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