@futdevpro/nts-dynamo 1.5.77 → 1.5.83
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/LICENSE +2 -2
- package/lib/_constants/dynamo-nts-global-settings.d.ts +2 -2
- package/lib/_constants/dynamo-nts-global-settings.js +17 -17
- package/lib/_constants/index.d.ts +1 -1
- package/lib/_constants/index.js +4 -4
- package/lib/_enums/data-model-type.enum.d.ts +12 -12
- package/lib/_enums/data-model-type.enum.js +16 -16
- package/lib/_enums/data-model-type.enum.js.map +1 -1
- package/lib/_enums/dynamo-nts-data-service-function.enum.d.ts +12 -12
- package/lib/_enums/dynamo-nts-data-service-function.enum.js +18 -18
- package/lib/_enums/dynamo-nts-data-service-function.enum.js.map +1 -1
- package/lib/_enums/dynamo-nts-route-security.enum.d.ts +11 -11
- package/lib/_enums/dynamo-nts-route-security.enum.js +15 -15
- package/lib/_enums/dynamo-nts-route-security.enum.js.map +1 -1
- package/lib/_enums/dynamo-nts-socket-security.enum.d.ts +10 -10
- package/lib/_enums/dynamo-nts-socket-security.enum.js +14 -14
- package/lib/_enums/dynamo-nts-socket-security.enum.js.map +1 -1
- package/lib/_enums/http/http-call-type.enum.d.ts +11 -11
- package/lib/_enums/http/http-call-type.enum.js +15 -15
- package/lib/_enums/http/http-call-type.enum.js.map +1 -1
- package/lib/_enums/http/http-response-type.enum.d.ts +6 -6
- package/lib/_enums/http/http-response-type.enum.js +10 -10
- package/lib/_enums/http/http-response-type.enum.js.map +1 -1
- package/lib/_enums/http/socket-event.enum.d.ts +9 -8
- package/lib/_enums/http/socket-event.enum.d.ts.map +1 -1
- package/lib/_enums/http/socket-event.enum.js +13 -12
- package/lib/_enums/http/socket-event.enum.js.map +1 -1
- package/lib/_enums/index.d.ts +8 -8
- package/lib/_enums/index.js +13 -13
- package/lib/_enums/predefined-data-types.enum.d.ts +10 -10
- package/lib/_enums/predefined-data-types.enum.js +14 -14
- package/lib/_enums/predefined-data-types.enum.js.map +1 -1
- package/lib/_interfaces/certification-settings.interface.d.ts +7 -0
- package/lib/_interfaces/certification-settings.interface.d.ts.map +1 -0
- package/lib/_interfaces/certification-settings.interface.js +3 -0
- package/lib/_interfaces/certification-settings.interface.js.map +1 -0
- package/lib/_interfaces/global-service-settings.interface.d.ts +18 -0
- package/lib/_interfaces/global-service-settings.interface.d.ts.map +1 -0
- package/lib/_interfaces/global-service-settings.interface.js +3 -0
- package/lib/_interfaces/global-service-settings.interface.js.map +1 -0
- package/lib/_interfaces/index.d.ts +1 -0
- package/lib/_interfaces/index.d.ts.map +1 -0
- package/lib/_interfaces/index.js +4 -0
- package/lib/_interfaces/index.js.map +1 -0
- package/lib/_interfaces/port-settings.interface.d.ts +5 -0
- package/lib/_interfaces/port-settings.interface.d.ts.map +1 -0
- package/lib/_interfaces/port-settings.interface.js +3 -0
- package/lib/_interfaces/port-settings.interface.js.map +1 -0
- package/lib/_models/dynamo-nts-api-call-params.d.ts +95 -95
- package/lib/_models/dynamo-nts-api-call-params.js +47 -47
- package/lib/_models/dynamo-nts-app-params.d.ts +49 -49
- package/lib/_models/dynamo-nts-app-params.js +17 -17
- package/lib/_models/dynamo-nts-endpoint-params.d.ts +80 -80
- package/lib/_models/dynamo-nts-endpoint-params.js +139 -139
- package/lib/_models/dynamo-nts-global-settings.d.ts +53 -53
- package/lib/_models/dynamo-nts-global-settings.js +2 -2
- package/lib/_models/dynamo-nts-routing-module-settings.d.ts +19 -19
- package/lib/_models/dynamo-nts-routing-module-settings.js +2 -2
- package/lib/_models/dynamo-nts-socket-event-params.d.ts +32 -30
- package/lib/_models/dynamo-nts-socket-event-params.d.ts.map +1 -1
- package/lib/_models/dynamo-nts-socket-event-params.js +80 -79
- package/lib/_models/dynamo-nts-socket-event-params.js.map +1 -1
- package/lib/_models/dynamo-nts-socket-presence.d.ts +21 -0
- package/lib/_models/dynamo-nts-socket-presence.d.ts.map +1 -0
- package/lib/_models/dynamo-nts-socket-presence.js +45 -0
- package/lib/_models/dynamo-nts-socket-presence.js.map +1 -0
- package/lib/_models/dynamo-nts-socket-service-params.d.ts +18 -18
- package/lib/_models/dynamo-nts-socket-service-params.d.ts.map +1 -1
- package/lib/_models/dynamo-nts-socket-service-params.js +26 -26
- package/lib/_models/dynamo-nts-socket-service-params.js.map +1 -1
- package/lib/_models/index.d.ts +7 -8
- package/lib/_models/index.d.ts.map +1 -1
- package/lib/_models/index.js +12 -12
- package/lib/_models/index.js.map +1 -1
- package/lib/_modules/api-service.index.d.ts +5 -5
- package/lib/_modules/api-service.index.js +11 -11
- package/lib/_modules/app-extended.index.d.ts +15 -12
- package/lib/_modules/app-extended.index.d.ts.map +1 -1
- package/lib/_modules/app-extended.index.js +23 -19
- package/lib/_modules/app-extended.index.js.map +1 -1
- package/lib/_modules/app.index.d.ts +13 -10
- package/lib/_modules/app.index.d.ts.map +1 -1
- package/lib/_modules/app.index.js +21 -17
- package/lib/_modules/app.index.js.map +1 -1
- package/lib/_modules/auth.index.d.ts +3 -3
- package/lib/_modules/auth.index.js +8 -8
- package/lib/_modules/constants.index.d.ts +1 -1
- package/lib/_modules/constants.index.js +4 -4
- package/lib/_modules/controller.index.d.ts +4 -4
- package/lib/_modules/controller.index.js +10 -10
- package/lib/_modules/custom-data/custom-data.controller.d.ts +5 -5
- package/lib/_modules/custom-data/custom-data.controller.js +55 -55
- package/lib/_modules/custom-data/custom-data.service.d.ts +5 -5
- package/lib/_modules/custom-data/custom-data.service.js +11 -11
- package/lib/_modules/custom-data/get-custom-data-routing-module.d.ts +3 -3
- package/lib/_modules/custom-data/get-custom-data-routing-module.js +17 -17
- package/lib/_modules/custom-data/index.d.ts +4 -4
- package/lib/_modules/custom-data/index.js +8 -8
- package/lib/_modules/custom-data-module.index.d.ts +1 -1
- package/lib/_modules/custom-data-module.index.js +4 -4
- package/lib/_modules/data-service.index.d.ts +5 -5
- package/lib/_modules/data-service.index.js +10 -10
- package/lib/_modules/email.index.d.ts +3 -3
- package/lib/_modules/email.index.js +8 -8
- package/lib/_modules/enums.index.d.ts +1 -1
- package/lib/_modules/enums.index.js +4 -4
- package/lib/_modules/models.index.d.ts +1 -1
- package/lib/_modules/models.index.js +4 -4
- package/lib/_modules/services.index.d.ts +1 -1
- package/lib/_modules/services.index.js +4 -4
- package/lib/_modules/test/get-test-routing-module.d.ts +3 -3
- package/lib/_modules/test/get-test-routing-module.js +17 -17
- package/lib/_modules/test/index.d.ts +3 -3
- package/lib/_modules/test/index.js +7 -7
- package/lib/_modules/test/test.controller.d.ts +5 -5
- package/lib/_modules/test/test.controller.js +104 -104
- package/lib/_modules/test-module.index.d.ts +1 -1
- package/lib/_modules/test-module.index.js +4 -4
- package/lib/_modules/usage/get-usage-routing-module.d.ts +3 -3
- package/lib/_modules/usage/get-usage-routing-module.js +17 -17
- package/lib/_modules/usage/index.d.ts +4 -4
- package/lib/_modules/usage/index.js +8 -8
- package/lib/_modules/usage/usage-controller.d.ts +6 -6
- package/lib/_modules/usage/usage-controller.js +88 -88
- package/lib/_modules/usage/usage.service.d.ts +16 -16
- package/lib/_modules/usage/usage.service.js +132 -132
- package/lib/_modules/usage-module.index.d.ts +1 -1
- package/lib/_modules/usage-module.index.js +4 -4
- package/lib/_services/dynamo-nts-api.service.d.ts +34 -34
- package/lib/_services/dynamo-nts-api.service.js +188 -188
- package/lib/_services/dynamo-nts-app-extended.d.ts +128 -128
- package/lib/_services/dynamo-nts-app-extended.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-app-extended.js +212 -212
- package/lib/_services/dynamo-nts-app-extended.js.map +1 -1
- package/lib/_services/dynamo-nts-app.d.ts +270 -278
- package/lib/_services/dynamo-nts-app.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-app.js +371 -371
- package/lib/_services/dynamo-nts-app.js.map +1 -1
- package/lib/_services/dynamo-nts-app.spec.d.ts +1 -0
- package/lib/_services/dynamo-nts-app.spec.d.ts.map +1 -0
- package/lib/_services/dynamo-nts-app.spec.js +10 -0
- package/lib/_services/dynamo-nts-app.spec.js.map +1 -0
- package/lib/_services/dynamo-nts-auth.service.d.ts +127 -127
- package/lib/_services/dynamo-nts-auth.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-auth.service.js +53 -53
- package/lib/_services/dynamo-nts-auth.service.js.map +1 -1
- package/lib/_services/dynamo-nts-controller.service.d.ts +105 -105
- package/lib/_services/dynamo-nts-controller.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-controller.service.js +57 -57
- package/lib/_services/dynamo-nts-controller.service.js.map +1 -1
- package/lib/_services/dynamo-nts-data.service.d.ts +230 -230
- package/lib/_services/dynamo-nts-data.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-data.service.js +689 -689
- package/lib/_services/dynamo-nts-data.service.js.map +1 -1
- package/lib/_services/dynamo-nts-db-service-collection.service.d.ts +8 -8
- package/lib/_services/dynamo-nts-db-service-collection.service.js +10 -10
- package/lib/_services/dynamo-nts-db.service.d.ts +386 -312
- package/lib/_services/dynamo-nts-db.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-db.service.js +856 -856
- package/lib/_services/dynamo-nts-db.service.js.map +1 -1
- package/lib/_services/dynamo-nts-email-service-collection.service.d.ts +18 -18
- package/lib/_services/dynamo-nts-email-service-collection.service.js +20 -20
- package/lib/_services/dynamo-nts-email.service.d.ts +56 -56
- package/lib/_services/dynamo-nts-email.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-email.service.js +203 -203
- package/lib/_services/dynamo-nts-email.service.js.map +1 -1
- package/lib/_services/dynamo-nts-global.service.d.ts +71 -84
- package/lib/_services/dynamo-nts-global.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-global.service.js +156 -156
- package/lib/_services/dynamo-nts-global.service.js.map +1 -1
- package/lib/_services/dynamo-nts-routing-module.service.d.ts +76 -76
- package/lib/_services/dynamo-nts-routing-module.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-routing-module.service.js +191 -191
- package/lib/_services/dynamo-nts-routing-module.service.js.map +1 -1
- package/lib/_services/dynamo-nts-shared.service.d.ts +31 -31
- package/lib/_services/dynamo-nts-shared.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-shared.service.js +70 -70
- package/lib/_services/dynamo-nts-shared.service.js.map +1 -1
- package/lib/_services/dynamo-nts-shared.service.spec.d.ts +2 -0
- package/lib/_services/dynamo-nts-shared.service.spec.d.ts.map +1 -0
- package/lib/_services/dynamo-nts-shared.service.spec.js +12 -0
- package/lib/_services/dynamo-nts-shared.service.spec.js.map +1 -0
- package/lib/_services/dynamo-nts-singleton.service.d.ts +8 -8
- package/lib/_services/dynamo-nts-singleton.service.js +18 -18
- package/lib/_services/dynamo-nts-singleton.service.js.map +1 -1
- package/lib/_services/dynamo-nts-socket-service-collection.service.d.ts +9 -9
- package/lib/_services/dynamo-nts-socket-service-collection.service.js +13 -13
- package/lib/_services/dynamo-nts-socket.service.d.ts +57 -45
- package/lib/_services/dynamo-nts-socket.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-socket.service.js +188 -165
- package/lib/_services/dynamo-nts-socket.service.js.map +1 -1
- package/lib/_services/index.d.ts +14 -16
- package/lib/_services/index.d.ts.map +1 -1
- package/lib/_services/index.js +20 -20
- package/lib/_services/index.js.map +1 -1
- package/lib/index.d.ts +6 -6
- package/lib/index.js +14 -14
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package SAVE.json +216 -0
- package/package-NEW with test but not working.json +228 -0
- package/package.json +14 -8
- package/spec/support/jasmine.json +14 -0
- package/src/_enums/http/socket-event.enum.ts +2 -1
- package/src/_interfaces/certification-settings.interface.ts +7 -0
- package/src/_interfaces/global-service-settings.interface.ts +23 -0
- package/src/_interfaces/index.ts +5 -0
- package/src/_interfaces/port-settings.interface.ts +5 -0
- package/src/_models/dynamo-nts-socket-event-params.ts +23 -21
- package/src/_models/{dynamo-nts-socket-dictionary.ts → dynamo-nts-socket-presence.ts} +21 -5
- package/src/_models/dynamo-nts-socket-service-params.ts +1 -0
- package/src/_models/index.ts +2 -2
- package/src/_modules/app-extended.index.ts +7 -2
- package/src/_modules/app.index.ts +5 -0
- package/src/_services/dynamo-nts-app-extended.ts +6 -2
- package/src/_services/dynamo-nts-app.spec.ts +14 -0
- package/src/_services/dynamo-nts-app.ts +8 -14
- package/src/_services/dynamo-nts-auth.service.ts +1 -0
- package/src/_services/dynamo-nts-controller.service.ts +2 -1
- package/src/_services/dynamo-nts-data.service.ts +19 -19
- package/src/_services/dynamo-nts-db.service.ts +195 -115
- package/src/_services/dynamo-nts-email.service.ts +1 -0
- package/src/_services/dynamo-nts-global.service.ts +3 -18
- package/src/_services/dynamo-nts-routing-module.service.ts +1 -0
- package/src/_services/dynamo-nts-shared.service.spec.ts +10 -0
- package/src/_services/dynamo-nts-shared.service.ts +2 -1
- package/src/_services/dynamo-nts-socket.service.ts +80 -41
- package/src/_services/index.ts +2 -2
|
@@ -5,26 +5,41 @@ import * as SocketIO from 'socket.io';
|
|
|
5
5
|
/**
|
|
6
6
|
* socket handling and clarification is under development
|
|
7
7
|
*/
|
|
8
|
-
export class
|
|
8
|
+
export class DynamoNTS_SocketPresence {
|
|
9
9
|
issuerId: string;
|
|
10
10
|
sockets: SocketIO.Socket[];
|
|
11
|
+
onDestroy: (issuerId: string) => void;
|
|
11
12
|
|
|
12
13
|
constructor(
|
|
13
|
-
set
|
|
14
|
+
set: {
|
|
14
15
|
issuerId: string,
|
|
15
16
|
sockets: SocketIO.Socket[],
|
|
17
|
+
onDestroy?: (issuerId: string) => void,
|
|
16
18
|
}
|
|
17
19
|
) {
|
|
18
|
-
|
|
19
|
-
if (!set.sockets.length) {
|
|
20
|
+
if (!set?.issuerId) {
|
|
20
21
|
throw new Dynamo_Error({
|
|
21
22
|
status: 406,
|
|
22
23
|
errorCode: 'NTS-SD0-C00',
|
|
23
24
|
addECToUserMsg: true,
|
|
24
|
-
message: 'trying to create
|
|
25
|
+
message: 'trying to create DynamoNTS_SocketPresence without a valid issuerId!',
|
|
26
|
+
userMessage: 'We encountered an unhandled Server Error, please contact the responsible development team.'
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
this.issuerId = set.issuerId;
|
|
31
|
+
this.onDestroy = set.onDestroy ?? (id => {});
|
|
32
|
+
|
|
33
|
+
if (!set?.sockets?.length) {
|
|
34
|
+
throw new Dynamo_Error({
|
|
35
|
+
status: 406,
|
|
36
|
+
errorCode: 'NTS-SD0-C01',
|
|
37
|
+
addECToUserMsg: true,
|
|
38
|
+
message: 'trying to create DynamoNTS_SocketPresence without a single active socket!',
|
|
25
39
|
userMessage: 'We encountered an unhandled Server Error, please contact the responsible development team.'
|
|
26
40
|
});
|
|
27
41
|
}
|
|
42
|
+
|
|
28
43
|
this.sockets = set.sockets;
|
|
29
44
|
}
|
|
30
45
|
|
|
@@ -38,5 +53,6 @@ export class DynamoNTS_SocketDictionary {
|
|
|
38
53
|
socket.emit(event, content);
|
|
39
54
|
});
|
|
40
55
|
}
|
|
56
|
+
|
|
41
57
|
}
|
|
42
58
|
|
|
@@ -30,6 +30,7 @@ export class DynamoNTS_SocketServiceParams {
|
|
|
30
30
|
|
|
31
31
|
if (set.getIdFromSubscrioption) {
|
|
32
32
|
this.getIdFromSubscrioption = set.getIdFromSubscrioption;
|
|
33
|
+
|
|
33
34
|
if (set.groupActiveSocketsBy) {
|
|
34
35
|
Dynamo_Log.error(
|
|
35
36
|
`setting groupActiveSocketsBy on DynamoNTS_SocketService (${this.name}) won't take effect, ` +
|
package/src/_models/index.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
// MODELS
|
|
4
4
|
export * from './dynamo-nts-api-call-params';
|
|
5
|
-
export * from './dynamo-nts-app-params';
|
|
5
|
+
//export * from './dynamo-nts-app-params';
|
|
6
6
|
export * from './dynamo-nts-endpoint-params';
|
|
7
7
|
export * from './dynamo-nts-global-settings';
|
|
8
8
|
export * from './dynamo-nts-routing-module-settings';
|
|
9
9
|
export * from './dynamo-nts-socket-event-params';
|
|
10
10
|
export * from './dynamo-nts-socket-service-params';
|
|
11
|
-
export * from './dynamo-nts-socket-
|
|
11
|
+
export * from './dynamo-nts-socket-presence';
|
|
12
12
|
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
|
|
2
2
|
// SERVICES
|
|
3
|
-
export * from '../_services/dynamo-nts-app';
|
|
4
3
|
export * from '../_services/dynamo-nts-app-extended';
|
|
5
4
|
export * from '../_services/dynamo-nts-global.service';
|
|
6
5
|
export * from '../_services/dynamo-nts-routing-module.service';
|
|
7
6
|
export * from '../_services/dynamo-nts-shared.service';
|
|
7
|
+
export * from '../_services/dynamo-nts-socket.service';
|
|
8
|
+
|
|
9
|
+
// INTERFACES
|
|
10
|
+
export * from '../_interfaces/global-service-settings.interface';
|
|
11
|
+
export * from '../_interfaces/port-settings.interface';
|
|
12
|
+
export * from '../_interfaces/certification-settings.interface';
|
|
8
13
|
|
|
9
14
|
// MODELS
|
|
10
15
|
export * from '../_models/dynamo-nts-app-params';
|
|
11
16
|
export * from '../_models/dynamo-nts-endpoint-params';
|
|
12
17
|
export * from '../_models/dynamo-nts-global-settings';
|
|
13
18
|
export * from '../_models/dynamo-nts-routing-module-settings';
|
|
14
|
-
export * from '../_models/dynamo-nts-socket-
|
|
19
|
+
export * from '../_models/dynamo-nts-socket-presence';
|
|
15
20
|
|
|
16
21
|
// ENUMS
|
|
17
22
|
export * from '../_enums/dynamo-nts-route-security.enum';
|
|
@@ -5,6 +5,11 @@ export * from '../_services/dynamo-nts-global.service';
|
|
|
5
5
|
export * from '../_services/dynamo-nts-routing-module.service';
|
|
6
6
|
export * from '../_services/dynamo-nts-shared.service';
|
|
7
7
|
|
|
8
|
+
// INTERFACES
|
|
9
|
+
export * from '../_interfaces/global-service-settings.interface';
|
|
10
|
+
export * from '../_interfaces/port-settings.interface';
|
|
11
|
+
export * from '../_interfaces/certification-settings.interface';
|
|
12
|
+
|
|
8
13
|
// MODELS
|
|
9
14
|
export * from '../_models/dynamo-nts-app-params';
|
|
10
15
|
export * from '../_models/dynamo-nts-endpoint-params';
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
import * as SocketIO from 'socket.io';
|
|
3
3
|
import * as Http from 'http';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Dynamo_Log } from '@futdevpro/fsm-dynamo';
|
|
6
|
+
|
|
6
7
|
import { DynamoNTS_App } from './dynamo-nts-app';
|
|
8
|
+
import { DynamoNTS_RouteSecurity } from '../_enums/dynamo-nts-route-security.enum';
|
|
7
9
|
import { DynamoNTS_SocketService } from './dynamo-nts-socket.service';
|
|
8
10
|
import { DynamoNTS_SocketSecurity } from '../_enums/dynamo-nts-socket-security.enum';
|
|
9
|
-
import { Dynamo_Log } from '@futdevpro/fsm-dynamo';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* This will be the MAIN service of our server project,
|
|
@@ -170,6 +171,7 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
|
|
|
170
171
|
}
|
|
171
172
|
httpSocketServer = Http.createServer(this.openExpress);
|
|
172
173
|
}
|
|
174
|
+
|
|
173
175
|
if (this.socketSecurity !== DynamoNTS_RouteSecurity.open) {
|
|
174
176
|
if (!this.httpsServer) {
|
|
175
177
|
if (this.cert) {
|
|
@@ -219,9 +221,11 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
|
|
|
219
221
|
if (service.security === DynamoNTS_SocketSecurity.open) {
|
|
220
222
|
if (this.debugLog) console.log(`\nsocket setup (open): ${service.name}:${service.port}`);
|
|
221
223
|
service.setupSocketServer(new SocketIO.Server(httpSocketServer));
|
|
224
|
+
|
|
222
225
|
} else if (service.security === DynamoNTS_SocketSecurity.secure) {
|
|
223
226
|
if (this.debugLog) console.log(`\nsocket setup (secure): ${service.name}:${service.port}`);
|
|
224
227
|
service.setupSocketServer(new SocketIO.Server(this.httpsServer));
|
|
228
|
+
|
|
225
229
|
} else {
|
|
226
230
|
let error = new Error(`INVALID Socket Service security: ${service.security} on ${service.name}`);
|
|
227
231
|
let errorStack: string[] = error.stack.split('\n');
|
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
|
|
2
|
-
import { DynamoNTS_AppParams } from '../_models/dynamo-nts-app-params';
|
|
3
2
|
import Mongoose = require("mongoose");
|
|
4
3
|
import Express = require("express");
|
|
5
4
|
import * as Https from 'https';
|
|
6
5
|
import * as FileSystem from 'fs';
|
|
7
6
|
import * as BodyParser from 'body-parser';
|
|
8
7
|
|
|
8
|
+
import { Dynamo_Log } from '@futdevpro/fsm-dynamo';
|
|
9
|
+
|
|
10
|
+
import { DynamoNTS_AppParams } from '../_models/dynamo-nts-app-params';
|
|
9
11
|
import { DynamoNTS_SingletonService } from './dynamo-nts-singleton.service';
|
|
10
12
|
import { DynamoNTS_RouteSecurity } from '../_enums/dynamo-nts-route-security.enum';
|
|
11
13
|
import { DynamoNTS_RoutingModule } from './dynamo-nts-routing-module.service';
|
|
12
14
|
import { DynamoNTS_EndpointParams } from '../_models/dynamo-nts-endpoint-params';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
keyPath: FileSystem.PathLike,
|
|
19
|
-
certPath: FileSystem.PathLike,
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface DynamoNTS_PortSettings {
|
|
23
|
-
httpPort?: number,
|
|
24
|
-
httpsPort?: number,
|
|
25
|
-
}
|
|
15
|
+
import { DynamoNTS_GlobalService } from './dynamo-nts-global.service';
|
|
16
|
+
import { DynamoNTS_PortSettings } from '../_interfaces/port-settings.interface';
|
|
17
|
+
import { DynamoNTS_CertificationSettings } from '../_interfaces/certification-settings.interface';
|
|
18
|
+
import { DynamoNTS_GlobalServiceSettings } from '../_interfaces/global-service-settings.interface';
|
|
19
|
+
import { dynamoNTS_GlobalSettings } from '../_constants/dynamo-nts-global-settings';
|
|
26
20
|
|
|
27
21
|
/**
|
|
28
22
|
* This will be the MAIN service of our server project,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
import { Dynamo_Log } from '@futdevpro/fsm-dynamo';
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
import { DynamoNTS_SingletonService } from './dynamo-nts-singleton.service';
|
|
6
|
+
import { DynamoNTS_EndpointParams } from '../_models/dynamo-nts-endpoint-params';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Basic controller for endpoint handlings
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { Dynamo_Metadata, Dynamo_DataParams, Dynamo_DataPropertyParams, Dynamo_Error, Dynamo_Log } from '@futdevpro/fsm-dynamo';
|
|
3
3
|
|
|
4
|
-
import { DynamoNTS_DBService } from './dynamo-nts-db.service';
|
|
4
|
+
import { DynamoNTS_DBFilter, DynamoNTS_DBService, DynamoNTS_DBUpdate } from './dynamo-nts-db.service';
|
|
5
5
|
import { DynamoNTS_GlobalService } from './dynamo-nts-global.service';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -117,7 +117,7 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
|
|
|
117
117
|
status: 417,
|
|
118
118
|
errorCode: 'NTS-DS0-GI1',
|
|
119
119
|
addECToUserMsg: true,
|
|
120
|
-
message: `ID is missing! (maybe you wanted to use getDataByDependencyId() instead...) (${this.dataParams.dataName})`,
|
|
120
|
+
message: `getDataById failed, ID is missing! (maybe you wanted to use getDataByDependencyId() instead...) (${this.dataParams.dataName})`,
|
|
121
121
|
userMessage: this.defaultErrorUserMsg
|
|
122
122
|
});
|
|
123
123
|
}
|
|
@@ -156,7 +156,7 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
|
|
|
156
156
|
status: 417,
|
|
157
157
|
errorCode: 'NTS-DS0-GD1',
|
|
158
158
|
addECToUserMsg: true,
|
|
159
|
-
message: `
|
|
159
|
+
message: `getDataByDependencyId failed, dependencyDataIdKey is missing from service! (${this.dataParams.dataName})`,
|
|
160
160
|
userMessage: this.defaultErrorUserMsg
|
|
161
161
|
});
|
|
162
162
|
}
|
|
@@ -166,14 +166,14 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
|
|
|
166
166
|
status: 417,
|
|
167
167
|
errorCode: 'NTS-DS0-GD2',
|
|
168
168
|
addECToUserMsg: true,
|
|
169
|
-
message:
|
|
169
|
+
message: `getDataByDependencyId failed, ${this.depKey} is missing! (${this.dataParams.dataName})`,
|
|
170
170
|
userMessage: this.defaultErrorUserMsg
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
const dataExists: T = await this.dataDBService.getDataByDependencyId(dependencyId ?? this.data[this.depKey]).catch(error => {
|
|
175
175
|
if (error?.errorCode === 'NTS-DBS-GD2') {
|
|
176
|
-
Dynamo_Log.warn(`getDataByDependencyId ${this.dataParams.dataName} (${this.depKey}: ${dependencyId ?? this.data[this.depKey]}) didn't found any.`);
|
|
176
|
+
Dynamo_Log.warn(`getDataByDependencyId failed; ${this.dataParams.dataName} (${this.depKey}: ${dependencyId ?? this.data[this.depKey]}) didn't found any.`);
|
|
177
177
|
return null;
|
|
178
178
|
} else {
|
|
179
179
|
throw error;
|
|
@@ -221,7 +221,7 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
|
|
|
221
221
|
status: 417,
|
|
222
222
|
errorCode: 'NTS-DS0-GLD2',
|
|
223
223
|
addECToUserMsg: true,
|
|
224
|
-
message:
|
|
224
|
+
message: `getDataListByDependencyId failed, ${this.depKey} is missing (${this.dataParams.dataName})`,
|
|
225
225
|
userMessage: this.defaultErrorUserMsg
|
|
226
226
|
});
|
|
227
227
|
}
|
|
@@ -285,9 +285,9 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
|
|
|
285
285
|
* //
|
|
286
286
|
* @returns {T} data: T
|
|
287
287
|
*/
|
|
288
|
-
async findData(
|
|
288
|
+
async findData(filterBy: DynamoNTS_DBFilter<T>, dontSetToService?: boolean): Promise<T> {
|
|
289
289
|
try {
|
|
290
|
-
const dataExists: T = await this.dataDBService.findOne(
|
|
290
|
+
const dataExists: T = await this.dataDBService.findOne(filterBy).catch(error => {
|
|
291
291
|
if (error?.errorCode === 'NTS-DBS-FO1') {
|
|
292
292
|
Dynamo_Log.warn(`findData ${this.dataParams.dataName} didn't found any.`);
|
|
293
293
|
return null;
|
|
@@ -342,9 +342,9 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
|
|
|
342
342
|
* //
|
|
343
343
|
* @returns {T[]} dataList: T[]
|
|
344
344
|
*/
|
|
345
|
-
async findDatas(
|
|
345
|
+
async findDatas(filterBy: DynamoNTS_DBFilter<T>, dontSetToService?: boolean): Promise<T[]> {
|
|
346
346
|
try {
|
|
347
|
-
const dataListExists: T[] = await this.dataDBService.find(
|
|
347
|
+
const dataListExists: T[] = await this.dataDBService.find(filterBy).catch(error => {
|
|
348
348
|
if (error?.errorCode === 'NTS-DBS-F1') {
|
|
349
349
|
Dynamo_Log.warn(`findDatas ${this.dataParams.dataName} didn't found any.`);
|
|
350
350
|
return [];
|
|
@@ -425,14 +425,14 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
|
|
|
425
425
|
* $unset: // Removes the specified field from a document. (set: "" to value)
|
|
426
426
|
* //
|
|
427
427
|
*/
|
|
428
|
-
async updateData(set: {
|
|
428
|
+
async updateData(set: { filterBy?: DynamoNTS_DBFilter<T>, update: DynamoNTS_DBUpdate<T> }): Promise<void> {
|
|
429
429
|
try {
|
|
430
|
-
if (set.
|
|
431
|
-
await this.dataDBService.updateOne(set.
|
|
430
|
+
if (set.filterBy) {
|
|
431
|
+
await this.dataDBService.updateOne(set.filterBy, set.update, this.issuer);
|
|
432
432
|
} else if (this.data._id) {
|
|
433
|
-
await this.dataDBService.updateOne({ _id: this.data._id }
|
|
433
|
+
await this.dataDBService.updateOne({ _id: this.data._id } as DynamoNTS_DBFilter<T>, set.update, this.issuer);
|
|
434
434
|
} else if (this.depKey && this.data[this.depKey]) {
|
|
435
|
-
await this.dataDBService.updateOne({ [this.depKey]: this.data[this.depKey] }
|
|
435
|
+
await this.dataDBService.updateOne({ [this.depKey]: this.data[this.depKey] } as DynamoNTS_DBFilter<T>, set.update, this.issuer);
|
|
436
436
|
} else {
|
|
437
437
|
throw new Dynamo_Error({
|
|
438
438
|
status: 417,
|
|
@@ -552,7 +552,7 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
|
|
|
552
552
|
status: 417,
|
|
553
553
|
errorCode: 'NTS-DS0-SD0',
|
|
554
554
|
addECToUserMsg: true,
|
|
555
|
-
message: `
|
|
555
|
+
message: `saveData was unsuccessful (${this.dataParams.dataName})`,
|
|
556
556
|
userMessage: this.defaultErrorUserMsg,
|
|
557
557
|
error: error
|
|
558
558
|
});
|
|
@@ -570,7 +570,7 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
|
|
|
570
570
|
status: 417,
|
|
571
571
|
errorCode: 'NTS-DS0-DD1',
|
|
572
572
|
addECToUserMsg: true,
|
|
573
|
-
message: `ID is missing! (${this.dataParams.dataName})` ,
|
|
573
|
+
message: `deleteData failed, ID is missing! (${this.dataParams.dataName})` ,
|
|
574
574
|
userMessage: this.defaultErrorUserMsg,
|
|
575
575
|
});
|
|
576
576
|
}
|
|
@@ -614,7 +614,7 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
|
|
|
614
614
|
status: 422,
|
|
615
615
|
errorCode: 'NTS-DS0-VD1',
|
|
616
616
|
addECToUserMsg: true,
|
|
617
|
-
message:
|
|
617
|
+
message: `validateForSave failed, ${this.dataParams.modelParams[i].key} is missing! (${this.dataParams.modelParams[i].required ? 'required' : 'index'}) (${this.dataParams.dataName})`,
|
|
618
618
|
userMessage: this.defaultValidationErrorUserMsg
|
|
619
619
|
});
|
|
620
620
|
}
|
|
@@ -627,7 +627,7 @@ export class DynamoNTS_DataService<T extends Dynamo_Metadata> {
|
|
|
627
627
|
status: 422,
|
|
628
628
|
errorCode: 'NTS-DS0-VD2',
|
|
629
629
|
addECToUserMsg: true,
|
|
630
|
-
message:
|
|
630
|
+
message: `validateForSave failed, ${this.dataParams.modelParams[i].key} is not a date! (${this.dataParams.dataName})`,
|
|
631
631
|
userMessage: this.defaultValidationErrorUserMsg
|
|
632
632
|
});
|
|
633
633
|
}
|