@resolveio/server-lib 5.2.35 → 5.2.36
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.
|
@@ -127,6 +127,8 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
127
127
|
}, 25);
|
|
128
128
|
logged_in_users_collection_1.LoggedInUsers.find().then(function (loggedInUsers) {
|
|
129
129
|
_this._loggedInUsers = loggedInUsers;
|
|
130
|
+
}, function (err) {
|
|
131
|
+
console.log(err);
|
|
130
132
|
});
|
|
131
133
|
setInterval(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
132
134
|
var userCopy, i, loggedInUser;
|
|
@@ -439,6 +441,8 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
439
441
|
var oplog = MongoOplog(that.serverConfig['OPLOG_URL']);
|
|
440
442
|
oplog.tail().then(function () {
|
|
441
443
|
console.log('tail started');
|
|
444
|
+
}, function (err) {
|
|
445
|
+
console.log(err);
|
|
442
446
|
});
|
|
443
447
|
oplog.on('insert', function (doc) {
|
|
444
448
|
var nsArray = doc.ns.split('.');
|
|
@@ -511,6 +515,8 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
511
515
|
var oplog = MongoOplog(that.serverConfig['RESOLVEIO_SUPPORT_OPLOG_URL']);
|
|
512
516
|
oplog.tail().then(function () {
|
|
513
517
|
console.log('tail started support');
|
|
518
|
+
}, function (err) {
|
|
519
|
+
console.log(err);
|
|
514
520
|
});
|
|
515
521
|
oplog.on('insert', function (doc) {
|
|
516
522
|
var nsArray = doc.ns.split('.');
|
package/methods/accounts.js
CHANGED
package/methods/collections.js
CHANGED
|
@@ -198,7 +198,7 @@ function loadCollectionMethods(methodManager) {
|
|
|
198
198
|
for (var i = 0; i < documents.length; i++) {
|
|
199
199
|
_loop_1(i);
|
|
200
200
|
}
|
|
201
|
-
Promise.all(promises).then(function (vals) { return res(vals); });
|
|
201
|
+
Promise.all(promises).then(function (vals) { return res(vals); }, function (err) { return console.log(err); });
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
204
|
},
|
|
@@ -256,9 +256,28 @@ function loadCollectionMethods(methodManager) {
|
|
|
256
256
|
else {
|
|
257
257
|
resolve(1);
|
|
258
258
|
}
|
|
259
|
+
}, function (err) {
|
|
260
|
+
console.log(err);
|
|
259
261
|
});
|
|
260
262
|
}, function (err) {
|
|
261
263
|
console.log(err);
|
|
264
|
+
index_1.ResolveIOServer.getMainDB().model(index_1.ResolveIOServer.getMainDB().model(collection)['versionCollection']).deleteMany({
|
|
265
|
+
$and: [
|
|
266
|
+
{ '_id._id': currDoc._id },
|
|
267
|
+
{ '_id.__v': { $lte: currDoc.__v - 4 } }
|
|
268
|
+
]
|
|
269
|
+
}).exec().then(function () {
|
|
270
|
+
if (updates_1) {
|
|
271
|
+
index_1.ResolveIOServer.getMainDB().model(collection).updateOne({ _id: f_document['_id'] }, updates_1, { strict: false }).exec().then(function (res) {
|
|
272
|
+
resolve(res.nModified);
|
|
273
|
+
}, function (err) { return reject(err); });
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
resolve(1);
|
|
277
|
+
}
|
|
278
|
+
}, function (err) {
|
|
279
|
+
console.log(err);
|
|
280
|
+
});
|
|
262
281
|
});
|
|
263
282
|
if (common_1.getBinarySize(JSON.stringify(f_document)) < 200000) {
|
|
264
283
|
log_collection_1.Logs.create({
|
|
@@ -316,7 +335,11 @@ function loadCollectionMethods(methodManager) {
|
|
|
316
335
|
]
|
|
317
336
|
}).exec().then(function () {
|
|
318
337
|
resolve(res.nModified);
|
|
338
|
+
}, function (err) {
|
|
339
|
+
console.log(err);
|
|
319
340
|
});
|
|
341
|
+
}, function (err) {
|
|
342
|
+
console.log(err);
|
|
320
343
|
});
|
|
321
344
|
}, function (err) { return reject(err); });
|
|
322
345
|
}
|
|
@@ -400,9 +423,28 @@ function loadCollectionMethods(methodManager) {
|
|
|
400
423
|
else {
|
|
401
424
|
resolve(1);
|
|
402
425
|
}
|
|
426
|
+
}, function (err) {
|
|
427
|
+
console.log(err);
|
|
403
428
|
});
|
|
404
429
|
}, function (err) {
|
|
405
430
|
console.log(err);
|
|
431
|
+
index_1.ResolveIOServer.getMainDB().model(index_1.ResolveIOServer.getMainDB().model(collection)['versionCollection']).deleteMany({
|
|
432
|
+
$and: [
|
|
433
|
+
{ '_id._id': currDoc._id },
|
|
434
|
+
{ '_id.__v': { $lte: currDoc.__v - 4 } }
|
|
435
|
+
]
|
|
436
|
+
}).exec().then(function () {
|
|
437
|
+
if (updates_2) {
|
|
438
|
+
index_1.ResolveIOServer.getMainDB().model(collection).updateOne({ _id: modifiedDoc_1._id }, updates_2, { strict: false }).exec().then(function (res) {
|
|
439
|
+
resolve(res.ok);
|
|
440
|
+
}, function (err) { return reject(err); });
|
|
441
|
+
}
|
|
442
|
+
else {
|
|
443
|
+
resolve(1);
|
|
444
|
+
}
|
|
445
|
+
}, function (err) {
|
|
446
|
+
console.log(err);
|
|
447
|
+
});
|
|
406
448
|
});
|
|
407
449
|
if (common_1.getBinarySize(JSON.stringify(updateParams)) < 200000) {
|
|
408
450
|
log_collection_1.Logs.create({
|
|
@@ -460,6 +502,8 @@ function loadCollectionMethods(methodManager) {
|
|
|
460
502
|
]
|
|
461
503
|
}).exec().then(function () {
|
|
462
504
|
resolve(res.nModified);
|
|
505
|
+
}, function (err) {
|
|
506
|
+
console.log(err);
|
|
463
507
|
});
|
|
464
508
|
}, function (err) {
|
|
465
509
|
console.log(err);
|
|
@@ -533,9 +577,28 @@ function loadCollectionMethods(methodManager) {
|
|
|
533
577
|
else {
|
|
534
578
|
resolve(1);
|
|
535
579
|
}
|
|
580
|
+
}, function (err) {
|
|
581
|
+
console.log(err);
|
|
536
582
|
});
|
|
537
583
|
}, function (err) {
|
|
538
584
|
console.log(err);
|
|
585
|
+
index_1.ResolveIOServer.getMainDB().model(index_1.ResolveIOServer.getMainDB().model(collection)['versionCollection']).deleteMany({
|
|
586
|
+
$and: [
|
|
587
|
+
{ '_id._id': currDoc._id },
|
|
588
|
+
{ '_id.__v': { $lte: currDoc.__v - 4 } }
|
|
589
|
+
]
|
|
590
|
+
}).exec().then(function () {
|
|
591
|
+
if (updates_3) {
|
|
592
|
+
index_1.ResolveIOServer.getMainDB().model(collection).updateOne({ _id: f_document['_id'] }, updates_3, { strict: false }).exec().then(function (res) {
|
|
593
|
+
resolve(res.nModified);
|
|
594
|
+
}, function (err) { return reject(err); });
|
|
595
|
+
}
|
|
596
|
+
else {
|
|
597
|
+
resolve(1);
|
|
598
|
+
}
|
|
599
|
+
}, function (err) {
|
|
600
|
+
console.log(err);
|
|
601
|
+
});
|
|
539
602
|
});
|
|
540
603
|
if (common_1.getBinarySize(JSON.stringify(f_document)) < 200000) {
|
|
541
604
|
log_collection_1.Logs.create({
|
|
@@ -587,6 +650,8 @@ function loadCollectionMethods(methodManager) {
|
|
|
587
650
|
]
|
|
588
651
|
}).exec().then(function () {
|
|
589
652
|
resolve(res.nModified);
|
|
653
|
+
}, function (err) {
|
|
654
|
+
console.log(err);
|
|
590
655
|
});
|
|
591
656
|
}, function (err) {
|
|
592
657
|
console.log(err);
|
|
@@ -676,9 +741,28 @@ function loadCollectionMethods(methodManager) {
|
|
|
676
741
|
else {
|
|
677
742
|
resolve(1);
|
|
678
743
|
}
|
|
744
|
+
}, function (err) {
|
|
745
|
+
console.log(err);
|
|
679
746
|
});
|
|
680
747
|
}, function (err) {
|
|
681
748
|
console.log(err);
|
|
749
|
+
index_1.ResolveIOServer.getMainDB().model(index_1.ResolveIOServer.getMainDB().model(collection)['versionCollection']).deleteMany({
|
|
750
|
+
$and: [
|
|
751
|
+
{ '_id._id': currDoc._id },
|
|
752
|
+
{ '_id.__v': { $lte: currDoc.__v - 4 } }
|
|
753
|
+
]
|
|
754
|
+
}).exec().then(function () {
|
|
755
|
+
if (updates_4) {
|
|
756
|
+
index_1.ResolveIOServer.getMainDB().model(collection).updateOne({ _id: modifiedDoc_2._id }, updates_4, { strict: false }).exec().then(function (res) {
|
|
757
|
+
resolve(res.ok);
|
|
758
|
+
}, function (err) { return reject(err); });
|
|
759
|
+
}
|
|
760
|
+
else {
|
|
761
|
+
resolve(1);
|
|
762
|
+
}
|
|
763
|
+
}, function (err) {
|
|
764
|
+
console.log(err);
|
|
765
|
+
});
|
|
682
766
|
});
|
|
683
767
|
if (common_1.getBinarySize(JSON.stringify(updateParams)) < 200000) {
|
|
684
768
|
log_collection_1.Logs.create({
|
|
@@ -730,6 +814,8 @@ function loadCollectionMethods(methodManager) {
|
|
|
730
814
|
]
|
|
731
815
|
}).exec().then(function () {
|
|
732
816
|
resolve(res.nModified);
|
|
817
|
+
}, function (err) {
|
|
818
|
+
console.log(err);
|
|
733
819
|
});
|
|
734
820
|
}, function (err) {
|
|
735
821
|
console.log(err);
|
package/methods/pdf.js
CHANGED
package/package.json
CHANGED
|
@@ -91,11 +91,15 @@ function loadSupportMethods(supportManager) {
|
|
|
91
91
|
supportTicket['fileAttached'] = filesAttached;
|
|
92
92
|
_this.sendEmail(supportTicket.client_user.email, 'ResolveIO - ' + supportTicket.support_ticket_number_string + ' Priority: ' + supportTicket.priority, '', template(supportTicket), filesAttached);
|
|
93
93
|
}
|
|
94
|
+
}, function (err) {
|
|
95
|
+
console.log(err);
|
|
94
96
|
});
|
|
95
97
|
resolve(true);
|
|
96
98
|
return [2 /*return*/];
|
|
97
99
|
});
|
|
98
|
-
}); })
|
|
100
|
+
}); }, function (err) {
|
|
101
|
+
console.log(err);
|
|
102
|
+
});
|
|
99
103
|
resolve(true);
|
|
100
104
|
}
|
|
101
105
|
else {
|
|
@@ -167,11 +171,15 @@ function loadSupportMethods(supportManager) {
|
|
|
167
171
|
supportTicket['fileAttached'] = filesAttached;
|
|
168
172
|
_this.sendEmail(supportTicket.client_user.email, 'ResolveIO - ' + supportTicket.support_ticket_number_string + ' Priority: ' + supportTicket.priority, '', template(supportTicket), filesAttached);
|
|
169
173
|
}
|
|
174
|
+
}, function (err) {
|
|
175
|
+
console.log(err);
|
|
170
176
|
});
|
|
171
177
|
resolve(true);
|
|
172
178
|
return [2 /*return*/];
|
|
173
179
|
});
|
|
174
|
-
}); })
|
|
180
|
+
}); }, function (err) {
|
|
181
|
+
console.log(err);
|
|
182
|
+
});
|
|
175
183
|
resolve(true);
|
|
176
184
|
}
|
|
177
185
|
else {
|
|
@@ -216,7 +224,9 @@ function loadSupportMethods(supportManager) {
|
|
|
216
224
|
}
|
|
217
225
|
return [2 /*return*/];
|
|
218
226
|
});
|
|
219
|
-
}); })
|
|
227
|
+
}); }, function (err) {
|
|
228
|
+
console.log(err);
|
|
229
|
+
});
|
|
220
230
|
resolve(true);
|
|
221
231
|
}
|
|
222
232
|
else {
|