@resolveio/server-lib 20.7.120 → 20.7.122
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/client-server-app.js +51 -1
- package/client-server-app.js.map +1 -1
- package/collections/app-status.collection.js +51 -1
- package/collections/app-status.collection.js.map +1 -1
- package/collections/counter.collection.js +55 -1
- package/collections/counter.collection.js.map +1 -1
- package/collections/cron-job-history.collection.js +136 -1
- package/collections/cron-job-history.collection.js.map +1 -1
- package/collections/cron-job.collection.js +87 -1
- package/collections/cron-job.collection.js.map +1 -1
- package/collections/email-history.collection.js +98 -1
- package/collections/email-history.collection.js.map +1 -1
- package/collections/email-verified.collection.js +60 -1
- package/collections/email-verified.collection.js.map +1 -1
- package/collections/file.collection.js +73 -1
- package/collections/file.collection.js.map +1 -1
- package/collections/flag-update.collection.js +56 -1
- package/collections/flag-update.collection.js.map +1 -1
- package/collections/flag.collection.js +56 -1
- package/collections/flag.collection.js.map +1 -1
- package/collections/log-method-latency.collection.js +72 -1
- package/collections/log-method-latency.collection.js.map +1 -1
- package/collections/log-subscription.collection.js +75 -1
- package/collections/log-subscription.collection.js.map +1 -1
- package/collections/log.collection.js +87 -1
- package/collections/log.collection.js.map +1 -1
- package/collections/logged-in-users.collection.js +66 -1
- package/collections/logged-in-users.collection.js.map +1 -1
- package/collections/monitor-cpu.collection.js +64 -1
- package/collections/monitor-cpu.collection.js.map +1 -1
- package/collections/monitor-function.collection.js +73 -1
- package/collections/monitor-function.collection.js.map +1 -1
- package/collections/monitor-memory.collection.js +76 -1
- package/collections/monitor-memory.collection.js.map +1 -1
- package/collections/monitor-mongo.collection.js +70 -1
- package/collections/monitor-mongo.collection.js.map +1 -1
- package/collections/notification.collection.js +56 -1
- package/collections/notification.collection.js.map +1 -1
- package/collections/report-builder-dashboard-builder.collection.js +108 -1
- package/collections/report-builder-dashboard-builder.collection.js.map +1 -1
- package/collections/report-builder-library.collection.js +86 -1
- package/collections/report-builder-library.collection.js.map +1 -1
- package/collections/report-builder-report.collection.js +148 -1
- package/collections/report-builder-report.collection.js.map +1 -1
- package/collections/user-group.collection.js +88 -1
- package/collections/user-group.collection.js.map +1 -1
- package/collections/user-guide.collection.js +56 -1
- package/collections/user-guide.collection.js.map +1 -1
- package/collections/user.collection.js +265 -1
- package/collections/user.collection.js.map +1 -1
- package/cron/cron.js +97 -1
- package/cron/cron.js.map +1 -1
- package/fixtures/cron-jobs.js +95 -1
- package/fixtures/cron-jobs.js.map +1 -1
- package/fixtures/init.js +78 -1
- package/fixtures/init.js.map +1 -1
- package/http/auth.js +869 -1
- package/http/auth.js.map +1 -1
- package/http/health.js +11 -1
- package/http/health.js.map +1 -1
- package/http/home.js +114 -1
- package/http/home.js.map +1 -1
- package/index.js +18 -1
- package/index.js.map +1 -1
- package/managers/cron.manager.js +461 -1
- package/managers/cron.manager.js.map +1 -1
- package/managers/local-log.manager.js +79 -1
- package/managers/local-log.manager.js.map +1 -1
- package/managers/method.manager.js +1025 -1
- package/managers/method.manager.js.map +1 -1
- package/managers/mongo.manager.js +4231 -1
- package/managers/mongo.manager.js.map +1 -1
- package/managers/monitor.manager.js +534 -1
- package/managers/monitor.manager.js.map +1 -1
- package/managers/subscription.manager.js +1292 -1
- package/managers/subscription.manager.js.map +1 -1
- package/managers/websocket.manager.js +165 -1
- package/managers/websocket.manager.js.map +1 -1
- package/managers/worker-dispatcher.manager.js +335 -1
- package/managers/worker-dispatcher.manager.js.map +1 -1
- package/managers/worker-server.manager.js +292 -1
- package/managers/worker-server.manager.js.map +1 -1
- package/methods/accounts.js +302 -1
- package/methods/accounts.js.map +1 -1
- package/methods/aws.js +748 -1
- package/methods/aws.js.map +1 -1
- package/methods/collections.js +542 -1
- package/methods/collections.js.map +1 -1
- package/methods/counters.js +111 -1
- package/methods/counters.js.map +1 -1
- package/methods/cron-jobs.js +1476 -1
- package/methods/cron-jobs.js.map +1 -1
- package/methods/flag-updates.js +8 -1
- package/methods/flag-updates.js.map +1 -1
- package/methods/flags.js +8 -1
- package/methods/flags.js.map +1 -1
- package/methods/logs.js +417 -1
- package/methods/logs.js.map +1 -1
- package/methods/monitor.js +543 -1
- package/methods/monitor.js.map +1 -1
- package/methods/pdf.js +742 -1
- package/methods/pdf.js.map +1 -1
- package/methods/report-builder.js +840 -1
- package/methods/report-builder.js.map +1 -1
- package/methods/support.js +232 -1
- package/methods/support.js.map +1 -1
- package/models/app-status.model.js +3 -1
- package/models/app-status.model.js.map +1 -1
- package/models/billing-logged-in-users.model.js +3 -1
- package/models/billing-logged-in-users.model.js.map +1 -1
- package/models/collection-document.model.js +3 -1
- package/models/collection-document.model.js.map +1 -1
- package/models/counter.model.js +3 -1
- package/models/counter.model.js.map +1 -1
- package/models/cron-job-history.model.js +3 -1
- package/models/cron-job-history.model.js.map +1 -1
- package/models/cron-job.model.js +3 -1
- package/models/cron-job.model.js.map +1 -1
- package/models/dialog.model.js +3 -1
- package/models/dialog.model.js.map +1 -1
- package/models/email-history.model.js +15 -1
- package/models/email-history.model.js.map +1 -1
- package/models/email-verified.model.js +3 -1
- package/models/email-verified.model.js.map +1 -1
- package/models/file.model.js +3 -1
- package/models/file.model.js.map +1 -1
- package/models/flag-update.model.js +3 -1
- package/models/flag-update.model.js.map +1 -1
- package/models/flag.model.js +3 -1
- package/models/flag.model.js.map +1 -1
- package/models/log-method-latency.model.js +3 -1
- package/models/log-method-latency.model.js.map +1 -1
- package/models/log-subscription.model.js +3 -1
- package/models/log-subscription.model.js.map +1 -1
- package/models/log.model.js +3 -1
- package/models/log.model.js.map +1 -1
- package/models/logged-in-users.model.js +3 -1
- package/models/logged-in-users.model.js.map +1 -1
- package/models/method-response.model.js +3 -1
- package/models/method-response.model.js.map +1 -1
- package/models/method.model.d.ts +0 -1
- package/models/method.model.js +3 -1
- package/models/method.model.js.map +1 -1
- package/models/monitor-cpu.model.js +3 -1
- package/models/monitor-cpu.model.js.map +1 -1
- package/models/monitor-function.model.js +3 -1
- package/models/monitor-function.model.js.map +1 -1
- package/models/monitor-memory.model.js +3 -1
- package/models/monitor-memory.model.js.map +1 -1
- package/models/monitor-mongo.model.js +3 -1
- package/models/monitor-mongo.model.js.map +1 -1
- package/models/notification.model.js +3 -1
- package/models/notification.model.js.map +1 -1
- package/models/pagination.model.js +23 -1
- package/models/pagination.model.js.map +1 -1
- package/models/permission.model.js +3 -1
- package/models/permission.model.js.map +1 -1
- package/models/report-builder-dashboard-builder.model.js +3 -1
- package/models/report-builder-dashboard-builder.model.js.map +1 -1
- package/models/report-builder-library.model.js +3 -1
- package/models/report-builder-library.model.js.map +1 -1
- package/models/report-builder-report.model.js +3 -1
- package/models/report-builder-report.model.js.map +1 -1
- package/models/report-builder.model.js +3 -1
- package/models/report-builder.model.js.map +1 -1
- package/models/select-data-label.model.js +3 -1
- package/models/select-data-label.model.js.map +1 -1
- package/models/server-message.model.js +3 -1
- package/models/server-message.model.js.map +1 -1
- package/models/subscription.model.js +3 -1
- package/models/subscription.model.js.map +1 -1
- package/models/support-ticket.model.js +3 -1
- package/models/support-ticket.model.js.map +1 -1
- package/models/user-group.model.js +3 -1
- package/models/user-group.model.js.map +1 -1
- package/models/user-guide.model.js +3 -1
- package/models/user-guide.model.js.map +1 -1
- package/models/user.model.js +3 -1
- package/models/user.model.js.map +1 -1
- package/package.json +1 -1
- package/public_api.js +77 -1
- package/public_api.js.map +1 -1
- package/publications/app-status.js +16 -1
- package/publications/app-status.js.map +1 -1
- package/publications/cron-jobs.js +32 -1
- package/publications/cron-jobs.js.map +1 -1
- package/publications/files.js +36 -1
- package/publications/files.js.map +1 -1
- package/publications/flags-update.js +22 -1
- package/publications/flags-update.js.map +1 -1
- package/publications/flags.js +22 -1
- package/publications/flags.js.map +1 -1
- package/publications/logs.js +164 -1
- package/publications/logs.js.map +1 -1
- package/publications/notifications.js +16 -1
- package/publications/notifications.js.map +1 -1
- package/publications/report-builder-dashboard-builders.js +42 -1
- package/publications/report-builder-dashboard-builders.js.map +1 -1
- package/publications/report-builder-libraries.js +90 -1
- package/publications/report-builder-libraries.js.map +1 -1
- package/publications/report-builder-reports.js +50 -1
- package/publications/report-builder-reports.js.map +1 -1
- package/publications/super-admin.js +16 -1
- package/publications/super-admin.js.map +1 -1
- package/publications/user-groups.js +16 -1
- package/publications/user-groups.js.map +1 -1
- package/publications/user-guides.js +16 -1
- package/publications/user-guides.js.map +1 -1
- package/resolveio-server-app.js +176 -1
- package/resolveio-server-app.js.map +1 -1
- package/server-app.js +1159 -1
- package/server-app.js.map +1 -1
- package/util/common.js +632 -1
- package/util/common.js.map +1 -1
- package/util/schema-report-builder.js +454 -1
- package/util/schema-report-builder.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collections/user-group.collection.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../src/collections/user-group.collection.ts"],"names":[],"mappings":";;;AAAA,2DAAsF;AAEtF,gEAA0D;AAE1D,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,YAAY,EAAE;QACb,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,WAAW,EAAE;QACZ,IAAI,EAAE,KAAK;KACX;IACD,eAAe,EAAE;QAChB,IAAI,EAAG,MAAM;KACb;IACD,oBAAoB,EAAE;QACrB,IAAI,EAAE,MAAM;KACZ;IACD,wBAAwB,EAAE;QACzB,IAAI,EAAE,OAAO;KACb;IACD,qBAAqB,EAAE;QACtB,IAAI,EAAE,KAAK;KACX;IACD,uBAAuB,EAAE;QACxB,IAAI,EAAE,MAAM;KACZ;IACD,4BAA4B,EAAE;QAC7B,IAAI,EAAE,MAAM;KACZ;IACD,gCAAgC,EAAE;QACjC,IAAI,EAAE,OAAO;KACb;IACD,aAAa,EAAE;QACd,IAAI,EAAE,KAAK;KACX;IACD,iBAAiB,EAAE;QAClB,IAAI,EAAG,MAAM;QACb,QAAQ,EAAE,IAAI;KACd;CACD,CAAC;AAES,QAAA,UAAU,GAA2C,IAAI,CAAC;AAC1D,QAAA,iBAAiB,GAA2C,IAAI,CAAC;AAE5E,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,sCAAe,IAAI,sCAAe,CAAC,SAAS,EAAE,IAAI,iCAAiB,EAAE;QACxE,IAAM,KAAK,GAAG,iCAAiB,CAAC,MAAM,CAAiB;YACtD,cAAc,EAAE,aAAa;YAC7B,MAAM,EAAE,MAAM;YACd,oBAAoB,EAAE,IAAI;YAC1B,gBAAgB,EAAE,IAAI;YACtB,yBAAyB,EAAE,EAAE;YAC7B,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,KAAK;YACjB,WAAW,EAAE,IAAI;YACjB,iBAAiB,EAAE,IAAI;SACvB,CAAC,CAAC;QACH,kBAAU,GAAG,KAAK,CAAC,eAAe,CAAC;QACnC,kBAAU,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;QAClC,yBAAiB,GAAG,KAAK,CAAC,kBAAkB,CAAC;KAC7C;SACI;QACJ,YAAY,CAAC;YACZ,oBAAoB,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;KACH;AACF,CAAC","file":"user-group.collection.js","sourcesContent":["import { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';\nimport { UserGroupModel } from '../models/user-group.model';\nimport { ResolveIOServer } from '../resolveio-server-app';\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\tname: {\n\t\ttype: String\n\t},\n\tlanding_page: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tpermissions: {\n\t\ttype: Array\n\t},\n\t'permissions.$': {\n\t\ttype: Object\n\t},\n\t'permissions.$.name': {\n\t\ttype: String\n\t},\n\t'permissions.$.selected': {\n\t\ttype: Boolean\n\t},\n\t'permissions.$.views': {\n\t\ttype: Array\n\t},\n\t'permissions.$.views.$': {\n\t\ttype: Object\n\t},\n\t'permissions.$.views.$.link': {\n\t\ttype: String\n\t},\n\t'permissions.$.views.$.selected': {\n\t\ttype: Boolean\n\t},\n\tnotifications: {\n\t\ttype: Array\n\t},\n\t'notifications.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n};\n\nexport let UserGroups: MongoManagerCollection<UserGroupModel> = null;\nexport let UserGroupVersions: MongoManagerCollection<UserGroupModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB() && MongoManagerModel) {\n\t\tconst model = MongoManagerModel.create<UserGroupModel>({\n\t\t\tcollectionName: 'user-groups',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: true,\n\t\t\tuseReportBuilder: true,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: false,\n\t\t\tcheckSchema: true,\n\t\t\tcollectionOptions: null\n\t\t});\n\t\tUserGroups = model.collection_main;\n\t\tUserGroups.createIndex({name: 1});\n\t\tUserGroupVersions = model.collection_version;\n\t}\n\telse {\n\t\tsetImmediate(() => {\n\t\t\tinitializeCollection();\n\t\t});\n\t}\n}"]}
|
|
@@ -1,2 +1,57 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserGuides = void 0;
|
|
4
|
+
var mongo_manager_1 = require("../managers/mongo.manager");
|
|
5
|
+
var resolveio_server_app_1 = require("../resolveio-server-app");
|
|
6
|
+
var schema = {
|
|
7
|
+
_id: {
|
|
8
|
+
type: String,
|
|
9
|
+
optional: true
|
|
10
|
+
},
|
|
11
|
+
__v: {
|
|
12
|
+
type: Number,
|
|
13
|
+
optional: true
|
|
14
|
+
},
|
|
15
|
+
updatedAt: {
|
|
16
|
+
type: Date,
|
|
17
|
+
optional: true
|
|
18
|
+
},
|
|
19
|
+
createdAt: {
|
|
20
|
+
type: Date,
|
|
21
|
+
optional: true
|
|
22
|
+
},
|
|
23
|
+
link: {
|
|
24
|
+
type: String
|
|
25
|
+
},
|
|
26
|
+
label: {
|
|
27
|
+
type: String
|
|
28
|
+
},
|
|
29
|
+
message: {
|
|
30
|
+
type: String
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
exports.UserGuides = null;
|
|
34
|
+
initializeCollection();
|
|
35
|
+
function initializeCollection() {
|
|
36
|
+
if (resolveio_server_app_1.ResolveIOServer && resolveio_server_app_1.ResolveIOServer.getMainDB() && mongo_manager_1.MongoManagerModel) {
|
|
37
|
+
var model = mongo_manager_1.MongoManagerModel.create({
|
|
38
|
+
collectionName: 'user-guides',
|
|
39
|
+
schema: schema,
|
|
40
|
+
useVersionCollection: false,
|
|
41
|
+
useReportBuilder: false,
|
|
42
|
+
reportBuilderLookupTables: [],
|
|
43
|
+
timestamps: true,
|
|
44
|
+
createLogs: false,
|
|
45
|
+
checkSchema: true,
|
|
46
|
+
collectionOptions: null
|
|
47
|
+
});
|
|
48
|
+
exports.UserGuides = model.collection_main;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
setImmediate(function () {
|
|
52
|
+
initializeCollection();
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
2
57
|
//# sourceMappingURL=user-guide.collection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collections/user-guide.collection.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../src/collections/user-guide.collection.ts"],"names":[],"mappings":";;;AAAC,2DAAsF;AAEvF,gEAA0D;AAE1D,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,GAA2C,IAAI,CAAC;AAErE,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,sCAAe,IAAI,sCAAe,CAAC,SAAS,EAAE,IAAI,iCAAiB,EAAE;QACxE,IAAM,KAAK,GAAG,iCAAiB,CAAC,MAAM,CAAiB;YACtD,cAAc,EAAE,aAAa;YAC7B,MAAM,EAAE,MAAM;YACd,oBAAoB,EAAE,KAAK;YAC3B,gBAAgB,EAAE,KAAK;YACvB,yBAAyB,EAAE,EAAE;YAC7B,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,KAAK;YACjB,WAAW,EAAE,IAAI;YACjB,iBAAiB,EAAE,IAAI;SACvB,CAAC,CAAC;QACH,kBAAU,GAAG,KAAK,CAAC,eAAe,CAAC;KACnC;SACI;QACJ,YAAY,CAAC;YACZ,oBAAoB,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;KACH;AACF,CAAC","file":"user-guide.collection.js","sourcesContent":[" import { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';\nimport { UserGuideModel } from '../models/user-guide.model';\nimport { ResolveIOServer } from '../resolveio-server-app';\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: MongoManagerCollection<UserGuideModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB() && MongoManagerModel) {\n\t\tconst model = MongoManagerModel.create<UserGuideModel>({\n\t\t\tcollectionName: 'user-guides',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: false,\n\t\t\tuseReportBuilder: false,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: false,\n\t\t\tcheckSchema: true,\n\t\t\tcollectionOptions: null\n\t\t});\n\t\tUserGuides = model.collection_main;\n\t}\n\telse {\n\t\tsetImmediate(() => {\n\t\t\tinitializeCollection();\n\t\t});\n\t}\n}"]}
|
|
@@ -1,2 +1,266 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserVersions = exports.Users = void 0;
|
|
4
|
+
var mongo_manager_1 = require("../managers/mongo.manager");
|
|
5
|
+
var resolveio_server_app_1 = require("../resolveio-server-app");
|
|
6
|
+
var schema = {
|
|
7
|
+
_id: {
|
|
8
|
+
type: String,
|
|
9
|
+
optional: true
|
|
10
|
+
},
|
|
11
|
+
__v: {
|
|
12
|
+
type: Number,
|
|
13
|
+
optional: true
|
|
14
|
+
},
|
|
15
|
+
updatedAt: {
|
|
16
|
+
type: Date,
|
|
17
|
+
optional: true
|
|
18
|
+
},
|
|
19
|
+
createdAt: {
|
|
20
|
+
type: Date,
|
|
21
|
+
optional: true
|
|
22
|
+
},
|
|
23
|
+
roles: {
|
|
24
|
+
type: Object
|
|
25
|
+
},
|
|
26
|
+
'roles.super_admin': {
|
|
27
|
+
type: Boolean
|
|
28
|
+
},
|
|
29
|
+
'roles.approvals': {
|
|
30
|
+
type: Array
|
|
31
|
+
},
|
|
32
|
+
'roles.approvals.$': {
|
|
33
|
+
type: Object
|
|
34
|
+
},
|
|
35
|
+
'roles.approvals.$.type': {
|
|
36
|
+
type: String
|
|
37
|
+
},
|
|
38
|
+
'roles.approvals.$.key_1': {
|
|
39
|
+
type: String,
|
|
40
|
+
optional: true
|
|
41
|
+
},
|
|
42
|
+
'roles.approvals.$.key_2': {
|
|
43
|
+
type: String,
|
|
44
|
+
optional: true
|
|
45
|
+
},
|
|
46
|
+
'roles.approvals.$.key_3': {
|
|
47
|
+
type: String,
|
|
48
|
+
optional: true
|
|
49
|
+
},
|
|
50
|
+
'roles.approvals.$.name': {
|
|
51
|
+
type: String
|
|
52
|
+
},
|
|
53
|
+
'roles.groups': {
|
|
54
|
+
type: Array
|
|
55
|
+
},
|
|
56
|
+
'roles.groups.$': {
|
|
57
|
+
type: Object
|
|
58
|
+
},
|
|
59
|
+
'roles.groups.$.name': {
|
|
60
|
+
type: String
|
|
61
|
+
},
|
|
62
|
+
'roles.groups.$.views': {
|
|
63
|
+
type: Array
|
|
64
|
+
},
|
|
65
|
+
'roles.groups.$.views.$': {
|
|
66
|
+
type: String
|
|
67
|
+
},
|
|
68
|
+
'roles.groups.$.yards': {
|
|
69
|
+
type: Array,
|
|
70
|
+
optional: true
|
|
71
|
+
},
|
|
72
|
+
'roles.groups.$.yards.$': {
|
|
73
|
+
type: String
|
|
74
|
+
},
|
|
75
|
+
'roles.notifications': {
|
|
76
|
+
type: Array
|
|
77
|
+
},
|
|
78
|
+
'roles.notifications.$': {
|
|
79
|
+
type: String
|
|
80
|
+
},
|
|
81
|
+
'roles.miscs': {
|
|
82
|
+
type: Array
|
|
83
|
+
},
|
|
84
|
+
'roles.miscs.$': {
|
|
85
|
+
type: String
|
|
86
|
+
},
|
|
87
|
+
username: {
|
|
88
|
+
type: String,
|
|
89
|
+
optional: true
|
|
90
|
+
},
|
|
91
|
+
email: {
|
|
92
|
+
type: String,
|
|
93
|
+
optional: true
|
|
94
|
+
},
|
|
95
|
+
fullname: {
|
|
96
|
+
type: String
|
|
97
|
+
},
|
|
98
|
+
active: {
|
|
99
|
+
type: Boolean
|
|
100
|
+
},
|
|
101
|
+
phonenumber: {
|
|
102
|
+
type: String,
|
|
103
|
+
optional: true
|
|
104
|
+
},
|
|
105
|
+
readonly: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
optional: true
|
|
108
|
+
},
|
|
109
|
+
other: {
|
|
110
|
+
type: Object,
|
|
111
|
+
blackbox: true
|
|
112
|
+
},
|
|
113
|
+
settings: {
|
|
114
|
+
type: Object,
|
|
115
|
+
optional: true
|
|
116
|
+
},
|
|
117
|
+
'settings.table_color': {
|
|
118
|
+
type: String
|
|
119
|
+
},
|
|
120
|
+
'settings.table_font_color': {
|
|
121
|
+
type: String
|
|
122
|
+
},
|
|
123
|
+
'settings.secondary_table_color': {
|
|
124
|
+
type: String
|
|
125
|
+
},
|
|
126
|
+
'settings.secondary_table_font_color': {
|
|
127
|
+
type: String
|
|
128
|
+
},
|
|
129
|
+
'settings.tertiary_table_color': {
|
|
130
|
+
type: String
|
|
131
|
+
},
|
|
132
|
+
'settings.tertiary_table_font_color': {
|
|
133
|
+
type: String
|
|
134
|
+
},
|
|
135
|
+
'settings.font_size': {
|
|
136
|
+
type: Number
|
|
137
|
+
},
|
|
138
|
+
'settings.collapsable_menu': {
|
|
139
|
+
type: Boolean
|
|
140
|
+
},
|
|
141
|
+
'settings.entries_per_page': {
|
|
142
|
+
type: String
|
|
143
|
+
},
|
|
144
|
+
'settings.warning_color': {
|
|
145
|
+
type: String
|
|
146
|
+
},
|
|
147
|
+
'settings.warning_font_color': {
|
|
148
|
+
type: String
|
|
149
|
+
},
|
|
150
|
+
'settings.warning_hover_color': {
|
|
151
|
+
type: String
|
|
152
|
+
},
|
|
153
|
+
'settings.success_color': {
|
|
154
|
+
type: String
|
|
155
|
+
},
|
|
156
|
+
'settings.success_font_color': {
|
|
157
|
+
type: String
|
|
158
|
+
},
|
|
159
|
+
'settings.success_hover_color': {
|
|
160
|
+
type: String
|
|
161
|
+
},
|
|
162
|
+
'settings.danger_color': {
|
|
163
|
+
type: String
|
|
164
|
+
},
|
|
165
|
+
'settings.danger_font_color': {
|
|
166
|
+
type: String
|
|
167
|
+
},
|
|
168
|
+
'settings.danger_hover_color': {
|
|
169
|
+
type: String
|
|
170
|
+
},
|
|
171
|
+
'settings.info_color': {
|
|
172
|
+
type: String
|
|
173
|
+
},
|
|
174
|
+
'settings.info_font_color': {
|
|
175
|
+
type: String
|
|
176
|
+
},
|
|
177
|
+
'settings.info_hover_color': {
|
|
178
|
+
type: String
|
|
179
|
+
},
|
|
180
|
+
'settings.primary_color': {
|
|
181
|
+
type: String
|
|
182
|
+
},
|
|
183
|
+
'settings.primary_font_color': {
|
|
184
|
+
type: String
|
|
185
|
+
},
|
|
186
|
+
'settings.primary_hover_color': {
|
|
187
|
+
type: String
|
|
188
|
+
},
|
|
189
|
+
'settings.secondary_color': {
|
|
190
|
+
type: String
|
|
191
|
+
},
|
|
192
|
+
'settings.secondary_font_color': {
|
|
193
|
+
type: String
|
|
194
|
+
},
|
|
195
|
+
'settings.secondary_hover_color': {
|
|
196
|
+
type: String
|
|
197
|
+
},
|
|
198
|
+
'settings.routing_preference': {
|
|
199
|
+
type: String
|
|
200
|
+
},
|
|
201
|
+
'settings.opening_route': {
|
|
202
|
+
type: String
|
|
203
|
+
},
|
|
204
|
+
salt: {
|
|
205
|
+
type: String
|
|
206
|
+
},
|
|
207
|
+
hash: {
|
|
208
|
+
type: String
|
|
209
|
+
},
|
|
210
|
+
attempts: {
|
|
211
|
+
type: Number
|
|
212
|
+
},
|
|
213
|
+
last: {
|
|
214
|
+
type: Date,
|
|
215
|
+
optional: true
|
|
216
|
+
},
|
|
217
|
+
services: {
|
|
218
|
+
type: Object,
|
|
219
|
+
optional: true
|
|
220
|
+
},
|
|
221
|
+
'services.enrollment': {
|
|
222
|
+
type: String,
|
|
223
|
+
optional: true
|
|
224
|
+
},
|
|
225
|
+
'services.forgot_password': {
|
|
226
|
+
type: String,
|
|
227
|
+
optional: true
|
|
228
|
+
},
|
|
229
|
+
'services.reset_password': {
|
|
230
|
+
type: String,
|
|
231
|
+
optional: true
|
|
232
|
+
},
|
|
233
|
+
is_customer: {
|
|
234
|
+
type: Boolean,
|
|
235
|
+
optional: true
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
exports.Users = null;
|
|
239
|
+
exports.UserVersions = null;
|
|
240
|
+
initializeCollection();
|
|
241
|
+
function initializeCollection() {
|
|
242
|
+
if (resolveio_server_app_1.ResolveIOServer && resolveio_server_app_1.ResolveIOServer.getMainDB() && mongo_manager_1.MongoManagerModel) {
|
|
243
|
+
var model = mongo_manager_1.MongoManagerModel.create({
|
|
244
|
+
collectionName: 'users',
|
|
245
|
+
schema: schema,
|
|
246
|
+
useVersionCollection: true,
|
|
247
|
+
useReportBuilder: true,
|
|
248
|
+
reportBuilderLookupTables: [],
|
|
249
|
+
timestamps: true,
|
|
250
|
+
createLogs: true,
|
|
251
|
+
checkSchema: true,
|
|
252
|
+
collectionOptions: null
|
|
253
|
+
});
|
|
254
|
+
exports.Users = model.collection_main;
|
|
255
|
+
exports.Users.createIndex({ fullname: 1 });
|
|
256
|
+
exports.Users.createIndex({ active: 1 });
|
|
257
|
+
exports.UserVersions = model.collection_version;
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
setImmediate(function () {
|
|
261
|
+
initializeCollection();
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
2
266
|
//# sourceMappingURL=user.collection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collections/user.collection.ts"],"names":["mongo_manager_1","require","resolveio_server_app_1","schema","_id","type","String","optional","__v","Number","updatedAt","Date","createdAt","roles","Object","roles.super_admin","Boolean","roles.approvals","Array","roles.approvals.$","roles.approvals.$.type","roles.approvals.$.key_1","roles.approvals.$.key_2","roles.approvals.$.key_3","roles.approvals.$.name","roles.groups","roles.groups.$","roles.groups.$.name","roles.groups.$.views","roles.groups.$.views.$","roles.groups.$.yards","roles.groups.$.yards.$","roles.notifications","roles.notifications.$","roles.miscs","roles.miscs.$","username","email","fullname","active","phonenumber","readonly","other","blackbox","settings","settings.table_color","settings.table_font_color","settings.secondary_table_color","settings.secondary_table_font_color","settings.tertiary_table_color","settings.tertiary_table_font_color","settings.font_size","settings.collapsable_menu","settings.entries_per_page","settings.warning_color","settings.warning_font_color","settings.warning_hover_color","settings.success_color","settings.success_font_color","settings.success_hover_color","settings.danger_color","settings.danger_font_color","settings.danger_hover_color","settings.info_color","settings.info_font_color","settings.info_hover_color","settings.primary_color","settings.primary_font_color","settings.primary_hover_color","settings.secondary_color","settings.secondary_font_color","settings.secondary_hover_color","settings.routing_preference","settings.opening_route","salt","hash","attempts","last","services","services.enrollment","services.forgot_password","services.reset_password","is_customer","initializeCollection","model","ResolveIOServer","getMainDB","MongoManagerModel","create","collectionName","useVersionCollection","useReportBuilder","reportBuilderLookupTables","timestamps","createLogs","checkSchema","collectionOptions","exports","Users","collection_main","createIndex","UserVersions","collection_version","setImmediate"],"mappings":"8GAAA,IAAAA,gBAAAC,QAAA,2BAAA,EAEAC,uBAAAD,QAAA,yBAAA,EAEIE,OAAc,CACjBC,IAAK,CACJC,KAAMC,OACNC,SAAU,CAAA,C,EAEXC,IAAK,CACJH,KAAMI,OACNF,SAAU,CAAA,C,EAEXG,UAAW,CACVL,KAAMM,KACNJ,SAAU,CAAA,C,EAEXK,UA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U,CAAA,C,EAEX0E,0BAA2B,CAC1B5E,KAAMC,OACNC,SAAU,CAAA,C,EAEX2E,YAAa,CACZ7E,KAAMW,QACNT,SAAU,CAAA,C,GASZ,SAAS4E,uBACR,IACOC,EADHlF,uBAAAmF,iBAAmBnF,uBAAAmF,gBAAgBC,UAAS,GAAMtF,gBAAAuF,mBAC/CH,EAAQpF,gBAAAuF,kBAAkBC,OAAkB,CACjDC,eAAgB,QAChBtF,OAAQA,OACRuF,qBAAsB,CAAA,EACtBC,iBAAkB,CAAA,EAClBC,0BAA2B,GAC3BC,WAAY,CAAA,EACZC,WAAY,CAAA,EACZC,YAAa,CAAA,EACbC,kBAAmB,I,CACnB,EAEDC,QAAAC,MAA+Cd,EAAMe,gBACrDF,QAAAC,MAAME,YAAY,CAAC9D,SAAU,CAAC,CAAC,EAC/B2D,QAAAC,MAAME,YAAY,CAAC7D,OAAQ,CAAC,CAAC,EAC7B0D,QAAAI,aAAsDjB,EAAMkB,oBAG5DC,aAAa,WACZpB,qBAAoB,CACrB,CAAC,CAEH,CA7BWc,QAAAC,MAA+C,KAC/CD,QAAAI,aAAsD,KAEjElB,qBAAoB","file":"user.collection.js","sourcesContent":["import { MongoManagerModel, MongoManagerUserCollection } from '../managers/mongo.manager';\nimport { UserModel } from '../models/user.model';\nimport { ResolveIOServer } from '../resolveio-server-app';\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\toptional: true\n\t},\n\t'roles.approvals.$.key_2': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'roles.approvals.$.key_3': {\n\t\ttype: String,\n\t\toptional: true\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.$.yards': {\n\t\ttype: Array,\n\t\toptional: true\n\t},\n\t'roles.groups.$.yards.$': {\n\t\ttype: String\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: 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\tis_customer: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t}\n};\n\nexport let Users: MongoManagerUserCollection<UserModel> = null;\nexport let UserVersions: MongoManagerUserCollection<UserModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB() && MongoManagerModel) {\n\t\tconst model = MongoManagerModel.create<UserModel>({\n\t\t\tcollectionName: 'users',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: true,\n\t\t\tuseReportBuilder: true,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: true,\n\t\t\tcheckSchema: true,\n\t\t\tcollectionOptions: null\n\t\t});\n\n\t\tUsers = <MongoManagerUserCollection<UserModel>>model.collection_main;\n\t\tUsers.createIndex({fullname: 1});\n\t\tUsers.createIndex({active: 1});\n\t\tUserVersions = <MongoManagerUserCollection<UserModel>>model.collection_version;\n\t}\n\telse {\n\t\tsetImmediate(() => {\n\t\t\tinitializeCollection();\n\t\t});\n\t}\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../src/collections/user.collection.ts"],"names":[],"mappings":";;;AAAA,2DAA0F;AAE1F,gEAA0D;AAE1D,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;IACD,wBAAwB,EAAE;QACzB,IAAI,EAAE,MAAM;KACZ;IACD,yBAAyB,EAAE;QAC1B,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,yBAAyB,EAAE;QAC1B,IAAI,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AE,IAAI;YACjB,iBAAiB,EAAE,IAAI;SACvB,CAAC,CAAC;QAEH,aAAK,GAA0C,KAAK,CAAC,eAAe,CAAC;QACrE,aAAK,CAAC,WAAW,CAAC,EAAC,QAAQ,EAAE,CAAC,EAAC,CAAC,CAAC;QACjC,aAAK,CAAC,WAAW,CAAC,EAAC,MAAM,EAAE,CAAC,EAAC,CAAC,CAAC;QAC/B,oBAAY,GAA0C,KAAK,CAAC,kBAAkB,CAAC;KAC/E;SACI;QACJ,YAAY,CAAC;YACZ,oBAAoB,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;KACH;AACF,CAAC","file":"user.collection.js","sourcesContent":["import { MongoManagerModel, MongoManagerUserCollection } from '../managers/mongo.manager';\nimport { UserModel } from '../models/user.model';\nimport { ResolveIOServer } from '../resolveio-server-app';\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\toptional: true\n\t},\n\t'roles.approvals.$.key_2': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'roles.approvals.$.key_3': {\n\t\ttype: String,\n\t\toptional: true\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.$.yards': {\n\t\ttype: Array,\n\t\toptional: true\n\t},\n\t'roles.groups.$.yards.$': {\n\t\ttype: String\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: 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\tis_customer: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t}\n};\n\nexport let Users: MongoManagerUserCollection<UserModel> = null;\nexport let UserVersions: MongoManagerUserCollection<UserModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB() && MongoManagerModel) {\n\t\tconst model = MongoManagerModel.create<UserModel>({\n\t\t\tcollectionName: 'users',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: true,\n\t\t\tuseReportBuilder: true,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: true,\n\t\t\tcheckSchema: true,\n\t\t\tcollectionOptions: null\n\t\t});\n\n\t\tUsers = <MongoManagerUserCollection<UserModel>>model.collection_main;\n\t\tUsers.createIndex({fullname: 1});\n\t\tUsers.createIndex({active: 1});\n\t\tUserVersions = <MongoManagerUserCollection<UserModel>>model.collection_version;\n\t}\n\telse {\n\t\tsetImmediate(() => {\n\t\t\tinitializeCollection();\n\t\t});\n\t}\n}"]}
|
package/cron/cron.js
CHANGED
|
@@ -1,2 +1,98 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CronJobManager = void 0;
|
|
4
|
+
var cron_1 = require("cron");
|
|
5
|
+
var CronJobManager = /** @class */ (function () {
|
|
6
|
+
function CronJobManager(key, tab, task, onComplete, start, timeZone, context, runOnInit) {
|
|
7
|
+
this.jobs = {};
|
|
8
|
+
if (key && tab && task) {
|
|
9
|
+
this.add(key, tab, task, onComplete, start, timeZone, context, runOnInit);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
CronJobManager.prototype.getJob = function (key) {
|
|
13
|
+
return this.jobs[key];
|
|
14
|
+
};
|
|
15
|
+
CronJobManager.prototype.getJobs = function () {
|
|
16
|
+
return Object.keys(this.jobs);
|
|
17
|
+
};
|
|
18
|
+
CronJobManager.prototype.add = function (key, tab, task, onComplete, start, timeZone, context, runOnInit) {
|
|
19
|
+
if ((typeof tab === 'string' || tab instanceof Date) && typeof key === 'string' && task instanceof Function) {
|
|
20
|
+
try {
|
|
21
|
+
if (this.jobs[key]) {
|
|
22
|
+
this.delete(key);
|
|
23
|
+
console.warn("".concat(key, " already existed and was deleted from the manager..."));
|
|
24
|
+
}
|
|
25
|
+
this.jobs[key] = new cron_1.CronJob(tab, task, onComplete, start, timeZone, context, runOnInit);
|
|
26
|
+
}
|
|
27
|
+
catch (fooBaredByUser) {
|
|
28
|
+
console.error("crontab: ".concat(tab, " possibly not valid, job ").concat(key, " not started...").concat(fooBaredByUser.message));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
console.warn("couldn't add: ".concat(key, " improper arguments"));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
CronJobManager.prototype.update = function (key, tab, task, onComplete, start, timeZone, context, runOnInit) {
|
|
36
|
+
// Check if the job exists
|
|
37
|
+
if (!this.jobs[key]) {
|
|
38
|
+
console.warn("Job with key ".concat(key, " does not exist."));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
// Store the running state
|
|
42
|
+
var wasRunning = this.jobs[key].running;
|
|
43
|
+
// Stop the existing job
|
|
44
|
+
this.jobs[key].stop();
|
|
45
|
+
// Create a new job instance with the updated properties
|
|
46
|
+
var newJob = new cron_1.CronJob(tab, task, onComplete, start || wasRunning, timeZone, context, runOnInit);
|
|
47
|
+
delete this.jobs[key];
|
|
48
|
+
// Replace the old job with the new one
|
|
49
|
+
this.jobs[key] = newJob;
|
|
50
|
+
};
|
|
51
|
+
CronJobManager.prototype.delete = function (key) {
|
|
52
|
+
try {
|
|
53
|
+
this.jobs[key].stop();
|
|
54
|
+
delete this.jobs[key];
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
console.error(new Date(), "Error in CronJobManager (delete): Trying to stop job: ".concat(key, ": ").concat(err));
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
CronJobManager.prototype.start = function (key) {
|
|
61
|
+
try {
|
|
62
|
+
if (this.jobs[key].running) {
|
|
63
|
+
console.warn("".concat(key, " job already running"));
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
this.jobs[key].start();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
console.error("couldn't start job: ".concat(key, ": ").concat(err));
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
CronJobManager.prototype.stop = function (key) {
|
|
74
|
+
try {
|
|
75
|
+
if (!this.jobs[key].running) {
|
|
76
|
+
console.warn("".concat(key, " job already stopped"));
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
this.jobs[key].stop();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
console.error("couldn't stop job: ".concat(key, ": ").concat(err));
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
CronJobManager.prototype.stopAll = function () {
|
|
87
|
+
for (var jobKey in this.jobs) {
|
|
88
|
+
this.jobs[jobKey].stop();
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
CronJobManager.prototype.exists = function (key) {
|
|
92
|
+
return !!this.jobs[key];
|
|
93
|
+
};
|
|
94
|
+
return CronJobManager;
|
|
95
|
+
}());
|
|
96
|
+
exports.CronJobManager = CronJobManager;
|
|
97
|
+
|
|
2
98
|
//# sourceMappingURL=cron.js.map
|
package/cron/cron.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cron/cron.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../src/cron/cron.ts"],"names":[],"mappings":";;;AAAA,6BAAkF;AAElF;IAGI,wBAAY,GAAY,EAAE,GAAmB,EAAE,IAAgC,EAAE,UAAkC,EAAE,KAAe,EAAE,QAAiB,EAAE,OAAuB,EAAE,SAAmB;QACjM,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,IAAI,GAAG,IAAI,GAAG,IAAI,IAAI,EAAE;YACpB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;SAC7E;IACL,CAAC;IAED,+BAAM,GAAN,UAAO,GAAW;QACd,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IAED,gCAAO,GAAP;QACI,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,4BAAG,GAAH,UAAI,GAAW,EAAE,GAAkB,EAAE,IAA+B,EAAE,UAAkC,EA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;QACD,OAAO,GAAG,EAAE;YACX,OAAO,CAAC,KAAK,CAAC,6BAAsB,GAAG,eAAK,GAAG,CAAE,CAAC,CAAC;SACnD;IACF,CAAC;IAED,gCAAO,GAAP;QACC,KAAK,IAAI,MAAM,IAAI,IAAI,CAAC,IAAI,EAAE;YAC7B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;SACzB;IACF,CAAC;IAED,+BAAM,GAAN,UAAO,GAAW;QACjB,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IACF,qBAAC;AAAD,CAhHA,AAgHC,IAAA;AAhHY,wCAAc","file":"cron.js","sourcesContent":["import { CronCommand, CronJob, CronJobParams, CronOnCompleteCommand } from 'cron';\n\nexport class CronJobManager {\n\tprivate jobs: { [key: string]: CronJob };\n\n constructor(key?: string, tab?: string | Date, task?: CronCommand<any, boolean>, onComplete?: CronOnCompleteCommand, start?: boolean, timeZone?: string, context?: CronJobParams, runOnInit?: boolean) {\n this.jobs = {};\n if (key && tab && task) {\n this.add(key, tab, task, onComplete, start, timeZone, context, runOnInit);\n }\n }\n\n getJob(key: string): CronJob {\n return this.jobs[key];\n }\n\n getJobs(): string[] {\n return Object.keys(this.jobs);\n }\n\n add(key: string, tab: string | Date, task: CronCommand<any, boolean>, onComplete?: CronOnCompleteCommand, start?: boolean, timeZone?: string, context?: CronJobParams, runOnInit?: boolean): void {\n\t\tif ((typeof tab === 'string' || tab instanceof Date) && typeof key === 'string' && task instanceof Function) {\n\t\t\ttry {\n\t\t\t\tif (this.jobs[key]) {\n\t\t\t\t\tthis.delete(key);\n\t\t\t\t\tconsole.warn(`${key} already existed and was deleted from the manager...`);\n\t\t\t\t}\n\t\t\t\tthis.jobs[key] = new CronJob(tab, task, onComplete, start, timeZone, context, runOnInit);\n\t\t\t} catch (fooBaredByUser) {\n\t\t\t\tconsole.error(`crontab: ${tab} possibly not valid, job ${key} not started...${fooBaredByUser.message}`);\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.warn(`couldn't add: ${key} improper arguments`);\n\t\t}\n\t}\n\n\tupdate(key: string, tab: string | Date, task: CronCommand<any, boolean>, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean): void {\n\t\t// Check if the job exists\n\t\tif (!this.jobs[key]) {\n\t\t\tconsole.warn(`Job with key ${key} does not exist.`);\n\t\t\treturn;\n\t\t}\n\n\t\t// Store the running state\n\t\tconst wasRunning = this.jobs[key].running;\n\t\n\t\t// Stop the existing job\n\t\tthis.jobs[key].stop();\n\t\n\t\t// Create a new job instance with the updated properties\n\t\tconst newJob = new CronJob(\n\t\t\ttab,\n\t\t\ttask,\n\t\t\tonComplete,\n\t\t\tstart || wasRunning,\n\t\t\ttimeZone,\n\t\t\tcontext,\n\t\t\trunOnInit\n\t\t);\n\n\t\tdelete this.jobs[key];\n\t\n\t\t// Replace the old job with the new one\n\t\tthis.jobs[key] = newJob;\n\t}\n\t\n\t\n\tdelete(key: string) {\n\t\ttry {\n\t\t\tthis.jobs[key].stop();\n\t\t\tdelete this.jobs[key];\n\t\t}\n\t\tcatch (err) { \n\t\t\tconsole.error(new Date(), `Error in CronJobManager (delete): Trying to stop job: ${key}: ${err}`);\n\t\t}\n\t}\n\n\tstart(key: string) {\n\t\ttry {\n\t\t\tif (this.jobs[key].running) {\n\t\t\t\tconsole.warn(`${key} job already running`);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.jobs[key].start();\n\t\t\t}\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.error(`couldn't start job: ${key}: ${err}`);\n\t\t}\n\t}\n\n\tstop(key: string) {\n\t\ttry {\n\t\t\tif (!this.jobs[key].running ) {\n\t\t\t\tconsole.warn(`${key} job already stopped`);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.jobs[key].stop();\n\t\t\t}\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.error(`couldn't stop job: ${key}: ${err}`);\n\t\t}\n\t}\n\n\tstopAll() {\n\t\tfor (let jobKey in this.jobs) {\n\t\t\tthis.jobs[jobKey].stop();\n\t\t}\n\t}\n\n\texists(key: string) {\n\t\treturn !!this.jobs[key];\n\t}\n}"]}
|