@futdevpro/nts-dynamo 1.6.23 → 1.6.24
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/_services/server/app-extended.server.d.ts.map +1 -1
- package/lib/_services/server/app-extended.server.js +11 -3
- package/lib/_services/server/app-extended.server.js.map +1 -1
- package/lib/_services/server/app.server.d.ts +1 -1
- package/lib/_services/server/app.server.d.ts.map +1 -1
- package/lib/_services/server/app.server.js +11 -5
- package/lib/_services/server/app.server.js.map +1 -1
- package/lib/_services/socket/socket-client.service.d.ts +2 -1
- package/lib/_services/socket/socket-client.service.d.ts.map +1 -1
- package/lib/_services/socket/socket-client.service.js +7 -2
- package/lib/_services/socket/socket-client.service.js.map +1 -1
- package/lib/_services/socket/socket-server.service.d.ts.map +1 -1
- package/lib/_services/socket/socket-server.service.js +2 -1
- package/lib/_services/socket/socket-server.service.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/_services/server/app-extended.server.ts +9 -2
- package/src/_services/server/app.server.ts +12 -8
- package/src/_services/socket/socket-client.service.ts +6 -2
- package/src/_services/socket/socket-server.service.ts +1 -0
|
@@ -164,6 +164,7 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
|
|
|
164
164
|
|
|
165
165
|
Dynamo_Log.test(`${this.params.name} started successfully.`);
|
|
166
166
|
} catch (error) {
|
|
167
|
+
Dynamo_Log.error(`\nExtended Application: ${this.params?.name} start failed.\n`, error, '\n');
|
|
167
168
|
throw new Dynamo_Error({
|
|
168
169
|
errorCode: 'NTS-AES-001',
|
|
169
170
|
error: error,
|
|
@@ -208,9 +209,13 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
|
|
|
208
209
|
this.systemControlsExt.httpSocketServer.getReady() &&
|
|
209
210
|
this.systemControlsExt.httpsSocketServer.getReady()
|
|
210
211
|
);
|
|
212
|
+
} else {
|
|
213
|
+
Dynamo_Log.error(`${this.params.name} APP NOT INITIALIZED while trying to get ready.`);
|
|
211
214
|
}
|
|
212
215
|
|
|
213
|
-
|
|
216
|
+
if (!ready) {
|
|
217
|
+
await wait(100);
|
|
218
|
+
}
|
|
214
219
|
}
|
|
215
220
|
|
|
216
221
|
if (this.constructErrors.length) {
|
|
@@ -344,13 +349,13 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
|
|
|
344
349
|
errorMsg += `\n ${service?.name} (port: ${service.port})`;
|
|
345
350
|
}
|
|
346
351
|
});
|
|
347
|
-
Dynamo_Log.error(errorMsg);
|
|
348
352
|
|
|
349
353
|
let error = new Error('Secure routes cannot be established!');
|
|
350
354
|
let errorStack: string[] = error.stack.split('\n');
|
|
351
355
|
errorStack.splice(1, 2);
|
|
352
356
|
error.stack = errorStack.join('\n');
|
|
353
357
|
|
|
358
|
+
Dynamo_Log.error(errorMsg);
|
|
354
359
|
throw error;
|
|
355
360
|
}
|
|
356
361
|
}
|
|
@@ -371,6 +376,7 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
|
|
|
371
376
|
errorStack.splice(1, 4);
|
|
372
377
|
error.stack = errorStack.join('\n');
|
|
373
378
|
|
|
379
|
+
Dynamo_Log.error(`\n${error.message}`);
|
|
374
380
|
throw error;
|
|
375
381
|
}
|
|
376
382
|
|
|
@@ -416,6 +422,7 @@ export abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
|
|
|
416
422
|
errorStack.splice(1, 4);
|
|
417
423
|
error.stack = errorStack.join('\n');
|
|
418
424
|
|
|
425
|
+
Dynamo_Log.error(`\n${error.message}`);
|
|
419
426
|
throw error;
|
|
420
427
|
}
|
|
421
428
|
} catch (error) {
|
|
@@ -208,11 +208,9 @@ export abstract class DynamoNTS_App extends DynamoNTS_SingletonService {
|
|
|
208
208
|
protected httpServer: Http.Server;
|
|
209
209
|
|
|
210
210
|
private globalService: DynamoNTS_GlobalService;
|
|
211
|
+
private _rootServices: DynamoNTS_SingletonService[] = [];
|
|
211
212
|
|
|
212
213
|
private _routingModules: DynamoNTS_RoutingModule[] = [];
|
|
213
|
-
/* protected get routingModules(): DynamoNTS_RoutingModule[] { return this._routingModules; } */
|
|
214
|
-
|
|
215
|
-
private _rootServices: DynamoNTS_SingletonService[] = [];
|
|
216
214
|
|
|
217
215
|
/**
|
|
218
216
|
* setting this value to true, enables this service debug logs
|
|
@@ -303,6 +301,7 @@ export abstract class DynamoNTS_App extends DynamoNTS_SingletonService {
|
|
|
303
301
|
}
|
|
304
302
|
} catch (error) {
|
|
305
303
|
this.constructErrors.push(error);
|
|
304
|
+
Dynamo_Log.error(`${this._params.name} start failed. ERRORS`, this.constructErrors);
|
|
306
305
|
throw new Dynamo_Error({
|
|
307
306
|
errorCode: 'NTS-AS0-001',
|
|
308
307
|
error: error,
|
|
@@ -340,14 +339,18 @@ export abstract class DynamoNTS_App extends DynamoNTS_SingletonService {
|
|
|
340
339
|
this.systemControls.httpServer.getReady() &&
|
|
341
340
|
this.systemControls.httpsServer.getReady()
|
|
342
341
|
);
|
|
342
|
+
} else {
|
|
343
|
+
Dynamo_Log.error(`${this.params.name} APP NOT INITIALIZED while trying to get ready.`);
|
|
343
344
|
}
|
|
344
345
|
|
|
345
|
-
|
|
346
|
+
if (!ready) {
|
|
347
|
+
await wait(100);
|
|
348
|
+
}
|
|
346
349
|
}
|
|
347
350
|
|
|
348
351
|
if (timeout < +new Date() - start) {
|
|
349
352
|
Dynamo_Log.error(`${this._params.name} start failed. TIMEOUT`, this.constructErrors);
|
|
350
|
-
throw new Dynamo_Error({
|
|
353
|
+
throw new Dynamo_Error({
|
|
351
354
|
message: `${this._params.name} start failed. TIMEOUT`,
|
|
352
355
|
additionalContent: {
|
|
353
356
|
constructErrors: this.constructErrors,
|
|
@@ -363,7 +366,7 @@ export abstract class DynamoNTS_App extends DynamoNTS_SingletonService {
|
|
|
363
366
|
|
|
364
367
|
if (this.constructErrors.length) {
|
|
365
368
|
Dynamo_Log.error(`${this._params.name} start failed. ERROR`, this.constructErrors);
|
|
366
|
-
throw new Dynamo_Error({
|
|
369
|
+
throw new Dynamo_Error({
|
|
367
370
|
message: `${this._params.name} start failed. ERROR`,
|
|
368
371
|
additionalContent: this.constructErrors,
|
|
369
372
|
});
|
|
@@ -515,13 +518,13 @@ export abstract class DynamoNTS_App extends DynamoNTS_SingletonService {
|
|
|
515
518
|
});
|
|
516
519
|
}
|
|
517
520
|
});
|
|
518
|
-
Dynamo_Log.error(errorMsg);
|
|
519
521
|
|
|
520
522
|
let error = new Error('Open routes cannot be established!');
|
|
521
523
|
let errorStack: string[] = error.stack.split('\n');
|
|
522
524
|
errorStack.splice(1, 2);
|
|
523
525
|
error.stack = errorStack.join('\n');
|
|
524
526
|
|
|
527
|
+
Dynamo_Log.error(errorMsg);
|
|
525
528
|
throw error;
|
|
526
529
|
}
|
|
527
530
|
|
|
@@ -552,13 +555,13 @@ export abstract class DynamoNTS_App extends DynamoNTS_SingletonService {
|
|
|
552
555
|
});
|
|
553
556
|
}
|
|
554
557
|
});
|
|
555
|
-
Dynamo_Log.error(errorMsg);
|
|
556
558
|
|
|
557
559
|
let error = new Error('Secure routes cannot be established!');
|
|
558
560
|
let errorStack: string[] = error.stack.split('\n');
|
|
559
561
|
errorStack.splice(1, 2);
|
|
560
562
|
error.stack = errorStack.join('\n');
|
|
561
563
|
|
|
564
|
+
Dynamo_Log.error(errorMsg);
|
|
562
565
|
throw error;
|
|
563
566
|
}
|
|
564
567
|
|
|
@@ -668,6 +671,7 @@ export abstract class DynamoNTS_App extends DynamoNTS_SingletonService {
|
|
|
668
671
|
}
|
|
669
672
|
} catch (error) {
|
|
670
673
|
Dynamo_Log.error(`startExpresses failed...`, error);
|
|
674
|
+
throw error;
|
|
671
675
|
}
|
|
672
676
|
}
|
|
673
677
|
|
|
@@ -17,8 +17,6 @@ export abstract class DynamoNTS_SocketClientService extends DynamoNTS_SingletonS
|
|
|
17
17
|
protected get params(): DynamoNTS_SocketClientServiceParams { return this._params; }
|
|
18
18
|
get name(): string { return this.params.name; }
|
|
19
19
|
|
|
20
|
-
protected log: boolean = dynamoNTS_globalSettings.logSetup;
|
|
21
|
-
|
|
22
20
|
protected socket: SocketIO.Socket
|
|
23
21
|
|
|
24
22
|
protected incomingEvents: DynamoNTS_SocketEvent<any>[];
|
|
@@ -26,6 +24,9 @@ export abstract class DynamoNTS_SocketClientService extends DynamoNTS_SingletonS
|
|
|
26
24
|
protected _connected: boolean = false;
|
|
27
25
|
get connected(): boolean { return this._connected; }
|
|
28
26
|
|
|
27
|
+
protected log: boolean = dynamoNTS_globalSettings.logSetup;
|
|
28
|
+
protected logFn: boolean;
|
|
29
|
+
|
|
29
30
|
private defaultEvents: DynamoNTS_SocketEvent<any>[] = [
|
|
30
31
|
new DynamoNTS_SocketEvent<any>({
|
|
31
32
|
eventType: DynamoNTS_SocketEventType.connect,
|
|
@@ -82,6 +83,7 @@ export abstract class DynamoNTS_SocketClientService extends DynamoNTS_SingletonS
|
|
|
82
83
|
|
|
83
84
|
await this.connectSocket();
|
|
84
85
|
} catch (error) {
|
|
86
|
+
Dynamo_Log.error(`${this.params?.name} Socket Client Service setup failed!`, error);
|
|
85
87
|
throw new Dynamo_Error({
|
|
86
88
|
errorCode: 'NTS-SCS-001',
|
|
87
89
|
error: error,
|
|
@@ -91,6 +93,7 @@ export abstract class DynamoNTS_SocketClientService extends DynamoNTS_SingletonS
|
|
|
91
93
|
|
|
92
94
|
private async setupDefaultEvents(): Promise<void> {
|
|
93
95
|
try {
|
|
96
|
+
if (this.logFn) console.log('\nFn:. setupDefaultEvents')
|
|
94
97
|
this.defaultEvents.forEach((defaultEvent: DynamoNTS_SocketEvent<any>) => {
|
|
95
98
|
const eventDeclared = this.incomingEvents.find((event: DynamoNTS_SocketEvent<any>) => event.eventType === defaultEvent.eventType);
|
|
96
99
|
if (!eventDeclared) {
|
|
@@ -145,6 +148,7 @@ export abstract class DynamoNTS_SocketClientService extends DynamoNTS_SingletonS
|
|
|
145
148
|
|
|
146
149
|
private async tryReconnectIfNeeded(): Promise<void> {
|
|
147
150
|
try {
|
|
151
|
+
if (this.logFn) console.log(`\nFn:. tryReconnectIfNeeded`);
|
|
148
152
|
await delay(this._params.reconnectDelay);
|
|
149
153
|
|
|
150
154
|
if (!this._connected) {
|
|
@@ -75,6 +75,7 @@ export abstract class DynamoNTS_SocketServerService<
|
|
|
75
75
|
|
|
76
76
|
if (this.logSetup) console.log(`Socket Server Service setup done: ${this.params.name} (${this.params.port}) serurity: ${this.params.security}\n`);
|
|
77
77
|
} catch (error) {
|
|
78
|
+
Dynamo_Log.error(`Socket Server Service setup failed: ${this.params?.name} (${this.params?.port})`, error);
|
|
78
79
|
throw new Dynamo_Error({
|
|
79
80
|
errorCode: 'NTS-SSS-001',
|
|
80
81
|
error: error,
|