@futdevpro/nts-dynamo 1.7.16 → 1.7.20
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/.eslintrc.json +171 -0
- package/lib/_constants/mocks/app-extended-server.mock.d.ts.map +1 -1
- package/lib/_constants/mocks/app-extended-server.mock.js.map +1 -1
- package/lib/_constants/mocks/app-server.mock.d.ts.map +1 -1
- package/lib/_constants/mocks/app-server.mock.js.map +1 -1
- package/lib/_constants/mocks/data-model.mock.d.ts.map +1 -1
- package/lib/_constants/mocks/data-model.mock.js.map +1 -1
- package/lib/_constants/mocks/email-service-collection.mock.d.ts.map +1 -1
- package/lib/_constants/mocks/email-service-collection.mock.js.map +1 -1
- package/lib/_constants/mocks/email-service.mock.js +3 -3
- package/lib/_constants/mocks/email-service.mock.js.map +1 -1
- package/lib/_constants/mocks/endpoint.mock.d.ts.map +1 -1
- package/lib/_constants/mocks/endpoint.mock.js.map +1 -1
- package/lib/_constants/mocks/socket-server.mock.d.ts.map +1 -1
- package/lib/_constants/mocks/socket-server.mock.js.map +1 -1
- package/lib/_enums/index.js +1 -1
- package/lib/_enums/index.js.map +1 -1
- package/lib/_models/control-models/api-call-params.control-model.d.ts +2 -2
- 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.map +1 -1
- package/lib/_models/control-models/app-system-controls.control-model copy.d.ts.map +1 -1
- package/lib/_models/control-models/app-system-controls.control-model copy.js.map +1 -1
- package/lib/_models/control-models/app-system-controls.control-model.d.ts.map +1 -1
- package/lib/_models/control-models/app-system-controls.control-model.js.map +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 +15 -9
- package/lib/_models/control-models/endpoint-params.control-model.js.map +1 -1
- package/lib/_models/control-models/http-settings.control-model.d.ts +1 -1
- 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 -1
- package/lib/_models/control-models/http-settings.control-model.js.map +1 -1
- 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.map +1 -1
- package/lib/_models/control-models/socket-presence.control-model.js.map +1 -1
- package/lib/_modules/custom-data/custom-data.controller.d.ts.map +1 -1
- package/lib/_modules/custom-data/custom-data.controller.js +2 -1
- package/lib/_modules/custom-data/custom-data.controller.js.map +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.map +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.map +1 -1
- package/lib/_modules/test/test.controller.d.ts.map +1 -1
- package/lib/_modules/test/test.controller.js.map +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 +1 -1
- package/lib/_modules/usage/get-usage-routing-module.util.js.map +1 -1
- package/lib/_modules/usage/usage.controller.d.ts.map +1 -1
- package/lib/_modules/usage/usage.controller.js +15 -14
- package/lib/_modules/usage/usage.controller.js.map +1 -1
- package/lib/_modules/usage/usage.data-service.d.ts +3 -1
- package/lib/_modules/usage/usage.data-service.d.ts.map +1 -1
- package/lib/_modules/usage/usage.data-service.js +24 -16
- package/lib/_modules/usage/usage.data-service.js.map +1 -1
- package/lib/_services/base/data.service.d.ts.map +1 -1
- package/lib/_services/base/data.service.js +45 -23
- package/lib/_services/base/data.service.js.map +1 -1
- package/lib/_services/base/db.service.d.ts.map +1 -1
- package/lib/_services/base/db.service.js +82 -53
- package/lib/_services/base/db.service.js.map +1 -1
- package/lib/_services/base/singleton.service.d.ts.map +1 -1
- package/lib/_services/base/singleton.service.js.map +1 -1
- package/lib/_services/core/api.service.d.ts +21 -13
- package/lib/_services/core/api.service.d.ts.map +1 -1
- package/lib/_services/core/api.service.js +192 -143
- package/lib/_services/core/api.service.js.map +1 -1
- package/lib/_services/core/auth.service.d.ts.map +1 -1
- package/lib/_services/core/auth.service.js.map +1 -1
- package/lib/_services/core/email.service.d.ts +50 -36
- package/lib/_services/core/email.service.d.ts.map +1 -1
- package/lib/_services/core/email.service.js +329 -94
- package/lib/_services/core/email.service.js.map +1 -1
- package/lib/_services/core/global.service.d.ts.map +1 -1
- package/lib/_services/core/global.service.js +30 -19
- package/lib/_services/core/global.service.js.map +1 -1
- 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.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.map +1 -1
- package/lib/_services/server/app-extended.server.js +19 -14
- package/lib/_services/server/app-extended.server.js.map +1 -1
- package/lib/_services/server/app-extended.server.spec.js +1 -0
- package/lib/_services/server/app-extended.server.spec.js.map +1 -1
- package/lib/_services/server/app.server.d.ts +4 -3
- package/lib/_services/server/app.server.d.ts.map +1 -1
- package/lib/_services/server/app.server.js +107 -52
- package/lib/_services/server/app.server.js.map +1 -1
- package/lib/_services/server/app.server.spec.js +1 -0
- package/lib/_services/server/app.server.spec.js.map +1 -1
- package/lib/_services/shared.static-service.js.map +1 -1
- package/lib/_services/socket/socket-client.service.js.map +1 -1
- package/lib/_services/socket/socket-server.service.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/nodemon.json +3 -1
- package/package.json +9 -8
- package/src/_constants/mocks/app-extended-server.mock.ts +6 -2
- package/src/_constants/mocks/app-server.mock.ts +7 -1
- package/src/_constants/mocks/data-model.mock.ts +2 -2
- package/src/_constants/mocks/email-service-collection.mock.ts +2 -1
- package/src/_constants/mocks/email-service.mock.ts +2 -2
- package/src/_constants/mocks/endpoint.mock.ts +28 -26
- package/src/_constants/mocks/socket-server.mock.ts +12 -4
- package/src/_enums/index.ts +1 -1
- package/src/_models/control-models/api-call-params.control-model.ts +3 -2
- package/src/_models/control-models/app-system-controls.control-model copy.ts +1 -1
- package/src/_models/control-models/app-system-controls.control-model.ts +1 -1
- package/src/_models/control-models/endpoint-params.control-model.ts +39 -16
- package/src/_models/control-models/http-settings.control-model.ts +4 -2
- package/src/_modules/custom-data/custom-data.controller.ts +55 -51
- package/src/_modules/custom-data/get-custom-data-routing-module.util.ts +7 -3
- package/src/_modules/test/get-test-routing-module.util.ts +7 -3
- package/src/_modules/test/test.controller.ts +98 -96
- package/src/_modules/usage/get-usage-routing-module.util.ts +8 -4
- package/src/_modules/usage/usage.controller.ts +108 -102
- package/src/_modules/usage/usage.data-service.ts +54 -28
- package/src/_services/base/data.service.ts +133 -34
- package/src/_services/base/db.service.ts +254 -171
- package/src/_services/base/singleton.service.ts +1 -1
- package/src/_services/core/api.service.ts +348 -218
- package/src/_services/core/auth.service.ts +2 -0
- package/src/_services/core/email.service.ts +537 -129
- package/src/_services/core/global.service.ts +56 -26
- package/src/_services/route/controller.service.ts +3 -1
- package/src/_services/route/routing-module.service.ts +33 -16
- package/src/_services/server/app-extended.server.spec.ts +22 -17
- package/src/_services/server/app-extended.server.ts +108 -45
- package/src/_services/server/app.server.spec.ts +17 -12
- package/src/_services/server/app.server.ts +264 -138
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import { Request, Response } from 'express';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
Dynamo_Metadata, Dynamo_DataParams, Dynamo_Log, Dynamo_Error, Dynamo_Array
|
|
7
|
+
} from '@futdevpro/fsm-dynamo';
|
|
6
8
|
import { DynamoNTS_AppParams } from '../../_models/control-models/app-params.control-model';
|
|
7
9
|
|
|
8
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
DynamoNTS_GlobalServiceSettings
|
|
12
|
+
} from '../../_models/interfaces/global-service-settings.interface';
|
|
9
13
|
|
|
10
14
|
import { DynamoNTS_AuthService } from './auth.service';
|
|
11
15
|
/* import { DynamoNTS_DBServiceCollection } from './db-service-collection.service'; */
|
|
@@ -27,17 +31,28 @@ export class DynamoNTS_GlobalService extends DynamoNTS_SingletonService {
|
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
private static _params: DynamoNTS_AppParams;
|
|
30
|
-
static get params(): DynamoNTS_AppParams {
|
|
34
|
+
static get params(): DynamoNTS_AppParams {
|
|
35
|
+
return this._params;
|
|
36
|
+
}
|
|
31
37
|
|
|
32
38
|
private static readonly _upSince: Date = new Date();
|
|
33
|
-
static get upSince(): Date {
|
|
34
|
-
|
|
39
|
+
static get upSince(): Date {
|
|
40
|
+
return this._upSince;
|
|
41
|
+
}
|
|
42
|
+
static get upTime(): number {
|
|
43
|
+
return +new Date() - +this._upSince;
|
|
44
|
+
}
|
|
35
45
|
|
|
36
46
|
authService: DynamoNTS_AuthService;
|
|
37
|
-
dbServiceCollection: DynamoNTS_ServiceCollection<DynamoNTS_DBService<any>>;
|
|
38
|
-
emailServiceCollection: DynamoNTS_ServiceCollection<DynamoNTS_EmailService>;
|
|
39
|
-
|
|
40
|
-
static globalErrorHandler?: (
|
|
47
|
+
dbServiceCollection: DynamoNTS_ServiceCollection<DynamoNTS_DBService<any>>;
|
|
48
|
+
emailServiceCollection: DynamoNTS_ServiceCollection<DynamoNTS_EmailService>;
|
|
49
|
+
|
|
50
|
+
static globalErrorHandler?: (
|
|
51
|
+
err: any,
|
|
52
|
+
req?: Request,
|
|
53
|
+
res?: Response,
|
|
54
|
+
issuer?: string
|
|
55
|
+
) => Promise<void>;
|
|
41
56
|
|
|
42
57
|
/**
|
|
43
58
|
* You need to setup global Services through this function
|
|
@@ -47,34 +62,43 @@ export class DynamoNTS_GlobalService extends DynamoNTS_SingletonService {
|
|
|
47
62
|
|
|
48
63
|
try {
|
|
49
64
|
this.instance.dbServiceCollection = {};
|
|
50
|
-
set.dbModels?.forEach((dbModel: Dynamo_DataParams) => {
|
|
65
|
+
set.dbModels?.forEach((dbModel: Dynamo_DataParams): void => {
|
|
51
66
|
try {
|
|
52
67
|
this.instance.dbServiceCollection[dbModel.dataName] = new DynamoNTS_DBService(dbModel);
|
|
53
68
|
} catch (error) {
|
|
54
69
|
Dynamo_Log.error(`Failed to create DynamoNTS_DBService (${dbModel.dataName}).`, error);
|
|
55
|
-
|
|
70
|
+
|
|
71
|
+
throw new Dynamo_Error({
|
|
56
72
|
message: `Failed to create DynamoNTS_DBService (${dbModel.dataName}).\n` + dbModel,
|
|
57
73
|
issuerService: 'DynamoNTS_GlobalService',
|
|
58
|
-
error: error
|
|
74
|
+
error: error,
|
|
59
75
|
});
|
|
60
|
-
throw error;
|
|
61
76
|
}
|
|
62
77
|
});
|
|
63
78
|
|
|
64
79
|
this.instance.authService = set.authService;
|
|
65
|
-
this.instance.emailServiceCollection = set.emailServiceCollection;
|
|
80
|
+
this.instance.emailServiceCollection = set.emailServiceCollection ?? {};
|
|
81
|
+
await Dynamo_Array.asyncForEach(
|
|
82
|
+
Object.keys(this.instance.emailServiceCollection),
|
|
83
|
+
async (key: string): Promise<void> => {
|
|
84
|
+
await (
|
|
85
|
+
this.instance.emailServiceCollection[key] as DynamoNTS_EmailService
|
|
86
|
+
).asyncPostConstruct();
|
|
87
|
+
}
|
|
88
|
+
);
|
|
66
89
|
|
|
67
|
-
DynamoNTS_GlobalService.globalErrorHandler =
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
90
|
+
DynamoNTS_GlobalService.globalErrorHandler =
|
|
91
|
+
set.errorHandler ??
|
|
92
|
+
(async (error: any): Promise<void> => {
|
|
93
|
+
Dynamo_Log.warn(`globalErrorHandler not set!`);
|
|
94
|
+
Dynamo_Log.error(`ERROR:\n`, error);
|
|
95
|
+
});
|
|
71
96
|
} catch (error) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
97
|
+
throw new Dynamo_Error({
|
|
98
|
+
message: `Failed to setServices on DynamoNTS_GlobalService.`,
|
|
99
|
+
error: error,
|
|
100
|
+
errorCode: 'NTS-GS0-SS0',
|
|
76
101
|
});
|
|
77
|
-
throw error; */
|
|
78
102
|
}
|
|
79
103
|
}
|
|
80
104
|
|
|
@@ -106,7 +130,8 @@ export class DynamoNTS_GlobalService extends DynamoNTS_SingletonService {
|
|
|
106
130
|
if (!this.instance?.dbServiceCollection) {
|
|
107
131
|
throw new Error(
|
|
108
132
|
`\n Unique DataBase Service Collection missing!` +
|
|
109
|
-
`\n Please create a Unique DataBase Service Collection extending
|
|
133
|
+
`\n Please create a Unique DataBase Service Collection extending ` +
|
|
134
|
+
`DynamoNTS_DBServiceCollection, ` +
|
|
110
135
|
`\n and Setup with DynamoNTS_GlobalServiceC.setServices(...)\n`
|
|
111
136
|
);
|
|
112
137
|
}
|
|
@@ -119,7 +144,9 @@ export class DynamoNTS_GlobalService extends DynamoNTS_SingletonService {
|
|
|
119
144
|
* @param dataParams
|
|
120
145
|
* @returns
|
|
121
146
|
*/
|
|
122
|
-
static getDBService<T extends Dynamo_Metadata>(
|
|
147
|
+
static getDBService<T extends Dynamo_Metadata>(
|
|
148
|
+
dataParams: Dynamo_DataParams
|
|
149
|
+
): DynamoNTS_DBService<T> {
|
|
123
150
|
return this.getDBServiceByKey<T>(dataParams.dataName);
|
|
124
151
|
}
|
|
125
152
|
|
|
@@ -130,10 +157,12 @@ export class DynamoNTS_GlobalService extends DynamoNTS_SingletonService {
|
|
|
130
157
|
*/
|
|
131
158
|
static getDBServiceByKey<T extends Dynamo_Metadata>(key: string): DynamoNTS_DBService<T> {
|
|
132
159
|
const collection = this.getDBServiceCollection();
|
|
160
|
+
|
|
133
161
|
if (collection[key]) {
|
|
134
162
|
return collection[key] as DynamoNTS_DBService<T>;
|
|
135
163
|
} else {
|
|
136
164
|
let keys: string = `${Object.keys(collection)}`;
|
|
165
|
+
|
|
137
166
|
keys = keys.replace(/,/g, '\n ');
|
|
138
167
|
|
|
139
168
|
throw new Error(
|
|
@@ -153,7 +182,8 @@ export class DynamoNTS_GlobalService extends DynamoNTS_SingletonService {
|
|
|
153
182
|
if (!this.instance?.emailServiceCollection) {
|
|
154
183
|
throw new Error(
|
|
155
184
|
`\n Unique Email Service Collection missing!` +
|
|
156
|
-
`\n Please create a Unique Email Service Collection extending
|
|
185
|
+
`\n Please create a Unique Email Service Collection extending ` +
|
|
186
|
+
`DynamoBEEmailServiceCollection, ` +
|
|
157
187
|
`\n and Setup with DynamoNTS_GlobalServiceC.setServices(...)\n`
|
|
158
188
|
);
|
|
159
189
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
import { Dynamo_Log } from '@futdevpro/fsm-dynamo';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
DynamoNTS_EndpointParams
|
|
6
|
+
} from '../../_models/control-models/endpoint-params.control-model';
|
|
5
7
|
|
|
6
8
|
import { DynamoNTS_SingletonService } from '../base/singleton.service';
|
|
7
9
|
|
|
@@ -7,8 +7,12 @@ import { dynamoNTS_globalSettings } from '../../_constants/global-settings.const
|
|
|
7
7
|
import { DynamoNTS_RouteSecurity } from '../../_enums/route-security.enum';
|
|
8
8
|
import { DynamoNTS_HttpCallType } from '../../_enums/http/http-call-type.enum';
|
|
9
9
|
import { DynamoNTS_Controller } from './controller.service';
|
|
10
|
-
import {
|
|
11
|
-
|
|
10
|
+
import {
|
|
11
|
+
DynamoNTS_RoutingModuleSettings
|
|
12
|
+
} from '../../_models/interfaces/routing-module-settings.interface';
|
|
13
|
+
import {
|
|
14
|
+
DynamoNTS_EndpointParams
|
|
15
|
+
} from '../../_models/control-models/endpoint-params.control-model';
|
|
12
16
|
|
|
13
17
|
/**
|
|
14
18
|
* Routing Module
|
|
@@ -81,7 +85,9 @@ export class DynamoNTS_RoutingModule {
|
|
|
81
85
|
this.setupRoutes();
|
|
82
86
|
this.mountRoutes(set.securityOverride);
|
|
83
87
|
|
|
84
|
-
if (this.log) console.log(
|
|
88
|
+
if (this.log) console.log(
|
|
89
|
+
`routing module setup done: ${this.route} serurity: ${this.security}\n`
|
|
90
|
+
);
|
|
85
91
|
} catch (error) {
|
|
86
92
|
Dynamo_Log.error(`\nRouting module setup failed (${this.route})`, error);
|
|
87
93
|
}
|
|
@@ -91,7 +97,7 @@ export class DynamoNTS_RoutingModule {
|
|
|
91
97
|
* You must setup endpoints and required services for this function
|
|
92
98
|
*/
|
|
93
99
|
private setupRoutes(): void {
|
|
94
|
-
this.controllers.forEach((controller: DynamoNTS_Controller) => {
|
|
100
|
+
this.controllers.forEach((controller: DynamoNTS_Controller): void => {
|
|
95
101
|
this.endpoints.push(...controller.endpoints);
|
|
96
102
|
});
|
|
97
103
|
}
|
|
@@ -105,7 +111,7 @@ export class DynamoNTS_RoutingModule {
|
|
|
105
111
|
this.security = securityOverride;
|
|
106
112
|
}
|
|
107
113
|
|
|
108
|
-
this.endpoints.forEach((endpoint: DynamoNTS_EndpointParams) => {
|
|
114
|
+
this.endpoints.forEach((endpoint: DynamoNTS_EndpointParams): void => {
|
|
109
115
|
if (securityOverride) {
|
|
110
116
|
endpoint.security = securityOverride;
|
|
111
117
|
} else {
|
|
@@ -118,13 +124,16 @@ export class DynamoNTS_RoutingModule {
|
|
|
118
124
|
}
|
|
119
125
|
}
|
|
120
126
|
|
|
121
|
-
if (this.log) console.log(
|
|
127
|
+
if (this.log) console.log(
|
|
128
|
+
`endpoint mount (${endpoint.security}): ${this.route}${endpoint.endpoint}`
|
|
129
|
+
);
|
|
122
130
|
const existingEndPoints: DynamoNTS_EndpointParams[] = this.endpoints
|
|
123
|
-
.filter((ep: DynamoNTS_EndpointParams) => ep.endpoint === endpoint.endpoint);
|
|
131
|
+
.filter((ep: DynamoNTS_EndpointParams): boolean => ep.endpoint === endpoint.endpoint);
|
|
124
132
|
|
|
125
133
|
if (1 < existingEndPoints.length) {
|
|
126
|
-
|
|
127
|
-
|
|
134
|
+
const error = new Error(`ENDPOINT DUPLICATION: ${endpoint.endpoint}`);
|
|
135
|
+
const errorStack: string[] = error.stack.split('\n');
|
|
136
|
+
|
|
128
137
|
errorStack.splice(1, 4);
|
|
129
138
|
error.stack = errorStack.join('\n');
|
|
130
139
|
|
|
@@ -135,11 +144,13 @@ export class DynamoNTS_RoutingModule {
|
|
|
135
144
|
if (endpoint.security !== DynamoNTS_RouteSecurity.secure) {
|
|
136
145
|
this.mountOpenRoute(endpoint);
|
|
137
146
|
}
|
|
147
|
+
|
|
138
148
|
if (endpoint.security !== DynamoNTS_RouteSecurity.open) {
|
|
139
149
|
this.mountSecureRoute(endpoint);
|
|
140
150
|
}
|
|
141
151
|
} catch (error) {
|
|
142
152
|
Dynamo_Log.error(`\nRouting module setup failed (${this.route})`, error);
|
|
153
|
+
|
|
143
154
|
throw new Dynamo_Error({
|
|
144
155
|
errorCode: 'NTS-RM9-100',
|
|
145
156
|
addECToUserMsg: true,
|
|
@@ -147,7 +158,7 @@ export class DynamoNTS_RoutingModule {
|
|
|
147
158
|
userMessage: this.defaultErrorUserMsg,
|
|
148
159
|
issuerService: this.serviceName + ' - ' + this.route,
|
|
149
160
|
error
|
|
150
|
-
})
|
|
161
|
+
});
|
|
151
162
|
}
|
|
152
163
|
});
|
|
153
164
|
}
|
|
@@ -164,7 +175,7 @@ export class DynamoNTS_RoutingModule {
|
|
|
164
175
|
break;
|
|
165
176
|
|
|
166
177
|
case DynamoNTS_HttpCallType.post:
|
|
167
|
-
|
|
178
|
+
this.openRouter.post(endpointParams.endpoint, endpointParams.getFullExecution());
|
|
168
179
|
break;
|
|
169
180
|
|
|
170
181
|
case DynamoNTS_HttpCallType.put:
|
|
@@ -181,14 +192,16 @@ export class DynamoNTS_RoutingModule {
|
|
|
181
192
|
|
|
182
193
|
default:
|
|
183
194
|
Dynamo_Log.error(`INVALID route type: ${endpointParams.type} - ${endpointParams.name}`);
|
|
195
|
+
|
|
184
196
|
throw new Dynamo_Error({
|
|
185
197
|
errorCode: 'NTS-RM9-200',
|
|
186
198
|
addECToUserMsg: true,
|
|
187
|
-
message:
|
|
199
|
+
message:
|
|
200
|
+
`DYNAMO-NTS ERROR: INVALID route type: ${endpointParams.type} - ${endpointParams.name}`,
|
|
188
201
|
userMessage: this.defaultErrorUserMsg,
|
|
189
202
|
issuerService: this.serviceName + ' - ' + this.route,
|
|
190
203
|
error: new Error()
|
|
191
|
-
})
|
|
204
|
+
});
|
|
192
205
|
}
|
|
193
206
|
}
|
|
194
207
|
|
|
@@ -219,15 +232,19 @@ export class DynamoNTS_RoutingModule {
|
|
|
219
232
|
break;
|
|
220
233
|
|
|
221
234
|
default:
|
|
222
|
-
Dynamo_Log.error(
|
|
235
|
+
Dynamo_Log.error(
|
|
236
|
+
`DYNAMO-NTS ERROR: INVALID route type: ${endpointParams.type} - ${endpointParams.name}`
|
|
237
|
+
);
|
|
238
|
+
|
|
223
239
|
throw new Dynamo_Error({
|
|
224
240
|
errorCode: 'NTS-RM9-300',
|
|
225
241
|
addECToUserMsg: true,
|
|
226
|
-
message:
|
|
242
|
+
message:
|
|
243
|
+
`DYNAMO-NTS ERROR: INVALID route type: ${endpointParams.type} - ${endpointParams.name}`,
|
|
227
244
|
userMessage: this.defaultErrorUserMsg,
|
|
228
245
|
issuerService: this.serviceName + ' - ' + this.route,
|
|
229
246
|
error: new Error()
|
|
230
|
-
})
|
|
247
|
+
});
|
|
231
248
|
}
|
|
232
249
|
}
|
|
233
250
|
}
|
|
@@ -1,70 +1,75 @@
|
|
|
1
1
|
import { delay } from '@futdevpro/fsm-dynamo';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
DynamoNTS_AppExtendedBase_Mock, DynamoNTS_AppExtendedFull_Mock, DynamoNTS_AppWbMock_Mock
|
|
4
|
+
} from '../../_constants/mocks/app-extended-server.mock';
|
|
3
5
|
|
|
4
|
-
describe('DynamoNTS_AppExtended;', () => {
|
|
5
|
-
describe('a extended-base instance;', () => {
|
|
6
|
+
describe('DynamoNTS_AppExtended;', (): void => {
|
|
7
|
+
describe('a extended-base instance;', (): void => {
|
|
6
8
|
let app: DynamoNTS_AppExtendedBase_Mock;
|
|
7
9
|
|
|
8
|
-
beforeEach(async () => {
|
|
10
|
+
beforeEach(async (): Promise<void> => {
|
|
9
11
|
app = new DynamoNTS_AppExtendedBase_Mock();
|
|
12
|
+
|
|
13
|
+
await delay(100);
|
|
14
|
+
|
|
10
15
|
await app.ready();
|
|
11
16
|
});
|
|
12
17
|
|
|
13
|
-
afterEach(async () => {
|
|
18
|
+
afterEach(async (): Promise<void> => {
|
|
14
19
|
await app.stop();
|
|
15
20
|
|
|
16
21
|
await delay(100);
|
|
17
22
|
});
|
|
18
23
|
|
|
19
|
-
it('should be created', () => {
|
|
24
|
+
it('should be created', (): void => {
|
|
20
25
|
expect(app).toBeDefined();
|
|
21
26
|
});
|
|
22
27
|
|
|
23
|
-
it('should be started', () => {
|
|
28
|
+
it('should be started', (): void => {
|
|
24
29
|
expect(app.started).toBeTrue();
|
|
25
30
|
});
|
|
26
31
|
});
|
|
27
32
|
|
|
28
|
-
describe('a extended-full instance;', () => {
|
|
33
|
+
describe('a extended-full instance;', (): void => {
|
|
29
34
|
let app: DynamoNTS_AppExtendedFull_Mock;
|
|
30
35
|
|
|
31
|
-
beforeEach(async () => {
|
|
36
|
+
beforeEach(async (): Promise<void> => {
|
|
32
37
|
app = new DynamoNTS_AppExtendedFull_Mock();
|
|
33
38
|
await app.ready();
|
|
34
39
|
});
|
|
35
40
|
|
|
36
|
-
afterEach(async () => {
|
|
41
|
+
afterEach(async (): Promise<void> => {
|
|
37
42
|
await app.stop();
|
|
38
43
|
});
|
|
39
44
|
|
|
40
|
-
it('should be created', () => {
|
|
45
|
+
it('should be created', (): void => {
|
|
41
46
|
expect(app).toBeDefined();
|
|
42
47
|
});
|
|
43
48
|
|
|
44
|
-
it('should be started', () => {
|
|
49
|
+
it('should be started', (): void => {
|
|
45
50
|
expect(app.started).toBeTrue();
|
|
46
51
|
});
|
|
47
52
|
});
|
|
48
53
|
|
|
49
|
-
describe('a wb-mock instance;', () => {
|
|
54
|
+
describe('a wb-mock instance;', (): void => {
|
|
50
55
|
let app: DynamoNTS_AppWbMock_Mock;
|
|
51
56
|
|
|
52
|
-
beforeEach(async () => {
|
|
57
|
+
beforeEach(async (): Promise<void> => {
|
|
53
58
|
app = new DynamoNTS_AppWbMock_Mock();
|
|
54
59
|
await app.ready();
|
|
55
60
|
});
|
|
56
61
|
|
|
57
|
-
afterEach(async () => {
|
|
62
|
+
afterEach(async (): Promise<void> => {
|
|
58
63
|
await app.stop();
|
|
59
64
|
|
|
60
65
|
await delay(100);
|
|
61
66
|
});
|
|
62
67
|
|
|
63
|
-
it('should be created', () => {
|
|
68
|
+
it('should be created', (): void => {
|
|
64
69
|
expect(app).toBeDefined();
|
|
65
70
|
});
|
|
66
71
|
|
|
67
|
-
it('should be started', () => {
|
|
72
|
+
it('should be started', (): void => {
|
|
68
73
|
expect(app.started).toBeTrue();
|
|
69
74
|
});
|
|
70
75
|
});
|