@futdevpro/nts-dynamo 1.5.31 → 1.5.32
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/_modules/usage/usage.service.js +4 -4
- package/lib/_modules/usage/usage.service.js.map +1 -1
- package/lib/_services/dynamo-nts-api.service.js +3 -3
- package/lib/_services/dynamo-nts-api.service.js.map +1 -1
- package/lib/_services/dynamo-nts-auth.service.js +2 -2
- package/lib/_services/dynamo-nts-auth.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 +18 -18
- 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 +25 -25
- package/lib/_services/dynamo-nts-db.service.js.map +1 -1
- package/lib/_services/dynamo-nts-email.service.js +4 -4
- package/lib/_services/dynamo-nts-email.service.js.map +1 -1
- package/lib/_services/dynamo-nts-global.service.d.ts +3 -3
- package/lib/_services/dynamo-nts-global.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-global.service.js.map +1 -1
- package/lib/_services/dynamo-nts-routing-module.service.js +3 -3
- package/lib/_services/dynamo-nts-routing-module.service.js.map +1 -1
- package/lib/_services/dynamo-nts-shared.service.d.ts +2 -2
- package/lib/_services/dynamo-nts-shared.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-shared.service.js +1 -1
- package/lib/_services/dynamo-nts-shared.service.js.map +1 -1
- package/lib/_services/dynamobe-db.service.js +1 -1
- package/lib/tsconfig.tsbuildinfo +59 -59
- package/package.json +3 -2
- package/src/_modules/usage/usage.service.ts +5 -5
- package/src/_services/dynamo-nts-api.service.ts +4 -4
- package/src/_services/dynamo-nts-auth.service.ts +3 -3
- package/src/_services/dynamo-nts-data.service.ts +22 -22
- package/src/_services/dynamo-nts-db.service.ts +32 -32
- package/src/_services/dynamo-nts-email.service.ts +5 -5
- package/src/_services/dynamo-nts-global.service.ts +4 -4
- package/src/_services/dynamo-nts-routing-module.service.ts +4 -4
- package/src/_services/dynamo-nts-shared.service.ts +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import * as mongoose from 'mongoose';
|
|
3
3
|
import { Schema } from 'mongoose';
|
|
4
|
-
import { Metadata,
|
|
4
|
+
import { Metadata, DynamoNTS_DataParams, DynamoNTS_DataPropertyParams, DynamoNTS_Error } from '@futdevpro/fsm-dynamo';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
@@ -18,7 +18,7 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
18
18
|
* schemaSettings also MUST contain specific types that differs from the listed above (Array, Date)
|
|
19
19
|
*/
|
|
20
20
|
constructor(
|
|
21
|
-
public dataParams:
|
|
21
|
+
public dataParams: DynamoNTS_DataParams
|
|
22
22
|
){
|
|
23
23
|
this.lookForDependencyDataSettings();
|
|
24
24
|
}
|
|
@@ -39,14 +39,14 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
39
39
|
if (res) {
|
|
40
40
|
newData = res.toObject() as T;
|
|
41
41
|
} else {
|
|
42
|
-
throw new
|
|
42
|
+
throw new DynamoNTS_Error({
|
|
43
43
|
status: 204, message: `${this.dataParams.dbName} not found! (BD)`,
|
|
44
44
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-401`,
|
|
45
45
|
error: new Error()
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
}).catch(error => {
|
|
49
|
-
throw new
|
|
49
|
+
throw new DynamoNTS_Error({
|
|
50
50
|
status: 422, message: `Create new ${this.dataParams.dbName} was unsuccessful (BD)`,
|
|
51
51
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-400`,
|
|
52
52
|
error
|
|
@@ -74,14 +74,14 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
74
74
|
if (res) {
|
|
75
75
|
newData = res.toObject() as T;
|
|
76
76
|
} else {
|
|
77
|
-
throw new
|
|
77
|
+
throw new DynamoNTS_Error({
|
|
78
78
|
status: 204, message: `${this.dataParams.dbName} not found! (BD)`,
|
|
79
79
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-411`,
|
|
80
80
|
error: new Error()
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
}).catch(error => {
|
|
84
|
-
throw new
|
|
84
|
+
throw new DynamoNTS_Error({
|
|
85
85
|
status: 417, message: `modify ${this.dataParams.dbName} was unsuccessful (DB)`,
|
|
86
86
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-410`,
|
|
87
87
|
error
|
|
@@ -105,7 +105,7 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
105
105
|
data = null;
|
|
106
106
|
}
|
|
107
107
|
}).catch(error => {
|
|
108
|
-
throw new
|
|
108
|
+
throw new DynamoNTS_Error({
|
|
109
109
|
status: 417, message: `get ${this.dataParams.dbName} by ID was unsuccessful (DB)`,
|
|
110
110
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-430`,
|
|
111
111
|
error
|
|
@@ -132,7 +132,7 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
132
132
|
data = null;
|
|
133
133
|
}
|
|
134
134
|
}).catch(error => {
|
|
135
|
-
throw new
|
|
135
|
+
throw new DynamoNTS_Error({
|
|
136
136
|
status: 417, message: `get ${this.dataParams.dbName} by ${this.depDataName} was unsuccessful (DB)`,
|
|
137
137
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-441`,
|
|
138
138
|
error
|
|
@@ -143,7 +143,7 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
143
143
|
}
|
|
144
144
|
return data;
|
|
145
145
|
} else {
|
|
146
|
-
throw new
|
|
146
|
+
throw new DynamoNTS_Error({
|
|
147
147
|
status: 501, message: `dependencyDataIdKey not setted up for this db-service (${this.dataParams.dbName}) (BD)`,
|
|
148
148
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-440`,
|
|
149
149
|
error: new Error()
|
|
@@ -164,7 +164,7 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
164
164
|
dataList = res;
|
|
165
165
|
}
|
|
166
166
|
}).catch(error => {
|
|
167
|
-
throw new
|
|
167
|
+
throw new DynamoNTS_Error({
|
|
168
168
|
status: 417, message: `get ${this.dataParams.dbName} by ${this.depDataName} was unsuccessful (DB)`,
|
|
169
169
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-451`,
|
|
170
170
|
error
|
|
@@ -177,7 +177,7 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
177
177
|
}
|
|
178
178
|
return dataList;
|
|
179
179
|
} else {
|
|
180
|
-
throw new
|
|
180
|
+
throw new DynamoNTS_Error({
|
|
181
181
|
status: 501, message: `dependencyDataIdKey not setted up for this db-service (${this.dataParams.dbName}) (BD)`,
|
|
182
182
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-450`,
|
|
183
183
|
error: new Error()
|
|
@@ -198,7 +198,7 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
198
198
|
dataList = res;
|
|
199
199
|
}
|
|
200
200
|
}).catch(error => {
|
|
201
|
-
throw new
|
|
201
|
+
throw new DynamoNTS_Error({
|
|
202
202
|
status: 417, message: `get ${this.dataParams.dbName}s by ${this.depDataName}s was unsuccessful (DB)`,
|
|
203
203
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-461`,
|
|
204
204
|
error
|
|
@@ -206,7 +206,7 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
206
206
|
});
|
|
207
207
|
return dataList;
|
|
208
208
|
} else {
|
|
209
|
-
throw new
|
|
209
|
+
throw new DynamoNTS_Error({
|
|
210
210
|
status: 501, message: `dependencyDataIdKey not setted up for this db-service (${this.dataParams.dbName}) (BD)`,
|
|
211
211
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-460`,
|
|
212
212
|
error: new Error()
|
|
@@ -228,14 +228,14 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
228
228
|
if (this.depDataName) {
|
|
229
229
|
filter[this.depDataName] = { $in: narrowByDependencyIds };
|
|
230
230
|
} else {
|
|
231
|
-
throw new
|
|
231
|
+
throw new DynamoNTS_Error({
|
|
232
232
|
status: 501, message: `dependencyDataIdKey not setted up for this db-service (${this.dataParams.dbName}) (BD)`,
|
|
233
233
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-470`,
|
|
234
234
|
error: new Error()
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
await this.dataParams.modelParams.forEach((modelParam:
|
|
238
|
+
await this.dataParams.modelParams.forEach((modelParam: DynamoNTS_DataPropertyParams) => {
|
|
239
239
|
if ((searchBy[modelParam.key] !== null && searchBy[modelParam.key] !== undefined) || searchBy[modelParam.key + 'Range']) {
|
|
240
240
|
if (modelParam.key.includes('Range') || modelParam.type.includes('[]')) {
|
|
241
241
|
// inverz search filter (for Range and Array functions)
|
|
@@ -279,7 +279,7 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
279
279
|
dataList = res;
|
|
280
280
|
}
|
|
281
281
|
}).catch(error => {
|
|
282
|
-
throw new
|
|
282
|
+
throw new DynamoNTS_Error({
|
|
283
283
|
status: 417, message: `search ${this.dataParams.dbName} was unsuccessful (DB)`,
|
|
284
284
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-471`,
|
|
285
285
|
error
|
|
@@ -313,7 +313,7 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
313
313
|
data = null;
|
|
314
314
|
}
|
|
315
315
|
}).catch(error => {
|
|
316
|
-
throw new
|
|
316
|
+
throw new DynamoNTS_Error({ status: 417, message: `find ${this.dataParams.dbName} was unsuccessful (DB)`, error });
|
|
317
317
|
});
|
|
318
318
|
if (data && typeof data._id === 'object') {
|
|
319
319
|
data._id = `${data._id}`;
|
|
@@ -332,7 +332,7 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
332
332
|
dataList = res;
|
|
333
333
|
}
|
|
334
334
|
}).catch(error => {
|
|
335
|
-
throw new
|
|
335
|
+
throw new DynamoNTS_Error({
|
|
336
336
|
status: 417, message: `get all ${this.dataParams.dbName} was unsuccessful (DB)`,
|
|
337
337
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-480`,
|
|
338
338
|
error
|
|
@@ -352,7 +352,7 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
352
352
|
*/
|
|
353
353
|
async deleteDataById(id: string): Promise<void> {
|
|
354
354
|
await this.dataModel.findByIdAndDelete(id).catch(error => {
|
|
355
|
-
throw new
|
|
355
|
+
throw new DynamoNTS_Error({
|
|
356
356
|
status: 417, message: `delete ${this.dataParams.dbName} was unsuccessful (DB)`,
|
|
357
357
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-490`,
|
|
358
358
|
error
|
|
@@ -367,14 +367,14 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
367
367
|
async deleteDataByDependencyId(dependencyId: string): Promise<void> {
|
|
368
368
|
if (this.depDataName) {
|
|
369
369
|
await this.dataModel.deleteMany({ [this.depDataName]: dependencyId }).catch(error => {
|
|
370
|
-
throw new
|
|
370
|
+
throw new DynamoNTS_Error({
|
|
371
371
|
status: 417, message: `delete ${this.dataParams.dbName} by ${this.depDataName} was unsuccessful (DB)`,
|
|
372
372
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-591`,
|
|
373
373
|
error
|
|
374
374
|
});
|
|
375
375
|
});
|
|
376
376
|
} else {
|
|
377
|
-
throw new
|
|
377
|
+
throw new DynamoNTS_Error({
|
|
378
378
|
status: 501, message: `dependencyDataIdKey not setted up for this db-service (${this.dataParams.dbName}) (BD)`,
|
|
379
379
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-590`,
|
|
380
380
|
error: new Error()
|
|
@@ -415,7 +415,7 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
415
415
|
data = null;
|
|
416
416
|
}
|
|
417
417
|
}).catch(error => {
|
|
418
|
-
throw new
|
|
418
|
+
throw new DynamoNTS_Error({
|
|
419
419
|
status: 417, message: `findOne ${this.dataParams.dbName} was unsuccessful (DB)`,
|
|
420
420
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-510`,
|
|
421
421
|
error
|
|
@@ -452,7 +452,7 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
452
452
|
dataList = res;
|
|
453
453
|
}
|
|
454
454
|
}).catch(error => {
|
|
455
|
-
throw new
|
|
455
|
+
throw new DynamoNTS_Error({
|
|
456
456
|
status: 417, message: `find ${this.dataParams.dbName} was unsuccessful (DB)`,
|
|
457
457
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-520`,
|
|
458
458
|
error
|
|
@@ -498,7 +498,7 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
498
498
|
dataList = res;
|
|
499
499
|
}
|
|
500
500
|
}).catch(error => {
|
|
501
|
-
throw new
|
|
501
|
+
throw new DynamoNTS_Error({
|
|
502
502
|
status: 417, message: `findWithPaging ${this.dataParams.dbName} was unsuccessful (DB)`,
|
|
503
503
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-530`,
|
|
504
504
|
error
|
|
@@ -526,14 +526,14 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
526
526
|
if (res) {
|
|
527
527
|
data = res.toObject() as T;
|
|
528
528
|
} else {
|
|
529
|
-
throw new
|
|
529
|
+
throw new DynamoNTS_Error({
|
|
530
530
|
status: 204, message: `${this.dataParams.dbName} not found! (BD)`,
|
|
531
531
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-541`,
|
|
532
532
|
error: new Error()
|
|
533
533
|
});
|
|
534
534
|
}
|
|
535
535
|
}).catch(error => {
|
|
536
|
-
throw new
|
|
536
|
+
throw new DynamoNTS_Error({
|
|
537
537
|
status: 417, message: `findByIdAndUpdate ${this.dataParams.dbName} was unsuccessful (DB)`,
|
|
538
538
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-540`,
|
|
539
539
|
error
|
|
@@ -579,7 +579,7 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
579
579
|
update.__lastModified = new Date();
|
|
580
580
|
update.__lastModifiedBy = modifier;
|
|
581
581
|
await this.dataModel.updateOne(updateBy, update).catch(error => {
|
|
582
|
-
throw new
|
|
582
|
+
throw new DynamoNTS_Error({
|
|
583
583
|
status: 417, message: `updateOne ${this.dataParams.dbName} was unsuccessful (DB)`,
|
|
584
584
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-550`,
|
|
585
585
|
error
|
|
@@ -622,7 +622,7 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
622
622
|
update.__lastModified = new Date();
|
|
623
623
|
update.__lastModifiedBy = modifier;
|
|
624
624
|
await this.dataModel.updateMany(updateBy, update).catch(error => {
|
|
625
|
-
throw new
|
|
625
|
+
throw new DynamoNTS_Error({
|
|
626
626
|
status: 417, message: `updateMany ${this.dataParams.dbName} was unsuccessful (DB)`,
|
|
627
627
|
userMessage: `We encountered an uncought DB Error, please contact the responsible development team. errorcode: 505-223-560`,
|
|
628
628
|
error
|
|
@@ -655,12 +655,12 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
655
655
|
* @param params DynamoBEDataPropertyParams
|
|
656
656
|
* @returns mongoose schema object
|
|
657
657
|
*/
|
|
658
|
-
private buildMongooseSchemaByModelParams(params?:
|
|
658
|
+
private buildMongooseSchemaByModelParams(params?: DynamoNTS_DataPropertyParams[]): any {
|
|
659
659
|
const schemaSettingsObj = {};
|
|
660
660
|
if (!params) {
|
|
661
661
|
params = this.dataParams.modelParams;
|
|
662
662
|
}
|
|
663
|
-
params.forEach((property:
|
|
663
|
+
params.forEach((property: DynamoNTS_DataPropertyParams) => {
|
|
664
664
|
const beType = this.getBEType(property.type);
|
|
665
665
|
if (beType !== Object || !property.subObjectParams) {
|
|
666
666
|
schemaSettingsObj[property.key] = {
|
|
@@ -728,8 +728,8 @@ export class DynamoNTS_DBService<T extends Metadata> {
|
|
|
728
728
|
* sets depDataKey
|
|
729
729
|
*/
|
|
730
730
|
private lookForDependencyDataSettings(): void {
|
|
731
|
-
const dependencyParam:
|
|
732
|
-
(modelParams:
|
|
731
|
+
const dependencyParam: DynamoNTS_DataPropertyParams = this.dataParams.modelParams.find(
|
|
732
|
+
(modelParams: DynamoNTS_DataPropertyParams) => modelParams.isDependencyHook);
|
|
733
733
|
if (dependencyParam) {
|
|
734
734
|
this.depDataName = dependencyParam.key;
|
|
735
735
|
}
|
|
@@ -3,7 +3,7 @@ import * as FileSystem from 'fs';
|
|
|
3
3
|
import * as Path from 'path';
|
|
4
4
|
import * as NodeMailer from 'nodemailer';
|
|
5
5
|
import { Options as MailOptions, Attachment } from 'nodemailer/lib/mailer';
|
|
6
|
-
import {
|
|
6
|
+
import { DynamoNTS_Error } from '@futdevpro/fsm-dynamo';
|
|
7
7
|
|
|
8
8
|
import { DynamoNTS_Shared } from './dynamo-nts-shared.service';
|
|
9
9
|
|
|
@@ -87,7 +87,7 @@ export class DynamoNTS_EmailService {
|
|
|
87
87
|
content = set.content
|
|
88
88
|
} else if (set.useTemplate) {
|
|
89
89
|
if (!this.templates[set.useTemplate]) {
|
|
90
|
-
throw new
|
|
90
|
+
throw new DynamoNTS_Error({
|
|
91
91
|
message: `no template found with this parameter! (${set.useTemplate})`,
|
|
92
92
|
userMessage: `We encountered an uncought BackEnd Email Service Error, please contact the responsible development team. errorcode: 701-114-101`,
|
|
93
93
|
error: new Error()
|
|
@@ -102,7 +102,7 @@ export class DynamoNTS_EmailService {
|
|
|
102
102
|
props += `${key}${index != this.templatePropertyKeys[set.useTemplate].length - 1 ? ', ' : ''}`;
|
|
103
103
|
});
|
|
104
104
|
DynamoNTS_Shared.logError('\nDynamoBEEmailService ERROR: INVALID sendEmail settings', set);
|
|
105
|
-
throw new
|
|
105
|
+
throw new DynamoNTS_Error({
|
|
106
106
|
message: `templateProperties missing! properties needed: ${props}`,
|
|
107
107
|
userMessage: `We encountered an uncought BackEnd Email Service Error, please contact the responsible development team. errorcode: 701-114-102`,
|
|
108
108
|
error: new Error()
|
|
@@ -117,7 +117,7 @@ export class DynamoNTS_EmailService {
|
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
} else {
|
|
120
|
-
throw new
|
|
120
|
+
throw new DynamoNTS_Error({
|
|
121
121
|
message: 'no content setting passsed to emailSending!',
|
|
122
122
|
userMessage: `We encountered an uncought BackEnd Email Service Error, please contact the responsible development team. errorcode: 701-114-100`,
|
|
123
123
|
error: new Error()
|
|
@@ -195,7 +195,7 @@ export class DynamoNTS_EmailService {
|
|
|
195
195
|
while (propertyOpenTagIndex >= 0) {
|
|
196
196
|
if (propertyCloseTagIndex === -1) {
|
|
197
197
|
DynamoNTS_Shared.logError(`\nDynamoBEEmailService ERROR, missing closing tag from email template! (${propertyOpenTagIndex} -)`, propertyKeys);
|
|
198
|
-
throw new
|
|
198
|
+
throw new DynamoNTS_Error({
|
|
199
199
|
message: `ERROR, missing closing tag from email template! (${propertyOpenTagIndex} -)`,
|
|
200
200
|
userMessage: `We encountered an uncought BackEnd Email Service Error, please contact the responsible development team. errorcode: 701-114-200`,
|
|
201
201
|
error: new Error()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
import { Metadata,
|
|
3
|
+
import { Metadata, DynamoNTS_DataParams } 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';
|
|
@@ -42,14 +42,14 @@ export class DynamoNTS_GlobalService extends DynamoNTS_SingletonService {
|
|
|
42
42
|
/**
|
|
43
43
|
* you can setup data tables by passing a DynamoBEDataParams list at this point
|
|
44
44
|
*/
|
|
45
|
-
dbModels:
|
|
45
|
+
dbModels: DynamoNTS_DataParams[],
|
|
46
46
|
}
|
|
47
47
|
): void {
|
|
48
48
|
this.getInstance();
|
|
49
49
|
|
|
50
50
|
try {
|
|
51
51
|
this.instance.dbServiceCollection = new DynamoNTS_DBServiceCollection();
|
|
52
|
-
set.dbModels.forEach((dbModel:
|
|
52
|
+
set.dbModels.forEach((dbModel: DynamoNTS_DataParams) => {
|
|
53
53
|
try {
|
|
54
54
|
this.instance.dbServiceCollection[dbModel.dataName] = new DynamoNTS_DBService(dbModel);
|
|
55
55
|
} catch (error) {
|
|
@@ -97,7 +97,7 @@ export class DynamoNTS_GlobalService extends DynamoNTS_SingletonService {
|
|
|
97
97
|
* @param dataParams
|
|
98
98
|
* @returns
|
|
99
99
|
*/
|
|
100
|
-
static getDBService<T extends Metadata>(dataParams:
|
|
100
|
+
static getDBService<T extends Metadata>(dataParams: DynamoNTS_DataParams): DynamoNTS_DBService<T> {
|
|
101
101
|
return this.getDBServiceByKey<T>(dataParams.dataName);
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { Router } from 'express';
|
|
3
|
-
import {
|
|
3
|
+
import { DynamoNTS_Error } from '@futdevpro/fsm-dynamo';
|
|
4
4
|
|
|
5
5
|
import { dynamoNTS_GlobalSettings } from '../_constants/dynamo-nts-global.settings';
|
|
6
6
|
import { DynamoNTS_RouteSecurity } from '../_enums/dynamo-nts-route-security.enum';
|
|
@@ -94,7 +94,7 @@ export class DynamoNTS_RoutingModule {
|
|
|
94
94
|
this.mountSecureRoute(endpoint);
|
|
95
95
|
}
|
|
96
96
|
} catch (error) {
|
|
97
|
-
throw new
|
|
97
|
+
throw new DynamoNTS_Error({
|
|
98
98
|
message: `DYNAMOBEERROR: Failed to mount routes.`,
|
|
99
99
|
userMessage: `We encountered an uncought BackEnd Build Error, please contact the responsible development team. errorcode: 900-456-100`,
|
|
100
100
|
error
|
|
@@ -130,7 +130,7 @@ export class DynamoNTS_RoutingModule {
|
|
|
130
130
|
endpointParams.preProcessess, endpointParams.getTasksExecution());
|
|
131
131
|
break;
|
|
132
132
|
default:
|
|
133
|
-
throw new
|
|
133
|
+
throw new DynamoNTS_Error({
|
|
134
134
|
message: `DYNAMOBEERROR: INVALID route type: ${endpointParams.type} - ${endpointParams.name}` ,
|
|
135
135
|
userMessage: `We encountered an uncought BackEnd Build Error, please contact the responsible development team. errorcode: 900-456-200`,
|
|
136
136
|
error: new Error()
|
|
@@ -165,7 +165,7 @@ export class DynamoNTS_RoutingModule {
|
|
|
165
165
|
endpointParams.preProcessess, endpointParams.getTasksExecution());
|
|
166
166
|
break;
|
|
167
167
|
default:
|
|
168
|
-
throw new
|
|
168
|
+
throw new DynamoNTS_Error({
|
|
169
169
|
message: `DYNAMOBEERROR: INVALID route type: ${endpointParams.type} - ${endpointParams.name}`,
|
|
170
170
|
userMessage: `We encountered an uncought BackEnd Build Error, please contact the responsible development team. errorcode: 900-456-300`,
|
|
171
171
|
error: new Error()
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import * as ReadLine from 'readline';
|
|
3
3
|
import { Request } from 'express';
|
|
4
4
|
import * as GeoIp from 'geoip-lite';
|
|
5
|
-
import { GeoIpLocation,
|
|
5
|
+
import { GeoIpLocation, Dynamo_Shared } from '@futdevpro/fsm-dynamo/shared-service';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
export class DynamoNTS_Shared extends
|
|
10
|
+
export class DynamoNTS_Shared extends Dynamo_Shared {
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
*
|