@resolveio/server-lib 1.1.6 → 1.1.7
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/fixtures/init.js +3 -15
- package/methods/collections.js +2 -2
- package/package.json +1 -1
package/fixtures/init.js
CHANGED
|
@@ -36,12 +36,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
var app_version_collection_1 = require("../collections/app-version.collection");
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
// import { LoggedInUsers } from '../collections/logged-in-users.collection';
|
|
40
|
+
// import { ActiveSubscriptions } from '../collections/active-subscription.collection';
|
|
41
41
|
var mongoose_1 = require("mongoose");
|
|
42
42
|
function loadServerInit() {
|
|
43
43
|
return __awaiter(this, void 0, void 0, function () {
|
|
44
|
-
var appVersion
|
|
44
|
+
var appVersion;
|
|
45
45
|
return __generator(this, function (_a) {
|
|
46
46
|
switch (_a.label) {
|
|
47
47
|
case 0: return [4 /*yield*/, app_version_collection_1.AppVersions.findOne()];
|
|
@@ -53,18 +53,6 @@ function loadServerInit() {
|
|
|
53
53
|
version: 1
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
return [4 /*yield*/, logged_in_users_collection_1.LoggedInUsers.find({})];
|
|
57
|
-
case 2:
|
|
58
|
-
loggedInUsers = _a.sent();
|
|
59
|
-
loggedInUsers.forEach(function (loggedInUser) {
|
|
60
|
-
logged_in_users_collection_1.LoggedInUsers.deleteOne({ _id: loggedInUser._id }).exec();
|
|
61
|
-
});
|
|
62
|
-
return [4 /*yield*/, active_subscription_collection_1.ActiveSubscriptions.find({})];
|
|
63
|
-
case 3:
|
|
64
|
-
activeSubs = _a.sent();
|
|
65
|
-
activeSubs.forEach(function (sub) {
|
|
66
|
-
active_subscription_collection_1.ActiveSubscriptions.deleteOne({ _id: sub._id }).exec();
|
|
67
|
-
});
|
|
68
56
|
return [2 /*return*/];
|
|
69
57
|
}
|
|
70
58
|
});
|
package/methods/collections.js
CHANGED
|
@@ -353,7 +353,7 @@ function loadCollectionMethods(methodManager) {
|
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
355
|
else {
|
|
356
|
-
console.log('invalid version - ' + collection, currDoc.__v, doc__v);
|
|
356
|
+
console.log(new Date(), 'invalid version - ' + collection, currDoc.__v, doc__v);
|
|
357
357
|
index_1.ResolveIOServer.getMainDB().model(index_1.ResolveIOServer.getMainDB().model(collection)['versionCollection']).findOne({
|
|
358
358
|
$and: [
|
|
359
359
|
{ '_id._id': currDoc._id },
|
|
@@ -385,7 +385,7 @@ function loadCollectionMethods(methodManager) {
|
|
|
385
385
|
}, function (err) { return reject(err); });
|
|
386
386
|
}
|
|
387
387
|
else {
|
|
388
|
-
reject('Invalid Version And Could Not Find History Props - DB: ' + currDoc.__v + ', Trying to update with :' +
|
|
388
|
+
reject('Invalid Version And Could Not Find History Props - DB: ' + currDoc.__v + ', Trying to update with :' + doc__v);
|
|
389
389
|
}
|
|
390
390
|
});
|
|
391
391
|
}
|