@futdevpro/nts-dynamo 1.9.15 → 1.9.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.copilot/patterns.json +7 -7
- package/.github/workflows/main.yml +206 -0
- package/HOWTO.md +15 -15
- package/README.md +140 -140
- package/build/_models/control-models/endpoint-params.control-model.d.ts.map +1 -1
- package/build/_models/control-models/endpoint-params.control-model.js +2 -0
- package/build/_models/control-models/endpoint-params.control-model.js.map +1 -1
- package/build/_models/control-models/socket-event.control-model.js +1 -1
- package/build/_services/core/global.service.d.ts.map +1 -1
- package/build/_services/core/global.service.js +1 -0
- package/build/_services/core/global.service.js.map +1 -1
- package/build/_services/route/routing-module.service.d.ts +1 -0
- package/build/_services/route/routing-module.service.d.ts.map +1 -1
- package/build/_services/route/routing-module.service.js +17 -23
- package/build/_services/route/routing-module.service.js.map +1 -1
- package/build/_services/server/app.server.d.ts.map +1 -1
- package/build/_services/server/app.server.js +4 -1
- package/build/_services/server/app.server.js.map +1 -1
- package/build/_services/socket/socket-client.service.d.ts.map +1 -1
- package/build/_services/socket/socket-client.service.js +1 -0
- package/build/_services/socket/socket-client.service.js.map +1 -1
- package/nodemon.json +17 -15
- package/package.json +5 -5
- package/src/_constants/global-settings.const.ts +27 -27
- package/src/_constants/index.ts +2 -2
- package/src/_constants/mocks/app-extended-server.mock.ts +198 -198
- package/src/_constants/mocks/app-params.mock.ts +9 -9
- package/src/_constants/mocks/app-server.mock.ts +185 -185
- package/src/_constants/mocks/auth-service.mock.ts +28 -28
- package/src/_constants/mocks/controller.mock.ts +16 -16
- package/src/_constants/mocks/data-model.mock.ts +83 -83
- package/src/_constants/mocks/email-service-collection.mock.ts +13 -13
- package/src/_constants/mocks/email-service.mock.ts +19 -19
- package/src/_constants/mocks/email-template.mock.html +14 -14
- package/src/_constants/mocks/endpoint.mock.ts +90 -90
- package/src/_constants/mocks/socket-client.mock.ts +43 -43
- package/src/_constants/mocks/socket-server.mock.ts +43 -43
- package/src/_enums/data-model-type.enum.ts +14 -14
- package/src/_enums/data-service-function.enum.ts +15 -15
- package/src/_enums/http/http-call-type.enum.ts +12 -12
- package/src/_enums/http/http-response-type.enum.ts +7 -7
- package/src/_enums/http/socket-event-type.enum.ts +18 -18
- package/src/_enums/index.ts +13 -13
- package/src/_enums/predefined-data-types.enum.ts +27 -27
- package/src/_enums/route-security.enum.ts +12 -12
- package/src/_enums/socket-security.enum.ts +11 -11
- package/src/_models/control-models/api-call-params.control-model.ts +126 -126
- package/src/_models/control-models/app-ext-system-controls.control-model.ts +9 -9
- package/src/_models/control-models/app-params.control-model.ts +45 -45
- package/src/_models/control-models/app-system-controls.control-model.ts +9 -9
- package/src/_models/control-models/endpoint-params.control-model.ts +309 -307
- package/src/_models/control-models/http-settings.control-model.ts +29 -29
- package/src/_models/control-models/index.ts +13 -13
- package/src/_models/control-models/socket-client-service-params.control-model.ts +28 -28
- package/src/_models/control-models/socket-event.control-model.ts +150 -150
- package/src/_models/control-models/socket-presence.control-model.ts +207 -207
- package/src/_models/control-models/socket-server-service-params.control-model.ts +20 -20
- package/src/_models/control-models/system-control.control-model.ts +12 -12
- package/src/_models/index.ts +9 -9
- package/src/_models/interfaces/certification-settings.interface.ts +7 -7
- package/src/_models/interfaces/global-service-settings.interface.ts +45 -45
- package/src/_models/interfaces/global-settings.interface.ts +83 -83
- package/src/_models/interfaces/index.ts +7 -7
- package/src/_models/interfaces/routing-module-settings.interface.ts +20 -20
- package/src/_models/types/db-filter.type.ts +108 -108
- package/src/_models/types/db-update.type.ts +100 -100
- package/src/_models/types/index.ts +5 -5
- package/src/_modules/api-service.index.ts +12 -12
- package/src/_modules/app-extended.index.ts +28 -28
- package/src/_modules/app.index.ts +24 -24
- package/src/_modules/auth.index.ts +7 -7
- package/src/_modules/constants.index.ts +2 -2
- package/src/_modules/controller.index.ts +10 -10
- package/src/_modules/custom-data/custom-data.controller.ts +69 -69
- package/src/_modules/custom-data/custom-data.data-service.ts +20 -20
- package/src/_modules/custom-data/get-custom-data-routing-module.util.ts +23 -23
- package/src/_modules/custom-data/index.ts +6 -6
- package/src/_modules/custom-data-module.index.ts +2 -2
- package/src/_modules/data-service.index.ts +9 -9
- package/src/_modules/email.index.ts +8 -8
- package/src/_modules/enums.index.ts +2 -2
- package/src/_modules/extended.index.ts +8 -8
- package/src/_modules/models.index.ts +2 -2
- package/src/_modules/services.index.ts +2 -2
- package/src/_modules/test/get-test-routing-module.util.ts +23 -23
- package/src/_modules/test/index.ts +5 -5
- package/src/_modules/test/test.controller.ts +115 -115
- package/src/_modules/test-module.index.ts +2 -2
- package/src/_modules/usage/get-usage-routing-module.util.ts +22 -22
- package/src/_modules/usage/index.ts +7 -7
- package/src/_modules/usage/usage.controller.ts +120 -120
- package/src/_modules/usage/usage.data-service.ts +172 -172
- package/src/_modules/usage-module.index.ts +2 -2
- package/src/_services/base/data.service.ts +921 -921
- package/src/_services/base/db.service.spec.ts +32 -32
- package/src/_services/base/db.service.ts +1063 -1063
- package/src/_services/base/singleton.service.ts +21 -21
- package/src/_services/core/api.service.ts +453 -453
- package/src/_services/core/auth.service.ts +172 -172
- package/src/_services/core/email.service.ts +678 -678
- package/src/_services/core/global.service.ts +270 -269
- package/src/_services/core/service-collection.service.ts +5 -5
- package/src/_services/index.ts +23 -23
- package/src/_services/route/controller.service.ts +129 -129
- package/src/_services/route/routing-module.service.ts +293 -273
- package/src/_services/server/app-extended.server.spec.ts +76 -76
- package/src/_services/server/app-extended.server.ts +520 -520
- package/src/_services/server/app.server.spec.ts +67 -67
- package/src/_services/server/app.server.ts +1181 -1179
- package/src/_services/shared.service.spec.ts +19 -19
- package/src/_services/shared.static-service.ts +73 -73
- package/src/_services/socket/socket-client.service.ts +236 -235
- package/src/_services/socket/socket-server.service.spec.ts +11 -11
- package/src/_services/socket/socket-server.service.ts +761 -761
- package/src/index.ts +18 -18
- package/tsconfig.json +41 -41
- package/build/tsconfig.tsbuildinfo +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* security settings for API,
|
|
4
|
-
* different security paths will need different handlers
|
|
5
|
-
*
|
|
6
|
-
* open; http, secure; https or both,
|
|
7
|
-
*/
|
|
8
|
-
export enum DynamoNTS_RouteSecurity {
|
|
9
|
-
open = 'open',
|
|
10
|
-
secure = 'secure',
|
|
11
|
-
both = 'both',
|
|
12
|
-
}
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* security settings for API,
|
|
4
|
+
* different security paths will need different handlers
|
|
5
|
+
*
|
|
6
|
+
* open; http, secure; https or both,
|
|
7
|
+
*/
|
|
8
|
+
export enum DynamoNTS_RouteSecurity {
|
|
9
|
+
open = 'open',
|
|
10
|
+
secure = 'secure',
|
|
11
|
+
both = 'both',
|
|
12
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* security settings for API,
|
|
4
|
-
* different security paths will need different handlers
|
|
5
|
-
*
|
|
6
|
-
* open; http or secure; https
|
|
7
|
-
*/
|
|
8
|
-
export enum DynamoNTS_SocketSecurity {
|
|
9
|
-
open = 'open',
|
|
10
|
-
secure = 'secure',
|
|
11
|
-
}
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* security settings for API,
|
|
4
|
+
* different security paths will need different handlers
|
|
5
|
+
*
|
|
6
|
+
* open; http or secure; https
|
|
7
|
+
*/
|
|
8
|
+
export enum DynamoNTS_SocketSecurity {
|
|
9
|
+
open = 'open',
|
|
10
|
+
secure = 'secure',
|
|
11
|
+
}
|
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
|
|
2
|
-
import { DynamoFM_Log } from '@futdevpro/fsm-dynamo';
|
|
3
|
-
import { DynamoNTS_HttpCallType } from '../../_enums/http/http-call-type.enum';
|
|
4
|
-
import { DynamoNTS_HttpResponseType } from '../../_enums/http/http-response-type.enum';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* API call params,
|
|
8
|
-
* such as
|
|
9
|
-
* type (HttpCallType),
|
|
10
|
-
* endpoint,
|
|
11
|
-
* and other options as httpOptions
|
|
12
|
-
*/
|
|
13
|
-
export class DynamoNTS_ApiCall_Params {
|
|
14
|
-
/**
|
|
15
|
-
* name the call to be able to identify it when debugging
|
|
16
|
-
*/
|
|
17
|
-
name: string;
|
|
18
|
-
/**
|
|
19
|
-
* type of the call as; HttpCallType .get, .post, ...ect
|
|
20
|
-
*/
|
|
21
|
-
type: DynamoNTS_HttpCallType;
|
|
22
|
-
/**
|
|
23
|
-
* the endpoint of the API, without the baseUrl:
|
|
24
|
-
* '/user/get/:userId',
|
|
25
|
-
* where the parts starting with ':', will be used as pathParam
|
|
26
|
-
*/
|
|
27
|
-
baseUrl: string;
|
|
28
|
-
/**
|
|
29
|
-
* baseUrl of the API;
|
|
30
|
-
* 'https://futdevpro.hu/api'
|
|
31
|
-
*/
|
|
32
|
-
endPoint: string;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* if this value is true, the call will return the full HTTP call response in raw
|
|
36
|
-
*/
|
|
37
|
-
getFullResponse: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* this setting will be passed to the axios http call
|
|
40
|
-
*/
|
|
41
|
-
httpOptions: any;
|
|
42
|
-
|
|
43
|
-
constructor(
|
|
44
|
-
/**
|
|
45
|
-
* set of options necessary for setting up an API call
|
|
46
|
-
*/
|
|
47
|
-
set: {
|
|
48
|
-
/**
|
|
49
|
-
* name the call to be able to identify it when debugging
|
|
50
|
-
*/
|
|
51
|
-
name: string,
|
|
52
|
-
/**
|
|
53
|
-
* set type as; HttpCallType .get, .post, ...ect
|
|
54
|
-
*/
|
|
55
|
-
type: DynamoNTS_HttpCallType,
|
|
56
|
-
/**
|
|
57
|
-
* the endpoint of the API, without the baseUrl:
|
|
58
|
-
* '/user/get/:userId',
|
|
59
|
-
* where the parts starting with ':', will be used as pathParam
|
|
60
|
-
*/
|
|
61
|
-
endPoint: string,
|
|
62
|
-
/**
|
|
63
|
-
* baseUrl of the API;
|
|
64
|
-
* 'https://futdevpro.hu/api'
|
|
65
|
-
*/
|
|
66
|
-
baseUrl: string,
|
|
67
|
-
/**
|
|
68
|
-
* setting this value to true, will return the full HTTP call response in raw
|
|
69
|
-
*/
|
|
70
|
-
getFullResponse?: boolean,
|
|
71
|
-
/**
|
|
72
|
-
* this setting will pass any kind of http setting used by the axios http messaging package
|
|
73
|
-
*/
|
|
74
|
-
httpOptions?: DynamoNTS_HttpOptions,
|
|
75
|
-
}
|
|
76
|
-
) {
|
|
77
|
-
this.name = set.name;
|
|
78
|
-
this.type = set.type;
|
|
79
|
-
|
|
80
|
-
if (set.endPoint.includes('{')) {
|
|
81
|
-
DynamoFM_Log.warn(
|
|
82
|
-
`using {param} bracets in endpoint definitions will be deprecated... (${set.endPoint})` +
|
|
83
|
-
'use :param instead ({pathparam} --> :pathparam)'
|
|
84
|
-
);
|
|
85
|
-
set.endPoint.replace(/{/g, ':').replace(/}/g, '');
|
|
86
|
-
}
|
|
87
|
-
this.endPoint = set.endPoint;
|
|
88
|
-
this.baseUrl = set.baseUrl;
|
|
89
|
-
this.getFullResponse = !!set.getFullResponse;
|
|
90
|
-
this.httpOptions = set.httpOptions ? set.httpOptions : {};
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* basic axios HttpsOptions,
|
|
96
|
-
*
|
|
97
|
-
* learn more on axios package....
|
|
98
|
-
* TOD: link package documentations
|
|
99
|
-
*/
|
|
100
|
-
export class DynamoNTS_HttpOptions {
|
|
101
|
-
responseType?: DynamoNTS_HttpResponseType;
|
|
102
|
-
headers?: {
|
|
103
|
-
[header: string]: string | string[];
|
|
104
|
-
};
|
|
105
|
-
observe?: 'body';
|
|
106
|
-
reportProgress?: boolean;
|
|
107
|
-
withCredentials?: boolean;
|
|
108
|
-
|
|
109
|
-
constructor(
|
|
110
|
-
set: {
|
|
111
|
-
responseType?: DynamoNTS_HttpResponseType,
|
|
112
|
-
headers?: {
|
|
113
|
-
[header: string]: string | string[];
|
|
114
|
-
},
|
|
115
|
-
observe?: 'body',
|
|
116
|
-
reportProgress?: boolean,
|
|
117
|
-
withCredentials?: boolean
|
|
118
|
-
}
|
|
119
|
-
) {
|
|
120
|
-
this.responseType = set.responseType;
|
|
121
|
-
this.headers = set.headers;
|
|
122
|
-
this.observe = set.observe;
|
|
123
|
-
this.reportProgress = set.reportProgress;
|
|
124
|
-
this.withCredentials = set.withCredentials;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
1
|
+
|
|
2
|
+
import { DynamoFM_Log } from '@futdevpro/fsm-dynamo';
|
|
3
|
+
import { DynamoNTS_HttpCallType } from '../../_enums/http/http-call-type.enum';
|
|
4
|
+
import { DynamoNTS_HttpResponseType } from '../../_enums/http/http-response-type.enum';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* API call params,
|
|
8
|
+
* such as
|
|
9
|
+
* type (HttpCallType),
|
|
10
|
+
* endpoint,
|
|
11
|
+
* and other options as httpOptions
|
|
12
|
+
*/
|
|
13
|
+
export class DynamoNTS_ApiCall_Params {
|
|
14
|
+
/**
|
|
15
|
+
* name the call to be able to identify it when debugging
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
/**
|
|
19
|
+
* type of the call as; HttpCallType .get, .post, ...ect
|
|
20
|
+
*/
|
|
21
|
+
type: DynamoNTS_HttpCallType;
|
|
22
|
+
/**
|
|
23
|
+
* the endpoint of the API, without the baseUrl:
|
|
24
|
+
* '/user/get/:userId',
|
|
25
|
+
* where the parts starting with ':', will be used as pathParam
|
|
26
|
+
*/
|
|
27
|
+
baseUrl: string;
|
|
28
|
+
/**
|
|
29
|
+
* baseUrl of the API;
|
|
30
|
+
* 'https://futdevpro.hu/api'
|
|
31
|
+
*/
|
|
32
|
+
endPoint: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* if this value is true, the call will return the full HTTP call response in raw
|
|
36
|
+
*/
|
|
37
|
+
getFullResponse: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* this setting will be passed to the axios http call
|
|
40
|
+
*/
|
|
41
|
+
httpOptions: any;
|
|
42
|
+
|
|
43
|
+
constructor(
|
|
44
|
+
/**
|
|
45
|
+
* set of options necessary for setting up an API call
|
|
46
|
+
*/
|
|
47
|
+
set: {
|
|
48
|
+
/**
|
|
49
|
+
* name the call to be able to identify it when debugging
|
|
50
|
+
*/
|
|
51
|
+
name: string,
|
|
52
|
+
/**
|
|
53
|
+
* set type as; HttpCallType .get, .post, ...ect
|
|
54
|
+
*/
|
|
55
|
+
type: DynamoNTS_HttpCallType,
|
|
56
|
+
/**
|
|
57
|
+
* the endpoint of the API, without the baseUrl:
|
|
58
|
+
* '/user/get/:userId',
|
|
59
|
+
* where the parts starting with ':', will be used as pathParam
|
|
60
|
+
*/
|
|
61
|
+
endPoint: string,
|
|
62
|
+
/**
|
|
63
|
+
* baseUrl of the API;
|
|
64
|
+
* 'https://futdevpro.hu/api'
|
|
65
|
+
*/
|
|
66
|
+
baseUrl: string,
|
|
67
|
+
/**
|
|
68
|
+
* setting this value to true, will return the full HTTP call response in raw
|
|
69
|
+
*/
|
|
70
|
+
getFullResponse?: boolean,
|
|
71
|
+
/**
|
|
72
|
+
* this setting will pass any kind of http setting used by the axios http messaging package
|
|
73
|
+
*/
|
|
74
|
+
httpOptions?: DynamoNTS_HttpOptions,
|
|
75
|
+
}
|
|
76
|
+
) {
|
|
77
|
+
this.name = set.name;
|
|
78
|
+
this.type = set.type;
|
|
79
|
+
|
|
80
|
+
if (set.endPoint.includes('{')) {
|
|
81
|
+
DynamoFM_Log.warn(
|
|
82
|
+
`using {param} bracets in endpoint definitions will be deprecated... (${set.endPoint})` +
|
|
83
|
+
'use :param instead ({pathparam} --> :pathparam)'
|
|
84
|
+
);
|
|
85
|
+
set.endPoint.replace(/{/g, ':').replace(/}/g, '');
|
|
86
|
+
}
|
|
87
|
+
this.endPoint = set.endPoint;
|
|
88
|
+
this.baseUrl = set.baseUrl;
|
|
89
|
+
this.getFullResponse = !!set.getFullResponse;
|
|
90
|
+
this.httpOptions = set.httpOptions ? set.httpOptions : {};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* basic axios HttpsOptions,
|
|
96
|
+
*
|
|
97
|
+
* learn more on axios package....
|
|
98
|
+
* TOD: link package documentations
|
|
99
|
+
*/
|
|
100
|
+
export class DynamoNTS_HttpOptions {
|
|
101
|
+
responseType?: DynamoNTS_HttpResponseType;
|
|
102
|
+
headers?: {
|
|
103
|
+
[header: string]: string | string[];
|
|
104
|
+
};
|
|
105
|
+
observe?: 'body';
|
|
106
|
+
reportProgress?: boolean;
|
|
107
|
+
withCredentials?: boolean;
|
|
108
|
+
|
|
109
|
+
constructor(
|
|
110
|
+
set: {
|
|
111
|
+
responseType?: DynamoNTS_HttpResponseType,
|
|
112
|
+
headers?: {
|
|
113
|
+
[header: string]: string | string[];
|
|
114
|
+
},
|
|
115
|
+
observe?: 'body',
|
|
116
|
+
reportProgress?: boolean,
|
|
117
|
+
withCredentials?: boolean
|
|
118
|
+
}
|
|
119
|
+
) {
|
|
120
|
+
this.responseType = set.responseType;
|
|
121
|
+
this.headers = set.headers;
|
|
122
|
+
this.observe = set.observe;
|
|
123
|
+
this.reportProgress = set.reportProgress;
|
|
124
|
+
this.withCredentials = set.withCredentials;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { DynamoNTS_SystemControl } from './system-control.control-model';
|
|
4
|
-
|
|
5
|
-
export class DynamoNTS_AppExtSysControls {
|
|
6
|
-
appExtended: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
|
|
7
|
-
httpSocketServer: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
|
|
8
|
-
httpsSocketServer: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
|
|
9
|
-
}
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import { DynamoNTS_SystemControl } from './system-control.control-model';
|
|
4
|
+
|
|
5
|
+
export class DynamoNTS_AppExtSysControls {
|
|
6
|
+
appExtended: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
|
|
7
|
+
httpSocketServer: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
|
|
8
|
+
httpsSocketServer: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
|
|
9
|
+
}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This will hold and set the basic settings of an application
|
|
4
|
-
*/
|
|
5
|
-
export class DynamoNTS_App_Params {
|
|
6
|
-
/**
|
|
7
|
-
* name of the application
|
|
8
|
-
*/
|
|
9
|
-
name: string;
|
|
10
|
-
/**
|
|
11
|
-
* title will be shown on the start of the application
|
|
12
|
-
*/
|
|
13
|
-
title?: string;
|
|
14
|
-
/**
|
|
15
|
-
* version of the application
|
|
16
|
-
* you should set the version,
|
|
17
|
-
* probably, you should set from the package.json as follows:
|
|
18
|
-
* import { version } from '../package.json';
|
|
19
|
-
*/
|
|
20
|
-
version: string;
|
|
21
|
-
/**
|
|
22
|
-
* name of your MongoDB table
|
|
23
|
-
* by default, its: `mongodb://localhost:27017/${this.dbName}`
|
|
24
|
-
*/
|
|
25
|
-
dbUri?: string;
|
|
26
|
-
/**
|
|
27
|
-
* name of your MongoDB table
|
|
28
|
-
*/
|
|
29
|
-
dbName: string;
|
|
30
|
-
/**
|
|
31
|
-
* name of the system, by default, its: this.name.replace(' ', '-')
|
|
32
|
-
*/
|
|
33
|
-
systemName?: string;
|
|
34
|
-
|
|
35
|
-
constructor(
|
|
36
|
-
set: DynamoNTS_App_Params
|
|
37
|
-
) {
|
|
38
|
-
this.name = set.name;
|
|
39
|
-
this.title = set.title ?? '';
|
|
40
|
-
this.version = set.version;
|
|
41
|
-
this.dbName = set.dbName;
|
|
42
|
-
this.dbUri = set.dbUri ?? `mongodb://localhost:27017/${this.dbName}`;
|
|
43
|
-
this.systemName = set.systemName ?? this.name.replace(' ', '-');
|
|
44
|
-
}
|
|
45
|
-
}
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This will hold and set the basic settings of an application
|
|
4
|
+
*/
|
|
5
|
+
export class DynamoNTS_App_Params {
|
|
6
|
+
/**
|
|
7
|
+
* name of the application
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* title will be shown on the start of the application
|
|
12
|
+
*/
|
|
13
|
+
title?: string;
|
|
14
|
+
/**
|
|
15
|
+
* version of the application
|
|
16
|
+
* you should set the version,
|
|
17
|
+
* probably, you should set from the package.json as follows:
|
|
18
|
+
* import { version } from '../package.json';
|
|
19
|
+
*/
|
|
20
|
+
version: string;
|
|
21
|
+
/**
|
|
22
|
+
* name of your MongoDB table
|
|
23
|
+
* by default, its: `mongodb://localhost:27017/${this.dbName}`
|
|
24
|
+
*/
|
|
25
|
+
dbUri?: string;
|
|
26
|
+
/**
|
|
27
|
+
* name of your MongoDB table
|
|
28
|
+
*/
|
|
29
|
+
dbName: string;
|
|
30
|
+
/**
|
|
31
|
+
* name of the system, by default, its: this.name.replace(' ', '-')
|
|
32
|
+
*/
|
|
33
|
+
systemName?: string;
|
|
34
|
+
|
|
35
|
+
constructor(
|
|
36
|
+
set: DynamoNTS_App_Params
|
|
37
|
+
) {
|
|
38
|
+
this.name = set.name;
|
|
39
|
+
this.title = set.title ?? '';
|
|
40
|
+
this.version = set.version;
|
|
41
|
+
this.dbName = set.dbName;
|
|
42
|
+
this.dbUri = set.dbUri ?? `mongodb://localhost:27017/${this.dbName}`;
|
|
43
|
+
this.systemName = set.systemName ?? this.name.replace(' ', '-');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import { DynamoNTS_SystemControl } from './system-control.control-model';
|
|
3
|
-
|
|
4
|
-
export class DynamoNTS_AppSystemControls {
|
|
5
|
-
app: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
|
|
6
|
-
mongoose: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
|
|
7
|
-
httpServer: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
|
|
8
|
-
httpsServer: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
|
|
9
|
-
}
|
|
1
|
+
|
|
2
|
+
import { DynamoNTS_SystemControl } from './system-control.control-model';
|
|
3
|
+
|
|
4
|
+
export class DynamoNTS_AppSystemControls {
|
|
5
|
+
app: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
|
|
6
|
+
mongoose: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
|
|
7
|
+
httpServer: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
|
|
8
|
+
httpsServer: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
|
|
9
|
+
}
|