-
Notifications
You must be signed in to change notification settings - Fork 0
/
Local.mjs
52 lines (50 loc) · 1.35 KB
/
Local.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
* Local configuration DTO defines data structure being stored in './etc/local.json' for this plugin.
* @see TeqFw_Core_Back_Config
*/
// MODULE'S VARS
const NS = 'TeqFw_Core_Back_Plugin_Dto_Config_Local';
// MODULE'S CLASSES
/**
* @memberOf TeqFw_Core_Back_Plugin_Dto_Config_Local
*/
class Dto {
static namespace = NS;
/**
* 'true' - application is in development mode.
* @type {boolean}
*/
devMode;
/**
* Backend instance identifier. Random ID will be generated if omitted.
* @type {string}
*/
uuid;
}
/**
* @implements TeqFw_Core_Shared_Api_Factory_Dto
*/
export default class TeqFw_Core_Back_Plugin_Dto_Config_Local {
/**
* @param {TeqFw_Core_Shared_Util_Cast} cast
*/
constructor(
{
TeqFw_Core_Shared_Util_Cast$: cast,
}
) {
// INSTANCE METHODS
/**
* @param {TeqFw_Core_Back_Plugin_Dto_Config_Local.Dto} [data]
* @return {TeqFw_Core_Back_Plugin_Dto_Config_Local.Dto}
*/
this.createDto = function (data) {
// create new DTO and populate it with initialization data
const res = Object.assign(new Dto(), data);
// util.cast known attributes
res.devMode = cast.boolean(data?.devMode);
res.uuid = cast.string(data?.uuid);
return res;
};
}
}