@futdevpro/nts-dynamo 1.5.54 → 1.5.55
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/dynamo-nts-data.service.d.ts +2 -2
- package/lib/_services/dynamo-nts-data.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-data.service.js +190 -146
- package/lib/_services/dynamo-nts-data.service.js.map +1 -1
- package/lib/_services/dynamo-nts-db.service.d.ts.map +1 -1
- package/lib/_services/dynamo-nts-db.service.js +132 -83
- package/lib/_services/dynamo-nts-db.service.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/_services/dynamo-nts-data.service.ts +191 -131
- package/src/_services/dynamo-nts-db.service.ts +122 -83
|
@@ -50,14 +50,18 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
}).catch(error => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
54
|
+
throw error;
|
|
55
|
+
} else {
|
|
56
|
+
throw new Dynamo_Error({
|
|
57
|
+
status: 422,
|
|
58
|
+
errorCode: 'NTS-DBS-CD0',
|
|
59
|
+
addECToUserMsg: true,
|
|
60
|
+
message: `Create new ${this.dataParams.dbName} was unsuccessful (NTS DB)`,
|
|
61
|
+
userMessage: this.defaultErrorUserMsg,
|
|
62
|
+
error
|
|
63
|
+
});
|
|
64
|
+
}
|
|
61
65
|
});
|
|
62
66
|
|
|
63
67
|
if (typeof newData._id === 'object') {
|
|
@@ -92,14 +96,18 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
92
96
|
});
|
|
93
97
|
}
|
|
94
98
|
}).catch(error => {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
100
|
+
throw error;
|
|
101
|
+
} else {
|
|
102
|
+
throw new Dynamo_Error({
|
|
103
|
+
status: 417,
|
|
104
|
+
errorCode: 'NTS-DBS-FU0',
|
|
105
|
+
addECToUserMsg: true,
|
|
106
|
+
message: `modify ${this.dataParams.dbName} was unsuccessful (NTS DB)`,
|
|
107
|
+
userMessage: this.defaultErrorUserMsg,
|
|
108
|
+
error
|
|
109
|
+
});
|
|
110
|
+
}
|
|
103
111
|
});
|
|
104
112
|
|
|
105
113
|
if (typeof newData._id === 'object') {
|
|
@@ -132,14 +140,18 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
132
140
|
});
|
|
133
141
|
}
|
|
134
142
|
}).catch(error => {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
144
|
+
throw error;
|
|
145
|
+
} else {
|
|
146
|
+
throw new Dynamo_Error({
|
|
147
|
+
status: 417,
|
|
148
|
+
errorCode: 'NTS-DBS-GI0',
|
|
149
|
+
addECToUserMsg: true,
|
|
150
|
+
message: `get ${this.dataParams.dbName} by ID was unsuccessful (NTS DB)`,
|
|
151
|
+
userMessage: this.defaultErrorUserMsg,
|
|
152
|
+
error
|
|
153
|
+
});
|
|
154
|
+
}
|
|
143
155
|
});
|
|
144
156
|
|
|
145
157
|
if (data && typeof data._id === 'object') {
|
|
@@ -181,14 +193,18 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
181
193
|
});
|
|
182
194
|
}
|
|
183
195
|
}).catch(error => {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
196
|
+
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
197
|
+
throw error;
|
|
198
|
+
} else {
|
|
199
|
+
throw new Dynamo_Error({
|
|
200
|
+
status: 417,
|
|
201
|
+
errorCode: 'NTS-DBS-GD1',
|
|
202
|
+
addECToUserMsg: true,
|
|
203
|
+
message: `get ${this.dataParams.dbName} by ${this.depDataName} was unsuccessful (NTS DB)`,
|
|
204
|
+
userMessage: this.defaultErrorUserMsg,
|
|
205
|
+
error
|
|
206
|
+
});
|
|
207
|
+
}
|
|
192
208
|
});
|
|
193
209
|
|
|
194
210
|
if (data && typeof data._id === 'object') {
|
|
@@ -231,14 +247,18 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
231
247
|
});
|
|
232
248
|
}
|
|
233
249
|
}).catch(error => {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
250
|
+
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
251
|
+
throw error;
|
|
252
|
+
} else {
|
|
253
|
+
throw new Dynamo_Error({
|
|
254
|
+
status: 417,
|
|
255
|
+
errorCode: 'NTS-DBS-GLD1',
|
|
256
|
+
addECToUserMsg: true,
|
|
257
|
+
message: `get ${this.dataParams.dbName} by ${this.depDataName} was unsuccessful (NTS DB)`,
|
|
258
|
+
userMessage: this.defaultErrorUserMsg,
|
|
259
|
+
error
|
|
260
|
+
});
|
|
261
|
+
}
|
|
242
262
|
});
|
|
243
263
|
|
|
244
264
|
if (0 < dataList.length) {
|
|
@@ -285,14 +305,18 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
285
305
|
});
|
|
286
306
|
}
|
|
287
307
|
}).catch(error => {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
308
|
+
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
309
|
+
throw error;
|
|
310
|
+
} else {
|
|
311
|
+
throw new Dynamo_Error({
|
|
312
|
+
status: 417,
|
|
313
|
+
errorCode: 'NTS-DBS-GLDS1',
|
|
314
|
+
addECToUserMsg: true,
|
|
315
|
+
message: `get ${this.dataParams.dbName}s by ${this.depDataName}s was unsuccessful (NTS DB)`,
|
|
316
|
+
userMessage: this.defaultErrorUserMsg,
|
|
317
|
+
error
|
|
318
|
+
});
|
|
319
|
+
}
|
|
296
320
|
});
|
|
297
321
|
|
|
298
322
|
if (0 < dataList.length) {
|
|
@@ -424,14 +448,18 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
424
448
|
});
|
|
425
449
|
}
|
|
426
450
|
}).catch(error => {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
451
|
+
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
452
|
+
throw error;
|
|
453
|
+
} else {
|
|
454
|
+
throw new Dynamo_Error({
|
|
455
|
+
status: 417,
|
|
456
|
+
errorCode: 'NTS-DBS-GA0',
|
|
457
|
+
addECToUserMsg: true,
|
|
458
|
+
message: `get all ${this.dataParams.dbName} was unsuccessful (NTS DB)`,
|
|
459
|
+
userMessage: this.defaultErrorUserMsg,
|
|
460
|
+
error
|
|
461
|
+
});
|
|
462
|
+
}
|
|
435
463
|
});
|
|
436
464
|
|
|
437
465
|
if (0 < dataList.length && typeof dataList[0]._id === 'object') {
|
|
@@ -475,8 +503,7 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
475
503
|
});
|
|
476
504
|
}
|
|
477
505
|
|
|
478
|
-
await this.dataModel.deleteMany({ [this.depDataName]: dependencyId })
|
|
479
|
-
.catch(error => {
|
|
506
|
+
await this.dataModel.deleteMany({ [this.depDataName]: dependencyId }).catch(error => {
|
|
480
507
|
throw new Dynamo_Error({
|
|
481
508
|
status: 417,
|
|
482
509
|
errorCode: 'NTS-DBS-DDD1',
|
|
@@ -534,14 +561,18 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
534
561
|
});
|
|
535
562
|
}
|
|
536
563
|
}).catch(error => {
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
564
|
+
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
565
|
+
throw error;
|
|
566
|
+
} else {
|
|
567
|
+
throw new Dynamo_Error({
|
|
568
|
+
status: 417,
|
|
569
|
+
errorCode: 'NTS-DBS-FO0',
|
|
570
|
+
addECToUserMsg: true,
|
|
571
|
+
message: `findOne ${this.dataParams.dbName} was unsuccessful (NTS DB) fliter: ${filter}`,
|
|
572
|
+
userMessage: this.defaultErrorUserMsg,
|
|
573
|
+
error
|
|
574
|
+
});
|
|
575
|
+
}
|
|
545
576
|
});
|
|
546
577
|
|
|
547
578
|
if (data && typeof data._id === 'object') {
|
|
@@ -594,14 +625,18 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
594
625
|
});
|
|
595
626
|
}
|
|
596
627
|
}).catch(error => {
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
628
|
+
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
629
|
+
throw error;
|
|
630
|
+
} else {
|
|
631
|
+
throw new Dynamo_Error({
|
|
632
|
+
status: 417,
|
|
633
|
+
errorCode: 'NTS-DBS-F0',
|
|
634
|
+
addECToUserMsg: true,
|
|
635
|
+
message: `find ${this.dataParams.dbName} was unsuccessful (NTS DB)`,
|
|
636
|
+
userMessage: this.defaultErrorUserMsg,
|
|
637
|
+
error
|
|
638
|
+
});
|
|
639
|
+
}
|
|
605
640
|
});
|
|
606
641
|
|
|
607
642
|
if (0 < dataList.length) {
|
|
@@ -697,19 +732,23 @@ export class DynamoNTS_DBService<T extends Dynamo_Metadata> {
|
|
|
697
732
|
status: 204,
|
|
698
733
|
errorCode: 'NTS-DBS-FIU1',
|
|
699
734
|
addECToUserMsg: true,
|
|
700
|
-
message: `${this.dataParams.dbName} not found! (NTS DB)`,
|
|
735
|
+
message: `${this.dataParams.dbName} not found! (by id: ${id}) (NTS DB)`,
|
|
701
736
|
userMessage: this.defaultErrorUserMsg
|
|
702
737
|
});
|
|
703
738
|
}
|
|
704
739
|
}).catch(error => {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
740
|
+
if (error?.flag == 'DYNAMO ERROR OBJECT') {
|
|
741
|
+
throw error;
|
|
742
|
+
} else {
|
|
743
|
+
throw new Dynamo_Error({
|
|
744
|
+
status: 417,
|
|
745
|
+
errorCode: 'NTS-DBS-FIU0',
|
|
746
|
+
addECToUserMsg: true,
|
|
747
|
+
message: `findByIdAndUpdate ${this.dataParams.dbName} was unsuccessful (NTS DB)`,
|
|
748
|
+
userMessage: this.defaultErrorUserMsg,
|
|
749
|
+
error
|
|
750
|
+
});
|
|
751
|
+
}
|
|
713
752
|
});
|
|
714
753
|
|
|
715
754
|
if (typeof newData._id === 'object') {
|