@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.
@@ -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
- log_collection_1.Logs.insertOne({
282
- _id: objectIdHexString(),
283
- type: 'query',
284
- collection: _this.collectionName,
285
- id_document: '',
286
- payload: JSON.stringify([pipeline, options], null, 2),
287
- method: 'aggregate',
288
- id_user: '',
289
- user: '',
290
- messageId: 0,
291
- route: ''
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
- log_collection_1.Logs.insertOne({
303
- _id: objectIdHexString(),
304
- type: 'queryResponse',
305
- collection: _this.collectionName,
306
- id_document: '',
307
- payload: common_1.getBinarySize(JSON.stringify(['Is Cached: ' + cached, err, res])) < 200000 ? JSON.stringify(['Is Cached: ' + cached, err, res], null, 2) : 'Too Big',
308
- method: 'aggregate',
309
- id_user: '',
310
- user: '',
311
- messageId: 0,
312
- route: ''
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
- log_collection_1.Logs.insertOne({
507
- _id: objectIdHexString(),
508
- type: 'query',
509
- collection: this.collectionName,
510
- id_document: '',
511
- payload: JSON.stringify([filter, options], null, 2),
512
- method: 'find',
513
- id_user: '',
514
- user: '',
515
- messageId: 0,
516
- route: ''
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
- log_collection_1.Logs.insertOne({
528
- _id: objectIdHexString(),
529
- type: 'queryResponse',
530
- collection: _this.collectionName,
531
- id_document: '',
532
- payload: common_1.getBinarySize(JSON.stringify(['Is Cached: ' + cached, err, res])) < 200000 ? JSON.stringify(['Is Cached: ' + cached, err, res], null, 2) : 'Too Big',
533
- method: 'find',
534
- id_user: '',
535
- user: '',
536
- messageId: 0,
537
- route: ''
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
- log_collection_1.Logs.insertOne({
568
- _id: objectIdHexString(),
569
- type: 'query',
570
- collection: this.collectionName,
571
- id_document: '',
572
- payload: JSON.stringify([filter, options], null, 2),
573
- method: 'findCount',
574
- id_user: '',
575
- user: '',
576
- messageId: 0,
577
- route: ''
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
- log_collection_1.Logs.insertOne({
597
- _id: objectIdHexString(),
598
- type: 'query',
599
- collection: _this.collectionName,
600
- id_document: '',
601
- payload: JSON.stringify([filter, options], null, 2),
602
- method: 'findOne',
603
- id_user: '',
604
- user: '',
605
- messageId: 0,
606
- route: ''
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
- log_collection_1.Logs.insertOne({
624
- _id: objectIdHexString(),
625
- type: 'queryResponse',
626
- collection: _this.collectionName,
627
- id_document: '',
628
- payload: common_1.getBinarySize(JSON.stringify(['Is Cached: ' + cached, err, res])) < 200000 ? JSON.stringify(['Is Cached: ' + cached, err, res], null, 2) : 'Too Big',
629
- method: 'findOne',
630
- id_user: '',
631
- user: '',
632
- messageId: 0,
633
- route: ''
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
- log_collection_1.Logs.insertOne({
687
- _id: objectIdHexString(),
688
- type: 'queryResponse',
689
- collection: _this.collectionName,
690
- id_document: '',
691
- payload: common_1.getBinarySize(JSON.stringify([res.value])) < 200000 ? JSON.stringify([res.value], null, 2) : 'Too Big',
692
- method: 'findOneAndDelete',
693
- id_user: '',
694
- user: '',
695
- messageId: 0,
696
- route: ''
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
- log_collection_1.Logs.insertOne({
703
- _id: objectIdHexString(),
704
- type: 'queryResponse',
705
- collection: _this.collectionName,
706
- id_document: '',
707
- payload: common_1.getBinarySize(JSON.stringify([err])) < 200000 ? JSON.stringify([err], null, 2) : 'Too Big',
708
- method: 'findOneAndDelete',
709
- id_user: '',
710
- user: '',
711
- messageId: 0,
712
- route: ''
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
- log_collection_1.Logs.insertOne({
775
- _id: objectIdHexString(),
776
- type: 'queryResponse',
777
- collection: _this.collectionName,
778
- id_document: '',
779
- payload: common_1.getBinarySize(JSON.stringify([res.value])) < 200000 ? JSON.stringify([res.value], null, 2) : 'Too Big',
780
- method: 'findOneAndReplace',
781
- id_user: '',
782
- user: '',
783
- messageId: 0,
784
- route: ''
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
- log_collection_1.Logs.insertOne({
791
- _id: objectIdHexString(),
792
- type: 'queryResponse',
793
- collection: _this.collectionName,
794
- id_document: '',
795
- payload: common_1.getBinarySize(JSON.stringify([err])) < 200000 ? JSON.stringify([err], null, 2) : 'Too Big',
796
- method: 'findOneAndReplace',
797
- id_user: '',
798
- user: '',
799
- messageId: 0,
800
- route: ''
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
- log_collection_1.Logs.insertOne({
868
- _id: objectIdHexString(),
869
- type: 'queryResponse',
870
- collection: _this.collectionName,
871
- id_document: '',
872
- payload: common_1.getBinarySize(JSON.stringify([res.value])) < 200000 ? JSON.stringify([res.value], null, 2) : 'Too Big',
873
- method: 'findOneAndUpdate',
874
- id_user: '',
875
- user: '',
876
- messageId: 0,
877
- route: ''
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
- log_collection_1.Logs.insertOne({
884
- _id: objectIdHexString(),
885
- type: 'queryResponse',
886
- collection: _this.collectionName,
887
- id_document: '',
888
- payload: common_1.getBinarySize(JSON.stringify([err])) < 200000 ? JSON.stringify([err], null, 2) : 'Too Big',
889
- method: 'findOneAndUpdate',
890
- id_user: '',
891
- user: '',
892
- messageId: 0,
893
- route: ''
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*/];