@futdevpro/nts-dynamo 1.7.28 → 1.8.5
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/lib/_constants/global-settings.const.d.ts +2 -2
- package/lib/_constants/global-settings.const.d.ts.map +1 -1
- package/lib/_constants/global-settings.const.js +2 -2
- package/lib/_constants/global-settings.const.js.map +1 -1
- package/lib/_constants/mocks/app-extended-server.mock.d.ts +12 -12
- package/lib/_constants/mocks/app-extended-server.mock.d.ts.map +1 -1
- package/lib/_constants/mocks/app-extended-server.mock.js +16 -16
- package/lib/_constants/mocks/app-extended-server.mock.js.map +1 -1
- package/lib/_constants/mocks/app-params.mock.d.ts +2 -2
- package/lib/_constants/mocks/app-params.mock.d.ts.map +1 -1
- package/lib/_constants/mocks/app-params.mock.js +1 -1
- package/lib/_constants/mocks/app-params.mock.js.map +1 -1
- package/lib/_constants/mocks/app-server.mock.d.ts +15 -15
- package/lib/_constants/mocks/app-server.mock.d.ts.map +1 -1
- package/lib/_constants/mocks/app-server.mock.js +10 -10
- package/lib/_constants/mocks/app-server.mock.js.map +1 -1
- package/lib/_constants/mocks/data-model.mock.d.ts +3 -3
- package/lib/_constants/mocks/data-model.mock.d.ts.map +1 -1
- package/lib/_constants/mocks/data-model.mock.js +22 -22
- package/lib/_constants/mocks/data-model.mock.js.map +1 -1
- package/lib/_constants/mocks/email-service-collection.mock.d.ts +2 -2
- package/lib/_constants/mocks/email-service-collection.mock.d.ts.map +1 -1
- package/lib/_constants/mocks/email-service-collection.mock.js +1 -1
- package/lib/_constants/mocks/email-service-collection.mock.js.map +1 -1
- package/lib/_constants/mocks/endpoint.mock.d.ts +8 -8
- package/lib/_constants/mocks/endpoint.mock.d.ts.map +1 -1
- package/lib/_constants/mocks/endpoint.mock.js +18 -18
- package/lib/_constants/mocks/endpoint.mock.js.map +1 -1
- package/lib/_constants/mocks/socket-client.mock.d.ts +2 -2
- package/lib/_constants/mocks/socket-client.mock.d.ts.map +1 -1
- package/lib/_constants/mocks/socket-client.mock.js +1 -1
- package/lib/_constants/mocks/socket-client.mock.js.map +1 -1
- package/lib/_constants/mocks/socket-server.mock.d.ts +2 -2
- package/lib/_constants/mocks/socket-server.mock.d.ts.map +1 -1
- package/lib/_constants/mocks/socket-server.mock.js +1 -1
- package/lib/_constants/mocks/socket-server.mock.js.map +1 -1
- package/lib/_enums/data-model-type.enum.d.ts +1 -0
- package/lib/_enums/data-model-type.enum.d.ts.map +1 -1
- package/lib/_enums/data-model-type.enum.js +1 -0
- package/lib/_enums/data-model-type.enum.js.map +1 -1
- package/lib/_models/control-models/api-call-params.control-model.d.ts +3 -3
- package/lib/_models/control-models/api-call-params.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/api-call-params.control-model.js +5 -5
- package/lib/_models/control-models/api-call-params.control-model.js.map +1 -1
- package/lib/_models/control-models/{app-system-controls.control-model copy.d.ts → app-ext-system-controls.control-model.d.ts} +1 -1
- package/lib/_models/control-models/app-ext-system-controls.control-model.d.ts.map +1 -0
- package/lib/_models/control-models/{app-system-controls.control-model copy.js → app-ext-system-controls.control-model.js} +1 -1
- package/lib/_models/control-models/app-ext-system-controls.control-model.js.map +1 -0
- package/lib/_models/control-models/app-params.control-model.d.ts +2 -2
- package/lib/_models/control-models/app-params.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/app-params.control-model.js +3 -3
- package/lib/_models/control-models/app-params.control-model.js.map +1 -1
- package/lib/_models/control-models/endpoint-params.control-model.d.ts +1 -1
- package/lib/_models/control-models/endpoint-params.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/endpoint-params.control-model.js +8 -8
- package/lib/_models/control-models/endpoint-params.control-model.js.map +1 -1
- package/lib/_models/control-models/http-settings.control-model.d.ts +2 -2
- package/lib/_models/control-models/http-settings.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/http-settings.control-model.js +3 -3
- package/lib/_models/control-models/http-settings.control-model.js.map +1 -1
- package/lib/_models/control-models/socket-client-service-params.control-model.d.ts +2 -2
- package/lib/_models/control-models/socket-client-service-params.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/socket-client-service-params.control-model.js +3 -3
- package/lib/_models/control-models/socket-client-service-params.control-model.js.map +1 -1
- package/lib/_models/control-models/socket-event.control-model.js +4 -4
- package/lib/_models/control-models/socket-presence.control-model.d.ts +12 -0
- package/lib/_models/control-models/socket-presence.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/socket-presence.control-model.js +4 -0
- package/lib/_models/control-models/socket-presence.control-model.js.map +1 -1
- package/lib/_models/control-models/socket-server-service-params.control-model.d.ts +2 -2
- package/lib/_models/control-models/socket-server-service-params.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/socket-server-service-params.control-model.js +4 -4
- package/lib/_models/control-models/socket-server-service-params.control-model.js.map +1 -1
- package/lib/_models/interfaces/certification-settings.interface.d.ts +1 -1
- package/lib/_models/interfaces/certification-settings.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/global-service-settings.interface.d.ts +6 -6
- package/lib/_models/interfaces/global-service-settings.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/global-settings.interface.d.ts +1 -1
- package/lib/_models/interfaces/global-settings.interface.d.ts.map +1 -1
- package/lib/_models/interfaces/routing-module-settings.interface.d.ts +1 -1
- package/lib/_models/interfaces/routing-module-settings.interface.d.ts.map +1 -1
- package/lib/_models/types/db-filter.type.d.ts.map +1 -1
- package/lib/_models/types/db-update.type.d.ts +2 -1
- package/lib/_models/types/db-update.type.d.ts.map +1 -1
- package/lib/_modules/custom-data/custom-data.controller.d.ts +2 -2
- package/lib/_modules/custom-data/custom-data.controller.d.ts.map +1 -1
- package/lib/_modules/custom-data/custom-data.controller.js +18 -16
- package/lib/_modules/custom-data/custom-data.controller.js.map +1 -1
- package/lib/_modules/custom-data/custom-data.data-service.d.ts +1 -1
- package/lib/_modules/custom-data/custom-data.data-service.d.ts.map +1 -1
- package/lib/_modules/custom-data/custom-data.data-service.js +4 -4
- package/lib/_modules/custom-data/custom-data.data-service.js.map +1 -1
- package/lib/_modules/custom-data/get-custom-data-routing-module.util.d.ts +1 -1
- package/lib/_modules/custom-data/get-custom-data-routing-module.util.d.ts.map +1 -1
- package/lib/_modules/custom-data/get-custom-data-routing-module.util.js +5 -5
- package/lib/_modules/custom-data/get-custom-data-routing-module.util.js.map +1 -1
- package/lib/_modules/test/get-test-routing-module.util.d.ts +1 -1
- package/lib/_modules/test/get-test-routing-module.util.d.ts.map +1 -1
- package/lib/_modules/test/get-test-routing-module.util.js +5 -5
- package/lib/_modules/test/get-test-routing-module.util.js.map +1 -1
- package/lib/_modules/test/test.controller.d.ts +2 -2
- package/lib/_modules/test/test.controller.d.ts.map +1 -1
- package/lib/_modules/test/test.controller.js +33 -33
- package/lib/_modules/test/test.controller.js.map +1 -1
- package/lib/_modules/usage/get-usage-routing-module.util.d.ts +1 -1
- package/lib/_modules/usage/get-usage-routing-module.util.d.ts.map +1 -1
- package/lib/_modules/usage/get-usage-routing-module.util.js +5 -5
- package/lib/_modules/usage/get-usage-routing-module.util.js.map +1 -1
- package/lib/_modules/usage/usage.controller.d.ts +2 -2
- package/lib/_modules/usage/usage.controller.d.ts.map +1 -1
- package/lib/_modules/usage/usage.controller.js +16 -16
- package/lib/_modules/usage/usage.controller.js.map +1 -1
- package/lib/_modules/usage/usage.data-service.d.ts +1 -1
- package/lib/_modules/usage/usage.data-service.d.ts.map +1 -1
- package/lib/_modules/usage/usage.data-service.js +4 -4
- package/lib/_modules/usage/usage.data-service.js.map +1 -1
- package/lib/_services/base/data.service.d.ts +3 -3
- package/lib/_services/base/data.service.d.ts.map +1 -1
- package/lib/_services/base/data.service.js +15 -15
- package/lib/_services/base/data.service.js.map +1 -1
- package/lib/_services/base/db.service.d.ts +3 -3
- package/lib/_services/base/db.service.d.ts.map +1 -1
- package/lib/_services/base/db.service.js +10 -6
- package/lib/_services/base/db.service.js.map +1 -1
- package/lib/_services/core/api.service.d.ts +4 -4
- package/lib/_services/core/api.service.d.ts.map +1 -1
- package/lib/_services/core/api.service.js +9 -9
- package/lib/_services/core/api.service.js.map +1 -1
- package/lib/_services/core/email.service.d.ts +4 -4
- package/lib/_services/core/email.service.d.ts.map +1 -1
- package/lib/_services/core/email.service.js.map +1 -1
- package/lib/_services/core/global.service.d.ts +12 -12
- package/lib/_services/core/global.service.d.ts.map +1 -1
- package/lib/_services/core/global.service.js +14 -1
- package/lib/_services/core/global.service.js.map +1 -1
- package/lib/_services/core/service-collection.service.d.ts +1 -1
- package/lib/_services/core/service-collection.service.d.ts.map +1 -1
- package/lib/_services/core/service-collection.service.js +3 -3
- package/lib/_services/core/service-collection.service.js.map +1 -1
- package/lib/_services/route/controller.service.d.ts +2 -2
- package/lib/_services/route/controller.service.d.ts.map +1 -1
- package/lib/_services/route/controller.service.js.map +1 -1
- package/lib/_services/route/routing-module.service.d.ts +4 -4
- package/lib/_services/route/routing-module.service.d.ts.map +1 -1
- package/lib/_services/route/routing-module.service.js +2 -2
- package/lib/_services/route/routing-module.service.js.map +1 -1
- package/lib/_services/server/app-extended.server.d.ts +2 -2
- package/lib/_services/server/app-extended.server.js +5 -5
- package/lib/_services/server/app-extended.server.js.map +1 -1
- package/lib/_services/server/app-extended.server.spec.js +3 -3
- package/lib/_services/server/app-extended.server.spec.js.map +1 -1
- package/lib/_services/server/app.server.d.ts +14 -14
- package/lib/_services/server/app.server.d.ts.map +1 -1
- package/lib/_services/server/app.server.js +8 -8
- package/lib/_services/server/app.server.js.map +1 -1
- package/lib/_services/server/app.server.spec.js +3 -3
- package/lib/_services/server/app.server.spec.js.map +1 -1
- package/lib/_services/shared.static-service.d.ts +3 -3
- package/lib/_services/shared.static-service.d.ts.map +1 -1
- package/lib/_services/shared.static-service.js +1 -1
- package/lib/_services/shared.static-service.js.map +1 -1
- package/lib/_services/socket/socket-client.service.d.ts +3 -3
- package/lib/_services/socket/socket-client.service.d.ts.map +1 -1
- package/lib/_services/socket/socket-client.service.js +24 -18
- package/lib/_services/socket/socket-client.service.js.map +1 -1
- package/lib/_services/socket/socket-server.service.d.ts +3 -3
- package/lib/_services/socket/socket-server.service.d.ts.map +1 -1
- package/lib/_services/socket/socket-server.service.js +5 -5
- package/lib/_services/socket/socket-server.service.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/_constants/global-settings.const.ts +2 -2
- package/src/_constants/mocks/app-extended-server.mock.ts +34 -35
- package/src/_constants/mocks/app-params.mock.ts +2 -2
- package/src/_constants/mocks/app-server.mock.ts +30 -30
- package/src/_constants/mocks/data-model.mock.ts +23 -23
- package/src/_constants/mocks/email-service-collection.mock.ts +2 -2
- package/src/_constants/mocks/endpoint.mock.ts +22 -22
- package/src/_constants/mocks/socket-client.mock.ts +3 -3
- package/src/_constants/mocks/socket-server.mock.ts +3 -3
- package/src/_enums/data-model-type.enum.ts +1 -0
- package/src/_models/control-models/api-call-params.control-model.ts +3 -3
- package/src/_models/control-models/app-params.control-model.ts +2 -2
- package/src/_models/control-models/endpoint-params.control-model.ts +7 -7
- package/src/_models/control-models/http-settings.control-model.ts +2 -2
- package/src/_models/control-models/socket-client-service-params.control-model.ts +2 -2
- package/src/_models/control-models/socket-event.control-model.ts +5 -5
- package/src/_models/control-models/socket-presence.control-model.ts +12 -0
- package/src/_models/control-models/socket-server-service-params.control-model.ts +4 -4
- package/src/_models/interfaces/certification-settings.interface.ts +1 -1
- package/src/_models/interfaces/global-service-settings.interface.ts +6 -6
- package/src/_models/interfaces/global-settings.interface.ts +1 -1
- package/src/_models/interfaces/routing-module-settings.interface.ts +1 -1
- package/src/_models/types/db-filter.type.ts +5 -2
- package/src/_models/types/db-update.type.ts +3 -2
- package/src/_modules/custom-data/custom-data.controller.ts +20 -18
- package/src/_modules/custom-data/custom-data.data-service.ts +6 -4
- package/src/_modules/custom-data/get-custom-data-routing-module.util.ts +7 -7
- package/src/_modules/test/get-test-routing-module.util.ts +7 -7
- package/src/_modules/test/test.controller.ts +34 -34
- package/src/_modules/usage/get-usage-routing-module.util.ts +7 -7
- package/src/_modules/usage/usage.controller.ts +18 -19
- package/src/_modules/usage/usage.data-service.ts +3 -3
- package/src/_services/base/data.service.ts +21 -20
- package/src/_services/base/db.service.ts +15 -12
- package/src/_services/core/api.service.ts +22 -22
- package/src/_services/core/email.service.ts +4 -4
- package/src/_services/core/global.service.ts +29 -15
- package/src/_services/core/service-collection.service.ts +1 -1
- package/src/_services/route/controller.service.ts +2 -2
- package/src/_services/route/routing-module.service.ts +12 -12
- package/src/_services/server/app-extended.server.spec.ts +4 -4
- package/src/_services/server/app-extended.server.ts +5 -5
- package/src/_services/server/app.server.spec.ts +4 -4
- package/src/_services/server/app.server.ts +27 -27
- package/src/_services/shared.static-service.ts +7 -4
- package/src/_services/socket/socket-client.service.ts +69 -37
- package/src/_services/socket/socket-server.service.ts +9 -9
- package/tsconfig.json +1 -0
- package/lib/_models/control-models/app-system-controls.control-model copy.d.ts.map +0 -1
- package/lib/_models/control-models/app-system-controls.control-model copy.js.map +0 -1
- /package/src/_models/control-models/{app-system-controls.control-model copy.ts → app-ext-system-controls.control-model.ts} +0 -0
|
@@ -5,7 +5,7 @@ import { Request, Response } from 'express';
|
|
|
5
5
|
import { Dynamo_Array, Dynamo_Error, Dynamo_Log } from '@futdevpro/fsm-dynamo';
|
|
6
6
|
import { DynamoNTS_RouteSecurity } from '../../_enums/route-security.enum';
|
|
7
7
|
import { DynamoNTS_HttpCallType } from '../../_enums/http/http-call-type.enum';
|
|
8
|
-
import {
|
|
8
|
+
import { DynamoNTS_globalSettings } from '../../_constants/global-settings.const';
|
|
9
9
|
import { DynamoNTS_GlobalService } from '../../_services/core/global.service';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -13,7 +13,7 @@ import { DynamoNTS_GlobalService } from '../../_services/core/global.service';
|
|
|
13
13
|
* used for specific events such as saving or getting data,
|
|
14
14
|
* triggering events, logging in or out, and much more
|
|
15
15
|
*/
|
|
16
|
-
export class
|
|
16
|
+
export class DynamoNTS_Endpoint_Params {
|
|
17
17
|
name: string;
|
|
18
18
|
security: DynamoNTS_RouteSecurity;
|
|
19
19
|
|
|
@@ -85,7 +85,7 @@ export class DynamoNTS_EndpointParams{
|
|
|
85
85
|
) {
|
|
86
86
|
try {
|
|
87
87
|
this.name = set.name ?? set.endpoint;
|
|
88
|
-
this.security = set.security ??
|
|
88
|
+
this.security = set.security ?? DynamoNTS_globalSettings.defaultRouteSecurity;
|
|
89
89
|
|
|
90
90
|
this.type = set.type;
|
|
91
91
|
this.endpoint = set.endpoint;
|
|
@@ -111,12 +111,12 @@ export class DynamoNTS_EndpointParams{
|
|
|
111
111
|
this.preProcessess = set.preProcessess ?? [];
|
|
112
112
|
this.tasks = set.tasks ?? [];
|
|
113
113
|
|
|
114
|
-
this.logRequest = set.logRequest ??
|
|
115
|
-
this.logRequestsParams = set.logRequestsParams ??
|
|
114
|
+
this.logRequest = set.logRequest ?? DynamoNTS_globalSettings.logRequest;
|
|
115
|
+
this.logRequestsParams = set.logRequestsParams ?? DynamoNTS_globalSettings.logRequestsParams;
|
|
116
116
|
this.logRequestsContent =
|
|
117
|
-
set.logRequestsContent ??
|
|
117
|
+
set.logRequestsContent ?? DynamoNTS_globalSettings.logRequestsContent;
|
|
118
118
|
this.logResponseContent =
|
|
119
|
-
set.logResponseContent ??
|
|
119
|
+
set.logResponseContent ?? DynamoNTS_globalSettings.logResponseContent;
|
|
120
120
|
} catch (error) {
|
|
121
121
|
Dynamo_Log.error(
|
|
122
122
|
`\nEndpoint params setup failed: name: '${set.name}' ` +
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import * as BodyParser from 'body-parser';
|
|
3
|
-
export class
|
|
3
|
+
export class DynamoNTS_Http_Settings {
|
|
4
4
|
httpPort?: number;
|
|
5
5
|
httpsPort?: number;
|
|
6
6
|
|
|
@@ -20,7 +20,7 @@ export class DynamoNTS_HttpSettings {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
constructor(
|
|
23
|
-
set?:
|
|
23
|
+
set?: DynamoNTS_Http_Settings
|
|
24
24
|
) {
|
|
25
25
|
if (set) {
|
|
26
26
|
Object.assign(this, set);
|
|
@@ -6,7 +6,7 @@ import { second } from '@futdevpro/fsm-dynamo';
|
|
|
6
6
|
/**
|
|
7
7
|
* socket handling and clarification is under development
|
|
8
8
|
*/
|
|
9
|
-
export class
|
|
9
|
+
export class DynamoNTS_SocketClientService_Params {
|
|
10
10
|
service: string;
|
|
11
11
|
name: string;
|
|
12
12
|
address?: string = 'ws://localhost';
|
|
@@ -16,7 +16,7 @@ export class DynamoNTS_SocketClientServiceParams {
|
|
|
16
16
|
socketOptions?: Partial<SocketIO.ManagerOptions & SocketIO.SocketOptions>;
|
|
17
17
|
|
|
18
18
|
constructor(
|
|
19
|
-
set:
|
|
19
|
+
set: DynamoNTS_SocketClientService_Params
|
|
20
20
|
) {
|
|
21
21
|
Object.assign(this, set);
|
|
22
22
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { Dynamo_Array, Dynamo_Log } from '@futdevpro/fsm-dynamo';
|
|
3
|
-
import {
|
|
3
|
+
import { DynamoNTS_globalSettings } from '../../_constants/global-settings.const';
|
|
4
4
|
import { DynamoNTS_SocketEventKey } from '../../_enums/http/socket-event-type.enum';
|
|
5
5
|
|
|
6
6
|
|
|
@@ -78,13 +78,13 @@ export class DynamoNTS_SocketEvent<T>{
|
|
|
78
78
|
DynamoNTS_SocketEventKey.disconnect,
|
|
79
79
|
] as string[]).includes(this.eventKey)
|
|
80
80
|
) {
|
|
81
|
-
this.logEvent =
|
|
82
|
-
|
|
81
|
+
this.logEvent = DynamoNTS_globalSettings.logMainSocketEvents ||
|
|
82
|
+
DynamoNTS_globalSettings.logAllSocketEvent;
|
|
83
83
|
} else {
|
|
84
|
-
this.logEvent =
|
|
84
|
+
this.logEvent = DynamoNTS_globalSettings.logAllSocketEvent;
|
|
85
85
|
}
|
|
86
86
|
this.logEventContent = set.logEventContent !== undefined ?
|
|
87
|
-
set.logEventContent :
|
|
87
|
+
set.logEventContent : DynamoNTS_globalSettings.logSocketEventContent;
|
|
88
88
|
} catch (error) {
|
|
89
89
|
Dynamo_Log.error(
|
|
90
90
|
`\nSocket Event params setup failed (${this.serviceName}): ${set.eventKey}`,
|
|
@@ -8,6 +8,10 @@ import * as SocketIO from 'socket.io';
|
|
|
8
8
|
* socket handling and clarification is under development
|
|
9
9
|
*/
|
|
10
10
|
export class DynamoNTS_SocketPresence {
|
|
11
|
+
/**
|
|
12
|
+
* this is the presence ID which is used to getand handle the presence
|
|
13
|
+
* usually the service master identifier such as userID
|
|
14
|
+
* */
|
|
11
15
|
issuerId: string;
|
|
12
16
|
serviceName?: string = 'unknown';
|
|
13
17
|
onDestroy?: (issuerId: string) => void = (): void => {};
|
|
@@ -20,6 +24,10 @@ export class DynamoNTS_SocketPresence {
|
|
|
20
24
|
|
|
21
25
|
constructor(
|
|
22
26
|
set: {
|
|
27
|
+
/**
|
|
28
|
+
* this is the presence ID which is used to get and set handle the presence/sockets
|
|
29
|
+
* usually the service master identifier such as userID
|
|
30
|
+
* */
|
|
23
31
|
issuerId: string,
|
|
24
32
|
serviceName?: string,
|
|
25
33
|
onDestroy?: (issuerId: string) => void,
|
|
@@ -27,6 +35,10 @@ export class DynamoNTS_SocketPresence {
|
|
|
27
35
|
defaultErrorUserMsg?: string,
|
|
28
36
|
sockets: SocketIO.Socket[],
|
|
29
37
|
|
|
38
|
+
/**
|
|
39
|
+
* this is the issuer ID which is used to register data changes,
|
|
40
|
+
* usually the main master identifier such as accountID
|
|
41
|
+
*/
|
|
30
42
|
issuer: string,
|
|
31
43
|
}
|
|
32
44
|
) {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { DynamoNTS_globalSettings } from '../../_constants/global-settings.const';
|
|
3
3
|
import { DynamoNTS_SocketSecurity } from '../../_enums/socket-security.enum';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* socket handling and clarification is under development
|
|
7
7
|
*/
|
|
8
|
-
export class
|
|
8
|
+
export class DynamoNTS_SocketServerService_Params<T = any> {
|
|
9
9
|
name: string;
|
|
10
10
|
port: number;
|
|
11
11
|
security?: DynamoNTS_SocketSecurity;
|
|
12
12
|
|
|
13
13
|
constructor(
|
|
14
|
-
set:
|
|
14
|
+
set: DynamoNTS_SocketServerService_Params<T>
|
|
15
15
|
) {
|
|
16
16
|
this.name = set.name;
|
|
17
17
|
this.port = set.port;
|
|
18
|
-
this.security = set.security ? set.security :
|
|
18
|
+
this.security = set.security ? set.security : DynamoNTS_globalSettings.defaultSocketSecurity;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import { Request, Response } from 'express';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Dynamo_DataModel_Params } from '@futdevpro/fsm-dynamo';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { DynamoNTS_Service_Collection } from '../../_services/core/service-collection.service';
|
|
10
10
|
import { DynamoNTS_EmailService } from '../../_services/core/email.service';
|
|
11
11
|
import { DynamoNTS_AuthService } from '../../_services/core/auth.service';
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
export interface
|
|
14
|
+
export interface DynamoNTS_GlobalService_Settings {
|
|
15
15
|
/**
|
|
16
16
|
* You need to setup your Own Auth Service extending the DynamoNTS_AuthService class
|
|
17
17
|
*/
|
|
@@ -20,12 +20,12 @@ export interface DynamoNTS_GlobalServiceSettings {
|
|
|
20
20
|
/**
|
|
21
21
|
* You can setup your Own Email Service extending the DynamoNTS_EmailServiceCollection class
|
|
22
22
|
*/
|
|
23
|
-
emailServiceCollection?:
|
|
23
|
+
emailServiceCollection?: DynamoNTS_Service_Collection<DynamoNTS_EmailService>,
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* you can setup data tables by passing a
|
|
26
|
+
* you can setup data tables by passing a Dynamo_DataModel_Params list at this point
|
|
27
27
|
*/
|
|
28
|
-
dbModels?:
|
|
28
|
+
dbModels?: Dynamo_DataModel_Params[],
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* you can setup other services by passing a DynamoNTS_SingletonService list at this point
|
|
@@ -9,7 +9,7 @@ import { DynamoNTS_SocketSecurity } from '../../_enums/socket-security.enum';
|
|
|
9
9
|
* @param logEventContent only will log if the specific socket event is also set to log
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
|
-
export interface
|
|
12
|
+
export interface DynamoNTS_Global_Settings {
|
|
13
13
|
/**
|
|
14
14
|
* this will be used as the main baseUrl for the application,
|
|
15
15
|
* this is not required, but we suggest to use at least a '/api' as base route
|
|
@@ -4,7 +4,7 @@ import { DynamoNTS_Controller } from '../../_services';
|
|
|
4
4
|
/**
|
|
5
5
|
* This is a main route point handler, which collects a list of controllers for the API
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface DynamoNTS_RoutingModule_Settings {
|
|
8
8
|
/**
|
|
9
9
|
* main route of the module
|
|
10
10
|
*/
|
|
@@ -20,12 +20,15 @@
|
|
|
20
20
|
* //
|
|
21
21
|
* @returns {T} data: T
|
|
22
22
|
*/
|
|
23
|
-
export type DynamoNTS_DBFilter<T> =
|
|
23
|
+
export type DynamoNTS_DBFilter<T> =
|
|
24
|
+
DynamoNTS_DBFilterSimple<T> |
|
|
25
|
+
DynamoNTS_DBFilterOR<T> |
|
|
26
|
+
DynamoNTS_DBFilterNOR<T>;
|
|
24
27
|
|
|
25
28
|
/**
|
|
26
29
|
* A simple filter for a DynamoDB query.
|
|
27
30
|
*/
|
|
28
|
-
|
|
31
|
+
export type DynamoNTS_DBFilterSimple<T> = {
|
|
29
32
|
[K in keyof T]?: T[K] | DynamoNTS_DBFilterExpressions<T[K]>;
|
|
30
33
|
} & {
|
|
31
34
|
[path: string]: any;
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* $unset: // Removes the specified field from a document. (set: "" to value)
|
|
28
28
|
* //
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
export type DynamoNTS_DBUpdate<T> = {
|
|
31
31
|
/**
|
|
32
32
|
* Sets the value of a field to current date, either as a Date or a Timestamp.
|
|
33
33
|
*/
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
*/
|
|
62
62
|
$set?: { [K in keyof T]?: string } | any;
|
|
63
63
|
/**
|
|
64
|
-
* Sets the value of a field if an update results in an insert of a document.
|
|
64
|
+
* Sets the value of a field if an update results in an insert of a document.
|
|
65
|
+
* Has no effect on update operations that modify existing documents.
|
|
65
66
|
*/
|
|
66
67
|
$setOnInsert?: { [K in keyof T]?: T[K] };
|
|
67
68
|
/**
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
|
|
2
2
|
import { Request, Response } from 'express';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { Dynamo_customDataModule_settings } from '@futdevpro/fsm-dynamo';
|
|
5
5
|
|
|
6
6
|
import { DynamoNTS_HttpCallType } from '../../_enums/http/http-call-type.enum';
|
|
7
7
|
import { DynamoNTS_Controller } from '../../_services/route/controller.service';
|
|
8
|
-
import {
|
|
8
|
+
import { Dynamo_CustomData_DataService } from './custom-data.data-service';
|
|
9
9
|
import {
|
|
10
|
-
|
|
10
|
+
DynamoNTS_Endpoint_Params
|
|
11
11
|
} from '../../_models/control-models/endpoint-params.control-model';
|
|
12
12
|
|
|
13
|
-
export class
|
|
13
|
+
export class DynamoNTS_CustomData_Controller extends DynamoNTS_Controller {
|
|
14
14
|
|
|
15
|
-
static getInstance():
|
|
16
|
-
return
|
|
15
|
+
static getInstance(): DynamoNTS_CustomData_Controller {
|
|
16
|
+
return DynamoNTS_CustomData_Controller.getSingletonInstance();
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
setupEndpoints(): void {
|
|
20
20
|
this.endpoints = [
|
|
21
21
|
// CUSTOM DATA
|
|
22
|
-
new
|
|
22
|
+
new DynamoNTS_Endpoint_Params({
|
|
23
23
|
name: 'getCustomData',
|
|
24
24
|
type: DynamoNTS_HttpCallType.get,
|
|
25
|
-
endpoint:
|
|
25
|
+
endpoint: Dynamo_customDataModule_settings.endPoints.getCustomData,
|
|
26
26
|
tasks: [
|
|
27
27
|
async (req: Request, res: Response): Promise<void> => {
|
|
28
|
-
const customDataService = new
|
|
28
|
+
const customDataService = new Dynamo_CustomData_DataService({
|
|
29
|
+
_id: req.params.customId,
|
|
30
|
+
});
|
|
29
31
|
|
|
30
32
|
await customDataService.getDataById();
|
|
31
33
|
|
|
@@ -33,19 +35,19 @@ export class CustomDataController extends DynamoNTS_Controller {
|
|
|
33
35
|
url: req.url,
|
|
34
36
|
result: 'get custom call was successful!',
|
|
35
37
|
response: customDataService.data,
|
|
36
|
-
request: `.../custom/get/${req.params.customId}
|
|
38
|
+
request: `.../custom/get/${req.params.customId}`,
|
|
37
39
|
});
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
+
},
|
|
41
|
+
],
|
|
40
42
|
}),
|
|
41
43
|
|
|
42
|
-
new
|
|
44
|
+
new DynamoNTS_Endpoint_Params({
|
|
43
45
|
name: 'modifyCustomData',
|
|
44
46
|
type: DynamoNTS_HttpCallType.post,
|
|
45
|
-
endpoint:
|
|
47
|
+
endpoint: Dynamo_customDataModule_settings.endPoints.modifyCustomData,
|
|
46
48
|
tasks: [
|
|
47
49
|
async (req: Request, res: Response, issuer: string): Promise<void> => {
|
|
48
|
-
const customDataService = new
|
|
50
|
+
const customDataService = new Dynamo_CustomData_DataService(req.body, issuer);
|
|
49
51
|
|
|
50
52
|
await customDataService.saveData();
|
|
51
53
|
|
|
@@ -56,10 +58,10 @@ export class CustomDataController extends DynamoNTS_Controller {
|
|
|
56
58
|
warning:
|
|
57
59
|
'keep in mind that this is a playground DB, ' +
|
|
58
60
|
'and it will be cleared out from time to time',
|
|
59
|
-
request: req.body
|
|
61
|
+
request: req.body,
|
|
60
62
|
});
|
|
61
|
-
}
|
|
62
|
-
]
|
|
63
|
+
},
|
|
64
|
+
],
|
|
63
65
|
}),
|
|
64
66
|
];
|
|
65
67
|
}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
Dynamo_customDataModel_params, Dynamo_CustomData
|
|
6
|
+
} from '@futdevpro/fsm-dynamo/custom-data-module';
|
|
5
7
|
import { DynamoNTS_DataService } from '../../_services/base/data.service';
|
|
6
8
|
|
|
7
|
-
export class
|
|
9
|
+
export class Dynamo_CustomData_DataService extends DynamoNTS_DataService<Dynamo_CustomData> {
|
|
8
10
|
|
|
9
11
|
constructor(
|
|
10
12
|
customData?: Dynamo_CustomData,
|
|
11
|
-
issuer?: string
|
|
13
|
+
issuer?: string
|
|
12
14
|
) {
|
|
13
15
|
super(
|
|
14
16
|
new Dynamo_CustomData(customData),
|
|
15
|
-
|
|
17
|
+
Dynamo_customDataModel_params,
|
|
16
18
|
issuer
|
|
17
19
|
);
|
|
18
20
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { Dynamo_customDataModule_settings } from '@futdevpro/fsm-dynamo';
|
|
3
3
|
import { DynamoNTS_RouteSecurity } from '../../_enums/route-security.enum';
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
DynamoNTS_RoutingModule_Settings
|
|
6
6
|
} from '../../_models/interfaces/routing-module-settings.interface';
|
|
7
7
|
import { DynamoNTS_RoutingModule } from '../../_services/route/routing-module.service';
|
|
8
|
-
import {
|
|
8
|
+
import { DynamoNTS_CustomData_Controller } from './custom-data.controller';
|
|
9
9
|
|
|
10
|
-
export function
|
|
10
|
+
export function DynamoNTS_getCustomDataRoutingModule(
|
|
11
11
|
securityOverride?: DynamoNTS_RouteSecurity
|
|
12
12
|
): DynamoNTS_RoutingModule {
|
|
13
|
-
const set:
|
|
14
|
-
route:
|
|
15
|
-
controllers: [
|
|
13
|
+
const set: DynamoNTS_RoutingModule_Settings = {
|
|
14
|
+
route: Dynamo_customDataModule_settings.mainRoute,
|
|
15
|
+
controllers: [ DynamoNTS_CustomData_Controller.getInstance() ],
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
if (securityOverride) {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { Dynamo_testModule_settings } from '@futdevpro/fsm-dynamo/test-module';
|
|
3
3
|
import { DynamoNTS_RouteSecurity } from '../../_enums/route-security.enum';
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
DynamoNTS_RoutingModule_Settings
|
|
6
6
|
} from '../../_models/interfaces/routing-module-settings.interface';
|
|
7
7
|
import { DynamoNTS_RoutingModule } from '../../_services/route/routing-module.service';
|
|
8
|
-
import {
|
|
8
|
+
import { DynamoNTS_Test_Controller } from './test.controller';
|
|
9
9
|
|
|
10
|
-
export function
|
|
10
|
+
export function DynamoNTS_getTestRoutingModule(
|
|
11
11
|
securityOverride?: DynamoNTS_RouteSecurity
|
|
12
12
|
): DynamoNTS_RoutingModule {
|
|
13
|
-
const set:
|
|
14
|
-
route:
|
|
15
|
-
controllers: [
|
|
13
|
+
const set: DynamoNTS_RoutingModule_Settings = {
|
|
14
|
+
route: Dynamo_testModule_settings.mainRoute,
|
|
15
|
+
controllers: [ DynamoNTS_Test_Controller.getInstance() ],
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
if (securityOverride) {
|
|
@@ -1,103 +1,103 @@
|
|
|
1
1
|
|
|
2
2
|
import { Request, Response } from 'express';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { Dynamo_testModule_settings } from '@futdevpro/fsm-dynamo/test-module';
|
|
5
5
|
|
|
6
6
|
import { DynamoNTS_HttpCallType } from '../../_enums/http/http-call-type.enum';
|
|
7
7
|
import { DynamoNTS_Controller } from '../../_services/route/controller.service';
|
|
8
8
|
import {
|
|
9
|
-
|
|
9
|
+
DynamoNTS_Endpoint_Params
|
|
10
10
|
} from '../../_models/control-models/endpoint-params.control-model';
|
|
11
11
|
import { DynamoNTS_GlobalService } from '../../_services/core/global.service';
|
|
12
12
|
|
|
13
|
-
export class
|
|
13
|
+
export class DynamoNTS_Test_Controller extends DynamoNTS_Controller {
|
|
14
14
|
|
|
15
|
-
static getInstance():
|
|
16
|
-
return
|
|
15
|
+
static getInstance(): DynamoNTS_Test_Controller {
|
|
16
|
+
return DynamoNTS_Test_Controller.getSingletonInstance();
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
setupEndpoints(): void {
|
|
20
20
|
this.endpoints = [
|
|
21
21
|
// TESTS
|
|
22
|
-
new
|
|
22
|
+
new DynamoNTS_Endpoint_Params({
|
|
23
23
|
name: 'testGet',
|
|
24
24
|
type: DynamoNTS_HttpCallType.get,
|
|
25
|
-
endpoint:
|
|
25
|
+
endpoint: Dynamo_testModule_settings.endPoints.testGet,
|
|
26
26
|
tasks: [
|
|
27
27
|
async (req: Request, res: Response): Promise<void> => {
|
|
28
28
|
res.send({
|
|
29
29
|
url: req.url,
|
|
30
30
|
result: 'test-get call was successful!',
|
|
31
|
-
request: req.body
|
|
31
|
+
request: req.body,
|
|
32
32
|
});
|
|
33
|
-
}
|
|
34
|
-
]
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
35
|
}),
|
|
36
36
|
|
|
37
|
-
new
|
|
37
|
+
new DynamoNTS_Endpoint_Params({
|
|
38
38
|
name: 'testPost',
|
|
39
39
|
type: DynamoNTS_HttpCallType.post,
|
|
40
|
-
endpoint:
|
|
40
|
+
endpoint: Dynamo_testModule_settings.endPoints.testPost,
|
|
41
41
|
tasks: [
|
|
42
42
|
async (req: Request, res: Response): Promise<void> => {
|
|
43
43
|
res.send({
|
|
44
44
|
url: req.url,
|
|
45
45
|
result: 'test-post call was successful!',
|
|
46
|
-
request: req.body
|
|
46
|
+
request: req.body,
|
|
47
47
|
});
|
|
48
|
-
}
|
|
49
|
-
]
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
50
|
}),
|
|
51
51
|
|
|
52
|
-
new
|
|
52
|
+
new DynamoNTS_Endpoint_Params({
|
|
53
53
|
name: 'testPut',
|
|
54
54
|
type: DynamoNTS_HttpCallType.put,
|
|
55
|
-
endpoint:
|
|
55
|
+
endpoint: Dynamo_testModule_settings.endPoints.testPut,
|
|
56
56
|
tasks: [
|
|
57
57
|
async (req: Request, res: Response): Promise<void> => {
|
|
58
58
|
res.send({
|
|
59
59
|
url: req.url,
|
|
60
60
|
result: 'test-put call was successful!',
|
|
61
|
-
request: req.body
|
|
61
|
+
request: req.body,
|
|
62
62
|
});
|
|
63
|
-
}
|
|
64
|
-
]
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
65
|
}),
|
|
66
66
|
|
|
67
|
-
new
|
|
67
|
+
new DynamoNTS_Endpoint_Params({
|
|
68
68
|
name: 'testPatch',
|
|
69
69
|
type: DynamoNTS_HttpCallType.patch,
|
|
70
|
-
endpoint:
|
|
70
|
+
endpoint: Dynamo_testModule_settings.endPoints.testPatch,
|
|
71
71
|
tasks: [
|
|
72
72
|
async (req: Request, res: Response): Promise<void> => {
|
|
73
73
|
res.send({
|
|
74
74
|
url: req.url,
|
|
75
75
|
result: 'test-patch call was successful!',
|
|
76
|
-
request: req.body
|
|
76
|
+
request: req.body,
|
|
77
77
|
});
|
|
78
|
-
}
|
|
79
|
-
]
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
80
|
}),
|
|
81
81
|
|
|
82
|
-
new
|
|
82
|
+
new DynamoNTS_Endpoint_Params({
|
|
83
83
|
name: 'testDelete',
|
|
84
84
|
type: DynamoNTS_HttpCallType.delete,
|
|
85
|
-
endpoint:
|
|
85
|
+
endpoint: Dynamo_testModule_settings.endPoints.testDelete,
|
|
86
86
|
tasks: [
|
|
87
87
|
async (req: Request, res: Response): Promise<void> => {
|
|
88
88
|
res.send({
|
|
89
89
|
url: req.url,
|
|
90
90
|
result: 'test-delete call was successful!',
|
|
91
|
-
request: req.body
|
|
91
|
+
request: req.body,
|
|
92
92
|
});
|
|
93
|
-
}
|
|
94
|
-
]
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
95
|
}),
|
|
96
96
|
|
|
97
|
-
new
|
|
97
|
+
new DynamoNTS_Endpoint_Params({
|
|
98
98
|
name: 'getServerStatus',
|
|
99
99
|
type: DynamoNTS_HttpCallType.get,
|
|
100
|
-
endpoint:
|
|
100
|
+
endpoint: Dynamo_testModule_settings.endPoints.getServerStatus,
|
|
101
101
|
tasks: [
|
|
102
102
|
async (req: Request, res: Response): Promise<void> => {
|
|
103
103
|
|
|
@@ -106,8 +106,8 @@ export class TestController extends DynamoNTS_Controller {
|
|
|
106
106
|
version: DynamoNTS_GlobalService.params.version,
|
|
107
107
|
upTime: DynamoNTS_GlobalService.upTime,
|
|
108
108
|
});
|
|
109
|
-
}
|
|
110
|
-
]
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
111
|
}),
|
|
112
112
|
];
|
|
113
113
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { Dynamo_usageModule_settings } from '@futdevpro/fsm-dynamo/usage-module';
|
|
3
3
|
import { DynamoNTS_RouteSecurity } from '../../_enums/route-security.enum';
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
DynamoNTS_RoutingModule_Settings
|
|
6
6
|
} from '../../_models/interfaces/routing-module-settings.interface';
|
|
7
7
|
import { DynamoNTS_RoutingModule } from '../../_services/route/routing-module.service';
|
|
8
|
-
import {
|
|
8
|
+
import { DynamoNTS_Usage_Controller } from './usage.controller';
|
|
9
9
|
|
|
10
|
-
export function
|
|
10
|
+
export function DynamoNTS_getUsageRoutingModule(
|
|
11
11
|
securityOverride?: DynamoNTS_RouteSecurity
|
|
12
12
|
): DynamoNTS_RoutingModule {
|
|
13
|
-
const set:
|
|
14
|
-
route:
|
|
15
|
-
controllers: [
|
|
13
|
+
const set: DynamoNTS_RoutingModule_Settings = {
|
|
14
|
+
route: Dynamo_usageModule_settings.mainRoute,
|
|
15
|
+
controllers: [ DynamoNTS_Usage_Controller.getInstance() ],
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
if (securityOverride) {
|