@digipair/skill-cron 0.93.0-0 → 0.93.0
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/{dist/index.cjs.js → index.cjs.js} +195 -175
- package/index.d.ts +1 -0
- package/{dist/index.esm.js → index.esm.js} +188 -174
- package/libs/skill-cron/src/index.d.ts +1 -0
- package/{dist → libs/skill-cron}/src/lib/skill-cron.d.ts +0 -1
- package/package.json +6 -20
- package/README.md +0 -7
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/lib/skill-cron.d.ts.map +0 -1
- package/dist/src/lib/skill-cron.spec.d.ts +0 -2
- package/dist/src/lib/skill-cron.spec.d.ts.map +0 -1
- /package/{dist/index.d.ts → index.cjs.d.ts} +0 -0
- /package/{dist/schema.fr.json → schema.fr.json} +0 -0
- /package/{dist/schema.json → schema.json} +0 -0
@@ -1,9 +1,15 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
3
5
|
var fs = require('fs');
|
4
6
|
var require$$0 = require('child_process');
|
5
7
|
|
6
|
-
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
9
|
+
|
10
|
+
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
|
11
|
+
|
12
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
7
13
|
|
8
14
|
var dist = {};
|
9
15
|
|
@@ -158,6 +164,11 @@ function ownKeys(object, enumerableOnly) {
|
|
158
164
|
var keys = Object.keys(object);
|
159
165
|
if (Object.getOwnPropertySymbols) {
|
160
166
|
var symbols = Object.getOwnPropertySymbols(object);
|
167
|
+
if (enumerableOnly) {
|
168
|
+
symbols = symbols.filter(function(sym) {
|
169
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
170
|
+
});
|
171
|
+
}
|
161
172
|
keys.push.apply(keys, symbols);
|
162
173
|
}
|
163
174
|
return keys;
|
@@ -281,7 +292,7 @@ function _create_super$1(Derived) {
|
|
281
292
|
return _possible_constructor_return$1(this, result);
|
282
293
|
};
|
283
294
|
}
|
284
|
-
Object.defineProperty(luxon,
|
295
|
+
Object.defineProperty(luxon, "__esModule", {
|
285
296
|
value: true
|
286
297
|
});
|
287
298
|
// these aren't really private, but nor are they really useful to document
|
@@ -1828,7 +1839,7 @@ var singleton = null;
|
|
1828
1839
|
else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);
|
1829
1840
|
} else if (isNumber(input)) {
|
1830
1841
|
return FixedOffsetZone.instance(input);
|
1831
|
-
} else if (
|
1842
|
+
} else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") {
|
1832
1843
|
// This is dumb, but the instanceof check above doesn't seem to really work
|
1833
1844
|
// so we're duck checking it
|
1834
1845
|
return input;
|
@@ -1837,26 +1848,26 @@ var singleton = null;
|
|
1837
1848
|
}
|
1838
1849
|
}
|
1839
1850
|
var numberingSystems = {
|
1840
|
-
arab: "[
|
1841
|
-
arabext: "[
|
1842
|
-
bali: "[
|
1843
|
-
beng: "[
|
1844
|
-
deva: "[
|
1845
|
-
fullwide: "[
|
1846
|
-
gujr: "[
|
1851
|
+
arab: "[٠-٩]",
|
1852
|
+
arabext: "[۰-۹]",
|
1853
|
+
bali: "[᭐-᭙]",
|
1854
|
+
beng: "[০-৯]",
|
1855
|
+
deva: "[०-९]",
|
1856
|
+
fullwide: "[0-9]",
|
1857
|
+
gujr: "[૦-૯]",
|
1847
1858
|
hanidec: "[〇|一|二|三|四|五|六|七|八|九]",
|
1848
|
-
khmr: "[
|
1849
|
-
knda: "[
|
1850
|
-
laoo: "[
|
1851
|
-
limb: "[
|
1852
|
-
mlym: "[
|
1853
|
-
mong: "[
|
1854
|
-
mymr: "[
|
1855
|
-
orya: "[
|
1856
|
-
tamldec: "[
|
1857
|
-
telu: "[
|
1858
|
-
thai: "[
|
1859
|
-
tibt: "[
|
1859
|
+
khmr: "[០-៩]",
|
1860
|
+
knda: "[೦-೯]",
|
1861
|
+
laoo: "[໐-໙]",
|
1862
|
+
limb: "[᥆-᥏]",
|
1863
|
+
mlym: "[൦-൯]",
|
1864
|
+
mong: "[᠐-᠙]",
|
1865
|
+
mymr: "[၀-၉]",
|
1866
|
+
orya: "[୦-୯]",
|
1867
|
+
tamldec: "[௦-௯]",
|
1868
|
+
telu: "[౦-౯]",
|
1869
|
+
thai: "[๐-๙]",
|
1870
|
+
tibt: "[༠-༩]",
|
1860
1871
|
latn: "\\d"
|
1861
1872
|
};
|
1862
1873
|
var numberingSystemsUTF16 = {
|
@@ -2413,7 +2424,7 @@ function hasOwnProperty(obj, prop) {
|
|
2413
2424
|
function validateWeekSettings(settings) {
|
2414
2425
|
if (settings == null) {
|
2415
2426
|
return null;
|
2416
|
-
} else if (
|
2427
|
+
} else if (typeof settings !== "object") {
|
2417
2428
|
throw new InvalidArgumentError("Week settings must be an object");
|
2418
2429
|
} else {
|
2419
2430
|
if (!integerBetween(settings.firstDay, 1, 7) || !integerBetween(settings.minimalDays, 1, 7) || !Array.isArray(settings.weekend) || settings.weekend.some(function(v) {
|
@@ -4592,7 +4603,7 @@ function removeZeroes(vals) {
|
|
4592
4603
|
* @return {Duration}
|
4593
4604
|
*/ function fromObject(obj) {
|
4594
4605
|
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
4595
|
-
if (obj == null ||
|
4606
|
+
if (obj == null || typeof obj !== "object") {
|
4596
4607
|
throw new InvalidArgumentError("Duration.fromObject: argument expected to be an object, got ".concat(obj === null ? "null" : typeof obj === "undefined" ? "undefined" : _type_of$2(obj)));
|
4597
4608
|
}
|
4598
4609
|
return new Duration({
|
@@ -4619,7 +4630,7 @@ function removeZeroes(vals) {
|
|
4619
4630
|
return Duration.fromMillis(durationLike);
|
4620
4631
|
} else if (Duration.isDuration(durationLike)) {
|
4621
4632
|
return durationLike;
|
4622
|
-
} else if (
|
4633
|
+
} else if (typeof durationLike === "object") {
|
4623
4634
|
return Duration.fromObject(durationLike);
|
4624
4635
|
} else {
|
4625
4636
|
throw new InvalidArgumentError("Unknown duration argument ".concat(durationLike, " of type ").concat(typeof durationLike === "undefined" ? "undefined" : _type_of$2(durationLike)));
|
@@ -6078,7 +6089,7 @@ function tokenForPart(part, formatOpts, resolvedOpts) {
|
|
6078
6089
|
}
|
6079
6090
|
}
|
6080
6091
|
var val = partTypeStyleToTokenVal[actualType];
|
6081
|
-
if (
|
6092
|
+
if (typeof val === "object") {
|
6082
6093
|
val = val[style];
|
6083
6094
|
}
|
6084
6095
|
if (val) {
|
@@ -6721,7 +6732,7 @@ function diffRelative(start, end, opts) {
|
|
6721
6732
|
}
|
6722
6733
|
function lastOpts(argList) {
|
6723
6734
|
var opts = {}, args;
|
6724
|
-
if (argList.length > 0 &&
|
6735
|
+
if (argList.length > 0 && typeof argList[argList.length - 1] === "object") {
|
6725
6736
|
opts = argList[argList.length - 1];
|
6726
6737
|
args = Array.from(argList).slice(0, argList.length - 1);
|
6727
6738
|
} else {
|
@@ -8874,7 +8885,7 @@ function lastOpts(argList) {
|
|
8874
8885
|
return dateTimeish;
|
8875
8886
|
} else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {
|
8876
8887
|
return DateTime.fromJSDate(dateTimeish);
|
8877
|
-
} else if (dateTimeish &&
|
8888
|
+
} else if (dateTimeish && typeof dateTimeish === "object") {
|
8878
8889
|
return DateTime.fromObject(dateTimeish);
|
8879
8890
|
} else {
|
8880
8891
|
throw new InvalidArgumentError("Unknown datetime argument: ".concat(dateTimeish, ", of type ").concat(typeof dateTimeish === "undefined" ? "undefined" : _type_of$2(dateTimeish)));
|
@@ -8896,89 +8907,89 @@ luxon.Zone = Zone;
|
|
8896
8907
|
var constants = {};
|
8897
8908
|
|
8898
8909
|
(function (exports) {
|
8899
|
-
|
8900
|
-
|
8901
|
-
|
8902
|
-
|
8903
|
-
|
8904
|
-
|
8905
|
-
|
8906
|
-
|
8907
|
-
|
8908
|
-
|
8909
|
-
|
8910
|
-
|
8911
|
-
|
8912
|
-
|
8913
|
-
|
8914
|
-
|
8915
|
-
|
8916
|
-
|
8917
|
-
|
8918
|
-
|
8919
|
-
|
8920
|
-
|
8921
|
-
|
8922
|
-
|
8923
|
-
|
8924
|
-
|
8925
|
-
|
8926
|
-
|
8927
|
-
|
8928
|
-
|
8929
|
-
|
8930
|
-
|
8931
|
-
|
8932
|
-
|
8933
|
-
|
8934
|
-
|
8935
|
-
|
8936
|
-
|
8937
|
-
|
8938
|
-
|
8939
|
-
|
8940
|
-
|
8941
|
-
|
8942
|
-
|
8943
|
-
|
8944
|
-
|
8945
|
-
|
8946
|
-
|
8947
|
-
|
8948
|
-
|
8949
|
-
|
8950
|
-
|
8951
|
-
|
8952
|
-
|
8953
|
-
|
8954
|
-
|
8955
|
-
|
8956
|
-
|
8957
|
-
|
8958
|
-
|
8959
|
-
|
8960
|
-
|
8961
|
-
|
8962
|
-
|
8963
|
-
|
8964
|
-
|
8965
|
-
|
8966
|
-
|
8967
|
-
|
8968
|
-
|
8969
|
-
|
8970
|
-
|
8971
|
-
|
8972
|
-
|
8973
|
-
|
8974
|
-
|
8975
|
-
|
8976
|
-
|
8977
|
-
|
8978
|
-
|
8979
|
-
|
8980
|
-
|
8981
|
-
}
|
8910
|
+
Object.defineProperty(exports, "__esModule", {
|
8911
|
+
value: true
|
8912
|
+
});
|
8913
|
+
exports.RE_RANGE = exports.RE_WILDCARDS = exports.PRESETS = exports.TIME_UNITS_LEN = exports.TIME_UNITS = exports.TIME_UNITS_MAP = exports.ALIASES = exports.PARSE_DEFAULTS = exports.CONSTRAINTS = void 0;
|
8914
|
+
exports.CONSTRAINTS = Object.freeze({
|
8915
|
+
second: [
|
8916
|
+
0,
|
8917
|
+
59
|
8918
|
+
],
|
8919
|
+
minute: [
|
8920
|
+
0,
|
8921
|
+
59
|
8922
|
+
],
|
8923
|
+
hour: [
|
8924
|
+
0,
|
8925
|
+
23
|
8926
|
+
],
|
8927
|
+
dayOfMonth: [
|
8928
|
+
1,
|
8929
|
+
31
|
8930
|
+
],
|
8931
|
+
month: [
|
8932
|
+
1,
|
8933
|
+
12
|
8934
|
+
],
|
8935
|
+
dayOfWeek: [
|
8936
|
+
0,
|
8937
|
+
7
|
8938
|
+
]
|
8939
|
+
});
|
8940
|
+
exports.PARSE_DEFAULTS = Object.freeze({
|
8941
|
+
second: "0",
|
8942
|
+
minute: "*",
|
8943
|
+
hour: "*",
|
8944
|
+
dayOfMonth: "*",
|
8945
|
+
month: "*",
|
8946
|
+
dayOfWeek: "*"
|
8947
|
+
});
|
8948
|
+
exports.ALIASES = Object.freeze({
|
8949
|
+
jan: 1,
|
8950
|
+
feb: 2,
|
8951
|
+
mar: 3,
|
8952
|
+
apr: 4,
|
8953
|
+
may: 5,
|
8954
|
+
jun: 6,
|
8955
|
+
jul: 7,
|
8956
|
+
aug: 8,
|
8957
|
+
sep: 9,
|
8958
|
+
oct: 10,
|
8959
|
+
nov: 11,
|
8960
|
+
dec: 12,
|
8961
|
+
sun: 0,
|
8962
|
+
mon: 1,
|
8963
|
+
tue: 2,
|
8964
|
+
wed: 3,
|
8965
|
+
thu: 4,
|
8966
|
+
fri: 5,
|
8967
|
+
sat: 6
|
8968
|
+
});
|
8969
|
+
exports.TIME_UNITS_MAP = Object.freeze({
|
8970
|
+
SECOND: "second",
|
8971
|
+
MINUTE: "minute",
|
8972
|
+
HOUR: "hour",
|
8973
|
+
DAY_OF_MONTH: "dayOfMonth",
|
8974
|
+
MONTH: "month",
|
8975
|
+
DAY_OF_WEEK: "dayOfWeek"
|
8976
|
+
});
|
8977
|
+
exports.TIME_UNITS = Object.freeze(Object.values(exports.TIME_UNITS_MAP));
|
8978
|
+
exports.TIME_UNITS_LEN = exports.TIME_UNITS.length;
|
8979
|
+
exports.PRESETS = Object.freeze({
|
8980
|
+
"@yearly": "0 0 0 1 1 *",
|
8981
|
+
"@monthly": "0 0 0 1 * *",
|
8982
|
+
"@weekly": "0 0 0 * * 0",
|
8983
|
+
"@daily": "0 0 0 * * *",
|
8984
|
+
"@hourly": "0 0 * * * *",
|
8985
|
+
"@minutely": "0 * * * * *",
|
8986
|
+
"@secondly": "* * * * * *",
|
8987
|
+
"@weekdays": "0 0 0 * * 1-5",
|
8988
|
+
"@weekends": "0 0 0 * * 0,6"
|
8989
|
+
});
|
8990
|
+
exports.RE_WILDCARDS = /\*/g;
|
8991
|
+
exports.RE_RANGE = /^(\d+)(?:-(\d+))?(?:\/(\d+))?$/g;
|
8992
|
+
}(constants));
|
8982
8993
|
|
8983
8994
|
var errors = {};
|
8984
8995
|
|
@@ -9151,6 +9162,7 @@ function _defineProperties$1(target, props) {
|
|
9151
9162
|
}
|
9152
9163
|
function _create_class$1(Constructor, protoProps, staticProps) {
|
9153
9164
|
if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
|
9165
|
+
if (staticProps) _defineProperties$1(Constructor, staticProps);
|
9154
9166
|
return Constructor;
|
9155
9167
|
}
|
9156
9168
|
function _instanceof$1(left, right) {
|
@@ -9225,14 +9237,14 @@ var CronTime = /*#__PURE__*/ function() {
|
|
9225
9237
|
this.month = {};
|
9226
9238
|
this.dayOfWeek = {};
|
9227
9239
|
if (timeZone != null && utcOffset != null) {
|
9228
|
-
throw new errors_1$1.ExclusiveParametersError(
|
9240
|
+
throw new errors_1$1.ExclusiveParametersError("timeZone", "utcOffset");
|
9229
9241
|
}
|
9230
9242
|
if (timeZone) {
|
9231
9243
|
var dt = luxon_1.DateTime.fromObject({}, {
|
9232
9244
|
zone: timeZone
|
9233
9245
|
});
|
9234
9246
|
if (!dt.isValid) {
|
9235
|
-
throw new errors_1$1.CronError(
|
9247
|
+
throw new errors_1$1.CronError("Invalid timezone.");
|
9236
9248
|
}
|
9237
9249
|
this.timeZone = timeZone;
|
9238
9250
|
}
|
@@ -9262,20 +9274,20 @@ var CronTime = /*#__PURE__*/ function() {
|
|
9262
9274
|
date = date.setZone(this.timeZone);
|
9263
9275
|
}
|
9264
9276
|
if (this.utcOffset !== undefined) {
|
9265
|
-
var sign = this.utcOffset < 0 ?
|
9277
|
+
var sign = this.utcOffset < 0 ? "-" : "+";
|
9266
9278
|
var offsetHours = Math.trunc(this.utcOffset / 60);
|
9267
|
-
var offsetHoursStr = String(Math.abs(offsetHours)).padStart(2,
|
9279
|
+
var offsetHoursStr = String(Math.abs(offsetHours)).padStart(2, "0");
|
9268
9280
|
var offsetMins = Math.abs(this.utcOffset - offsetHours * 60);
|
9269
|
-
var offsetMinsStr = String(offsetMins).padStart(2,
|
9281
|
+
var offsetMinsStr = String(offsetMins).padStart(2, "0");
|
9270
9282
|
var utcZone = "UTC".concat(sign).concat(offsetHoursStr, ":").concat(offsetMinsStr);
|
9271
9283
|
date = date.setZone(utcZone);
|
9272
9284
|
if (!date.isValid) {
|
9273
|
-
throw new errors_1$1.CronError(
|
9285
|
+
throw new errors_1$1.CronError("ERROR: You specified an invalid UTC offset.");
|
9274
9286
|
}
|
9275
9287
|
}
|
9276
9288
|
if (this.realDate) {
|
9277
9289
|
if (luxon_1.DateTime.local() > date) {
|
9278
|
-
throw new errors_1$1.CronError(
|
9290
|
+
throw new errors_1$1.CronError("WARNING: Date in past. Will never be fired.");
|
9279
9291
|
}
|
9280
9292
|
return date;
|
9281
9293
|
}
|
@@ -9300,7 +9312,7 @@ var CronTime = /*#__PURE__*/ function() {
|
|
9300
9312
|
{
|
9301
9313
|
key: "toString",
|
9302
9314
|
value: function toString() {
|
9303
|
-
return this.toJSON().join(
|
9315
|
+
return this.toJSON().join(" ");
|
9304
9316
|
}
|
9305
9317
|
},
|
9306
9318
|
{
|
@@ -9333,7 +9345,7 @@ var CronTime = /*#__PURE__*/ function() {
|
|
9333
9345
|
}
|
9334
9346
|
}
|
9335
9347
|
if (!date.isValid) {
|
9336
|
-
throw new errors_1$1.CronError(
|
9348
|
+
throw new errors_1$1.CronError("ERROR: You specified an invalid date.");
|
9337
9349
|
}
|
9338
9350
|
var maxMatch = luxon_1.DateTime.now().plus({
|
9339
9351
|
years: 8
|
@@ -9599,13 +9611,13 @@ var CronTime = /*#__PURE__*/ function() {
|
|
9599
9611
|
key: "_wcOrAll",
|
9600
9612
|
value: function _wcOrAll(unit) {
|
9601
9613
|
if (this._hasAll(unit)) {
|
9602
|
-
return
|
9614
|
+
return "*";
|
9603
9615
|
}
|
9604
9616
|
var all = [];
|
9605
9617
|
for(var time in this[unit]){
|
9606
9618
|
all.push(time);
|
9607
9619
|
}
|
9608
|
-
return all.join(
|
9620
|
+
return all.join(",");
|
9609
9621
|
}
|
9610
9622
|
},
|
9611
9623
|
{
|
@@ -9638,10 +9650,10 @@ var CronTime = /*#__PURE__*/ function() {
|
|
9638
9650
|
});
|
9639
9651
|
var units = source.trim().split(/\s+/);
|
9640
9652
|
if (units.length < constants_1.TIME_UNITS_LEN - 1) {
|
9641
|
-
throw new errors_1$1.CronError(
|
9653
|
+
throw new errors_1$1.CronError("Too few fields");
|
9642
9654
|
}
|
9643
9655
|
if (units.length > constants_1.TIME_UNITS_LEN) {
|
9644
|
-
throw new errors_1$1.CronError(
|
9656
|
+
throw new errors_1$1.CronError("Too many fields");
|
9645
9657
|
}
|
9646
9658
|
var unitsLen = units.length;
|
9647
9659
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
@@ -9676,15 +9688,15 @@ var CronTime = /*#__PURE__*/ function() {
|
|
9676
9688
|
var constraints = constants_1.CONSTRAINTS[unit];
|
9677
9689
|
var low = constraints[0];
|
9678
9690
|
var high = constraints[1];
|
9679
|
-
var fields = value.split(
|
9691
|
+
var fields = value.split(",");
|
9680
9692
|
fields.forEach(function(field) {
|
9681
|
-
var wildcardIndex = field.indexOf(
|
9693
|
+
var wildcardIndex = field.indexOf("*");
|
9682
9694
|
if (wildcardIndex !== -1 && wildcardIndex !== 0) {
|
9683
9695
|
throw new errors_1$1.CronError("Field (".concat(field, ") has an invalid wildcard expression"));
|
9684
9696
|
}
|
9685
9697
|
});
|
9686
9698
|
value = value.replace(constants_1.RE_WILDCARDS, "".concat(low, "-").concat(high));
|
9687
|
-
var allRanges = value.split(
|
9699
|
+
var allRanges = value.split(",");
|
9688
9700
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
9689
9701
|
try {
|
9690
9702
|
for(var _iterator = allRanges[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
@@ -9695,7 +9707,7 @@ var CronTime = /*#__PURE__*/ function() {
|
|
9695
9707
|
var lower = parseInt(mLower, 10);
|
9696
9708
|
var upper = mUpper !== undefined ? parseInt(mUpper, 10) : undefined;
|
9697
9709
|
var wasStepDefined = mStep !== undefined;
|
9698
|
-
var step = parseInt(mStep !== null && mStep !== void 0 ? mStep :
|
9710
|
+
var step = parseInt(mStep !== null && mStep !== void 0 ? mStep : "1", 10);
|
9699
9711
|
if (step === 0) {
|
9700
9712
|
throw new errors_1$1.CronError("Field (".concat(unit, ") has a step of zero"));
|
9701
9713
|
}
|
@@ -9717,7 +9729,7 @@ var CronTime = /*#__PURE__*/ function() {
|
|
9717
9729
|
typeObj[pointer] = true;
|
9718
9730
|
pointer += step;
|
9719
9731
|
}while (pointer <= upper);
|
9720
|
-
if (unit ===
|
9732
|
+
if (unit === "dayOfWeek") {
|
9721
9733
|
if (!typeObj[0] && !!typeObj[7]) typeObj[0] = typeObj[7];
|
9722
9734
|
delete typeObj[7];
|
9723
9735
|
}
|
@@ -9929,7 +9941,7 @@ Object.defineProperty(job, "__esModule", {
|
|
9929
9941
|
value: true
|
9930
9942
|
});
|
9931
9943
|
job.CronJob = void 0;
|
9932
|
-
var child_process_1 = require$$
|
9944
|
+
var child_process_1 = require$$0__default["default"];
|
9933
9945
|
var errors_1 = errors;
|
9934
9946
|
var time_1 = time;
|
9935
9947
|
var CronJob = /*#__PURE__*/ function() {
|
@@ -9946,7 +9958,7 @@ var CronJob = /*#__PURE__*/ function() {
|
|
9946
9958
|
this.waitForCompletion = Boolean(waitForCompletion);
|
9947
9959
|
this.errorHandler = errorHandler;
|
9948
9960
|
if (timeZone != null && utcOffset != null) {
|
9949
|
-
throw new errors_1.ExclusiveParametersError(
|
9961
|
+
throw new errors_1.ExclusiveParametersError("timeZone", "utcOffset");
|
9950
9962
|
}
|
9951
9963
|
if (timeZone != null) {
|
9952
9964
|
this.cronTime = new time_1.CronTime(cronTime, timeZone, null);
|
@@ -9983,16 +9995,16 @@ var CronJob = /*#__PURE__*/ function() {
|
|
9983
9995
|
value: function _fnWrap(cmd) {
|
9984
9996
|
var _a, _b;
|
9985
9997
|
switch(typeof cmd === "undefined" ? "undefined" : _type_of(cmd)){
|
9986
|
-
case
|
9998
|
+
case "function":
|
9987
9999
|
{
|
9988
10000
|
return cmd;
|
9989
10001
|
}
|
9990
|
-
case
|
10002
|
+
case "string":
|
9991
10003
|
{
|
9992
|
-
var _cmd_split = _to_array(cmd.split(
|
10004
|
+
var _cmd_split = _to_array(cmd.split(" ")), command = _cmd_split[0], args = _cmd_split.slice(1);
|
9993
10005
|
return child_process_1.spawn.bind(undefined, command !== null && command !== void 0 ? command : cmd, args, {});
|
9994
10006
|
}
|
9995
|
-
case
|
10007
|
+
case "object":
|
9996
10008
|
{
|
9997
10009
|
return child_process_1.spawn.bind(undefined, cmd.command, (_a = cmd.args) !== null && _a !== void 0 ? _a : [], (_b = cmd.options) !== null && _b !== void 0 ? _b : {});
|
9998
10010
|
}
|
@@ -10002,7 +10014,7 @@ var CronJob = /*#__PURE__*/ function() {
|
|
10002
10014
|
{
|
10003
10015
|
key: "addCallback",
|
10004
10016
|
value: function addCallback(callback) {
|
10005
|
-
if (typeof callback ===
|
10017
|
+
if (typeof callback === "function") {
|
10006
10018
|
this._callbacks.push(callback);
|
10007
10019
|
}
|
10008
10020
|
}
|
@@ -10011,7 +10023,7 @@ var CronJob = /*#__PURE__*/ function() {
|
|
10011
10023
|
key: "setTime",
|
10012
10024
|
value: function setTime(time) {
|
10013
10025
|
if (!_instanceof(time, time_1.CronTime)) {
|
10014
|
-
throw new errors_1.CronError(
|
10026
|
+
throw new errors_1.CronError("time must be an instance of CronTime.");
|
10015
10027
|
}
|
10016
10028
|
var wasRunning = this.running;
|
10017
10029
|
this.stop();
|
@@ -10115,7 +10127,7 @@ var CronJob = /*#__PURE__*/ function() {
|
|
10115
10127
|
case 10:
|
10116
10128
|
error = _state.sent();
|
10117
10129
|
if (this.errorHandler != null) this.errorHandler(error);
|
10118
|
-
else console.error(
|
10130
|
+
else console.error("[Cron] error in callback", error);
|
10119
10131
|
return [
|
10120
10132
|
3,
|
10121
10133
|
12
|
@@ -10152,7 +10164,7 @@ var CronJob = /*#__PURE__*/ function() {
|
|
10152
10164
|
var setCronTimeout = function(t) {
|
10153
10165
|
startTime = Date.now();
|
10154
10166
|
_this._timeout = setTimeout(callbackWrapper, t);
|
10155
|
-
if (_this.unrefTimeout && typeof _this._timeout.unref ===
|
10167
|
+
if (_this.unrefTimeout && typeof _this._timeout.unref === "function") {
|
10156
10168
|
_this._timeout.unref();
|
10157
10169
|
}
|
10158
10170
|
};
|
@@ -10207,7 +10219,7 @@ var CronJob = /*#__PURE__*/ function() {
|
|
10207
10219
|
return _ts_generator(this, function(_state) {
|
10208
10220
|
switch(_state.label){
|
10209
10221
|
case 0:
|
10210
|
-
if (typeof this.onComplete !==
|
10222
|
+
if (typeof this.onComplete !== "function") return [
|
10211
10223
|
2
|
10212
10224
|
];
|
10213
10225
|
_state.label = 1;
|
@@ -10230,7 +10242,7 @@ var CronJob = /*#__PURE__*/ function() {
|
|
10230
10242
|
];
|
10231
10243
|
case 3:
|
10232
10244
|
error = _state.sent();
|
10233
|
-
console.error(
|
10245
|
+
console.error("[Cron] error in onComplete callback:", error);
|
10234
10246
|
return [
|
10235
10247
|
3,
|
10236
10248
|
4
|
@@ -10317,7 +10329,7 @@ var CronJob = /*#__PURE__*/ function() {
|
|
10317
10329
|
key: "from",
|
10318
10330
|
value: function from(params) {
|
10319
10331
|
if (params.timeZone != null && params.utcOffset != null) {
|
10320
|
-
throw new errors_1.ExclusiveParametersError(
|
10332
|
+
throw new errors_1.ExclusiveParametersError("timeZone", "utcOffset");
|
10321
10333
|
}
|
10322
10334
|
if (params.timeZone != null) {
|
10323
10335
|
return new CronJob(params.cronTime, params.onTick, params.onComplete, params.start, params.timeZone, params.context, params.runOnInit, params.utcOffset, params.unrefTimeout, params.waitForCompletion, params.errorHandler);
|
@@ -10334,34 +10346,34 @@ var CronJob = /*#__PURE__*/ function() {
|
|
10334
10346
|
job.CronJob = CronJob;
|
10335
10347
|
|
10336
10348
|
(function (exports) {
|
10337
|
-
|
10338
|
-
|
10339
|
-
|
10340
|
-
|
10341
|
-
|
10342
|
-
|
10343
|
-
|
10344
|
-
|
10345
|
-
|
10346
|
-
|
10347
|
-
|
10348
|
-
|
10349
|
-
|
10350
|
-
|
10351
|
-
|
10352
|
-
|
10353
|
-
|
10354
|
-
|
10355
|
-
|
10356
|
-
|
10357
|
-
|
10358
|
-
|
10359
|
-
|
10360
|
-
|
10361
|
-
|
10362
|
-
|
10363
|
-
|
10364
|
-
}
|
10349
|
+
Object.defineProperty(exports, "__esModule", {
|
10350
|
+
value: true
|
10351
|
+
});
|
10352
|
+
exports.timeout = exports.sendAt = exports.CronTime = exports.CronJob = void 0;
|
10353
|
+
var time_1 = time;
|
10354
|
+
var job_1 = job;
|
10355
|
+
Object.defineProperty(exports, "CronJob", {
|
10356
|
+
enumerable: true,
|
10357
|
+
get: function get() {
|
10358
|
+
return job_1.CronJob;
|
10359
|
+
}
|
10360
|
+
});
|
10361
|
+
var time_2 = time;
|
10362
|
+
Object.defineProperty(exports, "CronTime", {
|
10363
|
+
enumerable: true,
|
10364
|
+
get: function get() {
|
10365
|
+
return time_2.CronTime;
|
10366
|
+
}
|
10367
|
+
});
|
10368
|
+
var sendAt = function(cronTime) {
|
10369
|
+
return new time_1.CronTime(cronTime).sendAt();
|
10370
|
+
};
|
10371
|
+
exports.sendAt = sendAt;
|
10372
|
+
var timeout = function(cronTime) {
|
10373
|
+
return new time_1.CronTime(cronTime).getTimeout();
|
10374
|
+
};
|
10375
|
+
exports.timeout = timeout;
|
10376
|
+
}(dist));
|
10365
10377
|
|
10366
10378
|
/**
|
10367
10379
|
* Convert array of 16 byte values to UUID string format of the form:
|
@@ -10377,7 +10389,7 @@ function unsafeStringify(arr) {
|
|
10377
10389
|
//
|
10378
10390
|
// Note to future-self: No, you can't remove the `toLowerCase()` call.
|
10379
10391
|
// REF: https://github.com/uuidjs/uuid/pull/677#issuecomment-1757351351
|
10380
|
-
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] +
|
10392
|
+
return (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();
|
10381
10393
|
}
|
10382
10394
|
|
10383
10395
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
@@ -10389,21 +10401,21 @@ function rng() {
|
|
10389
10401
|
// lazy load so that environments that need to polyfill have a chance to do so
|
10390
10402
|
if (!getRandomValues) {
|
10391
10403
|
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
10392
|
-
getRandomValues = typeof crypto !==
|
10404
|
+
getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
10393
10405
|
if (!getRandomValues) {
|
10394
|
-
throw new Error(
|
10406
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
10395
10407
|
}
|
10396
10408
|
}
|
10397
10409
|
return getRandomValues(rnds8);
|
10398
10410
|
}
|
10399
10411
|
|
10400
|
-
var randomUUID = typeof crypto !==
|
10412
|
+
var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
10401
10413
|
var native = {
|
10402
10414
|
randomUUID: randomUUID
|
10403
10415
|
};
|
10404
10416
|
|
10405
10417
|
function v4(options, buf, offset) {
|
10406
|
-
if (native.randomUUID &&
|
10418
|
+
if (native.randomUUID && !buf && !options) {
|
10407
10419
|
return native.randomUUID();
|
10408
10420
|
}
|
10409
10421
|
options = options || {};
|
@@ -10411,6 +10423,14 @@ function v4(options, buf, offset) {
|
|
10411
10423
|
// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
10412
10424
|
rnds[6] = rnds[6] & 0x0f | 0x40;
|
10413
10425
|
rnds[8] = rnds[8] & 0x3f | 0x80;
|
10426
|
+
// Copy bytes to buffer, if provided
|
10427
|
+
if (buf) {
|
10428
|
+
offset = offset || 0;
|
10429
|
+
for(var i = 0; i < 16; ++i){
|
10430
|
+
buf[offset + i] = rnds[i];
|
10431
|
+
}
|
10432
|
+
return buf;
|
10433
|
+
}
|
10414
10434
|
return unsafeStringify(rnds);
|
10415
10435
|
}
|
10416
10436
|
|