@resolveio/server-lib 8.1.36 → 9.0.0
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/collections/app-status.collection.d.ts +2 -6
- package/collections/app-status.collection.js +4 -21
- package/collections/app-status.collection.js.map +1 -1
- package/collections/app-version.collection.d.ts +2 -6
- package/collections/app-version.collection.js +4 -34
- package/collections/app-version.collection.js.map +1 -1
- package/collections/counter.collection.d.ts +2 -6
- package/collections/counter.collection.js +4 -34
- package/collections/counter.collection.js.map +1 -1
- package/collections/cron-job-history.collection.d.ts +3 -7
- package/collections/cron-job-history.collection.js +5 -34
- package/collections/cron-job-history.collection.js.map +1 -1
- package/collections/cron-job.collection.d.ts +2 -6
- package/collections/cron-job.collection.js +4 -33
- package/collections/cron-job.collection.js.map +1 -1
- package/collections/email-history.collection.d.ts +2 -6
- package/collections/email-history.collection.js +4 -21
- package/collections/email-history.collection.js.map +1 -1
- package/collections/email-verified.collection.d.ts +2 -6
- package/collections/email-verified.collection.js +5 -22
- package/collections/email-verified.collection.js.map +1 -1
- package/collections/file.collection.d.ts +2 -6
- package/collections/file.collection.js +4 -26
- package/collections/file.collection.js.map +1 -1
- package/collections/flag.collection.d.ts +2 -6
- package/collections/flag.collection.js +4 -21
- package/collections/flag.collection.js.map +1 -1
- package/collections/log-method-latency.collection.d.ts +2 -6
- package/collections/log-method-latency.collection.js +7 -22
- package/collections/log-method-latency.collection.js.map +1 -1
- package/collections/log-subscription.collection.d.ts +2 -6
- package/collections/log-subscription.collection.js +9 -24
- package/collections/log-subscription.collection.js.map +1 -1
- package/collections/log.collection.d.ts +2 -6
- package/collections/log.collection.js +9 -25
- package/collections/log.collection.js.map +1 -1
- package/collections/logged-in-users.collection.d.ts +2 -6
- package/collections/logged-in-users.collection.js +5 -32
- package/collections/logged-in-users.collection.js.map +1 -1
- package/collections/method-call.collection.d.ts +2 -5
- package/collections/method-call.collection.js +5 -11
- package/collections/method-call.collection.js.map +1 -1
- package/collections/method-response.collection.d.ts +2 -5
- package/collections/method-response.collection.js +5 -11
- package/collections/method-response.collection.js.map +1 -1
- package/collections/monitor-cpu.collection.d.ts +2 -6
- package/collections/monitor-cpu.collection.js +9 -26
- package/collections/monitor-cpu.collection.js.map +1 -1
- package/collections/monitor-https-inbound.collection.d.ts +2 -6
- package/collections/monitor-https-inbound.collection.js +9 -26
- package/collections/monitor-https-inbound.collection.js.map +1 -1
- package/collections/monitor-https-outbound.collection.d.ts +2 -6
- package/collections/monitor-https-outbound.collection.js +11 -28
- package/collections/monitor-https-outbound.collection.js.map +1 -1
- package/collections/monitor-memory.collection.d.ts +2 -6
- package/collections/monitor-memory.collection.js +8 -25
- package/collections/monitor-memory.collection.js.map +1 -1
- package/collections/monitor-mongo.collection.d.ts +2 -6
- package/collections/monitor-mongo.collection.js +8 -25
- package/collections/monitor-mongo.collection.js.map +1 -1
- package/collections/notification.collection.d.ts +2 -6
- package/collections/notification.collection.js +4 -21
- package/collections/notification.collection.js.map +1 -1
- package/collections/queue-flag.collection.d.ts +2 -6
- package/collections/queue-flag.collection.js +5 -22
- package/collections/queue-flag.collection.js.map +1 -1
- package/collections/queue-method.collection.d.ts +2 -6
- package/collections/queue-method.collection.js +6 -77
- package/collections/queue-method.collection.js.map +1 -1
- package/collections/queue-response.collection.d.ts +2 -6
- package/collections/queue-response.collection.js +5 -34
- package/collections/queue-response.collection.js.map +1 -1
- package/collections/report-builder-dashboard-builder.collection.d.ts +2 -6
- package/collections/report-builder-dashboard-builder.collection.js +6 -35
- package/collections/report-builder-dashboard-builder.collection.js.map +1 -1
- package/collections/report-builder-library.collection.d.ts +2 -6
- package/collections/report-builder-library.collection.js +7 -36
- package/collections/report-builder-library.collection.js.map +1 -1
- package/collections/report-builder-report.collection.d.ts +2 -6
- package/collections/report-builder-report.collection.js +7 -36
- package/collections/report-builder-report.collection.js.map +1 -1
- package/collections/user-group.collection.d.ts +3 -6
- package/collections/user-group.collection.js +5 -38
- package/collections/user-group.collection.js.map +1 -1
- package/collections/user-guide.collection.d.ts +2 -6
- package/collections/user-guide.collection.js +4 -26
- package/collections/user-guide.collection.js.map +1 -1
- package/collections/user.collection.d.ts +3 -6
- package/collections/user.collection.js +36 -62
- package/collections/user.collection.js.map +1 -1
- package/fixtures/cron-jobs.js +5 -5
- package/fixtures/cron-jobs.js.map +1 -1
- package/fixtures/init.js +2 -2
- package/fixtures/init.js.map +1 -1
- package/http/auth.js +201 -185
- package/http/auth.js.map +1 -1
- package/index.d.ts +2 -1
- package/index.js +5 -6
- package/index.js.map +1 -1
- package/managers/cron.manager.js +6 -6
- package/managers/cron.manager.js.map +1 -1
- package/managers/method.manager.js +10 -10
- package/managers/method.manager.js.map +1 -1
- package/managers/mongo.manager.d.ts +102 -0
- package/managers/mongo.manager.js +514 -0
- package/managers/mongo.manager.js.map +1 -0
- package/managers/monitor.manager.js +6 -6
- package/managers/monitor.manager.js.map +1 -1
- package/managers/queue-method.manager.js +14 -14
- package/managers/queue-method.manager.js.map +1 -1
- package/managers/subscription.manager.js +9 -7
- package/managers/subscription.manager.js.map +1 -1
- package/methods/accounts.js +23 -21
- package/methods/accounts.js.map +1 -1
- package/methods/aws.js +7 -7
- package/methods/aws.js.map +1 -1
- package/methods/collections.js +112 -119
- package/methods/collections.js.map +1 -1
- package/methods/counters.js +5 -5
- package/methods/counters.js.map +1 -1
- package/methods/cron-jobs.js +2 -2
- package/methods/cron-jobs.js.map +1 -1
- package/methods/logs.js +8 -8
- package/methods/logs.js.map +1 -1
- package/methods/monitor.js +6 -6
- package/methods/monitor.js.map +1 -1
- package/methods/pdf.js +5 -5
- package/methods/pdf.js.map +1 -1
- package/methods/report-builder.js +2 -2
- package/methods/report-builder.js.map +1 -1
- package/models/report-builder.model.d.ts +1 -2
- package/models/report-builder.model.js.map +1 -1
- package/models/user.model.d.ts +9 -7
- package/models/user.model.js.map +1 -1
- package/package.json +26 -27
- package/public_api.js +1 -1
- package/publications/app-status.js +1 -1
- package/publications/app-status.js.map +1 -1
- package/publications/app-version.js +1 -1
- package/publications/app-version.js.map +1 -1
- package/publications/cron-jobs.js +2 -2
- package/publications/cron-jobs.js.map +1 -1
- package/publications/files.js +3 -3
- package/publications/files.js.map +1 -1
- package/publications/flags.js +1 -1
- package/publications/flags.js.map +1 -1
- package/publications/logs.js +3 -3
- package/publications/logs.js.map +1 -1
- package/publications/method-calls.js +1 -1
- package/publications/method-calls.js.map +1 -1
- package/publications/method-responses.js +1 -1
- package/publications/method-responses.js.map +1 -1
- package/publications/notifications.js +1 -1
- package/publications/notifications.js.map +1 -1
- package/publications/report-builder-dashboard-builders.js +2 -2
- package/publications/report-builder-dashboard-builders.js.map +1 -1
- package/publications/report-builder-libraries.js +3 -3
- package/publications/report-builder-libraries.js.map +1 -1
- package/publications/report-builder-reports.js +4 -4
- package/publications/report-builder-reports.js.map +1 -1
- package/publications/super-admin.js +1 -1
- package/publications/super-admin.js.map +1 -1
- package/publications/user-groups.js +1 -1
- package/publications/user-groups.js.map +1 -1
- package/publications/user-guides.js +1 -1
- package/publications/user-guides.js.map +1 -1
- package/server-app.d.ts +4 -1
- package/server-app.js +19 -28
- package/server-app.js.map +1 -1
- package/util/common.d.ts +2 -3
- package/util/common.js +16 -21
- package/util/common.js.map +1 -1
- package/util/schema-report-builder.js +5 -5
- package/util/schema-report-builder.js.map +1 -1
- package/managers/database.manager.d.ts +0 -6
- package/managers/database.manager.js +0 -15
- package/managers/database.manager.js.map +0 -1
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var mongoose_1 = require("mongoose");
|
|
5
|
-
var simpl_schema_1 = require("simpl-schema");
|
|
3
|
+
exports.UserGuides = void 0;
|
|
6
4
|
var index_1 = require("../index");
|
|
7
|
-
var
|
|
5
|
+
var mongo_manager_1 = require("../managers/mongo.manager");
|
|
8
6
|
var schema = {
|
|
9
7
|
_id: {
|
|
10
8
|
type: String,
|
|
@@ -32,32 +30,12 @@ var schema = {
|
|
|
32
30
|
type: String
|
|
33
31
|
},
|
|
34
32
|
};
|
|
35
|
-
var DefaultSchema = new mongoose_1.Schema(schema, {
|
|
36
|
-
skipVersioning: true,
|
|
37
|
-
versionKey: false,
|
|
38
|
-
timestamps: true
|
|
39
|
-
});
|
|
40
33
|
exports.UserGuides = null;
|
|
41
|
-
exports.UserGuideVersions = null;
|
|
42
34
|
initializeCollection();
|
|
43
35
|
function initializeCollection() {
|
|
44
36
|
if (index_1.ResolveIOServer.getMainDB()) {
|
|
45
|
-
|
|
46
|
-
exports.UserGuides
|
|
47
|
-
schema._id = {
|
|
48
|
-
type: mongoose_1.Schema.Types.Mixed
|
|
49
|
-
};
|
|
50
|
-
var VersionSchema = new mongoose_1.Schema(schema, {
|
|
51
|
-
skipVersioning: true,
|
|
52
|
-
versionKey: false,
|
|
53
|
-
timestamps: true
|
|
54
|
-
});
|
|
55
|
-
exports.UserGuides['versionCollection'] = 'user-guides.versions';
|
|
56
|
-
exports.UserGuideVersions = index_1.ResolveIOServer.getMainDB().model(exports.UserGuides['versionCollection'], VersionSchema);
|
|
57
|
-
//------------- Report Builder Schema
|
|
58
|
-
var rbLookups = [];
|
|
59
|
-
var rbSchema = Object.assign(schema, common_1.buildRbLookups(rbLookups, DefaultSchema, []));
|
|
60
|
-
exports.UserGuides['rbSchema'] = common_1.buildRbSchema(rbSchema);
|
|
37
|
+
var model = new mongo_manager_1.Model('user-guides', schema, false, false);
|
|
38
|
+
exports.UserGuides = model.collection_main;
|
|
61
39
|
}
|
|
62
40
|
else {
|
|
63
41
|
setTimeout(function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collections/user-guide.collection.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/collections/user-guide.collection.ts"],"names":[],"mappings":";;;AAAA,kCAA2C;AAC3C,2DAA8D;AAG9D,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,IAAI,EAAE;QACL,IAAI,EAAE,MAAM;KACZ;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,OAAO,EAAE;QACR,IAAI,EAAE,MAAM;KACZ;CACD,CAAC;AAES,QAAA,UAAU,GAA+B,IAAI,CAAC;AAEzD,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QAChC,IAAM,KAAK,GAAG,IAAI,qBAAK,CAAiB,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC7E,kBAAU,GAAG,KAAK,CAAC,eAAe,CAAC;KACnC;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"user-guide.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Collection, Model } from '../managers/mongo.manager';\nimport { UserGuideModel } from '../models/user-guide.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tlink: {\n\t\ttype: String\n\t},\n\tlabel: {\n\t\ttype: String\n\t},\n\tmessage: {\n\t\ttype: String\n\t},\n};\n\nexport let UserGuides: Collection<UserGuideModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<UserGuideModel>('user-guides', schema, false, false);\n\t\tUserGuides = model.collection_main;\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UserCollection } from '../managers/mongo.manager';
|
|
2
2
|
import { UserModel } from '../models/user.model';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export declare let Users: Model<ResolveIOModel>;
|
|
6
|
-
export declare let UserVersions: Model<ResolveIOModel>;
|
|
7
|
-
export {};
|
|
3
|
+
export declare let Users: UserCollection<UserModel>;
|
|
4
|
+
export declare let UserVersions: UserCollection<UserModel>;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserVersions = exports.Users = void 0;
|
|
4
|
-
var mongoose_1 = require("mongoose");
|
|
5
|
-
var passportLocalMongoose = require("passport-local-mongoose");
|
|
6
|
-
var simpl_schema_1 = require("simpl-schema");
|
|
7
4
|
var index_1 = require("../index");
|
|
8
|
-
var
|
|
5
|
+
var mongo_manager_1 = require("../managers/mongo.manager");
|
|
9
6
|
var schema = {
|
|
10
7
|
_id: {
|
|
11
8
|
type: String,
|
|
@@ -81,30 +78,6 @@ var schema = {
|
|
|
81
78
|
'roles.miscs.$': {
|
|
82
79
|
type: String
|
|
83
80
|
},
|
|
84
|
-
attempts: {
|
|
85
|
-
type: Number,
|
|
86
|
-
optional: true
|
|
87
|
-
},
|
|
88
|
-
last: {
|
|
89
|
-
type: Date,
|
|
90
|
-
optional: true
|
|
91
|
-
},
|
|
92
|
-
services: {
|
|
93
|
-
type: Object,
|
|
94
|
-
optional: true
|
|
95
|
-
},
|
|
96
|
-
'services.enrollment': {
|
|
97
|
-
type: String,
|
|
98
|
-
optional: true
|
|
99
|
-
},
|
|
100
|
-
'services.forgot_password': {
|
|
101
|
-
type: String,
|
|
102
|
-
optional: true
|
|
103
|
-
},
|
|
104
|
-
'services.reset_password': {
|
|
105
|
-
type: String,
|
|
106
|
-
optional: true
|
|
107
|
-
},
|
|
108
81
|
username: {
|
|
109
82
|
type: String,
|
|
110
83
|
optional: true
|
|
@@ -222,46 +195,47 @@ var schema = {
|
|
|
222
195
|
'settings.opening_route': {
|
|
223
196
|
type: String
|
|
224
197
|
},
|
|
198
|
+
salt: {
|
|
199
|
+
type: String
|
|
200
|
+
},
|
|
201
|
+
hash: {
|
|
202
|
+
type: String
|
|
203
|
+
},
|
|
204
|
+
attempts: {
|
|
205
|
+
type: Number
|
|
206
|
+
},
|
|
207
|
+
last: {
|
|
208
|
+
type: Number
|
|
209
|
+
},
|
|
210
|
+
services: {
|
|
211
|
+
type: Object,
|
|
212
|
+
optional: true
|
|
213
|
+
},
|
|
214
|
+
'services.enrollment': {
|
|
215
|
+
type: String,
|
|
216
|
+
optional: true
|
|
217
|
+
},
|
|
218
|
+
'services.forgot_password': {
|
|
219
|
+
type: String,
|
|
220
|
+
optional: true
|
|
221
|
+
},
|
|
222
|
+
'services.reset_password': {
|
|
223
|
+
type: String,
|
|
224
|
+
optional: true
|
|
225
|
+
},
|
|
225
226
|
};
|
|
226
|
-
var DefaultSchema = new mongoose_1.Schema(schema, {
|
|
227
|
-
skipVersioning: true,
|
|
228
|
-
versionKey: false,
|
|
229
|
-
timestamps: true
|
|
230
|
-
});
|
|
231
|
-
DefaultSchema.plugin(passportLocalMongoose, {
|
|
232
|
-
usernameUnique: true,
|
|
233
|
-
limitAttempts: true,
|
|
234
|
-
maxAttempts: 5,
|
|
235
|
-
findByUsername: function (mongooseModel, queryParameters) {
|
|
236
|
-
// Add additional query parameter - AND condition - active: true
|
|
237
|
-
queryParameters.active = true;
|
|
238
|
-
return mongooseModel.findOne(queryParameters);
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
DefaultSchema.index({ fullname: 1 });
|
|
242
|
-
DefaultSchema.index({ active: 1 });
|
|
243
227
|
exports.Users = null;
|
|
244
228
|
exports.UserVersions = null;
|
|
245
229
|
initializeCollection();
|
|
246
230
|
function initializeCollection() {
|
|
247
231
|
if (index_1.ResolveIOServer.getMainDB()) {
|
|
248
|
-
|
|
249
|
-
exports.Users
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
versionKey: false,
|
|
256
|
-
timestamps: true
|
|
257
|
-
});
|
|
258
|
-
VersionSchema.index({ '_id.__v': 1, '_id._id': 1 });
|
|
259
|
-
exports.Users['versionCollection'] = 'users.versions';
|
|
260
|
-
exports.UserVersions = index_1.ResolveIOServer.getMainDB().model(exports.Users['versionCollection'], VersionSchema);
|
|
261
|
-
//------------- Report Builder Schema
|
|
262
|
-
var rbLookups = [];
|
|
263
|
-
var rbSchema = Object.assign(schema, common_1.buildRbLookups(rbLookups, DefaultSchema, []));
|
|
264
|
-
exports.Users['rbSchema'] = common_1.buildRbSchema(rbSchema);
|
|
232
|
+
var model = new mongo_manager_1.Model('users', schema, true, true, []);
|
|
233
|
+
exports.Users = model.collection_main;
|
|
234
|
+
exports.Users.createIndex({ fullname: 1 });
|
|
235
|
+
exports.Users.createIndex({ active: 1 });
|
|
236
|
+
exports.Users.createIndex({ username: 1 }, { unique: true });
|
|
237
|
+
exports.Users.createIndex({ email: 1 }, { unique: true });
|
|
238
|
+
exports.UserVersions = model.collection_main;
|
|
265
239
|
}
|
|
266
240
|
else {
|
|
267
241
|
setTimeout(function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collections/user.collection.ts"],"names":[],"mappings":";;;AAAA,qCAAwG;AACxG,+DAAiE;AACjE,6CAAwC;AACxC,kCAA2C;AAG3C,yCAA+D;AAE/D,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,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S,EAAE,CAAC,KAAK,CAAC,aAAK,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;QAE5F,qCAAqC;QACrC,IAAI,SAAS,GAAmB,EAAE,CAAC;QAEnC,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,uBAAc,CAAC,SAAS,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC;QACnF,aAAK,CAAC,UAAU,CAAC,GAAG,sBAAa,CAAC,QAAQ,CAAC,CAAC;KAC5C;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"user.collection.js","sourcesContent":["import { Schema, Model, PassportLocalDocument, PassportLocalModel, PassportLocalSchema} from 'mongoose';\nimport * as passportLocalMongoose from 'passport-local-mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { UserModel } from '../models/user.model';\nimport { LookupTables } from '../models/report-builder.model';\nimport { buildRbSchema, buildRbLookups } from '../util/common';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\troles: {\n\t\ttype: Object\n\t},\n\t'roles.super_admin': {\n\t\ttype: Boolean\n\t},\n\t'roles.approvals': {\n\t\ttype: Array\n\t},\n\t'roles.approvals.$': {\n\t\ttype: Object\n\t},\n\t'roles.approvals.$.type': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_1': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_2': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_3': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.name': {\n\t\ttype: String\n\t},\n\t'roles.groups': {\n\t\ttype: Array\n\t},\n\t'roles.groups.$': {\n\t\ttype: Object\n\t},\n\t'roles.groups.$.name': {\n\t\ttype: String\n\t},\n\t'roles.groups.$.views': {\n\t\ttype: Array\n\t},\n\t'roles.groups.$.views.$': {\n\t\ttype: String\n\t},\n\t'roles.groups.$.yard': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'roles.notifications': {\n\t\ttype: Array\n\t},\n\t'roles.notifications.$': {\n\t\ttype: String\n\t},\n\t'roles.miscs': {\n\t\ttype: Array\n\t},\n\t'roles.miscs.$': {\n\t\ttype: String\n\t},\n\tattempts: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tlast: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tservices: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'services.enrollment': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.forgot_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.reset_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tusername: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\temail: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tfullname: {\n\t\ttype: String\n\t},\n\tactive: {\n\t\ttype: Boolean\n\t},\n\tphonenumber: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\treadonly: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t},\n\tother: {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tsettings: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'settings.table_color': {\n\t\ttype: String\n\t},\n\t'settings.table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.font_size': {\n\t\ttype: Number\n\t},\n\t'settings.collapsable_menu': {\n\t\ttype: Boolean\n\t},\n\t'settings.entries_per_page': {\n\t\ttype: String\n\t},\n\t'settings.warning_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_font_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.success_color': {\n\t\ttype: String\n\t},\n\t'settings.success_font_color': {\n\t\ttype: String\n\t},\n\t'settings.success_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_font_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.info_color': {\n\t\ttype: String\n\t},\n\t'settings.info_font_color': {\n\t\ttype: String\n\t},\n\t'settings.info_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.routing_preference': {\n\t\ttype: String\n\t},\n\t'settings.opening_route': {\n\t\ttype: String\n\t},\n};\n\nconst DefaultSchema = <PassportLocalSchema>new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nDefaultSchema.plugin(passportLocalMongoose, {\n\tusernameUnique: true,\n\tlimitAttempts: true,\n\tmaxAttempts: 5,\n\tfindByUsername: (mongooseModel, queryParameters) => {\n\t\t// Add additional query parameter - AND condition - active: true\n\t\tqueryParameters.active = true;\n\t\treturn mongooseModel.findOne(queryParameters);\n\t}\n});\n\nDefaultSchema.index({fullname: 1});\nDefaultSchema.index({active: 1});\n\ninterface ResolveIOModel extends UserModel, PassportLocalDocument {}\n\nexport let Users: Model<ResolveIOModel> = null;\nexport let UserVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tUsers = ResolveIOServer.getMainDB().model('users', DefaultSchema);\n\n\t\tUsers['simplschema'] = new SimpleSchema(schema);\n\n\t\tschema._id = {\n\t\t\ttype: Schema.Types.Mixed\n\t\t};\n\n\t\tlet VersionSchema = new Schema(schema, {\n\t\t\tskipVersioning: true,\n\t\t\tversionKey: false,\n\t\t\ttimestamps: true\n\t\t});\n\n\t\tVersionSchema.index({'_id.__v': 1, '_id._id': 1});\n\n\t\tUsers['versionCollection'] = 'users.versions';\n\n\t\tUserVersions = ResolveIOServer.getMainDB().model(Users['versionCollection'], VersionSchema);\n\n\t\t//------------- Report Builder Schema\n\t\tlet rbLookups: LookupTables[] = [];\n\n\t\tlet rbSchema = Object.assign(schema, buildRbLookups(rbLookups, DefaultSchema, []));\n\t\tUsers['rbSchema'] = buildRbSchema(rbSchema);\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../src/collections/user.collection.ts"],"names":[],"mappings":";;;AAAA,kCAA2C;AAC3C,2DAAkE;AAGlE,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,mBAAmB,EAAE;QACpB,IAAI,EAAE,OAAO;KACb;IACD,iBAAiB,EAAE;QAClB,IAAI,EAAE,KAAK;KACX;IACD,mBAAmB,EAAE;QACpB,IAAI,EAAE,MAAM;KACZ;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AC,EAAC,QAAQ,EAAE,CAAC,EAAC,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;QACjD,aAAK,CAAC,WAAW,CAAC,EAAC,KAAK,EAAE,CAAC,EAAC,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;QAC9C,oBAAY,GAA8B,KAAK,CAAC,eAAe,CAAC;KAChE;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"user.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { Model, UserCollection } from '../managers/mongo.manager';\nimport { UserModel } from '../models/user.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\troles: {\n\t\ttype: Object\n\t},\n\t'roles.super_admin': {\n\t\ttype: Boolean\n\t},\n\t'roles.approvals': {\n\t\ttype: Array\n\t},\n\t'roles.approvals.$': {\n\t\ttype: Object\n\t},\n\t'roles.approvals.$.type': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_1': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_2': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_3': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.name': {\n\t\ttype: String\n\t},\n\t'roles.groups': {\n\t\ttype: Array\n\t},\n\t'roles.groups.$': {\n\t\ttype: Object\n\t},\n\t'roles.groups.$.name': {\n\t\ttype: String\n\t},\n\t'roles.groups.$.views': {\n\t\ttype: Array\n\t},\n\t'roles.groups.$.views.$': {\n\t\ttype: String\n\t},\n\t'roles.groups.$.yard': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'roles.notifications': {\n\t\ttype: Array\n\t},\n\t'roles.notifications.$': {\n\t\ttype: String\n\t},\n\t'roles.miscs': {\n\t\ttype: Array\n\t},\n\t'roles.miscs.$': {\n\t\ttype: String\n\t},\n\tusername: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\temail: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tfullname: {\n\t\ttype: String\n\t},\n\tactive: {\n\t\ttype: Boolean\n\t},\n\tphonenumber: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\treadonly: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t},\n\tother: {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tsettings: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'settings.table_color': {\n\t\ttype: String\n\t},\n\t'settings.table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.font_size': {\n\t\ttype: Number\n\t},\n\t'settings.collapsable_menu': {\n\t\ttype: Boolean\n\t},\n\t'settings.entries_per_page': {\n\t\ttype: String\n\t},\n\t'settings.warning_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_font_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.success_color': {\n\t\ttype: String\n\t},\n\t'settings.success_font_color': {\n\t\ttype: String\n\t},\n\t'settings.success_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_font_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.info_color': {\n\t\ttype: String\n\t},\n\t'settings.info_font_color': {\n\t\ttype: String\n\t},\n\t'settings.info_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.routing_preference': {\n\t\ttype: String\n\t},\n\t'settings.opening_route': {\n\t\ttype: String\n\t},\n\tsalt: {\n\t\ttype: String\n\t},\n\thash: {\n\t\ttype: String\n\t},\n\tattempts: {\n\t\ttype: Number\n\t},\n\tlast: {\n\t\ttype: Number\n\t},\n\tservices: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'services.enrollment': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.forgot_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.reset_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n};\n\nexport let Users: UserCollection<UserModel> = null;\nexport let UserVersions: UserCollection<UserModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tconst model = new Model<UserModel>('users', schema, true, true, []);\n\t\tUsers = <UserCollection<UserModel>>model.collection_main;\n\t\tUsers.createIndex({fullname: 1});\n\t\tUsers.createIndex({active: 1});\n\t\tUsers.createIndex({username: 1}, {unique: true});\n\t\tUsers.createIndex({email: 1}, {unique: true});\n\t\tUserVersions = <UserCollection<UserModel>>model.collection_main;\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
|
package/fixtures/cron-jobs.js
CHANGED
|
@@ -38,18 +38,18 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.loadServerCronJobs = void 0;
|
|
40
40
|
var cron_job_collection_1 = require("../collections/cron-job.collection");
|
|
41
|
-
var
|
|
41
|
+
var mongo_manager_1 = require("../managers/mongo.manager");
|
|
42
42
|
function loadServerCronJobs() {
|
|
43
43
|
return __awaiter(this, void 0, void 0, function () {
|
|
44
44
|
var cronJobs;
|
|
45
45
|
return __generator(this, function (_a) {
|
|
46
46
|
switch (_a.label) {
|
|
47
|
-
case 0: return [4 /*yield*/, cron_job_collection_1.CronJobs.find({})
|
|
47
|
+
case 0: return [4 /*yield*/, cron_job_collection_1.CronJobs.find({})];
|
|
48
48
|
case 1:
|
|
49
49
|
cronJobs = _a.sent();
|
|
50
50
|
if (!cronJobs.filter(function (a) { return a.name === 'Method Queue'; }).length) {
|
|
51
51
|
cron_job_collection_1.CronJobs.create({
|
|
52
|
-
_id:
|
|
52
|
+
_id: mongo_manager_1.objectIdHexString(),
|
|
53
53
|
__v: 0,
|
|
54
54
|
name: 'Method Queue',
|
|
55
55
|
"repeat": true,
|
|
@@ -63,7 +63,7 @@ function loadServerCronJobs() {
|
|
|
63
63
|
}
|
|
64
64
|
if (!cronJobs.some(function (a) { return a.name === 'Email Merged Docs Cleanup'; })) {
|
|
65
65
|
cron_job_collection_1.CronJobs.create({
|
|
66
|
-
_id:
|
|
66
|
+
_id: mongo_manager_1.objectIdHexString(),
|
|
67
67
|
__v: 0,
|
|
68
68
|
"name": "Email Merged Docs Cleanup",
|
|
69
69
|
"repeat": true,
|
|
@@ -75,7 +75,7 @@ function loadServerCronJobs() {
|
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
cronJobs.filter(function (a) { return a.running && a.next_run && a.next_run.getTime() < (new Date()).getTime(); }).forEach(function (cronJob) {
|
|
78
|
-
cron_job_collection_1.CronJobs.updateOne({ _id: cronJob._id }, { $set: { running: false } })
|
|
78
|
+
cron_job_collection_1.CronJobs.updateOne({ _id: cronJob._id }, { $set: { running: false } });
|
|
79
79
|
});
|
|
80
80
|
return [2 /*return*/];
|
|
81
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/fixtures/cron-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;yBACjB,CAAC,CAAC;qBACH;oBAED,QAAQ,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,EAAxE,CAAwE,CAAC,CAAC,OAAO,CAAC,UAAA,OAAO;wBAC7G,8BAAQ,CAAC,SAAS,CAAC,EAAC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAE,EAAC,OAAO,EAAE,KAAK,EAAC,EAAC,CAAC,CAAC;oBAClE,CAAC,CAAC,CAAC;;;;;CACH;AAtCD,gDAsCC","file":"cron-jobs.js","sourcesContent":["import { CronJobs } from '../collections/cron-job.collection';\nimport { objectIdHexString } from '../managers/mongo.manager';\n\nexport async function loadServerCronJobs() {\n\n\tlet cronJobs = await CronJobs.find({});\n\n\tif (!cronJobs.filter(a => a.name === 'Method Queue').length) {\n\t\tCronJobs.create(\n\t\t\t{\n\t\t\t\t_id: objectIdHexString(),\n\t\t\t\t__v: 0,\n\t\t\t\tname: 'Method Queue',\n\t\t\t\t\"repeat\" : true, \n\t\t\t\treoccuring: true,\n\t\t\t\t\"time_to_run\" : \"*/5 * * * * *\", \n\t\t\t\t\"method_run\" : \"methodQueue\", \n\t\t\t\t\"method_run_data\" : null, \n\t\t\t\t\"next_run\" : new Date(), \n\t\t\t\t\"running\" : false\n\t\t\t}\n\t\t);\n\t}\n\n\tif (!cronJobs.some(a => a.name === 'Email Merged Docs Cleanup')) {\n\t\tCronJobs.create({\n\t\t\t_id: objectIdHexString(),\n\t\t\t__v: 0,\n\t\t\t\"name\" : \"Email Merged Docs Cleanup\", \n\t\t\t\"repeat\" : true, \n\t\t\t\"time_to_run\" : \"0 0 * * *\", \n\t\t\t\"method_run\" : \"cronEmailMergedDocsCleanUp\", \n\t\t\t\"method_run_data\" : null, \n\t\t\t\"next_run\" : new Date(), \n\t\t\t\"running\" : false\n\t\t});\n\t}\n\n\tcronJobs.filter(a => a.running && a.next_run && a.next_run.getTime() < (new Date()).getTime()).forEach(cronJob => {\n\t\tCronJobs.updateOne({_id: cronJob._id}, {$set: {running: false}});\n\t});\n} "]}
|
package/fixtures/init.js
CHANGED
|
@@ -37,8 +37,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.loadServerInit = void 0;
|
|
40
|
+
var mongo_manager_1 = require("../managers/mongo.manager");
|
|
40
41
|
var app_version_collection_1 = require("../collections/app-version.collection");
|
|
41
|
-
var mongoose_1 = require("mongoose");
|
|
42
42
|
function loadServerInit() {
|
|
43
43
|
return __awaiter(this, void 0, void 0, function () {
|
|
44
44
|
var appVersion;
|
|
@@ -49,7 +49,7 @@ function loadServerInit() {
|
|
|
49
49
|
appVersion = _a.sent();
|
|
50
50
|
if (!appVersion) {
|
|
51
51
|
app_version_collection_1.AppVersions.create({
|
|
52
|
-
_id:
|
|
52
|
+
_id: mongo_manager_1.objectIdHexString(),
|
|
53
53
|
version: 1
|
|
54
54
|
});
|
|
55
55
|
}
|
package/fixtures/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/fixtures/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/fixtures/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2DAA8D;AAC9D,gFAAoE;AAEpE,SAAsB,cAAc;;;;;wBAClB,qBAAM,oCAAW,CAAC,OAAO,EAAE,EAAA;;oBAAxC,UAAU,GAAG,SAA2B;oBAE5C,IAAI,CAAC,UAAU,EAAE;wBAChB,oCAAW,CAAC,MAAM,CAAC;4BAClB,GAAG,EAAE,iCAAiB,EAAE;4BACxB,OAAO,EAAE,CAAC;yBACV,CAAC,CAAC;qBACH;;;;;CACD;AATD,wCASC","file":"init.js","sourcesContent":["import { objectIdHexString } from '../managers/mongo.manager';\nimport { AppVersions } from '../collections/app-version.collection';\n\nexport async function loadServerInit() {\n\tlet appVersion = await AppVersions.findOne();\n\n\tif (!appVersion) {\n\t\tAppVersions.create({\n\t\t\t_id: objectIdHexString(),\n\t\t\tversion: 1\n\t\t});\n\t}\n}"]}
|