@resolveio/server-lib 9.1.22 → 9.1.24
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.d.ts +1 -1
- package/managers/mongo.manager.js +142 -121
- package/managers/mongo.manager.js.map +1 -1
- package/managers/subscription.manager.d.ts +2 -0
- package/managers/subscription.manager.js +118 -70
- package/managers/subscription.manager.js.map +1 -1
- package/models/subscription.model.d.ts +2 -7
- package/models/subscription.model.js.map +1 -1
- package/package.json +1 -1
|
@@ -39,7 +39,7 @@ export declare class Collection<T> {
|
|
|
39
39
|
createLogs: boolean;
|
|
40
40
|
useRB: boolean;
|
|
41
41
|
constructor(collectionName: string, schema: object, useReportBuilder: any, reportBuilderLookupTables: LookupTables[], timestamps: any, createLogs: any, checkSchema: any);
|
|
42
|
-
aggregate(pipeline: object[], options?: CollectionAggregationOptions): Promise<any[]>;
|
|
42
|
+
aggregate(pipeline: object[], options?: CollectionAggregationOptions, bypassLogs?: boolean): Promise<any[]>;
|
|
43
43
|
aggregateCount(pipeline: object[], options?: CollectionAggregationOptions): Promise<number>;
|
|
44
44
|
aggregateCursor(pipeline: object[], options?: CollectionAggregationOptions): import("mongodb").AggregationCursor<any>;
|
|
45
45
|
aggregateStream(pipeline: object[], options?: CollectionAggregationOptions): import("mongodb").Cursor<any>;
|
|
@@ -221,21 +221,24 @@ var Collection = /** @class */ (function () {
|
|
|
221
221
|
}
|
|
222
222
|
}, 1);
|
|
223
223
|
}
|
|
224
|
-
Collection.prototype.aggregate = function (pipeline, options) {
|
|
224
|
+
Collection.prototype.aggregate = function (pipeline, options, bypassLogs) {
|
|
225
225
|
var _this = this;
|
|
226
|
+
if (bypassLogs === void 0) { bypassLogs = false; }
|
|
226
227
|
return new Promise(function (resolve, reject) {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
228
|
+
if (_this.createLogs && !bypassLogs) {
|
|
229
|
+
log_collection_1.Logs.insertOne({
|
|
230
|
+
_id: objectIdHexString(),
|
|
231
|
+
type: 'query',
|
|
232
|
+
collection: _this.collectionName,
|
|
233
|
+
id_document: '',
|
|
234
|
+
payload: common_1.getBinarySize(JSON.stringify([pipeline, options])) < 200000 ? JSON.stringify([pipeline, options], null, 2) : 'Too Big',
|
|
235
|
+
method: 'aggregate',
|
|
236
|
+
id_user: '',
|
|
237
|
+
user: '',
|
|
238
|
+
messageId: 0,
|
|
239
|
+
route: ''
|
|
240
|
+
});
|
|
241
|
+
}
|
|
239
242
|
index_1.ResolveIOServer.getMongoManager().addToQueue({
|
|
240
243
|
_id: 0,
|
|
241
244
|
name_collection: _this.collectionName,
|
|
@@ -250,18 +253,20 @@ var Collection = /** @class */ (function () {
|
|
|
250
253
|
else {
|
|
251
254
|
resolve(res);
|
|
252
255
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
256
|
+
if (_this.createLogs && !bypassLogs) {
|
|
257
|
+
log_collection_1.Logs.insertOne({
|
|
258
|
+
_id: objectIdHexString(),
|
|
259
|
+
type: 'queryResponse',
|
|
260
|
+
collection: _this.collectionName,
|
|
261
|
+
id_document: '',
|
|
262
|
+
payload: common_1.getBinarySize(JSON.stringify([err, res])) < 200000 ? JSON.stringify([err, res], null, 2) : 'Too Big',
|
|
263
|
+
method: 'aggregate',
|
|
264
|
+
id_user: '',
|
|
265
|
+
user: '',
|
|
266
|
+
messageId: 0,
|
|
267
|
+
route: ''
|
|
268
|
+
});
|
|
269
|
+
}
|
|
265
270
|
}],
|
|
266
271
|
cbs_next: [],
|
|
267
272
|
running: false
|
|
@@ -462,18 +467,20 @@ var Collection = /** @class */ (function () {
|
|
|
462
467
|
else {
|
|
463
468
|
resolve(res);
|
|
464
469
|
}
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
470
|
+
if (_this.createLogs && !bypassLogs) {
|
|
471
|
+
log_collection_1.Logs.insertOne({
|
|
472
|
+
_id: objectIdHexString(),
|
|
473
|
+
type: 'queryResponse',
|
|
474
|
+
collection: _this.collectionName,
|
|
475
|
+
id_document: '',
|
|
476
|
+
payload: JSON.stringify([err, res], null, 2),
|
|
477
|
+
method: 'find',
|
|
478
|
+
id_user: '',
|
|
479
|
+
user: '',
|
|
480
|
+
messageId: 0,
|
|
481
|
+
route: ''
|
|
482
|
+
});
|
|
483
|
+
}
|
|
477
484
|
}],
|
|
478
485
|
cbs_next: [],
|
|
479
486
|
running: false
|
|
@@ -545,18 +552,20 @@ var Collection = /** @class */ (function () {
|
|
|
545
552
|
else {
|
|
546
553
|
resolve(res);
|
|
547
554
|
}
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
555
|
+
if (_this.createLogs && !bypassLogs) {
|
|
556
|
+
log_collection_1.Logs.insertOne({
|
|
557
|
+
_id: objectIdHexString(),
|
|
558
|
+
type: 'queryResponse',
|
|
559
|
+
collection: _this.collectionName,
|
|
560
|
+
id_document: '',
|
|
561
|
+
payload: JSON.stringify([err, res], null, 2),
|
|
562
|
+
method: 'findOne',
|
|
563
|
+
id_user: '',
|
|
564
|
+
user: '',
|
|
565
|
+
messageId: 0,
|
|
566
|
+
route: ''
|
|
567
|
+
});
|
|
568
|
+
}
|
|
560
569
|
}],
|
|
561
570
|
cbs_next: [],
|
|
562
571
|
running: false
|
|
@@ -600,32 +609,36 @@ var Collection = /** @class */ (function () {
|
|
|
600
609
|
else {
|
|
601
610
|
reject(res.lastErrorObject);
|
|
602
611
|
}
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
612
|
+
if (_this.createLogs && !bypassLogs) {
|
|
613
|
+
log_collection_1.Logs.insertOne({
|
|
614
|
+
_id: objectIdHexString(),
|
|
615
|
+
type: 'queryResponse',
|
|
616
|
+
collection: _this.collectionName,
|
|
617
|
+
id_document: '',
|
|
618
|
+
payload: JSON.stringify([res.value], null, 2),
|
|
619
|
+
method: 'findOneAndDelete',
|
|
620
|
+
id_user: '',
|
|
621
|
+
user: '',
|
|
622
|
+
messageId: 0,
|
|
623
|
+
route: ''
|
|
624
|
+
});
|
|
625
|
+
}
|
|
615
626
|
}, function (err) {
|
|
616
627
|
reject(err);
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
628
|
+
if (_this.createLogs && !bypassLogs) {
|
|
629
|
+
log_collection_1.Logs.insertOne({
|
|
630
|
+
_id: objectIdHexString(),
|
|
631
|
+
type: 'queryResponse',
|
|
632
|
+
collection: _this.collectionName,
|
|
633
|
+
id_document: '',
|
|
634
|
+
payload: JSON.stringify([err], null, 2),
|
|
635
|
+
method: 'findOneAndDelete',
|
|
636
|
+
id_user: '',
|
|
637
|
+
user: '',
|
|
638
|
+
messageId: 0,
|
|
639
|
+
route: ''
|
|
640
|
+
});
|
|
641
|
+
}
|
|
629
642
|
});
|
|
630
643
|
return [2 /*return*/];
|
|
631
644
|
}
|
|
@@ -684,32 +697,36 @@ var Collection = /** @class */ (function () {
|
|
|
684
697
|
else {
|
|
685
698
|
reject(res.lastErrorObject);
|
|
686
699
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
700
|
+
if (_this.createLogs && !bypassLogs) {
|
|
701
|
+
log_collection_1.Logs.insertOne({
|
|
702
|
+
_id: objectIdHexString(),
|
|
703
|
+
type: 'queryResponse',
|
|
704
|
+
collection: _this.collectionName,
|
|
705
|
+
id_document: '',
|
|
706
|
+
payload: JSON.stringify([res.value], null, 2),
|
|
707
|
+
method: 'findOneAndReplace',
|
|
708
|
+
id_user: '',
|
|
709
|
+
user: '',
|
|
710
|
+
messageId: 0,
|
|
711
|
+
route: ''
|
|
712
|
+
});
|
|
713
|
+
}
|
|
699
714
|
}, function (err) {
|
|
700
715
|
reject(err);
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
716
|
+
if (_this.createLogs && !bypassLogs) {
|
|
717
|
+
log_collection_1.Logs.insertOne({
|
|
718
|
+
_id: objectIdHexString(),
|
|
719
|
+
type: 'queryResponse',
|
|
720
|
+
collection: _this.collectionName,
|
|
721
|
+
id_document: '',
|
|
722
|
+
payload: JSON.stringify([err], null, 2),
|
|
723
|
+
method: 'findOneAndReplace',
|
|
724
|
+
id_user: '',
|
|
725
|
+
user: '',
|
|
726
|
+
messageId: 0,
|
|
727
|
+
route: ''
|
|
728
|
+
});
|
|
729
|
+
}
|
|
713
730
|
});
|
|
714
731
|
return [2 /*return*/];
|
|
715
732
|
}
|
|
@@ -773,32 +790,36 @@ var Collection = /** @class */ (function () {
|
|
|
773
790
|
else {
|
|
774
791
|
reject(res.lastErrorObject);
|
|
775
792
|
}
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
793
|
+
if (_this.createLogs && !bypassLogs) {
|
|
794
|
+
log_collection_1.Logs.insertOne({
|
|
795
|
+
_id: objectIdHexString(),
|
|
796
|
+
type: 'queryResponse',
|
|
797
|
+
collection: _this.collectionName,
|
|
798
|
+
id_document: '',
|
|
799
|
+
payload: JSON.stringify([res.value], null, 2),
|
|
800
|
+
method: 'findOneAndUpdate',
|
|
801
|
+
id_user: '',
|
|
802
|
+
user: '',
|
|
803
|
+
messageId: 0,
|
|
804
|
+
route: ''
|
|
805
|
+
});
|
|
806
|
+
}
|
|
788
807
|
}, function (err) {
|
|
789
808
|
reject(err);
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
809
|
+
if (_this.createLogs && !bypassLogs) {
|
|
810
|
+
log_collection_1.Logs.insertOne({
|
|
811
|
+
_id: objectIdHexString(),
|
|
812
|
+
type: 'queryResponse',
|
|
813
|
+
collection: _this.collectionName,
|
|
814
|
+
id_document: '',
|
|
815
|
+
payload: JSON.stringify([err], null, 2),
|
|
816
|
+
method: 'findOneAndUpdate',
|
|
817
|
+
id_user: '',
|
|
818
|
+
user: '',
|
|
819
|
+
messageId: 0,
|
|
820
|
+
route: ''
|
|
821
|
+
});
|
|
822
|
+
}
|
|
802
823
|
});
|
|
803
824
|
return [2 /*return*/];
|
|
804
825
|
}
|