@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.
Files changed (129) hide show
  1. package/.eslintrc.json +171 -0
  2. package/lib/_constants/mocks/app-extended-server.mock.d.ts.map +1 -1
  3. package/lib/_constants/mocks/app-extended-server.mock.js.map +1 -1
  4. package/lib/_constants/mocks/app-server.mock.d.ts.map +1 -1
  5. package/lib/_constants/mocks/app-server.mock.js.map +1 -1
  6. package/lib/_constants/mocks/data-model.mock.d.ts.map +1 -1
  7. package/lib/_constants/mocks/data-model.mock.js.map +1 -1
  8. package/lib/_constants/mocks/email-service-collection.mock.d.ts.map +1 -1
  9. package/lib/_constants/mocks/email-service-collection.mock.js.map +1 -1
  10. package/lib/_constants/mocks/email-service.mock.js +3 -3
  11. package/lib/_constants/mocks/email-service.mock.js.map +1 -1
  12. package/lib/_constants/mocks/endpoint.mock.d.ts.map +1 -1
  13. package/lib/_constants/mocks/endpoint.mock.js.map +1 -1
  14. package/lib/_constants/mocks/socket-server.mock.d.ts.map +1 -1
  15. package/lib/_constants/mocks/socket-server.mock.js.map +1 -1
  16. package/lib/_enums/index.js +1 -1
  17. package/lib/_enums/index.js.map +1 -1
  18. package/lib/_models/control-models/api-call-params.control-model.d.ts +2 -2
  19. package/lib/_models/control-models/api-call-params.control-model.d.ts.map +1 -1
  20. package/lib/_models/control-models/api-call-params.control-model.js.map +1 -1
  21. package/lib/_models/control-models/app-system-controls.control-model copy.d.ts.map +1 -1
  22. package/lib/_models/control-models/app-system-controls.control-model copy.js.map +1 -1
  23. package/lib/_models/control-models/app-system-controls.control-model.d.ts.map +1 -1
  24. package/lib/_models/control-models/app-system-controls.control-model.js.map +1 -1
  25. package/lib/_models/control-models/endpoint-params.control-model.d.ts.map +1 -1
  26. package/lib/_models/control-models/endpoint-params.control-model.js +15 -9
  27. package/lib/_models/control-models/endpoint-params.control-model.js.map +1 -1
  28. package/lib/_models/control-models/http-settings.control-model.d.ts +1 -1
  29. package/lib/_models/control-models/http-settings.control-model.d.ts.map +1 -1
  30. package/lib/_models/control-models/http-settings.control-model.js +3 -1
  31. package/lib/_models/control-models/http-settings.control-model.js.map +1 -1
  32. package/lib/_models/control-models/socket-client-service-params.control-model.js.map +1 -1
  33. package/lib/_models/control-models/socket-event.control-model.js.map +1 -1
  34. package/lib/_models/control-models/socket-presence.control-model.js.map +1 -1
  35. package/lib/_modules/custom-data/custom-data.controller.d.ts.map +1 -1
  36. package/lib/_modules/custom-data/custom-data.controller.js +2 -1
  37. package/lib/_modules/custom-data/custom-data.controller.js.map +1 -1
  38. package/lib/_modules/custom-data/get-custom-data-routing-module.util.d.ts.map +1 -1
  39. package/lib/_modules/custom-data/get-custom-data-routing-module.util.js.map +1 -1
  40. package/lib/_modules/test/get-test-routing-module.util.d.ts.map +1 -1
  41. package/lib/_modules/test/get-test-routing-module.util.js.map +1 -1
  42. package/lib/_modules/test/test.controller.d.ts.map +1 -1
  43. package/lib/_modules/test/test.controller.js.map +1 -1
  44. package/lib/_modules/usage/get-usage-routing-module.util.d.ts.map +1 -1
  45. package/lib/_modules/usage/get-usage-routing-module.util.js +1 -1
  46. package/lib/_modules/usage/get-usage-routing-module.util.js.map +1 -1
  47. package/lib/_modules/usage/usage.controller.d.ts.map +1 -1
  48. package/lib/_modules/usage/usage.controller.js +15 -14
  49. package/lib/_modules/usage/usage.controller.js.map +1 -1
  50. package/lib/_modules/usage/usage.data-service.d.ts +3 -1
  51. package/lib/_modules/usage/usage.data-service.d.ts.map +1 -1
  52. package/lib/_modules/usage/usage.data-service.js +24 -16
  53. package/lib/_modules/usage/usage.data-service.js.map +1 -1
  54. package/lib/_services/base/data.service.d.ts.map +1 -1
  55. package/lib/_services/base/data.service.js +45 -23
  56. package/lib/_services/base/data.service.js.map +1 -1
  57. package/lib/_services/base/db.service.d.ts.map +1 -1
  58. package/lib/_services/base/db.service.js +82 -53
  59. package/lib/_services/base/db.service.js.map +1 -1
  60. package/lib/_services/base/singleton.service.d.ts.map +1 -1
  61. package/lib/_services/base/singleton.service.js.map +1 -1
  62. package/lib/_services/core/api.service.d.ts +21 -13
  63. package/lib/_services/core/api.service.d.ts.map +1 -1
  64. package/lib/_services/core/api.service.js +192 -143
  65. package/lib/_services/core/api.service.js.map +1 -1
  66. package/lib/_services/core/auth.service.d.ts.map +1 -1
  67. package/lib/_services/core/auth.service.js.map +1 -1
  68. package/lib/_services/core/email.service.d.ts +50 -36
  69. package/lib/_services/core/email.service.d.ts.map +1 -1
  70. package/lib/_services/core/email.service.js +329 -94
  71. package/lib/_services/core/email.service.js.map +1 -1
  72. package/lib/_services/core/global.service.d.ts.map +1 -1
  73. package/lib/_services/core/global.service.js +30 -19
  74. package/lib/_services/core/global.service.js.map +1 -1
  75. package/lib/_services/route/controller.service.d.ts.map +1 -1
  76. package/lib/_services/route/controller.service.js.map +1 -1
  77. package/lib/_services/route/routing-module.service.d.ts.map +1 -1
  78. package/lib/_services/route/routing-module.service.js +2 -2
  79. package/lib/_services/route/routing-module.service.js.map +1 -1
  80. package/lib/_services/server/app-extended.server.d.ts.map +1 -1
  81. package/lib/_services/server/app-extended.server.js +19 -14
  82. package/lib/_services/server/app-extended.server.js.map +1 -1
  83. package/lib/_services/server/app-extended.server.spec.js +1 -0
  84. package/lib/_services/server/app-extended.server.spec.js.map +1 -1
  85. package/lib/_services/server/app.server.d.ts +4 -3
  86. package/lib/_services/server/app.server.d.ts.map +1 -1
  87. package/lib/_services/server/app.server.js +107 -52
  88. package/lib/_services/server/app.server.js.map +1 -1
  89. package/lib/_services/server/app.server.spec.js +1 -0
  90. package/lib/_services/server/app.server.spec.js.map +1 -1
  91. package/lib/_services/shared.static-service.js.map +1 -1
  92. package/lib/_services/socket/socket-client.service.js.map +1 -1
  93. package/lib/_services/socket/socket-server.service.js.map +1 -1
  94. package/lib/tsconfig.tsbuildinfo +1 -1
  95. package/nodemon.json +3 -1
  96. package/package.json +9 -8
  97. package/src/_constants/mocks/app-extended-server.mock.ts +6 -2
  98. package/src/_constants/mocks/app-server.mock.ts +7 -1
  99. package/src/_constants/mocks/data-model.mock.ts +2 -2
  100. package/src/_constants/mocks/email-service-collection.mock.ts +2 -1
  101. package/src/_constants/mocks/email-service.mock.ts +2 -2
  102. package/src/_constants/mocks/endpoint.mock.ts +28 -26
  103. package/src/_constants/mocks/socket-server.mock.ts +12 -4
  104. package/src/_enums/index.ts +1 -1
  105. package/src/_models/control-models/api-call-params.control-model.ts +3 -2
  106. package/src/_models/control-models/app-system-controls.control-model copy.ts +1 -1
  107. package/src/_models/control-models/app-system-controls.control-model.ts +1 -1
  108. package/src/_models/control-models/endpoint-params.control-model.ts +39 -16
  109. package/src/_models/control-models/http-settings.control-model.ts +4 -2
  110. package/src/_modules/custom-data/custom-data.controller.ts +55 -51
  111. package/src/_modules/custom-data/get-custom-data-routing-module.util.ts +7 -3
  112. package/src/_modules/test/get-test-routing-module.util.ts +7 -3
  113. package/src/_modules/test/test.controller.ts +98 -96
  114. package/src/_modules/usage/get-usage-routing-module.util.ts +8 -4
  115. package/src/_modules/usage/usage.controller.ts +108 -102
  116. package/src/_modules/usage/usage.data-service.ts +54 -28
  117. package/src/_services/base/data.service.ts +133 -34
  118. package/src/_services/base/db.service.ts +254 -171
  119. package/src/_services/base/singleton.service.ts +1 -1
  120. package/src/_services/core/api.service.ts +348 -218
  121. package/src/_services/core/auth.service.ts +2 -0
  122. package/src/_services/core/email.service.ts +537 -129
  123. package/src/_services/core/global.service.ts +56 -26
  124. package/src/_services/route/controller.service.ts +3 -1
  125. package/src/_services/route/routing-module.service.ts +33 -16
  126. package/src/_services/server/app-extended.server.spec.ts +22 -17
  127. package/src/_services/server/app-extended.server.ts +108 -45
  128. package/src/_services/server/app.server.spec.ts +17 -12
  129. package/src/_services/server/app.server.ts +264 -138
