@futdevpro/nts-dynamo 1.5.62 → 1.5.65
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/_models/dynamo-nts-endpoint-params.js +8 -8
- package/lib/_models/dynamo-nts-endpoint-params.js.map +1 -1
- package/lib/_models/dynamo-nts-socket-event-params.js +1 -1
- package/lib/_models/dynamo-nts-socket-event-params.js.map +1 -1
- package/lib/_models/dynamo-nts-socket-service-params.js +1 -1
- package/lib/_models/dynamo-nts-socket-service-params.js.map +1 -1
- package/lib/_modules/custom-data/custom-data.controller.d.ts +6 -0
- package/lib/_modules/custom-data/custom-data.controller.d.ts.map +1 -0
- package/lib/_modules/custom-data/custom-data.controller.js +56 -0
- package/lib/_modules/custom-data/custom-data.controller.js.map +1 -0
- package/lib/_modules/custom-data/custom-data.service.d.ts +6 -0
- package/lib/_modules/custom-data/custom-data.service.d.ts.map +1 -0
- package/lib/_modules/custom-data/custom-data.service.js +12 -0
- package/lib/_modules/custom-data/custom-data.service.js.map +1 -0
- package/lib/_modules/custom-data/get-custom-data-routing-module.d.ts +4 -0
- package/lib/_modules/custom-data/get-custom-data-routing-module.d.ts.map +1 -0
- package/lib/_modules/custom-data/get-custom-data-routing-module.js +18 -0
- package/lib/_modules/custom-data/get-custom-data-routing-module.js.map +1 -0
- package/lib/_modules/custom-data/index.d.ts +5 -0
- package/lib/_modules/custom-data/index.d.ts.map +1 -0
- package/lib/_modules/custom-data/index.js +9 -0
- package/lib/_modules/custom-data/index.js.map +1 -0
- package/lib/_modules/test/get-test-routing-module.js +1 -1
- package/lib/_modules/test/index.d.ts +1 -2
- package/lib/_modules/test/index.d.ts.map +1 -1
- package/lib/_modules/test/index.js +1 -2
- package/lib/_modules/test/index.js.map +1 -1
- package/lib/_modules/test/test.controller.d.ts +6 -0
- package/lib/_modules/test/test.controller.d.ts.map +1 -0
- package/lib/_modules/test/test.controller.js +102 -0
- package/lib/_modules/test/test.controller.js.map +1 -0
- package/lib/_services/dynamo-nts-api.service.js +8 -8
- package/lib/_services/dynamo-nts-api.service.js.map +1 -1
- package/lib/_services/dynamo-nts-app-extended.js +3 -3
- package/lib/_services/dynamo-nts-app-extended.js.map +1 -1
- package/lib/_services/dynamo-nts-app.js +12 -12
- package/lib/_services/dynamo-nts-app.js.map +1 -1
- package/lib/_services/dynamo-nts-auth.service.d.ts +4 -4
- package/lib/_services/dynamo-nts-controller.service.js +1 -1
- package/lib/_services/dynamo-nts-controller.service.js.map +1 -1
- package/lib/_services/dynamo-nts-data.service.d.ts +3 -3
- package/lib/_services/dynamo-nts-data.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-data.service.js +6 -6
- package/lib/_services/dynamo-nts-data.service.js.map +1 -1
- package/lib/_services/dynamo-nts-db.service.d.ts +3 -3
- package/lib/_services/dynamo-nts-db.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-db.service.js +120 -119
- package/lib/_services/dynamo-nts-db.service.js.map +1 -1
- package/lib/_services/dynamo-nts-email.service.js +8 -8
- package/lib/_services/dynamo-nts-email.service.js.map +1 -1
- package/lib/_services/dynamo-nts-global.service.d.ts +4 -4
- package/lib/_services/dynamo-nts-global.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-global.service.js +2 -2
- package/lib/_services/dynamo-nts-global.service.js.map +1 -1
- package/lib/_services/dynamo-nts-routing-module.service.js +1 -1
- package/lib/_services/dynamo-nts-routing-module.service.js.map +1 -1
- package/lib/_services/dynamo-nts-socket.service.js +1 -1
- package/lib/_services/dynamo-nts-socket.service.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -2
- package/src/_models/dynamo-nts-endpoint-params.ts +8 -8
- package/src/_models/dynamo-nts-socket-event-params.ts +1 -1
- package/src/_models/dynamo-nts-socket-service-params.ts +1 -1
- package/src/_modules/custom-data/custom-data.controller.ts +62 -0
- package/src/_modules/{test → custom-data}/custom-data.service.ts +1 -1
- package/src/_modules/custom-data/get-custom-data-routing-module.ts +17 -0
- package/src/_modules/custom-data/index.ts +6 -0
- package/src/_modules/test/get-test-routing-module.ts +1 -1
- package/src/_modules/test/index.ts +1 -2
- package/src/_modules/test/{test-controller.ts → test.controller.ts} +4 -33
- package/src/_services/dynamo-nts-api.service.ts +8 -8
- package/src/_services/dynamo-nts-app-extended.ts +3 -3
- package/src/_services/dynamo-nts-app.ts +12 -12
- package/src/_services/dynamo-nts-auth.service.ts +4 -4
- package/src/_services/dynamo-nts-controller.service.ts +1 -1
- package/src/_services/dynamo-nts-data.service.ts +10 -10
- package/src/_services/dynamo-nts-db.service.ts +37 -36
- package/src/_services/dynamo-nts-email.service.ts +8 -8
- package/src/_services/dynamo-nts-global.service.ts +7 -7
- package/src/_services/dynamo-nts-routing-module.service.ts +1 -1
- package/src/_services/dynamo-nts-socket.service.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import * as mongoose from 'mongoose';
|
|
3
3
|
import { Schema } from 'mongoose';
|
|
4
|
-
import { Dynamo_Metadata,
|
|
4
|
+
import { Dynamo_Metadata, Dynamo_DataParams, Dynamo_DataPropertyParams, Dynamo_Error } from '@futdevpro/fsm-dynamo';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
@@ -22,7 +22,7 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
22
22
|
* schemaSettings also MUST contain specific types that differs from the listed above (Array, Date)
|
|
23
23
|
*/
|
|
24
24
|
constructor(
|
|
25
|
-
public dataParams:
|
|
25
|
+
public dataParams: Dynamo_DataParams
|
|
26
26
|
){
|
|
27
27
|
this.lookForDependencyDataSettings();
|
|
28
28
|
}
|
|
@@ -86,7 +86,8 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
86
86
|
|
|
87
87
|
const dataModel = new this.dataModel(data);
|
|
88
88
|
let newData: T = await this.dataModel.findByIdAndUpdate(data._id, dataModel).then(res => {
|
|
89
|
-
|
|
89
|
+
return res?.toObject() as T ?? null;
|
|
90
|
+
/* if (res) {
|
|
90
91
|
return res.toObject() as T;
|
|
91
92
|
} else {
|
|
92
93
|
throw new Dynamo_Error({
|
|
@@ -96,7 +97,7 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
96
97
|
message: `update ${this.dataParams.dbName} result not found! (NTS DB)`,
|
|
97
98
|
userMessage: this.defaultErrorUserMsg
|
|
98
99
|
});
|
|
99
|
-
}
|
|
100
|
+
} */
|
|
100
101
|
}).catch(error => {
|
|
101
102
|
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
102
103
|
throw error;
|
|
@@ -129,10 +130,10 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
129
130
|
*/
|
|
130
131
|
async getDataById(id: string): Promise<T> {
|
|
131
132
|
let data: T = await this.dataModel.findById(id).then(res => {
|
|
132
|
-
|
|
133
|
+
return res?.toObject() as T ?? null;
|
|
134
|
+
/* if (res) {
|
|
133
135
|
return res.toObject() as T;
|
|
134
136
|
} else {
|
|
135
|
-
/* return null; */
|
|
136
137
|
throw new Dynamo_Error({
|
|
137
138
|
status: 417,
|
|
138
139
|
errorCode: 'NTS-DBS-GI1',
|
|
@@ -140,7 +141,7 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
140
141
|
message: `get ${this.dataParams.dbName} by ID was unsuccessful: data not found by id: ${id} (NTS DB)`,
|
|
141
142
|
userMessage: this.defaultErrorUserMsg
|
|
142
143
|
});
|
|
143
|
-
}
|
|
144
|
+
} */
|
|
144
145
|
}).catch(error => {
|
|
145
146
|
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
146
147
|
throw error;
|
|
@@ -182,10 +183,10 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
182
183
|
}
|
|
183
184
|
|
|
184
185
|
let data: T = await this.dataModel.findOne({ [this.depDataName]: dependencyId }).then(res => {
|
|
185
|
-
|
|
186
|
+
return res.toObject() as T ?? null;
|
|
187
|
+
/* if (res) {
|
|
186
188
|
return res.toObject() as T;
|
|
187
189
|
} else {
|
|
188
|
-
/* return null; */
|
|
189
190
|
throw new Dynamo_Error({
|
|
190
191
|
status: 417,
|
|
191
192
|
errorCode: 'NTS-DBS-GD2',
|
|
@@ -193,7 +194,7 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
193
194
|
message: `get ${this.dataParams.dbName} by ${this.depDataName} was unsuccessful: data not found by id: ${dependencyId} (NTS DB)`,
|
|
194
195
|
userMessage: this.defaultErrorUserMsg
|
|
195
196
|
});
|
|
196
|
-
}
|
|
197
|
+
} */
|
|
197
198
|
}).catch(error => {
|
|
198
199
|
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
199
200
|
throw error;
|
|
@@ -234,12 +235,11 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
234
235
|
});
|
|
235
236
|
}
|
|
236
237
|
|
|
237
|
-
let dataList: T[] = await this.dataModel.find({ [this.depDataName]: dependencyId })
|
|
238
|
-
|
|
239
|
-
if (res) {
|
|
238
|
+
let dataList: T[] = await this.dataModel.find({ [this.depDataName]: dependencyId }).then(res => {
|
|
239
|
+
return res as T[] ?? [];
|
|
240
|
+
/* if (res) {
|
|
240
241
|
return res as T[];
|
|
241
242
|
} else {
|
|
242
|
-
/* return []; */
|
|
243
243
|
throw new Dynamo_Error({
|
|
244
244
|
status: 417,
|
|
245
245
|
errorCode: 'NTS-DBS-GLD2',
|
|
@@ -247,7 +247,7 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
247
247
|
message: `get ${this.dataParams.dbName} by ${this.depDataName} was unsuccessful: no data found by id: ${dependencyId} (NTS DB)`,
|
|
248
248
|
userMessage: this.defaultErrorUserMsg
|
|
249
249
|
});
|
|
250
|
-
}
|
|
250
|
+
} */
|
|
251
251
|
}).catch(error => {
|
|
252
252
|
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
253
253
|
throw error;
|
|
@@ -292,12 +292,11 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
292
292
|
});
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
let dataList: T[] = await this.dataModel.find({ [this.depDataName]: { $in: ids }})
|
|
296
|
-
|
|
297
|
-
if (res) {
|
|
295
|
+
let dataList: T[] = await this.dataModel.find({ [this.depDataName]: { $in: ids }}).then(res => {
|
|
296
|
+
return res as T[] ?? [];
|
|
297
|
+
/* if (res) {
|
|
298
298
|
return res as T[];
|
|
299
299
|
} else {
|
|
300
|
-
/* return []; */
|
|
301
300
|
throw new Dynamo_Error({
|
|
302
301
|
status: 417,
|
|
303
302
|
errorCode: 'NTS-DBS-GLDS2',
|
|
@@ -305,7 +304,7 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
305
304
|
message: `get ${this.dataParams.dbName} by ${this.depDataName} was unsuccessful: no data found by ids: ${ids} (NTS DB)`,
|
|
306
305
|
userMessage: this.defaultErrorUserMsg
|
|
307
306
|
});
|
|
308
|
-
}
|
|
307
|
+
} */
|
|
309
308
|
}).catch(error => {
|
|
310
309
|
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
311
310
|
throw error;
|
|
@@ -357,7 +356,7 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
357
356
|
filter[this.depDataName] = { $in: narrowByDependencyIds };
|
|
358
357
|
}
|
|
359
358
|
|
|
360
|
-
await this.dataParams.modelParams.forEach((modelParam:
|
|
359
|
+
await this.dataParams.modelParams.forEach((modelParam: Dynamo_DataPropertyParams) => {
|
|
361
360
|
if (
|
|
362
361
|
(searchBy[modelParam.key] !== null && searchBy[modelParam.key] !== undefined) ||
|
|
363
362
|
searchBy[modelParam.key + 'Range']
|
|
@@ -437,10 +436,10 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
437
436
|
async getAll(): Promise<T[]> {
|
|
438
437
|
let dataList: T[] = await this.dataModel.find({})
|
|
439
438
|
.then(res => {
|
|
440
|
-
|
|
439
|
+
return res as T[] ?? [];
|
|
440
|
+
/* if (res) {
|
|
441
441
|
return res as T[];
|
|
442
442
|
} else {
|
|
443
|
-
/* return null; */
|
|
444
443
|
throw new Dynamo_Error({
|
|
445
444
|
status: 417,
|
|
446
445
|
errorCode: 'NTS-DBS-GA1',
|
|
@@ -448,7 +447,7 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
448
447
|
message: `get all ${this.dataParams.dbName} was unsuccessful: no data found (NTS DB)`,
|
|
449
448
|
userMessage: this.defaultErrorUserMsg
|
|
450
449
|
});
|
|
451
|
-
}
|
|
450
|
+
} */
|
|
452
451
|
}).catch(error => {
|
|
453
452
|
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
454
453
|
throw error;
|
|
@@ -550,10 +549,11 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
550
549
|
*/
|
|
551
550
|
async findOne(filter: any): Promise<T> {
|
|
552
551
|
let data: T = await this.dataModel.findOne(filter).then(res => {
|
|
553
|
-
|
|
552
|
+
return res as T ?? null;
|
|
553
|
+
/* if (res) {
|
|
554
554
|
return res as T;
|
|
555
555
|
} else {
|
|
556
|
-
|
|
556
|
+
return null;
|
|
557
557
|
throw new Dynamo_Error({
|
|
558
558
|
status: 417,
|
|
559
559
|
errorCode: 'NTS-DBS-FO1',
|
|
@@ -561,7 +561,7 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
561
561
|
message: `findOne ${this.dataParams.dbName} was unsuccessful, no data found (NTS DB) fliter: ${filter}`,
|
|
562
562
|
userMessage: this.defaultErrorUserMsg
|
|
563
563
|
});
|
|
564
|
-
}
|
|
564
|
+
} */
|
|
565
565
|
}).catch(error => {
|
|
566
566
|
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
567
567
|
throw error;
|
|
@@ -614,10 +614,10 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
614
614
|
async find(filter: any): Promise<T[]> {
|
|
615
615
|
let dataList: T[] = await this.dataModel.find(filter)
|
|
616
616
|
.then(res => {
|
|
617
|
-
|
|
617
|
+
return res as T[] ?? [];
|
|
618
|
+
/* if (res) {
|
|
618
619
|
return res as T[];
|
|
619
620
|
} else {
|
|
620
|
-
/* return null; */
|
|
621
621
|
throw new Dynamo_Error({
|
|
622
622
|
status: 417,
|
|
623
623
|
errorCode: 'NTS-DBS-F1',
|
|
@@ -625,7 +625,7 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
625
625
|
message: `find ${this.dataParams.dbName} was unsuccessful, no data found (NTS DB) fliter: ${filter}`,
|
|
626
626
|
userMessage: this.defaultErrorUserMsg
|
|
627
627
|
});
|
|
628
|
-
}
|
|
628
|
+
} */
|
|
629
629
|
}).catch(error => {
|
|
630
630
|
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
631
631
|
throw error;
|
|
@@ -727,7 +727,8 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
727
727
|
update.__lastModifiedBy = modifier;
|
|
728
728
|
|
|
729
729
|
let newData: T = await this.dataModel.findByIdAndUpdate(id, update).then(res => {
|
|
730
|
-
|
|
730
|
+
return res.toObject() as T ?? null;
|
|
731
|
+
/* if (res) {
|
|
731
732
|
return res.toObject() as T;
|
|
732
733
|
} else {
|
|
733
734
|
throw new Dynamo_Error({
|
|
@@ -737,7 +738,7 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
737
738
|
message: `${this.dataParams.dbName} not found! (by id: ${id}) (NTS DB)`,
|
|
738
739
|
userMessage: this.defaultErrorUserMsg
|
|
739
740
|
});
|
|
740
|
-
}
|
|
741
|
+
} */
|
|
741
742
|
}).catch(error => {
|
|
742
743
|
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
743
744
|
throw error;
|
|
@@ -924,14 +925,14 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
924
925
|
* @param params DynamoBEDataPropertyParams
|
|
925
926
|
* @returns mongoose schema object
|
|
926
927
|
*/
|
|
927
|
-
private buildMongooseSchemaByModelParams(params?:
|
|
928
|
+
private buildMongooseSchemaByModelParams(params?: Dynamo_DataPropertyParams[]): any {
|
|
928
929
|
const schemaSettingsObj = {};
|
|
929
930
|
|
|
930
931
|
if (!params) {
|
|
931
932
|
params = this.dataParams.modelParams;
|
|
932
933
|
}
|
|
933
934
|
|
|
934
|
-
params.forEach((property:
|
|
935
|
+
params.forEach((property: Dynamo_DataPropertyParams) => {
|
|
935
936
|
const beType = this.getBEType(property.type);
|
|
936
937
|
if (beType !== Object || !property?.subObjectParams || property?.subObjectParams?.length == 0) {
|
|
937
938
|
schemaSettingsObj[property.key] = {
|
|
@@ -1001,8 +1002,8 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
1001
1002
|
* sets depDataKey
|
|
1002
1003
|
*/
|
|
1003
1004
|
private lookForDependencyDataSettings(): void {
|
|
1004
|
-
const dependencyParam:
|
|
1005
|
-
(modelParams:
|
|
1005
|
+
const dependencyParam: Dynamo_DataPropertyParams = this.dataParams.modelParams.find(
|
|
1006
|
+
(modelParams: Dynamo_DataPropertyParams) => modelParams.isDependencyHook);
|
|
1006
1007
|
if (dependencyParam) {
|
|
1007
1008
|
this.depDataName = dependencyParam.key;
|
|
1008
1009
|
}
|
|
@@ -57,7 +57,7 @@ export class DynamoNTS_EmailService {
|
|
|
57
57
|
this.constructionFinished();
|
|
58
58
|
}
|
|
59
59
|
} catch (error) {
|
|
60
|
-
Dynamo_Log.
|
|
60
|
+
Dynamo_Log.error(`\nDynamoBEEmailService ERROR, The emailService construction failed for ${set.email}.`, new Error());
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -65,7 +65,7 @@ export class DynamoNTS_EmailService {
|
|
|
65
65
|
*
|
|
66
66
|
*/
|
|
67
67
|
private constructionFinished(): void {
|
|
68
|
-
Dynamo_Log.
|
|
68
|
+
Dynamo_Log.success(`\nEmailService construction (${this.senderName}) Finished!\n`)
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/**
|
|
@@ -114,7 +114,7 @@ export class DynamoNTS_EmailService {
|
|
|
114
114
|
this.templatePropertyKeys[set.useTemplate].forEach((key: string, index: number) => {
|
|
115
115
|
props += `${key}${index != this.templatePropertyKeys[set.useTemplate].length - 1 ? ', ' : ''}`;
|
|
116
116
|
});
|
|
117
|
-
Dynamo_Log.
|
|
117
|
+
Dynamo_Log.error('\nDynamoBEEmailService ERROR: INVALID sendEmail settings', set);
|
|
118
118
|
|
|
119
119
|
throw new Dynamo_Error({
|
|
120
120
|
errorCode: 'NTS-ES4-103',
|
|
@@ -125,7 +125,7 @@ export class DynamoNTS_EmailService {
|
|
|
125
125
|
}
|
|
126
126
|
this.templatePropertyKeys[set.useTemplate].forEach((propertyKey: string) => {
|
|
127
127
|
if (!set.templateProperties[propertyKey]) {
|
|
128
|
-
Dynamo_Log.
|
|
128
|
+
Dynamo_Log.error(`TemplateProperty missing! (${propertyKey})`);
|
|
129
129
|
}
|
|
130
130
|
const reg = new RegExp(`{{${propertyKey}}}`, 'g')
|
|
131
131
|
content = content.replace(reg, set.templateProperties[propertyKey]);
|
|
@@ -176,7 +176,7 @@ export class DynamoNTS_EmailService {
|
|
|
176
176
|
templatePath = Path.join(rootPath, templatePath);
|
|
177
177
|
FileSystem.readFile(templatePath, 'utf8' , (err, template) => {
|
|
178
178
|
if (err) {
|
|
179
|
-
Dynamo_Log.
|
|
179
|
+
Dynamo_Log.error(`\nDynamoBEEmailService readFile ERROR (0), Couldn't load email template; ${templateName} from ${templatePath}\nerror:\n`, err, '\n');
|
|
180
180
|
reject(err);
|
|
181
181
|
return;
|
|
182
182
|
} else {
|
|
@@ -192,7 +192,7 @@ export class DynamoNTS_EmailService {
|
|
|
192
192
|
});
|
|
193
193
|
});
|
|
194
194
|
} catch (error) {
|
|
195
|
-
Dynamo_Log.
|
|
195
|
+
Dynamo_Log.error(`\nDynamoBEEmailService ERROR (1), Couldn't load email template; ${templateName} from ${templatePath}`, new Error());
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
|
|
@@ -209,7 +209,7 @@ export class DynamoNTS_EmailService {
|
|
|
209
209
|
|
|
210
210
|
while (propertyOpenTagIndex >= 0) {
|
|
211
211
|
if (propertyCloseTagIndex === -1) {
|
|
212
|
-
Dynamo_Log.
|
|
212
|
+
Dynamo_Log.error(`\nDynamoBEEmailService ERROR, missing closing tag from email template! (${propertyOpenTagIndex} -)`, propertyKeys);
|
|
213
213
|
throw new Dynamo_Error({
|
|
214
214
|
errorCode: 'NTS-ES4-200',
|
|
215
215
|
addECToUserMsg: true,
|
|
@@ -229,7 +229,7 @@ export class DynamoNTS_EmailService {
|
|
|
229
229
|
// console.log('\n\n\nTEST propertyKeys: ', propertyKeys);
|
|
230
230
|
return propertyKeys;
|
|
231
231
|
} catch (error) {
|
|
232
|
-
Dynamo_Log.
|
|
232
|
+
Dynamo_Log.error(`\nDynamoBEEmailService ERROR, getTemplatePropertyKeys ERROR`, new Error(), '\ntemplate:\n', template);
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
import { Dynamo_Metadata,
|
|
3
|
+
import { Dynamo_Metadata, Dynamo_DataParams, Dynamo_Log } from '@futdevpro/fsm-dynamo';
|
|
4
4
|
|
|
5
5
|
import { DynamoNTS_AuthService } from './dynamo-nts-auth.service';
|
|
6
6
|
import { DynamoNTS_DBServiceCollection } from './dynamo-nts-db-service-collection.service';
|
|
@@ -35,7 +35,7 @@ export class DynamoNTS_GlobalService extends DynamoNTS_SingletonService {
|
|
|
35
35
|
/**
|
|
36
36
|
* You need to setup your Own Auth Service extending the DynamoBEAuthService class
|
|
37
37
|
*/
|
|
38
|
-
authService
|
|
38
|
+
authService?: DynamoNTS_AuthService,
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* You can setup your Own Email Service extending the DynamoBEEmailServiceCollection class
|
|
@@ -45,25 +45,25 @@ export class DynamoNTS_GlobalService extends DynamoNTS_SingletonService {
|
|
|
45
45
|
/**
|
|
46
46
|
* you can setup data tables by passing a DynamoBEDataParams list at this point
|
|
47
47
|
*/
|
|
48
|
-
dbModels:
|
|
48
|
+
dbModels: Dynamo_DataParams[],
|
|
49
49
|
}
|
|
50
50
|
): void {
|
|
51
51
|
this.getInstance();
|
|
52
52
|
|
|
53
53
|
try {
|
|
54
54
|
this.instance.dbServiceCollection = new DynamoNTS_DBServiceCollection();
|
|
55
|
-
set.dbModels.forEach((dbModel:
|
|
55
|
+
set.dbModels.forEach((dbModel: Dynamo_DataParams) => {
|
|
56
56
|
try {
|
|
57
57
|
this.instance.dbServiceCollection[dbModel.dataName] = new DynamoNTS_DBService(dbModel);
|
|
58
58
|
} catch (error) {
|
|
59
|
-
Dynamo_Log.
|
|
59
|
+
Dynamo_Log.error(`\nFailed to create DynamoBEDBService (${dbModel.dataName}).\n`, dbModel, `\n`, error);
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
this.instance.authService = set.authService;
|
|
64
64
|
this.instance.emailServiceCollection = set.emailServiceCollection;
|
|
65
65
|
} catch (error) {
|
|
66
|
-
Dynamo_Log.
|
|
66
|
+
Dynamo_Log.error('\nsetServices failed on DBE_Global_S.\n', error);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -102,7 +102,7 @@ export class DynamoNTS_GlobalService extends DynamoNTS_SingletonService {
|
|
|
102
102
|
* @param dataParams
|
|
103
103
|
* @returns
|
|
104
104
|
*/
|
|
105
|
-
static getDBService<T extends Dynamo_Metadata>(dataParams:
|
|
105
|
+
static getDBService<T extends Dynamo_Metadata>(dataParams: Dynamo_DataParams): DynamoNTS_DBService<T> {
|
|
106
106
|
return this.getDBServiceByKey<T>(dataParams.dataName);
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -79,7 +79,7 @@ export class DynamoNTS_RoutingModule {
|
|
|
79
79
|
|
|
80
80
|
if (this.log) console.log(`routing module setup done: ${this.route} serurity: ${this.security}\n`);
|
|
81
81
|
} catch (error) {
|
|
82
|
-
Dynamo_Log.
|
|
82
|
+
Dynamo_Log.error(`Routing module setup failed (${this.route})`, error);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
@@ -47,7 +47,7 @@ export abstract class DynamoNTS_SocketService<T extends DynamoNTS_SocketDictiona
|
|
|
47
47
|
|
|
48
48
|
if (this.log) console.log(`Socket Controller setup done: ${this.params.name} (${this.params.port}) serurity: ${this.params.security}\n`);
|
|
49
49
|
} catch (error) {
|
|
50
|
-
Dynamo_Log.
|
|
50
|
+
Dynamo_Log.error(`Socket Controller setup failed: ${this.params.name} (${this.params.port})`, error);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|