@resolveio/server-lib 12.5.54 → 12.5.56
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.d.ts +1 -0
- package/client-server-app.js +48 -0
- package/client-server-app.js.map +1 -0
- package/collections/app-status.collection.d.ts +3 -0
- package/collections/app-status.collection.js +51 -0
- package/collections/app-status.collection.js.map +1 -0
- package/collections/counter.collection.d.ts +3 -0
- package/collections/counter.collection.js +54 -0
- package/collections/counter.collection.js.map +1 -0
- package/collections/cron-job-history.collection.d.ts +3 -0
- package/collections/cron-job-history.collection.js +82 -0
- package/collections/cron-job-history.collection.js.map +1 -0
- package/collections/cron-job.collection.d.ts +3 -0
- package/collections/cron-job.collection.js +85 -0
- package/collections/cron-job.collection.js.map +1 -0
- package/collections/email-history.collection.d.ts +3 -0
- package/collections/email-history.collection.js +66 -0
- package/collections/email-history.collection.js.map +1 -0
- package/collections/email-verified.collection.d.ts +3 -0
- package/collections/email-verified.collection.js +61 -0
- package/collections/email-verified.collection.js.map +1 -0
- package/collections/file.collection.d.ts +3 -0
- package/collections/file.collection.js +73 -0
- package/collections/file.collection.js.map +1 -0
- package/collections/flag.collection.d.ts +3 -0
- package/collections/flag.collection.js +56 -0
- package/collections/flag.collection.js.map +1 -0
- package/collections/log-method-latency.collection.d.ts +3 -0
- package/collections/log-method-latency.collection.js +64 -0
- package/collections/log-method-latency.collection.js.map +1 -0
- package/collections/log-subscription.collection.d.ts +3 -0
- package/collections/log-subscription.collection.js +68 -0
- package/collections/log-subscription.collection.js.map +1 -0
- package/collections/log-ts.collection.d.ts +3 -0
- package/collections/log-ts.collection.js +78 -0
- package/collections/log-ts.collection.js.map +1 -0
- package/collections/log.collection.d.ts +3 -0
- package/collections/log.collection.js +77 -0
- package/collections/log.collection.js.map +1 -0
- package/collections/logged-in-users.collection.d.ts +3 -0
- package/collections/logged-in-users.collection.js +65 -0
- package/collections/logged-in-users.collection.js.map +1 -0
- package/collections/method-response.collection.d.ts +3 -0
- package/collections/method-response.collection.js +66 -0
- package/collections/method-response.collection.js.map +1 -0
- package/collections/monitor-cpu.collection.d.ts +3 -0
- package/collections/monitor-cpu.collection.js +63 -0
- package/collections/monitor-cpu.collection.js.map +1 -0
- package/collections/monitor-memory.collection.d.ts +3 -0
- package/collections/monitor-memory.collection.js +75 -0
- package/collections/monitor-memory.collection.js.map +1 -0
- package/collections/monitor-mongo.collection.d.ts +3 -0
- package/collections/monitor-mongo.collection.js +69 -0
- package/collections/monitor-mongo.collection.js.map +1 -0
- package/collections/notification.collection.d.ts +3 -0
- package/collections/notification.collection.js +51 -0
- package/collections/notification.collection.js.map +1 -0
- package/collections/report-builder-dashboard-builder.collection.d.ts +3 -0
- package/collections/report-builder-dashboard-builder.collection.js +109 -0
- package/collections/report-builder-dashboard-builder.collection.js.map +1 -0
- package/collections/report-builder-library.collection.d.ts +3 -0
- package/collections/report-builder-library.collection.js +87 -0
- package/collections/report-builder-library.collection.js.map +1 -0
- package/collections/report-builder-report.collection.d.ts +4 -0
- package/collections/report-builder-report.collection.js +149 -0
- package/collections/report-builder-report.collection.js.map +1 -0
- package/collections/user-group.collection.d.ts +4 -0
- package/collections/user-group.collection.js +90 -0
- package/collections/user-group.collection.js.map +1 -0
- package/collections/user-guide.collection.d.ts +3 -0
- package/collections/user-guide.collection.js +57 -0
- package/collections/user-guide.collection.js.map +1 -0
- package/collections/user.collection.d.ts +4 -0
- package/collections/user.collection.js +259 -0
- package/collections/user.collection.js.map +1 -0
- package/cron/cron.d.ts +5 -0
- package/cron/cron.js +162 -0
- package/cron/cron.js.map +1 -0
- package/fixtures/cron-jobs.d.ts +1 -0
- package/fixtures/cron-jobs.js +73 -0
- package/fixtures/cron-jobs.js.map +1 -0
- package/fixtures/init.d.ts +1 -0
- package/fixtures/init.js +59 -0
- package/fixtures/init.js.map +1 -0
- package/http/auth.d.ts +2 -0
- package/http/auth.js +763 -0
- package/http/auth.js.map +1 -0
- package/http/health.d.ts +1 -0
- package/http/health.js +12 -0
- package/http/health.js.map +1 -0
- package/http/home.d.ts +2 -0
- package/http/home.js +66 -0
- package/http/home.js.map +1 -0
- package/index.d.ts +23 -0
- package/index.js +127 -0
- package/index.js.map +1 -0
- package/managers/cron.manager.d.ts +17 -0
- package/managers/cron.manager.js +242 -0
- package/managers/cron.manager.js.map +1 -0
- package/managers/method.manager.d.ts +38 -0
- package/managers/method.manager.js +595 -0
- package/managers/method.manager.js.map +1 -0
- package/managers/mongo.manager.d.ts +178 -0
- package/managers/mongo.manager.js +2221 -0
- package/managers/mongo.manager.js.map +1 -0
- package/managers/monitor.manager.d.ts +59 -0
- package/managers/monitor.manager.js +351 -0
- package/managers/monitor.manager.js.map +1 -0
- package/managers/subscription.manager.d.ts +50 -0
- package/managers/subscription.manager.js +1091 -0
- package/managers/subscription.manager.js.map +1 -0
- package/managers/subscription.performance.d.ts +1 -0
- package/{src/managers/subscription.performance.ts → managers/subscription.performance.js} +33 -68
- package/managers/subscription.performance.js.map +1 -0
- package/methods/accounts.d.ts +2 -0
- package/methods/accounts.js +274 -0
- package/methods/accounts.js.map +1 -0
- package/methods/aws.d.ts +2 -0
- package/methods/aws.js +617 -0
- package/methods/aws.js.map +1 -0
- package/methods/collections.d.ts +2 -0
- package/methods/collections.js +499 -0
- package/methods/collections.js.map +1 -0
- package/methods/counters.d.ts +2 -0
- package/methods/counters.js +122 -0
- package/methods/counters.js.map +1 -0
- package/methods/cron-jobs.d.ts +2 -0
- package/methods/cron-jobs.js +1315 -0
- package/methods/cron-jobs.js.map +1 -0
- package/methods/flags.d.ts +2 -0
- package/methods/flags.js +9 -0
- package/methods/flags.js.map +1 -0
- package/methods/logs.d.ts +2 -0
- package/methods/logs.js +371 -0
- package/methods/logs.js.map +1 -0
- package/methods/monitor.d.ts +2 -0
- package/methods/monitor.js +565 -0
- package/methods/monitor.js.map +1 -0
- package/methods/pdf.d.ts +2 -0
- package/methods/pdf.js +468 -0
- package/methods/pdf.js.map +1 -0
- package/methods/report-builder.d.ts +2 -0
- package/methods/report-builder.js +858 -0
- package/methods/report-builder.js.map +1 -0
- package/methods/support.d.ts +2 -0
- package/methods/support.js +246 -0
- package/methods/support.js.map +1 -0
- package/{src/models/app-status.model.ts → models/app-status.model.d.ts} +2 -3
- package/models/app-status.model.js +4 -0
- package/models/app-status.model.js.map +1 -0
- package/{src/models/billing-logged-in-users.model.ts → models/billing-logged-in-users.model.d.ts} +4 -5
- package/models/billing-logged-in-users.model.js +4 -0
- package/models/billing-logged-in-users.model.js.map +1 -0
- package/models/collection-document.model.d.ts +19 -0
- package/models/collection-document.model.js +4 -0
- package/models/collection-document.model.js.map +1 -0
- package/{src/models/counter.model.ts → models/counter.model.d.ts} +3 -4
- package/models/counter.model.js +4 -0
- package/models/counter.model.js.map +1 -0
- package/models/cron-job-history.model.d.ts +12 -0
- package/models/cron-job-history.model.js +4 -0
- package/models/cron-job-history.model.js.map +1 -0
- package/models/cron-job.model.d.ts +13 -0
- package/models/cron-job.model.js +4 -0
- package/models/cron-job.model.js.map +1 -0
- package/models/dialog.model.d.ts +23 -0
- package/models/dialog.model.js +4 -0
- package/models/dialog.model.js.map +1 -0
- package/{src/models/email-history.model.ts → models/email-history.model.d.ts} +7 -8
- package/models/email-history.model.js +4 -0
- package/models/email-history.model.js.map +1 -0
- package/{src/models/email-verified.model.ts → models/email-verified.model.d.ts} +5 -6
- package/models/email-verified.model.js +4 -0
- package/models/email-verified.model.js.map +1 -0
- package/{src/models/file.model.ts → models/file.model.d.ts} +7 -8
- package/models/file.model.js +4 -0
- package/models/file.model.js.map +1 -0
- package/{src/models/flag.model.ts → models/flag.model.d.ts} +3 -4
- package/models/flag.model.js +4 -0
- package/models/flag.model.js.map +1 -0
- package/{src/models/log-method-latency.model.ts → models/log-method-latency.model.d.ts} +4 -5
- package/models/log-method-latency.model.js +4 -0
- package/models/log-method-latency.model.js.map +1 -0
- package/{src/models/log-subscription.model.ts → models/log-subscription.model.d.ts} +6 -8
- package/models/log-subscription.model.js +4 -0
- package/models/log-subscription.model.js.map +1 -0
- package/{src/models/log.model.ts → models/log.model.d.ts} +10 -12
- package/models/log.model.js +4 -0
- package/models/log.model.js.map +1 -0
- package/{src/models/logged-in-users.model.ts → models/logged-in-users.model.d.ts} +5 -6
- package/models/logged-in-users.model.js +4 -0
- package/models/logged-in-users.model.js.map +1 -0
- package/{src/models/method-response.model.ts → models/method-response.model.d.ts} +6 -7
- package/models/method-response.model.js +4 -0
- package/models/method-response.model.js.map +1 -0
- package/models/method.model.d.ts +9 -0
- package/models/method.model.js +4 -0
- package/models/method.model.js.map +1 -0
- package/{src/models/monitor-cpu.model.ts → models/monitor-cpu.model.d.ts} +7 -9
- package/models/monitor-cpu.model.js +4 -0
- package/models/monitor-cpu.model.js.map +1 -0
- package/models/monitor-memory.model.d.ts +15 -0
- package/models/monitor-memory.model.js +4 -0
- package/models/monitor-memory.model.js.map +1 -0
- package/models/monitor-mongo.model.d.ts +13 -0
- package/models/monitor-mongo.model.js +4 -0
- package/models/monitor-mongo.model.js.map +1 -0
- package/{src/models/notification.model.ts → models/notification.model.d.ts} +2 -3
- package/models/notification.model.js +4 -0
- package/models/notification.model.js.map +1 -0
- package/models/pagination.model.d.ts +10 -0
- package/models/pagination.model.js +24 -0
- package/models/pagination.model.js.map +1 -0
- package/models/permission.model.d.ts +12 -0
- package/models/permission.model.js +4 -0
- package/models/permission.model.js.map +1 -0
- package/models/report-builder-dashboard-builder.model.d.ts +25 -0
- package/models/report-builder-dashboard-builder.model.js +4 -0
- package/models/report-builder-dashboard-builder.model.js.map +1 -0
- package/models/report-builder-library.model.d.ts +17 -0
- package/models/report-builder-library.model.js +4 -0
- package/models/report-builder-library.model.js.map +1 -0
- package/models/report-builder-report.model.d.ts +98 -0
- package/models/report-builder-report.model.js +4 -0
- package/models/report-builder-report.model.js.map +1 -0
- package/models/report-builder.model.d.ts +61 -0
- package/models/report-builder.model.js +4 -0
- package/models/report-builder.model.js.map +1 -0
- package/models/select-data-label.model.d.ts +9 -0
- package/models/select-data-label.model.js +4 -0
- package/models/select-data-label.model.js.map +1 -0
- package/models/server-response.model.d.ts +5 -0
- package/models/server-response.model.js +4 -0
- package/models/server-response.model.js.map +1 -0
- package/models/subscription.model.d.ts +23 -0
- package/models/subscription.model.js +4 -0
- package/models/subscription.model.js.map +1 -0
- package/models/support-ticket.model.d.ts +72 -0
- package/models/support-ticket.model.js +4 -0
- package/models/support-ticket.model.js.map +1 -0
- package/models/user-group.model.d.ts +19 -0
- package/models/user-group.model.js +4 -0
- package/models/user-group.model.js.map +1 -0
- package/{src/models/user-guide.model.ts → models/user-guide.model.d.ts} +4 -5
- package/models/user-guide.model.js +4 -0
- package/models/user-guide.model.js.map +1 -0
- package/models/user.model.d.ts +70 -0
- package/models/user.model.js +4 -0
- package/models/user.model.js.map +1 -0
- package/package.json +1 -1
- package/{src/public_api.ts → public_api.d.ts} +1 -1
- package/public_api.js +75 -0
- package/public_api.js.map +1 -0
- package/publications/app-status.d.ts +2 -0
- package/publications/app-status.js +17 -0
- package/publications/app-status.js.map +1 -0
- package/publications/cron-jobs.d.ts +2 -0
- package/publications/cron-jobs.js +33 -0
- package/publications/cron-jobs.js.map +1 -0
- package/publications/files.d.ts +2 -0
- package/publications/files.js +37 -0
- package/publications/files.js.map +1 -0
- package/publications/flags.d.ts +2 -0
- package/publications/flags.js +23 -0
- package/publications/flags.js.map +1 -0
- package/publications/logs.d.ts +2 -0
- package/publications/logs.js +165 -0
- package/publications/logs.js.map +1 -0
- package/publications/method-responses.d.ts +2 -0
- package/publications/method-responses.js +17 -0
- package/publications/method-responses.js.map +1 -0
- package/publications/notifications.d.ts +2 -0
- package/publications/notifications.js +17 -0
- package/publications/notifications.js.map +1 -0
- package/publications/report-builder-dashboard-builders.d.ts +2 -0
- package/publications/report-builder-dashboard-builders.js +43 -0
- package/publications/report-builder-dashboard-builders.js.map +1 -0
- package/publications/report-builder-libraries.d.ts +2 -0
- package/publications/report-builder-libraries.js +90 -0
- package/publications/report-builder-libraries.js.map +1 -0
- package/publications/report-builder-reports.d.ts +2 -0
- package/publications/report-builder-reports.js +51 -0
- package/publications/report-builder-reports.js.map +1 -0
- package/publications/super-admin.d.ts +2 -0
- package/publications/super-admin.js +17 -0
- package/publications/super-admin.js.map +1 -0
- package/publications/user-groups.d.ts +1 -0
- package/publications/user-groups.js +17 -0
- package/publications/user-groups.js.map +1 -0
- package/publications/user-guides.d.ts +1 -0
- package/publications/user-guides.js +17 -0
- package/publications/user-guides.js.map +1 -0
- package/server-app.d.ts +52 -0
- package/server-app.js +739 -0
- package/server-app.js.map +1 -0
- package/util/common.d.ts +25 -0
- package/util/common.js +524 -0
- package/util/common.js.map +1 -0
- package/util/schema-report-builder.d.ts +6 -0
- package/util/schema-report-builder.js +453 -0
- package/util/schema-report-builder.js.map +1 -0
- package/.nodemon.json +0 -5
- package/.vscode/settings.json +0 -3
- package/README.md +0 -22
- package/compileDTS.pl +0 -64
- package/gulpfile.js +0 -127
- package/mongodbensurers.js +0 -2
- package/mongostop.js +0 -3
- package/settings.development.json +0 -13
- package/src/client-server-app.ts +0 -7
- package/src/collections/app-status.collection.ts +0 -51
- package/src/collections/counter.collection.ts +0 -54
- package/src/collections/cron-job-history.collection.ts +0 -82
- package/src/collections/cron-job.collection.ts +0 -85
- package/src/collections/email-history.collection.ts +0 -66
- package/src/collections/email-verified.collection.ts +0 -61
- package/src/collections/file.collection.ts +0 -73
- package/src/collections/flag.collection.ts +0 -56
- package/src/collections/log-method-latency.collection.ts +0 -64
- package/src/collections/log-subscription.collection.ts +0 -68
- package/src/collections/log-ts.collection.ts +0 -78
- package/src/collections/log.collection.ts +0 -77
- package/src/collections/logged-in-users.collection.ts +0 -65
- package/src/collections/method-response.collection.ts +0 -66
- package/src/collections/monitor-cpu.collection.ts +0 -63
- package/src/collections/monitor-memory.collection.ts +0 -75
- package/src/collections/monitor-mongo.collection.ts +0 -69
- package/src/collections/notification.collection.ts +0 -51
- package/src/collections/report-builder-dashboard-builder.collection.ts +0 -109
- package/src/collections/report-builder-library.collection.ts +0 -89
- package/src/collections/report-builder-report.collection.ts +0 -149
- package/src/collections/user-group.collection.ts +0 -90
- package/src/collections/user-guide.collection.ts +0 -57
- package/src/collections/user.collection.ts +0 -259
- package/src/cron/cron.ts +0 -188
- package/src/fixtures/cron-jobs.ts +0 -25
- package/src/fixtures/init.ts +0 -10
- package/src/http/auth.ts +0 -732
- package/src/http/health.ts +0 -7
- package/src/http/home.ts +0 -71
- package/src/index.ts +0 -71
- package/src/managers/cron.manager.ts +0 -208
- package/src/managers/method.manager.ts +0 -607
- package/src/managers/mongo.manager.ts +0 -2282
- package/src/managers/monitor.manager.ts +0 -323
- package/src/managers/subscription.manager.ts +0 -1196
- package/src/methods/accounts.ts +0 -202
- package/src/methods/aws.ts +0 -507
- package/src/methods/collections.ts +0 -512
- package/src/methods/counters.ts +0 -75
- package/src/methods/cron-jobs.ts +0 -1454
- package/src/methods/flags.ts +0 -7
- package/src/methods/logs.ts +0 -327
- package/src/methods/monitor.ts +0 -548
- package/src/methods/pdf.ts +0 -615
- package/src/methods/report-builder.ts +0 -876
- package/src/methods/support.ts +0 -146
- package/src/models/collection-document.model.ts +0 -22
- package/src/models/cron-job-history.model.ts +0 -13
- package/src/models/cron-job.model.ts +0 -14
- package/src/models/dialog.model.ts +0 -25
- package/src/models/method.model.ts +0 -11
- package/src/models/monitor-memory.model.ts +0 -17
- package/src/models/monitor-mongo.model.ts +0 -15
- package/src/models/pagination.model.ts +0 -30
- package/src/models/permission.model.ts +0 -14
- package/src/models/report-builder-dashboard-builder.model.ts +0 -29
- package/src/models/report-builder-library.model.ts +0 -20
- package/src/models/report-builder-report.model.ts +0 -110
- package/src/models/report-builder.model.ts +0 -68
- package/src/models/select-data-label.model.ts +0 -9
- package/src/models/server-response.model.ts +0 -5
- package/src/models/subscription.model.ts +0 -64
- package/src/models/support-ticket.model.ts +0 -81
- package/src/models/user-group.model.ts +0 -23
- package/src/models/user.model.ts +0 -79
- package/src/publications/app-status.ts +0 -13
- package/src/publications/cron-jobs.ts +0 -30
- package/src/publications/files.ts +0 -34
- package/src/publications/flags.ts +0 -20
- package/src/publications/logs.ts +0 -164
- package/src/publications/method-responses.ts +0 -13
- package/src/publications/notifications.ts +0 -13
- package/src/publications/report-builder-dashboard-builders.ts +0 -39
- package/src/publications/report-builder-libraries.ts +0 -41
- package/src/publications/report-builder-reports.ts +0 -48
- package/src/publications/super-admin.ts +0 -13
- package/src/publications/user-groups.ts +0 -12
- package/src/publications/user-guides.ts +0 -12
- package/src/server-app.ts +0 -769
- package/src/util/common.ts +0 -519
- package/src/util/schema-report-builder.ts +0 -413
- package/tsconfig.json +0 -30
- package/tslint.json +0 -143
- /package/{src/private → private}/email-templates/enrollment.html +0 -0
- /package/{src/private → private}/email-templates/forgot-password.html +0 -0
- /package/{src/private → private}/email-templates/support-ticket-deleted.html +0 -0
- /package/{src/private → private}/email-templates/support-ticket-modified.html +0 -0
- /package/{src/private → private}/email-templates/support-ticket.html +0 -0
- /package/{src/private → private}/images/ResolveIO.png +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserGroupVersions = exports.UserGroups = void 0;
|
|
4
|
+
var index_1 = require("../index");
|
|
5
|
+
var mongo_manager_1 = require("../managers/mongo.manager");
|
|
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
|
+
name: {
|
|
24
|
+
type: String
|
|
25
|
+
},
|
|
26
|
+
permissions: {
|
|
27
|
+
type: Array
|
|
28
|
+
},
|
|
29
|
+
'permissions.$': {
|
|
30
|
+
type: Object
|
|
31
|
+
},
|
|
32
|
+
'permissions.$.name': {
|
|
33
|
+
type: String
|
|
34
|
+
},
|
|
35
|
+
'permissions.$.selected': {
|
|
36
|
+
type: Boolean
|
|
37
|
+
},
|
|
38
|
+
'permissions.$.views': {
|
|
39
|
+
type: Array
|
|
40
|
+
},
|
|
41
|
+
'permissions.$.views.$': {
|
|
42
|
+
type: Object
|
|
43
|
+
},
|
|
44
|
+
'permissions.$.views.$.link': {
|
|
45
|
+
type: String
|
|
46
|
+
},
|
|
47
|
+
'permissions.$.views.$.selected': {
|
|
48
|
+
type: Boolean
|
|
49
|
+
},
|
|
50
|
+
notifications: {
|
|
51
|
+
type: Array
|
|
52
|
+
},
|
|
53
|
+
'notifications.$': {
|
|
54
|
+
type: Object
|
|
55
|
+
},
|
|
56
|
+
'notifications.$.name': {
|
|
57
|
+
type: String
|
|
58
|
+
},
|
|
59
|
+
'notifications.$.selected': {
|
|
60
|
+
type: Boolean
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
exports.UserGroups = null;
|
|
64
|
+
exports.UserGroupVersions = null;
|
|
65
|
+
initializeCollection();
|
|
66
|
+
function initializeCollection() {
|
|
67
|
+
if (index_1.ResolveIOServer && index_1.ResolveIOServer.getMainDB()) {
|
|
68
|
+
var model = new mongo_manager_1.MongoManagerModel({
|
|
69
|
+
collectionName: 'user-groups',
|
|
70
|
+
schema: schema,
|
|
71
|
+
useVersionCollection: true,
|
|
72
|
+
useReportBuilder: true,
|
|
73
|
+
reportBuilderLookupTables: [],
|
|
74
|
+
timestamps: true,
|
|
75
|
+
createLogs: false,
|
|
76
|
+
checkSchema: true,
|
|
77
|
+
collectionOptions: null
|
|
78
|
+
});
|
|
79
|
+
exports.UserGroups = model.collection_main;
|
|
80
|
+
exports.UserGroups.createIndex({ name: 1 });
|
|
81
|
+
exports.UserGroupVersions = model.collection_version;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
setTimeout(function () {
|
|
85
|
+
initializeCollection();
|
|
86
|
+
}, 1);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=user-group.collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/collections/user-group.collection.ts"],"names":[],"mappings":";;;AAAA,kCAA2C;AAC3C,2DAAsF;AAGtF,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,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;KACb;IACD,sBAAsB,EAAE;QACvB,IAAI,EAAE,MAAM;KACZ;IACD,0BAA0B,EAAE;QAC3B,IAAI,EAAE,OAAO;KACb;CACD,CAAC;AAES,QAAA,UAAU,GAA2C,IAAI,CAAC;AAC1D,QAAA,iBAAiB,GAA2C,IAAI,CAAC;AAE5E,oBAAoB,EAAE,CAAC;AAEvB,SAAS,oBAAoB;IAC5B,IAAI,uBAAe,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QACnD,IAAM,KAAK,GAAG,IAAI,iCAAiB,CAAiB;YACnD,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,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"user-group.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';\nimport { UserGroupModel } from '../models/user-group.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\tname: {\n\t\ttype: String\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},\n\t'notifications.$.name': {\n\t\ttype: String\n\t},\n\t'notifications.$.selected': {\n\t\ttype: Boolean\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()) {\n\t\tconst model = new MongoManagerModel<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\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 1);\n\t}\n}"]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserGuides = void 0;
|
|
4
|
+
var index_1 = require("../index");
|
|
5
|
+
var mongo_manager_1 = require("../managers/mongo.manager");
|
|
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 (index_1.ResolveIOServer && index_1.ResolveIOServer.getMainDB()) {
|
|
37
|
+
var model = new mongo_manager_1.MongoManagerModel({
|
|
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
|
+
setTimeout(function () {
|
|
52
|
+
initializeCollection();
|
|
53
|
+
}, 1);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=user-guide.collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/collections/user-guide.collection.ts"],"names":[],"mappings":";;;AAAA,kCAA2C;AAC3C,2DAAsF;AAGtF,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,uBAAe,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QACnD,IAAM,KAAK,GAAG,IAAI,iCAAiB,CAAiB;YACnD,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,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 { MongoManagerCollection, MongoManagerModel } 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: MongoManagerCollection<UserGuideModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB()) {\n\t\tconst model = new MongoManagerModel<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\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 1);\n\t}\n}"]}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserVersions = exports.Users = void 0;
|
|
4
|
+
var index_1 = require("../index");
|
|
5
|
+
var mongo_manager_1 = require("../managers/mongo.manager");
|
|
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.$.yard': {
|
|
69
|
+
type: String,
|
|
70
|
+
optional: true
|
|
71
|
+
},
|
|
72
|
+
'roles.notifications': {
|
|
73
|
+
type: Array
|
|
74
|
+
},
|
|
75
|
+
'roles.notifications.$': {
|
|
76
|
+
type: String
|
|
77
|
+
},
|
|
78
|
+
'roles.miscs': {
|
|
79
|
+
type: Array
|
|
80
|
+
},
|
|
81
|
+
'roles.miscs.$': {
|
|
82
|
+
type: String
|
|
83
|
+
},
|
|
84
|
+
username: {
|
|
85
|
+
type: String,
|
|
86
|
+
optional: true
|
|
87
|
+
},
|
|
88
|
+
email: {
|
|
89
|
+
type: String,
|
|
90
|
+
optional: true
|
|
91
|
+
},
|
|
92
|
+
fullname: {
|
|
93
|
+
type: String
|
|
94
|
+
},
|
|
95
|
+
active: {
|
|
96
|
+
type: Boolean
|
|
97
|
+
},
|
|
98
|
+
phonenumber: {
|
|
99
|
+
type: String,
|
|
100
|
+
optional: true
|
|
101
|
+
},
|
|
102
|
+
readonly: {
|
|
103
|
+
type: Boolean,
|
|
104
|
+
optional: true
|
|
105
|
+
},
|
|
106
|
+
other: {
|
|
107
|
+
type: Object,
|
|
108
|
+
blackbox: true
|
|
109
|
+
},
|
|
110
|
+
settings: {
|
|
111
|
+
type: Object,
|
|
112
|
+
optional: true
|
|
113
|
+
},
|
|
114
|
+
'settings.table_color': {
|
|
115
|
+
type: String
|
|
116
|
+
},
|
|
117
|
+
'settings.table_font_color': {
|
|
118
|
+
type: String
|
|
119
|
+
},
|
|
120
|
+
'settings.secondary_table_color': {
|
|
121
|
+
type: String
|
|
122
|
+
},
|
|
123
|
+
'settings.secondary_table_font_color': {
|
|
124
|
+
type: String
|
|
125
|
+
},
|
|
126
|
+
'settings.tertiary_table_color': {
|
|
127
|
+
type: String
|
|
128
|
+
},
|
|
129
|
+
'settings.tertiary_table_font_color': {
|
|
130
|
+
type: String
|
|
131
|
+
},
|
|
132
|
+
'settings.font_size': {
|
|
133
|
+
type: Number
|
|
134
|
+
},
|
|
135
|
+
'settings.collapsable_menu': {
|
|
136
|
+
type: Boolean
|
|
137
|
+
},
|
|
138
|
+
'settings.entries_per_page': {
|
|
139
|
+
type: String
|
|
140
|
+
},
|
|
141
|
+
'settings.warning_color': {
|
|
142
|
+
type: String
|
|
143
|
+
},
|
|
144
|
+
'settings.warning_font_color': {
|
|
145
|
+
type: String
|
|
146
|
+
},
|
|
147
|
+
'settings.warning_hover_color': {
|
|
148
|
+
type: String
|
|
149
|
+
},
|
|
150
|
+
'settings.success_color': {
|
|
151
|
+
type: String
|
|
152
|
+
},
|
|
153
|
+
'settings.success_font_color': {
|
|
154
|
+
type: String
|
|
155
|
+
},
|
|
156
|
+
'settings.success_hover_color': {
|
|
157
|
+
type: String
|
|
158
|
+
},
|
|
159
|
+
'settings.danger_color': {
|
|
160
|
+
type: String
|
|
161
|
+
},
|
|
162
|
+
'settings.danger_font_color': {
|
|
163
|
+
type: String
|
|
164
|
+
},
|
|
165
|
+
'settings.danger_hover_color': {
|
|
166
|
+
type: String
|
|
167
|
+
},
|
|
168
|
+
'settings.info_color': {
|
|
169
|
+
type: String
|
|
170
|
+
},
|
|
171
|
+
'settings.info_font_color': {
|
|
172
|
+
type: String
|
|
173
|
+
},
|
|
174
|
+
'settings.info_hover_color': {
|
|
175
|
+
type: String
|
|
176
|
+
},
|
|
177
|
+
'settings.primary_color': {
|
|
178
|
+
type: String
|
|
179
|
+
},
|
|
180
|
+
'settings.primary_font_color': {
|
|
181
|
+
type: String
|
|
182
|
+
},
|
|
183
|
+
'settings.primary_hover_color': {
|
|
184
|
+
type: String
|
|
185
|
+
},
|
|
186
|
+
'settings.secondary_color': {
|
|
187
|
+
type: String
|
|
188
|
+
},
|
|
189
|
+
'settings.secondary_font_color': {
|
|
190
|
+
type: String
|
|
191
|
+
},
|
|
192
|
+
'settings.secondary_hover_color': {
|
|
193
|
+
type: String
|
|
194
|
+
},
|
|
195
|
+
'settings.routing_preference': {
|
|
196
|
+
type: String
|
|
197
|
+
},
|
|
198
|
+
'settings.opening_route': {
|
|
199
|
+
type: String
|
|
200
|
+
},
|
|
201
|
+
salt: {
|
|
202
|
+
type: String
|
|
203
|
+
},
|
|
204
|
+
hash: {
|
|
205
|
+
type: String
|
|
206
|
+
},
|
|
207
|
+
attempts: {
|
|
208
|
+
type: Number
|
|
209
|
+
},
|
|
210
|
+
last: {
|
|
211
|
+
type: Date,
|
|
212
|
+
optional: true
|
|
213
|
+
},
|
|
214
|
+
services: {
|
|
215
|
+
type: Object,
|
|
216
|
+
optional: true
|
|
217
|
+
},
|
|
218
|
+
'services.enrollment': {
|
|
219
|
+
type: String,
|
|
220
|
+
optional: true
|
|
221
|
+
},
|
|
222
|
+
'services.forgot_password': {
|
|
223
|
+
type: String,
|
|
224
|
+
optional: true
|
|
225
|
+
},
|
|
226
|
+
'services.reset_password': {
|
|
227
|
+
type: String,
|
|
228
|
+
optional: true
|
|
229
|
+
},
|
|
230
|
+
};
|
|
231
|
+
exports.Users = null;
|
|
232
|
+
exports.UserVersions = null;
|
|
233
|
+
initializeCollection();
|
|
234
|
+
function initializeCollection() {
|
|
235
|
+
if (index_1.ResolveIOServer && index_1.ResolveIOServer.getMainDB()) {
|
|
236
|
+
var model = new mongo_manager_1.MongoManagerModel({
|
|
237
|
+
collectionName: 'users',
|
|
238
|
+
schema: schema,
|
|
239
|
+
useVersionCollection: true,
|
|
240
|
+
useReportBuilder: true,
|
|
241
|
+
reportBuilderLookupTables: [],
|
|
242
|
+
timestamps: true,
|
|
243
|
+
createLogs: true,
|
|
244
|
+
checkSchema: true,
|
|
245
|
+
collectionOptions: null
|
|
246
|
+
});
|
|
247
|
+
exports.Users = model.collection_main;
|
|
248
|
+
exports.Users.createIndex({ fullname: 1 });
|
|
249
|
+
exports.Users.createIndex({ active: 1 });
|
|
250
|
+
exports.UserVersions = model.collection_version;
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
setTimeout(function () {
|
|
254
|
+
initializeCollection();
|
|
255
|
+
}, 1);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
//# sourceMappingURL=user.collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/collections/user.collection.ts"],"names":[],"mappings":";;;AAAA,kCAA2C;AAC3C,2DAA0F;AAG1F,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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AAI;YAChB,WAAW,EAAE,IAAI;YACjB,iBAAiB,EAAE,IAAI;SACvB,CAAC,CAAC;QACH,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,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 { MongoManagerModel, MongoManagerUserCollection } 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\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.$.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: 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};\n\nexport let Users: MongoManagerUserCollection<UserModel> = null;\nexport let UserVersions: MongoManagerUserCollection<UserModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB()) {\n\t\tconst model = new MongoManagerModel<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\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\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 1);\n\t}\n}"]}
|
package/cron/cron.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare let CronJobPackage: any;
|
|
2
|
+
declare function CrontabManager(key: any, tab: any, task: any, options: any): void;
|
|
3
|
+
declare function combineOptions(tab: any, task: any, options: any): {};
|
|
4
|
+
declare function updateTab(key: any, cronstring: any): void;
|
|
5
|
+
declare function updateTask(key: any, task: any): void;
|
package/cron/cron.js
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
var CronJobPackage = require('cron').CronJob;
|
|
2
|
+
function CrontabManager(key, tab, task, options) {
|
|
3
|
+
this.jobs = {};
|
|
4
|
+
if (key && tab && task) {
|
|
5
|
+
this.add(key, tab, task, options);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
CrontabManager.prototype.getJob = function (key) {
|
|
9
|
+
return this.jobs[key];
|
|
10
|
+
};
|
|
11
|
+
CrontabManager.prototype.getJobs = function () {
|
|
12
|
+
return Object.keys(this.jobs);
|
|
13
|
+
};
|
|
14
|
+
CrontabManager.prototype.add = function (key, tab, task, options) {
|
|
15
|
+
if ((typeof tab === 'string' || tab instanceof Date) && typeof key === 'string' && task instanceof Function) {
|
|
16
|
+
options = combineOptions(tab, task, options);
|
|
17
|
+
try {
|
|
18
|
+
if (this.jobs[key]) {
|
|
19
|
+
this.deleteJob(key);
|
|
20
|
+
console.warn("".concat(key, " already existed and was deleted from the manager..."));
|
|
21
|
+
}
|
|
22
|
+
this.jobs[key] = new CronJobPackage(options);
|
|
23
|
+
}
|
|
24
|
+
catch (fooBaredByUser) {
|
|
25
|
+
console.error("crontab: ".concat(tab, " possibly not valid, job ").concat(key, " not started...").concat(fooBaredByUser.message));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
console.warn("couldn't add: ".concat(key, " improper arguments"));
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
CrontabManager.prototype.update = function () {
|
|
33
|
+
if (arguments.length === 2) {
|
|
34
|
+
if (typeof arguments[1] === 'string' || arguments[1] instanceof Date) {
|
|
35
|
+
updateTab.call(this, arguments[0], arguments[1]);
|
|
36
|
+
}
|
|
37
|
+
else if (arguments[1] instanceof Function) {
|
|
38
|
+
updateTask.call(this, arguments[0], arguments[1]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else if (arguments.length === 3) {
|
|
42
|
+
updateTab.call(this, arguments[0], arguments[1]);
|
|
43
|
+
updateTask.call(this, arguments[0], arguments[2]);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
console.error("incorrect number of arguents passed to update.. won't update.. ".concat(arguments[0]));
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
CrontabManager.prototype.deleteJob = function (key) {
|
|
50
|
+
try {
|
|
51
|
+
this.jobs[key].stop();
|
|
52
|
+
delete this.jobs[key];
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
console.error(new Date(), "error in trying to stop job: ".concat(key, ": ").concat(err));
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
CrontabManager.prototype.start = function (key) {
|
|
59
|
+
try {
|
|
60
|
+
if (this.jobs[key].running) {
|
|
61
|
+
console.warn("".concat(key, " job already running"));
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
this.jobs[key].start();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
console.error("couldn't start job: ".concat(key, ": ").concat(err));
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
CrontabManager.prototype.stop = function (key) {
|
|
72
|
+
try {
|
|
73
|
+
if (!this.jobs[key].running) {
|
|
74
|
+
console.warn("".concat(key, " job already stopped"));
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
this.jobs[key].stop();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
console.error("couldn't stop job: ".concat(key, ": ").concat(err));
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
CrontabManager.prototype.stopAll = function () {
|
|
85
|
+
// tslint:disable-next-line:forin
|
|
86
|
+
for (var jobKey in this.jobs) {
|
|
87
|
+
try {
|
|
88
|
+
this.jobs[jobKey].stop();
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
CrontabManager.prototype.toString = function () {
|
|
95
|
+
var manString = '{\n';
|
|
96
|
+
// tslint:disable-next-line:forin
|
|
97
|
+
for (var jobKey in this.jobs) {
|
|
98
|
+
manString += "'".concat(jobKey, "': ").concat(this.jobs[jobKey].cronTime.source, ": ").concat(this.jobs[jobKey]._callbacks[0], ": ").concat(this.jobs[jobKey].running ? 'Running' : 'Stopped');
|
|
99
|
+
}
|
|
100
|
+
manString += '\n}';
|
|
101
|
+
return manString;
|
|
102
|
+
};
|
|
103
|
+
CrontabManager.prototype.listCrons = function () {
|
|
104
|
+
var manString = '{\n';
|
|
105
|
+
// tslint:disable-next-line:forin
|
|
106
|
+
for (var jobKey in this.jobs) {
|
|
107
|
+
manString += "'".concat(jobKey, "': ").concat(this.jobs[jobKey].cronTime.source, " status: ").concat(this.jobs[jobKey].running ? 'Running' : 'Stopped', " \n");
|
|
108
|
+
}
|
|
109
|
+
manString += '\n}';
|
|
110
|
+
return manString;
|
|
111
|
+
};
|
|
112
|
+
CrontabManager.prototype.exists = function (tabKey) {
|
|
113
|
+
if (this.jobs[tabKey]) {
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
return false;
|
|
117
|
+
};
|
|
118
|
+
function combineOptions(tab, task, options) {
|
|
119
|
+
var newOpts = {};
|
|
120
|
+
newOpts['cronTime'] = tab;
|
|
121
|
+
newOpts['onTick'] = task;
|
|
122
|
+
if (options instanceof Object) {
|
|
123
|
+
// might overwrite... please be careful.
|
|
124
|
+
// tslint:disable-next-line:forin
|
|
125
|
+
for (var optionKey in options) {
|
|
126
|
+
newOpts[optionKey] = options[optionKey];
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return newOpts;
|
|
130
|
+
}
|
|
131
|
+
function updateTab(key, cronstring) {
|
|
132
|
+
try {
|
|
133
|
+
var running = this.jobs[key].running;
|
|
134
|
+
this.jobs[key].stop();
|
|
135
|
+
if (typeof cronstring === 'string' || cronstring instanceof Date) {
|
|
136
|
+
this.jobs[key] = new CronJobPackage(cronstring, this.jobs[key]._callbacks[0], this.jobs[key].onComplete, running, this.jobs[key].zone);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
throw new Error("The cron definition passed was not a string or a Date object! ".concat(key, " was stopped and not updated"));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
catch (tabErr) {
|
|
143
|
+
console.error("error updating tab: ".concat(key, " - ").concat(tabErr.message));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function updateTask(key, task) {
|
|
147
|
+
try {
|
|
148
|
+
var running = this.jobs[key].running;
|
|
149
|
+
this.jobs[key].stop();
|
|
150
|
+
if (!(task instanceof Function)) {
|
|
151
|
+
console.error("can't update with something that is not a function: ".concat(typeof (task)));
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
this.jobs[key] = new CronJobPackage(this.jobs[key].cronTime.source, task, this.jobs[key].onComplete, running, this.jobs[key].zone);
|
|
155
|
+
}
|
|
156
|
+
catch (tabErr) {
|
|
157
|
+
console.error("error updating task: ".concat(key, " - ").concat(tabErr.message));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
module.exports = CrontabManager;
|
|
161
|
+
|
|
162
|
+
//# sourceMappingURL=cron.js.map
|
package/cron/cron.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/cron/cron.ts"],"names":[],"mappings":"AAAA,IAAI,cAAc,GAAG,OAAO,CAAC,M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,OAAO,CAAC,KAAK,CAAC,8DAAuD,OAAM,CAAC,IAAI,CAAC,CAAE,CAAC,CAAC;YACrF,OAAO;SACP;QAED,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAI,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;KAGpI;IACD,OAAO,MAAM,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,+BAAwB,GAAG,iBAAO,MAAM,CAAC,OAAO,CAAE,CAAC,CAAC;KAClE;AACF,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,cAAc,CAAC","file":"cron.js","sourcesContent":["let CronJobPackage = require('cron').CronJob;\n\nfunction CrontabManager(key, tab, task, options) {\n\tthis.jobs = {};\n\tif (key && tab && task) {\n\t\tthis.add(key, tab, task, options);\n\t}\n\n}\n\nCrontabManager.prototype.getJob = function(key) {\n\treturn this.jobs[key];\n};\n\nCrontabManager.prototype.getJobs = function() {\n\treturn Object.keys(this.jobs);\n};\n\nCrontabManager.prototype.add = function(key, tab, task, options) {\n\tif ((typeof tab === 'string' || tab instanceof Date) && typeof key === 'string' && task instanceof Function) {\n\t\toptions = combineOptions(tab, task, options);\n\t\ttry {\n\t\t\tif (this.jobs[key]) {\n\t\t\t\tthis.deleteJob(key);\n\t\t\t\tconsole.warn(`${key} already existed and was deleted from the manager...`);\n\t\t\t}\n\t\t\t\n\t\t\tthis.jobs[key] = new CronJobPackage(options);\n\t\t} \n\t\tcatch (fooBaredByUser) {\n\t\t\tconsole.error(`crontab: ${tab} possibly not valid, job ${key} not started...${fooBaredByUser.message}`);\n\t\t}\n\t}\n\telse {\n\t\tconsole.warn(`couldn't add: ${key} improper arguments`);\n\t}\n};\n\nCrontabManager.prototype.update = function() {\n\tif (arguments.length === 2) {\n\t\tif (typeof arguments[1] === 'string' || arguments[1] instanceof Date) {\n\t\t\tupdateTab.call(this, arguments[0], arguments[1]);\n\t\t}\n\t\telse if (arguments[1] instanceof Function) {\n\t\t\tupdateTask.call(this, arguments[0], arguments[1]);\n\t\t}\n\t} \n\telse if (arguments.length === 3) {\n\t\tupdateTab.call(this, arguments[0], arguments[1]);\n\t\tupdateTask.call(this, arguments[0], arguments[2]);\n\t}\n\telse {\n\t\tconsole.error(`incorrect number of arguents passed to update.. won't update.. ${arguments[0]}`);\n\t}\n};\n\nCrontabManager.prototype.deleteJob = function(key) {\n\ttry {\n\t\tthis.jobs[key].stop();\n\t\tdelete this.jobs[key];\n\t}\n\tcatch (err) { \n\t\tconsole.error(new Date(), `error in trying to stop job: ${key}: ${err}`);\n\t}\n};\n\nCrontabManager.prototype.start = function(key) {\n\ttry {\n\t\tif (this.jobs[key].running) {\n\t\t\tconsole.warn(`${key} job already running`);\n\t\t}\n\t\telse {\n\t\t\tthis.jobs[key].start();\n\t\t}\n\t}\n\tcatch (err) {\n\t\tconsole.error(`couldn't start job: ${key}: ${err}`);\n\t}\n};\n\nCrontabManager.prototype.stop = function(key) {\n\ttry {\n\t\tif (! this.jobs[key].running ) {\n\t\t\tconsole.warn(`${key} job already stopped`);\n\t\t}\n\t\telse {\n\t\t\tthis.jobs[key].stop();\n\t\t}\n\t}\n\tcatch (err) {\n\t\tconsole.error(`couldn't stop job: ${key}: ${err}`);\n\t}\n};\n\nCrontabManager.prototype.stopAll = function() {\n\t// tslint:disable-next-line:forin\n\tfor (let jobKey in this.jobs) {\n\t\ttry {\n\t\t\tthis.jobs[jobKey].stop();\n\t\t}\n\t\tcatch (err) {\n\n\t\t}\n\t}\n};\n\nCrontabManager.prototype.toString = function() {\n\tlet manString = '{\\n';\n\t// tslint:disable-next-line:forin\n\tfor (let jobKey in this.jobs) {\n\n\t\tmanString += `'${jobKey}': ${this.jobs[jobKey].cronTime.source}: ${this.jobs[jobKey]._callbacks[0]}: ${this.jobs[jobKey].running ? 'Running' : 'Stopped'}`;\n\t}\n\tmanString += '\\n}';\n\treturn manString;\n};\n\nCrontabManager.prototype.listCrons = function() {\n\tlet manString = '{\\n';\n\t// tslint:disable-next-line:forin\n\tfor (let jobKey in this.jobs) {\n\t\tmanString += `'${jobKey}': ${this.jobs[jobKey].cronTime.source} status: ${this.jobs[jobKey].running ? 'Running' : 'Stopped'} \\n`;\n\t}\n\tmanString += '\\n}';\n\treturn manString;\n};\n\nCrontabManager.prototype.exists = function(tabKey) {\n\tif (this.jobs[tabKey]) {\n\t\treturn true;\n\t}\n\n\treturn false;\n};\n\nfunction combineOptions(tab, task, options) {\n\tlet newOpts = {};\n\tnewOpts['cronTime'] = tab; \n\tnewOpts['onTick'] = task;\n\n\tif (options instanceof Object) {\n\t\t// might overwrite... please be careful.\n\t\t// tslint:disable-next-line:forin\n\t\tfor (let optionKey in options) {\n\t\t\tnewOpts[optionKey] = options[optionKey];\n\t\t}\n\t}\n\treturn newOpts;\n}\n\nfunction updateTab(key, cronstring) {\n\n\ttry {\n\t\tlet running = this.jobs[key].running;\n\t\tthis.jobs[key].stop();\n\n\t\tif (typeof cronstring === 'string' || cronstring instanceof Date) {\n\t\t\tthis.jobs[key] = new CronJobPackage(cronstring, this.jobs[key]._callbacks[0], this.jobs[key].onComplete, running, this.jobs[key].zone);\n\t\t}\n\t\telse {\n\t\t\tthrow new Error(`The cron definition passed was not a string or a Date object! ${key} was stopped and not updated`);\n\t\t}\n\t}\n\tcatch (tabErr) {\n\t\tconsole.error(`error updating tab: ${key} - ${tabErr.message}`);\n\t}\n}\n\nfunction updateTask(key, task) {\n\ttry {\n\t\tlet running = this.jobs[key].running;\n\t\tthis.jobs[key].stop();\n\n\t\tif (!(task instanceof Function)) {\n\t\t\tconsole.error(`can't update with something that is not a function: ${typeof(task)}`);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.jobs[key] = new CronJobPackage(this.jobs[key].cronTime.source, task, this.jobs[key].onComplete, running, this.jobs[key].zone);\n\n\n\t} \n\tcatch (tabErr) {\n\t\tconsole.error(`error updating task: ${key} - ${tabErr.message}`);\n\t}\n}\n\nmodule.exports = CrontabManager;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function loadServerCronJobs(): Promise<void>;
|