@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
package/index.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export * from './libs/skill-cron/src/index';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { promises } from 'fs';
|
2
2
|
import require$$0 from 'child_process';
|
3
3
|
|
4
|
-
var commonjsGlobal = typeof globalThis !==
|
4
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
5
5
|
|
6
6
|
var dist = {};
|
7
7
|
|
@@ -156,6 +156,11 @@ function ownKeys(object, enumerableOnly) {
|
|
156
156
|
var keys = Object.keys(object);
|
157
157
|
if (Object.getOwnPropertySymbols) {
|
158
158
|
var symbols = Object.getOwnPropertySymbols(object);
|
159
|
+
if (enumerableOnly) {
|
160
|
+
symbols = symbols.filter(function(sym) {
|
161
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
162
|
+
});
|
163
|
+
}
|
159
164
|
keys.push.apply(keys, symbols);
|
160
165
|
}
|
161
166
|
return keys;
|
@@ -279,7 +284,7 @@ function _create_super$1(Derived) {
|
|
279
284
|
return _possible_constructor_return$1(this, result);
|
280
285
|
};
|
281
286
|
}
|
282
|
-
Object.defineProperty(luxon,
|
287
|
+
Object.defineProperty(luxon, "__esModule", {
|
283
288
|
value: true
|
284
289
|
});
|
285
290
|
// these aren't really private, but nor are they really useful to document
|
@@ -1826,7 +1831,7 @@ var singleton = null;
|
|
1826
1831
|
else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);
|
1827
1832
|
} else if (isNumber(input)) {
|
1828
1833
|
return FixedOffsetZone.instance(input);
|
1829
|
-
} else if (
|
1834
|
+
} else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") {
|
1830
1835
|
// This is dumb, but the instanceof check above doesn't seem to really work
|
1831
1836
|
// so we're duck checking it
|
1832
1837
|
return input;
|
@@ -1835,26 +1840,26 @@ var singleton = null;
|
|
1835
1840
|
}
|
1836
1841
|
}
|
1837
1842
|
var numberingSystems = {
|
1838
|
-
arab: "[
|
1839
|
-
arabext: "[
|
1840
|
-
bali: "[
|
1841
|
-
beng: "[
|
1842
|
-
deva: "[
|
1843
|
-
fullwide: "[
|
1844
|
-
gujr: "[
|
1843
|
+
arab: "[٠-٩]",
|
1844
|
+
arabext: "[۰-۹]",
|
1845
|
+
bali: "[᭐-᭙]",
|
1846
|
+
beng: "[০-৯]",
|
1847
|
+
deva: "[०-९]",
|
1848
|
+
fullwide: "[0-9]",
|
1849
|
+
gujr: "[૦-૯]",
|
1845
1850
|
hanidec: "[〇|一|二|三|四|五|六|七|八|九]",
|
1846
|
-
khmr: "[
|
1847
|
-
knda: "[
|
1848
|
-
laoo: "[
|
1849
|
-
limb: "[
|
1850
|
-
mlym: "[
|
1851
|
-
mong: "[
|
1852
|
-
mymr: "[
|
1853
|
-
orya: "[
|
1854
|
-
tamldec: "[
|
1855
|
-
telu: "[
|
1856
|
-
thai: "[
|
1857
|
-
tibt: "[
|
1851
|
+
khmr: "[០-៩]",
|
1852
|
+
knda: "[೦-೯]",
|
1853
|
+
laoo: "[໐-໙]",
|
1854
|
+
limb: "[᥆-᥏]",
|
1855
|
+
mlym: "[൦-൯]",
|
1856
|
+
mong: "[᠐-᠙]",
|
1857
|
+
mymr: "[၀-၉]",
|
1858
|
+
orya: "[୦-୯]",
|
1859
|
+
tamldec: "[௦-௯]",
|
1860
|
+
telu: "[౦-౯]",
|
1861
|
+
thai: "[๐-๙]",
|
1862
|
+
tibt: "[༠-༩]",
|
1858
1863
|
latn: "\\d"
|
1859
1864
|
};
|
1860
1865
|
var numberingSystemsUTF16 = {
|
@@ -2411,7 +2416,7 @@ function hasOwnProperty(obj, prop) {
|
|
2411
2416
|
function validateWeekSettings(settings) {
|
2412
2417
|
if (settings == null) {
|
2413
2418
|
return null;
|
2414
|
-
} else if (
|
2419
|
+
} else if (typeof settings !== "object") {
|
2415
2420
|
throw new InvalidArgumentError("Week settings must be an object");
|
2416
2421
|
} else {
|
2417
2422
|
if (!integerBetween(settings.firstDay, 1, 7) || !integerBetween(settings.minimalDays, 1, 7) || !Array.isArray(settings.weekend) || settings.weekend.some(function(v) {
|
@@ -4590,7 +4595,7 @@ function removeZeroes(vals) {
|
|
4590
4595
|
* @return {Duration}
|
4591
4596
|
*/ function fromObject(obj) {
|
4592
4597
|
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
4593
|
-
if (obj == null ||
|
4598
|
+
if (obj == null || typeof obj !== "object") {
|
4594
4599
|
throw new InvalidArgumentError("Duration.fromObject: argument expected to be an object, got ".concat(obj === null ? "null" : typeof obj === "undefined" ? "undefined" : _type_of$2(obj)));
|
4595
4600
|
}
|
4596
4601
|
return new Duration({
|
@@ -4617,7 +4622,7 @@ function removeZeroes(vals) {
|
|
4617
4622
|
return Duration.fromMillis(durationLike);
|
4618
4623
|
} else if (Duration.isDuration(durationLike)) {
|
4619
4624
|
return durationLike;
|
4620
|
-
} else if (
|
4625
|
+
} else if (typeof durationLike === "object") {
|
4621
4626
|
return Duration.fromObject(durationLike);
|
4622
4627
|
} else {
|
4623
4628
|
throw new InvalidArgumentError("Unknown duration argument ".concat(durationLike, " of type ").concat(typeof durationLike === "undefined" ? "undefined" : _type_of$2(durationLike)));
|
@@ -6076,7 +6081,7 @@ function tokenForPart(part, formatOpts, resolvedOpts) {
|
|
6076
6081
|
}
|
6077
6082
|
}
|
6078
6083
|
var val = partTypeStyleToTokenVal[actualType];
|
6079
|
-
if (
|
6084
|
+
if (typeof val === "object") {
|
6080
6085
|
val = val[style];
|
6081
6086
|
}
|
6082
6087
|
if (val) {
|
@@ -6719,7 +6724,7 @@ function diffRelative(start, end, opts) {
|
|
6719
6724
|
}
|
6720
6725
|
function lastOpts(argList) {
|
6721
6726
|
var opts = {}, args;
|
6722
|
-
if (argList.length > 0 &&
|
6727
|
+
if (argList.length > 0 && typeof argList[argList.length - 1] === "object") {
|
6723
6728
|
opts = argList[argList.length - 1];
|
6724
6729
|
args = Array.from(argList).slice(0, argList.length - 1);
|
6725
6730
|
} else {
|
@@ -8872,7 +8877,7 @@ function lastOpts(argList) {
|
|
8872
8877
|
return dateTimeish;
|
8873
8878
|
} else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {
|
8874
8879
|
return DateTime.fromJSDate(dateTimeish);
|
8875
|
-
} else if (dateTimeish &&
|
8880
|
+
} else if (dateTimeish && typeof dateTimeish === "object") {
|
8876
8881
|
return DateTime.fromObject(dateTimeish);
|
8877
8882
|
} else {
|
8878
8883
|
throw new InvalidArgumentError("Unknown datetime argument: ".concat(dateTimeish, ", of type ").concat(typeof dateTimeish === "undefined" ? "undefined" : _type_of$2(dateTimeish)));
|
@@ -8894,89 +8899,89 @@ luxon.Zone = Zone;
|
|
8894
8899
|
var constants = {};
|
8895
8900
|
|
8896
8901
|
(function (exports) {
|
8897
|
-
|
8898
|
-
|
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
|
-
}
|
8902
|
+
Object.defineProperty(exports, "__esModule", {
|
8903
|
+
value: true
|
8904
|
+
});
|
8905
|
+
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;
|
8906
|
+
exports.CONSTRAINTS = Object.freeze({
|
8907
|
+
second: [
|
8908
|
+
0,
|
8909
|
+
59
|
8910
|
+
],
|
8911
|
+
minute: [
|
8912
|
+
0,
|
8913
|
+
59
|
8914
|
+
],
|
8915
|
+
hour: [
|
8916
|
+
0,
|
8917
|
+
23
|
8918
|
+
],
|
8919
|
+
dayOfMonth: [
|
8920
|
+
1,
|
8921
|
+
31
|
8922
|
+
],
|
8923
|
+
month: [
|
8924
|
+
1,
|
8925
|
+
12
|
8926
|
+
],
|
8927
|
+
dayOfWeek: [
|
8928
|
+
0,
|
8929
|
+
7
|
8930
|
+
]
|
8931
|
+
});
|
8932
|
+
exports.PARSE_DEFAULTS = Object.freeze({
|
8933
|
+
second: "0",
|
8934
|
+
minute: "*",
|
8935
|
+
hour: "*",
|
8936
|
+
dayOfMonth: "*",
|
8937
|
+
month: "*",
|
8938
|
+
dayOfWeek: "*"
|
8939
|
+
});
|
8940
|
+
exports.ALIASES = Object.freeze({
|
8941
|
+
jan: 1,
|
8942
|
+
feb: 2,
|
8943
|
+
mar: 3,
|
8944
|
+
apr: 4,
|
8945
|
+
may: 5,
|
8946
|
+
jun: 6,
|
8947
|
+
jul: 7,
|
8948
|
+
aug: 8,
|
8949
|
+
sep: 9,
|
8950
|
+
oct: 10,
|
8951
|
+
nov: 11,
|
8952
|
+
dec: 12,
|
8953
|
+
sun: 0,
|
8954
|
+
mon: 1,
|
8955
|
+
tue: 2,
|
8956
|
+
wed: 3,
|
8957
|
+
thu: 4,
|
8958
|
+
fri: 5,
|
8959
|
+
sat: 6
|
8960
|
+
});
|
8961
|
+
exports.TIME_UNITS_MAP = Object.freeze({
|
8962
|
+
SECOND: "second",
|
8963
|
+
MINUTE: "minute",
|
8964
|
+
HOUR: "hour",
|
8965
|
+
DAY_OF_MONTH: "dayOfMonth",
|
8966
|
+
MONTH: "month",
|
8967
|
+
DAY_OF_WEEK: "dayOfWeek"
|
8968
|
+
});
|
8969
|
+
exports.TIME_UNITS = Object.freeze(Object.values(exports.TIME_UNITS_MAP));
|
8970
|
+
exports.TIME_UNITS_LEN = exports.TIME_UNITS.length;
|
8971
|
+
exports.PRESETS = Object.freeze({
|
8972
|
+
"@yearly": "0 0 0 1 1 *",
|
8973
|
+
"@monthly": "0 0 0 1 * *",
|
8974
|
+
"@weekly": "0 0 0 * * 0",
|
8975
|
+
"@daily": "0 0 0 * * *",
|
8976
|
+
"@hourly": "0 0 * * * *",
|
8977
|
+
"@minutely": "0 * * * * *",
|
8978
|
+
"@secondly": "* * * * * *",
|
8979
|
+
"@weekdays": "0 0 0 * * 1-5",
|
8980
|
+
"@weekends": "0 0 0 * * 0,6"
|
8981
|
+
});
|
8982
|
+
exports.RE_WILDCARDS = /\*/g;
|
8983
|
+
exports.RE_RANGE = /^(\d+)(?:-(\d+))?(?:\/(\d+))?$/g;
|
8984
|
+
}(constants));
|
8980
8985
|
|
8981
8986
|
var errors = {};
|
8982
8987
|
|
@@ -9149,6 +9154,7 @@ function _defineProperties$1(target, props) {
|
|
9149
9154
|
}
|
9150
9155
|
function _create_class$1(Constructor, protoProps, staticProps) {
|
9151
9156
|
if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
|
9157
|
+
if (staticProps) _defineProperties$1(Constructor, staticProps);
|
9152
9158
|
return Constructor;
|
9153
9159
|
}
|
9154
9160
|
function _instanceof$1(left, right) {
|
@@ -9223,14 +9229,14 @@ var CronTime = /*#__PURE__*/ function() {
|
|
9223
9229
|
this.month = {};
|
9224
9230
|
this.dayOfWeek = {};
|
9225
9231
|
if (timeZone != null && utcOffset != null) {
|
9226
|
-
throw new errors_1$1.ExclusiveParametersError(
|
9232
|
+
throw new errors_1$1.ExclusiveParametersError("timeZone", "utcOffset");
|
9227
9233
|
}
|
9228
9234
|
if (timeZone) {
|
9229
9235
|
var dt = luxon_1.DateTime.fromObject({}, {
|
9230
9236
|
zone: timeZone
|
9231
9237
|
});
|
9232
9238
|
if (!dt.isValid) {
|
9233
|
-
throw new errors_1$1.CronError(
|
9239
|
+
throw new errors_1$1.CronError("Invalid timezone.");
|
9234
9240
|
}
|
9235
9241
|
this.timeZone = timeZone;
|
9236
9242
|
}
|
@@ -9260,20 +9266,20 @@ var CronTime = /*#__PURE__*/ function() {
|
|
9260
9266
|
date = date.setZone(this.timeZone);
|
9261
9267
|
}
|
9262
9268
|
if (this.utcOffset !== undefined) {
|
9263
|
-
var sign = this.utcOffset < 0 ?
|
9269
|
+
var sign = this.utcOffset < 0 ? "-" : "+";
|
9264
9270
|
var offsetHours = Math.trunc(this.utcOffset / 60);
|
9265
|
-
var offsetHoursStr = String(Math.abs(offsetHours)).padStart(2,
|
9271
|
+
var offsetHoursStr = String(Math.abs(offsetHours)).padStart(2, "0");
|
9266
9272
|
var offsetMins = Math.abs(this.utcOffset - offsetHours * 60);
|
9267
|
-
var offsetMinsStr = String(offsetMins).padStart(2,
|
9273
|
+
var offsetMinsStr = String(offsetMins).padStart(2, "0");
|
9268
9274
|
var utcZone = "UTC".concat(sign).concat(offsetHoursStr, ":").concat(offsetMinsStr);
|
9269
9275
|
date = date.setZone(utcZone);
|
9270
9276
|
if (!date.isValid) {
|
9271
|
-
throw new errors_1$1.CronError(
|
9277
|
+
throw new errors_1$1.CronError("ERROR: You specified an invalid UTC offset.");
|
9272
9278
|
}
|
9273
9279
|
}
|
9274
9280
|
if (this.realDate) {
|
9275
9281
|
if (luxon_1.DateTime.local() > date) {
|
9276
|
-
throw new errors_1$1.CronError(
|
9282
|
+
throw new errors_1$1.CronError("WARNING: Date in past. Will never be fired.");
|
9277
9283
|
}
|
9278
9284
|
return date;
|
9279
9285
|
}
|
@@ -9298,7 +9304,7 @@ var CronTime = /*#__PURE__*/ function() {
|
|
9298
9304
|
{
|
9299
9305
|
key: "toString",
|
9300
9306
|
value: function toString() {
|
9301
|
-
return this.toJSON().join(
|
9307
|
+
return this.toJSON().join(" ");
|
9302
9308
|
}
|
9303
9309
|
},
|
9304
9310
|
{
|
@@ -9331,7 +9337,7 @@ var CronTime = /*#__PURE__*/ function() {
|
|
9331
9337
|
}
|
9332
9338
|
}
|
9333
9339
|
if (!date.isValid) {
|
9334
|
-
throw new errors_1$1.CronError(
|
9340
|
+
throw new errors_1$1.CronError("ERROR: You specified an invalid date.");
|
9335
9341
|
}
|
9336
9342
|
var maxMatch = luxon_1.DateTime.now().plus({
|
9337
9343
|
years: 8
|
@@ -9597,13 +9603,13 @@ var CronTime = /*#__PURE__*/ function() {
|
|
9597
9603
|
key: "_wcOrAll",
|
9598
9604
|
value: function _wcOrAll(unit) {
|
9599
9605
|
if (this._hasAll(unit)) {
|
9600
|
-
return
|
9606
|
+
return "*";
|
9601
9607
|
}
|
9602
9608
|
var all = [];
|
9603
9609
|
for(var time in this[unit]){
|
9604
9610
|
all.push(time);
|
9605
9611
|
}
|
9606
|
-
return all.join(
|
9612
|
+
return all.join(",");
|
9607
9613
|
}
|
9608
9614
|
},
|
9609
9615
|
{
|
@@ -9636,10 +9642,10 @@ var CronTime = /*#__PURE__*/ function() {
|
|
9636
9642
|
});
|
9637
9643
|
var units = source.trim().split(/\s+/);
|
9638
9644
|
if (units.length < constants_1.TIME_UNITS_LEN - 1) {
|
9639
|
-
throw new errors_1$1.CronError(
|
9645
|
+
throw new errors_1$1.CronError("Too few fields");
|
9640
9646
|
}
|
9641
9647
|
if (units.length > constants_1.TIME_UNITS_LEN) {
|
9642
|
-
throw new errors_1$1.CronError(
|
9648
|
+
throw new errors_1$1.CronError("Too many fields");
|
9643
9649
|
}
|
9644
9650
|
var unitsLen = units.length;
|
9645
9651
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
@@ -9674,15 +9680,15 @@ var CronTime = /*#__PURE__*/ function() {
|
|
9674
9680
|
var constraints = constants_1.CONSTRAINTS[unit];
|
9675
9681
|
var low = constraints[0];
|
9676
9682
|
var high = constraints[1];
|
9677
|
-
var fields = value.split(
|
9683
|
+
var fields = value.split(",");
|
9678
9684
|
fields.forEach(function(field) {
|
9679
|
-
var wildcardIndex = field.indexOf(
|
9685
|
+
var wildcardIndex = field.indexOf("*");
|
9680
9686
|
if (wildcardIndex !== -1 && wildcardIndex !== 0) {
|
9681
9687
|
throw new errors_1$1.CronError("Field (".concat(field, ") has an invalid wildcard expression"));
|
9682
9688
|
}
|
9683
9689
|
});
|
9684
9690
|
value = value.replace(constants_1.RE_WILDCARDS, "".concat(low, "-").concat(high));
|
9685
|
-
var allRanges = value.split(
|
9691
|
+
var allRanges = value.split(",");
|
9686
9692
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
9687
9693
|
try {
|
9688
9694
|
for(var _iterator = allRanges[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
@@ -9693,7 +9699,7 @@ var CronTime = /*#__PURE__*/ function() {
|
|
9693
9699
|
var lower = parseInt(mLower, 10);
|
9694
9700
|
var upper = mUpper !== undefined ? parseInt(mUpper, 10) : undefined;
|
9695
9701
|
var wasStepDefined = mStep !== undefined;
|
9696
|
-
var step = parseInt(mStep !== null && mStep !== void 0 ? mStep :
|
9702
|
+
var step = parseInt(mStep !== null && mStep !== void 0 ? mStep : "1", 10);
|
9697
9703
|
if (step === 0) {
|
9698
9704
|
throw new errors_1$1.CronError("Field (".concat(unit, ") has a step of zero"));
|
9699
9705
|
}
|
@@ -9715,7 +9721,7 @@ var CronTime = /*#__PURE__*/ function() {
|
|
9715
9721
|
typeObj[pointer] = true;
|
9716
9722
|
pointer += step;
|
9717
9723
|
}while (pointer <= upper);
|
9718
|
-
if (unit ===
|
9724
|
+
if (unit === "dayOfWeek") {
|
9719
9725
|
if (!typeObj[0] && !!typeObj[7]) typeObj[0] = typeObj[7];
|
9720
9726
|
delete typeObj[7];
|
9721
9727
|
}
|
@@ -9944,7 +9950,7 @@ var CronJob = /*#__PURE__*/ function() {
|
|
9944
9950
|
this.waitForCompletion = Boolean(waitForCompletion);
|
9945
9951
|
this.errorHandler = errorHandler;
|
9946
9952
|
if (timeZone != null && utcOffset != null) {
|
9947
|
-
throw new errors_1.ExclusiveParametersError(
|
9953
|
+
throw new errors_1.ExclusiveParametersError("timeZone", "utcOffset");
|
9948
9954
|
}
|
9949
9955
|
if (timeZone != null) {
|
9950
9956
|
this.cronTime = new time_1.CronTime(cronTime, timeZone, null);
|
@@ -9981,16 +9987,16 @@ var CronJob = /*#__PURE__*/ function() {
|
|
9981
9987
|
value: function _fnWrap(cmd) {
|
9982
9988
|
var _a, _b;
|
9983
9989
|
switch(typeof cmd === "undefined" ? "undefined" : _type_of(cmd)){
|
9984
|
-
case
|
9990
|
+
case "function":
|
9985
9991
|
{
|
9986
9992
|
return cmd;
|
9987
9993
|
}
|
9988
|
-
case
|
9994
|
+
case "string":
|
9989
9995
|
{
|
9990
|
-
var _cmd_split = _to_array(cmd.split(
|
9996
|
+
var _cmd_split = _to_array(cmd.split(" ")), command = _cmd_split[0], args = _cmd_split.slice(1);
|
9991
9997
|
return child_process_1.spawn.bind(undefined, command !== null && command !== void 0 ? command : cmd, args, {});
|
9992
9998
|
}
|
9993
|
-
case
|
9999
|
+
case "object":
|
9994
10000
|
{
|
9995
10001
|
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 : {});
|
9996
10002
|
}
|
@@ -10000,7 +10006,7 @@ var CronJob = /*#__PURE__*/ function() {
|
|
10000
10006
|
{
|
10001
10007
|
key: "addCallback",
|
10002
10008
|
value: function addCallback(callback) {
|
10003
|
-
if (typeof callback ===
|
10009
|
+
if (typeof callback === "function") {
|
10004
10010
|
this._callbacks.push(callback);
|
10005
10011
|
}
|
10006
10012
|
}
|
@@ -10009,7 +10015,7 @@ var CronJob = /*#__PURE__*/ function() {
|
|
10009
10015
|
key: "setTime",
|
10010
10016
|
value: function setTime(time) {
|
10011
10017
|
if (!_instanceof(time, time_1.CronTime)) {
|
10012
|
-
throw new errors_1.CronError(
|
10018
|
+
throw new errors_1.CronError("time must be an instance of CronTime.");
|
10013
10019
|
}
|
10014
10020
|
var wasRunning = this.running;
|
10015
10021
|
this.stop();
|
@@ -10113,7 +10119,7 @@ var CronJob = /*#__PURE__*/ function() {
|
|
10113
10119
|
case 10:
|
10114
10120
|
error = _state.sent();
|
10115
10121
|
if (this.errorHandler != null) this.errorHandler(error);
|
10116
|
-
else console.error(
|
10122
|
+
else console.error("[Cron] error in callback", error);
|
10117
10123
|
return [
|
10118
10124
|
3,
|
10119
10125
|
12
|
@@ -10150,7 +10156,7 @@ var CronJob = /*#__PURE__*/ function() {
|
|
10150
10156
|
var setCronTimeout = function(t) {
|
10151
10157
|
startTime = Date.now();
|
10152
10158
|
_this._timeout = setTimeout(callbackWrapper, t);
|
10153
|
-
if (_this.unrefTimeout && typeof _this._timeout.unref ===
|
10159
|
+
if (_this.unrefTimeout && typeof _this._timeout.unref === "function") {
|
10154
10160
|
_this._timeout.unref();
|
10155
10161
|
}
|
10156
10162
|
};
|
@@ -10205,7 +10211,7 @@ var CronJob = /*#__PURE__*/ function() {
|
|
10205
10211
|
return _ts_generator(this, function(_state) {
|
10206
10212
|
switch(_state.label){
|
10207
10213
|
case 0:
|
10208
|
-
if (typeof this.onComplete !==
|
10214
|
+
if (typeof this.onComplete !== "function") return [
|
10209
10215
|
2
|
10210
10216
|
];
|
10211
10217
|
_state.label = 1;
|
@@ -10228,7 +10234,7 @@ var CronJob = /*#__PURE__*/ function() {
|
|
10228
10234
|
];
|
10229
10235
|
case 3:
|
10230
10236
|
error = _state.sent();
|
10231
|
-
console.error(
|
10237
|
+
console.error("[Cron] error in onComplete callback:", error);
|
10232
10238
|
return [
|
10233
10239
|
3,
|
10234
10240
|
4
|
@@ -10315,7 +10321,7 @@ var CronJob = /*#__PURE__*/ function() {
|
|
10315
10321
|
key: "from",
|
10316
10322
|
value: function from(params) {
|
10317
10323
|
if (params.timeZone != null && params.utcOffset != null) {
|
10318
|
-
throw new errors_1.ExclusiveParametersError(
|
10324
|
+
throw new errors_1.ExclusiveParametersError("timeZone", "utcOffset");
|
10319
10325
|
}
|
10320
10326
|
if (params.timeZone != null) {
|
10321
10327
|
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);
|
@@ -10332,34 +10338,34 @@ var CronJob = /*#__PURE__*/ function() {
|
|
10332
10338
|
job.CronJob = CronJob;
|
10333
10339
|
|
10334
10340
|
(function (exports) {
|
10335
|
-
|
10336
|
-
|
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
|
-
}
|
10341
|
+
Object.defineProperty(exports, "__esModule", {
|
10342
|
+
value: true
|
10343
|
+
});
|
10344
|
+
exports.timeout = exports.sendAt = exports.CronTime = exports.CronJob = void 0;
|
10345
|
+
var time_1 = time;
|
10346
|
+
var job_1 = job;
|
10347
|
+
Object.defineProperty(exports, "CronJob", {
|
10348
|
+
enumerable: true,
|
10349
|
+
get: function get() {
|
10350
|
+
return job_1.CronJob;
|
10351
|
+
}
|
10352
|
+
});
|
10353
|
+
var time_2 = time;
|
10354
|
+
Object.defineProperty(exports, "CronTime", {
|
10355
|
+
enumerable: true,
|
10356
|
+
get: function get() {
|
10357
|
+
return time_2.CronTime;
|
10358
|
+
}
|
10359
|
+
});
|
10360
|
+
var sendAt = function(cronTime) {
|
10361
|
+
return new time_1.CronTime(cronTime).sendAt();
|
10362
|
+
};
|
10363
|
+
exports.sendAt = sendAt;
|
10364
|
+
var timeout = function(cronTime) {
|
10365
|
+
return new time_1.CronTime(cronTime).getTimeout();
|
10366
|
+
};
|
10367
|
+
exports.timeout = timeout;
|
10368
|
+
}(dist));
|
10363
10369
|
|
10364
10370
|
/**
|
10365
10371
|
* Convert array of 16 byte values to UUID string format of the form:
|
@@ -10375,7 +10381,7 @@ function unsafeStringify(arr) {
|
|
10375
10381
|
//
|
10376
10382
|
// Note to future-self: No, you can't remove the `toLowerCase()` call.
|
10377
10383
|
// REF: https://github.com/uuidjs/uuid/pull/677#issuecomment-1757351351
|
10378
|
-
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] +
|
10384
|
+
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();
|
10379
10385
|
}
|
10380
10386
|
|
10381
10387
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
@@ -10387,21 +10393,21 @@ function rng() {
|
|
10387
10393
|
// lazy load so that environments that need to polyfill have a chance to do so
|
10388
10394
|
if (!getRandomValues) {
|
10389
10395
|
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
10390
|
-
getRandomValues = typeof crypto !==
|
10396
|
+
getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
10391
10397
|
if (!getRandomValues) {
|
10392
|
-
throw new Error(
|
10398
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
10393
10399
|
}
|
10394
10400
|
}
|
10395
10401
|
return getRandomValues(rnds8);
|
10396
10402
|
}
|
10397
10403
|
|
10398
|
-
var randomUUID = typeof crypto !==
|
10404
|
+
var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
10399
10405
|
var native = {
|
10400
10406
|
randomUUID: randomUUID
|
10401
10407
|
};
|
10402
10408
|
|
10403
10409
|
function v4(options, buf, offset) {
|
10404
|
-
if (native.randomUUID &&
|
10410
|
+
if (native.randomUUID && !buf && !options) {
|
10405
10411
|
return native.randomUUID();
|
10406
10412
|
}
|
10407
10413
|
options = options || {};
|
@@ -10409,6 +10415,14 @@ function v4(options, buf, offset) {
|
|
10409
10415
|
// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
10410
10416
|
rnds[6] = rnds[6] & 0x0f | 0x40;
|
10411
10417
|
rnds[8] = rnds[8] & 0x3f | 0x80;
|
10418
|
+
// Copy bytes to buffer, if provided
|
10419
|
+
if (buf) {
|
10420
|
+
offset = offset || 0;
|
10421
|
+
for(var i = 0; i < 16; ++i){
|
10422
|
+
buf[offset + i] = rnds[i];
|
10423
|
+
}
|
10424
|
+
return buf;
|
10425
|
+
}
|
10412
10426
|
return unsafeStringify(rnds);
|
10413
10427
|
}
|
10414
10428
|
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './lib/skill-cron';
|
@@ -14,4 +14,3 @@ export declare const deleteCron: (params: any, pinsSettingsList: PinsSettings[],
|
|
14
14
|
}>;
|
15
15
|
export declare const enableCron: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
16
16
|
export declare const disableCron: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
17
|
-
//# sourceMappingURL=skill-cron.d.ts.map
|