@resolveio/server-lib 12.5.53 → 12.5.54
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/.nodemon.json +5 -0
- package/.vscode/settings.json +3 -0
- package/README.md +22 -0
- package/compileDTS.pl +64 -0
- package/gulpfile.js +127 -0
- package/mongodbensurers.js +2 -0
- package/mongostop.js +3 -0
- package/package.json +1 -1
- package/settings.development.json +13 -0
- package/src/client-server-app.ts +7 -0
- package/src/collections/app-status.collection.ts +51 -0
- package/src/collections/counter.collection.ts +54 -0
- package/src/collections/cron-job-history.collection.ts +82 -0
- package/src/collections/cron-job.collection.ts +85 -0
- package/src/collections/email-history.collection.ts +66 -0
- package/src/collections/email-verified.collection.ts +61 -0
- package/src/collections/file.collection.ts +73 -0
- package/src/collections/flag.collection.ts +56 -0
- package/src/collections/log-method-latency.collection.ts +64 -0
- package/src/collections/log-subscription.collection.ts +68 -0
- package/src/collections/log-ts.collection.ts +78 -0
- package/src/collections/log.collection.ts +77 -0
- package/src/collections/logged-in-users.collection.ts +65 -0
- package/src/collections/method-response.collection.ts +66 -0
- package/src/collections/monitor-cpu.collection.ts +63 -0
- package/src/collections/monitor-memory.collection.ts +75 -0
- package/src/collections/monitor-mongo.collection.ts +69 -0
- package/src/collections/notification.collection.ts +51 -0
- package/src/collections/report-builder-dashboard-builder.collection.ts +109 -0
- package/src/collections/report-builder-library.collection.ts +89 -0
- package/src/collections/report-builder-report.collection.ts +149 -0
- package/src/collections/user-group.collection.ts +90 -0
- package/src/collections/user-guide.collection.ts +57 -0
- package/src/collections/user.collection.ts +259 -0
- package/src/cron/cron.ts +188 -0
- package/src/fixtures/cron-jobs.ts +25 -0
- package/src/fixtures/init.ts +10 -0
- package/src/http/auth.ts +732 -0
- package/src/http/health.ts +7 -0
- package/src/http/home.ts +71 -0
- package/src/index.ts +71 -0
- package/src/managers/cron.manager.ts +208 -0
- package/src/managers/method.manager.ts +607 -0
- package/src/managers/mongo.manager.ts +2282 -0
- package/src/managers/monitor.manager.ts +323 -0
- package/src/managers/subscription.manager.ts +1196 -0
- package/{managers/subscription.performance.js → src/managers/subscription.performance.ts} +68 -33
- package/src/methods/accounts.ts +202 -0
- package/src/methods/aws.ts +507 -0
- package/src/methods/collections.ts +512 -0
- package/src/methods/counters.ts +75 -0
- package/src/methods/cron-jobs.ts +1454 -0
- package/src/methods/flags.ts +7 -0
- package/src/methods/logs.ts +327 -0
- package/src/methods/monitor.ts +548 -0
- package/src/methods/pdf.ts +615 -0
- package/src/methods/report-builder.ts +876 -0
- package/src/methods/support.ts +146 -0
- package/{models/app-status.model.d.ts → src/models/app-status.model.ts} +3 -2
- package/{models/billing-logged-in-users.model.d.ts → src/models/billing-logged-in-users.model.ts} +5 -4
- package/src/models/collection-document.model.ts +22 -0
- package/{models/counter.model.d.ts → src/models/counter.model.ts} +4 -3
- package/src/models/cron-job-history.model.ts +13 -0
- package/src/models/cron-job.model.ts +14 -0
- package/src/models/dialog.model.ts +25 -0
- package/{models/email-history.model.d.ts → src/models/email-history.model.ts} +8 -7
- package/{models/email-verified.model.d.ts → src/models/email-verified.model.ts} +6 -5
- package/{models/file.model.d.ts → src/models/file.model.ts} +8 -7
- package/{models/flag.model.d.ts → src/models/flag.model.ts} +4 -3
- package/{models/log-method-latency.model.d.ts → src/models/log-method-latency.model.ts} +5 -4
- package/{models/log-subscription.model.d.ts → src/models/log-subscription.model.ts} +8 -6
- package/{models/log.model.d.ts → src/models/log.model.ts} +12 -10
- package/{models/logged-in-users.model.d.ts → src/models/logged-in-users.model.ts} +6 -5
- package/{models/method-response.model.d.ts → src/models/method-response.model.ts} +7 -6
- package/src/models/method.model.ts +11 -0
- package/{models/monitor-cpu.model.d.ts → src/models/monitor-cpu.model.ts} +9 -7
- package/src/models/monitor-memory.model.ts +17 -0
- package/src/models/monitor-mongo.model.ts +15 -0
- package/{models/notification.model.d.ts → src/models/notification.model.ts} +3 -2
- package/src/models/pagination.model.ts +30 -0
- package/src/models/permission.model.ts +14 -0
- package/src/models/report-builder-dashboard-builder.model.ts +29 -0
- package/src/models/report-builder-library.model.ts +20 -0
- package/src/models/report-builder-report.model.ts +110 -0
- package/src/models/report-builder.model.ts +68 -0
- package/src/models/select-data-label.model.ts +9 -0
- package/src/models/server-response.model.ts +5 -0
- package/src/models/subscription.model.ts +64 -0
- package/src/models/support-ticket.model.ts +81 -0
- package/src/models/user-group.model.ts +23 -0
- package/{models/user-guide.model.d.ts → src/models/user-guide.model.ts} +5 -4
- package/src/models/user.model.ts +79 -0
- package/{public_api.d.ts → src/public_api.ts} +1 -1
- package/src/publications/app-status.ts +13 -0
- package/src/publications/cron-jobs.ts +30 -0
- package/src/publications/files.ts +34 -0
- package/src/publications/flags.ts +20 -0
- package/src/publications/logs.ts +164 -0
- package/src/publications/method-responses.ts +13 -0
- package/src/publications/notifications.ts +13 -0
- package/src/publications/report-builder-dashboard-builders.ts +39 -0
- package/src/publications/report-builder-libraries.ts +41 -0
- package/src/publications/report-builder-reports.ts +48 -0
- package/src/publications/super-admin.ts +13 -0
- package/src/publications/user-groups.ts +12 -0
- package/src/publications/user-guides.ts +12 -0
- package/src/server-app.ts +769 -0
- package/src/util/common.ts +519 -0
- package/src/util/schema-report-builder.ts +413 -0
- package/tsconfig.json +30 -0
- package/tslint.json +143 -0
- package/client-server-app.d.ts +0 -1
- package/client-server-app.js +0 -48
- package/client-server-app.js.map +0 -1
- package/collections/app-status.collection.d.ts +0 -3
- package/collections/app-status.collection.js +0 -51
- package/collections/app-status.collection.js.map +0 -1
- package/collections/counter.collection.d.ts +0 -3
- package/collections/counter.collection.js +0 -54
- package/collections/counter.collection.js.map +0 -1
- package/collections/cron-job-history.collection.d.ts +0 -3
- package/collections/cron-job-history.collection.js +0 -82
- package/collections/cron-job-history.collection.js.map +0 -1
- package/collections/cron-job.collection.d.ts +0 -3
- package/collections/cron-job.collection.js +0 -85
- package/collections/cron-job.collection.js.map +0 -1
- package/collections/email-history.collection.d.ts +0 -3
- package/collections/email-history.collection.js +0 -66
- package/collections/email-history.collection.js.map +0 -1
- package/collections/email-verified.collection.d.ts +0 -3
- package/collections/email-verified.collection.js +0 -61
- package/collections/email-verified.collection.js.map +0 -1
- package/collections/file.collection.d.ts +0 -3
- package/collections/file.collection.js +0 -73
- package/collections/file.collection.js.map +0 -1
- package/collections/flag.collection.d.ts +0 -3
- package/collections/flag.collection.js +0 -56
- package/collections/flag.collection.js.map +0 -1
- package/collections/log-method-latency.collection.d.ts +0 -3
- package/collections/log-method-latency.collection.js +0 -64
- package/collections/log-method-latency.collection.js.map +0 -1
- package/collections/log-subscription.collection.d.ts +0 -3
- package/collections/log-subscription.collection.js +0 -68
- package/collections/log-subscription.collection.js.map +0 -1
- package/collections/log-ts.collection.d.ts +0 -3
- package/collections/log-ts.collection.js +0 -78
- package/collections/log-ts.collection.js.map +0 -1
- package/collections/log.collection.d.ts +0 -3
- package/collections/log.collection.js +0 -77
- package/collections/log.collection.js.map +0 -1
- package/collections/logged-in-users.collection.d.ts +0 -3
- package/collections/logged-in-users.collection.js +0 -65
- package/collections/logged-in-users.collection.js.map +0 -1
- package/collections/method-response.collection.d.ts +0 -3
- package/collections/method-response.collection.js +0 -66
- package/collections/method-response.collection.js.map +0 -1
- package/collections/monitor-cpu.collection.d.ts +0 -3
- package/collections/monitor-cpu.collection.js +0 -63
- package/collections/monitor-cpu.collection.js.map +0 -1
- package/collections/monitor-memory.collection.d.ts +0 -3
- package/collections/monitor-memory.collection.js +0 -75
- package/collections/monitor-memory.collection.js.map +0 -1
- package/collections/monitor-mongo.collection.d.ts +0 -3
- package/collections/monitor-mongo.collection.js +0 -69
- package/collections/monitor-mongo.collection.js.map +0 -1
- package/collections/notification.collection.d.ts +0 -3
- package/collections/notification.collection.js +0 -51
- package/collections/notification.collection.js.map +0 -1
- package/collections/report-builder-dashboard-builder.collection.d.ts +0 -3
- package/collections/report-builder-dashboard-builder.collection.js +0 -109
- package/collections/report-builder-dashboard-builder.collection.js.map +0 -1
- package/collections/report-builder-library.collection.d.ts +0 -3
- package/collections/report-builder-library.collection.js +0 -87
- package/collections/report-builder-library.collection.js.map +0 -1
- package/collections/report-builder-report.collection.d.ts +0 -4
- package/collections/report-builder-report.collection.js +0 -149
- package/collections/report-builder-report.collection.js.map +0 -1
- package/collections/user-group.collection.d.ts +0 -4
- package/collections/user-group.collection.js +0 -90
- package/collections/user-group.collection.js.map +0 -1
- package/collections/user-guide.collection.d.ts +0 -3
- package/collections/user-guide.collection.js +0 -57
- package/collections/user-guide.collection.js.map +0 -1
- package/collections/user.collection.d.ts +0 -4
- package/collections/user.collection.js +0 -259
- package/collections/user.collection.js.map +0 -1
- package/cron/cron.d.ts +0 -5
- package/cron/cron.js +0 -162
- package/cron/cron.js.map +0 -1
- package/fixtures/cron-jobs.d.ts +0 -1
- package/fixtures/cron-jobs.js +0 -73
- package/fixtures/cron-jobs.js.map +0 -1
- package/fixtures/init.d.ts +0 -1
- package/fixtures/init.js +0 -59
- package/fixtures/init.js.map +0 -1
- package/http/auth.d.ts +0 -2
- package/http/auth.js +0 -763
- package/http/auth.js.map +0 -1
- package/http/health.d.ts +0 -1
- package/http/health.js +0 -12
- package/http/health.js.map +0 -1
- package/http/home.d.ts +0 -2
- package/http/home.js +0 -66
- package/http/home.js.map +0 -1
- package/index.d.ts +0 -23
- package/index.js +0 -127
- package/index.js.map +0 -1
- package/managers/cron.manager.d.ts +0 -17
- package/managers/cron.manager.js +0 -242
- package/managers/cron.manager.js.map +0 -1
- package/managers/method.manager.d.ts +0 -38
- package/managers/method.manager.js +0 -595
- package/managers/method.manager.js.map +0 -1
- package/managers/mongo.manager.d.ts +0 -178
- package/managers/mongo.manager.js +0 -2221
- package/managers/mongo.manager.js.map +0 -1
- package/managers/monitor.manager.d.ts +0 -59
- package/managers/monitor.manager.js +0 -351
- package/managers/monitor.manager.js.map +0 -1
- package/managers/subscription.manager.d.ts +0 -50
- package/managers/subscription.manager.js +0 -1091
- package/managers/subscription.manager.js.map +0 -1
- package/managers/subscription.performance.d.ts +0 -1
- package/managers/subscription.performance.js.map +0 -1
- package/methods/accounts.d.ts +0 -2
- package/methods/accounts.js +0 -274
- package/methods/accounts.js.map +0 -1
- package/methods/aws.d.ts +0 -2
- package/methods/aws.js +0 -617
- package/methods/aws.js.map +0 -1
- package/methods/collections.d.ts +0 -2
- package/methods/collections.js +0 -499
- package/methods/collections.js.map +0 -1
- package/methods/counters.d.ts +0 -2
- package/methods/counters.js +0 -122
- package/methods/counters.js.map +0 -1
- package/methods/cron-jobs.d.ts +0 -2
- package/methods/cron-jobs.js +0 -1315
- package/methods/cron-jobs.js.map +0 -1
- package/methods/flags.d.ts +0 -2
- package/methods/flags.js +0 -9
- package/methods/flags.js.map +0 -1
- package/methods/logs.d.ts +0 -2
- package/methods/logs.js +0 -371
- package/methods/logs.js.map +0 -1
- package/methods/monitor.d.ts +0 -2
- package/methods/monitor.js +0 -565
- package/methods/monitor.js.map +0 -1
- package/methods/pdf.d.ts +0 -2
- package/methods/pdf.js +0 -468
- package/methods/pdf.js.map +0 -1
- package/methods/report-builder.d.ts +0 -2
- package/methods/report-builder.js +0 -858
- package/methods/report-builder.js.map +0 -1
- package/methods/support.d.ts +0 -2
- package/methods/support.js +0 -246
- package/methods/support.js.map +0 -1
- package/models/app-status.model.js +0 -4
- package/models/app-status.model.js.map +0 -1
- package/models/billing-logged-in-users.model.js +0 -4
- package/models/billing-logged-in-users.model.js.map +0 -1
- package/models/collection-document.model.d.ts +0 -19
- package/models/collection-document.model.js +0 -4
- package/models/collection-document.model.js.map +0 -1
- package/models/counter.model.js +0 -4
- package/models/counter.model.js.map +0 -1
- package/models/cron-job-history.model.d.ts +0 -12
- package/models/cron-job-history.model.js +0 -4
- package/models/cron-job-history.model.js.map +0 -1
- package/models/cron-job.model.d.ts +0 -13
- package/models/cron-job.model.js +0 -4
- package/models/cron-job.model.js.map +0 -1
- package/models/dialog.model.d.ts +0 -23
- package/models/dialog.model.js +0 -4
- package/models/dialog.model.js.map +0 -1
- package/models/email-history.model.js +0 -4
- package/models/email-history.model.js.map +0 -1
- package/models/email-verified.model.js +0 -4
- package/models/email-verified.model.js.map +0 -1
- package/models/file.model.js +0 -4
- package/models/file.model.js.map +0 -1
- package/models/flag.model.js +0 -4
- package/models/flag.model.js.map +0 -1
- package/models/log-method-latency.model.js +0 -4
- package/models/log-method-latency.model.js.map +0 -1
- package/models/log-subscription.model.js +0 -4
- package/models/log-subscription.model.js.map +0 -1
- package/models/log.model.js +0 -4
- package/models/log.model.js.map +0 -1
- package/models/logged-in-users.model.js +0 -4
- package/models/logged-in-users.model.js.map +0 -1
- package/models/method-response.model.js +0 -4
- package/models/method-response.model.js.map +0 -1
- package/models/method.model.d.ts +0 -9
- package/models/method.model.js +0 -4
- package/models/method.model.js.map +0 -1
- package/models/monitor-cpu.model.js +0 -4
- package/models/monitor-cpu.model.js.map +0 -1
- package/models/monitor-memory.model.d.ts +0 -15
- package/models/monitor-memory.model.js +0 -4
- package/models/monitor-memory.model.js.map +0 -1
- package/models/monitor-mongo.model.d.ts +0 -13
- package/models/monitor-mongo.model.js +0 -4
- package/models/monitor-mongo.model.js.map +0 -1
- package/models/notification.model.js +0 -4
- package/models/notification.model.js.map +0 -1
- package/models/pagination.model.d.ts +0 -10
- package/models/pagination.model.js +0 -24
- package/models/pagination.model.js.map +0 -1
- package/models/permission.model.d.ts +0 -12
- package/models/permission.model.js +0 -4
- package/models/permission.model.js.map +0 -1
- package/models/report-builder-dashboard-builder.model.d.ts +0 -25
- package/models/report-builder-dashboard-builder.model.js +0 -4
- package/models/report-builder-dashboard-builder.model.js.map +0 -1
- package/models/report-builder-library.model.d.ts +0 -17
- package/models/report-builder-library.model.js +0 -4
- package/models/report-builder-library.model.js.map +0 -1
- package/models/report-builder-report.model.d.ts +0 -98
- package/models/report-builder-report.model.js +0 -4
- package/models/report-builder-report.model.js.map +0 -1
- package/models/report-builder.model.d.ts +0 -61
- package/models/report-builder.model.js +0 -4
- package/models/report-builder.model.js.map +0 -1
- package/models/select-data-label.model.d.ts +0 -9
- package/models/select-data-label.model.js +0 -4
- package/models/select-data-label.model.js.map +0 -1
- package/models/server-response.model.d.ts +0 -5
- package/models/server-response.model.js +0 -4
- package/models/server-response.model.js.map +0 -1
- package/models/subscription.model.d.ts +0 -23
- package/models/subscription.model.js +0 -4
- package/models/subscription.model.js.map +0 -1
- package/models/support-ticket.model.d.ts +0 -72
- package/models/support-ticket.model.js +0 -4
- package/models/support-ticket.model.js.map +0 -1
- package/models/user-group.model.d.ts +0 -19
- package/models/user-group.model.js +0 -4
- package/models/user-group.model.js.map +0 -1
- package/models/user-guide.model.js +0 -4
- package/models/user-guide.model.js.map +0 -1
- package/models/user.model.d.ts +0 -70
- package/models/user.model.js +0 -4
- package/models/user.model.js.map +0 -1
- package/public_api.js +0 -75
- package/public_api.js.map +0 -1
- package/publications/app-status.d.ts +0 -2
- package/publications/app-status.js +0 -17
- package/publications/app-status.js.map +0 -1
- package/publications/cron-jobs.d.ts +0 -2
- package/publications/cron-jobs.js +0 -33
- package/publications/cron-jobs.js.map +0 -1
- package/publications/files.d.ts +0 -2
- package/publications/files.js +0 -37
- package/publications/files.js.map +0 -1
- package/publications/flags.d.ts +0 -2
- package/publications/flags.js +0 -23
- package/publications/flags.js.map +0 -1
- package/publications/logs.d.ts +0 -2
- package/publications/logs.js +0 -165
- package/publications/logs.js.map +0 -1
- package/publications/method-responses.d.ts +0 -2
- package/publications/method-responses.js +0 -17
- package/publications/method-responses.js.map +0 -1
- package/publications/notifications.d.ts +0 -2
- package/publications/notifications.js +0 -17
- package/publications/notifications.js.map +0 -1
- package/publications/report-builder-dashboard-builders.d.ts +0 -2
- package/publications/report-builder-dashboard-builders.js +0 -43
- package/publications/report-builder-dashboard-builders.js.map +0 -1
- package/publications/report-builder-libraries.d.ts +0 -2
- package/publications/report-builder-libraries.js +0 -90
- package/publications/report-builder-libraries.js.map +0 -1
- package/publications/report-builder-reports.d.ts +0 -2
- package/publications/report-builder-reports.js +0 -51
- package/publications/report-builder-reports.js.map +0 -1
- package/publications/super-admin.d.ts +0 -2
- package/publications/super-admin.js +0 -17
- package/publications/super-admin.js.map +0 -1
- package/publications/user-groups.d.ts +0 -1
- package/publications/user-groups.js +0 -17
- package/publications/user-groups.js.map +0 -1
- package/publications/user-guides.d.ts +0 -1
- package/publications/user-guides.js +0 -17
- package/publications/user-guides.js.map +0 -1
- package/server-app.d.ts +0 -52
- package/server-app.js +0 -739
- package/server-app.js.map +0 -1
- package/util/common.d.ts +0 -24
- package/util/common.js +0 -511
- package/util/common.js.map +0 -1
- package/util/schema-report-builder.d.ts +0 -6
- package/util/schema-report-builder.js +0 -453
- package/util/schema-report-builder.js.map +0 -1
- /package/{private → src/private}/email-templates/enrollment.html +0 -0
- /package/{private → src/private}/email-templates/forgot-password.html +0 -0
- /package/{private → src/private}/email-templates/support-ticket-deleted.html +0 -0
- /package/{private → src/private}/email-templates/support-ticket-modified.html +0 -0
- /package/{private → src/private}/email-templates/support-ticket.html +0 -0
- /package/{private → src/private}/images/ResolveIO.png +0 -0
|
@@ -1,259 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,IAA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AAI,uBAAe,IAAI,uBAAe,CAAC,SAAS,EAAE,EAAE;QACnD,IAAM,KAAK,GAAG,IAAI,iCAAiB,CAAY;YAC9C,cAAc,EAAE,OAAO;YACvB,MAAM,EAAE,MAAM;YACd,oBAAoB,EAAE,IAAI;YAC1B,gBAAgB,EAAE,IAAI;YACtB,yBAAyB,EAAE,EAAE;YAC7B,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,IAAI;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
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
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
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cron/cron.ts"],"names":[],"mappings":"AAAA,IAAI,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;AAE7C,SAAS,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO;IAC9C,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;IACf,IAAI,GAAG,IAAI,GAAG,IAAI,IAAI,EAAE;QACvB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;KAClC;AAEF,CAAC;AAED,cAAc,CAAC,SAAS,CAAC,MAAM,GAAG,UAAS,GAAG;IAC7C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,OAAO,GAAG;IAClC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,GAAG,GAAG,UAAS,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO;IAC9D,IAAI,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,YAAY,IAAI,CAAC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,IAAI,YAAY,QAAQ,EAAE;QAC5G,OAAO,GAAG,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAC7C,IAAI;YACH,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBACnB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;gBACpB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F,CAAC;AAED,SAAS,UAAU,CAAC,GAAG,EAAE,IAAI;IAC5B,IAAI;QACH,IAAI,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC;QACrC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QAEtB,IAAI,CAAC,CAAC,IAAI,YAAY,QAAQ,CAAC,EAAE;YAChC,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"]}
|
package/fixtures/cron-jobs.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function loadServerCronJobs(): Promise<void>;
|
package/fixtures/cron-jobs.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.loadServerCronJobs = void 0;
|
|
40
|
-
var cron_job_collection_1 = require("../collections/cron-job.collection");
|
|
41
|
-
var mongo_manager_1 = require("../managers/mongo.manager");
|
|
42
|
-
function loadServerCronJobs() {
|
|
43
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
44
|
-
var cronJobs;
|
|
45
|
-
return __generator(this, function (_a) {
|
|
46
|
-
switch (_a.label) {
|
|
47
|
-
case 0: return [4 /*yield*/, cron_job_collection_1.CronJobs.find({})];
|
|
48
|
-
case 1:
|
|
49
|
-
cronJobs = _a.sent();
|
|
50
|
-
if (!cronJobs.some(function (a) { return a.name === 'Email Merged Docs Cleanup'; })) {
|
|
51
|
-
cron_job_collection_1.CronJobs.create({
|
|
52
|
-
_id: (0, mongo_manager_1.objectIdHexString)(),
|
|
53
|
-
__v: 0,
|
|
54
|
-
name: 'Email Merged Docs Cleanup',
|
|
55
|
-
repeat: true,
|
|
56
|
-
time_to_run: '0 0 * * *',
|
|
57
|
-
method_run: 'cronEmailMergedDocsCleanUp',
|
|
58
|
-
method_run_data: null,
|
|
59
|
-
next_run: new Date(),
|
|
60
|
-
running: false
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
if (cronJobs.some(function (a) { return a.running; })) {
|
|
64
|
-
cron_job_collection_1.CronJobs.updateMany({ running: true }, { $set: { running: false } });
|
|
65
|
-
}
|
|
66
|
-
return [2 /*return*/];
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
exports.loadServerCronJobs = loadServerCronJobs;
|
|
72
|
-
|
|
73
|
-
//# sourceMappingURL=cron-jobs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/fixtures/cron-jobs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAA8D;AAC9D,2DAA8D;AAE9D,SAAsB,kBAAkB;;;;;wBAExB,qBAAM,8BAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAA;;oBAAlC,QAAQ,GAAG,SAAuB;oBAEtC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,KAAK,2BAA2B,EAAtC,CAAsC,CAAC,EAAE;wBAChE,8BAAQ,CAAC,MAAM,CAAC;4BACf,GAAG,EAAE,IAAA,iCAAiB,GAAE;4BACxB,GAAG,EAAE,CAAC;4BACN,IAAI,EAAG,2BAA2B;4BAClC,MAAM,EAAG,IAAI;4BACb,WAAW,EAAG,WAAW;4BACzB,UAAU,EAAG,4BAA4B;4BACzC,eAAe,EAAG,IAAI;4BACtB,QAAQ,EAAG,IAAI,IAAI,EAAE;4BACrB,OAAO,EAAG,KAAK;yBACf,CAAC,CAAC;qBACH;oBAED,IAAI,QAAQ,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,OAAO,EAAT,CAAS,CAAC,EAAE;wBAClC,8BAAQ,CAAC,UAAU,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,EAAE,EAAC,IAAI,EAAE,EAAC,OAAO,EAAE,KAAK,EAAC,EAAC,CAAC,CAAC;qBAC/D;;;;;CACD;AArBD,gDAqBC","file":"cron-jobs.js","sourcesContent":["import { CronJobs } from '../collections/cron-job.collection';\nimport { objectIdHexString } from '../managers/mongo.manager';\n\nexport async function loadServerCronJobs() {\n\n\tlet cronJobs = await CronJobs.find({});\n\n\tif (!cronJobs.some(a => a.name === 'Email Merged Docs Cleanup')) {\n\t\tCronJobs.create({\n\t\t\t_id: objectIdHexString(),\n\t\t\t__v: 0,\n\t\t\tname : 'Email Merged Docs Cleanup', \n\t\t\trepeat : true, \n\t\t\ttime_to_run : '0 0 * * *', \n\t\t\tmethod_run : 'cronEmailMergedDocsCleanUp', \n\t\t\tmethod_run_data : null, \n\t\t\tnext_run : new Date(), \n\t\t\trunning : false\n\t\t});\n\t}\n\n\tif (cronJobs.some(a => a.running)) {\n\t\tCronJobs.updateMany({running: true}, {$set: {running: false}});\n\t}\n}"]}
|
package/fixtures/init.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function loadServerInit(): Promise<void>;
|
package/fixtures/init.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.loadServerInit = void 0;
|
|
40
|
-
var flag_collection_1 = require("../collections/flag.collection");
|
|
41
|
-
function loadServerInit() {
|
|
42
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
43
|
-
var enableDebugFlag;
|
|
44
|
-
return __generator(this, function (_a) {
|
|
45
|
-
switch (_a.label) {
|
|
46
|
-
case 0: return [4 /*yield*/, flag_collection_1.Flags.findOne({ type: 'Enable Debug' })];
|
|
47
|
-
case 1:
|
|
48
|
-
enableDebugFlag = _a.sent();
|
|
49
|
-
if (!enableDebugFlag) {
|
|
50
|
-
flag_collection_1.Flags.insertOne({ type: 'Enable Debug', value: false });
|
|
51
|
-
}
|
|
52
|
-
return [2 /*return*/];
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
exports.loadServerInit = loadServerInit;
|
|
58
|
-
|
|
59
|
-
//# sourceMappingURL=init.js.map
|
package/fixtures/init.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/fixtures/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kEAAuD;AAEvD,SAAsB,cAAc;;;;;wBACb,qBAAM,uBAAK,CAAC,OAAO,CAAC,EAAC,IAAI,EAAE,cAAc,EAAC,CAAC,EAAA;;oBAA7D,eAAe,GAAG,SAA2C;oBAEjE,IAAI,CAAC,eAAe,EAAE;wBACrB,uBAAK,CAAC,SAAS,CAAC,EAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAC,CAAC,CAAC;qBACtD;;;;;CACD;AAND,wCAMC","file":"init.js","sourcesContent":["import { objectIdHexString } from '../managers/mongo.manager';\nimport { Flags } from '../collections/flag.collection';\n\nexport async function loadServerInit() {\n\tlet enableDebugFlag = await Flags.findOne({type: 'Enable Debug'});\n\n\tif (!enableDebugFlag) {\n\t\tFlags.insertOne({type: 'Enable Debug', value: false});\n\t}\n}"]}
|
package/http/auth.d.ts
DELETED