@resolveio/server-lib 20.0.27 → 20.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client-server-app.js +1 -47
- package/client-server-app.js.map +1 -1
- package/collections/app-status.collection.js +1 -50
- package/collections/app-status.collection.js.map +1 -1
- package/collections/counter.collection.js +1 -53
- package/collections/counter.collection.js.map +1 -1
- package/collections/cron-job-history.collection.js +1 -88
- package/collections/cron-job-history.collection.js.map +1 -1
- package/collections/cron-job.collection.js +1 -84
- package/collections/cron-job.collection.js.map +1 -1
- package/collections/email-history.collection.js +1 -65
- package/collections/email-history.collection.js.map +1 -1
- package/collections/email-verified.collection.js +1 -60
- package/collections/email-verified.collection.js.map +1 -1
- package/collections/file.collection.js +1 -72
- package/collections/file.collection.js.map +1 -1
- package/collections/flag.collection.js +1 -55
- package/collections/flag.collection.js.map +1 -1
- package/collections/log-method-latency.collection.js +1 -63
- package/collections/log-method-latency.collection.js.map +1 -1
- package/collections/log-subscription.collection.js +1 -67
- package/collections/log-subscription.collection.js.map +1 -1
- package/collections/log-ts.collection.js +1 -77
- package/collections/log-ts.collection.js.map +1 -1
- package/collections/log.collection.js +1 -76
- package/collections/log.collection.js.map +1 -1
- package/collections/logged-in-users.collection.js +1 -64
- package/collections/logged-in-users.collection.js.map +1 -1
- package/collections/method-response.collection.js +1 -65
- package/collections/method-response.collection.js.map +1 -1
- package/collections/monitor-cpu.collection.js +1 -62
- package/collections/monitor-cpu.collection.js.map +1 -1
- package/collections/monitor-memory.collection.js +1 -74
- package/collections/monitor-memory.collection.js.map +1 -1
- package/collections/monitor-mongo.collection.js +1 -68
- package/collections/monitor-mongo.collection.js.map +1 -1
- package/collections/notification.collection.js +1 -55
- package/collections/notification.collection.js.map +1 -1
- package/collections/report-builder-dashboard-builder.collection.js +1 -108
- package/collections/report-builder-dashboard-builder.collection.js.map +1 -1
- package/collections/report-builder-library.collection.js +1 -86
- package/collections/report-builder-library.collection.js.map +1 -1
- package/collections/report-builder-report.collection.js +1 -148
- package/collections/report-builder-report.collection.js.map +1 -1
- package/collections/user-group.collection.js +1 -93
- package/collections/user-group.collection.js.map +1 -1
- package/collections/user-guide.collection.js +1 -56
- package/collections/user-guide.collection.js.map +1 -1
- package/collections/user.collection.js +1 -265
- package/collections/user.collection.js.map +1 -1
- package/cron/cron.js +1 -101
- package/cron/cron.js.map +1 -1
- package/fixtures/cron-jobs.js +1 -87
- package/fixtures/cron-jobs.js.map +1 -1
- package/fixtures/init.js +1 -58
- package/fixtures/init.js.map +1 -1
- package/http/auth.js +1 -763
- package/http/auth.js.map +1 -1
- package/http/health.js +1 -11
- package/http/health.js.map +1 -1
- package/http/home.js +1 -65
- package/http/home.js.map +1 -1
- package/index.js +1 -126
- package/index.js.map +1 -1
- package/managers/cron.manager.js +1 -322
- package/managers/cron.manager.js.map +1 -1
- package/managers/method.manager.js +1 -593
- package/managers/method.manager.js.map +1 -1
- package/managers/mongo.manager.js +1 -2259
- package/managers/mongo.manager.js.map +1 -1
- package/managers/monitor.manager.js +1 -350
- package/managers/monitor.manager.js.map +1 -1
- package/managers/subscription.manager.js +1 -1110
- package/managers/subscription.manager.js.map +1 -1
- package/managers/subscription.performance.js +1 -102
- package/managers/subscription.performance.js.map +1 -1
- package/methods/accounts.js +1 -291
- package/methods/accounts.js.map +1 -1
- package/methods/aws.js +1 -634
- package/methods/aws.js.map +1 -1
- package/methods/collections.js +1 -499
- package/methods/collections.js.map +1 -1
- package/methods/counters.js +1 -121
- package/methods/counters.js.map +1 -1
- package/methods/cron-jobs.js +1 -1337
- package/methods/cron-jobs.js.map +1 -1
- package/methods/flags.js +1 -8
- package/methods/flags.js.map +1 -1
- package/methods/logs.js +1 -370
- package/methods/logs.js.map +1 -1
- package/methods/monitor.js +1 -564
- package/methods/monitor.js.map +1 -1
- package/methods/pdf.js +1 -731
- package/methods/pdf.js.map +1 -1
- package/methods/report-builder.js +1 -859
- package/methods/report-builder.js.map +1 -1
- package/methods/support.js +1 -245
- package/methods/support.js.map +1 -1
- package/models/app-status.model.js +1 -3
- package/models/app-status.model.js.map +1 -1
- package/models/billing-logged-in-users.model.js +1 -3
- package/models/billing-logged-in-users.model.js.map +1 -1
- package/models/collection-document.model.js +1 -3
- package/models/collection-document.model.js.map +1 -1
- package/models/counter.model.js +1 -3
- package/models/counter.model.js.map +1 -1
- package/models/cron-job-history.model.js +1 -3
- package/models/cron-job-history.model.js.map +1 -1
- package/models/cron-job.model.js +1 -3
- package/models/cron-job.model.js.map +1 -1
- package/models/dialog.model.js +1 -3
- package/models/dialog.model.js.map +1 -1
- package/models/email-history.model.js +1 -3
- package/models/email-history.model.js.map +1 -1
- package/models/email-verified.model.js +1 -3
- package/models/email-verified.model.js.map +1 -1
- package/models/file.model.js +1 -3
- package/models/file.model.js.map +1 -1
- package/models/flag.model.js +1 -3
- package/models/flag.model.js.map +1 -1
- package/models/log-method-latency.model.js +1 -3
- package/models/log-method-latency.model.js.map +1 -1
- package/models/log-subscription.model.js +1 -3
- package/models/log-subscription.model.js.map +1 -1
- package/models/log.model.js +1 -3
- package/models/log.model.js.map +1 -1
- package/models/logged-in-users.model.js +1 -3
- package/models/logged-in-users.model.js.map +1 -1
- package/models/method-response.model.js +1 -3
- package/models/method-response.model.js.map +1 -1
- package/models/method.model.js +1 -3
- package/models/method.model.js.map +1 -1
- package/models/monitor-cpu.model.js +1 -3
- package/models/monitor-cpu.model.js.map +1 -1
- package/models/monitor-memory.model.js +1 -3
- package/models/monitor-memory.model.js.map +1 -1
- package/models/monitor-mongo.model.js +1 -3
- package/models/monitor-mongo.model.js.map +1 -1
- package/models/notification.model.js +1 -3
- package/models/notification.model.js.map +1 -1
- package/models/pagination.model.js +1 -23
- package/models/pagination.model.js.map +1 -1
- package/models/permission.model.js +1 -3
- package/models/permission.model.js.map +1 -1
- package/models/report-builder-dashboard-builder.model.js +1 -3
- package/models/report-builder-dashboard-builder.model.js.map +1 -1
- package/models/report-builder-library.model.js +1 -3
- package/models/report-builder-library.model.js.map +1 -1
- package/models/report-builder-report.model.js +1 -3
- package/models/report-builder-report.model.js.map +1 -1
- package/models/report-builder.model.js +1 -3
- package/models/report-builder.model.js.map +1 -1
- package/models/select-data-label.model.js +1 -3
- package/models/select-data-label.model.js.map +1 -1
- package/models/server-response.model.js +1 -3
- package/models/server-response.model.js.map +1 -1
- package/models/subscription.model.js +1 -3
- package/models/subscription.model.js.map +1 -1
- package/models/support-ticket.model.js +1 -3
- package/models/support-ticket.model.js.map +1 -1
- package/models/user-group.model.js +1 -3
- package/models/user-group.model.js.map +1 -1
- package/models/user-guide.model.js +1 -3
- package/models/user-guide.model.js.map +1 -1
- package/models/user.model.js +1 -3
- package/models/user.model.js.map +1 -1
- package/package.json +6 -4
- package/public_api.js +1 -74
- package/public_api.js.map +1 -1
- package/publications/app-status.js +1 -16
- package/publications/app-status.js.map +1 -1
- package/publications/cron-jobs.js +1 -32
- package/publications/cron-jobs.js.map +1 -1
- package/publications/files.js +1 -36
- package/publications/files.js.map +1 -1
- package/publications/flags.js +1 -22
- package/publications/flags.js.map +1 -1
- package/publications/logs.js +1 -164
- package/publications/logs.js.map +1 -1
- package/publications/method-responses.js +1 -16
- package/publications/method-responses.js.map +1 -1
- package/publications/notifications.js +1 -16
- package/publications/notifications.js.map +1 -1
- package/publications/report-builder-dashboard-builders.js +1 -42
- package/publications/report-builder-dashboard-builders.js.map +1 -1
- package/publications/report-builder-libraries.js +1 -89
- package/publications/report-builder-libraries.js.map +1 -1
- package/publications/report-builder-reports.js +1 -50
- package/publications/report-builder-reports.js.map +1 -1
- package/publications/super-admin.js +1 -16
- package/publications/super-admin.js.map +1 -1
- package/publications/user-groups.js +1 -16
- package/publications/user-groups.js.map +1 -1
- package/publications/user-guides.js +1 -16
- package/publications/user-guides.js.map +1 -1
- package/server-app.js +1 -770
- package/server-app.js.map +1 -1
- package/util/common.js +1 -546
- package/util/common.js.map +1 -1
- package/util/schema-report-builder.js +1 -452
- package/util/schema-report-builder.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collections/user-guide.collection.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../src/collections/user-guide.collection.ts"],"names":["index_1","require","mongo_manager_1","schema","_id","type","String","optional","__v","Number","updatedAt","Date","createdAt","link","label","message","initializeCollection","model","ResolveIOServer","getMainDB","MongoManagerModel","collectionName","useVersionCollection","useReportBuilder","reportBuilderLookupTables","timestamps","createLogs","checkSchema","collectionOptions","exports","UserGuides","collection_main","setTimeout"],"mappings":"8FAAA,IAAAA,QAAAC,QAAA,UAAA,EACAC,gBAAAD,QAAA,2BAAA,EAGIE,OAAc,CACjBC,IAAK,CACJC,KAAMC,OACNC,SAAU,CAAA,C,EAEXC,IAAK,CACJH,KAAMI,OACNF,SAAU,CAAA,C,EAEXG,UAAW,CACVL,KAAMM,KACNJ,SAAU,CAAA,C,EAEXK,UAAW,CACVP,KAAMM,KACNJ,SAAU,CAAA,C,EAEXM,KAAM,CACLR,KAAMC,M,EAEPQ,MAAO,CACNT,KAAMC,M,EAEPS,QAAS,CACRV,KAAMC,M,GAQR,SAASU,uBACR,IACOC,EADHjB,QAAAkB,iBAAmBlB,QAAAkB,gBAAgBC,UAAS,GACzCF,EAAQ,IAAIf,gBAAAkB,kBAAkC,CACnDC,eAAgB,cAChBlB,OAAQA,OACRmB,qBAAsB,CAAA,EACtBC,iBAAkB,CAAA,EAClBC,0BAA2B,GAC3BC,WAAY,CAAA,EACZC,WAAY,CAAA,EACZC,YAAa,CAAA,EACbC,kBAAmB,I,CACnB,EACDC,QAAAC,WAAab,EAAMc,iBAGnBC,WAAW,WACVhB,qBAAoB,CACrB,EAAG,CAAC,CAEN,CAxBWa,QAAAC,WAAqD,KAEhEd,qBAAoB","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}"]}
|
|
@@ -1,266 +1,2 @@
|
|
|
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.$.yards': {
|
|
69
|
-
type: Array,
|
|
70
|
-
optional: true
|
|
71
|
-
},
|
|
72
|
-
'roles.groups.$.yards.$': {
|
|
73
|
-
type: String
|
|
74
|
-
},
|
|
75
|
-
'roles.notifications': {
|
|
76
|
-
type: Array
|
|
77
|
-
},
|
|
78
|
-
'roles.notifications.$': {
|
|
79
|
-
type: String
|
|
80
|
-
},
|
|
81
|
-
'roles.miscs': {
|
|
82
|
-
type: Array
|
|
83
|
-
},
|
|
84
|
-
'roles.miscs.$': {
|
|
85
|
-
type: String
|
|
86
|
-
},
|
|
87
|
-
username: {
|
|
88
|
-
type: String,
|
|
89
|
-
optional: true
|
|
90
|
-
},
|
|
91
|
-
email: {
|
|
92
|
-
type: String,
|
|
93
|
-
optional: true
|
|
94
|
-
},
|
|
95
|
-
fullname: {
|
|
96
|
-
type: String
|
|
97
|
-
},
|
|
98
|
-
active: {
|
|
99
|
-
type: Boolean
|
|
100
|
-
},
|
|
101
|
-
phonenumber: {
|
|
102
|
-
type: String,
|
|
103
|
-
optional: true
|
|
104
|
-
},
|
|
105
|
-
readonly: {
|
|
106
|
-
type: Boolean,
|
|
107
|
-
optional: true
|
|
108
|
-
},
|
|
109
|
-
other: {
|
|
110
|
-
type: Object,
|
|
111
|
-
blackbox: true
|
|
112
|
-
},
|
|
113
|
-
settings: {
|
|
114
|
-
type: Object,
|
|
115
|
-
optional: true
|
|
116
|
-
},
|
|
117
|
-
'settings.table_color': {
|
|
118
|
-
type: String
|
|
119
|
-
},
|
|
120
|
-
'settings.table_font_color': {
|
|
121
|
-
type: String
|
|
122
|
-
},
|
|
123
|
-
'settings.secondary_table_color': {
|
|
124
|
-
type: String
|
|
125
|
-
},
|
|
126
|
-
'settings.secondary_table_font_color': {
|
|
127
|
-
type: String
|
|
128
|
-
},
|
|
129
|
-
'settings.tertiary_table_color': {
|
|
130
|
-
type: String
|
|
131
|
-
},
|
|
132
|
-
'settings.tertiary_table_font_color': {
|
|
133
|
-
type: String
|
|
134
|
-
},
|
|
135
|
-
'settings.font_size': {
|
|
136
|
-
type: Number
|
|
137
|
-
},
|
|
138
|
-
'settings.collapsable_menu': {
|
|
139
|
-
type: Boolean
|
|
140
|
-
},
|
|
141
|
-
'settings.entries_per_page': {
|
|
142
|
-
type: String
|
|
143
|
-
},
|
|
144
|
-
'settings.warning_color': {
|
|
145
|
-
type: String
|
|
146
|
-
},
|
|
147
|
-
'settings.warning_font_color': {
|
|
148
|
-
type: String
|
|
149
|
-
},
|
|
150
|
-
'settings.warning_hover_color': {
|
|
151
|
-
type: String
|
|
152
|
-
},
|
|
153
|
-
'settings.success_color': {
|
|
154
|
-
type: String
|
|
155
|
-
},
|
|
156
|
-
'settings.success_font_color': {
|
|
157
|
-
type: String
|
|
158
|
-
},
|
|
159
|
-
'settings.success_hover_color': {
|
|
160
|
-
type: String
|
|
161
|
-
},
|
|
162
|
-
'settings.danger_color': {
|
|
163
|
-
type: String
|
|
164
|
-
},
|
|
165
|
-
'settings.danger_font_color': {
|
|
166
|
-
type: String
|
|
167
|
-
},
|
|
168
|
-
'settings.danger_hover_color': {
|
|
169
|
-
type: String
|
|
170
|
-
},
|
|
171
|
-
'settings.info_color': {
|
|
172
|
-
type: String
|
|
173
|
-
},
|
|
174
|
-
'settings.info_font_color': {
|
|
175
|
-
type: String
|
|
176
|
-
},
|
|
177
|
-
'settings.info_hover_color': {
|
|
178
|
-
type: String
|
|
179
|
-
},
|
|
180
|
-
'settings.primary_color': {
|
|
181
|
-
type: String
|
|
182
|
-
},
|
|
183
|
-
'settings.primary_font_color': {
|
|
184
|
-
type: String
|
|
185
|
-
},
|
|
186
|
-
'settings.primary_hover_color': {
|
|
187
|
-
type: String
|
|
188
|
-
},
|
|
189
|
-
'settings.secondary_color': {
|
|
190
|
-
type: String
|
|
191
|
-
},
|
|
192
|
-
'settings.secondary_font_color': {
|
|
193
|
-
type: String
|
|
194
|
-
},
|
|
195
|
-
'settings.secondary_hover_color': {
|
|
196
|
-
type: String
|
|
197
|
-
},
|
|
198
|
-
'settings.routing_preference': {
|
|
199
|
-
type: String
|
|
200
|
-
},
|
|
201
|
-
'settings.opening_route': {
|
|
202
|
-
type: String
|
|
203
|
-
},
|
|
204
|
-
salt: {
|
|
205
|
-
type: String
|
|
206
|
-
},
|
|
207
|
-
hash: {
|
|
208
|
-
type: String
|
|
209
|
-
},
|
|
210
|
-
attempts: {
|
|
211
|
-
type: Number
|
|
212
|
-
},
|
|
213
|
-
last: {
|
|
214
|
-
type: Date,
|
|
215
|
-
optional: true
|
|
216
|
-
},
|
|
217
|
-
services: {
|
|
218
|
-
type: Object,
|
|
219
|
-
optional: true
|
|
220
|
-
},
|
|
221
|
-
'services.enrollment': {
|
|
222
|
-
type: String,
|
|
223
|
-
optional: true
|
|
224
|
-
},
|
|
225
|
-
'services.forgot_password': {
|
|
226
|
-
type: String,
|
|
227
|
-
optional: true
|
|
228
|
-
},
|
|
229
|
-
'services.reset_password': {
|
|
230
|
-
type: String,
|
|
231
|
-
optional: true
|
|
232
|
-
},
|
|
233
|
-
is_customer: {
|
|
234
|
-
type: Boolean,
|
|
235
|
-
optional: true
|
|
236
|
-
}
|
|
237
|
-
};
|
|
238
|
-
exports.Users = null;
|
|
239
|
-
exports.UserVersions = null;
|
|
240
|
-
initializeCollection();
|
|
241
|
-
function initializeCollection() {
|
|
242
|
-
if (index_1.ResolveIOServer && index_1.ResolveIOServer.getMainDB()) {
|
|
243
|
-
var model = new mongo_manager_1.MongoManagerModel({
|
|
244
|
-
collectionName: 'users',
|
|
245
|
-
schema: schema,
|
|
246
|
-
useVersionCollection: true,
|
|
247
|
-
useReportBuilder: true,
|
|
248
|
-
reportBuilderLookupTables: [],
|
|
249
|
-
timestamps: true,
|
|
250
|
-
createLogs: true,
|
|
251
|
-
checkSchema: true,
|
|
252
|
-
collectionOptions: null
|
|
253
|
-
});
|
|
254
|
-
exports.Users = model.collection_main;
|
|
255
|
-
exports.Users.createIndex({ fullname: 1 });
|
|
256
|
-
exports.Users.createIndex({ active: 1 });
|
|
257
|
-
exports.UserVersions = model.collection_version;
|
|
258
|
-
}
|
|
259
|
-
else {
|
|
260
|
-
setTimeout(function () {
|
|
261
|
-
initializeCollection();
|
|
262
|
-
}, 1);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserVersions=exports.Users=void 0;var index_1=require("../index"),mongo_manager_1=require("../managers/mongo.manager"),schema={_id:{type:String,optional:!0},__v:{type:Number,optional:!0},updatedAt:{type:Date,optional:!0},createdAt:{type:Date,optional:!0},roles:{type:Object},"roles.super_admin":{type:Boolean},"roles.approvals":{type:Array},"roles.approvals.$":{type:Object},"roles.approvals.$.type":{type:String},"roles.approvals.$.key_1":{type:String,optional:!0},"roles.approvals.$.key_2":{type:String,optional:!0},"roles.approvals.$.key_3":{type:String,optional:!0},"roles.approvals.$.name":{type:String},"roles.groups":{type:Array},"roles.groups.$":{type:Object},"roles.groups.$.name":{type:String},"roles.groups.$.views":{type:Array},"roles.groups.$.views.$":{type:String},"roles.groups.$.yards":{type:Array,optional:!0},"roles.groups.$.yards.$":{type:String},"roles.notifications":{type:Array},"roles.notifications.$":{type:String},"roles.miscs":{type:Array},"roles.miscs.$":{type:String},username:{type:String,optional:!0},email:{type:String,optional:!0},fullname:{type:String},active:{type:Boolean},phonenumber:{type:String,optional:!0},readonly:{type:Boolean,optional:!0},other:{type:Object,blackbox:!0},settings:{type:Object,optional:!0},"settings.table_color":{type:String},"settings.table_font_color":{type:String},"settings.secondary_table_color":{type:String},"settings.secondary_table_font_color":{type:String},"settings.tertiary_table_color":{type:String},"settings.tertiary_table_font_color":{type:String},"settings.font_size":{type:Number},"settings.collapsable_menu":{type:Boolean},"settings.entries_per_page":{type:String},"settings.warning_color":{type:String},"settings.warning_font_color":{type:String},"settings.warning_hover_color":{type:String},"settings.success_color":{type:String},"settings.success_font_color":{type:String},"settings.success_hover_color":{type:String},"settings.danger_color":{type:String},"settings.danger_font_color":{type:String},"settings.danger_hover_color":{type:String},"settings.info_color":{type:String},"settings.info_font_color":{type:String},"settings.info_hover_color":{type:String},"settings.primary_color":{type:String},"settings.primary_font_color":{type:String},"settings.primary_hover_color":{type:String},"settings.secondary_color":{type:String},"settings.secondary_font_color":{type:String},"settings.secondary_hover_color":{type:String},"settings.routing_preference":{type:String},"settings.opening_route":{type:String},salt:{type:String},hash:{type:String},attempts:{type:Number},last:{type:Date,optional:!0},services:{type:Object,optional:!0},"services.enrollment":{type:String,optional:!0},"services.forgot_password":{type:String,optional:!0},"services.reset_password":{type:String,optional:!0},is_customer:{type:Boolean,optional:!0}};function initializeCollection(){var e;index_1.ResolveIOServer&&index_1.ResolveIOServer.getMainDB()?(e=new mongo_manager_1.MongoManagerModel({collectionName:"users",schema:schema,useVersionCollection:!0,useReportBuilder:!0,reportBuilderLookupTables:[],timestamps:!0,createLogs:!0,checkSchema:!0,collectionOptions:null}),exports.Users=e.collection_main,exports.Users.createIndex({fullname:1}),exports.Users.createIndex({active:1}),exports.UserVersions=e.collection_version):setTimeout(function(){initializeCollection()},1)}exports.Users=null,exports.UserVersions=null,initializeCollection();
|
|
266
2
|
//# sourceMappingURL=user.collection.js.map
|
|
@@ -1 +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;IACD,wBAAwB,EAAE;QACzB,IAAI,EAAE,MAAM;KACZ;IACD,yBAAyB,EAAE;QAC1B,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,yBAAyB,EAAE;QAC1B,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,yBAAyB,EAAE;QAC1B,IA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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.$.yards': {\n\t\ttype: Array,\n\t\toptional: true\n\t},\n\t'roles.groups.$.yards.$': {\n\t\ttype: String\n\t},\n\t'roles.notifications': {\n\t\ttype: Array\n\t},\n\t'roles.notifications.$': {\n\t\ttype: String\n\t},\n\t'roles.miscs': {\n\t\ttype: Array\n\t},\n\t'roles.miscs.$': {\n\t\ttype: String\n\t},\n\tusername: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\temail: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tfullname: {\n\t\ttype: String\n\t},\n\tactive: {\n\t\ttype: Boolean\n\t},\n\tphonenumber: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\treadonly: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t},\n\tother: {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tsettings: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'settings.table_color': {\n\t\ttype: String\n\t},\n\t'settings.table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.font_size': {\n\t\ttype: Number\n\t},\n\t'settings.collapsable_menu': {\n\t\ttype: Boolean\n\t},\n\t'settings.entries_per_page': {\n\t\ttype: String\n\t},\n\t'settings.warning_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_font_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.success_color': {\n\t\ttype: String\n\t},\n\t'settings.success_font_color': {\n\t\ttype: String\n\t},\n\t'settings.success_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_font_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.info_color': {\n\t\ttype: String\n\t},\n\t'settings.info_font_color': {\n\t\ttype: String\n\t},\n\t'settings.info_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.routing_preference': {\n\t\ttype: String\n\t},\n\t'settings.opening_route': {\n\t\ttype: String\n\t},\n\tsalt: {\n\t\ttype: String\n\t},\n\thash: {\n\t\ttype: String\n\t},\n\tattempts: {\n\t\ttype: Number\n\t},\n\tlast: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tservices: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'services.enrollment': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.forgot_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.reset_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tis_customer: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t}\n};\n\nexport let Users: MongoManagerUserCollection<UserModel> = null;\nexport let UserVersions: MongoManagerUserCollection<UserModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB()) {\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}"]}
|
|
1
|
+
{"version":3,"sources":["../../src/collections/user.collection.ts"],"names":["index_1","require","mongo_manager_1","schema","_id","type","String","optional","__v","Number","updatedAt","Date","createdAt","roles","Object","roles.super_admin","Boolean","roles.approvals","Array","roles.approvals.$","roles.approvals.$.type","roles.approvals.$.key_1","roles.approvals.$.key_2","roles.approvals.$.key_3","roles.approvals.$.name","roles.groups","roles.groups.$","roles.groups.$.name","roles.groups.$.views","roles.groups.$.views.$","roles.groups.$.yards","roles.groups.$.yards.$","roles.notifications","roles.notifications.$","roles.miscs","roles.miscs.$","username","email","fullname","active","phonenumber","readonly","other","blackbox","settings","settings.table_color","settings.table_font_color","settings.secondary_table_color","settings.secondary_table_font_color","settings.tertiary_table_color","settings.tertiary_table_font_color","settings.font_size","settings.collapsable_menu","settings.entries_per_page","settings.warning_color","settings.warning_font_color","settings.warning_hover_color","settings.success_color","settings.success_font_color","settings.success_hover_color","settings.danger_color","settings.danger_font_color","settings.danger_hover_color","settings.info_color","settings.info_font_color","settings.info_hover_color","settings.primary_color","settings.primary_font_color","settings.primary_hover_color","settings.secondary_color","settings.secondary_font_color","settings.secondary_hover_color","settings.routing_preference","settings.opening_route","salt","hash","attempts","last","services","services.enrollment","services.forgot_password","services.reset_password","is_customer","initializeCollection","model","ResolveIOServer","getMainDB","MongoManagerModel","collectionName","useVersionCollection","useReportBuilder","reportBuilderLookupTables","timestamps","createLogs","checkSchema","collectionOptions","exports","Users","collection_main","createIndex","UserVersions","collection_version","setTimeout"],"mappings":"8GAAA,IAAAA,QAAAC,QAAA,UAAA,EACAC,gBAAAD,QAAA,2BAAA,EAGIE,OAAc,CACjBC,IAAK,CACJC,KAAMC,OACNC,SAAU,CAAA,C,EAEXC,IAAK,CACJH,KAAMI,OACNF,SAAU,CAAA,C,EAEXG,UAAW,CACVL,KAAMM,KACNJ,SAAU,CAAA,C,EAEXK,UAAW,CACVP,KAAMM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0E,0BAA2B,CAC1B5E,KAAMC,OACNC,SAAU,CAAA,C,EAEX2E,YAAa,CACZ7E,KAAMW,QACNT,SAAU,CAAA,C,GASZ,SAAS4E,uBACR,IACOC,EADHpF,QAAAqF,iBAAmBrF,QAAAqF,gBAAgBC,UAAS,GACzCF,EAAQ,IAAIlF,gBAAAqF,kBAA6B,CAC9CC,eAAgB,QAChBrF,OAAQA,OACRsF,qBAAsB,CAAA,EACtBC,iBAAkB,CAAA,EAClBC,0BAA2B,GAC3BC,WAAY,CAAA,EACZC,WAAY,CAAA,EACZC,YAAa,CAAA,EACbC,kBAAmB,I,CACnB,EACDC,QAAAC,MAA+Cb,EAAMc,gBACrDF,QAAAC,MAAME,YAAY,CAAC7D,SAAU,CAAC,CAAC,EAC/B0D,QAAAC,MAAME,YAAY,CAAC5D,OAAQ,CAAC,CAAC,EAC7ByD,QAAAI,aAAsDhB,EAAMiB,oBAG5DC,WAAW,WACVnB,qBAAoB,CACrB,EAAG,CAAC,CAEN,CA5BWa,QAAAC,MAA+C,KAC/CD,QAAAI,aAAsD,KAEjEjB,qBAAoB","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.$.yards': {\n\t\ttype: Array,\n\t\toptional: true\n\t},\n\t'roles.groups.$.yards.$': {\n\t\ttype: String\n\t},\n\t'roles.notifications': {\n\t\ttype: Array\n\t},\n\t'roles.notifications.$': {\n\t\ttype: String\n\t},\n\t'roles.miscs': {\n\t\ttype: Array\n\t},\n\t'roles.miscs.$': {\n\t\ttype: String\n\t},\n\tusername: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\temail: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tfullname: {\n\t\ttype: String\n\t},\n\tactive: {\n\t\ttype: Boolean\n\t},\n\tphonenumber: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\treadonly: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t},\n\tother: {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tsettings: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'settings.table_color': {\n\t\ttype: String\n\t},\n\t'settings.table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.font_size': {\n\t\ttype: Number\n\t},\n\t'settings.collapsable_menu': {\n\t\ttype: Boolean\n\t},\n\t'settings.entries_per_page': {\n\t\ttype: String\n\t},\n\t'settings.warning_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_font_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.success_color': {\n\t\ttype: String\n\t},\n\t'settings.success_font_color': {\n\t\ttype: String\n\t},\n\t'settings.success_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_font_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.info_color': {\n\t\ttype: String\n\t},\n\t'settings.info_font_color': {\n\t\ttype: String\n\t},\n\t'settings.info_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.routing_preference': {\n\t\ttype: String\n\t},\n\t'settings.opening_route': {\n\t\ttype: String\n\t},\n\tsalt: {\n\t\ttype: String\n\t},\n\thash: {\n\t\ttype: String\n\t},\n\tattempts: {\n\t\ttype: Number\n\t},\n\tlast: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tservices: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'services.enrollment': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.forgot_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.reset_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tis_customer: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t}\n};\n\nexport let Users: MongoManagerUserCollection<UserModel> = null;\nexport let UserVersions: MongoManagerUserCollection<UserModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB()) {\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.js
CHANGED
|
@@ -1,102 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CronJobManager = void 0;
|
|
4
|
-
var cron_1 = require("cron");
|
|
5
|
-
var CronJobManager = /** @class */ (function () {
|
|
6
|
-
function CronJobManager(key, tab, task, onComplete, start, timeZone, context, runOnInit) {
|
|
7
|
-
this.jobs = {};
|
|
8
|
-
if (key && tab && task) {
|
|
9
|
-
this.add(key, tab, task, onComplete, start, timeZone, context, runOnInit);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
CronJobManager.prototype.getJob = function (key) {
|
|
13
|
-
return this.jobs[key];
|
|
14
|
-
};
|
|
15
|
-
CronJobManager.prototype.getJobs = function () {
|
|
16
|
-
return Object.keys(this.jobs);
|
|
17
|
-
};
|
|
18
|
-
CronJobManager.prototype.add = function (key, tab, task, onComplete, start, timeZone, context, runOnInit) {
|
|
19
|
-
if ((typeof tab === 'string' || tab instanceof Date) && typeof key === 'string' && task instanceof Function) {
|
|
20
|
-
try {
|
|
21
|
-
if (this.jobs[key]) {
|
|
22
|
-
this.delete(key);
|
|
23
|
-
console.warn("".concat(key, " already existed and was deleted from the manager..."));
|
|
24
|
-
}
|
|
25
|
-
this.jobs[key] = new cron_1.CronJob(tab, task, onComplete, start, timeZone, context, runOnInit);
|
|
26
|
-
}
|
|
27
|
-
catch (fooBaredByUser) {
|
|
28
|
-
console.error("crontab: ".concat(tab, " possibly not valid, job ").concat(key, " not started...").concat(fooBaredByUser.message));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
console.warn("couldn't add: ".concat(key, " improper arguments"));
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
CronJobManager.prototype.update = function (key, tab, task, onComplete, start, timeZone, context, runOnInit) {
|
|
36
|
-
// Check if the job exists
|
|
37
|
-
if (!this.jobs[key]) {
|
|
38
|
-
console.warn("Job with key ".concat(key, " does not exist."));
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
// Store the running state
|
|
42
|
-
var wasRunning = this.jobs[key].running;
|
|
43
|
-
// Stop the existing job
|
|
44
|
-
this.jobs[key].stop();
|
|
45
|
-
// Create a new job instance with the updated properties
|
|
46
|
-
var newJob = new cron_1.CronJob(tab, task, onComplete, start || wasRunning, timeZone, context, runOnInit);
|
|
47
|
-
delete this.jobs[key];
|
|
48
|
-
// Replace the old job with the new one
|
|
49
|
-
this.jobs[key] = newJob;
|
|
50
|
-
};
|
|
51
|
-
CronJobManager.prototype.delete = function (key) {
|
|
52
|
-
try {
|
|
53
|
-
this.jobs[key].stop();
|
|
54
|
-
delete this.jobs[key];
|
|
55
|
-
}
|
|
56
|
-
catch (err) {
|
|
57
|
-
console.error(new Date(), "error in trying to stop job: ".concat(key, ": ").concat(err));
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
CronJobManager.prototype.start = function (key) {
|
|
61
|
-
try {
|
|
62
|
-
if (this.jobs[key].running) {
|
|
63
|
-
console.warn("".concat(key, " job already running"));
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
this.jobs[key].start();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
catch (err) {
|
|
70
|
-
console.error("couldn't start job: ".concat(key, ": ").concat(err));
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
CronJobManager.prototype.stop = function (key) {
|
|
74
|
-
try {
|
|
75
|
-
if (!this.jobs[key].running) {
|
|
76
|
-
console.warn("".concat(key, " job already stopped"));
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
this.jobs[key].stop();
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
catch (err) {
|
|
83
|
-
console.error("couldn't stop job: ".concat(key, ": ").concat(err));
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
CronJobManager.prototype.stopAll = function () {
|
|
87
|
-
for (var jobKey in this.jobs) {
|
|
88
|
-
try {
|
|
89
|
-
this.jobs[jobKey].stop();
|
|
90
|
-
}
|
|
91
|
-
catch (err) {
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
CronJobManager.prototype.exists = function (key) {
|
|
96
|
-
return !!this.jobs[key];
|
|
97
|
-
};
|
|
98
|
-
return CronJobManager;
|
|
99
|
-
}());
|
|
100
|
-
exports.CronJobManager = CronJobManager;
|
|
101
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CronJobManager=void 0;var cron_1=require("cron"),CronJobManager=function(){function o(o,t,n,e,r,s,c,a){this.jobs={},o&&t&&n&&this.add(o,t,n,e,r,s,c,a)}return o.prototype.getJob=function(o){return this.jobs[o]},o.prototype.getJobs=function(){return Object.keys(this.jobs)},o.prototype.add=function(t,n,o,e,r,s,c,a){if(("string"==typeof n||n instanceof Date)&&"string"==typeof t&&o instanceof Function)try{this.jobs[t]&&(this.delete(t),console.warn("".concat(t," already existed and was deleted from the manager..."))),this.jobs[t]=new cron_1.CronJob(n,o,e,r,s,c,a)}catch(o){console.error("crontab: ".concat(n," possibly not valid, job ").concat(t," not started...").concat(o.message))}else console.warn("couldn't add: ".concat(t," improper arguments"))},o.prototype.update=function(o,t,n,e,r,s,c,a){var i;this.jobs[o]?(i=this.jobs[o].running,this.jobs[o].stop(),t=new cron_1.CronJob(t,n,e,r||i,s,c,a),delete this.jobs[o],this.jobs[o]=t):console.warn("Job with key ".concat(o," does not exist."))},o.prototype.delete=function(t){try{this.jobs[t].stop(),delete this.jobs[t]}catch(o){console.error(new Date,"error in trying to stop job: ".concat(t,": ").concat(o))}},o.prototype.start=function(t){try{this.jobs[t].running?console.warn("".concat(t," job already running")):this.jobs[t].start()}catch(o){console.error("couldn't start job: ".concat(t,": ").concat(o))}},o.prototype.stop=function(t){try{this.jobs[t].running?this.jobs[t].stop():console.warn("".concat(t," job already stopped"))}catch(o){console.error("couldn't stop job: ".concat(t,": ").concat(o))}},o.prototype.stopAll=function(){for(var o in this.jobs)try{this.jobs[o].stop()}catch(o){}},o.prototype.exists=function(o){return!!this.jobs[o]},o}();exports.CronJobManager=CronJobManager;
|
|
102
2
|
//# sourceMappingURL=cron.js.map
|
package/cron/cron.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cron/cron.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../src/cron/cron.ts"],"names":["cron_1","require","CronJobManager","key","tab","task","onComplete","start","timeZone","context","runOnInit","this","jobs","add","prototype","getJob","getJobs","Object","keys","Date","Function","delete","console","warn","concat","CronJob","fooBaredByUser","error","message","update","wasRunning","running","stop","newJob","err","stopAll","jobKey","exists","exports"],"mappings":"kGAAA,IAAAA,OAAAC,QAAA,MAAA,EAEAC,eAAA,WAGI,SAAAA,EAAYC,EAAcC,EAAqBC,EAAkCC,EAAoCC,EAAiBC,EAAmBC,EAAyBC,GAC9KC,KAAKC,KAAO,GACRT,GAAOC,GAAOC,GACdM,KAAKE,IAAIV,EAAKC,EAAKC,EAAMC,EAAYC,EAAOC,EAAUC,EAASC,CAAS,CAEhF,CA6GJ,OA3GIR,EAAAY,UAAAC,OAAA,SAAOZ,GACH,OAAOQ,KAAKC,KAAKT,EACrB,E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AIR,KAAQ,gCAAAK,OAAgCrB,EAAG,IAAA,EAAAqB,OAAKU,CAAG,CAAE,C,CAEzE,EAEAhC,EAAAY,UAAAP,MAAA,SAAMJ,GACL,IACKQ,KAAKC,KAAKT,GAAK4B,QAClBT,QAAQC,KAAK,GAAAC,OAAGrB,EAAG,sBAAA,CAAsB,EAGzCQ,KAAKC,KAAKT,GAAKI,MAAK,C,CAGtB,MAAO2B,GACNZ,QAAQK,MAAM,uBAAAH,OAAuBrB,EAAG,IAAA,EAAAqB,OAAKU,CAAG,CAAE,C,CAEpD,EAEAhC,EAAAY,UAAAkB,KAAA,SAAK7B,GACJ,IACMQ,KAAKC,KAAKT,GAAK4B,QAInBpB,KAAKC,KAAKT,GAAK6B,KAAI,EAHnBV,QAAQC,KAAK,GAAAC,OAAGrB,EAAG,sBAAA,CAAsB,C,CAM3C,MAAO+B,GACNZ,QAAQK,MAAM,sBAAAH,OAAsBrB,EAAG,IAAA,EAAAqB,OAAKU,CAAG,CAAE,C,CAEnD,EAEAhC,EAAAY,UAAAqB,QAAA,WACC,IAAK,IAAIC,KAAUzB,KAAKC,KACvB,IACCD,KAAKC,KAAKwB,GAAQJ,KAAI,C,CAEvB,MAAOE,IAIT,EAEAhC,EAAAY,UAAAuB,OAAA,SAAOlC,GACN,MAAO,CAAC,CAACQ,KAAKC,KAAKT,EACpB,EACDD,CAAA,EAAC,EArHYoC,QAAApC,eAAAA","file":"cron.js","sourcesContent":["import { CronJob, CronCommand, CronTime, CronOnCompleteCommand, CronJobParams } from 'cron';\n\nexport class CronJobManager {\n\tprivate jobs: { [key: string]: CronJob };\n\n constructor(key?: string, tab?: string | Date, task?: CronCommand<any, boolean>, onComplete?: CronOnCompleteCommand, start?: boolean, timeZone?: string, context?: CronJobParams, runOnInit?: boolean) {\n this.jobs = {};\n if (key && tab && task) {\n this.add(key, tab, task, onComplete, start, timeZone, context, runOnInit);\n }\n }\n\n getJob(key: string): CronJob {\n return this.jobs[key];\n }\n\n getJobs(): string[] {\n return Object.keys(this.jobs);\n }\n\n add(key: string, tab: string | Date, task: CronCommand<any, boolean>, onComplete?: CronOnCompleteCommand, start?: boolean, timeZone?: string, context?: CronJobParams, runOnInit?: boolean): void {\n\t\tif ((typeof tab === 'string' || tab instanceof Date) && typeof key === 'string' && task instanceof Function) {\n\t\t\ttry {\n\t\t\t\tif (this.jobs[key]) {\n\t\t\t\t\tthis.delete(key);\n\t\t\t\t\tconsole.warn(`${key} already existed and was deleted from the manager...`);\n\t\t\t\t}\n\t\t\t\tthis.jobs[key] = new CronJob(tab, task, onComplete, start, timeZone, context, runOnInit);\n\t\t\t} catch (fooBaredByUser) {\n\t\t\t\tconsole.error(`crontab: ${tab} possibly not valid, job ${key} not started...${fooBaredByUser.message}`);\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.warn(`couldn't add: ${key} improper arguments`);\n\t\t}\n\t}\n\n\tupdate(key: string, tab: string | Date, task: CronCommand<any, boolean>, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean): void {\n\t\t// Check if the job exists\n\t\tif (!this.jobs[key]) {\n\t\t\tconsole.warn(`Job with key ${key} does not exist.`);\n\t\t\treturn;\n\t\t}\n\n\t\t// Store the running state\n\t\tconst wasRunning = this.jobs[key].running;\n\t\n\t\t// Stop the existing job\n\t\tthis.jobs[key].stop();\n\t\n\t\t// Create a new job instance with the updated properties\n\t\tconst newJob = new CronJob(\n\t\t\ttab,\n\t\t\ttask,\n\t\t\tonComplete,\n\t\t\tstart || wasRunning,\n\t\t\ttimeZone,\n\t\t\tcontext,\n\t\t\trunOnInit\n\t\t);\n\n\t\tdelete this.jobs[key];\n\t\n\t\t// Replace the old job with the new one\n\t\tthis.jobs[key] = newJob;\n\t}\n\t\n\t\n\tdelete(key: string) {\n\t\ttry {\n\t\t\tthis.jobs[key].stop();\n\t\t\tdelete this.jobs[key];\n\t\t}\n\t\tcatch (err) { \n\t\t\tconsole.error(new Date(), `error in trying to stop job: ${key}: ${err}`);\n\t\t}\n\t}\n\n\tstart(key: string) {\n\t\ttry {\n\t\t\tif (this.jobs[key].running) {\n\t\t\t\tconsole.warn(`${key} job already running`);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.jobs[key].start();\n\t\t\t}\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.error(`couldn't start job: ${key}: ${err}`);\n\t\t}\n\t}\n\n\tstop(key: string) {\n\t\ttry {\n\t\t\tif (!this.jobs[key].running ) {\n\t\t\t\tconsole.warn(`${key} job already stopped`);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.jobs[key].stop();\n\t\t\t}\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.error(`couldn't stop job: ${key}: ${err}`);\n\t\t}\n\t}\n\n\tstopAll() {\n\t\tfor (let jobKey in this.jobs) {\n\t\t\ttry {\n\t\t\t\tthis.jobs[jobKey].stop();\n\t\t\t}\n\t\t\tcatch (err) {\n\t\n\t\t\t}\n\t\t}\n\t}\n\n\texists(key: string) {\n\t\treturn !!this.jobs[key];\n\t}\n}"]}
|
package/fixtures/cron-jobs.js
CHANGED
|
@@ -1,88 +1,2 @@
|
|
|
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
|
-
timezone: process.env.TZ_CLIENT || 'America/Chicago'
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
if (!cronJobs.some(function (a) { return a.name === 'Stuck Cron Job'; })) {
|
|
65
|
-
cron_job_collection_1.CronJobs.create({
|
|
66
|
-
_id: (0, mongo_manager_1.objectIdHexString)(),
|
|
67
|
-
__v: 0,
|
|
68
|
-
name: 'Stuck Cron Job',
|
|
69
|
-
repeat: true,
|
|
70
|
-
time_to_run: '*/5 * * * *',
|
|
71
|
-
method_run: 'stuckCronJob',
|
|
72
|
-
method_run_data: null,
|
|
73
|
-
next_run: new Date(),
|
|
74
|
-
running: false,
|
|
75
|
-
timezone: process.env.TZ_CLIENT || 'America/Chicago'
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
if (cronJobs.some(function (a) { return a.running; })) {
|
|
79
|
-
cron_job_collection_1.CronJobs.updateMany({ running: true }, { $set: { running: false } });
|
|
80
|
-
}
|
|
81
|
-
return [2 /*return*/];
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
exports.loadServerCronJobs = loadServerCronJobs;
|
|
87
|
-
|
|
1
|
+
"use strict";var __awaiter=this&&this.__awaiter||function(e,i,c,u){return new(c=c||Promise)(function(o,n){function r(e){try{a(u.next(e))}catch(e){n(e)}}function t(e){try{a(u.throw(e))}catch(e){n(e)}}function a(e){var n;e.done?o(e.value):((n=e.value)instanceof c?n:new c(function(e){e(n)})).then(r,t)}a((u=u.apply(e,i||[])).next())})},__generator=this&&this.__generator||function(r,t){var a,i,c,u={label:0,sent:function(){if(1&c[0])throw c[1];return c[1]},trys:[],ops:[]},l={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function e(o){return function(e){var n=[o,e];if(a)throw new TypeError("Generator is already executing.");for(;u=l&&n[l=0]?0:u;)try{if(a=1,i&&(c=2&n[0]?i.return:n[0]?i.throw||((c=i.return)&&c.call(i),0):i.next)&&!(c=c.call(i,n[1])).done)return c;switch(i=0,(n=c?[2&n[0],c.value]:n)[0]){case 0:case 1:c=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,i=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(!(c=0<(c=u.trys).length&&c[c.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!c||n[1]>c[0]&&n[1]<c[3]))u.label=n[1];else if(6===n[0]&&u.label<c[1])u.label=c[1],c=n;else{if(!(c&&u.label<c[2])){c[2]&&u.ops.pop(),u.trys.pop();continue}u.label=c[2],u.ops.push(n)}}n=t.call(r,u)}catch(e){n=[6,e],i=0}finally{a=c=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}}},cron_job_collection_1=(Object.defineProperty(exports,"__esModule",{value:!0}),exports.loadServerCronJobs=void 0,require("../collections/cron-job.collection")),mongo_manager_1=require("../managers/mongo.manager");function loadServerCronJobs(){return __awaiter(this,void 0,void 0,function(){var n;return __generator(this,function(e){switch(e.label){case 0:return[4,cron_job_collection_1.CronJobs.find({})];case 1:return(n=e.sent()).some(function(e){return"Email Merged Docs Cleanup"===e.name})||cron_job_collection_1.CronJobs.create({_id:(0,mongo_manager_1.objectIdHexString)(),__v:0,name:"Email Merged Docs Cleanup",repeat:!0,time_to_run:"0 0 * * *",method_run:"cronEmailMergedDocsCleanUp",method_run_data:null,next_run:new Date,running:!1,timezone:process.env.TZ_CLIENT||"America/Chicago"}),n.some(function(e){return"Stuck Cron Job"===e.name})||cron_job_collection_1.CronJobs.create({_id:(0,mongo_manager_1.objectIdHexString)(),__v:0,name:"Stuck Cron Job",repeat:!0,time_to_run:"*/5 * * * *",method_run:"stuckCronJob",method_run_data:null,next_run:new Date,running:!1,timezone:process.env.TZ_CLIENT||"America/Chicago"}),n.some(function(e){return e.running})&&cron_job_collection_1.CronJobs.updateMany({running:!0},{$set:{running:!1}}),[2]}})})}exports.loadServerCronJobs=loadServerCronJobs;
|
|
88
2
|
//# sourceMappingURL=cron-jobs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/fixtures/cron-jobs.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../src/fixtures/cron-jobs.ts"],"names":["cron_job_collection_1","require","mongo_manager_1","loadServerCronJobs","CronJobs","find","cronJobs","_a","sent","some","a","name","create","_id","objectIdHexString","__v","repeat","time_to_run","method_run","method_run_data","next_run","Date","running","timezone","process","env","TZ_CLIENT","updateMany","$set","exports"],"mappings":"44CAAAA,uB,yFAAAC,QAAA,oCAAA,GACAC,gBAAAD,QAAA,2BAAA,EAEA,SAAsBE,qB,gHAEN,MAAA,CAAA,EAAMH,sBAAAI,SAASC,KAAK,EAAE,G,cAAjCC,EAAWC,EAAAC,KAAA,GAEDC,KAAK,SAAAC,GAAK,MAAW,8BAAXA,EAAEC,IAAF,CAAsC,GAC7DX,sBAAAI,SAASQ,OAAO,CACfC,KAAK,EAAAX,gBAAAY,mBAAiB,EACtBC,IAAK,EACLJ,KAAO,4BACPK,OAAS,CAAA,EACTC,YAAc,YACdC,WAAa,6BACbC,gBAAkB,KAClBC,SAAW,IAAIC,KACfC,QAAU,CAAA,EACVC,SAAUC,QAAQC,IAAIC,WAAa,iB,CACnC,EAGGpB,EAASG,KAAK,SAAAC,GAAK,MAAW,mBAAXA,EAAEC,IAAF,CAA2B,GAClDX,sBAAAI,SAASQ,OAAO,CACfC,KAAK,EAAAX,gBAAAY,mBAAiB,EACtBC,IAAK,EACLJ,KAAO,iBACPK,OAAS,CAAA,EACTC,YAAc,cACdC,WAAa,eACbC,gBAAkB,KAClBC,SAAW,IAAIC,KACfC,QAAU,CAAA,EACVC,SAAUC,QAAQC,IAAIC,WAAa,iB,CACnC,EAGEpB,EAASG,KAAK,SAAAC,GAAK,OAAAA,EAAEY,OAAF,CAAS,GAC/BtB,sBAAAI,SAASuB,WAAW,CAACL,QAAS,CAAA,CAAI,EAAG,CAACM,KAAM,CAACN,QAAS,CAAA,CAAK,CAAC,CAAC,E,SAnC/DO,QAAA1B,mBAAAA","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\ttimezone: process.env.TZ_CLIENT || 'America/Chicago'\n\t\t});\n\t}\n\n\tif (!cronJobs.some(a => a.name === 'Stuck Cron Job')) {\n\t\tCronJobs.create({\n\t\t\t_id: objectIdHexString(),\n\t\t\t__v: 0,\n\t\t\tname : 'Stuck Cron Job', \n\t\t\trepeat : true, \n\t\t\ttime_to_run : '*/5 * * * *', \n\t\t\tmethod_run : 'stuckCronJob', \n\t\t\tmethod_run_data : null, \n\t\t\tnext_run : new Date(), \n\t\t\trunning : false,\n\t\t\ttimezone: process.env.TZ_CLIENT || 'America/Chicago'\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}"]}
|