@@ -8,7 +8,9 @@ import { DynamoNTS_App } from './app.server';
8
8
  import { DynamoNTS_RouteSecurity } from '../../_enums/route-security.enum';
9
9
  import { DynamoNTS_SocketServerService } from '../socket/socket-server.service';
10
10
  import { DynamoNTS_SocketSecurity } from '../../_enums/socket-security.enum';
11
- import { DynamoNTS_AppExtSysControls } from '../../_models/control-models/app-system-controls.control-model copy';
11
+ import {
12
+ DynamoNTS_AppExtSysControls
13
+ } from '../../_models/control-models/app-system-controls.control-model copy';
12
14
 
13
15
  /**
14
16
  * This will be the MAIN service of our server project,
@@ -136,8 +138,8 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
136
138
  constructor(){
137
139
  super(true);
138
140
 
139
- this.asyncConstructExt().catch((error: any) => {
140
- Dynamo_Log.error(
141
+ this.asyncConstructExt().catch((error: any): void => {
142
+ Dynamo_Log.H_error(
141
143
  `\nExtended Application: ${this.params?.name} start failed.` +
142
144
  `\n`, error,
143
145
  '\n'
@@ -156,7 +158,10 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
156
158
  this.setSocketSecurity();
157
159
 
158
160
  await this.setupSocketServerServices();
159
- if (this.logSetup) console.log(`\nAll sockets setted up.... sockets using security: ${this.socketSecurity}`);
161
+
162
+ if (this.logSetup) console.log(
163
+ `\nAll sockets setted up.... sockets using security: ${this.socketSecurity}`
164
+ );
160
165
  } else {
161
166
  Dynamo_Log.testWarn(
162
167
  'No socketServices setted up while using Extended Application.',
@@ -173,11 +178,12 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
173
178
  Dynamo_Log.H_success(`${this.params.name} started successfully.`);
174
179
 
175
180
  } catch (error) {
176
- Dynamo_Log.error(
181
+ Dynamo_Log.H_error(
177
182
  `\nExtended Application: ${this.params?.name} start failed.` +
178
183
  `\n`, error,
179
184
  '\n'
180
185
  );
186
+
181
187
  throw new Dynamo_Error({
182
188
  errorCode: 'NTS-AES-001',
183
189
  error: error,
@@ -207,7 +213,12 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
207
213
  const start: number = +new Date();
208
214
 
209
215
  if (this.constructErrors.length) {
210
- Dynamo_Log.error(`Extended Application: ${this.params?.name} start failed. ERRORS`, this.constructErrors, '\n');
216
+ Dynamo_Log.H_error(
217
+ `Extended Application: ${this.params?.name} start failed. ERRORS`,
218
+ this.constructErrors,
219
+ '\n'
220
+ );
221
+
211
222
  throw new Dynamo_Error({
212
223
  message: `${this.params?.name} start failed. ERRORS`,
213
224
  additionalContent: this.constructErrors,
@@ -232,7 +243,12 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
232
243
  }
233
244
 
234
245
  if (this.constructErrors.length) {
235
- Dynamo_Log.error(`Extended Application: ${this.params?.name} start failed. TIMEOUT`, this.constructErrors, '\n');
246
+ Dynamo_Log.H_error(
247
+ `Extended Application: ${this.params?.name} start failed. TIMEOUT`,
248
+ this.constructErrors,
249
+ '\n'
250
+ );
251
+
236
252
  throw new Dynamo_Error({
237
253
  message: `${this.params?.name} start failed. TIMEOUT`,
238
254
  additionalContent: this.constructErrors,
@@ -244,19 +260,29 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
244
260
  this.systemControlsExt.appExtended.started = true;
245
261
 
246
262
  if (this.logFn && this.deepLog) console.log('\nfn:. ready-extended: return');
263
+
247
264
  return;
248
265
  } else {
249
266
  this.systemControlsExt.appExtended.started = false;
250
267
 
251
268
  let msg: string = `${this.params?.name} start failed. UNKNOWN`;
252
- if (this.systemControlsExt.httpSocketServer.init && !this.systemControlsExt.httpSocketServer.started) {
269
+
270
+ if (
271
+ this.systemControlsExt.httpSocketServer.init &&
272
+ !this.systemControlsExt.httpSocketServer.started
273
+ ) {
253
274
  msg += '\nhttpSocketServer start failed.';
254
275
  }
255
- if (this.systemControlsExt.httpsSocketServer.init && !this.systemControlsExt.httpsSocketServer.started) {
276
+
277
+ if (
278
+ this.systemControlsExt.httpsSocketServer.init &&
279
+ !this.systemControlsExt.httpsSocketServer.started
280
+ ) {
256
281
  msg += '\nhttpsSocketServer start failed.';
257
282
  }
258
283
 
259
284
  Dynamo_Log.error(msg, this.constructErrors, '\n');
285
+
260
286
  throw new Dynamo_Error({
261
287
  errorCode: 'NTS-AES-110',
262
288
  message: msg,
@@ -281,30 +307,34 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
281
307
 
282
308
  override async stop(): Promise<void> {
283
309
  if (this.logFn) console.log('\nfn:. stop-extended');
310
+
284
311
  if (this.started) {
285
312
  await super.stop(true);
286
313
 
287
314
  this.systemControlsExt.httpSocketServer.started = false;
288
315
  this.systemControlsExt.httpsSocketServer.started = false;
289
- await Dynamo_Array.asyncForEach(this.allSocketServers, async (socketServer: SocketIO.Server) => {
290
- await new Promise<void>((resolve, reject) => {
291
- socketServer.disconnectSockets(true);
292
- socketServer.close((err) => {
293
- if (err) {
294
- Dynamo_Log.error(`\nHTTP socket server close error`, err);
295
- reject(
296
- new Dynamo_Error({
297
- errorCode: 'NTS-AES-120',
298
- message: `SocketServer close failed.`,
299
- error: err
300
- })
301
- );
302
- } else {
303
- resolve();
304
- }
316
+ await Dynamo_Array.asyncForEach(
317
+ this.allSocketServers,
318
+ async (socketServer: SocketIO.Server): Promise<void> => {
319
+ await new Promise<void>((resolve, reject): void => {
320
+ socketServer.disconnectSockets(true);
321
+ socketServer.close((err): void => {
322
+ if (err) {
323
+ Dynamo_Log.error(`\nHTTP socket server close error`, err);
324
+ reject(
325
+ new Dynamo_Error({
326
+ errorCode: 'NTS-AES-120',
327
+ message: `SocketServer close failed.`,
328
+ error: err
329
+ })
330
+ );
331
+ } else {
332
+ resolve();
333
+ }
334
+ });
305
335
  });
306
- });
307
- });
336
+ }
337
+ );
308
338
  this.systemControlsExt.httpSocketServer.init = false;
309
339
  this.systemControlsExt.httpsSocketServer.init = false;
310
340
 
@@ -317,10 +347,13 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
317
347
  */
318
348
  private setSocketSecurity(): void {
319
349
  if (this.logFn) console.log('\nfn:. setSocketSecurity');
320
- this.socketServices.forEach((service: DynamoNTS_SocketServerService<any>) => {
350
+ this.socketServices.forEach((service: DynamoNTS_SocketServerService<any>): void => {
321
351
  if (!this.socketSecurity) {
322
352
  this.socketSecurity = DynamoNTS_RouteSecurity[service.security];
323
- } else if (this.socketSecurity !== DynamoNTS_RouteSecurity.both && this.socketSecurity !== DynamoNTS_RouteSecurity[service.security]) {
353
+ } else if (
354
+ this.socketSecurity !== DynamoNTS_RouteSecurity.both &&
355
+ this.socketSecurity !== DynamoNTS_RouteSecurity[service.security]
356
+ ) {
324
357
  this.socketSecurity = DynamoNTS_RouteSecurity.both;
325
358
  }
326
359
  });
@@ -333,10 +366,12 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
333
366
  try {
334
367
  if (this.logFn) console.log('\nfn:. setupSocketServerServices');
335
368
  /* let httpServer: Http.Server; */
369
+
336
370
  if (this.socketSecurity !== DynamoNTS_RouteSecurity.secure) {
337
371
  if (!this.openExpress) {
338
372
  await this.initOpenExpress();
339
373
  }
374
+
340
375
  if (!this.httpSocketServer) {
341
376
  this.httpSocketServer = Http.createServer(this.openExpress);
342
377
  }
@@ -357,18 +392,20 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
357
392
  `\nin DynamoBEServer - setupRoutingModules() to enable secure routes.`;
358
393
 
359
394
  errorMsg += '\n\nThe socket services setted to use secure server:';
360
- this.socketServices.forEach((service: DynamoNTS_SocketServerService<any>) => {
395
+ this.socketServices.forEach((service: DynamoNTS_SocketServerService<any>): void => {
361
396
  if (service.security != DynamoNTS_SocketSecurity.open) {
362
397
  errorMsg += `\n ${service?.name} (port: ${service.port})`;
363
398
  }
364
399
  });
365
400
 
366
- let error = new Error('Secure routes cannot be established!');
367
- let errorStack: string[] = error.stack.split('\n');
401
+ const error = new Error('Secure routes cannot be established!');
402
+ const errorStack: string[] = error.stack.split('\n');
403
+
368
404
  errorStack.splice(1, 2);
369
405
  error.stack = errorStack.join('\n');
370
406
 
371
407
  Dynamo_Log.error(errorMsg);
408
+
372
409
  throw error;
373
410
  }
374
411
  }
@@ -376,25 +413,33 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
376
413
 
377
414
  await Dynamo_Array.asyncForEach(
378
415
  this.socketServices,
379
- async (service: DynamoNTS_SocketServerService<any>) => {
416
+ async (service: DynamoNTS_SocketServerService<any>): Promise<void> => {
380
417
  try {
381
418
  this.systemControlsExt.httpSocketServer.init = true;
382
419
  const existingPorts: DynamoNTS_SocketServerService<any>[] = this.socketServices.filter(
383
- (mod: DynamoNTS_SocketServerService<any>) => mod.port === service.port
420
+ (mod: DynamoNTS_SocketServerService<any>): boolean => mod.port === service.port
384
421
  );
385
422
 
386
- if (1 < existingPorts.length || this.portSettings.httpPort === service.port || this.portSettings.httpsPort === service.port) {
387
- let error = new Error(`PORT DUPLICATION: ${service.port}`);
388
- let errorStack: string[] = error.stack.split('\n');
423
+ if (
424
+ 1 < existingPorts.length ||
425
+ this.portSettings.httpPort === service.port ||
426
+ this.portSettings.httpsPort === service.port
427
+ ) {
428
+ const error = new Error(`PORT DUPLICATION: ${service.port}`);
429
+ const errorStack: string[] = error.stack.split('\n');
430
+
389
431
  errorStack.splice(1, 4);
390
432
  error.stack = errorStack.join('\n');
391
433
 
392
434
  Dynamo_Log.error(`\n${error.message}`);
435
+
393
436
  throw error;
394
437
  }
395
438
 
396
439
  if (service.security === DynamoNTS_SocketSecurity.open) {
397
- if (this.logSetup) console.log(`\nsocket setup (open): ${service?.name}:${service.port}`);
440
+ if (this.logSetup) console.log(
441
+ `\nsocket setup (open): ${service?.name}:${service.port}`
442
+ );
398
443
  this.httpSocketSettingUpCount++;
399
444
  this.systemControlsExt.httpSocketServer.started = false;
400
445
 
@@ -402,8 +447,9 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
402
447
  await service.setupSocketServer(
403
448
  new SocketIO.Server(this.httpSocketServer),
404
449
  DynamoNTS_SocketSecurity.open,
405
- () => {
450
+ (): void => {
406
451
  this.httpSocketSettingUpCount--;
452
+
407
453
  if (this.httpSocketSettingUpCount === 0) {
408
454
  this.systemControlsExt.httpSocketServer.started = true;
409
455
  }
@@ -412,7 +458,9 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
412
458
  );
413
459
 
414
460
  } else if (service.security === DynamoNTS_SocketSecurity.secure) {
415
- if (this.logSetup) console.log(`\nsocket setup (secure): ${service?.name}:${service.port}`);
461
+ if (this.logSetup) console.log(
462
+ `\nsocket setup (secure): ${service?.name}:${service.port}`
463
+ );
416
464
  this.httpsSocketSettingUpCount++;
417
465
  this.systemControlsExt.httpsSocketServer.started = false;
418
466
 
@@ -420,8 +468,9 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
420
468
  await service.setupSocketServer(
421
469
  new SocketIO.Server(this.httpsServer),
422
470
  DynamoNTS_SocketSecurity.secure,
423
- () => {
471
+ (): void => {
424
472
  this.httpsSocketSettingUpCount--;
473
+
425
474
  if (this.httpsSocketSettingUpCount === 0) {
426
475
  this.systemControlsExt.httpsSocketServer.started = true;
427
476
  }
@@ -430,22 +479,36 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
430
479
  );
431
480
 
432
481
  } else {
433
- let error = new Error(`INVALID Socket Service security: ${service.security} on ${service?.name}`);
434
- let errorStack: string[] = error.stack.split('\n');
482
+ const error = new Error(
483
+ `INVALID Socket Service security: ${service.security} on ${service?.name}`
484
+ );
485
+ const errorStack: string[] = error.stack.split('\n');
486
+
435
487
  errorStack.splice(1, 4);
436
488
  error.stack = errorStack.join('\n');
437
489
 
438
490
  Dynamo_Log.error(`\n${error.message}`);
491
+
439
492
  throw error;
440
493
  }
441
494
  } catch (error) {
442
- Dynamo_Log.error(`\nSocket Server service setup failed. (${service?.name})\n`, error, '\n');
495
+ Dynamo_Log.error(
496
+ `\nSocket Server service setup failed. (${service?.name})\n`,
497
+ error,
498
+ '\n'
499
+ );
500
+
443
501
  throw error;
444
502
  }
445
503
  }
446
504
  );
447
505
  } catch (error) {
448
- Dynamo_Log.error(`\nSocket Server services setup failed. (${this.socketServices?.length} services)\n`, error, '\n');
506
+ Dynamo_Log.error(
507
+ `\nSocket Server services setup failed. (${this.socketServices?.length} services)\n`,
508
+ error,
509
+ '\n'
510
+ );
511
+
449
512
  throw error;
450
513
  }
451
514
  }
@@ -1,41 +1,46 @@
1
1
 
2
2
  import { Dynamo_Log, delay } from '@futdevpro/fsm-dynamo';
3
- import { DynamoNTS_AppBase_Mock, DynamoNTS_AppFull_Mock } from '../../_constants/mocks/app-server.mock';
3
+ import {
4
+ DynamoNTS_AppBase_Mock, DynamoNTS_AppFull_Mock
5
+ } from '../../_constants/mocks/app-server.mock';
4
6
 
5
- describe('DynamoNTS_App AND DynamoNTS_AppExtended?;', () => {
7
+ describe('DynamoNTS_App AND DynamoNTS_AppExtended?;', (): void => {
6
8
  // jasmine.DEFAULT_TIMEOUT_INTERVAL = 15 * second;
7
9
 
8
- describe('a base instance;', () => {
10
+ describe('a base instance;', (): void => {
9
11
  let app: DynamoNTS_AppBase_Mock;
10
12
 
11
- beforeEach(async () => {
13
+ beforeEach(async (): Promise<void> => {
12
14
  try {
13
15
  app = new DynamoNTS_AppBase_Mock();
16
+
17
+ await delay(100);
18
+
14
19
  await app.ready();
15
20
  } catch (error) {
16
21
  Dynamo_Log.test('error', error);
17
22
  }
18
23
  });
19
24
 
20
- afterEach(async () => {
25
+ afterEach(async (): Promise<void> => {
21
26
  await app.stop();
22
27
 
23
28
  await delay(100);
24
29
  });
25
30
 
26
- it('should be created', () => {
31
+ it('should be created', (): void => {
27
32
  expect(app).toBeDefined();
28
33
  });
29
34
 
30
- it('should be started', () => {
35
+ it('should be started', (): void => {
31
36
  expect(app.started).toBeTrue();
32
37
  });
33
38
  });
34
39
 
35
- describe('a full instance;', () => {
40
+ describe('a full instance;', (): void => {
36
41
  let app: DynamoNTS_AppFull_Mock;
37
42
 
38
- beforeEach(async () => {
43
+ beforeEach(async (): Promise<void> => {
39
44
  try {
40
45
  app = new DynamoNTS_AppFull_Mock();
41
46
  await app.ready();
@@ -44,17 +49,17 @@ describe('DynamoNTS_App AND DynamoNTS_AppExtended?;', () => {
44
49
  }
45
50
  });
46
51
 
47
- afterEach(async () => {
52
+ afterEach(async (): Promise<void> => {
48
53
  await app.stop();
49
54
 
50
55
  await delay(100);
51
56
  });
52
57
 
53
- it('should be created', () => {
58
+ it('should be created', (): void => {
54
59
  expect(app).toBeDefined();
55
60
  });
56
61
 
57
- it('should be started', () => {
62
+ it('should be started', (): void => {
58
63
  expect(app.started).toBeTrue();
59
64
  });
60
65
  });