@qodalis/cli-cron 2.0.0-beta.8 → 2.0.0-rc.1
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/package.json +2 -2
- package/public-api.d.mts +2 -1
- package/public-api.d.ts +2 -1
- package/public-api.js +51 -16
- package/public-api.js.map +1 -1
- package/public-api.mjs +52 -17
- package/public-api.mjs.map +1 -1
- package/umd/index.global.js +330 -92
package/umd/index.global.js
CHANGED
|
@@ -8,7 +8,11 @@ var cron = (() => {
|
|
|
8
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
10
|
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
-
|
|
11
|
+
try {
|
|
12
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
13
|
+
} catch (e) {
|
|
14
|
+
throw mod = 0, e;
|
|
15
|
+
}
|
|
12
16
|
};
|
|
13
17
|
var __copyProps = (to, from, except, desc) => {
|
|
14
18
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -27,7 +31,7 @@ var cron = (() => {
|
|
|
27
31
|
mod
|
|
28
32
|
));
|
|
29
33
|
var require_constants = __commonJS({
|
|
30
|
-
"../../node_modules/.pnpm/semver@7.
|
|
34
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js"(exports, module2) {
|
|
31
35
|
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
32
36
|
var MAX_LENGTH = 256;
|
|
33
37
|
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
@@ -56,26 +60,26 @@ var cron = (() => {
|
|
|
56
60
|
}
|
|
57
61
|
});
|
|
58
62
|
var require_debug = __commonJS({
|
|
59
|
-
"../../node_modules/.pnpm/semver@7.
|
|
63
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js"(exports, module2) {
|
|
60
64
|
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
61
65
|
};
|
|
62
66
|
module2.exports = debug;
|
|
63
67
|
}
|
|
64
68
|
});
|
|
65
69
|
var require_re = __commonJS({
|
|
66
|
-
"../../node_modules/.pnpm/semver@7.
|
|
70
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js"(exports, module2) {
|
|
67
71
|
var {
|
|
68
72
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
69
73
|
MAX_SAFE_BUILD_LENGTH,
|
|
70
74
|
MAX_LENGTH
|
|
71
75
|
} = require_constants();
|
|
72
76
|
var debug = require_debug();
|
|
73
|
-
exports
|
|
74
|
-
var re = exports
|
|
75
|
-
var safeRe = exports
|
|
76
|
-
var src = exports
|
|
77
|
-
var safeSrc = exports
|
|
78
|
-
var t = exports
|
|
77
|
+
exports = module2.exports = {};
|
|
78
|
+
var re = exports.re = [];
|
|
79
|
+
var safeRe = exports.safeRe = [];
|
|
80
|
+
var src = exports.src = [];
|
|
81
|
+
var safeSrc = exports.safeSrc = [];
|
|
82
|
+
var t = exports.t = {};
|
|
79
83
|
var R = 0;
|
|
80
84
|
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
81
85
|
var safeRegexReplacements = [
|
|
@@ -128,18 +132,18 @@ var cron = (() => {
|
|
|
128
132
|
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
129
133
|
createToken("LONETILDE", "(?:~>?)");
|
|
130
134
|
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
131
|
-
exports
|
|
135
|
+
exports.tildeTrimReplace = "$1~";
|
|
132
136
|
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
133
137
|
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
134
138
|
createToken("LONECARET", "(?:\\^)");
|
|
135
139
|
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
136
|
-
exports
|
|
140
|
+
exports.caretTrimReplace = "$1^";
|
|
137
141
|
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
138
142
|
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
139
143
|
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
140
144
|
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
141
145
|
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
142
|
-
exports
|
|
146
|
+
exports.comparatorTrimReplace = "$1$2$3";
|
|
143
147
|
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
144
148
|
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
145
149
|
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
@@ -148,7 +152,7 @@ var cron = (() => {
|
|
|
148
152
|
}
|
|
149
153
|
});
|
|
150
154
|
var require_parse_options = __commonJS({
|
|
151
|
-
"../../node_modules/.pnpm/semver@7.
|
|
155
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js"(exports, module2) {
|
|
152
156
|
var looseOption = Object.freeze({ loose: true });
|
|
153
157
|
var emptyOpts = Object.freeze({});
|
|
154
158
|
var parseOptions = (options) => {
|
|
@@ -164,7 +168,7 @@ var cron = (() => {
|
|
|
164
168
|
}
|
|
165
169
|
});
|
|
166
170
|
var require_identifiers = __commonJS({
|
|
167
|
-
"../../node_modules/.pnpm/semver@7.
|
|
171
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js"(exports, module2) {
|
|
168
172
|
var numeric = /^[0-9]+$/;
|
|
169
173
|
var compareIdentifiers = (a, b) => {
|
|
170
174
|
if (typeof a === "number" && typeof b === "number") {
|
|
@@ -186,12 +190,24 @@ var cron = (() => {
|
|
|
186
190
|
}
|
|
187
191
|
});
|
|
188
192
|
var require_semver = __commonJS({
|
|
189
|
-
"../../node_modules/.pnpm/semver@7.
|
|
193
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js"(exports, module2) {
|
|
190
194
|
var debug = require_debug();
|
|
191
195
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
192
196
|
var { safeRe: re, t } = require_re();
|
|
193
197
|
var parseOptions = require_parse_options();
|
|
194
198
|
var { compareIdentifiers } = require_identifiers();
|
|
199
|
+
var isPrereleaseIdentifier = (prerelease, identifier) => {
|
|
200
|
+
const identifiers = identifier.split(".");
|
|
201
|
+
if (identifiers.length > prerelease.length) {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
for (let i = 0; i < identifiers.length; i++) {
|
|
205
|
+
if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return true;
|
|
210
|
+
};
|
|
195
211
|
var SemVer = class _SemVer {
|
|
196
212
|
constructor(version, options) {
|
|
197
213
|
options = parseOptions(options);
|
|
@@ -438,8 +454,9 @@ var cron = (() => {
|
|
|
438
454
|
if (identifierBase === false) {
|
|
439
455
|
prerelease = [identifier];
|
|
440
456
|
}
|
|
441
|
-
if (
|
|
442
|
-
|
|
457
|
+
if (isPrereleaseIdentifier(this.prerelease, identifier)) {
|
|
458
|
+
const prereleaseBase = this.prerelease[identifier.split(".").length];
|
|
459
|
+
if (isNaN(prereleaseBase)) {
|
|
443
460
|
this.prerelease = prerelease;
|
|
444
461
|
}
|
|
445
462
|
} else {
|
|
@@ -462,7 +479,7 @@ var cron = (() => {
|
|
|
462
479
|
}
|
|
463
480
|
});
|
|
464
481
|
var require_parse = __commonJS({
|
|
465
|
-
"../../node_modules/.pnpm/semver@7.
|
|
482
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js"(exports, module2) {
|
|
466
483
|
var SemVer = require_semver();
|
|
467
484
|
var parse = (version, options, throwErrors = false) => {
|
|
468
485
|
if (version instanceof SemVer) {
|
|
@@ -481,7 +498,7 @@ var cron = (() => {
|
|
|
481
498
|
}
|
|
482
499
|
});
|
|
483
500
|
var require_valid = __commonJS({
|
|
484
|
-
"../../node_modules/.pnpm/semver@7.
|
|
501
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js"(exports, module2) {
|
|
485
502
|
var parse = require_parse();
|
|
486
503
|
var valid2 = (version, options) => {
|
|
487
504
|
const v = parse(version, options);
|
|
@@ -491,7 +508,7 @@ var cron = (() => {
|
|
|
491
508
|
}
|
|
492
509
|
});
|
|
493
510
|
var require_clean = __commonJS({
|
|
494
|
-
"../../node_modules/.pnpm/semver@7.
|
|
511
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js"(exports, module2) {
|
|
495
512
|
var parse = require_parse();
|
|
496
513
|
var clean = (version, options) => {
|
|
497
514
|
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
@@ -501,7 +518,7 @@ var cron = (() => {
|
|
|
501
518
|
}
|
|
502
519
|
});
|
|
503
520
|
var require_inc = __commonJS({
|
|
504
|
-
"../../node_modules/.pnpm/semver@7.
|
|
521
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js"(exports, module2) {
|
|
505
522
|
var SemVer = require_semver();
|
|
506
523
|
var inc = (version, release, options, identifier, identifierBase) => {
|
|
507
524
|
if (typeof options === "string") {
|
|
@@ -522,7 +539,7 @@ var cron = (() => {
|
|
|
522
539
|
}
|
|
523
540
|
});
|
|
524
541
|
var require_diff = __commonJS({
|
|
525
|
-
"../../node_modules/.pnpm/semver@7.
|
|
542
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js"(exports, module2) {
|
|
526
543
|
var parse = require_parse();
|
|
527
544
|
var diff = (version1, version2) => {
|
|
528
545
|
const v1 = parse(version1, null, true);
|
|
@@ -563,28 +580,28 @@ var cron = (() => {
|
|
|
563
580
|
}
|
|
564
581
|
});
|
|
565
582
|
var require_major = __commonJS({
|
|
566
|
-
"../../node_modules/.pnpm/semver@7.
|
|
583
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js"(exports, module2) {
|
|
567
584
|
var SemVer = require_semver();
|
|
568
585
|
var major = (a, loose) => new SemVer(a, loose).major;
|
|
569
586
|
module2.exports = major;
|
|
570
587
|
}
|
|
571
588
|
});
|
|
572
589
|
var require_minor = __commonJS({
|
|
573
|
-
"../../node_modules/.pnpm/semver@7.
|
|
590
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js"(exports, module2) {
|
|
574
591
|
var SemVer = require_semver();
|
|
575
592
|
var minor = (a, loose) => new SemVer(a, loose).minor;
|
|
576
593
|
module2.exports = minor;
|
|
577
594
|
}
|
|
578
595
|
});
|
|
579
596
|
var require_patch = __commonJS({
|
|
580
|
-
"../../node_modules/.pnpm/semver@7.
|
|
597
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js"(exports, module2) {
|
|
581
598
|
var SemVer = require_semver();
|
|
582
599
|
var patch = (a, loose) => new SemVer(a, loose).patch;
|
|
583
600
|
module2.exports = patch;
|
|
584
601
|
}
|
|
585
602
|
});
|
|
586
603
|
var require_prerelease = __commonJS({
|
|
587
|
-
"../../node_modules/.pnpm/semver@7.
|
|
604
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js"(exports, module2) {
|
|
588
605
|
var parse = require_parse();
|
|
589
606
|
var prerelease = (version, options) => {
|
|
590
607
|
const parsed = parse(version, options);
|
|
@@ -594,28 +611,28 @@ var cron = (() => {
|
|
|
594
611
|
}
|
|
595
612
|
});
|
|
596
613
|
var require_compare = __commonJS({
|
|
597
|
-
"../../node_modules/.pnpm/semver@7.
|
|
614
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js"(exports, module2) {
|
|
598
615
|
var SemVer = require_semver();
|
|
599
616
|
var compare2 = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
600
617
|
module2.exports = compare2;
|
|
601
618
|
}
|
|
602
619
|
});
|
|
603
620
|
var require_rcompare = __commonJS({
|
|
604
|
-
"../../node_modules/.pnpm/semver@7.
|
|
621
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js"(exports, module2) {
|
|
605
622
|
var compare2 = require_compare();
|
|
606
623
|
var rcompare = (a, b, loose) => compare2(b, a, loose);
|
|
607
624
|
module2.exports = rcompare;
|
|
608
625
|
}
|
|
609
626
|
});
|
|
610
627
|
var require_compare_loose = __commonJS({
|
|
611
|
-
"../../node_modules/.pnpm/semver@7.
|
|
628
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js"(exports, module2) {
|
|
612
629
|
var compare2 = require_compare();
|
|
613
630
|
var compareLoose = (a, b) => compare2(a, b, true);
|
|
614
631
|
module2.exports = compareLoose;
|
|
615
632
|
}
|
|
616
633
|
});
|
|
617
634
|
var require_compare_build = __commonJS({
|
|
618
|
-
"../../node_modules/.pnpm/semver@7.
|
|
635
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js"(exports, module2) {
|
|
619
636
|
var SemVer = require_semver();
|
|
620
637
|
var compareBuild = (a, b, loose) => {
|
|
621
638
|
const versionA = new SemVer(a, loose);
|
|
@@ -626,63 +643,63 @@ var cron = (() => {
|
|
|
626
643
|
}
|
|
627
644
|
});
|
|
628
645
|
var require_sort = __commonJS({
|
|
629
|
-
"../../node_modules/.pnpm/semver@7.
|
|
646
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js"(exports, module2) {
|
|
630
647
|
var compareBuild = require_compare_build();
|
|
631
|
-
var sort = (
|
|
648
|
+
var sort = (list2, loose) => list2.sort((a, b) => compareBuild(a, b, loose));
|
|
632
649
|
module2.exports = sort;
|
|
633
650
|
}
|
|
634
651
|
});
|
|
635
652
|
var require_rsort = __commonJS({
|
|
636
|
-
"../../node_modules/.pnpm/semver@7.
|
|
653
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js"(exports, module2) {
|
|
637
654
|
var compareBuild = require_compare_build();
|
|
638
|
-
var rsort = (
|
|
655
|
+
var rsort = (list2, loose) => list2.sort((a, b) => compareBuild(b, a, loose));
|
|
639
656
|
module2.exports = rsort;
|
|
640
657
|
}
|
|
641
658
|
});
|
|
642
659
|
var require_gt = __commonJS({
|
|
643
|
-
"../../node_modules/.pnpm/semver@7.
|
|
660
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js"(exports, module2) {
|
|
644
661
|
var compare2 = require_compare();
|
|
645
662
|
var gt = (a, b, loose) => compare2(a, b, loose) > 0;
|
|
646
663
|
module2.exports = gt;
|
|
647
664
|
}
|
|
648
665
|
});
|
|
649
666
|
var require_lt = __commonJS({
|
|
650
|
-
"../../node_modules/.pnpm/semver@7.
|
|
667
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js"(exports, module2) {
|
|
651
668
|
var compare2 = require_compare();
|
|
652
669
|
var lt = (a, b, loose) => compare2(a, b, loose) < 0;
|
|
653
670
|
module2.exports = lt;
|
|
654
671
|
}
|
|
655
672
|
});
|
|
656
673
|
var require_eq = __commonJS({
|
|
657
|
-
"../../node_modules/.pnpm/semver@7.
|
|
674
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js"(exports, module2) {
|
|
658
675
|
var compare2 = require_compare();
|
|
659
676
|
var eq = (a, b, loose) => compare2(a, b, loose) === 0;
|
|
660
677
|
module2.exports = eq;
|
|
661
678
|
}
|
|
662
679
|
});
|
|
663
680
|
var require_neq = __commonJS({
|
|
664
|
-
"../../node_modules/.pnpm/semver@7.
|
|
681
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js"(exports, module2) {
|
|
665
682
|
var compare2 = require_compare();
|
|
666
683
|
var neq = (a, b, loose) => compare2(a, b, loose) !== 0;
|
|
667
684
|
module2.exports = neq;
|
|
668
685
|
}
|
|
669
686
|
});
|
|
670
687
|
var require_gte = __commonJS({
|
|
671
|
-
"../../node_modules/.pnpm/semver@7.
|
|
688
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js"(exports, module2) {
|
|
672
689
|
var compare2 = require_compare();
|
|
673
690
|
var gte2 = (a, b, loose) => compare2(a, b, loose) >= 0;
|
|
674
691
|
module2.exports = gte2;
|
|
675
692
|
}
|
|
676
693
|
});
|
|
677
694
|
var require_lte = __commonJS({
|
|
678
|
-
"../../node_modules/.pnpm/semver@7.
|
|
695
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js"(exports, module2) {
|
|
679
696
|
var compare2 = require_compare();
|
|
680
697
|
var lte = (a, b, loose) => compare2(a, b, loose) <= 0;
|
|
681
698
|
module2.exports = lte;
|
|
682
699
|
}
|
|
683
700
|
});
|
|
684
701
|
var require_cmp = __commonJS({
|
|
685
|
-
"../../node_modules/.pnpm/semver@7.
|
|
702
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js"(exports, module2) {
|
|
686
703
|
var eq = require_eq();
|
|
687
704
|
var neq = require_neq();
|
|
688
705
|
var gt = require_gt();
|
|
@@ -729,7 +746,7 @@ var cron = (() => {
|
|
|
729
746
|
}
|
|
730
747
|
});
|
|
731
748
|
var require_coerce = __commonJS({
|
|
732
|
-
"../../node_modules/.pnpm/semver@7.
|
|
749
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js"(exports, module2) {
|
|
733
750
|
var SemVer = require_semver();
|
|
734
751
|
var parse = require_parse();
|
|
735
752
|
var { safeRe: re, t } = require_re();
|
|
@@ -771,8 +788,46 @@ var cron = (() => {
|
|
|
771
788
|
module2.exports = coerce2;
|
|
772
789
|
}
|
|
773
790
|
});
|
|
791
|
+
var require_truncate = __commonJS({
|
|
792
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js"(exports, module2) {
|
|
793
|
+
var parse = require_parse();
|
|
794
|
+
var constants2 = require_constants();
|
|
795
|
+
var SemVer = require_semver();
|
|
796
|
+
var truncate = (version, truncation, options) => {
|
|
797
|
+
if (!constants2.RELEASE_TYPES.includes(truncation)) {
|
|
798
|
+
return null;
|
|
799
|
+
}
|
|
800
|
+
const clonedVersion = cloneInputVersion(version, options);
|
|
801
|
+
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
802
|
+
};
|
|
803
|
+
var cloneInputVersion = (version, options) => {
|
|
804
|
+
const versionStringToParse = version instanceof SemVer ? version.version : version;
|
|
805
|
+
return parse(versionStringToParse, options);
|
|
806
|
+
};
|
|
807
|
+
var doTruncation = (version, truncation) => {
|
|
808
|
+
if (isPrerelease(truncation)) {
|
|
809
|
+
return version.version;
|
|
810
|
+
}
|
|
811
|
+
version.prerelease = [];
|
|
812
|
+
switch (truncation) {
|
|
813
|
+
case "major":
|
|
814
|
+
version.minor = 0;
|
|
815
|
+
version.patch = 0;
|
|
816
|
+
break;
|
|
817
|
+
case "minor":
|
|
818
|
+
version.patch = 0;
|
|
819
|
+
break;
|
|
820
|
+
}
|
|
821
|
+
return version.format();
|
|
822
|
+
};
|
|
823
|
+
var isPrerelease = (type) => {
|
|
824
|
+
return type.startsWith("pre");
|
|
825
|
+
};
|
|
826
|
+
module2.exports = truncate;
|
|
827
|
+
}
|
|
828
|
+
});
|
|
774
829
|
var require_lrucache = __commonJS({
|
|
775
|
-
"../../node_modules/.pnpm/semver@7.
|
|
830
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js"(exports, module2) {
|
|
776
831
|
var LRUCache = class {
|
|
777
832
|
constructor() {
|
|
778
833
|
this.max = 1e3;
|
|
@@ -807,7 +862,7 @@ var cron = (() => {
|
|
|
807
862
|
}
|
|
808
863
|
});
|
|
809
864
|
var require_range = __commonJS({
|
|
810
|
-
"../../node_modules/.pnpm/semver@7.
|
|
865
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js"(exports, module2) {
|
|
811
866
|
var SPACE_CHARACTERS = /\s+/g;
|
|
812
867
|
var Range = class _Range {
|
|
813
868
|
constructor(range, options) {
|
|
@@ -874,6 +929,7 @@ var cron = (() => {
|
|
|
874
929
|
return this.range;
|
|
875
930
|
}
|
|
876
931
|
parseRange(range) {
|
|
932
|
+
range = range.replace(BUILDSTRIPRE, "");
|
|
877
933
|
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
878
934
|
const memoKey = memoOpts + ":" + range;
|
|
879
935
|
const cached = cache.get(memoKey);
|
|
@@ -956,12 +1012,14 @@ var cron = (() => {
|
|
|
956
1012
|
var SemVer = require_semver();
|
|
957
1013
|
var {
|
|
958
1014
|
safeRe: re,
|
|
1015
|
+
src,
|
|
959
1016
|
t,
|
|
960
1017
|
comparatorTrimReplace,
|
|
961
1018
|
tildeTrimReplace,
|
|
962
1019
|
caretTrimReplace
|
|
963
1020
|
} = require_re();
|
|
964
1021
|
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
1022
|
+
var BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
|
|
965
1023
|
var isNullSet = (c) => c.value === "<0.0.0-0";
|
|
966
1024
|
var isAny = (c) => c.value === "";
|
|
967
1025
|
var isSatisfiable = (comparators, options) => {
|
|
@@ -990,20 +1048,22 @@ var cron = (() => {
|
|
|
990
1048
|
return comp;
|
|
991
1049
|
};
|
|
992
1050
|
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
1051
|
+
var invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
|
|
993
1052
|
var replaceTildes = (comp, options) => {
|
|
994
1053
|
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
995
1054
|
};
|
|
996
1055
|
var replaceTilde = (comp, options) => {
|
|
997
1056
|
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
1057
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
998
1058
|
return comp.replace(r, (_, M, m, p, pr) => {
|
|
999
1059
|
debug("tilde", comp, _, M, m, p, pr);
|
|
1000
1060
|
let ret;
|
|
1001
1061
|
if (isX(M)) {
|
|
1002
1062
|
ret = "";
|
|
1003
1063
|
} else if (isX(m)) {
|
|
1004
|
-
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
1064
|
+
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
1005
1065
|
} else if (isX(p)) {
|
|
1006
|
-
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
1066
|
+
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
1007
1067
|
} else if (pr) {
|
|
1008
1068
|
debug("replaceTilde pr", pr);
|
|
1009
1069
|
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
@@ -1049,9 +1109,9 @@ var cron = (() => {
|
|
|
1049
1109
|
debug("no pr");
|
|
1050
1110
|
if (M === "0") {
|
|
1051
1111
|
if (m === "0") {
|
|
1052
|
-
ret = `>=${M}.${m}.${p}
|
|
1112
|
+
ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
|
|
1053
1113
|
} else {
|
|
1054
|
-
ret = `>=${M}.${m}.${p}
|
|
1114
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1055
1115
|
}
|
|
1056
1116
|
} else {
|
|
1057
1117
|
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
@@ -1070,6 +1130,9 @@ var cron = (() => {
|
|
|
1070
1130
|
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
1071
1131
|
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1072
1132
|
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1133
|
+
if (invalidXRangeOrder(M, m, p)) {
|
|
1134
|
+
return comp;
|
|
1135
|
+
}
|
|
1073
1136
|
const xM = isX(M);
|
|
1074
1137
|
const xm = xM || isX(m);
|
|
1075
1138
|
const xp = xm || isX(p);
|
|
@@ -1181,7 +1244,7 @@ var cron = (() => {
|
|
|
1181
1244
|
}
|
|
1182
1245
|
});
|
|
1183
1246
|
var require_comparator = __commonJS({
|
|
1184
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1247
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js"(exports, module2) {
|
|
1185
1248
|
var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
|
|
1186
1249
|
var Comparator = class _Comparator {
|
|
1187
1250
|
static get ANY() {
|
|
@@ -1291,7 +1354,7 @@ var cron = (() => {
|
|
|
1291
1354
|
}
|
|
1292
1355
|
});
|
|
1293
1356
|
var require_satisfies = __commonJS({
|
|
1294
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1357
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js"(exports, module2) {
|
|
1295
1358
|
var Range = require_range();
|
|
1296
1359
|
var satisfies2 = (version, range, options) => {
|
|
1297
1360
|
try {
|
|
@@ -1305,14 +1368,14 @@ var cron = (() => {
|
|
|
1305
1368
|
}
|
|
1306
1369
|
});
|
|
1307
1370
|
var require_to_comparators = __commonJS({
|
|
1308
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1371
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js"(exports, module2) {
|
|
1309
1372
|
var Range = require_range();
|
|
1310
1373
|
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1311
1374
|
module2.exports = toComparators;
|
|
1312
1375
|
}
|
|
1313
1376
|
});
|
|
1314
1377
|
var require_max_satisfying = __commonJS({
|
|
1315
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1378
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js"(exports, module2) {
|
|
1316
1379
|
var SemVer = require_semver();
|
|
1317
1380
|
var Range = require_range();
|
|
1318
1381
|
var maxSatisfying = (versions, range, options) => {
|
|
@@ -1338,7 +1401,7 @@ var cron = (() => {
|
|
|
1338
1401
|
}
|
|
1339
1402
|
});
|
|
1340
1403
|
var require_min_satisfying = __commonJS({
|
|
1341
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1404
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js"(exports, module2) {
|
|
1342
1405
|
var SemVer = require_semver();
|
|
1343
1406
|
var Range = require_range();
|
|
1344
1407
|
var minSatisfying = (versions, range, options) => {
|
|
@@ -1364,7 +1427,7 @@ var cron = (() => {
|
|
|
1364
1427
|
}
|
|
1365
1428
|
});
|
|
1366
1429
|
var require_min_version = __commonJS({
|
|
1367
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1430
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js"(exports, module2) {
|
|
1368
1431
|
var SemVer = require_semver();
|
|
1369
1432
|
var Range = require_range();
|
|
1370
1433
|
var gt = require_gt();
|
|
@@ -1420,7 +1483,7 @@ var cron = (() => {
|
|
|
1420
1483
|
}
|
|
1421
1484
|
});
|
|
1422
1485
|
var require_valid2 = __commonJS({
|
|
1423
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1486
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js"(exports, module2) {
|
|
1424
1487
|
var Range = require_range();
|
|
1425
1488
|
var validRange = (range, options) => {
|
|
1426
1489
|
try {
|
|
@@ -1433,7 +1496,7 @@ var cron = (() => {
|
|
|
1433
1496
|
}
|
|
1434
1497
|
});
|
|
1435
1498
|
var require_outside = __commonJS({
|
|
1436
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1499
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js"(exports, module2) {
|
|
1437
1500
|
var SemVer = require_semver();
|
|
1438
1501
|
var Comparator = require_comparator();
|
|
1439
1502
|
var { ANY } = Comparator;
|
|
@@ -1499,21 +1562,21 @@ var cron = (() => {
|
|
|
1499
1562
|
}
|
|
1500
1563
|
});
|
|
1501
1564
|
var require_gtr = __commonJS({
|
|
1502
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1565
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js"(exports, module2) {
|
|
1503
1566
|
var outside = require_outside();
|
|
1504
1567
|
var gtr = (version, range, options) => outside(version, range, ">", options);
|
|
1505
1568
|
module2.exports = gtr;
|
|
1506
1569
|
}
|
|
1507
1570
|
});
|
|
1508
1571
|
var require_ltr = __commonJS({
|
|
1509
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1572
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js"(exports, module2) {
|
|
1510
1573
|
var outside = require_outside();
|
|
1511
1574
|
var ltr = (version, range, options) => outside(version, range, "<", options);
|
|
1512
1575
|
module2.exports = ltr;
|
|
1513
1576
|
}
|
|
1514
1577
|
});
|
|
1515
1578
|
var require_intersects = __commonJS({
|
|
1516
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1579
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js"(exports, module2) {
|
|
1517
1580
|
var Range = require_range();
|
|
1518
1581
|
var intersects = (r1, r2, options) => {
|
|
1519
1582
|
r1 = new Range(r1, options);
|
|
@@ -1524,7 +1587,7 @@ var cron = (() => {
|
|
|
1524
1587
|
}
|
|
1525
1588
|
});
|
|
1526
1589
|
var require_simplify = __commonJS({
|
|
1527
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1590
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js"(exports, module2) {
|
|
1528
1591
|
var satisfies2 = require_satisfies();
|
|
1529
1592
|
var compare2 = require_compare();
|
|
1530
1593
|
module2.exports = (versions, range, options) => {
|
|
@@ -1571,7 +1634,7 @@ var cron = (() => {
|
|
|
1571
1634
|
}
|
|
1572
1635
|
});
|
|
1573
1636
|
var require_subset = __commonJS({
|
|
1574
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1637
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js"(exports, module2) {
|
|
1575
1638
|
var Range = require_range();
|
|
1576
1639
|
var Comparator = require_comparator();
|
|
1577
1640
|
var { ANY } = Comparator;
|
|
@@ -1678,7 +1741,7 @@ var cron = (() => {
|
|
|
1678
1741
|
if (higher === c && higher !== gt) {
|
|
1679
1742
|
return false;
|
|
1680
1743
|
}
|
|
1681
|
-
} else if (gt.operator === ">=" && !
|
|
1744
|
+
} else if (gt.operator === ">=" && !c.test(gt.semver)) {
|
|
1682
1745
|
return false;
|
|
1683
1746
|
}
|
|
1684
1747
|
}
|
|
@@ -1693,7 +1756,7 @@ var cron = (() => {
|
|
|
1693
1756
|
if (lower === c && lower !== lt) {
|
|
1694
1757
|
return false;
|
|
1695
1758
|
}
|
|
1696
|
-
} else if (lt.operator === "<=" && !
|
|
1759
|
+
} else if (lt.operator === "<=" && !c.test(lt.semver)) {
|
|
1697
1760
|
return false;
|
|
1698
1761
|
}
|
|
1699
1762
|
}
|
|
@@ -1730,7 +1793,7 @@ var cron = (() => {
|
|
|
1730
1793
|
}
|
|
1731
1794
|
});
|
|
1732
1795
|
var require_semver2 = __commonJS({
|
|
1733
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1796
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js"(exports, module2) {
|
|
1734
1797
|
var internalRe = require_re();
|
|
1735
1798
|
var constants2 = require_constants();
|
|
1736
1799
|
var SemVer = require_semver();
|
|
@@ -1758,6 +1821,7 @@ var cron = (() => {
|
|
|
1758
1821
|
var lte = require_lte();
|
|
1759
1822
|
var cmp = require_cmp();
|
|
1760
1823
|
var coerce2 = require_coerce();
|
|
1824
|
+
var truncate = require_truncate();
|
|
1761
1825
|
var Comparator = require_comparator();
|
|
1762
1826
|
var Range = require_range();
|
|
1763
1827
|
var satisfies2 = require_satisfies();
|
|
@@ -1796,6 +1860,7 @@ var cron = (() => {
|
|
|
1796
1860
|
lte,
|
|
1797
1861
|
cmp,
|
|
1798
1862
|
coerce: coerce2,
|
|
1863
|
+
truncate,
|
|
1799
1864
|
Comparator,
|
|
1800
1865
|
Range,
|
|
1801
1866
|
satisfies: satisfies2,
|
|
@@ -1902,7 +1967,7 @@ var cron = (() => {
|
|
|
1902
1967
|
CliIcon2["Server"] = "\u{1F5A5}";
|
|
1903
1968
|
CliIcon2["Cloud"] = "\u2601";
|
|
1904
1969
|
CliIcon2["Network"] = "\u{1F310}";
|
|
1905
|
-
CliIcon2["Monitor"] = "\u{
|
|
1970
|
+
CliIcon2["Monitor"] = "\u{1F4FA}";
|
|
1906
1971
|
CliIcon2["Printer"] = "\u{1F5A8}";
|
|
1907
1972
|
CliIcon2["USB"] = "\u{1F50C}";
|
|
1908
1973
|
CliIcon2["Speaker"] = "\u{1F50A}";
|
|
@@ -1912,14 +1977,14 @@ var cron = (() => {
|
|
|
1912
1977
|
CliIcon2["Music"] = "\u{1F3B5}";
|
|
1913
1978
|
CliIcon2["Phone"] = "\u{1F4DE}";
|
|
1914
1979
|
CliIcon2["Package"] = "\u{1F4E6}";
|
|
1915
|
-
CliIcon2["Plugin"] = "\u{
|
|
1916
|
-
CliIcon2["Extension"] = "\u{
|
|
1917
|
-
CliIcon2["Module"] = "\u{
|
|
1980
|
+
CliIcon2["Plugin"] = "\u{1F9E9}";
|
|
1981
|
+
CliIcon2["Extension"] = "\u{1F50C}";
|
|
1982
|
+
CliIcon2["Module"] = "\u{1F9F1}";
|
|
1918
1983
|
CliIcon2["Evaluate"] = "\u{1F50D}";
|
|
1919
|
-
CliIcon2["Variable"] = "\u{
|
|
1984
|
+
CliIcon2["Variable"] = "\u{1D465}";
|
|
1920
1985
|
CliIcon2["Script"] = "\u{1F4DC}";
|
|
1921
|
-
CliIcon2["Code"] = "\u{
|
|
1922
|
-
CliIcon2["Logs"] = "\u{
|
|
1986
|
+
CliIcon2["Code"] = "\u{1F4DD}";
|
|
1987
|
+
CliIcon2["Logs"] = "\u{1F4CB}";
|
|
1923
1988
|
CliIcon2["Power"] = "\u23FB";
|
|
1924
1989
|
CliIcon2["Heart"] = "\u2764";
|
|
1925
1990
|
CliIcon2["Flame"] = "\u{1F525}";
|
|
@@ -1950,14 +2015,89 @@ var cron = (() => {
|
|
|
1950
2015
|
CliIcon2["Gift"] = "\u{1F381}";
|
|
1951
2016
|
return CliIcon2;
|
|
1952
2017
|
})(CliIcon || {});
|
|
2018
|
+
function createCliToken(name) {
|
|
2019
|
+
return name;
|
|
2020
|
+
}
|
|
2021
|
+
var ICliUserSessionService_TOKEN = createCliToken("cli-user-session-service");
|
|
2022
|
+
var ICliUsersStoreService_TOKEN = createCliToken("cli-users-store-service");
|
|
2023
|
+
var ICliGroupsStoreService_TOKEN = createCliToken("cli-groups-store-service");
|
|
2024
|
+
var ICliAuthService_TOKEN = createCliToken("cli-auth-service");
|
|
2025
|
+
var ICliCompletionProvider_TOKEN = createCliToken("cli-completion-provider");
|
|
2026
|
+
var ICliDragDropService_TOKEN = createCliToken("cli-drag-drop-service");
|
|
2027
|
+
var ICliFileTransferService_TOKEN = createCliToken("cli-file-transfer-service");
|
|
2028
|
+
var ICliTranslationService_TOKEN = createCliToken("cli-translation-service");
|
|
2029
|
+
var ICliPermissionService_TOKEN = createCliToken("cli-permission-service");
|
|
2030
|
+
var ICliFilePickerProvider_TOKEN = createCliToken("cli-file-picker-provider");
|
|
2031
|
+
var ICliHttpClient_TOKEN = createCliToken("cli-http-client");
|
|
2032
|
+
var ICliUserEventService_TOKEN = createCliToken("cli-user-event-service");
|
|
2033
|
+
var ICliAuditService_TOKEN = createCliToken("cli-audit-service");
|
|
2034
|
+
var ICliAuthorizationService_TOKEN = createCliToken("cli-authorization-service");
|
|
2035
|
+
var ICliPermissionRegistry_TOKEN = createCliToken("cli-permission-registry");
|
|
2036
|
+
var ICliSessionsService_TOKEN = createCliToken("cli-sessions-service");
|
|
2037
|
+
var ICliKeyValueStore_TOKEN = createCliToken("cli-key-value-store");
|
|
2038
|
+
var ICliServerAuthTokenProvider_TOKEN = createCliToken("cli-server-auth-token-provider");
|
|
2039
|
+
var ICliServerAuthService_TOKEN = createCliToken("cli-server-auth-service");
|
|
2040
|
+
var ICliServerManager_TOKEN = createCliToken("cli-server-manager");
|
|
2041
|
+
function resolveHeaders(provider) {
|
|
2042
|
+
if (!provider) return {};
|
|
2043
|
+
return typeof provider === "function" ? provider() : provider;
|
|
2044
|
+
}
|
|
2045
|
+
var ICliCommandGuard_TOKEN = createCliToken("cli-command-guard");
|
|
2046
|
+
var ICliEventBus_TOKEN = createCliToken("cli-event-bus");
|
|
1953
2047
|
var DefaultLibraryAuthor = {
|
|
1954
2048
|
name: "Nicolae Lupei",
|
|
1955
2049
|
email: "nicolae.lupei@qodalis.com"
|
|
1956
2050
|
};
|
|
2051
|
+
function splitShellWords(text) {
|
|
2052
|
+
const words = [];
|
|
2053
|
+
let current = "";
|
|
2054
|
+
let inWord = false;
|
|
2055
|
+
for (let i = 0; i < text.length; i++) {
|
|
2056
|
+
const ch = text[i];
|
|
2057
|
+
if (ch === "\\" && i + 1 < text.length) {
|
|
2058
|
+
current += text[++i];
|
|
2059
|
+
inWord = true;
|
|
2060
|
+
} else if (ch === "'" && text.indexOf("'", i + 1) !== -1) {
|
|
2061
|
+
const end = text.indexOf("'", i + 1);
|
|
2062
|
+
current += text.slice(i + 1, end);
|
|
2063
|
+
inWord = true;
|
|
2064
|
+
i = end;
|
|
2065
|
+
} else if (ch === '"' && closingDoubleQuote(text, i) !== -1) {
|
|
2066
|
+
const end = closingDoubleQuote(text, i);
|
|
2067
|
+
current += unescapeDoubleQuoted(text.slice(i + 1, end));
|
|
2068
|
+
inWord = true;
|
|
2069
|
+
i = end;
|
|
2070
|
+
} else if (/\s/.test(ch)) {
|
|
2071
|
+
if (inWord) words.push(current);
|
|
2072
|
+
current = "";
|
|
2073
|
+
inWord = false;
|
|
2074
|
+
} else {
|
|
2075
|
+
current += ch;
|
|
2076
|
+
inWord = true;
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
if (inWord) words.push(current);
|
|
2080
|
+
return words;
|
|
2081
|
+
}
|
|
2082
|
+
function joinShellWords(text) {
|
|
2083
|
+
return splitShellWords(text).join(" ");
|
|
2084
|
+
}
|
|
2085
|
+
function closingDoubleQuote(text, start) {
|
|
2086
|
+
for (let i = start + 1; i < text.length; i++) {
|
|
2087
|
+
if (text[i] === "\\") i++;
|
|
2088
|
+
else if (text[i] === '"') return i;
|
|
2089
|
+
}
|
|
2090
|
+
return -1;
|
|
2091
|
+
}
|
|
2092
|
+
function unescapeDoubleQuoted(text) {
|
|
2093
|
+
return text.replace(/\\(["\\$`])/g, "$1");
|
|
2094
|
+
}
|
|
1957
2095
|
var semver = __toESM(require_semver2());
|
|
2096
|
+
var API_VERSION = 2;
|
|
2097
|
+
var VERSIONS_ENDPOINT = "/api/qcli/versions";
|
|
1958
2098
|
var ServerVersionNegotiator = class {
|
|
1959
2099
|
static {
|
|
1960
|
-
this.CLIENT_SUPPORTED_VERSIONS = [
|
|
2100
|
+
this.CLIENT_SUPPORTED_VERSIONS = [API_VERSION];
|
|
1961
2101
|
}
|
|
1962
2102
|
/**
|
|
1963
2103
|
* Given a server's version info, pick the highest mutually compatible version.
|
|
@@ -1974,9 +2114,18 @@ var cron = (() => {
|
|
|
1974
2114
|
* Returns the negotiated API version and the base path for all subsequent calls,
|
|
1975
2115
|
* or null if the server is unreachable or incompatible.
|
|
1976
2116
|
*/
|
|
1977
|
-
static async discover(baseUrl) {
|
|
2117
|
+
static async discover(baseUrl, headers, options) {
|
|
2118
|
+
let response;
|
|
2119
|
+
try {
|
|
2120
|
+
const resolved = resolveHeaders(headers);
|
|
2121
|
+
response = await fetch(`${baseUrl}${VERSIONS_ENDPOINT}`, {
|
|
2122
|
+
headers: Object.keys(resolved).length > 0 ? resolved : void 0
|
|
2123
|
+
});
|
|
2124
|
+
} catch (e) {
|
|
2125
|
+
if (options?.rethrowNetworkErrors) throw e;
|
|
2126
|
+
return null;
|
|
2127
|
+
}
|
|
1978
2128
|
try {
|
|
1979
|
-
const response = await fetch(`${baseUrl}/api/qcli/versions`);
|
|
1980
2129
|
if (!response.ok) return null;
|
|
1981
2130
|
const info = await response.json();
|
|
1982
2131
|
const version = this.negotiate(info);
|
|
@@ -1990,6 +2139,60 @@ var cron = (() => {
|
|
|
1990
2139
|
}
|
|
1991
2140
|
}
|
|
1992
2141
|
};
|
|
2142
|
+
function writeColumns(context, rows, formatLeft, formatRight) {
|
|
2143
|
+
const width = Math.max(...rows.map(([left]) => left.length)) + 2;
|
|
2144
|
+
for (const [left, right] of rows) {
|
|
2145
|
+
context.writer.writeln(
|
|
2146
|
+
` ${formatLeft(left.padEnd(width))}${formatRight(right)}`
|
|
2147
|
+
);
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
function writeUsage(context, rows) {
|
|
2151
|
+
const { writer, translator } = context;
|
|
2152
|
+
writer.writeln(`\u{1F4CB} ${translator.t("cli.common.usage", "Usage:")}`);
|
|
2153
|
+
writeColumns(
|
|
2154
|
+
context,
|
|
2155
|
+
rows,
|
|
2156
|
+
(cmd) => writer.wrapInColor(
|
|
2157
|
+
cmd,
|
|
2158
|
+
"\x1B[36m"
|
|
2159
|
+
/* Cyan */
|
|
2160
|
+
),
|
|
2161
|
+
(text) => text
|
|
2162
|
+
);
|
|
2163
|
+
}
|
|
2164
|
+
function writeExamples(context, rows) {
|
|
2165
|
+
const { writer, translator } = context;
|
|
2166
|
+
writer.writeln(`\u{1F4DD} ${translator.t("cli.common.examples", "Examples:")}`);
|
|
2167
|
+
writeColumns(
|
|
2168
|
+
context,
|
|
2169
|
+
rows,
|
|
2170
|
+
(cmd) => cmd,
|
|
2171
|
+
(comment) => writer.wrapInColor(
|
|
2172
|
+
`# ${comment}`,
|
|
2173
|
+
"\x1B[32m"
|
|
2174
|
+
/* Green */
|
|
2175
|
+
)
|
|
2176
|
+
);
|
|
2177
|
+
}
|
|
2178
|
+
function writeWrapped(context, text, indent = 0) {
|
|
2179
|
+
const cols = context.terminal?.cols ?? 80;
|
|
2180
|
+
const width = Math.max(20, Math.min(cols - 1, 100) - indent);
|
|
2181
|
+
const pad = " ".repeat(indent);
|
|
2182
|
+
let line = "";
|
|
2183
|
+
for (const word of text.split(/\s+/).filter(Boolean)) {
|
|
2184
|
+
if (line && visibleLength2(line) + 1 + visibleLength2(word) > width) {
|
|
2185
|
+
context.writer.writeln(pad + line);
|
|
2186
|
+
line = word;
|
|
2187
|
+
} else {
|
|
2188
|
+
line = line ? `${line} ${word}` : word;
|
|
2189
|
+
}
|
|
2190
|
+
}
|
|
2191
|
+
if (line) context.writer.writeln(pad + line);
|
|
2192
|
+
}
|
|
2193
|
+
function visibleLength2(text) {
|
|
2194
|
+
return text.replace(/\x1b\[[0-9;]*m/g, "").length;
|
|
2195
|
+
}
|
|
1993
2196
|
var bootCliModule = async (module2) => {
|
|
1994
2197
|
if (typeof window !== "undefined" && window.__cliModuleRegistry) {
|
|
1995
2198
|
await window.__cliModuleRegistry.register(module2);
|
|
@@ -2836,6 +3039,13 @@ var cron = (() => {
|
|
|
2836
3039
|
}
|
|
2837
3040
|
|
|
2838
3041
|
// src/lib/processors/cli-cron-command-processor.ts
|
|
3042
|
+
function textAfterWords(text, count) {
|
|
3043
|
+
const word = /\s*(?:\\.|"(?:[^"\\]|\\.)*"|'[^']*'|[^\s"'\\]|["'\\])+/y;
|
|
3044
|
+
for (let i = 0; i < count; i++) {
|
|
3045
|
+
if (!word.exec(text)) return "";
|
|
3046
|
+
}
|
|
3047
|
+
return text.slice(word.lastIndex).trim();
|
|
3048
|
+
}
|
|
2839
3049
|
var CliCronCommandProcessor = class {
|
|
2840
3050
|
constructor() {
|
|
2841
3051
|
this.command = "cron";
|
|
@@ -2854,14 +3064,14 @@ var cron = (() => {
|
|
|
2854
3064
|
acceptsRawInput: true,
|
|
2855
3065
|
valueRequired: true,
|
|
2856
3066
|
processCommand: async (cmd, context) => {
|
|
2857
|
-
const parts =
|
|
3067
|
+
const parts = cmd.positionals ?? [];
|
|
2858
3068
|
if (parts.length < 3) {
|
|
2859
3069
|
context.writer.writeError("Usage: cron add <name> <interval> <command>");
|
|
2860
3070
|
context.writer.writeln(" Example: cron add ping 5m echo heartbeat");
|
|
2861
3071
|
return;
|
|
2862
3072
|
}
|
|
2863
3073
|
const [name, intervalStr, ...cmdParts] = parts;
|
|
2864
|
-
const command = cmdParts.join(" ");
|
|
3074
|
+
const command = cmdParts.length === 1 ? cmdParts[0] : textAfterWords(cmd.value ?? "", 2) || cmdParts.join(" ");
|
|
2865
3075
|
const intervalMs = parseInterval(intervalStr);
|
|
2866
3076
|
if (!intervalMs) {
|
|
2867
3077
|
context.writer.writeError(`Invalid interval "${intervalStr}". Min 10s. Examples: 10s, 5m, 1h`);
|
|
@@ -2880,9 +3090,9 @@ var cron = (() => {
|
|
|
2880
3090
|
enabled: true,
|
|
2881
3091
|
runCount: 0
|
|
2882
3092
|
};
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
3093
|
+
await context.state.update((saved) => ({
|
|
3094
|
+
jobs: [...saved["jobs"] ?? [], job]
|
|
3095
|
+
}));
|
|
2886
3096
|
this.startJob(job, context);
|
|
2887
3097
|
context.writer.writeSuccess(
|
|
2888
3098
|
`Job "${name}" added \u2014 runs every ${formatInterval(intervalMs)}: ${command}`
|
|
@@ -2915,7 +3125,7 @@ var cron = (() => {
|
|
|
2915
3125
|
acceptsRawInput: true,
|
|
2916
3126
|
valueRequired: true,
|
|
2917
3127
|
processCommand: async (cmd, context) => {
|
|
2918
|
-
const name = (cmd.value ?? "")
|
|
3128
|
+
const name = joinShellWords(cmd.value ?? "");
|
|
2919
3129
|
const state = context.state.getState();
|
|
2920
3130
|
const idx = state.jobs.findIndex((j) => j.name === name);
|
|
2921
3131
|
if (idx === -1) {
|
|
@@ -2924,9 +3134,9 @@ var cron = (() => {
|
|
|
2924
3134
|
}
|
|
2925
3135
|
const job = state.jobs[idx];
|
|
2926
3136
|
this.stopJob(job.id);
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
3137
|
+
await context.state.update((saved) => ({
|
|
3138
|
+
jobs: (saved["jobs"] ?? []).filter((j) => j.name !== name)
|
|
3139
|
+
}));
|
|
2930
3140
|
context.writer.writeSuccess(`Job "${name}" removed`);
|
|
2931
3141
|
}
|
|
2932
3142
|
},
|
|
@@ -2936,7 +3146,7 @@ var cron = (() => {
|
|
|
2936
3146
|
acceptsRawInput: true,
|
|
2937
3147
|
valueRequired: true,
|
|
2938
3148
|
processCommand: async (cmd, context) => {
|
|
2939
|
-
await this.setEnabled((cmd.value ?? "")
|
|
3149
|
+
await this.setEnabled(joinShellWords(cmd.value ?? ""), true, context);
|
|
2940
3150
|
}
|
|
2941
3151
|
},
|
|
2942
3152
|
{
|
|
@@ -2945,7 +3155,7 @@ var cron = (() => {
|
|
|
2945
3155
|
acceptsRawInput: true,
|
|
2946
3156
|
valueRequired: true,
|
|
2947
3157
|
processCommand: async (cmd, context) => {
|
|
2948
|
-
await this.setEnabled((cmd.value ?? "")
|
|
3158
|
+
await this.setEnabled(joinShellWords(cmd.value ?? ""), false, context);
|
|
2949
3159
|
}
|
|
2950
3160
|
}
|
|
2951
3161
|
];
|
|
@@ -2956,6 +3166,32 @@ var cron = (() => {
|
|
|
2956
3166
|
this.startJob(job, context);
|
|
2957
3167
|
}
|
|
2958
3168
|
}
|
|
3169
|
+
writeDescription(context) {
|
|
3170
|
+
const t = context.translator;
|
|
3171
|
+
writeWrapped(
|
|
3172
|
+
context,
|
|
3173
|
+
t.t("cli.cron.help.run_command_again_again", "Run a command again and again at a fixed interval while the terminal is open. Jobs are saved: they start again when the terminal starts, and can be paused without removing them.")
|
|
3174
|
+
);
|
|
3175
|
+
context.writer.writeln();
|
|
3176
|
+
writeUsage(context, [
|
|
3177
|
+
["cron add <name> <interval> <command>", t.t("cli.cron.help.add_job", "Add a job")],
|
|
3178
|
+
["cron list", t.t("cli.cron.help.jobs_interval_status_run", "Jobs with interval, status and run count (ls)")],
|
|
3179
|
+
["cron disable <name>", t.t("cli.cron.help.pause_job", "Pause a job")],
|
|
3180
|
+
["cron enable <name>", t.t("cli.cron.help.resume_paused_job", "Resume a paused job")],
|
|
3181
|
+
["cron remove <name>", t.t("cli.cron.help.remove_job_rm_delete", "Remove a job (rm, delete)")]
|
|
3182
|
+
]);
|
|
3183
|
+
context.writer.writeln();
|
|
3184
|
+
writeWrapped(
|
|
3185
|
+
context,
|
|
3186
|
+
t.t("cli.cron.help.intervals_seconds_30_hours", "Intervals: seconds (30), or hours, minutes and seconds (1h, 5m, 1h30m, 90s); at least 10 seconds.")
|
|
3187
|
+
);
|
|
3188
|
+
context.writer.writeln();
|
|
3189
|
+
writeExamples(context, [
|
|
3190
|
+
["cron add ping 5m echo heartbeat", t.t("cli.cron.help.every_5_minutes", "Every 5 minutes")],
|
|
3191
|
+
["cron add backup 1h30m server jobs trigger backup", t.t("cli.cron.help.every_hour_half", "Every hour and a half")],
|
|
3192
|
+
["cron disable ping", t.t("cli.cron.help.pause", "Pause it")]
|
|
3193
|
+
]);
|
|
3194
|
+
}
|
|
2959
3195
|
async processCommand(_, context) {
|
|
2960
3196
|
const { jobs } = context.state.getState();
|
|
2961
3197
|
context.writer.writeln(`${jobs.length} job(s). Sub-commands: add, list, remove, enable, disable`);
|
|
@@ -2974,7 +3210,7 @@ var cron = (() => {
|
|
|
2974
3210
|
);
|
|
2975
3211
|
context.state.updateState({ jobs: updated });
|
|
2976
3212
|
} catch (e) {
|
|
2977
|
-
|
|
3213
|
+
context.logger.error(`Cron job "${job.name}" failed:`, e);
|
|
2978
3214
|
}
|
|
2979
3215
|
}, job.intervalMs);
|
|
2980
3216
|
this.timers.set(job.id, timer);
|
|
@@ -3000,19 +3236,21 @@ var cron = (() => {
|
|
|
3000
3236
|
} else {
|
|
3001
3237
|
this.stopJob(job.id);
|
|
3002
3238
|
}
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3239
|
+
await context.state.update((saved) => ({
|
|
3240
|
+
jobs: (saved["jobs"] ?? []).map(
|
|
3241
|
+
(j) => j.name === name ? { ...j, enabled } : j
|
|
3242
|
+
)
|
|
3243
|
+
}));
|
|
3006
3244
|
context.writer.writeSuccess(`Job "${name}" ${enabled ? "enabled" : "disabled"}`);
|
|
3007
3245
|
}
|
|
3008
3246
|
};
|
|
3009
3247
|
|
|
3010
3248
|
// src/lib/version.ts
|
|
3011
|
-
var
|
|
3249
|
+
var API_VERSION2 = 2;
|
|
3012
3250
|
|
|
3013
3251
|
// src/cli-entrypoint.ts
|
|
3014
3252
|
var module = {
|
|
3015
|
-
apiVersion:
|
|
3253
|
+
apiVersion: API_VERSION2,
|
|
3016
3254
|
name: "@qodalis/cli-cron",
|
|
3017
3255
|
processors: [new CliCronCommandProcessor()]
|
|
3018
3256
|
};
|