@resolveio/server-lib 9.1.36 → 9.1.38
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/managers/mongo.manager.js +158 -156
- package/managers/mongo.manager.js.map +1 -1
- package/managers/queue-method.manager.js +1 -1
- package/managers/queue-method.manager.js.map +1 -1
- package/managers/subscription.manager.js +16 -12
- package/managers/subscription.manager.js.map +1 -1
- package/package.json +1 -1
- package/server-app.js +7 -7
- package/server-app.js.map +1 -1
|
@@ -136,6 +136,7 @@ var MongoManager = /** @class */ (function () {
|
|
|
136
136
|
mongoQueue.cbs_next.forEach(function (cb) {
|
|
137
137
|
cb(err, null, false);
|
|
138
138
|
});
|
|
139
|
+
queueArr.splice(_this._mongoQueue.map(function (a) { return a._id; }).indexOf(mongoQueue._id), 1);
|
|
139
140
|
_this._mongoQueue.splice(_this._mongoQueue.map(function (a) { return a._id; }).indexOf(mongoQueue._id), 1);
|
|
140
141
|
});
|
|
141
142
|
}
|
|
@@ -162,6 +163,7 @@ var MongoManager = /** @class */ (function () {
|
|
|
162
163
|
mongoQueue.cbs_next.forEach(function (cb) {
|
|
163
164
|
cb(err, null, false);
|
|
164
165
|
});
|
|
166
|
+
queueArr.splice(_this._mongoQueue.map(function (a) { return a._id; }).indexOf(mongoQueue._id), 1);
|
|
165
167
|
_this._mongoQueue.splice(_this._mongoQueue.map(function (a) { return a._id; }).indexOf(mongoQueue._id), 1);
|
|
166
168
|
});
|
|
167
169
|
}
|
|
@@ -278,18 +280,18 @@ var Collection = /** @class */ (function () {
|
|
|
278
280
|
if (allowLogs === void 0) { allowLogs = false; }
|
|
279
281
|
return new Promise(function (resolve, reject) {
|
|
280
282
|
if (_this.createLogs && allowLogs) {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
});
|
|
283
|
+
// Logs.insertOne({
|
|
284
|
+
// _id: objectIdHexString(),
|
|
285
|
+
// type: 'query',
|
|
286
|
+
// collection: this.collectionName,
|
|
287
|
+
// id_document: '',
|
|
288
|
+
// payload: JSON.stringify([pipeline, options], null, 2),
|
|
289
|
+
// method: 'aggregate',
|
|
290
|
+
// id_user: '',
|
|
291
|
+
// user: '',
|
|
292
|
+
// messageId: 0,
|
|
293
|
+
// route: ''
|
|
294
|
+
// });
|
|
293
295
|
index_1.ResolveIOServer.getMongoManager().addToQueue({
|
|
294
296
|
_id: 0,
|
|
295
297
|
name_collection: _this.collectionName,
|
|
@@ -299,18 +301,18 @@ var Collection = /** @class */ (function () {
|
|
|
299
301
|
data_function_addt: [],
|
|
300
302
|
cbs: [function (err, res, cached) {
|
|
301
303
|
if (_this.createLogs && allowLogs) {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
});
|
|
304
|
+
// Logs.insertOne({
|
|
305
|
+
// _id: objectIdHexString(),
|
|
306
|
+
// type: 'queryResponse',
|
|
307
|
+
// collection: this.collectionName,
|
|
308
|
+
// id_document: '',
|
|
309
|
+
// payload: getBinarySize(JSON.stringify(['Is Cached: ' + cached, err, res])) < 200000 ? JSON.stringify(['Is Cached: ' + cached, err, res], null, 2) : 'Too Big',
|
|
310
|
+
// method: 'aggregate',
|
|
311
|
+
// id_user: '',
|
|
312
|
+
// user: '',
|
|
313
|
+
// messageId: 0,
|
|
314
|
+
// route: ''
|
|
315
|
+
// });
|
|
314
316
|
}
|
|
315
317
|
if (err) {
|
|
316
318
|
reject(err);
|
|
@@ -503,18 +505,18 @@ var Collection = /** @class */ (function () {
|
|
|
503
505
|
var _this = this;
|
|
504
506
|
return __generator(this, function (_a) {
|
|
505
507
|
if (this.createLogs && !bypassLogs) {
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
});
|
|
508
|
+
// Logs.insertOne({
|
|
509
|
+
// _id: objectIdHexString(),
|
|
510
|
+
// type: 'query',
|
|
511
|
+
// collection: this.collectionName,
|
|
512
|
+
// id_document: '',
|
|
513
|
+
// payload: JSON.stringify([filter, options], null, 2),
|
|
514
|
+
// method: 'find',
|
|
515
|
+
// id_user: '',
|
|
516
|
+
// user: '',
|
|
517
|
+
// messageId: 0,
|
|
518
|
+
// route: ''
|
|
519
|
+
// });
|
|
518
520
|
index_1.ResolveIOServer.getMongoManager().addToQueue({
|
|
519
521
|
_id: 0,
|
|
520
522
|
name_collection: this.collectionName,
|
|
@@ -524,18 +526,18 @@ var Collection = /** @class */ (function () {
|
|
|
524
526
|
data_function_addt: [],
|
|
525
527
|
cbs: [function (err, res, cached) {
|
|
526
528
|
if (_this.createLogs && !bypassLogs) {
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
});
|
|
529
|
+
// Logs.insertOne({
|
|
530
|
+
// _id: objectIdHexString(),
|
|
531
|
+
// type: 'queryResponse',
|
|
532
|
+
// collection: this.collectionName,
|
|
533
|
+
// id_document: '',
|
|
534
|
+
// payload: getBinarySize(JSON.stringify(['Is Cached: ' + cached, err, res])) < 200000 ? JSON.stringify(['Is Cached: ' + cached, err, res], null, 2) : 'Too Big',
|
|
535
|
+
// method: 'find',
|
|
536
|
+
// id_user: '',
|
|
537
|
+
// user: '',
|
|
538
|
+
// messageId: 0,
|
|
539
|
+
// route: ''
|
|
540
|
+
// });
|
|
539
541
|
}
|
|
540
542
|
if (err) {
|
|
541
543
|
reject(err);
|
|
@@ -564,18 +566,18 @@ var Collection = /** @class */ (function () {
|
|
|
564
566
|
if (filter === void 0) { filter = {}; }
|
|
565
567
|
if (bypassLogs === void 0) { bypassLogs = false; }
|
|
566
568
|
if (this.createLogs && !bypassLogs) {
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
});
|
|
569
|
+
// Logs.insertOne({
|
|
570
|
+
// _id: objectIdHexString(),
|
|
571
|
+
// type: 'query',
|
|
572
|
+
// collection: this.collectionName,
|
|
573
|
+
// id_document: '',
|
|
574
|
+
// payload: JSON.stringify([filter, options], null, 2),
|
|
575
|
+
// method: 'findCount',
|
|
576
|
+
// id_user: '',
|
|
577
|
+
// user: '',
|
|
578
|
+
// messageId: 0,
|
|
579
|
+
// route: ''
|
|
580
|
+
// });
|
|
579
581
|
}
|
|
580
582
|
return index_1.ResolveIOServer.getMainDB().collection(this.collectionName).find(filter, options).count();
|
|
581
583
|
};
|
|
@@ -593,18 +595,18 @@ var Collection = /** @class */ (function () {
|
|
|
593
595
|
if (bypassLogs === void 0) { bypassLogs = false; }
|
|
594
596
|
return new Promise(function (resolve, reject) {
|
|
595
597
|
if (_this.createLogs && !bypassLogs) {
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
});
|
|
598
|
+
// Logs.insertOne({
|
|
599
|
+
// _id: objectIdHexString(),
|
|
600
|
+
// type: 'query',
|
|
601
|
+
// collection: this.collectionName,
|
|
602
|
+
// id_document: '',
|
|
603
|
+
// payload: JSON.stringify([filter, options], null, 2),
|
|
604
|
+
// method: 'findOne',
|
|
605
|
+
// id_user: '',
|
|
606
|
+
// user: '',
|
|
607
|
+
// messageId: 0,
|
|
608
|
+
// route: ''
|
|
609
|
+
// });
|
|
608
610
|
index_1.ResolveIOServer.getMongoManager().addToQueue({
|
|
609
611
|
_id: 0,
|
|
610
612
|
name_collection: _this.collectionName,
|
|
@@ -620,18 +622,18 @@ var Collection = /** @class */ (function () {
|
|
|
620
622
|
resolve(res);
|
|
621
623
|
}
|
|
622
624
|
if (_this.createLogs && !bypassLogs) {
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
});
|
|
625
|
+
// Logs.insertOne({
|
|
626
|
+
// _id: objectIdHexString(),
|
|
627
|
+
// type: 'queryResponse',
|
|
628
|
+
// collection: this.collectionName,
|
|
629
|
+
// id_document: '',
|
|
630
|
+
// payload: getBinarySize(JSON.stringify(['Is Cached: ' + cached, err, res])) < 200000 ? JSON.stringify(['Is Cached: ' + cached, err, res], null, 2) : 'Too Big',
|
|
631
|
+
// method: 'findOne',
|
|
632
|
+
// id_user: '',
|
|
633
|
+
// user: '',
|
|
634
|
+
// messageId: 0,
|
|
635
|
+
// route: ''
|
|
636
|
+
// });
|
|
635
637
|
}
|
|
636
638
|
}],
|
|
637
639
|
cbs_next: [],
|
|
@@ -683,34 +685,34 @@ var Collection = /** @class */ (function () {
|
|
|
683
685
|
reject(res.lastErrorObject);
|
|
684
686
|
}
|
|
685
687
|
if (_this.createLogs && !bypassLogs) {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
});
|
|
688
|
+
// Logs.insertOne({
|
|
689
|
+
// _id: objectIdHexString(),
|
|
690
|
+
// type: 'queryResponse',
|
|
691
|
+
// collection: this.collectionName,
|
|
692
|
+
// id_document: '',
|
|
693
|
+
// payload: getBinarySize(JSON.stringify([res.value])) < 200000 ? JSON.stringify([res.value], null, 2) : 'Too Big',
|
|
694
|
+
// method: 'findOneAndDelete',
|
|
695
|
+
// id_user: '',
|
|
696
|
+
// user: '',
|
|
697
|
+
// messageId: 0,
|
|
698
|
+
// route: ''
|
|
699
|
+
// });
|
|
698
700
|
}
|
|
699
701
|
}, function (err) {
|
|
700
702
|
reject(err);
|
|
701
703
|
if (_this.createLogs && !bypassLogs) {
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
});
|
|
704
|
+
// Logs.insertOne({
|
|
705
|
+
// _id: objectIdHexString(),
|
|
706
|
+
// type: 'queryResponse',
|
|
707
|
+
// collection: this.collectionName,
|
|
708
|
+
// id_document: '',
|
|
709
|
+
// payload: getBinarySize(JSON.stringify([err])) < 200000 ? JSON.stringify([err], null, 2) : 'Too Big',
|
|
710
|
+
// method: 'findOneAndDelete',
|
|
711
|
+
// id_user: '',
|
|
712
|
+
// user: '',
|
|
713
|
+
// messageId: 0,
|
|
714
|
+
// route: ''
|
|
715
|
+
// });
|
|
714
716
|
}
|
|
715
717
|
});
|
|
716
718
|
return [2 /*return*/];
|
|
@@ -771,34 +773,34 @@ var Collection = /** @class */ (function () {
|
|
|
771
773
|
reject(res.lastErrorObject);
|
|
772
774
|
}
|
|
773
775
|
if (_this.createLogs && !bypassLogs) {
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
});
|
|
776
|
+
// Logs.insertOne({
|
|
777
|
+
// _id: objectIdHexString(),
|
|
778
|
+
// type: 'queryResponse',
|
|
779
|
+
// collection: this.collectionName,
|
|
780
|
+
// id_document: '',
|
|
781
|
+
// payload: getBinarySize(JSON.stringify([res.value])) < 200000 ? JSON.stringify([res.value], null, 2) : 'Too Big',
|
|
782
|
+
// method: 'findOneAndReplace',
|
|
783
|
+
// id_user: '',
|
|
784
|
+
// user: '',
|
|
785
|
+
// messageId: 0,
|
|
786
|
+
// route: ''
|
|
787
|
+
// });
|
|
786
788
|
}
|
|
787
789
|
}, function (err) {
|
|
788
790
|
reject(err);
|
|
789
791
|
if (_this.createLogs && !bypassLogs) {
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
});
|
|
792
|
+
// Logs.insertOne({
|
|
793
|
+
// _id: objectIdHexString(),
|
|
794
|
+
// type: 'queryResponse',
|
|
795
|
+
// collection: this.collectionName,
|
|
796
|
+
// id_document: '',
|
|
797
|
+
// payload: getBinarySize(JSON.stringify([err])) < 200000 ? JSON.stringify([err], null, 2) : 'Too Big',
|
|
798
|
+
// method: 'findOneAndReplace',
|
|
799
|
+
// id_user: '',
|
|
800
|
+
// user: '',
|
|
801
|
+
// messageId: 0,
|
|
802
|
+
// route: ''
|
|
803
|
+
// });
|
|
802
804
|
}
|
|
803
805
|
});
|
|
804
806
|
return [2 /*return*/];
|
|
@@ -864,34 +866,34 @@ var Collection = /** @class */ (function () {
|
|
|
864
866
|
reject(res.lastErrorObject);
|
|
865
867
|
}
|
|
866
868
|
if (_this.createLogs && !bypassLogs) {
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
});
|
|
869
|
+
// Logs.insertOne({
|
|
870
|
+
// _id: objectIdHexString(),
|
|
871
|
+
// type: 'queryResponse',
|
|
872
|
+
// collection: this.collectionName,
|
|
873
|
+
// id_document: '',
|
|
874
|
+
// payload: getBinarySize(JSON.stringify([res.value])) < 200000 ? JSON.stringify([res.value], null, 2) : 'Too Big',
|
|
875
|
+
// method: 'findOneAndUpdate',
|
|
876
|
+
// id_user: '',
|
|
877
|
+
// user: '',
|
|
878
|
+
// messageId: 0,
|
|
879
|
+
// route: ''
|
|
880
|
+
// });
|
|
879
881
|
}
|
|
880
882
|
}, function (err) {
|
|
881
883
|
reject(err);
|
|
882
884
|
if (_this.createLogs && !bypassLogs) {
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
});
|
|
885
|
+
// Logs.insertOne({
|
|
886
|
+
// _id: objectIdHexString(),
|
|
887
|
+
// type: 'queryResponse',
|
|
888
|
+
// collection: this.collectionName,
|
|
889
|
+
// id_document: '',
|
|
890
|
+
// payload: getBinarySize(JSON.stringify([err])) < 200000 ? JSON.stringify([err], null, 2) : 'Too Big',
|
|
891
|
+
// method: 'findOneAndUpdate',
|
|
892
|
+
// id_user: '',
|
|
893
|
+
// user: '',
|
|
894
|
+
// messageId: 0,
|
|
895
|
+
// route: ''
|
|
896
|
+
// });
|
|
895
897
|
}
|
|
896
898
|
});
|
|
897
899
|
return [2 /*return*/];
|