getpatter 0.5.2 → 0.5.3
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/README.md +5 -5
- package/dist/{banner-FLR2HE5Z.mjs → banner-3GNZ6VQK.mjs} +1 -1
- package/dist/{carrier-config-CPG5CROM.mjs → carrier-config-33HQ2W4V.mjs} +2 -2
- package/dist/{chunk-7SDDK2AO.mjs → chunk-FIFIWBL7.mjs} +3255 -588
- package/dist/chunk-QHHBUCMT.mjs +25 -0
- package/dist/{chunk-AKQFOFLG.mjs → chunk-SEMKNPCD.mjs} +7 -2
- package/dist/{chunk-FMNRCP5X.mjs → chunk-VJVDG4V5.mjs} +1 -1
- package/dist/cli.js +126 -13
- package/dist/dist-YRCCJQ26.mjs +1631 -0
- package/dist/index.d.mts +2000 -289
- package/dist/index.d.ts +2000 -289
- package/dist/index.js +7944 -1927
- package/dist/index.mjs +1881 -617
- package/dist/node-cron-6PRPSBG5.mjs +1348 -0
- package/dist/onnxruntime_binding-4Q2WV26X.node +0 -0
- package/dist/onnxruntime_binding-5PVQ7RFC.node +0 -0
- package/dist/onnxruntime_binding-FNOPH2XG.node +0 -0
- package/dist/onnxruntime_binding-HSGOY4IT.node +0 -0
- package/dist/onnxruntime_binding-OY2N3XIT.node +0 -0
- package/dist/onnxruntime_binding-ZPEJPBCV.node +0 -0
- package/dist/{persistence-CYIGNHSU.mjs → persistence-LQBYQPQQ.mjs} +1 -1
- package/dist/test-mode-MVJ3SKG4.mjs +8 -0
- package/dist/tunnel-UVR3PPAU.mjs +8 -0
- package/package.json +10 -3
- package/dist/chunk-OOIUSZB4.mjs +0 -37
- package/dist/node-cron-373UVDIO.mjs +0 -935
- package/dist/test-mode-K2TTPRGE.mjs +0 -8
- package/dist/tunnel-O7ICMSTP.mjs +0 -8
|
@@ -1,935 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__commonJS,
|
|
3
|
-
__esm,
|
|
4
|
-
__export,
|
|
5
|
-
__require,
|
|
6
|
-
__toCommonJS
|
|
7
|
-
} from "./chunk-OOIUSZB4.mjs";
|
|
8
|
-
|
|
9
|
-
// node_modules/node-cron/src/task.js
|
|
10
|
-
var require_task = __commonJS({
|
|
11
|
-
"node_modules/node-cron/src/task.js"(exports, module) {
|
|
12
|
-
"use strict";
|
|
13
|
-
var EventEmitter = __require("events");
|
|
14
|
-
var Task = class extends EventEmitter {
|
|
15
|
-
constructor(execution) {
|
|
16
|
-
super();
|
|
17
|
-
if (typeof execution !== "function") {
|
|
18
|
-
throw "execution must be a function";
|
|
19
|
-
}
|
|
20
|
-
this._execution = execution;
|
|
21
|
-
}
|
|
22
|
-
execute(now) {
|
|
23
|
-
let exec;
|
|
24
|
-
try {
|
|
25
|
-
exec = this._execution(now);
|
|
26
|
-
} catch (error) {
|
|
27
|
-
return this.emit("task-failed", error);
|
|
28
|
-
}
|
|
29
|
-
if (exec instanceof Promise) {
|
|
30
|
-
return exec.then(() => this.emit("task-finished")).catch((error) => this.emit("task-failed", error));
|
|
31
|
-
} else {
|
|
32
|
-
this.emit("task-finished");
|
|
33
|
-
return exec;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
module.exports = Task;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
// node_modules/node-cron/src/convert-expression/month-names-conversion.js
|
|
42
|
-
var require_month_names_conversion = __commonJS({
|
|
43
|
-
"node_modules/node-cron/src/convert-expression/month-names-conversion.js"(exports, module) {
|
|
44
|
-
"use strict";
|
|
45
|
-
module.exports = /* @__PURE__ */ (() => {
|
|
46
|
-
const months = [
|
|
47
|
-
"january",
|
|
48
|
-
"february",
|
|
49
|
-
"march",
|
|
50
|
-
"april",
|
|
51
|
-
"may",
|
|
52
|
-
"june",
|
|
53
|
-
"july",
|
|
54
|
-
"august",
|
|
55
|
-
"september",
|
|
56
|
-
"october",
|
|
57
|
-
"november",
|
|
58
|
-
"december"
|
|
59
|
-
];
|
|
60
|
-
const shortMonths = [
|
|
61
|
-
"jan",
|
|
62
|
-
"feb",
|
|
63
|
-
"mar",
|
|
64
|
-
"apr",
|
|
65
|
-
"may",
|
|
66
|
-
"jun",
|
|
67
|
-
"jul",
|
|
68
|
-
"aug",
|
|
69
|
-
"sep",
|
|
70
|
-
"oct",
|
|
71
|
-
"nov",
|
|
72
|
-
"dec"
|
|
73
|
-
];
|
|
74
|
-
function convertMonthName(expression, items) {
|
|
75
|
-
for (let i = 0; i < items.length; i++) {
|
|
76
|
-
expression = expression.replace(new RegExp(items[i], "gi"), parseInt(i, 10) + 1);
|
|
77
|
-
}
|
|
78
|
-
return expression;
|
|
79
|
-
}
|
|
80
|
-
function interprete(monthExpression) {
|
|
81
|
-
monthExpression = convertMonthName(monthExpression, months);
|
|
82
|
-
monthExpression = convertMonthName(monthExpression, shortMonths);
|
|
83
|
-
return monthExpression;
|
|
84
|
-
}
|
|
85
|
-
return interprete;
|
|
86
|
-
})();
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
// node_modules/node-cron/src/convert-expression/week-day-names-conversion.js
|
|
91
|
-
var require_week_day_names_conversion = __commonJS({
|
|
92
|
-
"node_modules/node-cron/src/convert-expression/week-day-names-conversion.js"(exports, module) {
|
|
93
|
-
"use strict";
|
|
94
|
-
module.exports = /* @__PURE__ */ (() => {
|
|
95
|
-
const weekDays = [
|
|
96
|
-
"sunday",
|
|
97
|
-
"monday",
|
|
98
|
-
"tuesday",
|
|
99
|
-
"wednesday",
|
|
100
|
-
"thursday",
|
|
101
|
-
"friday",
|
|
102
|
-
"saturday"
|
|
103
|
-
];
|
|
104
|
-
const shortWeekDays = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
|
|
105
|
-
function convertWeekDayName(expression, items) {
|
|
106
|
-
for (let i = 0; i < items.length; i++) {
|
|
107
|
-
expression = expression.replace(new RegExp(items[i], "gi"), parseInt(i, 10));
|
|
108
|
-
}
|
|
109
|
-
return expression;
|
|
110
|
-
}
|
|
111
|
-
function convertWeekDays(expression) {
|
|
112
|
-
expression = expression.replace("7", "0");
|
|
113
|
-
expression = convertWeekDayName(expression, weekDays);
|
|
114
|
-
return convertWeekDayName(expression, shortWeekDays);
|
|
115
|
-
}
|
|
116
|
-
return convertWeekDays;
|
|
117
|
-
})();
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
// node_modules/node-cron/src/convert-expression/asterisk-to-range-conversion.js
|
|
122
|
-
var require_asterisk_to_range_conversion = __commonJS({
|
|
123
|
-
"node_modules/node-cron/src/convert-expression/asterisk-to-range-conversion.js"(exports, module) {
|
|
124
|
-
"use strict";
|
|
125
|
-
module.exports = /* @__PURE__ */ (() => {
|
|
126
|
-
function convertAsterisk(expression, replecement) {
|
|
127
|
-
if (expression.indexOf("*") !== -1) {
|
|
128
|
-
return expression.replace("*", replecement);
|
|
129
|
-
}
|
|
130
|
-
return expression;
|
|
131
|
-
}
|
|
132
|
-
function convertAsterisksToRanges(expressions) {
|
|
133
|
-
expressions[0] = convertAsterisk(expressions[0], "0-59");
|
|
134
|
-
expressions[1] = convertAsterisk(expressions[1], "0-59");
|
|
135
|
-
expressions[2] = convertAsterisk(expressions[2], "0-23");
|
|
136
|
-
expressions[3] = convertAsterisk(expressions[3], "1-31");
|
|
137
|
-
expressions[4] = convertAsterisk(expressions[4], "1-12");
|
|
138
|
-
expressions[5] = convertAsterisk(expressions[5], "0-6");
|
|
139
|
-
return expressions;
|
|
140
|
-
}
|
|
141
|
-
return convertAsterisksToRanges;
|
|
142
|
-
})();
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
// node_modules/node-cron/src/convert-expression/range-conversion.js
|
|
147
|
-
var require_range_conversion = __commonJS({
|
|
148
|
-
"node_modules/node-cron/src/convert-expression/range-conversion.js"(exports, module) {
|
|
149
|
-
"use strict";
|
|
150
|
-
module.exports = /* @__PURE__ */ (() => {
|
|
151
|
-
function replaceWithRange(expression, text, init, end) {
|
|
152
|
-
const numbers = [];
|
|
153
|
-
let last = parseInt(end);
|
|
154
|
-
let first = parseInt(init);
|
|
155
|
-
if (first > last) {
|
|
156
|
-
last = parseInt(init);
|
|
157
|
-
first = parseInt(end);
|
|
158
|
-
}
|
|
159
|
-
for (let i = first; i <= last; i++) {
|
|
160
|
-
numbers.push(i);
|
|
161
|
-
}
|
|
162
|
-
return expression.replace(new RegExp(text, "i"), numbers.join());
|
|
163
|
-
}
|
|
164
|
-
function convertRange(expression) {
|
|
165
|
-
const rangeRegEx = /(\d+)-(\d+)/;
|
|
166
|
-
let match = rangeRegEx.exec(expression);
|
|
167
|
-
while (match !== null && match.length > 0) {
|
|
168
|
-
expression = replaceWithRange(expression, match[0], match[1], match[2]);
|
|
169
|
-
match = rangeRegEx.exec(expression);
|
|
170
|
-
}
|
|
171
|
-
return expression;
|
|
172
|
-
}
|
|
173
|
-
function convertAllRanges(expressions) {
|
|
174
|
-
for (let i = 0; i < expressions.length; i++) {
|
|
175
|
-
expressions[i] = convertRange(expressions[i]);
|
|
176
|
-
}
|
|
177
|
-
return expressions;
|
|
178
|
-
}
|
|
179
|
-
return convertAllRanges;
|
|
180
|
-
})();
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
// node_modules/node-cron/src/convert-expression/step-values-conversion.js
|
|
185
|
-
var require_step_values_conversion = __commonJS({
|
|
186
|
-
"node_modules/node-cron/src/convert-expression/step-values-conversion.js"(exports, module) {
|
|
187
|
-
"use strict";
|
|
188
|
-
module.exports = /* @__PURE__ */ (() => {
|
|
189
|
-
function convertSteps(expressions) {
|
|
190
|
-
var stepValuePattern = /^(.+)\/(\w+)$/;
|
|
191
|
-
for (var i = 0; i < expressions.length; i++) {
|
|
192
|
-
var match = stepValuePattern.exec(expressions[i]);
|
|
193
|
-
var isStepValue = match !== null && match.length > 0;
|
|
194
|
-
if (isStepValue) {
|
|
195
|
-
var baseDivider = match[2];
|
|
196
|
-
if (isNaN(baseDivider)) {
|
|
197
|
-
throw baseDivider + " is not a valid step value";
|
|
198
|
-
}
|
|
199
|
-
var values = match[1].split(",");
|
|
200
|
-
var stepValues = [];
|
|
201
|
-
var divider = parseInt(baseDivider, 10);
|
|
202
|
-
for (var j = 0; j <= values.length; j++) {
|
|
203
|
-
var value = parseInt(values[j], 10);
|
|
204
|
-
if (value % divider === 0) {
|
|
205
|
-
stepValues.push(value);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
expressions[i] = stepValues.join(",");
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
return expressions;
|
|
212
|
-
}
|
|
213
|
-
return convertSteps;
|
|
214
|
-
})();
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
// node_modules/node-cron/src/convert-expression/index.js
|
|
219
|
-
var require_convert_expression = __commonJS({
|
|
220
|
-
"node_modules/node-cron/src/convert-expression/index.js"(exports, module) {
|
|
221
|
-
"use strict";
|
|
222
|
-
var monthNamesConversion = require_month_names_conversion();
|
|
223
|
-
var weekDayNamesConversion = require_week_day_names_conversion();
|
|
224
|
-
var convertAsterisksToRanges = require_asterisk_to_range_conversion();
|
|
225
|
-
var convertRanges = require_range_conversion();
|
|
226
|
-
var convertSteps = require_step_values_conversion();
|
|
227
|
-
module.exports = /* @__PURE__ */ (() => {
|
|
228
|
-
function appendSeccondExpression(expressions) {
|
|
229
|
-
if (expressions.length === 5) {
|
|
230
|
-
return ["0"].concat(expressions);
|
|
231
|
-
}
|
|
232
|
-
return expressions;
|
|
233
|
-
}
|
|
234
|
-
function removeSpaces(str) {
|
|
235
|
-
return str.replace(/\s{2,}/g, " ").trim();
|
|
236
|
-
}
|
|
237
|
-
function normalizeIntegers(expressions) {
|
|
238
|
-
for (let i = 0; i < expressions.length; i++) {
|
|
239
|
-
const numbers = expressions[i].split(",");
|
|
240
|
-
for (let j = 0; j < numbers.length; j++) {
|
|
241
|
-
numbers[j] = parseInt(numbers[j]);
|
|
242
|
-
}
|
|
243
|
-
expressions[i] = numbers;
|
|
244
|
-
}
|
|
245
|
-
return expressions;
|
|
246
|
-
}
|
|
247
|
-
function interprete(expression) {
|
|
248
|
-
let expressions = removeSpaces(expression).split(" ");
|
|
249
|
-
expressions = appendSeccondExpression(expressions);
|
|
250
|
-
expressions[4] = monthNamesConversion(expressions[4]);
|
|
251
|
-
expressions[5] = weekDayNamesConversion(expressions[5]);
|
|
252
|
-
expressions = convertAsterisksToRanges(expressions);
|
|
253
|
-
expressions = convertRanges(expressions);
|
|
254
|
-
expressions = convertSteps(expressions);
|
|
255
|
-
expressions = normalizeIntegers(expressions);
|
|
256
|
-
return expressions.join(" ");
|
|
257
|
-
}
|
|
258
|
-
return interprete;
|
|
259
|
-
})();
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
// node_modules/node-cron/src/pattern-validation.js
|
|
264
|
-
var require_pattern_validation = __commonJS({
|
|
265
|
-
"node_modules/node-cron/src/pattern-validation.js"(exports, module) {
|
|
266
|
-
"use strict";
|
|
267
|
-
var convertExpression = require_convert_expression();
|
|
268
|
-
var validationRegex = /^(?:\d+|\*|\*\/\d+)$/;
|
|
269
|
-
function isValidExpression(expression, min, max) {
|
|
270
|
-
const options = expression.split(",");
|
|
271
|
-
for (const option of options) {
|
|
272
|
-
const optionAsInt = parseInt(option, 10);
|
|
273
|
-
if (!Number.isNaN(optionAsInt) && (optionAsInt < min || optionAsInt > max) || !validationRegex.test(option))
|
|
274
|
-
return false;
|
|
275
|
-
}
|
|
276
|
-
return true;
|
|
277
|
-
}
|
|
278
|
-
function isInvalidSecond(expression) {
|
|
279
|
-
return !isValidExpression(expression, 0, 59);
|
|
280
|
-
}
|
|
281
|
-
function isInvalidMinute(expression) {
|
|
282
|
-
return !isValidExpression(expression, 0, 59);
|
|
283
|
-
}
|
|
284
|
-
function isInvalidHour(expression) {
|
|
285
|
-
return !isValidExpression(expression, 0, 23);
|
|
286
|
-
}
|
|
287
|
-
function isInvalidDayOfMonth(expression) {
|
|
288
|
-
return !isValidExpression(expression, 1, 31);
|
|
289
|
-
}
|
|
290
|
-
function isInvalidMonth(expression) {
|
|
291
|
-
return !isValidExpression(expression, 1, 12);
|
|
292
|
-
}
|
|
293
|
-
function isInvalidWeekDay(expression) {
|
|
294
|
-
return !isValidExpression(expression, 0, 7);
|
|
295
|
-
}
|
|
296
|
-
function validateFields(patterns, executablePatterns) {
|
|
297
|
-
if (isInvalidSecond(executablePatterns[0]))
|
|
298
|
-
throw new Error(`${patterns[0]} is a invalid expression for second`);
|
|
299
|
-
if (isInvalidMinute(executablePatterns[1]))
|
|
300
|
-
throw new Error(`${patterns[1]} is a invalid expression for minute`);
|
|
301
|
-
if (isInvalidHour(executablePatterns[2]))
|
|
302
|
-
throw new Error(`${patterns[2]} is a invalid expression for hour`);
|
|
303
|
-
if (isInvalidDayOfMonth(executablePatterns[3]))
|
|
304
|
-
throw new Error(
|
|
305
|
-
`${patterns[3]} is a invalid expression for day of month`
|
|
306
|
-
);
|
|
307
|
-
if (isInvalidMonth(executablePatterns[4]))
|
|
308
|
-
throw new Error(`${patterns[4]} is a invalid expression for month`);
|
|
309
|
-
if (isInvalidWeekDay(executablePatterns[5]))
|
|
310
|
-
throw new Error(`${patterns[5]} is a invalid expression for week day`);
|
|
311
|
-
}
|
|
312
|
-
function validate2(pattern) {
|
|
313
|
-
if (typeof pattern !== "string")
|
|
314
|
-
throw new TypeError("pattern must be a string!");
|
|
315
|
-
const patterns = pattern.split(" ");
|
|
316
|
-
const executablePatterns = convertExpression(pattern).split(" ");
|
|
317
|
-
if (patterns.length === 5) patterns.unshift("0");
|
|
318
|
-
validateFields(patterns, executablePatterns);
|
|
319
|
-
}
|
|
320
|
-
module.exports = validate2;
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
|
-
|
|
324
|
-
// node_modules/node-cron/src/time-matcher.js
|
|
325
|
-
var require_time_matcher = __commonJS({
|
|
326
|
-
"node_modules/node-cron/src/time-matcher.js"(exports, module) {
|
|
327
|
-
"use strict";
|
|
328
|
-
var validatePattern = require_pattern_validation();
|
|
329
|
-
var convertExpression = require_convert_expression();
|
|
330
|
-
function matchPattern(pattern, value) {
|
|
331
|
-
if (pattern.indexOf(",") !== -1) {
|
|
332
|
-
const patterns = pattern.split(",");
|
|
333
|
-
return patterns.indexOf(value.toString()) !== -1;
|
|
334
|
-
}
|
|
335
|
-
return pattern === value.toString();
|
|
336
|
-
}
|
|
337
|
-
var TimeMatcher = class {
|
|
338
|
-
constructor(pattern, timezone) {
|
|
339
|
-
validatePattern(pattern);
|
|
340
|
-
this.pattern = convertExpression(pattern);
|
|
341
|
-
this.timezone = timezone;
|
|
342
|
-
this.expressions = this.pattern.split(" ");
|
|
343
|
-
this.dtf = this.timezone ? new Intl.DateTimeFormat("en-US", {
|
|
344
|
-
year: "numeric",
|
|
345
|
-
month: "2-digit",
|
|
346
|
-
day: "2-digit",
|
|
347
|
-
hour: "2-digit",
|
|
348
|
-
minute: "2-digit",
|
|
349
|
-
second: "2-digit",
|
|
350
|
-
hourCycle: "h23",
|
|
351
|
-
fractionalSecondDigits: 3,
|
|
352
|
-
timeZone: this.timezone
|
|
353
|
-
}) : null;
|
|
354
|
-
}
|
|
355
|
-
match(date) {
|
|
356
|
-
date = this.apply(date);
|
|
357
|
-
const runOnSecond = matchPattern(this.expressions[0], date.getSeconds());
|
|
358
|
-
const runOnMinute = matchPattern(this.expressions[1], date.getMinutes());
|
|
359
|
-
const runOnHour = matchPattern(this.expressions[2], date.getHours());
|
|
360
|
-
const runOnDay = matchPattern(this.expressions[3], date.getDate());
|
|
361
|
-
const runOnMonth = matchPattern(this.expressions[4], date.getMonth() + 1);
|
|
362
|
-
const runOnWeekDay = matchPattern(this.expressions[5], date.getDay());
|
|
363
|
-
return runOnSecond && runOnMinute && runOnHour && runOnDay && runOnMonth && runOnWeekDay;
|
|
364
|
-
}
|
|
365
|
-
apply(date) {
|
|
366
|
-
if (this.dtf) {
|
|
367
|
-
return new Date(this.dtf.format(date));
|
|
368
|
-
}
|
|
369
|
-
return date;
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
module.exports = TimeMatcher;
|
|
373
|
-
}
|
|
374
|
-
});
|
|
375
|
-
|
|
376
|
-
// node_modules/node-cron/src/scheduler.js
|
|
377
|
-
var require_scheduler = __commonJS({
|
|
378
|
-
"node_modules/node-cron/src/scheduler.js"(exports, module) {
|
|
379
|
-
"use strict";
|
|
380
|
-
var EventEmitter = __require("events");
|
|
381
|
-
var TimeMatcher = require_time_matcher();
|
|
382
|
-
var Scheduler = class extends EventEmitter {
|
|
383
|
-
constructor(pattern, timezone, autorecover) {
|
|
384
|
-
super();
|
|
385
|
-
this.timeMatcher = new TimeMatcher(pattern, timezone);
|
|
386
|
-
this.autorecover = autorecover;
|
|
387
|
-
}
|
|
388
|
-
start() {
|
|
389
|
-
this.stop();
|
|
390
|
-
let lastCheck = process.hrtime();
|
|
391
|
-
let lastExecution = this.timeMatcher.apply(/* @__PURE__ */ new Date());
|
|
392
|
-
const matchTime = () => {
|
|
393
|
-
const delay = 1e3;
|
|
394
|
-
const elapsedTime = process.hrtime(lastCheck);
|
|
395
|
-
const elapsedMs = (elapsedTime[0] * 1e9 + elapsedTime[1]) / 1e6;
|
|
396
|
-
const missedExecutions = Math.floor(elapsedMs / 1e3);
|
|
397
|
-
for (let i = missedExecutions; i >= 0; i--) {
|
|
398
|
-
const date = new Date((/* @__PURE__ */ new Date()).getTime() - i * 1e3);
|
|
399
|
-
let date_tmp = this.timeMatcher.apply(date);
|
|
400
|
-
if (lastExecution.getTime() < date_tmp.getTime() && (i === 0 || this.autorecover) && this.timeMatcher.match(date)) {
|
|
401
|
-
this.emit("scheduled-time-matched", date_tmp);
|
|
402
|
-
date_tmp.setMilliseconds(0);
|
|
403
|
-
lastExecution = date_tmp;
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
lastCheck = process.hrtime();
|
|
407
|
-
this.timeout = setTimeout(matchTime, delay);
|
|
408
|
-
};
|
|
409
|
-
matchTime();
|
|
410
|
-
}
|
|
411
|
-
stop() {
|
|
412
|
-
if (this.timeout) {
|
|
413
|
-
clearTimeout(this.timeout);
|
|
414
|
-
}
|
|
415
|
-
this.timeout = null;
|
|
416
|
-
}
|
|
417
|
-
};
|
|
418
|
-
module.exports = Scheduler;
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
|
|
422
|
-
// node_modules/node-cron/node_modules/uuid/dist/esm-node/rng.js
|
|
423
|
-
import crypto from "crypto";
|
|
424
|
-
function rng() {
|
|
425
|
-
if (poolPtr > rnds8Pool.length - 16) {
|
|
426
|
-
crypto.randomFillSync(rnds8Pool);
|
|
427
|
-
poolPtr = 0;
|
|
428
|
-
}
|
|
429
|
-
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
430
|
-
}
|
|
431
|
-
var rnds8Pool, poolPtr;
|
|
432
|
-
var init_rng = __esm({
|
|
433
|
-
"node_modules/node-cron/node_modules/uuid/dist/esm-node/rng.js"() {
|
|
434
|
-
"use strict";
|
|
435
|
-
rnds8Pool = new Uint8Array(256);
|
|
436
|
-
poolPtr = rnds8Pool.length;
|
|
437
|
-
}
|
|
438
|
-
});
|
|
439
|
-
|
|
440
|
-
// node_modules/node-cron/node_modules/uuid/dist/esm-node/regex.js
|
|
441
|
-
var regex_default;
|
|
442
|
-
var init_regex = __esm({
|
|
443
|
-
"node_modules/node-cron/node_modules/uuid/dist/esm-node/regex.js"() {
|
|
444
|
-
"use strict";
|
|
445
|
-
regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
446
|
-
}
|
|
447
|
-
});
|
|
448
|
-
|
|
449
|
-
// node_modules/node-cron/node_modules/uuid/dist/esm-node/validate.js
|
|
450
|
-
function validate(uuid) {
|
|
451
|
-
return typeof uuid === "string" && regex_default.test(uuid);
|
|
452
|
-
}
|
|
453
|
-
var validate_default;
|
|
454
|
-
var init_validate = __esm({
|
|
455
|
-
"node_modules/node-cron/node_modules/uuid/dist/esm-node/validate.js"() {
|
|
456
|
-
"use strict";
|
|
457
|
-
init_regex();
|
|
458
|
-
validate_default = validate;
|
|
459
|
-
}
|
|
460
|
-
});
|
|
461
|
-
|
|
462
|
-
// node_modules/node-cron/node_modules/uuid/dist/esm-node/stringify.js
|
|
463
|
-
function stringify(arr, offset = 0) {
|
|
464
|
-
const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
465
|
-
if (!validate_default(uuid)) {
|
|
466
|
-
throw TypeError("Stringified UUID is invalid");
|
|
467
|
-
}
|
|
468
|
-
return uuid;
|
|
469
|
-
}
|
|
470
|
-
var byteToHex, stringify_default;
|
|
471
|
-
var init_stringify = __esm({
|
|
472
|
-
"node_modules/node-cron/node_modules/uuid/dist/esm-node/stringify.js"() {
|
|
473
|
-
"use strict";
|
|
474
|
-
init_validate();
|
|
475
|
-
byteToHex = [];
|
|
476
|
-
for (let i = 0; i < 256; ++i) {
|
|
477
|
-
byteToHex.push((i + 256).toString(16).substr(1));
|
|
478
|
-
}
|
|
479
|
-
stringify_default = stringify;
|
|
480
|
-
}
|
|
481
|
-
});
|
|
482
|
-
|
|
483
|
-
// node_modules/node-cron/node_modules/uuid/dist/esm-node/v1.js
|
|
484
|
-
function v1(options, buf, offset) {
|
|
485
|
-
let i = buf && offset || 0;
|
|
486
|
-
const b = buf || new Array(16);
|
|
487
|
-
options = options || {};
|
|
488
|
-
let node = options.node || _nodeId;
|
|
489
|
-
let clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq;
|
|
490
|
-
if (node == null || clockseq == null) {
|
|
491
|
-
const seedBytes = options.random || (options.rng || rng)();
|
|
492
|
-
if (node == null) {
|
|
493
|
-
node = _nodeId = [seedBytes[0] | 1, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
|
|
494
|
-
}
|
|
495
|
-
if (clockseq == null) {
|
|
496
|
-
clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 16383;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
let msecs = options.msecs !== void 0 ? options.msecs : Date.now();
|
|
500
|
-
let nsecs = options.nsecs !== void 0 ? options.nsecs : _lastNSecs + 1;
|
|
501
|
-
const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4;
|
|
502
|
-
if (dt < 0 && options.clockseq === void 0) {
|
|
503
|
-
clockseq = clockseq + 1 & 16383;
|
|
504
|
-
}
|
|
505
|
-
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === void 0) {
|
|
506
|
-
nsecs = 0;
|
|
507
|
-
}
|
|
508
|
-
if (nsecs >= 1e4) {
|
|
509
|
-
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
|
|
510
|
-
}
|
|
511
|
-
_lastMSecs = msecs;
|
|
512
|
-
_lastNSecs = nsecs;
|
|
513
|
-
_clockseq = clockseq;
|
|
514
|
-
msecs += 122192928e5;
|
|
515
|
-
const tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296;
|
|
516
|
-
b[i++] = tl >>> 24 & 255;
|
|
517
|
-
b[i++] = tl >>> 16 & 255;
|
|
518
|
-
b[i++] = tl >>> 8 & 255;
|
|
519
|
-
b[i++] = tl & 255;
|
|
520
|
-
const tmh = msecs / 4294967296 * 1e4 & 268435455;
|
|
521
|
-
b[i++] = tmh >>> 8 & 255;
|
|
522
|
-
b[i++] = tmh & 255;
|
|
523
|
-
b[i++] = tmh >>> 24 & 15 | 16;
|
|
524
|
-
b[i++] = tmh >>> 16 & 255;
|
|
525
|
-
b[i++] = clockseq >>> 8 | 128;
|
|
526
|
-
b[i++] = clockseq & 255;
|
|
527
|
-
for (let n = 0; n < 6; ++n) {
|
|
528
|
-
b[i + n] = node[n];
|
|
529
|
-
}
|
|
530
|
-
return buf || stringify_default(b);
|
|
531
|
-
}
|
|
532
|
-
var _nodeId, _clockseq, _lastMSecs, _lastNSecs, v1_default;
|
|
533
|
-
var init_v1 = __esm({
|
|
534
|
-
"node_modules/node-cron/node_modules/uuid/dist/esm-node/v1.js"() {
|
|
535
|
-
"use strict";
|
|
536
|
-
init_rng();
|
|
537
|
-
init_stringify();
|
|
538
|
-
_lastMSecs = 0;
|
|
539
|
-
_lastNSecs = 0;
|
|
540
|
-
v1_default = v1;
|
|
541
|
-
}
|
|
542
|
-
});
|
|
543
|
-
|
|
544
|
-
// node_modules/node-cron/node_modules/uuid/dist/esm-node/parse.js
|
|
545
|
-
function parse(uuid) {
|
|
546
|
-
if (!validate_default(uuid)) {
|
|
547
|
-
throw TypeError("Invalid UUID");
|
|
548
|
-
}
|
|
549
|
-
let v;
|
|
550
|
-
const arr = new Uint8Array(16);
|
|
551
|
-
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
|
|
552
|
-
arr[1] = v >>> 16 & 255;
|
|
553
|
-
arr[2] = v >>> 8 & 255;
|
|
554
|
-
arr[3] = v & 255;
|
|
555
|
-
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
|
|
556
|
-
arr[5] = v & 255;
|
|
557
|
-
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
|
|
558
|
-
arr[7] = v & 255;
|
|
559
|
-
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
|
|
560
|
-
arr[9] = v & 255;
|
|
561
|
-
arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776 & 255;
|
|
562
|
-
arr[11] = v / 4294967296 & 255;
|
|
563
|
-
arr[12] = v >>> 24 & 255;
|
|
564
|
-
arr[13] = v >>> 16 & 255;
|
|
565
|
-
arr[14] = v >>> 8 & 255;
|
|
566
|
-
arr[15] = v & 255;
|
|
567
|
-
return arr;
|
|
568
|
-
}
|
|
569
|
-
var parse_default;
|
|
570
|
-
var init_parse = __esm({
|
|
571
|
-
"node_modules/node-cron/node_modules/uuid/dist/esm-node/parse.js"() {
|
|
572
|
-
"use strict";
|
|
573
|
-
init_validate();
|
|
574
|
-
parse_default = parse;
|
|
575
|
-
}
|
|
576
|
-
});
|
|
577
|
-
|
|
578
|
-
// node_modules/node-cron/node_modules/uuid/dist/esm-node/v35.js
|
|
579
|
-
function stringToBytes(str) {
|
|
580
|
-
str = unescape(encodeURIComponent(str));
|
|
581
|
-
const bytes = [];
|
|
582
|
-
for (let i = 0; i < str.length; ++i) {
|
|
583
|
-
bytes.push(str.charCodeAt(i));
|
|
584
|
-
}
|
|
585
|
-
return bytes;
|
|
586
|
-
}
|
|
587
|
-
function v35_default(name, version2, hashfunc) {
|
|
588
|
-
function generateUUID(value, namespace, buf, offset) {
|
|
589
|
-
if (typeof value === "string") {
|
|
590
|
-
value = stringToBytes(value);
|
|
591
|
-
}
|
|
592
|
-
if (typeof namespace === "string") {
|
|
593
|
-
namespace = parse_default(namespace);
|
|
594
|
-
}
|
|
595
|
-
if (namespace.length !== 16) {
|
|
596
|
-
throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
|
|
597
|
-
}
|
|
598
|
-
let bytes = new Uint8Array(16 + value.length);
|
|
599
|
-
bytes.set(namespace);
|
|
600
|
-
bytes.set(value, namespace.length);
|
|
601
|
-
bytes = hashfunc(bytes);
|
|
602
|
-
bytes[6] = bytes[6] & 15 | version2;
|
|
603
|
-
bytes[8] = bytes[8] & 63 | 128;
|
|
604
|
-
if (buf) {
|
|
605
|
-
offset = offset || 0;
|
|
606
|
-
for (let i = 0; i < 16; ++i) {
|
|
607
|
-
buf[offset + i] = bytes[i];
|
|
608
|
-
}
|
|
609
|
-
return buf;
|
|
610
|
-
}
|
|
611
|
-
return stringify_default(bytes);
|
|
612
|
-
}
|
|
613
|
-
try {
|
|
614
|
-
generateUUID.name = name;
|
|
615
|
-
} catch (err) {
|
|
616
|
-
}
|
|
617
|
-
generateUUID.DNS = DNS;
|
|
618
|
-
generateUUID.URL = URL;
|
|
619
|
-
return generateUUID;
|
|
620
|
-
}
|
|
621
|
-
var DNS, URL;
|
|
622
|
-
var init_v35 = __esm({
|
|
623
|
-
"node_modules/node-cron/node_modules/uuid/dist/esm-node/v35.js"() {
|
|
624
|
-
"use strict";
|
|
625
|
-
init_stringify();
|
|
626
|
-
init_parse();
|
|
627
|
-
DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
|
|
628
|
-
URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
|
|
629
|
-
}
|
|
630
|
-
});
|
|
631
|
-
|
|
632
|
-
// node_modules/node-cron/node_modules/uuid/dist/esm-node/md5.js
|
|
633
|
-
import crypto2 from "crypto";
|
|
634
|
-
function md5(bytes) {
|
|
635
|
-
if (Array.isArray(bytes)) {
|
|
636
|
-
bytes = Buffer.from(bytes);
|
|
637
|
-
} else if (typeof bytes === "string") {
|
|
638
|
-
bytes = Buffer.from(bytes, "utf8");
|
|
639
|
-
}
|
|
640
|
-
return crypto2.createHash("md5").update(bytes).digest();
|
|
641
|
-
}
|
|
642
|
-
var md5_default;
|
|
643
|
-
var init_md5 = __esm({
|
|
644
|
-
"node_modules/node-cron/node_modules/uuid/dist/esm-node/md5.js"() {
|
|
645
|
-
"use strict";
|
|
646
|
-
md5_default = md5;
|
|
647
|
-
}
|
|
648
|
-
});
|
|
649
|
-
|
|
650
|
-
// node_modules/node-cron/node_modules/uuid/dist/esm-node/v3.js
|
|
651
|
-
var v3, v3_default;
|
|
652
|
-
var init_v3 = __esm({
|
|
653
|
-
"node_modules/node-cron/node_modules/uuid/dist/esm-node/v3.js"() {
|
|
654
|
-
"use strict";
|
|
655
|
-
init_v35();
|
|
656
|
-
init_md5();
|
|
657
|
-
v3 = v35_default("v3", 48, md5_default);
|
|
658
|
-
v3_default = v3;
|
|
659
|
-
}
|
|
660
|
-
});
|
|
661
|
-
|
|
662
|
-
// node_modules/node-cron/node_modules/uuid/dist/esm-node/v4.js
|
|
663
|
-
function v4(options, buf, offset) {
|
|
664
|
-
options = options || {};
|
|
665
|
-
const rnds = options.random || (options.rng || rng)();
|
|
666
|
-
rnds[6] = rnds[6] & 15 | 64;
|
|
667
|
-
rnds[8] = rnds[8] & 63 | 128;
|
|
668
|
-
if (buf) {
|
|
669
|
-
offset = offset || 0;
|
|
670
|
-
for (let i = 0; i < 16; ++i) {
|
|
671
|
-
buf[offset + i] = rnds[i];
|
|
672
|
-
}
|
|
673
|
-
return buf;
|
|
674
|
-
}
|
|
675
|
-
return stringify_default(rnds);
|
|
676
|
-
}
|
|
677
|
-
var v4_default;
|
|
678
|
-
var init_v4 = __esm({
|
|
679
|
-
"node_modules/node-cron/node_modules/uuid/dist/esm-node/v4.js"() {
|
|
680
|
-
"use strict";
|
|
681
|
-
init_rng();
|
|
682
|
-
init_stringify();
|
|
683
|
-
v4_default = v4;
|
|
684
|
-
}
|
|
685
|
-
});
|
|
686
|
-
|
|
687
|
-
// node_modules/node-cron/node_modules/uuid/dist/esm-node/sha1.js
|
|
688
|
-
import crypto3 from "crypto";
|
|
689
|
-
function sha1(bytes) {
|
|
690
|
-
if (Array.isArray(bytes)) {
|
|
691
|
-
bytes = Buffer.from(bytes);
|
|
692
|
-
} else if (typeof bytes === "string") {
|
|
693
|
-
bytes = Buffer.from(bytes, "utf8");
|
|
694
|
-
}
|
|
695
|
-
return crypto3.createHash("sha1").update(bytes).digest();
|
|
696
|
-
}
|
|
697
|
-
var sha1_default;
|
|
698
|
-
var init_sha1 = __esm({
|
|
699
|
-
"node_modules/node-cron/node_modules/uuid/dist/esm-node/sha1.js"() {
|
|
700
|
-
"use strict";
|
|
701
|
-
sha1_default = sha1;
|
|
702
|
-
}
|
|
703
|
-
});
|
|
704
|
-
|
|
705
|
-
// node_modules/node-cron/node_modules/uuid/dist/esm-node/v5.js
|
|
706
|
-
var v5, v5_default;
|
|
707
|
-
var init_v5 = __esm({
|
|
708
|
-
"node_modules/node-cron/node_modules/uuid/dist/esm-node/v5.js"() {
|
|
709
|
-
"use strict";
|
|
710
|
-
init_v35();
|
|
711
|
-
init_sha1();
|
|
712
|
-
v5 = v35_default("v5", 80, sha1_default);
|
|
713
|
-
v5_default = v5;
|
|
714
|
-
}
|
|
715
|
-
});
|
|
716
|
-
|
|
717
|
-
// node_modules/node-cron/node_modules/uuid/dist/esm-node/nil.js
|
|
718
|
-
var nil_default;
|
|
719
|
-
var init_nil = __esm({
|
|
720
|
-
"node_modules/node-cron/node_modules/uuid/dist/esm-node/nil.js"() {
|
|
721
|
-
"use strict";
|
|
722
|
-
nil_default = "00000000-0000-0000-0000-000000000000";
|
|
723
|
-
}
|
|
724
|
-
});
|
|
725
|
-
|
|
726
|
-
// node_modules/node-cron/node_modules/uuid/dist/esm-node/version.js
|
|
727
|
-
function version(uuid) {
|
|
728
|
-
if (!validate_default(uuid)) {
|
|
729
|
-
throw TypeError("Invalid UUID");
|
|
730
|
-
}
|
|
731
|
-
return parseInt(uuid.substr(14, 1), 16);
|
|
732
|
-
}
|
|
733
|
-
var version_default;
|
|
734
|
-
var init_version = __esm({
|
|
735
|
-
"node_modules/node-cron/node_modules/uuid/dist/esm-node/version.js"() {
|
|
736
|
-
"use strict";
|
|
737
|
-
init_validate();
|
|
738
|
-
version_default = version;
|
|
739
|
-
}
|
|
740
|
-
});
|
|
741
|
-
|
|
742
|
-
// node_modules/node-cron/node_modules/uuid/dist/esm-node/index.js
|
|
743
|
-
var esm_node_exports = {};
|
|
744
|
-
__export(esm_node_exports, {
|
|
745
|
-
NIL: () => nil_default,
|
|
746
|
-
parse: () => parse_default,
|
|
747
|
-
stringify: () => stringify_default,
|
|
748
|
-
v1: () => v1_default,
|
|
749
|
-
v3: () => v3_default,
|
|
750
|
-
v4: () => v4_default,
|
|
751
|
-
v5: () => v5_default,
|
|
752
|
-
validate: () => validate_default,
|
|
753
|
-
version: () => version_default
|
|
754
|
-
});
|
|
755
|
-
var init_esm_node = __esm({
|
|
756
|
-
"node_modules/node-cron/node_modules/uuid/dist/esm-node/index.js"() {
|
|
757
|
-
"use strict";
|
|
758
|
-
init_v1();
|
|
759
|
-
init_v3();
|
|
760
|
-
init_v4();
|
|
761
|
-
init_v5();
|
|
762
|
-
init_nil();
|
|
763
|
-
init_version();
|
|
764
|
-
init_validate();
|
|
765
|
-
init_stringify();
|
|
766
|
-
init_parse();
|
|
767
|
-
}
|
|
768
|
-
});
|
|
769
|
-
|
|
770
|
-
// node_modules/node-cron/src/scheduled-task.js
|
|
771
|
-
var require_scheduled_task = __commonJS({
|
|
772
|
-
"node_modules/node-cron/src/scheduled-task.js"(exports, module) {
|
|
773
|
-
"use strict";
|
|
774
|
-
var EventEmitter = __require("events");
|
|
775
|
-
var Task = require_task();
|
|
776
|
-
var Scheduler = require_scheduler();
|
|
777
|
-
var uuid = (init_esm_node(), __toCommonJS(esm_node_exports));
|
|
778
|
-
var ScheduledTask = class extends EventEmitter {
|
|
779
|
-
constructor(cronExpression, func, options) {
|
|
780
|
-
super();
|
|
781
|
-
if (!options) {
|
|
782
|
-
options = {
|
|
783
|
-
scheduled: true,
|
|
784
|
-
recoverMissedExecutions: false
|
|
785
|
-
};
|
|
786
|
-
}
|
|
787
|
-
this.options = options;
|
|
788
|
-
this.options.name = this.options.name || uuid.v4();
|
|
789
|
-
this._task = new Task(func);
|
|
790
|
-
this._scheduler = new Scheduler(cronExpression, options.timezone, options.recoverMissedExecutions);
|
|
791
|
-
this._scheduler.on("scheduled-time-matched", (now) => {
|
|
792
|
-
this.now(now);
|
|
793
|
-
});
|
|
794
|
-
if (options.scheduled !== false) {
|
|
795
|
-
this._scheduler.start();
|
|
796
|
-
}
|
|
797
|
-
if (options.runOnInit === true) {
|
|
798
|
-
this.now("init");
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
now(now = "manual") {
|
|
802
|
-
let result = this._task.execute(now);
|
|
803
|
-
this.emit("task-done", result);
|
|
804
|
-
}
|
|
805
|
-
start() {
|
|
806
|
-
this._scheduler.start();
|
|
807
|
-
}
|
|
808
|
-
stop() {
|
|
809
|
-
this._scheduler.stop();
|
|
810
|
-
}
|
|
811
|
-
};
|
|
812
|
-
module.exports = ScheduledTask;
|
|
813
|
-
}
|
|
814
|
-
});
|
|
815
|
-
|
|
816
|
-
// node_modules/node-cron/src/background-scheduled-task/index.js
|
|
817
|
-
var require_background_scheduled_task = __commonJS({
|
|
818
|
-
"node_modules/node-cron/src/background-scheduled-task/index.js"(exports, module) {
|
|
819
|
-
"use strict";
|
|
820
|
-
var EventEmitter = __require("events");
|
|
821
|
-
var path = __require("path");
|
|
822
|
-
var { fork } = __require("child_process");
|
|
823
|
-
var uuid = (init_esm_node(), __toCommonJS(esm_node_exports));
|
|
824
|
-
var daemonPath = `${__dirname}/daemon.js`;
|
|
825
|
-
var BackgroundScheduledTask = class extends EventEmitter {
|
|
826
|
-
constructor(cronExpression, taskPath, options) {
|
|
827
|
-
super();
|
|
828
|
-
if (!options) {
|
|
829
|
-
options = {
|
|
830
|
-
scheduled: true,
|
|
831
|
-
recoverMissedExecutions: false
|
|
832
|
-
};
|
|
833
|
-
}
|
|
834
|
-
this.cronExpression = cronExpression;
|
|
835
|
-
this.taskPath = taskPath;
|
|
836
|
-
this.options = options;
|
|
837
|
-
this.options.name = this.options.name || uuid.v4();
|
|
838
|
-
if (options.scheduled) {
|
|
839
|
-
this.start();
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
start() {
|
|
843
|
-
this.stop();
|
|
844
|
-
this.forkProcess = fork(daemonPath);
|
|
845
|
-
this.forkProcess.on("message", (message) => {
|
|
846
|
-
switch (message.type) {
|
|
847
|
-
case "task-done":
|
|
848
|
-
this.emit("task-done", message.result);
|
|
849
|
-
break;
|
|
850
|
-
}
|
|
851
|
-
});
|
|
852
|
-
let options = this.options;
|
|
853
|
-
options.scheduled = true;
|
|
854
|
-
this.forkProcess.send({
|
|
855
|
-
type: "register",
|
|
856
|
-
path: path.resolve(this.taskPath),
|
|
857
|
-
cron: this.cronExpression,
|
|
858
|
-
options
|
|
859
|
-
});
|
|
860
|
-
}
|
|
861
|
-
stop() {
|
|
862
|
-
if (this.forkProcess) {
|
|
863
|
-
this.forkProcess.kill();
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
pid() {
|
|
867
|
-
if (this.forkProcess) {
|
|
868
|
-
return this.forkProcess.pid;
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
isRunning() {
|
|
872
|
-
return !this.forkProcess.killed;
|
|
873
|
-
}
|
|
874
|
-
};
|
|
875
|
-
module.exports = BackgroundScheduledTask;
|
|
876
|
-
}
|
|
877
|
-
});
|
|
878
|
-
|
|
879
|
-
// node_modules/node-cron/src/storage.js
|
|
880
|
-
var require_storage = __commonJS({
|
|
881
|
-
"node_modules/node-cron/src/storage.js"(exports, module) {
|
|
882
|
-
"use strict";
|
|
883
|
-
module.exports = (() => {
|
|
884
|
-
if (!global.scheduledTasks) {
|
|
885
|
-
global.scheduledTasks = /* @__PURE__ */ new Map();
|
|
886
|
-
}
|
|
887
|
-
return {
|
|
888
|
-
save: (task) => {
|
|
889
|
-
if (!task.options) {
|
|
890
|
-
const uuid = (init_esm_node(), __toCommonJS(esm_node_exports));
|
|
891
|
-
task.options = {};
|
|
892
|
-
task.options.name = uuid.v4();
|
|
893
|
-
}
|
|
894
|
-
global.scheduledTasks.set(task.options.name, task);
|
|
895
|
-
},
|
|
896
|
-
getTasks: () => {
|
|
897
|
-
return global.scheduledTasks;
|
|
898
|
-
}
|
|
899
|
-
};
|
|
900
|
-
})();
|
|
901
|
-
}
|
|
902
|
-
});
|
|
903
|
-
|
|
904
|
-
// node_modules/node-cron/src/node-cron.js
|
|
905
|
-
var require_node_cron = __commonJS({
|
|
906
|
-
"node_modules/node-cron/src/node-cron.js"(exports, module) {
|
|
907
|
-
var ScheduledTask = require_scheduled_task();
|
|
908
|
-
var BackgroundScheduledTask = require_background_scheduled_task();
|
|
909
|
-
var validation = require_pattern_validation();
|
|
910
|
-
var storage = require_storage();
|
|
911
|
-
function schedule(expression, func, options) {
|
|
912
|
-
const task = createTask(expression, func, options);
|
|
913
|
-
storage.save(task);
|
|
914
|
-
return task;
|
|
915
|
-
}
|
|
916
|
-
function createTask(expression, func, options) {
|
|
917
|
-
if (typeof func === "string")
|
|
918
|
-
return new BackgroundScheduledTask(expression, func, options);
|
|
919
|
-
return new ScheduledTask(expression, func, options);
|
|
920
|
-
}
|
|
921
|
-
function validate2(expression) {
|
|
922
|
-
try {
|
|
923
|
-
validation(expression);
|
|
924
|
-
return true;
|
|
925
|
-
} catch (_) {
|
|
926
|
-
return false;
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
function getTasks() {
|
|
930
|
-
return storage.getTasks();
|
|
931
|
-
}
|
|
932
|
-
module.exports = { schedule, validate: validate2, getTasks };
|
|
933
|
-
}
|
|
934
|
-
});
|
|
935
|
-
export default require_node_cron();
|