Adds Event system and automatic messages
This commit is contained in:
parent
0e10ea3cab
commit
2f826fbf36
20 changed files with 428 additions and 18 deletions
|
|
@ -6,11 +6,15 @@ import {GroupConfigurationResult, GroupConfigurationTransformers} from "./GroupC
|
|||
import setPath from 'object-path-set';
|
||||
import deepmerge from "deepmerge";
|
||||
import {Nullable} from "../types/Nullable";
|
||||
import {isPlainObject} from "is-plain-object";
|
||||
|
||||
export class GroupConfigurationHandler {
|
||||
private static DEFAULT_CONFIGURATION: RuntimeGroupConfiguration = {
|
||||
channels: null,
|
||||
locale: new Intl.Locale('en-GB'),
|
||||
permissions: {
|
||||
allowMemberManagingPlaydates: false
|
||||
}
|
||||
}
|
||||
|
||||
private readonly transformers: GroupConfigurationTransformers = new GroupConfigurationTransformers();
|
||||
|
|
@ -42,7 +46,9 @@ export class GroupConfigurationHandler {
|
|||
}
|
||||
|
||||
public getConfiguration(): RuntimeGroupConfiguration {
|
||||
return deepmerge(GroupConfigurationHandler.DEFAULT_CONFIGURATION, this.getDatabaseConfiguration());
|
||||
return deepmerge(GroupConfigurationHandler.DEFAULT_CONFIGURATION, this.getDatabaseConfiguration(), {
|
||||
isMergeableObject: isPlainObject
|
||||
});
|
||||
}
|
||||
|
||||
public getConfigurationByPath(path: string): Nullable<GroupConfigurationResult> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue