@futdevpro/nts-dynamo 1.6.26 → 1.6.28

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 (28) hide show
  1. package/lib/_models/control-models/endpoint-params.control-model.d.ts +3 -3
  2. package/lib/_models/control-models/endpoint-params.control-model.d.ts.map +1 -1
  3. package/lib/_models/control-models/endpoint-params.control-model.js +1 -1
  4. package/lib/_models/control-models/endpoint-params.control-model.js.map +1 -1
  5. package/lib/_services/core/email.service.d.ts.map +1 -1
  6. package/lib/_services/core/email.service.js +1 -1
  7. package/lib/_services/core/email.service.js.map +1 -1
  8. package/lib/_services/route/routing-module.service.js +10 -10
  9. package/lib/_services/route/routing-module.service.js.map +1 -1
  10. package/lib/_services/server/app-extended.server.d.ts.map +1 -1
  11. package/lib/_services/server/app-extended.server.js +4 -0
  12. package/lib/_services/server/app-extended.server.js.map +1 -1
  13. package/lib/_services/server/app.server.d.ts.map +1 -1
  14. package/lib/_services/server/app.server.js +7 -7
  15. package/lib/_services/server/app.server.js.map +1 -1
  16. package/lib/_services/socket/socket-client.service.js +3 -3
  17. package/lib/_services/socket/socket-client.service.js.map +1 -1
  18. package/lib/_services/socket/socket-server.service.js +1 -1
  19. package/lib/_services/socket/socket-server.service.js.map +1 -1
  20. package/lib/tsconfig.tsbuildinfo +1 -1
  21. package/package.json +1 -1
  22. package/src/_models/control-models/endpoint-params.control-model.ts +3 -3
  23. package/src/_services/core/email.service.ts +2 -1
  24. package/src/_services/route/routing-module.service.ts +10 -10
  25. package/src/_services/server/app-extended.server.ts +5 -1
  26. package/src/_services/server/app.server.ts +8 -9
  27. package/src/_services/socket/socket-client.service.ts +3 -3
  28. package/src/_services/socket/socket-server.service.ts +2 -2
@@ -22,8 +22,8 @@ export class DynamoNTS_EndpointParams{
22
22
 
23
23
  pathParams: string[];
24
24
 
25
- preProcessess: ((req: Request, res: Response, next: NextFunction) => Promise<void>)[]
26
- tasks: ((req: Request, res: Response, issuer?: string) => Promise<void>)[];
25
+ private preProcessess: ((req: Request, res: Response, next: NextFunction) => Promise<void>)[]
26
+ private tasks: ((req: Request, res: Response, issuer?: string) => Promise<void>)[];
27
27
 
28
28
  logRequest: boolean;
29
29
  logRequestsContent: boolean;
@@ -151,7 +151,7 @@ export class DynamoNTS_EndpointParams{
151
151
  };
152
152
  }
153
153
 
154
- getPreProcessExecution(): ((req: Request, res: Response, next: NextFunction) => Promise<void>)[] {
154
+ getPreProcessExecutions(): ((req: Request, res: Response, next: NextFunction) => Promise<void>)[] {
155
155
  return this.preProcessess.map(
156
156
  (
157
157
  preProcess: (req: Request, res: Response, next: NextFunction) => Promise<void>
@@ -53,6 +53,7 @@ export class DynamoNTS_EmailService {
53
53
  pass: set.pass
54
54
  }
55
55
  });
56
+
56
57
  if (set.templatePaths) {
57
58
  for (let key in set.templatePaths) {
58
59
  this.loadTemplate(key, set.rootPath, set.templatePaths[key]);
@@ -69,7 +70,7 @@ export class DynamoNTS_EmailService {
69
70
  *
70
71
  */
71
72
  private constructionFinished(): void {
72
- Dynamo_Log.success(`\nEmailService construction (${this.senderName}) Finished!\n`)
73
+ Dynamo_Log.success(`\nEmailService construction (${this.senderName}) Finished!`)
73
74
  }
74
75
 
75
76
  /**
@@ -161,31 +161,31 @@ export class DynamoNTS_RoutingModule {
161
161
 
162
162
  case DynamoNTS_HttpCallType.get:
163
163
  this.openRouter.get(endpointParams.endpoint,
164
- endpointParams.preProcessess, endpointParams.getTasksExecution()
164
+ endpointParams.getPreProcessExecutions(), endpointParams.getTasksExecution()
165
165
  );
166
166
  break;
167
167
 
168
168
  case DynamoNTS_HttpCallType.post:
169
169
  this.openRouter.post(endpointParams.endpoint,
170
- endpointParams.preProcessess, endpointParams.getTasksExecution()
170
+ endpointParams.getPreProcessExecutions(), endpointParams.getTasksExecution()
171
171
  );
172
172
  break;
173
173
 
174
174
  case DynamoNTS_HttpCallType.put:
175
175
  this.openRouter.put(endpointParams.endpoint,
176
- endpointParams.preProcessess, endpointParams.getTasksExecution()
176
+ endpointParams.getPreProcessExecutions(), endpointParams.getTasksExecution()
177
177
  );
178
178
  break;
179
179
 
180
180
  case DynamoNTS_HttpCallType.patch:
181
181
  this.openRouter.patch(endpointParams.endpoint,
182
- endpointParams.preProcessess, endpointParams.getTasksExecution()
182
+ endpointParams.getPreProcessExecutions(), endpointParams.getTasksExecution()
183
183
  );
184
184
  break;
185
185
 
186
186
  case DynamoNTS_HttpCallType.delete:
187
187
  this.openRouter.delete(endpointParams.endpoint,
188
- endpointParams.preProcessess, endpointParams.getTasksExecution()
188
+ endpointParams.getPreProcessExecutions(), endpointParams.getTasksExecution()
189
189
  );
190
190
  break;
191
191
 
@@ -210,27 +210,27 @@ export class DynamoNTS_RoutingModule {
210
210
  switch(endpointParams.type) {
211
211
  case DynamoNTS_HttpCallType.get:
212
212
  this.secureRouter.get(endpointParams.endpoint,
213
- endpointParams.preProcessess, endpointParams.getTasksExecution());
213
+ endpointParams.getPreProcessExecutions(), endpointParams.getTasksExecution());
214
214
  break;
215
215
 
216
216
  case DynamoNTS_HttpCallType.post:
217
217
  this.secureRouter.post(endpointParams.endpoint,
218
- endpointParams.preProcessess, endpointParams.getTasksExecution());
218
+ endpointParams.getPreProcessExecutions(), endpointParams.getTasksExecution());
219
219
  break;
220
220
 
221
221
  case DynamoNTS_HttpCallType.put:
222
222
  this.secureRouter.put(endpointParams.endpoint,
223
- endpointParams.preProcessess, endpointParams.getTasksExecution());
223
+ endpointParams.getPreProcessExecutions(), endpointParams.getTasksExecution());
224
224
  break;
225
225
 
226
226
  case DynamoNTS_HttpCallType.patch:
227
227
  this.secureRouter.patch(endpointParams.endpoint,
228
- endpointParams.preProcessess, endpointParams.getTasksExecution());
228
+ endpointParams.getPreProcessExecutions(), endpointParams.getTasksExecution());
229
229
  break;
230
230
 
231
231
  case DynamoNTS_HttpCallType.delete:
232
232
  this.secureRouter.delete(endpointParams.endpoint,
233
- endpointParams.preProcessess, endpointParams.getTasksExecution());
233
+ endpointParams.getPreProcessExecutions(), endpointParams.getTasksExecution());
234
234
  break;
235
235
 
236
236
  default:
@@ -161,7 +161,11 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
161
161
  }
162
162
 
163
163
  await this.ready();
164
-
164
+
165
+ if (this.params.title) {
166
+ console.log(this.params.title);
167
+ console.log(`Version: ${this.params.version}`);
168
+ }
165
169
  Dynamo_Log.testSuccess(`${this.params.name} started successfully.`);
166
170
 
167
171
  } catch (error) {
@@ -6,7 +6,7 @@ import * as Https from 'https';
6
6
  import * as FileSystem from 'fs';
7
7
  import * as BodyParser from 'body-parser';
8
8
 
9
- import { delay, Dynamo_Array, Dynamo_Error, Dynamo_Log, second, wait } from '@futdevpro/fsm-dynamo';
9
+ import { Dynamo_Array, Dynamo_Error, Dynamo_Log, second, wait } from '@futdevpro/fsm-dynamo';
10
10
 
11
11
  import { DynamoNTS_SingletonService } from '../base/singleton.service';
12
12
  import { DynamoNTS_RouteSecurity } from '../../_enums/route-security.enum';
@@ -18,7 +18,6 @@ import { DynamoNTS_GlobalServiceSettings } from '../../_models/interfaces/global
18
18
  import { dynamoNTS_globalSettings } from '../../_constants/global-settings.const';
19
19
  import { DynamoNTS_AppParams } from '../../_models/control-models/app-params.control-model';
20
20
  import { DynamoNTS_EndpointParams } from '../../_models/control-models/endpoint-params.control-model';
21
- import { DynamoNTS_SystemControl } from '../../_models/control-models/system-control.control-model';
22
21
  import { DynamoNTS_AppSystemControls } from '../../_models/control-models/app-system-controls.control-model';
23
22
 
24
23
 
@@ -260,10 +259,6 @@ export abstract class DynamoNTS_App extends DynamoNTS_SingletonService {
260
259
  }
261
260
 
262
261
  console.log(`\n\n\nStarting ${this._params.name}... `);
263
- if (this._params.title) {
264
- console.log(this._params.title);
265
- }
266
- console.log(`Version: ${this._params.version}`);
267
262
 
268
263
  await this.startDB();
269
264
 
@@ -297,7 +292,11 @@ export abstract class DynamoNTS_App extends DynamoNTS_SingletonService {
297
292
  if (!extended) {
298
293
  await this.ready();
299
294
 
300
- Dynamo_Log.testSuccess(`${this._params.name} started successfully.`);
295
+ if (this.params.title) {
296
+ console.log(this.params.title);
297
+ console.log(`Version: ${this.params.version}`);
298
+ }
299
+ Dynamo_Log.testSuccess(`${this.params.name} started successfully.`);
301
300
  }
302
301
  } catch (error) {
303
302
  this.constructErrors.push(error);
@@ -607,7 +606,7 @@ export abstract class DynamoNTS_App extends DynamoNTS_SingletonService {
607
606
  this.httpsServer
608
607
  .listen(this._ports.httpsPort, 'localhost', 0, () => {
609
608
  this.systemControls.httpsServer.started = true;
610
- Dynamo_Log.success(`\nHTTPS (secure) server is listening on port ${this._ports.httpsPort}`);
609
+ Dynamo_Log.success(`\nHTTPS (secure) server is listening on port: ${this._ports.httpsPort}`);
611
610
  resolve();
612
611
  })
613
612
  .on('error', (error) => {
@@ -641,7 +640,7 @@ export abstract class DynamoNTS_App extends DynamoNTS_SingletonService {
641
640
  this.httpServer = this.openExpress
642
641
  .listen(this._ports.httpPort, () => {
643
642
  this.systemControls.httpServer.started = true;
644
- Dynamo_Log.success(`\nHTTP (open) server is listening on port ${this._ports.httpPort}`);
643
+ Dynamo_Log.success(`\nHTTP (open) server is listening on port: ${this._ports.httpPort}`);
645
644
  resolve();
646
645
  })
647
646
  .on('error', (error) => {
@@ -33,7 +33,7 @@ export abstract class DynamoNTS_SocketClientService extends DynamoNTS_SingletonS
33
33
  tasks: [
34
34
  async () => {
35
35
  this._connected = true;
36
- console.log(`Socket Client connected: ${this.params.name}`);
36
+ Dynamo_Log.success(`Socket Client connected: ${this.params.name}`);
37
37
  }
38
38
  ]
39
39
  }),
@@ -42,7 +42,7 @@ export abstract class DynamoNTS_SocketClientService extends DynamoNTS_SingletonS
42
42
  tasks: [
43
43
  async () => {
44
44
  this._connected = false;
45
- console.log(`Socket Client disconnected: ${this.params.name}`);
45
+ Dynamo_Log.warn(`Socket Client disconnected: ${this.params.name}`);
46
46
 
47
47
  if (this._params.reconnect) {
48
48
  await delay(this._params.reconnectDelay);
@@ -55,7 +55,7 @@ export abstract class DynamoNTS_SocketClientService extends DynamoNTS_SingletonS
55
55
  eventType: DynamoNTS_SocketEventType.error,
56
56
  tasks: [
57
57
  async (content: any) => {
58
- console.log(`Socket Client error: ${this.params.name}`, content);
58
+ Dynamo_Log.error(`Socket Client error: ${this.params.name}`, content);
59
59
  }
60
60
  ]
61
61
  }),
@@ -215,8 +215,8 @@ export abstract class DynamoNTS_SocketServerService<
215
215
  this.secureSocketServer.listen(this.params.port);
216
216
  } */
217
217
 
218
- console.log(
219
- `\nsocket service setup finished: ${this.params.name}` +
218
+ Dynamo_Log.success(
219
+ `\nsocket server setup finished: ${this.params.name}` +
220
220
  `\nsocket server listening on port: ${this.params.port}`
221
221
  );
222
222