@resolveio/server-lib 20.11.8 → 20.11.9
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 +2 -2
- package/collections/app-status.collection.js.map +1 -1
- package/collections/counter.collection.js.map +1 -1
- package/collections/cron-job-history.collection.js +2 -2
- package/collections/cron-job-history.collection.js.map +1 -1
- package/collections/cron-job.collection.js.map +1 -1
- package/collections/email-history.collection.js.map +1 -1
- package/collections/email-verified.collection.js.map +1 -1
- package/collections/file.collection.js.map +1 -1
- package/collections/flag-update.collection.js.map +1 -1
- package/collections/flag.collection.js.map +1 -1
- package/collections/log-method-latency.collection.js.map +1 -1
- package/collections/log-subscription.collection.js.map +1 -1
- package/collections/log.collection.js.map +1 -1
- package/collections/logged-in-users.collection.js.map +1 -1
- package/collections/monitor-cpu.collection.js.map +1 -1
- package/collections/monitor-function.collection.js.map +1 -1
- package/collections/monitor-memory.collection.js.map +1 -1
- package/collections/monitor-mongo.collection.js.map +1 -1
- package/collections/notification.collection.js.map +1 -1
- package/collections/report-builder-dashboard-builder.collection.js.map +1 -1
- package/collections/report-builder-library.collection.js.map +1 -1
- package/collections/report-builder-report.collection.js.map +1 -1
- package/collections/user-group.collection.js.map +1 -1
- package/collections/user-guide.collection.js.map +1 -1
- package/collections/user.collection.js.map +1 -1
- package/cron/cron.d.ts +5 -5
- package/cron/cron.js +169 -51
- package/cron/cron.js.map +1 -1
- package/fixtures/cron-jobs.js +3 -4
- package/fixtures/cron-jobs.js.map +1 -1
- package/fixtures/init.js +3 -4
- package/fixtures/init.js.map +1 -1
- package/http/auth.js +13 -14
- package/http/auth.js.map +1 -1
- package/http/health.js +3 -4
- package/http/health.js.map +1 -1
- package/http/home.js +5 -6
- package/http/home.js.map +1 -1
- package/managers/cron.manager.js +95 -59
- package/managers/cron.manager.js.map +1 -1
- package/managers/local-log.manager.js.map +1 -1
- package/managers/method.manager.js +12 -12
- package/managers/method.manager.js.map +1 -1
- package/managers/mongo.manager.d.ts +6 -7
- package/managers/mongo.manager.js +129 -129
- package/managers/mongo.manager.js.map +1 -1
- package/managers/monitor.manager.js +2 -2
- package/managers/monitor.manager.js.map +1 -1
- package/managers/subscription.manager.js +20 -20
- package/managers/subscription.manager.js.map +1 -1
- package/managers/websocket.manager.js.map +1 -1
- package/managers/worker-dispatcher.manager.js.map +1 -1
- package/managers/worker-server.manager.js +6 -6
- package/managers/worker-server.manager.js.map +1 -1
- package/methods/accounts.js +7 -8
- package/methods/accounts.js.map +1 -1
- package/methods/aws.js +3 -4
- package/methods/aws.js.map +1 -1
- package/methods/collections.js +3 -4
- package/methods/collections.js.map +1 -1
- package/methods/counters.js +3 -4
- package/methods/counters.js.map +1 -1
- package/methods/cron-jobs.js +4 -5
- package/methods/cron-jobs.js.map +1 -1
- package/methods/flag-updates.js +1 -2
- package/methods/flag-updates.js.map +1 -1
- package/methods/flags.js +1 -2
- package/methods/flags.js.map +1 -1
- package/methods/logs.js +4 -5
- package/methods/logs.js.map +1 -1
- package/methods/monitor.js +3 -4
- package/methods/monitor.js.map +1 -1
- package/methods/pdf.js +30 -31
- package/methods/pdf.js.map +1 -1
- package/methods/report-builder.js +16 -17
- package/methods/report-builder.js.map +1 -1
- package/methods/support.js +3 -4
- package/methods/support.js.map +1 -1
- package/package.json +57 -59
- package/private/images/ResolveIO.png +0 -0
- package/publications/app-status.js +1 -2
- package/publications/app-status.js.map +1 -1
- package/publications/cron-jobs.js +1 -2
- package/publications/cron-jobs.js.map +1 -1
- package/publications/files.js +1 -2
- package/publications/files.js.map +1 -1
- package/publications/flags-update.js +1 -2
- package/publications/flags-update.js.map +1 -1
- package/publications/flags.js +1 -2
- package/publications/flags.js.map +1 -1
- package/publications/logs.js +1 -2
- package/publications/logs.js.map +1 -1
- package/publications/notifications.js +1 -2
- package/publications/notifications.js.map +1 -1
- package/publications/report-builder-dashboard-builders.js +1 -2
- package/publications/report-builder-dashboard-builders.js.map +1 -1
- package/publications/report-builder-libraries.js +3 -4
- package/publications/report-builder-libraries.js.map +1 -1
- package/publications/report-builder-reports.js +1 -2
- package/publications/report-builder-reports.js.map +1 -1
- package/publications/super-admin.js +1 -2
- package/publications/super-admin.js.map +1 -1
- package/publications/user-groups.js +1 -2
- package/publications/user-groups.js.map +1 -1
- package/publications/user-guides.js +1 -2
- package/publications/user-guides.js.map +1 -1
- package/resolveio-server-app.js +10 -10
- package/resolveio-server-app.js.map +1 -1
- package/server-app.d.ts +0 -1
- package/server-app.js +18 -10
- package/server-app.js.map +1 -1
- package/util/common.js +24 -25
- package/util/common.js.map +1 -1
- package/util/error-reporter.js +3 -3
- package/util/error-reporter.js.map +1 -1
- package/util/error-tracking.js +7 -8
- package/util/error-tracking.js.map +1 -1
- package/util/schema-report-builder.js +7 -8
- package/util/schema-report-builder.js.map +1 -1
- package/util/subscription-dependency-context.js +5 -6
- package/util/subscription-dependency-context.js.map +1 -1
package/cron/cron.js
CHANGED
|
@@ -1,12 +1,58 @@
|
|
|
1
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 = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["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
|
+
};
|
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
39
|
exports.CronJobManager = void 0;
|
|
4
40
|
var cron_1 = require("cron");
|
|
5
41
|
var CronJobManager = /** @class */ (function () {
|
|
6
42
|
function CronJobManager(key, tab, task, onComplete, start, timeZone, context, runOnInit) {
|
|
43
|
+
var _this = this;
|
|
7
44
|
this.jobs = {};
|
|
8
45
|
if (key && tab && task) {
|
|
9
|
-
|
|
46
|
+
setImmediate(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
47
|
+
return __generator(this, function (_a) {
|
|
48
|
+
switch (_a.label) {
|
|
49
|
+
case 0: return [4 /*yield*/, this.add(key, tab, task, onComplete, start, timeZone, context, runOnInit)];
|
|
50
|
+
case 1:
|
|
51
|
+
_a.sent();
|
|
52
|
+
return [2 /*return*/];
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}); });
|
|
10
56
|
}
|
|
11
57
|
}
|
|
12
58
|
CronJobManager.prototype.getJob = function (key) {
|
|
@@ -16,50 +62,87 @@ var CronJobManager = /** @class */ (function () {
|
|
|
16
62
|
return Object.keys(this.jobs);
|
|
17
63
|
};
|
|
18
64
|
CronJobManager.prototype.add = function (key, tab, task, onComplete, start, timeZone, context, runOnInit) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
65
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
66
|
+
var fooBaredByUser_1;
|
|
67
|
+
return __generator(this, function (_a) {
|
|
68
|
+
switch (_a.label) {
|
|
69
|
+
case 0:
|
|
70
|
+
if (!((typeof tab === 'string' || tab instanceof Date) && typeof key === 'string' && task instanceof Function)) return [3 /*break*/, 6];
|
|
71
|
+
_a.label = 1;
|
|
72
|
+
case 1:
|
|
73
|
+
_a.trys.push([1, 4, , 5]);
|
|
74
|
+
if (!this.jobs[key]) return [3 /*break*/, 3];
|
|
75
|
+
return [4 /*yield*/, this.delete(key)];
|
|
76
|
+
case 2:
|
|
77
|
+
_a.sent();
|
|
78
|
+
console.warn("".concat(key, " already existed and was deleted from the manager..."));
|
|
79
|
+
_a.label = 3;
|
|
80
|
+
case 3:
|
|
81
|
+
this.jobs[key] = new cron_1.CronJob(tab, task, onComplete, start, timeZone, context, runOnInit);
|
|
82
|
+
return [3 /*break*/, 5];
|
|
83
|
+
case 4:
|
|
84
|
+
fooBaredByUser_1 = _a.sent();
|
|
85
|
+
console.error("crontab: ".concat(tab, " possibly not valid, job ").concat(key, " not started...").concat(fooBaredByUser_1.message));
|
|
86
|
+
return [3 /*break*/, 5];
|
|
87
|
+
case 5: return [3 /*break*/, 7];
|
|
88
|
+
case 6:
|
|
89
|
+
console.warn("couldn't add: ".concat(key, " improper arguments"));
|
|
90
|
+
_a.label = 7;
|
|
91
|
+
case 7: return [2 /*return*/];
|
|
24
92
|
}
|
|
25
|
-
|
|
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
|
-
}
|
|
93
|
+
});
|
|
94
|
+
});
|
|
34
95
|
};
|
|
35
96
|
CronJobManager.prototype.update = function (key, tab, task, onComplete, start, timeZone, context, runOnInit) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
97
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
98
|
+
var wasRunning, newJob;
|
|
99
|
+
return __generator(this, function (_a) {
|
|
100
|
+
switch (_a.label) {
|
|
101
|
+
case 0:
|
|
102
|
+
// Check if the job exists
|
|
103
|
+
if (!this.jobs[key]) {
|
|
104
|
+
console.warn("Job with key ".concat(key, " does not exist."));
|
|
105
|
+
return [2 /*return*/];
|
|
106
|
+
}
|
|
107
|
+
wasRunning = this.jobs[key].isActive;
|
|
108
|
+
// Stop the existing job
|
|
109
|
+
return [4 /*yield*/, this.jobs[key].stop()];
|
|
110
|
+
case 1:
|
|
111
|
+
// Stop the existing job
|
|
112
|
+
_a.sent();
|
|
113
|
+
newJob = new cron_1.CronJob(tab, task, onComplete, start || wasRunning, timeZone, context, runOnInit);
|
|
114
|
+
delete this.jobs[key];
|
|
115
|
+
// Replace the old job with the new one
|
|
116
|
+
this.jobs[key] = newJob;
|
|
117
|
+
return [2 /*return*/];
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
50
121
|
};
|
|
51
122
|
CronJobManager.prototype.delete = function (key) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
123
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
124
|
+
var err_1;
|
|
125
|
+
return __generator(this, function (_a) {
|
|
126
|
+
switch (_a.label) {
|
|
127
|
+
case 0:
|
|
128
|
+
_a.trys.push([0, 2, , 3]);
|
|
129
|
+
return [4 /*yield*/, this.jobs[key].stop()];
|
|
130
|
+
case 1:
|
|
131
|
+
_a.sent();
|
|
132
|
+
delete this.jobs[key];
|
|
133
|
+
return [3 /*break*/, 3];
|
|
134
|
+
case 2:
|
|
135
|
+
err_1 = _a.sent();
|
|
136
|
+
console.error(new Date(), "Error in CronJobManager (delete): Trying to stop job: ".concat(key, ": ").concat(err_1));
|
|
137
|
+
return [3 /*break*/, 3];
|
|
138
|
+
case 3: return [2 /*return*/];
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
});
|
|
59
142
|
};
|
|
60
143
|
CronJobManager.prototype.start = function (key) {
|
|
61
144
|
try {
|
|
62
|
-
if (this.jobs[key].
|
|
145
|
+
if (this.jobs[key].isActive) {
|
|
63
146
|
console.warn("".concat(key, " job already running"));
|
|
64
147
|
}
|
|
65
148
|
else {
|
|
@@ -71,22 +154,57 @@ var CronJobManager = /** @class */ (function () {
|
|
|
71
154
|
}
|
|
72
155
|
};
|
|
73
156
|
CronJobManager.prototype.stop = function (key) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
157
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
158
|
+
var err_2;
|
|
159
|
+
return __generator(this, function (_a) {
|
|
160
|
+
switch (_a.label) {
|
|
161
|
+
case 0:
|
|
162
|
+
_a.trys.push([0, 4, , 5]);
|
|
163
|
+
if (!!this.jobs[key].isActive) return [3 /*break*/, 1];
|
|
164
|
+
console.warn("".concat(key, " job already stopped"));
|
|
165
|
+
return [3 /*break*/, 3];
|
|
166
|
+
case 1: return [4 /*yield*/, this.jobs[key].stop()];
|
|
167
|
+
case 2:
|
|
168
|
+
_a.sent();
|
|
169
|
+
_a.label = 3;
|
|
170
|
+
case 3: return [3 /*break*/, 5];
|
|
171
|
+
case 4:
|
|
172
|
+
err_2 = _a.sent();
|
|
173
|
+
console.error("couldn't stop job: ".concat(key, ": ").concat(err_2));
|
|
174
|
+
return [3 /*break*/, 5];
|
|
175
|
+
case 5: return [2 /*return*/];
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
});
|
|
85
179
|
};
|
|
86
180
|
CronJobManager.prototype.stopAll = function () {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
181
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
182
|
+
var _a, _b, _c, _i, jobKey;
|
|
183
|
+
return __generator(this, function (_d) {
|
|
184
|
+
switch (_d.label) {
|
|
185
|
+
case 0:
|
|
186
|
+
_a = this.jobs;
|
|
187
|
+
_b = [];
|
|
188
|
+
for (_c in _a)
|
|
189
|
+
_b.push(_c);
|
|
190
|
+
_i = 0;
|
|
191
|
+
_d.label = 1;
|
|
192
|
+
case 1:
|
|
193
|
+
if (!(_i < _b.length)) return [3 /*break*/, 4];
|
|
194
|
+
_c = _b[_i];
|
|
195
|
+
if (!(_c in _a)) return [3 /*break*/, 3];
|
|
196
|
+
jobKey = _c;
|
|
197
|
+
return [4 /*yield*/, this.jobs[jobKey].stop()];
|
|
198
|
+
case 2:
|
|
199
|
+
_d.sent();
|
|
200
|
+
_d.label = 3;
|
|
201
|
+
case 3:
|
|
202
|
+
_i++;
|
|
203
|
+
return [3 /*break*/, 1];
|
|
204
|
+
case 4: return [2 /*return*/];
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
});
|
|
90
208
|
};
|
|
91
209
|
CronJobManager.prototype.exists = function (key) {
|
|
92
210
|
return !!this.jobs[key];
|
package/cron/cron.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cron/cron.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/cron/cron.ts"],"names":[],"mappings":"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","file":"cron.js","sourcesContent":["import { CronCommand, CronJob, CronJobParams, CronOnCompleteCommand } from 'cron';\n\nexport class CronJobManager {\n\tprivate jobs: { [key: string]: CronJob };\n\n constructor(key?: string, tab?: string | Date, task?: CronCommand<any, boolean>, onComplete?: CronOnCompleteCommand, start?: boolean, timeZone?: string, context?: CronJobParams, runOnInit?: boolean) {\n this.jobs = {};\n if (key && tab && task) {\n\t\t\tsetImmediate(async () => {\n\t\t\t\tawait this.add(key, tab, task, onComplete, start, timeZone, context, runOnInit);\n\t\t\t});\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 async add(key: string, tab: string | Date, task: CronCommand<any, boolean>, onComplete?: CronOnCompleteCommand, start?: boolean, timeZone?: string, context?: CronJobParams, runOnInit?: boolean): Promise<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\tawait this.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\tasync update(key: string, tab: string | Date, task: CronCommand<any, boolean>, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean): Promise<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].isActive;\n\t\n\t\t// Stop the existing job\n\t\tawait this.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\tasync delete(key: string) {\n\t\ttry {\n\t\t\tawait this.jobs[key].stop();\n\t\t\tdelete this.jobs[key];\n\t\t}\n\t\tcatch (err) { \n\t\t\tconsole.error(new Date(), `Error in CronJobManager (delete): Trying to stop job: ${key}: ${err}`);\n\t\t}\n\t}\n\n\tstart(key: string) {\n\t\ttry {\n\t\t\tif (this.jobs[key].isActive) {\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\tasync stop(key: string) {\n\t\ttry {\n\t\t\tif (!this.jobs[key].isActive) {\n\t\t\t\tconsole.warn(`${key} job already stopped`);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tawait this.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\tasync stopAll() {\n\t\tfor (let jobKey in this.jobs) {\n\t\t\tawait this.jobs[jobKey].stop();\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
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
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 =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.loadServerCronJobs =
|
|
39
|
+
exports.loadServerCronJobs = loadServerCronJobs;
|
|
40
40
|
var cron_job_collection_1 = require("../collections/cron-job.collection");
|
|
41
41
|
var common_1 = require("../util/common");
|
|
42
42
|
function loadServerCronJobs() {
|
|
@@ -91,6 +91,5 @@ function loadServerCronJobs() {
|
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
exports.loadServerCronJobs = loadServerCronJobs;
|
|
95
94
|
|
|
96
95
|
//# sourceMappingURL=cron-jobs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/fixtures/cron-jobs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/fixtures/cron-jobs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,gDAqCC;AAxCD,0EAA8D;AAC9D,yCAAmD;AAEnD,SAAsB,kBAAkB;;;;;wBAExB,qBAAM,8BAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAA;;oBAAlC,QAAQ,GAAG,SAAuB;yBAElC,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,KAAK,2BAA2B,EAAtC,CAAsC,CAAC,EAA3D,wBAA2D;oBAC9D,qBAAM,8BAAQ,CAAC,MAAM,CAAC;4BACrB,GAAG,EAAE,IAAA,0BAAiB,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;4BACf,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,iBAAiB;yBACpD,CAAC,EAAA;;oBAXF,SAWE,CAAC;;;yBAGA,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,KAAK,gBAAgB,EAA3B,CAA2B,CAAC,EAAhD,wBAAgD;oBACnD,qBAAM,8BAAQ,CAAC,MAAM,CAAC;4BACrB,GAAG,EAAE,IAAA,0BAAiB,GAAE;4BACxB,GAAG,EAAE,CAAC;4BACN,IAAI,EAAG,gBAAgB;4BACvB,MAAM,EAAG,IAAI;4BACb,WAAW,EAAG,aAAa;4BAC3B,UAAU,EAAG,cAAc;4BAC3B,eAAe,EAAG,IAAI;4BACtB,QAAQ,EAAG,IAAI,IAAI,EAAE;4BACrB,OAAO,EAAG,KAAK;4BACf,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,iBAAiB;yBACpD,CAAC,EAAA;;oBAXF,SAWE,CAAC;;;yBAGA,QAAQ,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,OAAO,EAAT,CAAS,CAAC,EAA7B,wBAA6B;oBAChC,qBAAM,8BAAQ,CAAC,UAAU,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,EAAE,EAAC,IAAI,EAAE,EAAC,OAAO,EAAE,KAAK,EAAC,EAAC,CAAC,EAAA;;oBAApE,SAAoE,CAAC;;;;;;CAEtE","file":"cron-jobs.js","sourcesContent":["import { CronJobs } from '../collections/cron-job.collection';\nimport { objectIdHexString } from '../util/common';\n\nexport async function loadServerCronJobs() {\n\t\n\tlet cronJobs = await CronJobs.find({});\n\n\tif (!cronJobs.some(a => a.name === 'Email Merged Docs Cleanup')) {\n\t\tawait CronJobs.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\tawait CronJobs.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\tawait CronJobs.updateMany({running: true}, {$set: {running: false}});\n\t}\n}"]}
|
package/fixtures/init.js
CHANGED
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
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 =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.loadServerInit =
|
|
39
|
+
exports.loadServerInit = loadServerInit;
|
|
40
40
|
var __1 = require("..");
|
|
41
41
|
var resolveio_server_app_1 = require("../resolveio-server-app");
|
|
42
42
|
function loadServerInit() {
|
|
@@ -74,6 +74,5 @@ function loadServerInit() {
|
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
exports.loadServerInit = loadServerInit;
|
|
78
77
|
|
|
79
78
|
//# sourceMappingURL=init.js.map
|
package/fixtures/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/fixtures/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/fixtures/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,wCAiBC;AApBD,wBAA2C;AAC3C,gEAA0D;AAE1D,SAAsB,cAAc;;;;;wBACnC,qBAAM,kBAAc,CAAC,UAAU,CAAC,EAAC,MAAM,EAAE,YAAY,EAAC,EAAE,EAAC,IAAI,EAAE,EAAC,MAAM,EAAE,SAAS,EAAC,EAAC,CAAC,EAAA;;oBAApF,SAAoF,CAAC;oBAE/D,qBAAM,SAAK,CAAC,OAAO,CAAC,EAAC,IAAI,EAAE,cAAc,EAAC,CAAC,EAAA;;oBAA7D,eAAe,GAAG,SAA2C;yBAE7D,CAAC,eAAe,EAAhB,wBAAgB;oBACnB,qBAAM,SAAK,CAAC,SAAS,CAAC,EAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAC,CAAC,EAAA;;oBAA3D,SAA2D,CAAC;;wBAGpC,qBAAM,SAAK,CAAC,OAAO,CAAC,EAAC,IAAI,EAAE,kBAAkB,EAAC,CAAC,EAAA;;oBAApE,kBAAkB,GAAG,SAA+C;yBAEpE,CAAC,kBAAkB,EAAnB,wBAAmB;oBACtB,qBAAM,SAAK,CAAC,SAAS,CAAC,EAAC,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAAK,EAAC,CAAC,EAAA;;oBAA/D,SAA+D,CAAC;;;yBAExD,CAAA,kBAAkB,CAAC,KAAK,IAAI,sCAAe,CAAC,eAAe,EAAE,CAAC,UAAU,CAAC,KAAK,uBAAuB,CAAA,EAArG,wBAAqG;oBAC7G,qBAAM,SAAK,CAAC,SAAS,CAAC,EAAC,GAAG,EAAE,kBAAkB,CAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAE,EAAC,KAAK,EAAE,KAAK,EAAC,EAAC,CAAC,EAAA;;oBAA5E,SAA4E,CAAC;;;;;;CAE9E","file":"init.js","sourcesContent":["import { EmailHistories, Flags } from '..';\nimport { ResolveIOServer } from '../resolveio-server-app';\n\nexport async function loadServerInit() {\n\tawait EmailHistories.updateMany({status: 'processing'}, {$set: {status: 'pending'}});\n\n\tlet enableDebugFlag = await Flags.findOne({type: 'Enable Debug'});\n\n\tif (!enableDebugFlag) {\n\t\tawait Flags.insertOne({type: 'Enable Debug', value: false});\n\t}\n\n\tlet enableDebugFlagPDF = await Flags.findOne({type: 'Enable Debug PDF'});\n\n\tif (!enableDebugFlagPDF) {\n\t\tawait Flags.insertOne({type: 'Enable Debug PDF', value: false});\n\t}\n\telse if (enableDebugFlagPDF.value && ResolveIOServer.getServerConfig()['ROOT_URL'] !== 'http://localhost:4200') {\n\t\tawait Flags.updateOne({_id: enableDebugFlagPDF._id}, {$set: {value: false}});\n\t}\n}"]}
|
package/http/auth.js
CHANGED
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
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 =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -36,8 +36,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.setupAuthRoutes =
|
|
40
|
-
var
|
|
39
|
+
exports.setupAuthRoutes = setupAuthRoutes;
|
|
40
|
+
var express = require("express");
|
|
41
41
|
var handlebars = require("handlebars");
|
|
42
42
|
var jwt = require("jsonwebtoken");
|
|
43
43
|
var jwt_decode_1 = require("jwt-decode");
|
|
@@ -81,7 +81,7 @@ function reportHttpValidationError(route, body, errors) {
|
|
|
81
81
|
}
|
|
82
82
|
function setupAuthRoutes(mainServer, app, serverConfig) {
|
|
83
83
|
var _this = this;
|
|
84
|
-
app.post('/login365',
|
|
84
|
+
app.post('/login365', express.json(), function (request, response) { return __awaiter(_this, void 0, void 0, function () {
|
|
85
85
|
var body, schema, errors_1, tokenData, token, decodedJWT, user, update;
|
|
86
86
|
return __generator(this, function (_a) {
|
|
87
87
|
switch (_a.label) {
|
|
@@ -120,7 +120,7 @@ function setupAuthRoutes(mainServer, app, serverConfig) {
|
|
|
120
120
|
case 6:
|
|
121
121
|
tokenData = body.id_token.split('&');
|
|
122
122
|
token = tokenData[0].split('=')[1];
|
|
123
|
-
decodedJWT = (0, jwt_decode_1.
|
|
123
|
+
decodedJWT = (0, jwt_decode_1.jwtDecode)(token);
|
|
124
124
|
if (!(decodedJWT && decodedJWT['name'] && decodedJWT['preferred_username'] && decodedJWT['oid'])) return [3 /*break*/, 15];
|
|
125
125
|
return [4 /*yield*/, user_collection_1.Users.findOne({ 'other.ms_oid': decodedJWT['oid'] })];
|
|
126
126
|
case 7:
|
|
@@ -208,7 +208,7 @@ function setupAuthRoutes(mainServer, app, serverConfig) {
|
|
|
208
208
|
});
|
|
209
209
|
}); });
|
|
210
210
|
// Login via HTTP, return refresh token if authenticated
|
|
211
|
-
app.post('/login',
|
|
211
|
+
app.post('/login', express.json(), function (request, response) { return __awaiter(_this, void 0, void 0, function () {
|
|
212
212
|
var body, schema, errors_2, user, resAuth, emailData, html, template, emailData, html, template;
|
|
213
213
|
return __generator(this, function (_a) {
|
|
214
214
|
switch (_a.label) {
|
|
@@ -345,7 +345,7 @@ function setupAuthRoutes(mainServer, app, serverConfig) {
|
|
|
345
345
|
}
|
|
346
346
|
});
|
|
347
347
|
}); });
|
|
348
|
-
app.post('/accessToken',
|
|
348
|
+
app.post('/accessToken', express.json(), function (request, response) { return __awaiter(_this, void 0, void 0, function () {
|
|
349
349
|
var body, schema, errors_3;
|
|
350
350
|
var _this = this;
|
|
351
351
|
return __generator(this, function (_a) {
|
|
@@ -441,7 +441,7 @@ function setupAuthRoutes(mainServer, app, serverConfig) {
|
|
|
441
441
|
}
|
|
442
442
|
});
|
|
443
443
|
}); });
|
|
444
|
-
app.post('/userWithEnrollmentToken',
|
|
444
|
+
app.post('/userWithEnrollmentToken', express.json(), function (request, response) { return __awaiter(_this, void 0, void 0, function () {
|
|
445
445
|
var body_1, schema, errors_4;
|
|
446
446
|
var _this = this;
|
|
447
447
|
return __generator(this, function (_a) {
|
|
@@ -539,7 +539,7 @@ function setupAuthRoutes(mainServer, app, serverConfig) {
|
|
|
539
539
|
}
|
|
540
540
|
});
|
|
541
541
|
}); });
|
|
542
|
-
app.post('/setUserWithEnrollmentToken',
|
|
542
|
+
app.post('/setUserWithEnrollmentToken', express.json(), function (request, response) { return __awaiter(_this, void 0, void 0, function () {
|
|
543
543
|
var body_2, schema, errors_5;
|
|
544
544
|
var _this = this;
|
|
545
545
|
return __generator(this, function (_a) {
|
|
@@ -641,7 +641,7 @@ function setupAuthRoutes(mainServer, app, serverConfig) {
|
|
|
641
641
|
}
|
|
642
642
|
});
|
|
643
643
|
}); });
|
|
644
|
-
app.post('/userWithForgotPasswordToken',
|
|
644
|
+
app.post('/userWithForgotPasswordToken', express.json(), function (request, response) { return __awaiter(_this, void 0, void 0, function () {
|
|
645
645
|
var body_3, schema, errors_6;
|
|
646
646
|
var _this = this;
|
|
647
647
|
return __generator(this, function (_a) {
|
|
@@ -739,7 +739,7 @@ function setupAuthRoutes(mainServer, app, serverConfig) {
|
|
|
739
739
|
}
|
|
740
740
|
});
|
|
741
741
|
}); });
|
|
742
|
-
app.post('/setUserWithForgotPasswordToken',
|
|
742
|
+
app.post('/setUserWithForgotPasswordToken', express.json(), function (request, response) { return __awaiter(_this, void 0, void 0, function () {
|
|
743
743
|
var body_4, schema, errors_7;
|
|
744
744
|
var _this = this;
|
|
745
745
|
return __generator(this, function (_a) {
|
|
@@ -841,7 +841,7 @@ function setupAuthRoutes(mainServer, app, serverConfig) {
|
|
|
841
841
|
}
|
|
842
842
|
});
|
|
843
843
|
}); });
|
|
844
|
-
app.post('/resetPassword',
|
|
844
|
+
app.post('/resetPassword', express.json(), function (request, response) { return __awaiter(_this, void 0, void 0, function () {
|
|
845
845
|
var body, schema, errors_8, user;
|
|
846
846
|
return __generator(this, function (_a) {
|
|
847
847
|
switch (_a.label) {
|
|
@@ -899,6 +899,5 @@ function setupAuthRoutes(mainServer, app, serverConfig) {
|
|
|
899
899
|
});
|
|
900
900
|
}); });
|
|
901
901
|
}
|
|
902
|
-
exports.setupAuthRoutes = setupAuthRoutes;
|
|
903
902
|
|
|
904
903
|
//# sourceMappingURL=auth.js.map
|