@hot-updater/cloudflare 0.16.7-0 → 0.18.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/iac/index.cjs +12362 -12838
- package/dist/iac/index.d.cts +8 -4
- package/dist/iac/index.d.ts +8 -4
- package/dist/iac/index.js +12364 -12847
- package/dist/index.cjs +8062 -7779
- package/dist/index.d.cts +14 -10
- package/dist/index.d.ts +14 -10
- package/dist/index.js +8063 -7775
- package/package.json +7 -7
- package/sql/bundles.sql +6 -2
- package/worker/dist/README.md +1 -1
- package/worker/dist/index.js +2047 -1969
- package/worker/dist/index.js.map +4 -4
- package/worker/migrations/0003_hot-updater_0.18.0.sql +38 -0
package/worker/dist/index.js
CHANGED
|
@@ -264,7 +264,7 @@ var PerformanceObserver = class {
|
|
|
264
264
|
};
|
|
265
265
|
var performance = globalThis.performance && "addEventListener" in globalThis.performance ? globalThis.performance : new Performance();
|
|
266
266
|
|
|
267
|
-
// ../../node_modules/.pnpm/@cloudflare+unenv-preset@2.3.1_unenv@2.0.0-rc.15_workerd@1.
|
|
267
|
+
// ../../node_modules/.pnpm/@cloudflare+unenv-preset@2.3.1_unenv@2.0.0-rc.15_workerd@1.20250507.0/node_modules/@cloudflare/unenv-preset/dist/runtime/polyfill/performance.mjs
|
|
268
268
|
globalThis.performance = performance;
|
|
269
269
|
globalThis.Performance = Performance;
|
|
270
270
|
globalThis.PerformanceEntry = PerformanceEntry;
|
|
@@ -313,7 +313,7 @@ var _times = /* @__PURE__ */ new Map();
|
|
|
313
313
|
var _stdoutErrorHandler = noop_default;
|
|
314
314
|
var _stderrErrorHandler = noop_default;
|
|
315
315
|
|
|
316
|
-
// ../../node_modules/.pnpm/@cloudflare+unenv-preset@2.3.1_unenv@2.0.0-rc.15_workerd@1.
|
|
316
|
+
// ../../node_modules/.pnpm/@cloudflare+unenv-preset@2.3.1_unenv@2.0.0-rc.15_workerd@1.20250507.0/node_modules/@cloudflare/unenv-preset/dist/runtime/node/console.mjs
|
|
317
317
|
var workerdConsole = globalThis["console"];
|
|
318
318
|
var {
|
|
319
319
|
assert,
|
|
@@ -354,7 +354,7 @@ Object.assign(workerdConsole, {
|
|
|
354
354
|
});
|
|
355
355
|
var console_default = workerdConsole;
|
|
356
356
|
|
|
357
|
-
// ../../node_modules/.pnpm/wrangler@4.
|
|
357
|
+
// ../../node_modules/.pnpm/wrangler@4.14.3_@cloudflare+workers-types@4.20250507.0/node_modules/wrangler/_virtual_unenv_global_polyfill-@cloudflare-unenv-preset-node-console
|
|
358
358
|
globalThis.console = console_default;
|
|
359
359
|
|
|
360
360
|
// ../../node_modules/.pnpm/unenv@2.0.0-rc.15/node_modules/unenv/dist/runtime/node/internal/process/hrtime.mjs
|
|
@@ -671,7 +671,7 @@ var Process = class _Process extends EventEmitter {
|
|
|
671
671
|
_linkedBinding = void 0;
|
|
672
672
|
};
|
|
673
673
|
|
|
674
|
-
// ../../node_modules/.pnpm/@cloudflare+unenv-preset@2.3.1_unenv@2.0.0-rc.15_workerd@1.
|
|
674
|
+
// ../../node_modules/.pnpm/@cloudflare+unenv-preset@2.3.1_unenv@2.0.0-rc.15_workerd@1.20250507.0/node_modules/@cloudflare/unenv-preset/dist/runtime/node/process.mjs
|
|
675
675
|
var globalProcess = globalThis["process"];
|
|
676
676
|
var getBuiltinModule = globalProcess.getBuiltinModule;
|
|
677
677
|
var { exit, platform, nextTick } = getBuiltinModule(
|
|
@@ -899,1380 +899,1359 @@ var _process = {
|
|
|
899
899
|
};
|
|
900
900
|
var process_default = _process;
|
|
901
901
|
|
|
902
|
-
// ../../node_modules/.pnpm/wrangler@4.
|
|
902
|
+
// ../../node_modules/.pnpm/wrangler@4.14.3_@cloudflare+workers-types@4.20250507.0/node_modules/wrangler/_virtual_unenv_global_polyfill-@cloudflare-unenv-preset-node-process
|
|
903
903
|
globalThis.process = process_default;
|
|
904
904
|
|
|
905
905
|
// ../../packages/core/dist/index.js
|
|
906
906
|
var NIL_UUID = "00000000-0000-0000-0000-000000000000";
|
|
907
907
|
|
|
908
908
|
// ../js/dist/index.js
|
|
909
|
-
var
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
909
|
+
var __create = Object.create;
|
|
910
|
+
var __defProp2 = Object.defineProperty;
|
|
911
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
912
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
913
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
914
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
915
|
+
var __commonJS = /* @__PURE__ */ __name((cb, mod) => function() {
|
|
916
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
917
|
+
}, "__commonJS");
|
|
918
|
+
var __copyProps = /* @__PURE__ */ __name((to, from, except, desc) => {
|
|
919
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
920
|
+
key = keys[i];
|
|
921
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp2(to, key, {
|
|
922
|
+
get: ((k) => from[k]).bind(null, key),
|
|
923
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
return to;
|
|
927
|
+
}, "__copyProps");
|
|
928
|
+
var __toESM = /* @__PURE__ */ __name((mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
|
|
929
|
+
value: mod,
|
|
930
|
+
enumerable: true
|
|
931
|
+
}) : target, mod)), "__toESM");
|
|
932
|
+
var require_constants = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js"(exports, module) {
|
|
933
|
+
const SEMVER_SPEC_VERSION = "2.0.0";
|
|
934
|
+
const MAX_LENGTH$2 = 256;
|
|
935
|
+
const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
936
|
+
const MAX_SAFE_COMPONENT_LENGTH$1 = 16;
|
|
937
|
+
const MAX_SAFE_BUILD_LENGTH$1 = MAX_LENGTH$2 - 6;
|
|
938
|
+
const RELEASE_TYPES = [
|
|
939
|
+
"major",
|
|
940
|
+
"premajor",
|
|
941
|
+
"minor",
|
|
942
|
+
"preminor",
|
|
943
|
+
"patch",
|
|
944
|
+
"prepatch",
|
|
945
|
+
"prerelease"
|
|
946
|
+
];
|
|
947
|
+
module.exports = {
|
|
948
|
+
MAX_LENGTH: MAX_LENGTH$2,
|
|
949
|
+
MAX_SAFE_COMPONENT_LENGTH: MAX_SAFE_COMPONENT_LENGTH$1,
|
|
950
|
+
MAX_SAFE_BUILD_LENGTH: MAX_SAFE_BUILD_LENGTH$1,
|
|
951
|
+
MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
|
|
952
|
+
RELEASE_TYPES,
|
|
953
|
+
SEMVER_SPEC_VERSION,
|
|
954
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
955
|
+
FLAG_LOOSE: 2
|
|
956
|
+
};
|
|
957
|
+
} });
|
|
958
|
+
var require_debug = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/debug.js"(exports, module) {
|
|
959
|
+
const debug$4 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
960
|
+
};
|
|
961
|
+
module.exports = debug$4;
|
|
962
|
+
} });
|
|
963
|
+
var require_re = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/re.js"(exports, module) {
|
|
964
|
+
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH: MAX_LENGTH$1 } = require_constants();
|
|
965
|
+
const debug$3 = require_debug();
|
|
966
|
+
exports = module.exports = {};
|
|
967
|
+
const re$4 = exports.re = [];
|
|
968
|
+
const safeRe = exports.safeRe = [];
|
|
969
|
+
const src = exports.src = [];
|
|
970
|
+
const safeSrc = exports.safeSrc = [];
|
|
971
|
+
const t$4 = exports.t = {};
|
|
972
|
+
let R = 0;
|
|
973
|
+
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
974
|
+
const safeRegexReplacements = [
|
|
975
|
+
["\\s", 1],
|
|
976
|
+
["\\d", MAX_LENGTH$1],
|
|
977
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
978
|
+
];
|
|
979
|
+
const makeSafeRegex = /* @__PURE__ */ __name((value) => {
|
|
980
|
+
for (const [token, max] of safeRegexReplacements) value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
981
|
+
return value;
|
|
982
|
+
}, "makeSafeRegex");
|
|
983
|
+
const createToken = /* @__PURE__ */ __name((name, value, isGlobal) => {
|
|
984
|
+
const safe = makeSafeRegex(value);
|
|
985
|
+
const index = R++;
|
|
986
|
+
debug$3(name, index, value);
|
|
987
|
+
t$4[name] = index;
|
|
988
|
+
src[index] = value;
|
|
989
|
+
safeSrc[index] = safe;
|
|
990
|
+
re$4[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
991
|
+
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
992
|
+
}, "createToken");
|
|
993
|
+
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
994
|
+
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
995
|
+
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
996
|
+
createToken("MAINVERSION", `(${src[t$4.NUMERICIDENTIFIER]})\\.(${src[t$4.NUMERICIDENTIFIER]})\\.(${src[t$4.NUMERICIDENTIFIER]})`);
|
|
997
|
+
createToken("MAINVERSIONLOOSE", `(${src[t$4.NUMERICIDENTIFIERLOOSE]})\\.(${src[t$4.NUMERICIDENTIFIERLOOSE]})\\.(${src[t$4.NUMERICIDENTIFIERLOOSE]})`);
|
|
998
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t$4.NONNUMERICIDENTIFIER]}|${src[t$4.NUMERICIDENTIFIER]})`);
|
|
999
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t$4.NONNUMERICIDENTIFIER]}|${src[t$4.NUMERICIDENTIFIERLOOSE]})`);
|
|
1000
|
+
createToken("PRERELEASE", `(?:-(${src[t$4.PRERELEASEIDENTIFIER]}(?:\\.${src[t$4.PRERELEASEIDENTIFIER]})*))`);
|
|
1001
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t$4.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t$4.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
1002
|
+
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
1003
|
+
createToken("BUILD", `(?:\\+(${src[t$4.BUILDIDENTIFIER]}(?:\\.${src[t$4.BUILDIDENTIFIER]})*))`);
|
|
1004
|
+
createToken("FULLPLAIN", `v?${src[t$4.MAINVERSION]}${src[t$4.PRERELEASE]}?${src[t$4.BUILD]}?`);
|
|
1005
|
+
createToken("FULL", `^${src[t$4.FULLPLAIN]}$`);
|
|
1006
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t$4.MAINVERSIONLOOSE]}${src[t$4.PRERELEASELOOSE]}?${src[t$4.BUILD]}?`);
|
|
1007
|
+
createToken("LOOSE", `^${src[t$4.LOOSEPLAIN]}$`);
|
|
1008
|
+
createToken("GTLT", "((?:<|>)?=?)");
|
|
1009
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t$4.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
1010
|
+
createToken("XRANGEIDENTIFIER", `${src[t$4.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
1011
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t$4.XRANGEIDENTIFIER]})(?:\\.(${src[t$4.XRANGEIDENTIFIER]})(?:\\.(${src[t$4.XRANGEIDENTIFIER]})(?:${src[t$4.PRERELEASE]})?${src[t$4.BUILD]}?)?)?`);
|
|
1012
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:${src[t$4.PRERELEASELOOSE]})?${src[t$4.BUILD]}?)?)?`);
|
|
1013
|
+
createToken("XRANGE", `^${src[t$4.GTLT]}\\s*${src[t$4.XRANGEPLAIN]}$`);
|
|
1014
|
+
createToken("XRANGELOOSE", `^${src[t$4.GTLT]}\\s*${src[t$4.XRANGEPLAINLOOSE]}$`);
|
|
1015
|
+
createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
1016
|
+
createToken("COERCE", `${src[t$4.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
1017
|
+
createToken("COERCEFULL", src[t$4.COERCEPLAIN] + `(?:${src[t$4.PRERELEASE]})?(?:${src[t$4.BUILD]})?(?:$|[^\\d])`);
|
|
1018
|
+
createToken("COERCERTL", src[t$4.COERCE], true);
|
|
1019
|
+
createToken("COERCERTLFULL", src[t$4.COERCEFULL], true);
|
|
1020
|
+
createToken("LONETILDE", "(?:~>?)");
|
|
1021
|
+
createToken("TILDETRIM", `(\\s*)${src[t$4.LONETILDE]}\\s+`, true);
|
|
1022
|
+
exports.tildeTrimReplace = "$1~";
|
|
1023
|
+
createToken("TILDE", `^${src[t$4.LONETILDE]}${src[t$4.XRANGEPLAIN]}$`);
|
|
1024
|
+
createToken("TILDELOOSE", `^${src[t$4.LONETILDE]}${src[t$4.XRANGEPLAINLOOSE]}$`);
|
|
1025
|
+
createToken("LONECARET", "(?:\\^)");
|
|
1026
|
+
createToken("CARETTRIM", `(\\s*)${src[t$4.LONECARET]}\\s+`, true);
|
|
1027
|
+
exports.caretTrimReplace = "$1^";
|
|
1028
|
+
createToken("CARET", `^${src[t$4.LONECARET]}${src[t$4.XRANGEPLAIN]}$`);
|
|
1029
|
+
createToken("CARETLOOSE", `^${src[t$4.LONECARET]}${src[t$4.XRANGEPLAINLOOSE]}$`);
|
|
1030
|
+
createToken("COMPARATORLOOSE", `^${src[t$4.GTLT]}\\s*(${src[t$4.LOOSEPLAIN]})$|^$`);
|
|
1031
|
+
createToken("COMPARATOR", `^${src[t$4.GTLT]}\\s*(${src[t$4.FULLPLAIN]})$|^$`);
|
|
1032
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t$4.GTLT]}\\s*(${src[t$4.LOOSEPLAIN]}|${src[t$4.XRANGEPLAIN]})`, true);
|
|
1033
|
+
exports.comparatorTrimReplace = "$1$2$3";
|
|
1034
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t$4.XRANGEPLAIN]})\\s+-\\s+(${src[t$4.XRANGEPLAIN]})\\s*$`);
|
|
1035
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t$4.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t$4.XRANGEPLAINLOOSE]})\\s*$`);
|
|
1036
|
+
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
1037
|
+
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
1038
|
+
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
1039
|
+
} });
|
|
1040
|
+
var require_parse_options = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/parse-options.js"(exports, module) {
|
|
1041
|
+
const looseOption = Object.freeze({ loose: true });
|
|
1042
|
+
const emptyOpts = Object.freeze({});
|
|
1043
|
+
const parseOptions$3 = /* @__PURE__ */ __name((options) => {
|
|
1044
|
+
if (!options) return emptyOpts;
|
|
1045
|
+
if (typeof options !== "object") return looseOption;
|
|
1046
|
+
return options;
|
|
1047
|
+
}, "parseOptions$3");
|
|
1048
|
+
module.exports = parseOptions$3;
|
|
1049
|
+
} });
|
|
1050
|
+
var require_identifiers = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/identifiers.js"(exports, module) {
|
|
1051
|
+
const numeric = /^[0-9]+$/;
|
|
1052
|
+
const compareIdentifiers$1 = /* @__PURE__ */ __name((a, b) => {
|
|
1053
|
+
const anum = numeric.test(a);
|
|
1054
|
+
const bnum = numeric.test(b);
|
|
1055
|
+
if (anum && bnum) {
|
|
1056
|
+
a = +a;
|
|
1057
|
+
b = +b;
|
|
1058
|
+
}
|
|
1059
|
+
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
1060
|
+
}, "compareIdentifiers$1");
|
|
1061
|
+
const rcompareIdentifiers = /* @__PURE__ */ __name((a, b) => compareIdentifiers$1(b, a), "rcompareIdentifiers");
|
|
1062
|
+
module.exports = {
|
|
1063
|
+
compareIdentifiers: compareIdentifiers$1,
|
|
1064
|
+
rcompareIdentifiers
|
|
1065
|
+
};
|
|
1066
|
+
} });
|
|
1067
|
+
var require_semver$1 = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js"(exports, module) {
|
|
1068
|
+
const debug$2 = require_debug();
|
|
1069
|
+
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
1070
|
+
const { safeRe: re$3, t: t$3 } = require_re();
|
|
1071
|
+
const parseOptions$2 = require_parse_options();
|
|
1072
|
+
const { compareIdentifiers } = require_identifiers();
|
|
1073
|
+
var SemVer$15 = class SemVer$152 {
|
|
1074
|
+
static {
|
|
1075
|
+
__name(this, "SemVer$15");
|
|
1076
|
+
}
|
|
1077
|
+
constructor(version2, options) {
|
|
1078
|
+
options = parseOptions$2(options);
|
|
1079
|
+
if (version2 instanceof SemVer$152) if (version2.loose === !!options.loose && version2.includePrerelease === !!options.includePrerelease) return version2;
|
|
1080
|
+
else version2 = version2.version;
|
|
1081
|
+
else if (typeof version2 !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`);
|
|
1082
|
+
if (version2.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
1083
|
+
debug$2("SemVer", version2, options);
|
|
1084
|
+
this.options = options;
|
|
1085
|
+
this.loose = !!options.loose;
|
|
1086
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
1087
|
+
const m = version2.trim().match(options.loose ? re$3[t$3.LOOSE] : re$3[t$3.FULL]);
|
|
1088
|
+
if (!m) throw new TypeError(`Invalid Version: ${version2}`);
|
|
1089
|
+
this.raw = version2;
|
|
1090
|
+
this.major = +m[1];
|
|
1091
|
+
this.minor = +m[2];
|
|
1092
|
+
this.patch = +m[3];
|
|
1093
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
|
|
1094
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
|
|
1095
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
|
|
1096
|
+
if (!m[4]) this.prerelease = [];
|
|
1097
|
+
else this.prerelease = m[4].split(".").map((id) => {
|
|
1098
|
+
if (/^[0-9]+$/.test(id)) {
|
|
1099
|
+
const num = +id;
|
|
1100
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
963
1101
|
}
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
}
|
|
1102
|
+
return id;
|
|
1103
|
+
});
|
|
1104
|
+
this.build = m[5] ? m[5].split(".") : [];
|
|
1105
|
+
this.format();
|
|
1106
|
+
}
|
|
1107
|
+
format() {
|
|
1108
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
1109
|
+
if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
|
|
1110
|
+
return this.version;
|
|
974
1111
|
}
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
984
|
-
const SPACE_CHARACTERS = /\s+/g;
|
|
985
|
-
class Range {
|
|
986
|
-
static {
|
|
987
|
-
__name(this, "Range");
|
|
1112
|
+
toString() {
|
|
1113
|
+
return this.version;
|
|
1114
|
+
}
|
|
1115
|
+
compare(other) {
|
|
1116
|
+
debug$2("SemVer.compare", this.version, this.options, other);
|
|
1117
|
+
if (!(other instanceof SemVer$152)) {
|
|
1118
|
+
if (typeof other === "string" && other === this.version) return 0;
|
|
1119
|
+
other = new SemVer$152(other, this.options);
|
|
988
1120
|
}
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
if (
|
|
1009
|
-
if (
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1121
|
+
if (other.version === this.version) return 0;
|
|
1122
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
1123
|
+
}
|
|
1124
|
+
compareMain(other) {
|
|
1125
|
+
if (!(other instanceof SemVer$152)) other = new SemVer$152(other, this.options);
|
|
1126
|
+
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
|
1127
|
+
}
|
|
1128
|
+
comparePre(other) {
|
|
1129
|
+
if (!(other instanceof SemVer$152)) other = new SemVer$152(other, this.options);
|
|
1130
|
+
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
1131
|
+
else if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
1132
|
+
else if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
1133
|
+
let i = 0;
|
|
1134
|
+
do {
|
|
1135
|
+
const a = this.prerelease[i];
|
|
1136
|
+
const b = other.prerelease[i];
|
|
1137
|
+
debug$2("prerelease compare", i, a, b);
|
|
1138
|
+
if (a === void 0 && b === void 0) return 0;
|
|
1139
|
+
else if (b === void 0) return 1;
|
|
1140
|
+
else if (a === void 0) return -1;
|
|
1141
|
+
else if (a === b) continue;
|
|
1142
|
+
else return compareIdentifiers(a, b);
|
|
1143
|
+
} while (++i);
|
|
1144
|
+
}
|
|
1145
|
+
compareBuild(other) {
|
|
1146
|
+
if (!(other instanceof SemVer$152)) other = new SemVer$152(other, this.options);
|
|
1147
|
+
let i = 0;
|
|
1148
|
+
do {
|
|
1149
|
+
const a = this.build[i];
|
|
1150
|
+
const b = other.build[i];
|
|
1151
|
+
debug$2("build compare", i, a, b);
|
|
1152
|
+
if (a === void 0 && b === void 0) return 0;
|
|
1153
|
+
else if (b === void 0) return 1;
|
|
1154
|
+
else if (a === void 0) return -1;
|
|
1155
|
+
else if (a === b) continue;
|
|
1156
|
+
else return compareIdentifiers(a, b);
|
|
1157
|
+
} while (++i);
|
|
1158
|
+
}
|
|
1159
|
+
inc(release2, identifier, identifierBase) {
|
|
1160
|
+
if (release2.startsWith("pre")) {
|
|
1161
|
+
if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
|
|
1162
|
+
if (identifier) {
|
|
1163
|
+
const match = `-${identifier}`.match(this.options.loose ? re$3[t$3.PRERELEASELOOSE] : re$3[t$3.PRERELEASE]);
|
|
1164
|
+
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
1023
1165
|
}
|
|
1024
|
-
this.formatted = void 0;
|
|
1025
1166
|
}
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
this.
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1167
|
+
switch (release2) {
|
|
1168
|
+
case "premajor":
|
|
1169
|
+
this.prerelease.length = 0;
|
|
1170
|
+
this.patch = 0;
|
|
1171
|
+
this.minor = 0;
|
|
1172
|
+
this.major++;
|
|
1173
|
+
this.inc("pre", identifier, identifierBase);
|
|
1174
|
+
break;
|
|
1175
|
+
case "preminor":
|
|
1176
|
+
this.prerelease.length = 0;
|
|
1177
|
+
this.patch = 0;
|
|
1178
|
+
this.minor++;
|
|
1179
|
+
this.inc("pre", identifier, identifierBase);
|
|
1180
|
+
break;
|
|
1181
|
+
case "prepatch":
|
|
1182
|
+
this.prerelease.length = 0;
|
|
1183
|
+
this.inc("patch", identifier, identifierBase);
|
|
1184
|
+
this.inc("pre", identifier, identifierBase);
|
|
1185
|
+
break;
|
|
1186
|
+
case "prerelease":
|
|
1187
|
+
if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase);
|
|
1188
|
+
this.inc("pre", identifier, identifierBase);
|
|
1189
|
+
break;
|
|
1190
|
+
case "release":
|
|
1191
|
+
if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`);
|
|
1192
|
+
this.prerelease.length = 0;
|
|
1193
|
+
break;
|
|
1194
|
+
case "major":
|
|
1195
|
+
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++;
|
|
1196
|
+
this.minor = 0;
|
|
1197
|
+
this.patch = 0;
|
|
1198
|
+
this.prerelease = [];
|
|
1199
|
+
break;
|
|
1200
|
+
case "minor":
|
|
1201
|
+
if (this.patch !== 0 || this.prerelease.length === 0) this.minor++;
|
|
1202
|
+
this.patch = 0;
|
|
1203
|
+
this.prerelease = [];
|
|
1204
|
+
break;
|
|
1205
|
+
case "patch":
|
|
1206
|
+
if (this.prerelease.length === 0) this.patch++;
|
|
1207
|
+
this.prerelease = [];
|
|
1208
|
+
break;
|
|
1209
|
+
case "pre": {
|
|
1210
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
1211
|
+
if (this.prerelease.length === 0) this.prerelease = [base];
|
|
1212
|
+
else {
|
|
1213
|
+
let i = this.prerelease.length;
|
|
1214
|
+
while (--i >= 0) if (typeof this.prerelease[i] === "number") {
|
|
1215
|
+
this.prerelease[i]++;
|
|
1216
|
+
i = -2;
|
|
1217
|
+
}
|
|
1218
|
+
if (i === -1) {
|
|
1219
|
+
if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists");
|
|
1220
|
+
this.prerelease.push(base);
|
|
1035
1221
|
}
|
|
1036
1222
|
}
|
|
1223
|
+
if (identifier) {
|
|
1224
|
+
let prerelease$2 = [identifier, base];
|
|
1225
|
+
if (identifierBase === false) prerelease$2 = [identifier];
|
|
1226
|
+
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
1227
|
+
if (isNaN(this.prerelease[1])) this.prerelease = prerelease$2;
|
|
1228
|
+
} else this.prerelease = prerelease$2;
|
|
1229
|
+
}
|
|
1230
|
+
break;
|
|
1037
1231
|
}
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
format() {
|
|
1041
|
-
return this.range;
|
|
1232
|
+
default:
|
|
1233
|
+
throw new Error(`invalid increment argument: ${release2}`);
|
|
1042
1234
|
}
|
|
1043
|
-
|
|
1044
|
-
|
|
1235
|
+
this.raw = this.format();
|
|
1236
|
+
if (this.build.length) this.raw += `+${this.build.join(".")}`;
|
|
1237
|
+
return this;
|
|
1238
|
+
}
|
|
1239
|
+
};
|
|
1240
|
+
module.exports = SemVer$15;
|
|
1241
|
+
} });
|
|
1242
|
+
var require_parse = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/parse.js"(exports, module) {
|
|
1243
|
+
const SemVer$14 = require_semver$1();
|
|
1244
|
+
const parse$6 = /* @__PURE__ */ __name((version2, options, throwErrors = false) => {
|
|
1245
|
+
if (version2 instanceof SemVer$14) return version2;
|
|
1246
|
+
try {
|
|
1247
|
+
return new SemVer$14(version2, options);
|
|
1248
|
+
} catch (er) {
|
|
1249
|
+
if (!throwErrors) return null;
|
|
1250
|
+
throw er;
|
|
1251
|
+
}
|
|
1252
|
+
}, "parse$6");
|
|
1253
|
+
module.exports = parse$6;
|
|
1254
|
+
} });
|
|
1255
|
+
var require_valid$1 = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/valid.js"(exports, module) {
|
|
1256
|
+
const parse$5 = require_parse();
|
|
1257
|
+
const valid$1 = /* @__PURE__ */ __name((version2, options) => {
|
|
1258
|
+
const v = parse$5(version2, options);
|
|
1259
|
+
return v ? v.version : null;
|
|
1260
|
+
}, "valid$1");
|
|
1261
|
+
module.exports = valid$1;
|
|
1262
|
+
} });
|
|
1263
|
+
var require_clean = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/clean.js"(exports, module) {
|
|
1264
|
+
const parse$4 = require_parse();
|
|
1265
|
+
const clean$1 = /* @__PURE__ */ __name((version2, options) => {
|
|
1266
|
+
const s = parse$4(version2.trim().replace(/^[=v]+/, ""), options);
|
|
1267
|
+
return s ? s.version : null;
|
|
1268
|
+
}, "clean$1");
|
|
1269
|
+
module.exports = clean$1;
|
|
1270
|
+
} });
|
|
1271
|
+
var require_inc = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/inc.js"(exports, module) {
|
|
1272
|
+
const SemVer$13 = require_semver$1();
|
|
1273
|
+
const inc$1 = /* @__PURE__ */ __name((version2, release2, options, identifier, identifierBase) => {
|
|
1274
|
+
if (typeof options === "string") {
|
|
1275
|
+
identifierBase = identifier;
|
|
1276
|
+
identifier = options;
|
|
1277
|
+
options = void 0;
|
|
1278
|
+
}
|
|
1279
|
+
try {
|
|
1280
|
+
return new SemVer$13(version2 instanceof SemVer$13 ? version2.version : version2, options).inc(release2, identifier, identifierBase).version;
|
|
1281
|
+
} catch (er) {
|
|
1282
|
+
return null;
|
|
1283
|
+
}
|
|
1284
|
+
}, "inc$1");
|
|
1285
|
+
module.exports = inc$1;
|
|
1286
|
+
} });
|
|
1287
|
+
var require_diff = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/diff.js"(exports, module) {
|
|
1288
|
+
const parse$3 = require_parse();
|
|
1289
|
+
const diff$1 = /* @__PURE__ */ __name((version1, version2) => {
|
|
1290
|
+
const v1 = parse$3(version1, null, true);
|
|
1291
|
+
const v2 = parse$3(version2, null, true);
|
|
1292
|
+
const comparison = v1.compare(v2);
|
|
1293
|
+
if (comparison === 0) return null;
|
|
1294
|
+
const v1Higher = comparison > 0;
|
|
1295
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
1296
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
1297
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
1298
|
+
const lowHasPre = !!lowVersion.prerelease.length;
|
|
1299
|
+
if (lowHasPre && !highHasPre) {
|
|
1300
|
+
if (!lowVersion.patch && !lowVersion.minor) return "major";
|
|
1301
|
+
if (lowVersion.compareMain(highVersion) === 0) {
|
|
1302
|
+
if (lowVersion.minor && !lowVersion.patch) return "minor";
|
|
1303
|
+
return "patch";
|
|
1045
1304
|
}
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1305
|
+
}
|
|
1306
|
+
const prefix = highHasPre ? "pre" : "";
|
|
1307
|
+
if (v1.major !== v2.major) return prefix + "major";
|
|
1308
|
+
if (v1.minor !== v2.minor) return prefix + "minor";
|
|
1309
|
+
if (v1.patch !== v2.patch) return prefix + "patch";
|
|
1310
|
+
return "prerelease";
|
|
1311
|
+
}, "diff$1");
|
|
1312
|
+
module.exports = diff$1;
|
|
1313
|
+
} });
|
|
1314
|
+
var require_major = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/major.js"(exports, module) {
|
|
1315
|
+
const SemVer$12 = require_semver$1();
|
|
1316
|
+
const major$1 = /* @__PURE__ */ __name((a, loose) => new SemVer$12(a, loose).major, "major$1");
|
|
1317
|
+
module.exports = major$1;
|
|
1318
|
+
} });
|
|
1319
|
+
var require_minor = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/minor.js"(exports, module) {
|
|
1320
|
+
const SemVer$11 = require_semver$1();
|
|
1321
|
+
const minor$1 = /* @__PURE__ */ __name((a, loose) => new SemVer$11(a, loose).minor, "minor$1");
|
|
1322
|
+
module.exports = minor$1;
|
|
1323
|
+
} });
|
|
1324
|
+
var require_patch = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/patch.js"(exports, module) {
|
|
1325
|
+
const SemVer$10 = require_semver$1();
|
|
1326
|
+
const patch$1 = /* @__PURE__ */ __name((a, loose) => new SemVer$10(a, loose).patch, "patch$1");
|
|
1327
|
+
module.exports = patch$1;
|
|
1328
|
+
} });
|
|
1329
|
+
var require_prerelease = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/prerelease.js"(exports, module) {
|
|
1330
|
+
const parse$2 = require_parse();
|
|
1331
|
+
const prerelease$1 = /* @__PURE__ */ __name((version2, options) => {
|
|
1332
|
+
const parsed = parse$2(version2, options);
|
|
1333
|
+
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
1334
|
+
}, "prerelease$1");
|
|
1335
|
+
module.exports = prerelease$1;
|
|
1336
|
+
} });
|
|
1337
|
+
var require_compare = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js"(exports, module) {
|
|
1338
|
+
const SemVer$9 = require_semver$1();
|
|
1339
|
+
const compare$11 = /* @__PURE__ */ __name((a, b, loose) => new SemVer$9(a, loose).compare(new SemVer$9(b, loose)), "compare$11");
|
|
1340
|
+
module.exports = compare$11;
|
|
1341
|
+
} });
|
|
1342
|
+
var require_rcompare = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rcompare.js"(exports, module) {
|
|
1343
|
+
const compare$10 = require_compare();
|
|
1344
|
+
const rcompare$1 = /* @__PURE__ */ __name((a, b, loose) => compare$10(b, a, loose), "rcompare$1");
|
|
1345
|
+
module.exports = rcompare$1;
|
|
1346
|
+
} });
|
|
1347
|
+
var require_compare_loose = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-loose.js"(exports, module) {
|
|
1348
|
+
const compare$9 = require_compare();
|
|
1349
|
+
const compareLoose$1 = /* @__PURE__ */ __name((a, b) => compare$9(a, b, true), "compareLoose$1");
|
|
1350
|
+
module.exports = compareLoose$1;
|
|
1351
|
+
} });
|
|
1352
|
+
var require_compare_build = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-build.js"(exports, module) {
|
|
1353
|
+
const SemVer$8 = require_semver$1();
|
|
1354
|
+
const compareBuild$3 = /* @__PURE__ */ __name((a, b, loose) => {
|
|
1355
|
+
const versionA = new SemVer$8(a, loose);
|
|
1356
|
+
const versionB = new SemVer$8(b, loose);
|
|
1357
|
+
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
1358
|
+
}, "compareBuild$3");
|
|
1359
|
+
module.exports = compareBuild$3;
|
|
1360
|
+
} });
|
|
1361
|
+
var require_sort = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/sort.js"(exports, module) {
|
|
1362
|
+
const compareBuild$2 = require_compare_build();
|
|
1363
|
+
const sort$1 = /* @__PURE__ */ __name((list, loose) => list.sort((a, b) => compareBuild$2(a, b, loose)), "sort$1");
|
|
1364
|
+
module.exports = sort$1;
|
|
1365
|
+
} });
|
|
1366
|
+
var require_rsort = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rsort.js"(exports, module) {
|
|
1367
|
+
const compareBuild$1 = require_compare_build();
|
|
1368
|
+
const rsort$1 = /* @__PURE__ */ __name((list, loose) => list.sort((a, b) => compareBuild$1(b, a, loose)), "rsort$1");
|
|
1369
|
+
module.exports = rsort$1;
|
|
1370
|
+
} });
|
|
1371
|
+
var require_gt = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gt.js"(exports, module) {
|
|
1372
|
+
const compare$8 = require_compare();
|
|
1373
|
+
const gt$4 = /* @__PURE__ */ __name((a, b, loose) => compare$8(a, b, loose) > 0, "gt$4");
|
|
1374
|
+
module.exports = gt$4;
|
|
1375
|
+
} });
|
|
1376
|
+
var require_lt = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lt.js"(exports, module) {
|
|
1377
|
+
const compare$7 = require_compare();
|
|
1378
|
+
const lt$3 = /* @__PURE__ */ __name((a, b, loose) => compare$7(a, b, loose) < 0, "lt$3");
|
|
1379
|
+
module.exports = lt$3;
|
|
1380
|
+
} });
|
|
1381
|
+
var require_eq = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/eq.js"(exports, module) {
|
|
1382
|
+
const compare$6 = require_compare();
|
|
1383
|
+
const eq$2 = /* @__PURE__ */ __name((a, b, loose) => compare$6(a, b, loose) === 0, "eq$2");
|
|
1384
|
+
module.exports = eq$2;
|
|
1385
|
+
} });
|
|
1386
|
+
var require_neq = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/neq.js"(exports, module) {
|
|
1387
|
+
const compare$5 = require_compare();
|
|
1388
|
+
const neq$2 = /* @__PURE__ */ __name((a, b, loose) => compare$5(a, b, loose) !== 0, "neq$2");
|
|
1389
|
+
module.exports = neq$2;
|
|
1390
|
+
} });
|
|
1391
|
+
var require_gte = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js"(exports, module) {
|
|
1392
|
+
const compare$4 = require_compare();
|
|
1393
|
+
const gte$3 = /* @__PURE__ */ __name((a, b, loose) => compare$4(a, b, loose) >= 0, "gte$3");
|
|
1394
|
+
module.exports = gte$3;
|
|
1395
|
+
} });
|
|
1396
|
+
var require_lte = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lte.js"(exports, module) {
|
|
1397
|
+
const compare$3 = require_compare();
|
|
1398
|
+
const lte$3 = /* @__PURE__ */ __name((a, b, loose) => compare$3(a, b, loose) <= 0, "lte$3");
|
|
1399
|
+
module.exports = lte$3;
|
|
1400
|
+
} });
|
|
1401
|
+
var require_cmp = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/cmp.js"(exports, module) {
|
|
1402
|
+
const eq$1 = require_eq();
|
|
1403
|
+
const neq$1 = require_neq();
|
|
1404
|
+
const gt$3 = require_gt();
|
|
1405
|
+
const gte$2 = require_gte();
|
|
1406
|
+
const lt$2 = require_lt();
|
|
1407
|
+
const lte$2 = require_lte();
|
|
1408
|
+
const cmp$2 = /* @__PURE__ */ __name((a, op, b, loose) => {
|
|
1409
|
+
switch (op) {
|
|
1410
|
+
case "===":
|
|
1411
|
+
if (typeof a === "object") a = a.version;
|
|
1412
|
+
if (typeof b === "object") b = b.version;
|
|
1413
|
+
return a === b;
|
|
1414
|
+
case "!==":
|
|
1415
|
+
if (typeof a === "object") a = a.version;
|
|
1416
|
+
if (typeof b === "object") b = b.version;
|
|
1417
|
+
return a !== b;
|
|
1418
|
+
case "":
|
|
1419
|
+
case "=":
|
|
1420
|
+
case "==":
|
|
1421
|
+
return eq$1(a, b, loose);
|
|
1422
|
+
case "!=":
|
|
1423
|
+
return neq$1(a, b, loose);
|
|
1424
|
+
case ">":
|
|
1425
|
+
return gt$3(a, b, loose);
|
|
1426
|
+
case ">=":
|
|
1427
|
+
return gte$2(a, b, loose);
|
|
1428
|
+
case "<":
|
|
1429
|
+
return lt$2(a, b, loose);
|
|
1430
|
+
case "<=":
|
|
1431
|
+
return lte$2(a, b, loose);
|
|
1432
|
+
default:
|
|
1433
|
+
throw new TypeError(`Invalid operator: ${op}`);
|
|
1434
|
+
}
|
|
1435
|
+
}, "cmp$2");
|
|
1436
|
+
module.exports = cmp$2;
|
|
1437
|
+
} });
|
|
1438
|
+
var require_coerce = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/coerce.js"(exports, module) {
|
|
1439
|
+
const SemVer$7 = require_semver$1();
|
|
1440
|
+
const parse$1 = require_parse();
|
|
1441
|
+
const { safeRe: re$2, t: t$2 } = require_re();
|
|
1442
|
+
const coerce$1 = /* @__PURE__ */ __name((version2, options) => {
|
|
1443
|
+
if (version2 instanceof SemVer$7) return version2;
|
|
1444
|
+
if (typeof version2 === "number") version2 = String(version2);
|
|
1445
|
+
if (typeof version2 !== "string") return null;
|
|
1446
|
+
options = options || {};
|
|
1447
|
+
let match = null;
|
|
1448
|
+
if (!options.rtl) match = version2.match(options.includePrerelease ? re$2[t$2.COERCEFULL] : re$2[t$2.COERCE]);
|
|
1449
|
+
else {
|
|
1450
|
+
const coerceRtlRegex = options.includePrerelease ? re$2[t$2.COERCERTLFULL] : re$2[t$2.COERCERTL];
|
|
1451
|
+
let next;
|
|
1452
|
+
while ((next = coerceRtlRegex.exec(version2)) && (!match || match.index + match[0].length !== version2.length)) {
|
|
1453
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
1454
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
1081
1455
|
}
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1456
|
+
coerceRtlRegex.lastIndex = -1;
|
|
1457
|
+
}
|
|
1458
|
+
if (match === null) return null;
|
|
1459
|
+
const major$2 = match[2];
|
|
1460
|
+
const minor$2 = match[3] || "0";
|
|
1461
|
+
const patch$2 = match[4] || "0";
|
|
1462
|
+
const prerelease$2 = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
1463
|
+
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
1464
|
+
return parse$1(`${major$2}.${minor$2}.${patch$2}${prerelease$2}${build}`, options);
|
|
1465
|
+
}, "coerce$1");
|
|
1466
|
+
module.exports = coerce$1;
|
|
1467
|
+
} });
|
|
1468
|
+
var require_lrucache = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/lrucache.js"(exports, module) {
|
|
1469
|
+
var LRUCache = class {
|
|
1470
|
+
static {
|
|
1471
|
+
__name(this, "LRUCache");
|
|
1472
|
+
}
|
|
1473
|
+
constructor() {
|
|
1474
|
+
this.max = 1e3;
|
|
1475
|
+
this.map = /* @__PURE__ */ new Map();
|
|
1476
|
+
}
|
|
1477
|
+
get(key) {
|
|
1478
|
+
const value = this.map.get(key);
|
|
1479
|
+
if (value === void 0) return void 0;
|
|
1480
|
+
else {
|
|
1481
|
+
this.map.delete(key);
|
|
1482
|
+
this.map.set(key, value);
|
|
1483
|
+
return value;
|
|
1085
1484
|
}
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1485
|
+
}
|
|
1486
|
+
delete(key) {
|
|
1487
|
+
return this.map.delete(key);
|
|
1488
|
+
}
|
|
1489
|
+
set(key, value) {
|
|
1490
|
+
const deleted = this.delete(key);
|
|
1491
|
+
if (!deleted && value !== void 0) {
|
|
1492
|
+
if (this.map.size >= this.max) {
|
|
1493
|
+
const firstKey = this.map.keys().next().value;
|
|
1494
|
+
this.delete(firstKey);
|
|
1092
1495
|
}
|
|
1093
|
-
|
|
1094
|
-
return false;
|
|
1496
|
+
this.map.set(key, value);
|
|
1095
1497
|
}
|
|
1498
|
+
return this;
|
|
1499
|
+
}
|
|
1500
|
+
};
|
|
1501
|
+
module.exports = LRUCache;
|
|
1502
|
+
} });
|
|
1503
|
+
var require_range = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/range.js"(exports, module) {
|
|
1504
|
+
const SPACE_CHARACTERS = /\s+/g;
|
|
1505
|
+
var Range$11 = class Range$112 {
|
|
1506
|
+
static {
|
|
1507
|
+
__name(this, "Range$11");
|
|
1096
1508
|
}
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
const isNullSet = /* @__PURE__ */ __name((c) => "<0.0.0-0" === c.value, "isNullSet");
|
|
1107
|
-
const isAny = /* @__PURE__ */ __name((c) => "" === c.value, "isAny");
|
|
1108
|
-
const isSatisfiable = /* @__PURE__ */ __name((comparators, options) => {
|
|
1109
|
-
let result = true;
|
|
1110
|
-
const remainingComparators = comparators.slice();
|
|
1111
|
-
let testComparator = remainingComparators.pop();
|
|
1112
|
-
while (result && remainingComparators.length) {
|
|
1113
|
-
result = remainingComparators.every((otherComparator) => testComparator.intersects(otherComparator, options));
|
|
1114
|
-
testComparator = remainingComparators.pop();
|
|
1509
|
+
constructor(range, options) {
|
|
1510
|
+
options = parseOptions$1(options);
|
|
1511
|
+
if (range instanceof Range$112) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
|
|
1512
|
+
else return new Range$112(range.raw, options);
|
|
1513
|
+
if (range instanceof Comparator$4) {
|
|
1514
|
+
this.raw = range.value;
|
|
1515
|
+
this.set = [[range]];
|
|
1516
|
+
this.formatted = void 0;
|
|
1517
|
+
return this;
|
|
1115
1518
|
}
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
const isX = /* @__PURE__ */ __name((id) => !id || "x" === id.toLowerCase() || "*" === id, "isX");
|
|
1131
|
-
const replaceTildes = /* @__PURE__ */ __name((comp, options) => comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" "), "replaceTildes");
|
|
1132
|
-
const replaceTilde = /* @__PURE__ */ __name((comp, options) => {
|
|
1133
|
-
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
1134
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1135
|
-
debug3("tilde", comp, _, M, m, p, pr);
|
|
1136
|
-
let ret;
|
|
1137
|
-
if (isX(M)) ret = "";
|
|
1138
|
-
else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
1139
|
-
else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
1140
|
-
else if (pr) {
|
|
1141
|
-
debug3("replaceTilde pr", pr);
|
|
1142
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1143
|
-
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1144
|
-
debug3("tilde return", ret);
|
|
1145
|
-
return ret;
|
|
1146
|
-
});
|
|
1147
|
-
}, "replaceTilde");
|
|
1148
|
-
const replaceCarets = /* @__PURE__ */ __name((comp, options) => comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" "), "replaceCarets");
|
|
1149
|
-
const replaceCaret = /* @__PURE__ */ __name((comp, options) => {
|
|
1150
|
-
debug3("caret", comp, options);
|
|
1151
|
-
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
1152
|
-
const z = options.includePrerelease ? "-0" : "";
|
|
1153
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1154
|
-
debug3("caret", comp, _, M, m, p, pr);
|
|
1155
|
-
let ret;
|
|
1156
|
-
if (isX(M)) ret = "";
|
|
1157
|
-
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
1158
|
-
else if (isX(p)) ret = "0" === M ? `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` : `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
1159
|
-
else if (pr) {
|
|
1160
|
-
debug3("replaceCaret pr", pr);
|
|
1161
|
-
ret = "0" === M ? "0" === m ? `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0` : `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0` : `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
1162
|
-
} else {
|
|
1163
|
-
debug3("no pr");
|
|
1164
|
-
ret = "0" === M ? "0" === m ? `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0` : `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0` : `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
1165
|
-
}
|
|
1166
|
-
debug3("caret return", ret);
|
|
1167
|
-
return ret;
|
|
1168
|
-
});
|
|
1169
|
-
}, "replaceCaret");
|
|
1170
|
-
const replaceXRanges = /* @__PURE__ */ __name((comp, options) => {
|
|
1171
|
-
debug3("replaceXRanges", comp, options);
|
|
1172
|
-
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
1173
|
-
}, "replaceXRanges");
|
|
1174
|
-
const replaceXRange = /* @__PURE__ */ __name((comp, options) => {
|
|
1175
|
-
comp = comp.trim();
|
|
1176
|
-
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
1177
|
-
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1178
|
-
debug3("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1179
|
-
const xM = isX(M);
|
|
1180
|
-
const xm = xM || isX(m);
|
|
1181
|
-
const xp = xm || isX(p);
|
|
1182
|
-
const anyX = xp;
|
|
1183
|
-
if ("=" === gtlt && anyX) gtlt = "";
|
|
1184
|
-
pr = options.includePrerelease ? "-0" : "";
|
|
1185
|
-
if (xM) ret = ">" === gtlt || "<" === gtlt ? "<0.0.0-0" : "*";
|
|
1186
|
-
else if (gtlt && anyX) {
|
|
1187
|
-
if (xm) m = 0;
|
|
1188
|
-
p = 0;
|
|
1189
|
-
if (">" === gtlt) {
|
|
1190
|
-
gtlt = ">=";
|
|
1191
|
-
if (xm) {
|
|
1192
|
-
M = +M + 1;
|
|
1193
|
-
m = 0;
|
|
1194
|
-
p = 0;
|
|
1195
|
-
} else {
|
|
1196
|
-
m = +m + 1;
|
|
1197
|
-
p = 0;
|
|
1198
|
-
}
|
|
1199
|
-
} else if ("<=" === gtlt) {
|
|
1200
|
-
gtlt = "<";
|
|
1201
|
-
if (xm) M = +M + 1;
|
|
1202
|
-
else m = +m + 1;
|
|
1203
|
-
}
|
|
1204
|
-
if ("<" === gtlt) pr = "-0";
|
|
1205
|
-
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
1206
|
-
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
1207
|
-
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1208
|
-
debug3("xRange return", ret);
|
|
1209
|
-
return ret;
|
|
1210
|
-
});
|
|
1211
|
-
}, "replaceXRange");
|
|
1212
|
-
const replaceStars = /* @__PURE__ */ __name((comp, options) => {
|
|
1213
|
-
debug3("replaceStars", comp, options);
|
|
1214
|
-
return comp.trim().replace(re[t.STAR], "");
|
|
1215
|
-
}, "replaceStars");
|
|
1216
|
-
const replaceGTE0 = /* @__PURE__ */ __name((comp, options) => {
|
|
1217
|
-
debug3("replaceGTE0", comp, options);
|
|
1218
|
-
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
1219
|
-
}, "replaceGTE0");
|
|
1220
|
-
const hyphenReplace = /* @__PURE__ */ __name((incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
1221
|
-
from = isX(fM) ? "" : isX(fm) ? `>=${fM}.0.0${incPr ? "-0" : ""}` : isX(fp) ? `>=${fM}.${fm}.0${incPr ? "-0" : ""}` : fpr ? `>=${from}` : `>=${from}${incPr ? "-0" : ""}`;
|
|
1222
|
-
to = isX(tM) ? "" : isX(tm) ? `<${+tM + 1}.0.0-0` : isX(tp) ? `<${tM}.${+tm + 1}.0-0` : tpr ? `<=${tM}.${tm}.${tp}-${tpr}` : incPr ? `<${tM}.${tm}.${+tp + 1}-0` : `<=${to}`;
|
|
1223
|
-
return `${from} ${to}`.trim();
|
|
1224
|
-
}, "hyphenReplace");
|
|
1225
|
-
const testSet = /* @__PURE__ */ __name((set, version2, options) => {
|
|
1226
|
-
for (let i = 0; i < set.length; i++) if (!set[i].test(version2)) return false;
|
|
1227
|
-
if (version2.prerelease.length && !options.includePrerelease) {
|
|
1228
|
-
for (let i = 0; i < set.length; i++) {
|
|
1229
|
-
debug3(set[i].semver);
|
|
1230
|
-
if (set[i].semver !== Comparator.ANY) {
|
|
1231
|
-
if (set[i].semver.prerelease.length > 0) {
|
|
1232
|
-
const allowed = set[i].semver;
|
|
1233
|
-
if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) return true;
|
|
1234
|
-
}
|
|
1519
|
+
this.options = options;
|
|
1520
|
+
this.loose = !!options.loose;
|
|
1521
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
1522
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
1523
|
+
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
1524
|
+
if (!this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
1525
|
+
if (this.set.length > 1) {
|
|
1526
|
+
const first = this.set[0];
|
|
1527
|
+
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
1528
|
+
if (this.set.length === 0) this.set = [first];
|
|
1529
|
+
else if (this.set.length > 1) {
|
|
1530
|
+
for (const c of this.set) if (c.length === 1 && isAny(c[0])) {
|
|
1531
|
+
this.set = [c];
|
|
1532
|
+
break;
|
|
1235
1533
|
}
|
|
1236
1534
|
}
|
|
1237
|
-
return false;
|
|
1238
|
-
}
|
|
1239
|
-
return true;
|
|
1240
|
-
}, "testSet");
|
|
1241
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js"),
|
|
1242
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1243
|
-
const debug3 = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js");
|
|
1244
|
-
const { MAX_LENGTH, MAX_SAFE_INTEGER } = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js");
|
|
1245
|
-
const { safeRe: re, safeSrc: src, t } = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js");
|
|
1246
|
-
const parseOptions = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/parse-options.js");
|
|
1247
|
-
const { compareIdentifiers } = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/identifiers.js");
|
|
1248
|
-
class SemVer {
|
|
1249
|
-
static {
|
|
1250
|
-
__name(this, "SemVer");
|
|
1251
1535
|
}
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
if (!m) throw new TypeError(`Invalid Version: ${version2}`);
|
|
1264
|
-
this.raw = version2;
|
|
1265
|
-
this.major = +m[1];
|
|
1266
|
-
this.minor = +m[2];
|
|
1267
|
-
this.patch = +m[3];
|
|
1268
|
-
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
|
|
1269
|
-
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
|
|
1270
|
-
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
|
|
1271
|
-
if (m[4]) this.prerelease = m[4].split(".").map((id) => {
|
|
1272
|
-
if (/^[0-9]+$/.test(id)) {
|
|
1273
|
-
const num = +id;
|
|
1274
|
-
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
1536
|
+
this.formatted = void 0;
|
|
1537
|
+
}
|
|
1538
|
+
get range() {
|
|
1539
|
+
if (this.formatted === void 0) {
|
|
1540
|
+
this.formatted = "";
|
|
1541
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
1542
|
+
if (i > 0) this.formatted += "||";
|
|
1543
|
+
const comps = this.set[i];
|
|
1544
|
+
for (let k = 0; k < comps.length; k++) {
|
|
1545
|
+
if (k > 0) this.formatted += " ";
|
|
1546
|
+
this.formatted += comps[k].toString().trim();
|
|
1275
1547
|
}
|
|
1276
|
-
return id;
|
|
1277
|
-
});
|
|
1278
|
-
else this.prerelease = [];
|
|
1279
|
-
this.build = m[5] ? m[5].split(".") : [];
|
|
1280
|
-
this.format();
|
|
1281
|
-
}
|
|
1282
|
-
format() {
|
|
1283
|
-
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
1284
|
-
if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
|
|
1285
|
-
return this.version;
|
|
1286
|
-
}
|
|
1287
|
-
toString() {
|
|
1288
|
-
return this.version;
|
|
1289
|
-
}
|
|
1290
|
-
compare(other) {
|
|
1291
|
-
debug3("SemVer.compare", this.version, this.options, other);
|
|
1292
|
-
if (!(other instanceof SemVer)) {
|
|
1293
|
-
if ("string" == typeof other && other === this.version) return 0;
|
|
1294
|
-
other = new SemVer(other, this.options);
|
|
1295
1548
|
}
|
|
1296
|
-
if (other.version === this.version) return 0;
|
|
1297
|
-
return this.compareMain(other) || this.comparePre(other);
|
|
1298
1549
|
}
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1550
|
+
return this.formatted;
|
|
1551
|
+
}
|
|
1552
|
+
format() {
|
|
1553
|
+
return this.range;
|
|
1554
|
+
}
|
|
1555
|
+
toString() {
|
|
1556
|
+
return this.range;
|
|
1557
|
+
}
|
|
1558
|
+
parseRange(range) {
|
|
1559
|
+
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
1560
|
+
const memoKey = memoOpts + ":" + range;
|
|
1561
|
+
const cached = cache$1.get(memoKey);
|
|
1562
|
+
if (cached) return cached;
|
|
1563
|
+
const loose = this.options.loose;
|
|
1564
|
+
const hr = loose ? re$1[t$1.HYPHENRANGELOOSE] : re$1[t$1.HYPHENRANGE];
|
|
1565
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
1566
|
+
debug$1("hyphen replace", range);
|
|
1567
|
+
range = range.replace(re$1[t$1.COMPARATORTRIM], comparatorTrimReplace);
|
|
1568
|
+
debug$1("comparator trim", range);
|
|
1569
|
+
range = range.replace(re$1[t$1.TILDETRIM], tildeTrimReplace);
|
|
1570
|
+
debug$1("tilde trim", range);
|
|
1571
|
+
range = range.replace(re$1[t$1.CARETTRIM], caretTrimReplace);
|
|
1572
|
+
debug$1("caret trim", range);
|
|
1573
|
+
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
1574
|
+
if (loose) rangeList = rangeList.filter((comp) => {
|
|
1575
|
+
debug$1("loose invalid filter", comp, this.options);
|
|
1576
|
+
return !!comp.match(re$1[t$1.COMPARATORLOOSE]);
|
|
1577
|
+
});
|
|
1578
|
+
debug$1("range list", rangeList);
|
|
1579
|
+
const rangeMap = /* @__PURE__ */ new Map();
|
|
1580
|
+
const comparators = rangeList.map((comp) => new Comparator$4(comp, this.options));
|
|
1581
|
+
for (const comp of comparators) {
|
|
1582
|
+
if (isNullSet(comp)) return [comp];
|
|
1583
|
+
rangeMap.set(comp.value, comp);
|
|
1302
1584
|
}
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1585
|
+
if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete("");
|
|
1586
|
+
const result = [...rangeMap.values()];
|
|
1587
|
+
cache$1.set(memoKey, result);
|
|
1588
|
+
return result;
|
|
1589
|
+
}
|
|
1590
|
+
intersects(range, options) {
|
|
1591
|
+
if (!(range instanceof Range$112)) throw new TypeError("a Range is required");
|
|
1592
|
+
return this.set.some((thisComparators) => {
|
|
1593
|
+
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
1594
|
+
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
1595
|
+
return rangeComparators.every((rangeComparator) => {
|
|
1596
|
+
return thisComparator.intersects(rangeComparator, options);
|
|
1597
|
+
});
|
|
1598
|
+
});
|
|
1599
|
+
});
|
|
1600
|
+
});
|
|
1601
|
+
}
|
|
1602
|
+
test(version2) {
|
|
1603
|
+
if (!version2) return false;
|
|
1604
|
+
if (typeof version2 === "string") try {
|
|
1605
|
+
version2 = new SemVer$6(version2, this.options);
|
|
1606
|
+
} catch (er) {
|
|
1607
|
+
return false;
|
|
1319
1608
|
}
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1609
|
+
for (let i = 0; i < this.set.length; i++) if (testSet(this.set[i], version2, this.options)) return true;
|
|
1610
|
+
return false;
|
|
1611
|
+
}
|
|
1612
|
+
};
|
|
1613
|
+
module.exports = Range$11;
|
|
1614
|
+
const LRU = require_lrucache();
|
|
1615
|
+
const cache$1 = new LRU();
|
|
1616
|
+
const parseOptions$1 = require_parse_options();
|
|
1617
|
+
const Comparator$4 = require_comparator();
|
|
1618
|
+
const debug$1 = require_debug();
|
|
1619
|
+
const SemVer$6 = require_semver$1();
|
|
1620
|
+
const { safeRe: re$1, t: t$1, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
|
|
1621
|
+
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
1622
|
+
const isNullSet = /* @__PURE__ */ __name((c) => c.value === "<0.0.0-0", "isNullSet");
|
|
1623
|
+
const isAny = /* @__PURE__ */ __name((c) => c.value === "", "isAny");
|
|
1624
|
+
const isSatisfiable = /* @__PURE__ */ __name((comparators, options) => {
|
|
1625
|
+
let result = true;
|
|
1626
|
+
const remainingComparators = comparators.slice();
|
|
1627
|
+
let testComparator = remainingComparators.pop();
|
|
1628
|
+
while (result && remainingComparators.length) {
|
|
1629
|
+
result = remainingComparators.every((otherComparator) => {
|
|
1630
|
+
return testComparator.intersects(otherComparator, options);
|
|
1631
|
+
});
|
|
1632
|
+
testComparator = remainingComparators.pop();
|
|
1633
|
+
}
|
|
1634
|
+
return result;
|
|
1635
|
+
}, "isSatisfiable");
|
|
1636
|
+
const parseComparator = /* @__PURE__ */ __name((comp, options) => {
|
|
1637
|
+
debug$1("comp", comp, options);
|
|
1638
|
+
comp = replaceCarets(comp, options);
|
|
1639
|
+
debug$1("caret", comp);
|
|
1640
|
+
comp = replaceTildes(comp, options);
|
|
1641
|
+
debug$1("tildes", comp);
|
|
1642
|
+
comp = replaceXRanges(comp, options);
|
|
1643
|
+
debug$1("xrange", comp);
|
|
1644
|
+
comp = replaceStars(comp, options);
|
|
1645
|
+
debug$1("stars", comp);
|
|
1646
|
+
return comp;
|
|
1647
|
+
}, "parseComparator");
|
|
1648
|
+
const isX = /* @__PURE__ */ __name((id) => !id || id.toLowerCase() === "x" || id === "*", "isX");
|
|
1649
|
+
const replaceTildes = /* @__PURE__ */ __name((comp, options) => {
|
|
1650
|
+
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
1651
|
+
}, "replaceTildes");
|
|
1652
|
+
const replaceTilde = /* @__PURE__ */ __name((comp, options) => {
|
|
1653
|
+
const r = options.loose ? re$1[t$1.TILDELOOSE] : re$1[t$1.TILDE];
|
|
1654
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1655
|
+
debug$1("tilde", comp, _, M, m, p, pr);
|
|
1656
|
+
let ret;
|
|
1657
|
+
if (isX(M)) ret = "";
|
|
1658
|
+
else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
1659
|
+
else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
1660
|
+
else if (pr) {
|
|
1661
|
+
debug$1("replaceTilde pr", pr);
|
|
1662
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1663
|
+
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1664
|
+
debug$1("tilde return", ret);
|
|
1665
|
+
return ret;
|
|
1666
|
+
});
|
|
1667
|
+
}, "replaceTilde");
|
|
1668
|
+
const replaceCarets = /* @__PURE__ */ __name((comp, options) => {
|
|
1669
|
+
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
1670
|
+
}, "replaceCarets");
|
|
1671
|
+
const replaceCaret = /* @__PURE__ */ __name((comp, options) => {
|
|
1672
|
+
debug$1("caret", comp, options);
|
|
1673
|
+
const r = options.loose ? re$1[t$1.CARETLOOSE] : re$1[t$1.CARET];
|
|
1674
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
1675
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1676
|
+
debug$1("caret", comp, _, M, m, p, pr);
|
|
1677
|
+
let ret;
|
|
1678
|
+
if (isX(M)) ret = "";
|
|
1679
|
+
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
1680
|
+
else if (isX(p)) if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
1681
|
+
else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
1682
|
+
else if (pr) {
|
|
1683
|
+
debug$1("replaceCaret pr", pr);
|
|
1684
|
+
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
1685
|
+
else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1686
|
+
else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
1687
|
+
} else {
|
|
1688
|
+
debug$1("no pr");
|
|
1689
|
+
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
1690
|
+
else ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
|
1691
|
+
else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
1333
1692
|
}
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1693
|
+
debug$1("caret return", ret);
|
|
1694
|
+
return ret;
|
|
1695
|
+
});
|
|
1696
|
+
}, "replaceCaret");
|
|
1697
|
+
const replaceXRanges = /* @__PURE__ */ __name((comp, options) => {
|
|
1698
|
+
debug$1("replaceXRanges", comp, options);
|
|
1699
|
+
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
1700
|
+
}, "replaceXRanges");
|
|
1701
|
+
const replaceXRange = /* @__PURE__ */ __name((comp, options) => {
|
|
1702
|
+
comp = comp.trim();
|
|
1703
|
+
const r = options.loose ? re$1[t$1.XRANGELOOSE] : re$1[t$1.XRANGE];
|
|
1704
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1705
|
+
debug$1("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1706
|
+
const xM = isX(M);
|
|
1707
|
+
const xm = xM || isX(m);
|
|
1708
|
+
const xp = xm || isX(p);
|
|
1709
|
+
const anyX = xp;
|
|
1710
|
+
if (gtlt === "=" && anyX) gtlt = "";
|
|
1711
|
+
pr = options.includePrerelease ? "-0" : "";
|
|
1712
|
+
if (xM) if (gtlt === ">" || gtlt === "<") ret = "<0.0.0-0";
|
|
1713
|
+
else ret = "*";
|
|
1714
|
+
else if (gtlt && anyX) {
|
|
1715
|
+
if (xm) m = 0;
|
|
1716
|
+
p = 0;
|
|
1717
|
+
if (gtlt === ">") {
|
|
1718
|
+
gtlt = ">=";
|
|
1719
|
+
if (xm) {
|
|
1720
|
+
M = +M + 1;
|
|
1721
|
+
m = 0;
|
|
1722
|
+
p = 0;
|
|
1723
|
+
} else {
|
|
1724
|
+
m = +m + 1;
|
|
1725
|
+
p = 0;
|
|
1341
1726
|
}
|
|
1727
|
+
} else if (gtlt === "<=") {
|
|
1728
|
+
gtlt = "<";
|
|
1729
|
+
if (xm) M = +M + 1;
|
|
1730
|
+
else m = +m + 1;
|
|
1342
1731
|
}
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
if (0 === this.prerelease.length) this.patch++;
|
|
1383
|
-
this.prerelease = [];
|
|
1384
|
-
break;
|
|
1385
|
-
case "pre": {
|
|
1386
|
-
const base = Number(identifierBase) ? 1 : 0;
|
|
1387
|
-
if (0 === this.prerelease.length) this.prerelease = [
|
|
1388
|
-
base
|
|
1389
|
-
];
|
|
1390
|
-
else {
|
|
1391
|
-
let i = this.prerelease.length;
|
|
1392
|
-
while (--i >= 0) if ("number" == typeof this.prerelease[i]) {
|
|
1393
|
-
this.prerelease[i]++;
|
|
1394
|
-
i = -2;
|
|
1395
|
-
}
|
|
1396
|
-
if (-1 === i) {
|
|
1397
|
-
if (identifier === this.prerelease.join(".") && false === identifierBase) throw new Error("invalid increment argument: identifier already exists");
|
|
1398
|
-
this.prerelease.push(base);
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
if (identifier) {
|
|
1402
|
-
let prerelease = [
|
|
1403
|
-
identifier,
|
|
1404
|
-
base
|
|
1405
|
-
];
|
|
1406
|
-
if (false === identifierBase) prerelease = [
|
|
1407
|
-
identifier
|
|
1408
|
-
];
|
|
1409
|
-
if (0 === compareIdentifiers(this.prerelease[0], identifier)) {
|
|
1410
|
-
if (isNaN(this.prerelease[1])) this.prerelease = prerelease;
|
|
1411
|
-
} else this.prerelease = prerelease;
|
|
1412
|
-
}
|
|
1413
|
-
break;
|
|
1414
|
-
}
|
|
1415
|
-
default:
|
|
1416
|
-
throw new Error(`invalid increment argument: ${release2}`);
|
|
1732
|
+
if (gtlt === "<") pr = "-0";
|
|
1733
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
1734
|
+
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
1735
|
+
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1736
|
+
debug$1("xRange return", ret);
|
|
1737
|
+
return ret;
|
|
1738
|
+
});
|
|
1739
|
+
}, "replaceXRange");
|
|
1740
|
+
const replaceStars = /* @__PURE__ */ __name((comp, options) => {
|
|
1741
|
+
debug$1("replaceStars", comp, options);
|
|
1742
|
+
return comp.trim().replace(re$1[t$1.STAR], "");
|
|
1743
|
+
}, "replaceStars");
|
|
1744
|
+
const replaceGTE0 = /* @__PURE__ */ __name((comp, options) => {
|
|
1745
|
+
debug$1("replaceGTE0", comp, options);
|
|
1746
|
+
return comp.trim().replace(re$1[options.includePrerelease ? t$1.GTE0PRE : t$1.GTE0], "");
|
|
1747
|
+
}, "replaceGTE0");
|
|
1748
|
+
const hyphenReplace = /* @__PURE__ */ __name((incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
1749
|
+
if (isX(fM)) from = "";
|
|
1750
|
+
else if (isX(fm)) from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
1751
|
+
else if (isX(fp)) from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
1752
|
+
else if (fpr) from = `>=${from}`;
|
|
1753
|
+
else from = `>=${from}${incPr ? "-0" : ""}`;
|
|
1754
|
+
if (isX(tM)) to = "";
|
|
1755
|
+
else if (isX(tm)) to = `<${+tM + 1}.0.0-0`;
|
|
1756
|
+
else if (isX(tp)) to = `<${tM}.${+tm + 1}.0-0`;
|
|
1757
|
+
else if (tpr) to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
1758
|
+
else if (incPr) to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
1759
|
+
else to = `<=${to}`;
|
|
1760
|
+
return `${from} ${to}`.trim();
|
|
1761
|
+
}, "hyphenReplace");
|
|
1762
|
+
const testSet = /* @__PURE__ */ __name((set, version2, options) => {
|
|
1763
|
+
for (let i = 0; i < set.length; i++) if (!set[i].test(version2)) return false;
|
|
1764
|
+
if (version2.prerelease.length && !options.includePrerelease) {
|
|
1765
|
+
for (let i = 0; i < set.length; i++) {
|
|
1766
|
+
debug$1(set[i].semver);
|
|
1767
|
+
if (set[i].semver === Comparator$4.ANY) continue;
|
|
1768
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
1769
|
+
const allowed = set[i].semver;
|
|
1770
|
+
if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) return true;
|
|
1417
1771
|
}
|
|
1418
|
-
this.raw = this.format();
|
|
1419
|
-
if (this.build.length) this.raw += `+${this.build.join(".")}`;
|
|
1420
|
-
return this;
|
|
1421
1772
|
}
|
|
1773
|
+
return false;
|
|
1422
1774
|
}
|
|
1423
|
-
|
|
1424
|
-
}, "
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
throw new TypeError(`Invalid operator: ${op}`);
|
|
1466
|
-
}
|
|
1467
|
-
}, "cmp");
|
|
1468
|
-
module.exports = cmp;
|
|
1469
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/cmp.js"),
|
|
1470
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/coerce.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1471
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1472
|
-
const parse = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js");
|
|
1473
|
-
const { safeRe: re, t } = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js");
|
|
1474
|
-
const coerce = /* @__PURE__ */ __name((version2, options) => {
|
|
1475
|
-
if (version2 instanceof SemVer) return version2;
|
|
1476
|
-
if ("number" == typeof version2) version2 = String(version2);
|
|
1477
|
-
if ("string" != typeof version2) return null;
|
|
1478
|
-
options = options || {};
|
|
1479
|
-
let match = null;
|
|
1480
|
-
if (options.rtl) {
|
|
1481
|
-
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
1482
|
-
let next;
|
|
1483
|
-
while ((next = coerceRtlRegex.exec(version2)) && (!match || match.index + match[0].length !== version2.length)) {
|
|
1484
|
-
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
1485
|
-
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
1486
|
-
}
|
|
1487
|
-
coerceRtlRegex.lastIndex = -1;
|
|
1488
|
-
} else match = version2.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
1489
|
-
if (null === match) return null;
|
|
1490
|
-
const major = match[2];
|
|
1491
|
-
const minor = match[3] || "0";
|
|
1492
|
-
const patch = match[4] || "0";
|
|
1493
|
-
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
1494
|
-
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
1495
|
-
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
1496
|
-
}, "coerce");
|
|
1497
|
-
module.exports = coerce;
|
|
1498
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/coerce.js"),
|
|
1499
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-build.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1500
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1501
|
-
const compareBuild = /* @__PURE__ */ __name((a, b, loose) => {
|
|
1502
|
-
const versionA = new SemVer(a, loose);
|
|
1503
|
-
const versionB = new SemVer(b, loose);
|
|
1504
|
-
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
1505
|
-
}, "compareBuild");
|
|
1506
|
-
module.exports = compareBuild;
|
|
1507
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-build.js"),
|
|
1508
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-loose.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1509
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
1510
|
-
const compareLoose = /* @__PURE__ */ __name((a, b) => compare(a, b, true), "compareLoose");
|
|
1511
|
-
module.exports = compareLoose;
|
|
1512
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-loose.js"),
|
|
1513
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1514
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1515
|
-
const compare = /* @__PURE__ */ __name((a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)), "compare");
|
|
1516
|
-
module.exports = compare;
|
|
1517
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js"),
|
|
1518
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/diff.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1519
|
-
const parse = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js");
|
|
1520
|
-
const diff = /* @__PURE__ */ __name((version1, version2) => {
|
|
1521
|
-
const v1 = parse(version1, null, true);
|
|
1522
|
-
const v2 = parse(version2, null, true);
|
|
1523
|
-
const comparison = v1.compare(v2);
|
|
1524
|
-
if (0 === comparison) return null;
|
|
1525
|
-
const v1Higher = comparison > 0;
|
|
1526
|
-
const highVersion = v1Higher ? v1 : v2;
|
|
1527
|
-
const lowVersion = v1Higher ? v2 : v1;
|
|
1528
|
-
const highHasPre = !!highVersion.prerelease.length;
|
|
1529
|
-
const lowHasPre = !!lowVersion.prerelease.length;
|
|
1530
|
-
if (lowHasPre && !highHasPre) {
|
|
1531
|
-
if (!lowVersion.patch && !lowVersion.minor) return "major";
|
|
1532
|
-
if (0 === lowVersion.compareMain(highVersion)) {
|
|
1533
|
-
if (lowVersion.minor && !lowVersion.patch) return "minor";
|
|
1534
|
-
return "patch";
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
const prefix = highHasPre ? "pre" : "";
|
|
1538
|
-
if (v1.major !== v2.major) return prefix + "major";
|
|
1539
|
-
if (v1.minor !== v2.minor) return prefix + "minor";
|
|
1540
|
-
if (v1.patch !== v2.patch) return prefix + "patch";
|
|
1541
|
-
return "prerelease";
|
|
1542
|
-
}, "diff");
|
|
1543
|
-
module.exports = diff;
|
|
1544
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/diff.js"),
|
|
1545
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/eq.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1546
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
1547
|
-
const eq = /* @__PURE__ */ __name((a, b, loose) => 0 === compare(a, b, loose), "eq");
|
|
1548
|
-
module.exports = eq;
|
|
1549
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/eq.js"),
|
|
1550
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1551
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
1552
|
-
const gt = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) > 0, "gt");
|
|
1553
|
-
module.exports = gt;
|
|
1554
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js"),
|
|
1555
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gte.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1556
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
1557
|
-
const gte = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) >= 0, "gte");
|
|
1558
|
-
module.exports = gte;
|
|
1559
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gte.js"),
|
|
1560
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/inc.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1561
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1562
|
-
const inc = /* @__PURE__ */ __name((version2, release2, options, identifier, identifierBase) => {
|
|
1563
|
-
if ("string" == typeof options) {
|
|
1564
|
-
identifierBase = identifier;
|
|
1565
|
-
identifier = options;
|
|
1566
|
-
options = void 0;
|
|
1567
|
-
}
|
|
1568
|
-
try {
|
|
1569
|
-
return new SemVer(version2 instanceof SemVer ? version2.version : version2, options).inc(release2, identifier, identifierBase).version;
|
|
1570
|
-
} catch (er) {
|
|
1571
|
-
return null;
|
|
1572
|
-
}
|
|
1573
|
-
}, "inc");
|
|
1574
|
-
module.exports = inc;
|
|
1575
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/inc.js"),
|
|
1576
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lt.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1577
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
1578
|
-
const lt = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) < 0, "lt");
|
|
1579
|
-
module.exports = lt;
|
|
1580
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lt.js"),
|
|
1581
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lte.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1582
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
1583
|
-
const lte = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) <= 0, "lte");
|
|
1584
|
-
module.exports = lte;
|
|
1585
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lte.js"),
|
|
1586
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/major.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1587
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1588
|
-
const major = /* @__PURE__ */ __name((a, loose) => new SemVer(a, loose).major, "major");
|
|
1589
|
-
module.exports = major;
|
|
1590
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/major.js"),
|
|
1591
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/minor.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1592
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1593
|
-
const minor = /* @__PURE__ */ __name((a, loose) => new SemVer(a, loose).minor, "minor");
|
|
1594
|
-
module.exports = minor;
|
|
1595
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/minor.js"),
|
|
1596
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/neq.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1597
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
1598
|
-
const neq = /* @__PURE__ */ __name((a, b, loose) => 0 !== compare(a, b, loose), "neq");
|
|
1599
|
-
module.exports = neq;
|
|
1600
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/neq.js"),
|
|
1601
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1602
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1603
|
-
const parse = /* @__PURE__ */ __name((version2, options, throwErrors = false) => {
|
|
1604
|
-
if (version2 instanceof SemVer) return version2;
|
|
1605
|
-
try {
|
|
1606
|
-
return new SemVer(version2, options);
|
|
1607
|
-
} catch (er) {
|
|
1608
|
-
if (!throwErrors) return null;
|
|
1609
|
-
throw er;
|
|
1610
|
-
}
|
|
1611
|
-
}, "parse");
|
|
1612
|
-
module.exports = parse;
|
|
1613
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js"),
|
|
1614
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/patch.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1615
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1616
|
-
const patch = /* @__PURE__ */ __name((a, loose) => new SemVer(a, loose).patch, "patch");
|
|
1617
|
-
module.exports = patch;
|
|
1618
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/patch.js"),
|
|
1619
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/prerelease.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1620
|
-
const parse = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js");
|
|
1621
|
-
const prerelease = /* @__PURE__ */ __name((version2, options) => {
|
|
1622
|
-
const parsed = parse(version2, options);
|
|
1623
|
-
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
1624
|
-
}, "prerelease");
|
|
1625
|
-
module.exports = prerelease;
|
|
1626
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/prerelease.js"),
|
|
1627
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rcompare.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1628
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
1629
|
-
const rcompare = /* @__PURE__ */ __name((a, b, loose) => compare(b, a, loose), "rcompare");
|
|
1630
|
-
module.exports = rcompare;
|
|
1631
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rcompare.js"),
|
|
1632
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rsort.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1633
|
-
const compareBuild = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-build.js");
|
|
1634
|
-
const rsort = /* @__PURE__ */ __name((list, loose) => list.sort((a, b) => compareBuild(b, a, loose)), "rsort");
|
|
1635
|
-
module.exports = rsort;
|
|
1636
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rsort.js"),
|
|
1637
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/satisfies.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1638
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
1639
|
-
const satisfies = /* @__PURE__ */ __name((version2, range, options) => {
|
|
1640
|
-
try {
|
|
1641
|
-
range = new Range(range, options);
|
|
1775
|
+
return true;
|
|
1776
|
+
}, "testSet");
|
|
1777
|
+
} });
|
|
1778
|
+
var require_comparator = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/comparator.js"(exports, module) {
|
|
1779
|
+
const ANY$2 = Symbol("SemVer ANY");
|
|
1780
|
+
var Comparator$3 = class Comparator$32 {
|
|
1781
|
+
static {
|
|
1782
|
+
__name(this, "Comparator$3");
|
|
1783
|
+
}
|
|
1784
|
+
static get ANY() {
|
|
1785
|
+
return ANY$2;
|
|
1786
|
+
}
|
|
1787
|
+
constructor(comp, options) {
|
|
1788
|
+
options = parseOptions(options);
|
|
1789
|
+
if (comp instanceof Comparator$32) if (comp.loose === !!options.loose) return comp;
|
|
1790
|
+
else comp = comp.value;
|
|
1791
|
+
comp = comp.trim().split(/\s+/).join(" ");
|
|
1792
|
+
debug3("comparator", comp, options);
|
|
1793
|
+
this.options = options;
|
|
1794
|
+
this.loose = !!options.loose;
|
|
1795
|
+
this.parse(comp);
|
|
1796
|
+
if (this.semver === ANY$2) this.value = "";
|
|
1797
|
+
else this.value = this.operator + this.semver.version;
|
|
1798
|
+
debug3("comp", this);
|
|
1799
|
+
}
|
|
1800
|
+
parse(comp) {
|
|
1801
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
1802
|
+
const m = comp.match(r);
|
|
1803
|
+
if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
|
|
1804
|
+
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
1805
|
+
if (this.operator === "=") this.operator = "";
|
|
1806
|
+
if (!m[2]) this.semver = ANY$2;
|
|
1807
|
+
else this.semver = new SemVer$5(m[2], this.options.loose);
|
|
1808
|
+
}
|
|
1809
|
+
toString() {
|
|
1810
|
+
return this.value;
|
|
1811
|
+
}
|
|
1812
|
+
test(version2) {
|
|
1813
|
+
debug3("Comparator.test", version2, this.options.loose);
|
|
1814
|
+
if (this.semver === ANY$2 || version2 === ANY$2) return true;
|
|
1815
|
+
if (typeof version2 === "string") try {
|
|
1816
|
+
version2 = new SemVer$5(version2, this.options);
|
|
1642
1817
|
} catch (er) {
|
|
1643
1818
|
return false;
|
|
1644
1819
|
}
|
|
1645
|
-
return
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
const parse = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js");
|
|
1656
|
-
const valid = /* @__PURE__ */ __name((version2, options) => {
|
|
1657
|
-
const v = parse(version2, options);
|
|
1658
|
-
return v ? v.version : null;
|
|
1659
|
-
}, "valid");
|
|
1660
|
-
module.exports = valid;
|
|
1661
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/valid.js"),
|
|
1662
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/index.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1663
|
-
const internalRe = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js");
|
|
1664
|
-
const constants = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js");
|
|
1665
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1666
|
-
const identifiers = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/identifiers.js");
|
|
1667
|
-
const parse = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js");
|
|
1668
|
-
const valid = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/valid.js");
|
|
1669
|
-
const clean = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/clean.js");
|
|
1670
|
-
const inc = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/inc.js");
|
|
1671
|
-
const diff = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/diff.js");
|
|
1672
|
-
const major = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/major.js");
|
|
1673
|
-
const minor = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/minor.js");
|
|
1674
|
-
const patch = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/patch.js");
|
|
1675
|
-
const prerelease = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/prerelease.js");
|
|
1676
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
1677
|
-
const rcompare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rcompare.js");
|
|
1678
|
-
const compareLoose = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-loose.js");
|
|
1679
|
-
const compareBuild = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-build.js");
|
|
1680
|
-
const sort = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/sort.js");
|
|
1681
|
-
const rsort = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rsort.js");
|
|
1682
|
-
const gt = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js");
|
|
1683
|
-
const lt = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lt.js");
|
|
1684
|
-
const eq = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/eq.js");
|
|
1685
|
-
const neq = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/neq.js");
|
|
1686
|
-
const gte = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gte.js");
|
|
1687
|
-
const lte = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lte.js");
|
|
1688
|
-
const cmp = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/cmp.js");
|
|
1689
|
-
const coerce = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/coerce.js");
|
|
1690
|
-
const Comparator = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/comparator.js");
|
|
1691
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
1692
|
-
const satisfies = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/satisfies.js");
|
|
1693
|
-
const toComparators = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/to-comparators.js");
|
|
1694
|
-
const maxSatisfying = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/max-satisfying.js");
|
|
1695
|
-
const minSatisfying = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/min-satisfying.js");
|
|
1696
|
-
const minVersion = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/min-version.js");
|
|
1697
|
-
const validRange = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/valid.js");
|
|
1698
|
-
const outside = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/outside.js");
|
|
1699
|
-
const gtr = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/gtr.js");
|
|
1700
|
-
const ltr = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/ltr.js");
|
|
1701
|
-
const intersects = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/intersects.js");
|
|
1702
|
-
const simplifyRange = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/simplify.js");
|
|
1703
|
-
const subset = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/subset.js");
|
|
1704
|
-
module.exports = {
|
|
1705
|
-
parse,
|
|
1706
|
-
valid,
|
|
1707
|
-
clean,
|
|
1708
|
-
inc,
|
|
1709
|
-
diff,
|
|
1710
|
-
major,
|
|
1711
|
-
minor,
|
|
1712
|
-
patch,
|
|
1713
|
-
prerelease,
|
|
1714
|
-
compare,
|
|
1715
|
-
rcompare,
|
|
1716
|
-
compareLoose,
|
|
1717
|
-
compareBuild,
|
|
1718
|
-
sort,
|
|
1719
|
-
rsort,
|
|
1720
|
-
gt,
|
|
1721
|
-
lt,
|
|
1722
|
-
eq,
|
|
1723
|
-
neq,
|
|
1724
|
-
gte,
|
|
1725
|
-
lte,
|
|
1726
|
-
cmp,
|
|
1727
|
-
coerce,
|
|
1728
|
-
Comparator,
|
|
1729
|
-
Range,
|
|
1730
|
-
satisfies,
|
|
1731
|
-
toComparators,
|
|
1732
|
-
maxSatisfying,
|
|
1733
|
-
minSatisfying,
|
|
1734
|
-
minVersion,
|
|
1735
|
-
validRange,
|
|
1736
|
-
outside,
|
|
1737
|
-
gtr,
|
|
1738
|
-
ltr,
|
|
1739
|
-
intersects,
|
|
1740
|
-
simplifyRange,
|
|
1741
|
-
subset,
|
|
1742
|
-
SemVer,
|
|
1743
|
-
re: internalRe.re,
|
|
1744
|
-
src: internalRe.src,
|
|
1745
|
-
tokens: internalRe.t,
|
|
1746
|
-
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
1747
|
-
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
1748
|
-
compareIdentifiers: identifiers.compareIdentifiers,
|
|
1749
|
-
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
1750
|
-
};
|
|
1751
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/index.js"),
|
|
1752
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js": /* @__PURE__ */ __name(function(module) {
|
|
1753
|
-
const SEMVER_SPEC_VERSION = "2.0.0";
|
|
1754
|
-
const MAX_LENGTH = 256;
|
|
1755
|
-
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
1756
|
-
const MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
1757
|
-
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
1758
|
-
const RELEASE_TYPES = [
|
|
1759
|
-
"major",
|
|
1760
|
-
"premajor",
|
|
1761
|
-
"minor",
|
|
1762
|
-
"preminor",
|
|
1763
|
-
"patch",
|
|
1764
|
-
"prepatch",
|
|
1765
|
-
"prerelease"
|
|
1766
|
-
];
|
|
1767
|
-
module.exports = {
|
|
1768
|
-
MAX_LENGTH,
|
|
1769
|
-
MAX_SAFE_COMPONENT_LENGTH,
|
|
1770
|
-
MAX_SAFE_BUILD_LENGTH,
|
|
1771
|
-
MAX_SAFE_INTEGER,
|
|
1772
|
-
RELEASE_TYPES,
|
|
1773
|
-
SEMVER_SPEC_VERSION,
|
|
1774
|
-
FLAG_INCLUDE_PRERELEASE: 1,
|
|
1775
|
-
FLAG_LOOSE: 2
|
|
1776
|
-
};
|
|
1777
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js"),
|
|
1778
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js": /* @__PURE__ */ __name(function(module) {
|
|
1779
|
-
const debug3 = "object" == typeof process && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
1780
|
-
};
|
|
1781
|
-
module.exports = debug3;
|
|
1782
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js"),
|
|
1783
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/identifiers.js": /* @__PURE__ */ __name(function(module) {
|
|
1784
|
-
const numeric = /^[0-9]+$/;
|
|
1785
|
-
const compareIdentifiers = /* @__PURE__ */ __name((a, b) => {
|
|
1786
|
-
const anum = numeric.test(a);
|
|
1787
|
-
const bnum = numeric.test(b);
|
|
1788
|
-
if (anum && bnum) {
|
|
1789
|
-
a *= 1;
|
|
1790
|
-
b *= 1;
|
|
1791
|
-
}
|
|
1792
|
-
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
1793
|
-
}, "compareIdentifiers");
|
|
1794
|
-
const rcompareIdentifiers = /* @__PURE__ */ __name((a, b) => compareIdentifiers(b, a), "rcompareIdentifiers");
|
|
1795
|
-
module.exports = {
|
|
1796
|
-
compareIdentifiers,
|
|
1797
|
-
rcompareIdentifiers
|
|
1798
|
-
};
|
|
1799
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/identifiers.js"),
|
|
1800
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/lrucache.js": /* @__PURE__ */ __name(function(module) {
|
|
1801
|
-
class LRUCache {
|
|
1802
|
-
static {
|
|
1803
|
-
__name(this, "LRUCache");
|
|
1804
|
-
}
|
|
1805
|
-
constructor() {
|
|
1806
|
-
this.max = 1e3;
|
|
1807
|
-
this.map = /* @__PURE__ */ new Map();
|
|
1808
|
-
}
|
|
1809
|
-
get(key) {
|
|
1810
|
-
const value = this.map.get(key);
|
|
1811
|
-
if (void 0 === value) return;
|
|
1812
|
-
this.map.delete(key);
|
|
1813
|
-
this.map.set(key, value);
|
|
1814
|
-
return value;
|
|
1815
|
-
}
|
|
1816
|
-
delete(key) {
|
|
1817
|
-
return this.map.delete(key);
|
|
1820
|
+
return cmp$1(version2, this.operator, this.semver, this.options);
|
|
1821
|
+
}
|
|
1822
|
+
intersects(comp, options) {
|
|
1823
|
+
if (!(comp instanceof Comparator$32)) throw new TypeError("a Comparator is required");
|
|
1824
|
+
if (this.operator === "") {
|
|
1825
|
+
if (this.value === "") return true;
|
|
1826
|
+
return new Range$10(comp.value, options).test(this.value);
|
|
1827
|
+
} else if (comp.operator === "") {
|
|
1828
|
+
if (comp.value === "") return true;
|
|
1829
|
+
return new Range$10(this.value, options).test(comp.semver);
|
|
1818
1830
|
}
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1831
|
+
options = parseOptions(options);
|
|
1832
|
+
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
|
|
1833
|
+
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) return false;
|
|
1834
|
+
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
|
|
1835
|
+
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
|
|
1836
|
+
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
|
|
1837
|
+
if (cmp$1(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
|
|
1838
|
+
if (cmp$1(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
|
|
1839
|
+
return false;
|
|
1840
|
+
}
|
|
1841
|
+
};
|
|
1842
|
+
module.exports = Comparator$3;
|
|
1843
|
+
const parseOptions = require_parse_options();
|
|
1844
|
+
const { safeRe: re, t } = require_re();
|
|
1845
|
+
const cmp$1 = require_cmp();
|
|
1846
|
+
const debug3 = require_debug();
|
|
1847
|
+
const SemVer$5 = require_semver$1();
|
|
1848
|
+
const Range$10 = require_range();
|
|
1849
|
+
} });
|
|
1850
|
+
var require_satisfies = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/satisfies.js"(exports, module) {
|
|
1851
|
+
const Range$9 = require_range();
|
|
1852
|
+
const satisfies$4 = /* @__PURE__ */ __name((version2, range, options) => {
|
|
1853
|
+
try {
|
|
1854
|
+
range = new Range$9(range, options);
|
|
1855
|
+
} catch (er) {
|
|
1856
|
+
return false;
|
|
1857
|
+
}
|
|
1858
|
+
return range.test(version2);
|
|
1859
|
+
}, "satisfies$4");
|
|
1860
|
+
module.exports = satisfies$4;
|
|
1861
|
+
} });
|
|
1862
|
+
var require_to_comparators = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/to-comparators.js"(exports, module) {
|
|
1863
|
+
const Range$8 = require_range();
|
|
1864
|
+
const toComparators$1 = /* @__PURE__ */ __name((range, options) => new Range$8(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" ")), "toComparators$1");
|
|
1865
|
+
module.exports = toComparators$1;
|
|
1866
|
+
} });
|
|
1867
|
+
var require_max_satisfying = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
|
|
1868
|
+
const SemVer$4 = require_semver$1();
|
|
1869
|
+
const Range$7 = require_range();
|
|
1870
|
+
const maxSatisfying$1 = /* @__PURE__ */ __name((versions2, range, options) => {
|
|
1871
|
+
let max = null;
|
|
1872
|
+
let maxSV = null;
|
|
1873
|
+
let rangeObj = null;
|
|
1874
|
+
try {
|
|
1875
|
+
rangeObj = new Range$7(range, options);
|
|
1876
|
+
} catch (er) {
|
|
1877
|
+
return null;
|
|
1878
|
+
}
|
|
1879
|
+
versions2.forEach((v) => {
|
|
1880
|
+
if (rangeObj.test(v)) {
|
|
1881
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
1882
|
+
max = v;
|
|
1883
|
+
maxSV = new SemVer$4(max, options);
|
|
1827
1884
|
}
|
|
1828
|
-
return this;
|
|
1829
1885
|
}
|
|
1830
|
-
}
|
|
1831
|
-
module.exports = LRUCache;
|
|
1832
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/lrucache.js"),
|
|
1833
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/parse-options.js": /* @__PURE__ */ __name(function(module) {
|
|
1834
|
-
const looseOption = Object.freeze({
|
|
1835
|
-
loose: true
|
|
1836
1886
|
});
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
"\\s",
|
|
1859
|
-
1
|
|
1860
|
-
],
|
|
1861
|
-
[
|
|
1862
|
-
"\\d",
|
|
1863
|
-
MAX_LENGTH
|
|
1864
|
-
],
|
|
1865
|
-
[
|
|
1866
|
-
LETTERDASHNUMBER,
|
|
1867
|
-
MAX_SAFE_BUILD_LENGTH
|
|
1868
|
-
]
|
|
1869
|
-
];
|
|
1870
|
-
const makeSafeRegex = /* @__PURE__ */ __name((value) => {
|
|
1871
|
-
for (const [token, max] of safeRegexReplacements) value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
1872
|
-
return value;
|
|
1873
|
-
}, "makeSafeRegex");
|
|
1874
|
-
const createToken = /* @__PURE__ */ __name((name, value, isGlobal) => {
|
|
1875
|
-
const safe = makeSafeRegex(value);
|
|
1876
|
-
const index = R++;
|
|
1877
|
-
debug3(name, index, value);
|
|
1878
|
-
t[name] = index;
|
|
1879
|
-
src[index] = value;
|
|
1880
|
-
safeSrc[index] = safe;
|
|
1881
|
-
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
1882
|
-
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
1883
|
-
}, "createToken");
|
|
1884
|
-
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
1885
|
-
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
1886
|
-
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
1887
|
-
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
1888
|
-
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
1889
|
-
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
|
|
1890
|
-
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
|
|
1891
|
-
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
1892
|
-
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
1893
|
-
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
1894
|
-
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
1895
|
-
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
1896
|
-
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
1897
|
-
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
1898
|
-
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
1899
|
-
createToken("GTLT", "((?:<|>)?=?)");
|
|
1900
|
-
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
1901
|
-
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
1902
|
-
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
1903
|
-
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
1904
|
-
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
1905
|
-
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
1906
|
-
createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
1907
|
-
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
1908
|
-
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
1909
|
-
createToken("COERCERTL", src[t.COERCE], true);
|
|
1910
|
-
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
1911
|
-
createToken("LONETILDE", "(?:~>?)");
|
|
1912
|
-
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
1913
|
-
exports.tildeTrimReplace = "$1~";
|
|
1914
|
-
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
1915
|
-
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
1916
|
-
createToken("LONECARET", "(?:\\^)");
|
|
1917
|
-
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
1918
|
-
exports.caretTrimReplace = "$1^";
|
|
1919
|
-
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
1920
|
-
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
1921
|
-
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
1922
|
-
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
1923
|
-
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
1924
|
-
exports.comparatorTrimReplace = "$1$2$3";
|
|
1925
|
-
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
1926
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
1927
|
-
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
1928
|
-
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
1929
|
-
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
1930
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js"),
|
|
1931
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/gtr.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1932
|
-
const outside = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/outside.js");
|
|
1933
|
-
const gtr = /* @__PURE__ */ __name((version2, range, options) => outside(version2, range, ">", options), "gtr");
|
|
1934
|
-
module.exports = gtr;
|
|
1935
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/gtr.js"),
|
|
1936
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/intersects.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1937
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
1938
|
-
const intersects = /* @__PURE__ */ __name((r1, r2, options) => {
|
|
1939
|
-
r1 = new Range(r1, options);
|
|
1940
|
-
r2 = new Range(r2, options);
|
|
1941
|
-
return r1.intersects(r2, options);
|
|
1942
|
-
}, "intersects");
|
|
1943
|
-
module.exports = intersects;
|
|
1944
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/intersects.js"),
|
|
1945
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/ltr.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1946
|
-
const outside = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/outside.js");
|
|
1947
|
-
const ltr = /* @__PURE__ */ __name((version2, range, options) => outside(version2, range, "<", options), "ltr");
|
|
1948
|
-
module.exports = ltr;
|
|
1949
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/ltr.js"),
|
|
1950
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/max-satisfying.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1951
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1952
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
1953
|
-
const maxSatisfying = /* @__PURE__ */ __name((versions2, range, options) => {
|
|
1954
|
-
let max = null;
|
|
1955
|
-
let maxSV = null;
|
|
1956
|
-
let rangeObj = null;
|
|
1957
|
-
try {
|
|
1958
|
-
rangeObj = new Range(range, options);
|
|
1959
|
-
} catch (er) {
|
|
1960
|
-
return null;
|
|
1961
|
-
}
|
|
1962
|
-
versions2.forEach((v) => {
|
|
1963
|
-
if (rangeObj.test(v)) {
|
|
1964
|
-
if (!max || -1 === maxSV.compare(v)) {
|
|
1965
|
-
max = v;
|
|
1966
|
-
maxSV = new SemVer(max, options);
|
|
1967
|
-
}
|
|
1887
|
+
return max;
|
|
1888
|
+
}, "maxSatisfying$1");
|
|
1889
|
+
module.exports = maxSatisfying$1;
|
|
1890
|
+
} });
|
|
1891
|
+
var require_min_satisfying = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
|
|
1892
|
+
const SemVer$3 = require_semver$1();
|
|
1893
|
+
const Range$6 = require_range();
|
|
1894
|
+
const minSatisfying$1 = /* @__PURE__ */ __name((versions2, range, options) => {
|
|
1895
|
+
let min = null;
|
|
1896
|
+
let minSV = null;
|
|
1897
|
+
let rangeObj = null;
|
|
1898
|
+
try {
|
|
1899
|
+
rangeObj = new Range$6(range, options);
|
|
1900
|
+
} catch (er) {
|
|
1901
|
+
return null;
|
|
1902
|
+
}
|
|
1903
|
+
versions2.forEach((v) => {
|
|
1904
|
+
if (rangeObj.test(v)) {
|
|
1905
|
+
if (!min || minSV.compare(v) === 1) {
|
|
1906
|
+
min = v;
|
|
1907
|
+
minSV = new SemVer$3(min, options);
|
|
1968
1908
|
}
|
|
1969
|
-
});
|
|
1970
|
-
return max;
|
|
1971
|
-
}, "maxSatisfying");
|
|
1972
|
-
module.exports = maxSatisfying;
|
|
1973
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/max-satisfying.js"),
|
|
1974
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/min-satisfying.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
1975
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1976
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
1977
|
-
const minSatisfying = /* @__PURE__ */ __name((versions2, range, options) => {
|
|
1978
|
-
let min = null;
|
|
1979
|
-
let minSV = null;
|
|
1980
|
-
let rangeObj = null;
|
|
1981
|
-
try {
|
|
1982
|
-
rangeObj = new Range(range, options);
|
|
1983
|
-
} catch (er) {
|
|
1984
|
-
return null;
|
|
1985
1909
|
}
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1910
|
+
});
|
|
1911
|
+
return min;
|
|
1912
|
+
}, "minSatisfying$1");
|
|
1913
|
+
module.exports = minSatisfying$1;
|
|
1914
|
+
} });
|
|
1915
|
+
var require_min_version = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-version.js"(exports, module) {
|
|
1916
|
+
const SemVer$2 = require_semver$1();
|
|
1917
|
+
const Range$5 = require_range();
|
|
1918
|
+
const gt$2 = require_gt();
|
|
1919
|
+
const minVersion$1 = /* @__PURE__ */ __name((range, loose) => {
|
|
1920
|
+
range = new Range$5(range, loose);
|
|
1921
|
+
let minver = new SemVer$2("0.0.0");
|
|
1922
|
+
if (range.test(minver)) return minver;
|
|
1923
|
+
minver = new SemVer$2("0.0.0-0");
|
|
1924
|
+
if (range.test(minver)) return minver;
|
|
1925
|
+
minver = null;
|
|
1926
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1927
|
+
const comparators = range.set[i];
|
|
1928
|
+
let setMin = null;
|
|
1929
|
+
comparators.forEach((comparator) => {
|
|
1930
|
+
const compver = new SemVer$2(comparator.semver.version);
|
|
1931
|
+
switch (comparator.operator) {
|
|
1932
|
+
case ">":
|
|
1933
|
+
if (compver.prerelease.length === 0) compver.patch++;
|
|
1934
|
+
else compver.prerelease.push(0);
|
|
1935
|
+
compver.raw = compver.format();
|
|
1936
|
+
case "":
|
|
1937
|
+
case ">=":
|
|
1938
|
+
if (!setMin || gt$2(compver, setMin)) setMin = compver;
|
|
1939
|
+
break;
|
|
1940
|
+
case "<":
|
|
1941
|
+
case "<=":
|
|
1942
|
+
break;
|
|
1943
|
+
default:
|
|
1944
|
+
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1992
1945
|
}
|
|
1993
1946
|
});
|
|
1994
|
-
|
|
1995
|
-
}
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
"
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
if (range.test(minver)) return minver;
|
|
2008
|
-
minver = null;
|
|
2009
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
2010
|
-
const comparators = range.set[i];
|
|
2011
|
-
let setMin = null;
|
|
2012
|
-
comparators.forEach((comparator) => {
|
|
2013
|
-
const compver = new SemVer(comparator.semver.version);
|
|
2014
|
-
switch (comparator.operator) {
|
|
2015
|
-
case ">":
|
|
2016
|
-
if (0 === compver.prerelease.length) compver.patch++;
|
|
2017
|
-
else compver.prerelease.push(0);
|
|
2018
|
-
compver.raw = compver.format();
|
|
2019
|
-
case "":
|
|
2020
|
-
case ">=":
|
|
2021
|
-
if (!setMin || gt(compver, setMin)) setMin = compver;
|
|
2022
|
-
break;
|
|
2023
|
-
case "<":
|
|
2024
|
-
case "<=":
|
|
2025
|
-
break;
|
|
2026
|
-
default:
|
|
2027
|
-
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
2028
|
-
}
|
|
2029
|
-
});
|
|
2030
|
-
if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
|
|
2031
|
-
}
|
|
2032
|
-
if (minver && range.test(minver)) return minver;
|
|
1947
|
+
if (setMin && (!minver || gt$2(minver, setMin))) minver = setMin;
|
|
1948
|
+
}
|
|
1949
|
+
if (minver && range.test(minver)) return minver;
|
|
1950
|
+
return null;
|
|
1951
|
+
}, "minVersion$1");
|
|
1952
|
+
module.exports = minVersion$1;
|
|
1953
|
+
} });
|
|
1954
|
+
var require_valid = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/valid.js"(exports, module) {
|
|
1955
|
+
const Range$4 = require_range();
|
|
1956
|
+
const validRange$1 = /* @__PURE__ */ __name((range, options) => {
|
|
1957
|
+
try {
|
|
1958
|
+
return new Range$4(range, options).range || "*";
|
|
1959
|
+
} catch (er) {
|
|
2033
1960
|
return null;
|
|
2034
|
-
}
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
1961
|
+
}
|
|
1962
|
+
}, "validRange$1");
|
|
1963
|
+
module.exports = validRange$1;
|
|
1964
|
+
} });
|
|
1965
|
+
var require_outside = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/outside.js"(exports, module) {
|
|
1966
|
+
const SemVer$1 = require_semver$1();
|
|
1967
|
+
const Comparator$2 = require_comparator();
|
|
1968
|
+
const { ANY: ANY$1 } = Comparator$2;
|
|
1969
|
+
const Range$3 = require_range();
|
|
1970
|
+
const satisfies$3 = require_satisfies();
|
|
1971
|
+
const gt$1 = require_gt();
|
|
1972
|
+
const lt$1 = require_lt();
|
|
1973
|
+
const lte$1 = require_lte();
|
|
1974
|
+
const gte$1 = require_gte();
|
|
1975
|
+
const outside$3 = /* @__PURE__ */ __name((version2, range, hilo, options) => {
|
|
1976
|
+
version2 = new SemVer$1(version2, options);
|
|
1977
|
+
range = new Range$3(range, options);
|
|
1978
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1979
|
+
switch (hilo) {
|
|
1980
|
+
case ">":
|
|
1981
|
+
gtfn = gt$1;
|
|
1982
|
+
ltefn = lte$1;
|
|
1983
|
+
ltfn = lt$1;
|
|
1984
|
+
comp = ">";
|
|
1985
|
+
ecomp = ">=";
|
|
1986
|
+
break;
|
|
1987
|
+
case "<":
|
|
1988
|
+
gtfn = lt$1;
|
|
1989
|
+
ltefn = gte$1;
|
|
1990
|
+
ltfn = gt$1;
|
|
1991
|
+
comp = "<";
|
|
1992
|
+
ecomp = "<=";
|
|
1993
|
+
break;
|
|
1994
|
+
default:
|
|
1995
|
+
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
1996
|
+
}
|
|
1997
|
+
if (satisfies$3(version2, range, options)) return false;
|
|
1998
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1999
|
+
const comparators = range.set[i];
|
|
2000
|
+
let high = null;
|
|
2001
|
+
let low = null;
|
|
2002
|
+
comparators.forEach((comparator) => {
|
|
2003
|
+
if (comparator.semver === ANY$1) comparator = new Comparator$2(">=0.0.0");
|
|
2004
|
+
high = high || comparator;
|
|
2005
|
+
low = low || comparator;
|
|
2006
|
+
if (gtfn(comparator.semver, high.semver, options)) high = comparator;
|
|
2007
|
+
else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
|
|
2008
|
+
});
|
|
2009
|
+
if (high.operator === comp || high.operator === ecomp) return false;
|
|
2010
|
+
if ((!low.operator || low.operator === comp) && ltefn(version2, low.semver)) return false;
|
|
2011
|
+
else if (low.operator === ecomp && ltfn(version2, low.semver)) return false;
|
|
2012
|
+
}
|
|
2013
|
+
return true;
|
|
2014
|
+
}, "outside$3");
|
|
2015
|
+
module.exports = outside$3;
|
|
2016
|
+
} });
|
|
2017
|
+
var require_gtr = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/gtr.js"(exports, module) {
|
|
2018
|
+
const outside$2 = require_outside();
|
|
2019
|
+
const gtr$1 = /* @__PURE__ */ __name((version2, range, options) => outside$2(version2, range, ">", options), "gtr$1");
|
|
2020
|
+
module.exports = gtr$1;
|
|
2021
|
+
} });
|
|
2022
|
+
var require_ltr = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/ltr.js"(exports, module) {
|
|
2023
|
+
const outside$1 = require_outside();
|
|
2024
|
+
const ltr$1 = /* @__PURE__ */ __name((version2, range, options) => outside$1(version2, range, "<", options), "ltr$1");
|
|
2025
|
+
module.exports = ltr$1;
|
|
2026
|
+
} });
|
|
2027
|
+
var require_intersects = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/intersects.js"(exports, module) {
|
|
2028
|
+
const Range$2 = require_range();
|
|
2029
|
+
const intersects$1 = /* @__PURE__ */ __name((r1, r2, options) => {
|
|
2030
|
+
r1 = new Range$2(r1, options);
|
|
2031
|
+
r2 = new Range$2(r2, options);
|
|
2032
|
+
return r1.intersects(r2, options);
|
|
2033
|
+
}, "intersects$1");
|
|
2034
|
+
module.exports = intersects$1;
|
|
2035
|
+
} });
|
|
2036
|
+
var require_simplify = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/simplify.js"(exports, module) {
|
|
2037
|
+
const satisfies$2 = require_satisfies();
|
|
2038
|
+
const compare$2 = require_compare();
|
|
2039
|
+
module.exports = (versions2, range, options) => {
|
|
2040
|
+
const set = [];
|
|
2041
|
+
let first = null;
|
|
2042
|
+
let prev = null;
|
|
2043
|
+
const v = versions2.sort((a, b) => compare$2(a, b, options));
|
|
2044
|
+
for (const version2 of v) {
|
|
2045
|
+
const included = satisfies$2(version2, range, options);
|
|
2046
|
+
if (included) {
|
|
2047
|
+
prev = version2;
|
|
2048
|
+
if (!first) first = version2;
|
|
2049
|
+
} else {
|
|
2050
|
+
if (prev) set.push([first, prev]);
|
|
2051
|
+
prev = null;
|
|
2052
|
+
first = null;
|
|
2068
2053
|
}
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2054
|
+
}
|
|
2055
|
+
if (first) set.push([first, null]);
|
|
2056
|
+
const ranges = [];
|
|
2057
|
+
for (const [min, max] of set) if (min === max) ranges.push(min);
|
|
2058
|
+
else if (!max && min === v[0]) ranges.push("*");
|
|
2059
|
+
else if (!max) ranges.push(`>=${min}`);
|
|
2060
|
+
else if (min === v[0]) ranges.push(`<=${max}`);
|
|
2061
|
+
else ranges.push(`${min} - ${max}`);
|
|
2062
|
+
const simplified = ranges.join(" || ");
|
|
2063
|
+
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
2064
|
+
return simplified.length < original.length ? simplified : range;
|
|
2065
|
+
};
|
|
2066
|
+
} });
|
|
2067
|
+
var require_subset = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/subset.js"(exports, module) {
|
|
2068
|
+
const Range$1 = require_range();
|
|
2069
|
+
const Comparator$1 = require_comparator();
|
|
2070
|
+
const { ANY } = Comparator$1;
|
|
2071
|
+
const satisfies$1 = require_satisfies();
|
|
2072
|
+
const compare$1 = require_compare();
|
|
2073
|
+
const subset$1 = /* @__PURE__ */ __name((sub, dom, options = {}) => {
|
|
2074
|
+
if (sub === dom) return true;
|
|
2075
|
+
sub = new Range$1(sub, options);
|
|
2076
|
+
dom = new Range$1(dom, options);
|
|
2077
|
+
let sawNonNull = false;
|
|
2078
|
+
OUTER: for (const simpleSub of sub.set) {
|
|
2079
|
+
for (const simpleDom of dom.set) {
|
|
2080
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
2081
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
2082
|
+
if (isSub) continue OUTER;
|
|
2084
2083
|
}
|
|
2084
|
+
if (sawNonNull) return false;
|
|
2085
|
+
}
|
|
2086
|
+
return true;
|
|
2087
|
+
}, "subset$1");
|
|
2088
|
+
const minimumVersionWithPreRelease = [new Comparator$1(">=0.0.0-0")];
|
|
2089
|
+
const minimumVersion = [new Comparator$1(">=0.0.0")];
|
|
2090
|
+
const simpleSubset = /* @__PURE__ */ __name((sub, dom, options) => {
|
|
2091
|
+
if (sub === dom) return true;
|
|
2092
|
+
if (sub.length === 1 && sub[0].semver === ANY) if (dom.length === 1 && dom[0].semver === ANY) return true;
|
|
2093
|
+
else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
|
|
2094
|
+
else sub = minimumVersion;
|
|
2095
|
+
if (dom.length === 1 && dom[0].semver === ANY) if (options.includePrerelease) return true;
|
|
2096
|
+
else dom = minimumVersion;
|
|
2097
|
+
const eqSet = /* @__PURE__ */ new Set();
|
|
2098
|
+
let gt$5, lt$4;
|
|
2099
|
+
for (const c of sub) if (c.operator === ">" || c.operator === ">=") gt$5 = higherGT(gt$5, c, options);
|
|
2100
|
+
else if (c.operator === "<" || c.operator === "<=") lt$4 = lowerLT(lt$4, c, options);
|
|
2101
|
+
else eqSet.add(c.semver);
|
|
2102
|
+
if (eqSet.size > 1) return null;
|
|
2103
|
+
let gtltComp;
|
|
2104
|
+
if (gt$5 && lt$4) {
|
|
2105
|
+
gtltComp = compare$1(gt$5.semver, lt$4.semver, options);
|
|
2106
|
+
if (gtltComp > 0) return null;
|
|
2107
|
+
else if (gtltComp === 0 && (gt$5.operator !== ">=" || lt$4.operator !== "<=")) return null;
|
|
2108
|
+
}
|
|
2109
|
+
for (const eq$3 of eqSet) {
|
|
2110
|
+
if (gt$5 && !satisfies$1(eq$3, String(gt$5), options)) return null;
|
|
2111
|
+
if (lt$4 && !satisfies$1(eq$3, String(lt$4), options)) return null;
|
|
2112
|
+
for (const c of dom) if (!satisfies$1(eq$3, String(c), options)) return false;
|
|
2085
2113
|
return true;
|
|
2086
|
-
}
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
const included = satisfies(version2, range, options);
|
|
2099
|
-
if (included) {
|
|
2100
|
-
prev = version2;
|
|
2101
|
-
if (!first) first = version2;
|
|
2102
|
-
} else {
|
|
2103
|
-
if (prev) set.push([
|
|
2104
|
-
first,
|
|
2105
|
-
prev
|
|
2106
|
-
]);
|
|
2107
|
-
prev = null;
|
|
2108
|
-
first = null;
|
|
2109
|
-
}
|
|
2110
|
-
}
|
|
2111
|
-
if (first) set.push([
|
|
2112
|
-
first,
|
|
2113
|
-
null
|
|
2114
|
-
]);
|
|
2115
|
-
const ranges = [];
|
|
2116
|
-
for (const [min, max] of set) if (min === max) ranges.push(min);
|
|
2117
|
-
else if (max || min !== v[0]) if (max) if (min === v[0]) ranges.push(`<=${max}`);
|
|
2118
|
-
else ranges.push(`${min} - ${max}`);
|
|
2119
|
-
else ranges.push(`>=${min}`);
|
|
2120
|
-
else ranges.push("*");
|
|
2121
|
-
const simplified = ranges.join(" || ");
|
|
2122
|
-
const original = "string" == typeof range.raw ? range.raw : String(range);
|
|
2123
|
-
return simplified.length < original.length ? simplified : range;
|
|
2124
|
-
};
|
|
2125
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/simplify.js"),
|
|
2126
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/subset.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
2127
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
2128
|
-
const Comparator = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/comparator.js");
|
|
2129
|
-
const { ANY } = Comparator;
|
|
2130
|
-
const satisfies = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/satisfies.js");
|
|
2131
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
2132
|
-
const subset = /* @__PURE__ */ __name((sub, dom, options = {}) => {
|
|
2133
|
-
if (sub === dom) return true;
|
|
2134
|
-
sub = new Range(sub, options);
|
|
2135
|
-
dom = new Range(dom, options);
|
|
2136
|
-
let sawNonNull = false;
|
|
2137
|
-
OUTER: for (const simpleSub of sub.set) {
|
|
2138
|
-
for (const simpleDom of dom.set) {
|
|
2139
|
-
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
2140
|
-
sawNonNull = sawNonNull || null !== isSub;
|
|
2141
|
-
if (isSub) continue OUTER;
|
|
2114
|
+
}
|
|
2115
|
+
let higher, lower;
|
|
2116
|
+
let hasDomLT, hasDomGT;
|
|
2117
|
+
let needDomLTPre = lt$4 && !options.includePrerelease && lt$4.semver.prerelease.length ? lt$4.semver : false;
|
|
2118
|
+
let needDomGTPre = gt$5 && !options.includePrerelease && gt$5.semver.prerelease.length ? gt$5.semver : false;
|
|
2119
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt$4.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
|
|
2120
|
+
for (const c of dom) {
|
|
2121
|
+
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
2122
|
+
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
2123
|
+
if (gt$5) {
|
|
2124
|
+
if (needDomGTPre) {
|
|
2125
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) needDomGTPre = false;
|
|
2142
2126
|
}
|
|
2143
|
-
if (
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
const minimumVersionWithPreRelease = [
|
|
2148
|
-
new Comparator(">=0.0.0-0")
|
|
2149
|
-
];
|
|
2150
|
-
const minimumVersion = [
|
|
2151
|
-
new Comparator(">=0.0.0")
|
|
2152
|
-
];
|
|
2153
|
-
const simpleSubset = /* @__PURE__ */ __name((sub, dom, options) => {
|
|
2154
|
-
if (sub === dom) return true;
|
|
2155
|
-
if (1 === sub.length && sub[0].semver === ANY) if (1 === dom.length && dom[0].semver === ANY) return true;
|
|
2156
|
-
else sub = options.includePrerelease ? minimumVersionWithPreRelease : minimumVersion;
|
|
2157
|
-
if (1 === dom.length && dom[0].semver === ANY) if (options.includePrerelease) return true;
|
|
2158
|
-
else dom = minimumVersion;
|
|
2159
|
-
const eqSet = /* @__PURE__ */ new Set();
|
|
2160
|
-
let gt, lt;
|
|
2161
|
-
for (const c of sub) if (">" === c.operator || ">=" === c.operator) gt = higherGT(gt, c, options);
|
|
2162
|
-
else if ("<" === c.operator || "<=" === c.operator) lt = lowerLT(lt, c, options);
|
|
2163
|
-
else eqSet.add(c.semver);
|
|
2164
|
-
if (eqSet.size > 1) return null;
|
|
2165
|
-
let gtltComp;
|
|
2166
|
-
if (gt && lt) {
|
|
2167
|
-
gtltComp = compare(gt.semver, lt.semver, options);
|
|
2168
|
-
if (gtltComp > 0) return null;
|
|
2169
|
-
if (0 === gtltComp && (">=" !== gt.operator || "<=" !== lt.operator)) return null;
|
|
2170
|
-
}
|
|
2171
|
-
for (const eq of eqSet) {
|
|
2172
|
-
if (gt && !satisfies(eq, String(gt), options)) return null;
|
|
2173
|
-
if (lt && !satisfies(eq, String(lt), options)) return null;
|
|
2174
|
-
for (const c of dom) if (!satisfies(eq, String(c), options)) return false;
|
|
2175
|
-
return true;
|
|
2127
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
2128
|
+
higher = higherGT(gt$5, c, options);
|
|
2129
|
+
if (higher === c && higher !== gt$5) return false;
|
|
2130
|
+
} else if (gt$5.operator === ">=" && !satisfies$1(gt$5.semver, String(c), options)) return false;
|
|
2176
2131
|
}
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
2181
|
-
if (needDomLTPre && 1 === needDomLTPre.prerelease.length && "<" === lt.operator && 0 === needDomLTPre.prerelease[0]) needDomLTPre = false;
|
|
2182
|
-
for (const c of dom) {
|
|
2183
|
-
hasDomGT = hasDomGT || ">" === c.operator || ">=" === c.operator;
|
|
2184
|
-
hasDomLT = hasDomLT || "<" === c.operator || "<=" === c.operator;
|
|
2185
|
-
if (gt) {
|
|
2186
|
-
if (needDomGTPre) {
|
|
2187
|
-
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) needDomGTPre = false;
|
|
2188
|
-
}
|
|
2189
|
-
if (">" === c.operator || ">=" === c.operator) {
|
|
2190
|
-
higher = higherGT(gt, c, options);
|
|
2191
|
-
if (higher === c && higher !== gt) return false;
|
|
2192
|
-
} else if (">=" === gt.operator && !satisfies(gt.semver, String(c), options)) return false;
|
|
2193
|
-
}
|
|
2194
|
-
if (lt) {
|
|
2195
|
-
if (needDomLTPre) {
|
|
2196
|
-
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) needDomLTPre = false;
|
|
2197
|
-
}
|
|
2198
|
-
if ("<" === c.operator || "<=" === c.operator) {
|
|
2199
|
-
lower = lowerLT(lt, c, options);
|
|
2200
|
-
if (lower === c && lower !== lt) return false;
|
|
2201
|
-
} else if ("<=" === lt.operator && !satisfies(lt.semver, String(c), options)) return false;
|
|
2132
|
+
if (lt$4) {
|
|
2133
|
+
if (needDomLTPre) {
|
|
2134
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) needDomLTPre = false;
|
|
2202
2135
|
}
|
|
2203
|
-
if (
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
if (needDomGTPre || needDomLTPre) return false;
|
|
2208
|
-
return true;
|
|
2209
|
-
}, "simpleSubset");
|
|
2210
|
-
const higherGT = /* @__PURE__ */ __name((a, b, options) => {
|
|
2211
|
-
if (!a) return b;
|
|
2212
|
-
const comp = compare(a.semver, b.semver, options);
|
|
2213
|
-
return comp > 0 ? a : comp < 0 ? b : ">" === b.operator && ">=" === a.operator ? b : a;
|
|
2214
|
-
}, "higherGT");
|
|
2215
|
-
const lowerLT = /* @__PURE__ */ __name((a, b, options) => {
|
|
2216
|
-
if (!a) return b;
|
|
2217
|
-
const comp = compare(a.semver, b.semver, options);
|
|
2218
|
-
return comp < 0 ? a : comp > 0 ? b : "<" === b.operator && "<=" === a.operator ? b : a;
|
|
2219
|
-
}, "lowerLT");
|
|
2220
|
-
module.exports = subset;
|
|
2221
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/subset.js"),
|
|
2222
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/to-comparators.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
2223
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
2224
|
-
const toComparators = /* @__PURE__ */ __name((range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" ")), "toComparators");
|
|
2225
|
-
module.exports = toComparators;
|
|
2226
|
-
}, "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/to-comparators.js"),
|
|
2227
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/valid.js": /* @__PURE__ */ __name(function(module, __unused_webpack_exports, __webpack_require__2) {
|
|
2228
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
2229
|
-
const validRange = /* @__PURE__ */ __name((range, options) => {
|
|
2230
|
-
try {
|
|
2231
|
-
return new Range(range, options).range || "*";
|
|
2232
|
-
} catch (er) {
|
|
2233
|
-
return null;
|
|
2136
|
+
if (c.operator === "<" || c.operator === "<=") {
|
|
2137
|
+
lower = lowerLT(lt$4, c, options);
|
|
2138
|
+
if (lower === c && lower !== lt$4) return false;
|
|
2139
|
+
} else if (lt$4.operator === "<=" && !satisfies$1(lt$4.semver, String(c), options)) return false;
|
|
2234
2140
|
}
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
(
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2141
|
+
if (!c.operator && (lt$4 || gt$5) && gtltComp !== 0) return false;
|
|
2142
|
+
}
|
|
2143
|
+
if (gt$5 && hasDomLT && !lt$4 && gtltComp !== 0) return false;
|
|
2144
|
+
if (lt$4 && hasDomGT && !gt$5 && gtltComp !== 0) return false;
|
|
2145
|
+
if (needDomGTPre || needDomLTPre) return false;
|
|
2146
|
+
return true;
|
|
2147
|
+
}, "simpleSubset");
|
|
2148
|
+
const higherGT = /* @__PURE__ */ __name((a, b, options) => {
|
|
2149
|
+
if (!a) return b;
|
|
2150
|
+
const comp = compare$1(a.semver, b.semver, options);
|
|
2151
|
+
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
2152
|
+
}, "higherGT");
|
|
2153
|
+
const lowerLT = /* @__PURE__ */ __name((a, b, options) => {
|
|
2154
|
+
if (!a) return b;
|
|
2155
|
+
const comp = compare$1(a.semver, b.semver, options);
|
|
2156
|
+
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
2157
|
+
}, "lowerLT");
|
|
2158
|
+
module.exports = subset$1;
|
|
2159
|
+
} });
|
|
2160
|
+
var require_semver = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/index.js"(exports, module) {
|
|
2161
|
+
const internalRe = require_re();
|
|
2162
|
+
const constants = require_constants();
|
|
2163
|
+
const SemVer = require_semver$1();
|
|
2164
|
+
const identifiers = require_identifiers();
|
|
2165
|
+
const parse = require_parse();
|
|
2166
|
+
const valid = require_valid$1();
|
|
2167
|
+
const clean = require_clean();
|
|
2168
|
+
const inc = require_inc();
|
|
2169
|
+
const diff = require_diff();
|
|
2170
|
+
const major = require_major();
|
|
2171
|
+
const minor = require_minor();
|
|
2172
|
+
const patch = require_patch();
|
|
2173
|
+
const prerelease = require_prerelease();
|
|
2174
|
+
const compare = require_compare();
|
|
2175
|
+
const rcompare = require_rcompare();
|
|
2176
|
+
const compareLoose = require_compare_loose();
|
|
2177
|
+
const compareBuild = require_compare_build();
|
|
2178
|
+
const sort = require_sort();
|
|
2179
|
+
const rsort = require_rsort();
|
|
2180
|
+
const gt = require_gt();
|
|
2181
|
+
const lt = require_lt();
|
|
2182
|
+
const eq = require_eq();
|
|
2183
|
+
const neq = require_neq();
|
|
2184
|
+
const gte = require_gte();
|
|
2185
|
+
const lte = require_lte();
|
|
2186
|
+
const cmp = require_cmp();
|
|
2187
|
+
const coerce = require_coerce();
|
|
2188
|
+
const Comparator = require_comparator();
|
|
2189
|
+
const Range = require_range();
|
|
2190
|
+
const satisfies = require_satisfies();
|
|
2191
|
+
const toComparators = require_to_comparators();
|
|
2192
|
+
const maxSatisfying = require_max_satisfying();
|
|
2193
|
+
const minSatisfying = require_min_satisfying();
|
|
2194
|
+
const minVersion = require_min_version();
|
|
2195
|
+
const validRange = require_valid();
|
|
2196
|
+
const outside = require_outside();
|
|
2197
|
+
const gtr = require_gtr();
|
|
2198
|
+
const ltr = require_ltr();
|
|
2199
|
+
const intersects = require_intersects();
|
|
2200
|
+
const simplifyRange = require_simplify();
|
|
2201
|
+
const subset = require_subset();
|
|
2202
|
+
module.exports = {
|
|
2203
|
+
parse,
|
|
2204
|
+
valid,
|
|
2205
|
+
clean,
|
|
2206
|
+
inc,
|
|
2207
|
+
diff,
|
|
2208
|
+
major,
|
|
2209
|
+
minor,
|
|
2210
|
+
patch,
|
|
2211
|
+
prerelease,
|
|
2212
|
+
compare,
|
|
2213
|
+
rcompare,
|
|
2214
|
+
compareLoose,
|
|
2215
|
+
compareBuild,
|
|
2216
|
+
sort,
|
|
2217
|
+
rsort,
|
|
2218
|
+
gt,
|
|
2219
|
+
lt,
|
|
2220
|
+
eq,
|
|
2221
|
+
neq,
|
|
2222
|
+
gte,
|
|
2223
|
+
lte,
|
|
2224
|
+
cmp,
|
|
2225
|
+
coerce,
|
|
2226
|
+
Comparator,
|
|
2227
|
+
Range,
|
|
2228
|
+
satisfies,
|
|
2229
|
+
toComparators,
|
|
2230
|
+
maxSatisfying,
|
|
2231
|
+
minSatisfying,
|
|
2232
|
+
minVersion,
|
|
2233
|
+
validRange,
|
|
2234
|
+
outside,
|
|
2235
|
+
gtr,
|
|
2236
|
+
ltr,
|
|
2237
|
+
intersects,
|
|
2238
|
+
simplifyRange,
|
|
2239
|
+
subset,
|
|
2240
|
+
SemVer,
|
|
2241
|
+
re: internalRe.re,
|
|
2242
|
+
src: internalRe.src,
|
|
2243
|
+
tokens: internalRe.t,
|
|
2244
|
+
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
2245
|
+
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
2246
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
2247
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
2265
2248
|
};
|
|
2266
|
-
})
|
|
2267
|
-
(()
|
|
2268
|
-
__webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
2269
|
-
})();
|
|
2270
|
-
var semver = __webpack_require__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/index.js");
|
|
2271
|
-
var semver_default = /* @__PURE__ */ __webpack_require__.n(semver);
|
|
2249
|
+
} });
|
|
2250
|
+
var import_semver = __toESM(require_semver(), 1);
|
|
2272
2251
|
var semverSatisfies = /* @__PURE__ */ __name((targetAppVersion, currentVersion) => {
|
|
2273
|
-
const currentCoerce =
|
|
2252
|
+
const currentCoerce = import_semver.default.coerce(currentVersion);
|
|
2274
2253
|
if (!currentCoerce) return false;
|
|
2275
|
-
return
|
|
2254
|
+
return import_semver.default.satisfies(currentCoerce.version, targetAppVersion);
|
|
2276
2255
|
}, "semverSatisfies");
|
|
2277
2256
|
var filterCompatibleAppVersions = /* @__PURE__ */ __name((targetAppVersionList, currentVersion) => {
|
|
2278
2257
|
const compatibleAppVersionList = targetAppVersionList.filter((version2) => semverSatisfies(version2, currentVersion));
|
|
@@ -2280,6 +2259,7 @@ var filterCompatibleAppVersions = /* @__PURE__ */ __name((targetAppVersionList,
|
|
|
2280
2259
|
}, "filterCompatibleAppVersions");
|
|
2281
2260
|
var encoder = new TextEncoder();
|
|
2282
2261
|
var decoder = new TextDecoder();
|
|
2262
|
+
var MAX_INT32 = 2 ** 32;
|
|
2283
2263
|
function concat(...buffers) {
|
|
2284
2264
|
const size = buffers.reduce((acc, { length }) => acc + length, 0);
|
|
2285
2265
|
const buf = new Uint8Array(size);
|
|
@@ -2308,9 +2288,7 @@ function decodeBase64(encoded) {
|
|
|
2308
2288
|
}
|
|
2309
2289
|
__name(decodeBase64, "decodeBase64");
|
|
2310
2290
|
function decode(input) {
|
|
2311
|
-
if (Uint8Array.fromBase64) return Uint8Array.fromBase64("string"
|
|
2312
|
-
alphabet: "base64url"
|
|
2313
|
-
});
|
|
2291
|
+
if (Uint8Array.fromBase64) return Uint8Array.fromBase64(typeof input === "string" ? input : decoder.decode(input), { alphabet: "base64url" });
|
|
2314
2292
|
let encoded = input;
|
|
2315
2293
|
if (encoded instanceof Uint8Array) encoded = decoder.decode(encoded);
|
|
2316
2294
|
encoded = encoded.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
|
|
@@ -2323,7 +2301,7 @@ function decode(input) {
|
|
|
2323
2301
|
__name(decode, "decode");
|
|
2324
2302
|
function encode(input) {
|
|
2325
2303
|
let unencoded = input;
|
|
2326
|
-
if ("string"
|
|
2304
|
+
if (typeof unencoded === "string") unencoded = encoder.encode(unencoded);
|
|
2327
2305
|
if (Uint8Array.prototype.toBase64) return unencoded.toBase64({
|
|
2328
2306
|
alphabet: "base64url",
|
|
2329
2307
|
omitPadding: true
|
|
@@ -2337,8 +2315,8 @@ var JOSEError = class extends Error {
|
|
|
2337
2315
|
}
|
|
2338
2316
|
static code = "ERR_JOSE_GENERIC";
|
|
2339
2317
|
code = "ERR_JOSE_GENERIC";
|
|
2340
|
-
constructor(message, options) {
|
|
2341
|
-
super(message, options);
|
|
2318
|
+
constructor(message$1, options) {
|
|
2319
|
+
super(message$1, options);
|
|
2342
2320
|
this.name = this.constructor.name;
|
|
2343
2321
|
Error.captureStackTrace?.(this, this.constructor);
|
|
2344
2322
|
}
|
|
@@ -2352,14 +2330,12 @@ var JWTClaimValidationFailed = class extends JOSEError {
|
|
|
2352
2330
|
claim;
|
|
2353
2331
|
reason;
|
|
2354
2332
|
payload;
|
|
2355
|
-
constructor(message, payload, claim = "unspecified", reason = "unspecified") {
|
|
2356
|
-
super(message, {
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
}
|
|
2362
|
-
});
|
|
2333
|
+
constructor(message$1, payload, claim = "unspecified", reason = "unspecified") {
|
|
2334
|
+
super(message$1, { cause: {
|
|
2335
|
+
claim,
|
|
2336
|
+
reason,
|
|
2337
|
+
payload
|
|
2338
|
+
} });
|
|
2363
2339
|
this.claim = claim;
|
|
2364
2340
|
this.reason = reason;
|
|
2365
2341
|
this.payload = payload;
|
|
@@ -2374,14 +2350,12 @@ var JWTExpired = class extends JOSEError {
|
|
|
2374
2350
|
claim;
|
|
2375
2351
|
reason;
|
|
2376
2352
|
payload;
|
|
2377
|
-
constructor(message, payload, claim = "unspecified", reason = "unspecified") {
|
|
2378
|
-
super(message, {
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
}
|
|
2384
|
-
});
|
|
2353
|
+
constructor(message$1, payload, claim = "unspecified", reason = "unspecified") {
|
|
2354
|
+
super(message$1, { cause: {
|
|
2355
|
+
claim,
|
|
2356
|
+
reason,
|
|
2357
|
+
payload
|
|
2358
|
+
} });
|
|
2385
2359
|
this.claim = claim;
|
|
2386
2360
|
this.reason = reason;
|
|
2387
2361
|
this.payload = payload;
|
|
@@ -2421,71 +2395,23 @@ var JWSSignatureVerificationFailed = class extends JOSEError {
|
|
|
2421
2395
|
}
|
|
2422
2396
|
static code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
2423
2397
|
code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
2424
|
-
constructor(message = "signature verification failed", options) {
|
|
2425
|
-
super(message, options);
|
|
2398
|
+
constructor(message$1 = "signature verification failed", options) {
|
|
2399
|
+
super(message$1, options);
|
|
2426
2400
|
}
|
|
2427
2401
|
};
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
return {
|
|
2442
|
-
hash,
|
|
2443
|
-
name: "RSA-PSS",
|
|
2444
|
-
saltLength: parseInt(alg.slice(-3), 10) >> 3
|
|
2445
|
-
};
|
|
2446
|
-
case "RS256":
|
|
2447
|
-
case "RS384":
|
|
2448
|
-
case "RS512":
|
|
2449
|
-
return {
|
|
2450
|
-
hash,
|
|
2451
|
-
name: "RSASSA-PKCS1-v1_5"
|
|
2452
|
-
};
|
|
2453
|
-
case "ES256":
|
|
2454
|
-
case "ES384":
|
|
2455
|
-
case "ES512":
|
|
2456
|
-
return {
|
|
2457
|
-
hash,
|
|
2458
|
-
name: "ECDSA",
|
|
2459
|
-
namedCurve: algorithm.namedCurve
|
|
2460
|
-
};
|
|
2461
|
-
case "Ed25519":
|
|
2462
|
-
case "EdDSA":
|
|
2463
|
-
return {
|
|
2464
|
-
name: "Ed25519"
|
|
2465
|
-
};
|
|
2466
|
-
default:
|
|
2467
|
-
throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);
|
|
2468
|
-
}
|
|
2469
|
-
}, "subtle_dsa");
|
|
2470
|
-
var check_key_length = /* @__PURE__ */ __name((alg, key) => {
|
|
2471
|
-
if (alg.startsWith("RS") || alg.startsWith("PS")) {
|
|
2472
|
-
const { modulusLength } = key.algorithm;
|
|
2473
|
-
if ("number" != typeof modulusLength || modulusLength < 2048) throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`);
|
|
2474
|
-
}
|
|
2475
|
-
}, "check_key_length");
|
|
2476
|
-
function unusable(name, prop = "algorithm.name") {
|
|
2477
|
-
return new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`);
|
|
2478
|
-
}
|
|
2479
|
-
__name(unusable, "unusable");
|
|
2480
|
-
function isAlgorithm(algorithm, name) {
|
|
2481
|
-
return algorithm.name === name;
|
|
2482
|
-
}
|
|
2483
|
-
__name(isAlgorithm, "isAlgorithm");
|
|
2484
|
-
function getHashLength(hash) {
|
|
2485
|
-
return parseInt(hash.name.slice(4), 10);
|
|
2486
|
-
}
|
|
2487
|
-
__name(getHashLength, "getHashLength");
|
|
2488
|
-
function getNamedCurve(alg) {
|
|
2402
|
+
function unusable(name, prop = "algorithm.name") {
|
|
2403
|
+
return new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`);
|
|
2404
|
+
}
|
|
2405
|
+
__name(unusable, "unusable");
|
|
2406
|
+
function isAlgorithm(algorithm, name) {
|
|
2407
|
+
return algorithm.name === name;
|
|
2408
|
+
}
|
|
2409
|
+
__name(isAlgorithm, "isAlgorithm");
|
|
2410
|
+
function getHashLength(hash) {
|
|
2411
|
+
return parseInt(hash.name.slice(4), 10);
|
|
2412
|
+
}
|
|
2413
|
+
__name(getHashLength, "getHashLength");
|
|
2414
|
+
function getNamedCurve(alg) {
|
|
2489
2415
|
switch (alg) {
|
|
2490
2416
|
case "ES256":
|
|
2491
2417
|
return "P-256";
|
|
@@ -2532,9 +2458,10 @@ function checkSigCryptoKey(key, alg, usage) {
|
|
|
2532
2458
|
break;
|
|
2533
2459
|
}
|
|
2534
2460
|
case "Ed25519":
|
|
2535
|
-
case "EdDSA":
|
|
2461
|
+
case "EdDSA": {
|
|
2536
2462
|
if (!isAlgorithm(key.algorithm, "Ed25519")) throw unusable("Ed25519");
|
|
2537
2463
|
break;
|
|
2464
|
+
}
|
|
2538
2465
|
case "ES256":
|
|
2539
2466
|
case "ES384":
|
|
2540
2467
|
case "ES512": {
|
|
@@ -2550,52 +2477,46 @@ function checkSigCryptoKey(key, alg, usage) {
|
|
|
2550
2477
|
checkUsage(key, usage);
|
|
2551
2478
|
}
|
|
2552
2479
|
__name(checkSigCryptoKey, "checkSigCryptoKey");
|
|
2553
|
-
function
|
|
2480
|
+
function message(msg, actual, ...types) {
|
|
2554
2481
|
types = types.filter(Boolean);
|
|
2555
2482
|
if (types.length > 2) {
|
|
2556
2483
|
const last = types.pop();
|
|
2557
2484
|
msg += `one of type ${types.join(", ")}, or ${last}.`;
|
|
2558
|
-
} else if (
|
|
2485
|
+
} else if (types.length === 2) msg += `one of type ${types[0]} or ${types[1]}.`;
|
|
2559
2486
|
else msg += `of type ${types[0]}.`;
|
|
2560
|
-
if (
|
|
2561
|
-
else if ("function"
|
|
2562
|
-
else if ("object"
|
|
2487
|
+
if (actual == null) msg += ` Received ${actual}`;
|
|
2488
|
+
else if (typeof actual === "function" && actual.name) msg += ` Received function ${actual.name}`;
|
|
2489
|
+
else if (typeof actual === "object" && actual != null) {
|
|
2563
2490
|
if (actual.constructor?.name) msg += ` Received an instance of ${actual.constructor.name}`;
|
|
2564
2491
|
}
|
|
2565
2492
|
return msg;
|
|
2566
2493
|
}
|
|
2567
|
-
__name(
|
|
2568
|
-
var
|
|
2494
|
+
__name(message, "message");
|
|
2495
|
+
var invalid_key_input_default = /* @__PURE__ */ __name((actual, ...types) => {
|
|
2496
|
+
return message("Key must be ", actual, ...types);
|
|
2497
|
+
}, "invalid_key_input_default");
|
|
2569
2498
|
function withAlg(alg, actual, ...types) {
|
|
2570
|
-
return
|
|
2499
|
+
return message(`Key for the ${alg} algorithm must be `, actual, ...types);
|
|
2571
2500
|
}
|
|
2572
2501
|
__name(withAlg, "withAlg");
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
}, "get_sign_verify_key");
|
|
2586
|
-
var sign = /* @__PURE__ */ __name(async (alg, key, data) => {
|
|
2587
|
-
const cryptoKey = await get_sign_verify_key(alg, key, "sign");
|
|
2588
|
-
check_key_length(alg, cryptoKey);
|
|
2589
|
-
const signature = await crypto.subtle.sign(subtle_dsa(alg, cryptoKey.algorithm), cryptoKey, data);
|
|
2590
|
-
return new Uint8Array(signature);
|
|
2591
|
-
}, "sign");
|
|
2592
|
-
var is_disjoint = /* @__PURE__ */ __name((...headers) => {
|
|
2502
|
+
function isCryptoKey(key) {
|
|
2503
|
+
return key?.[Symbol.toStringTag] === "CryptoKey";
|
|
2504
|
+
}
|
|
2505
|
+
__name(isCryptoKey, "isCryptoKey");
|
|
2506
|
+
function isKeyObject(key) {
|
|
2507
|
+
return key?.[Symbol.toStringTag] === "KeyObject";
|
|
2508
|
+
}
|
|
2509
|
+
__name(isKeyObject, "isKeyObject");
|
|
2510
|
+
var is_key_like_default = /* @__PURE__ */ __name((key) => {
|
|
2511
|
+
return isCryptoKey(key) || isKeyObject(key);
|
|
2512
|
+
}, "is_key_like_default");
|
|
2513
|
+
var is_disjoint_default = /* @__PURE__ */ __name((...headers) => {
|
|
2593
2514
|
const sources = headers.filter(Boolean);
|
|
2594
|
-
if (
|
|
2515
|
+
if (sources.length === 0 || sources.length === 1) return true;
|
|
2595
2516
|
let acc;
|
|
2596
2517
|
for (const header of sources) {
|
|
2597
2518
|
const parameters = Object.keys(header);
|
|
2598
|
-
if (!acc ||
|
|
2519
|
+
if (!acc || acc.size === 0) {
|
|
2599
2520
|
acc = new Set(parameters);
|
|
2600
2521
|
continue;
|
|
2601
2522
|
}
|
|
@@ -2605,150 +2526,29 @@ var is_disjoint = /* @__PURE__ */ __name((...headers) => {
|
|
|
2605
2526
|
}
|
|
2606
2527
|
}
|
|
2607
2528
|
return true;
|
|
2608
|
-
}, "
|
|
2609
|
-
function isCryptoKey(key) {
|
|
2610
|
-
return key?.[Symbol.toStringTag] === "CryptoKey";
|
|
2611
|
-
}
|
|
2612
|
-
__name(isCryptoKey, "isCryptoKey");
|
|
2613
|
-
function isKeyObject(key) {
|
|
2614
|
-
return key?.[Symbol.toStringTag] === "KeyObject";
|
|
2615
|
-
}
|
|
2616
|
-
__name(isKeyObject, "isKeyObject");
|
|
2617
|
-
var is_key_like = /* @__PURE__ */ __name((key) => isCryptoKey(key) || isKeyObject(key), "is_key_like");
|
|
2529
|
+
}, "is_disjoint_default");
|
|
2618
2530
|
function isObjectLike(value) {
|
|
2619
|
-
return "object"
|
|
2531
|
+
return typeof value === "object" && value !== null;
|
|
2620
2532
|
}
|
|
2621
2533
|
__name(isObjectLike, "isObjectLike");
|
|
2622
|
-
var
|
|
2623
|
-
if (!isObjectLike(input) ||
|
|
2624
|
-
if (
|
|
2534
|
+
var is_object_default = /* @__PURE__ */ __name((input) => {
|
|
2535
|
+
if (!isObjectLike(input) || Object.prototype.toString.call(input) !== "[object Object]") return false;
|
|
2536
|
+
if (Object.getPrototypeOf(input) === null) return true;
|
|
2625
2537
|
let proto = input;
|
|
2626
|
-
while (
|
|
2538
|
+
while (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto);
|
|
2627
2539
|
return Object.getPrototypeOf(input) === proto;
|
|
2628
|
-
}, "
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
}
|
|
2632
|
-
|
|
2633
|
-
function isPrivateJWK(key) {
|
|
2634
|
-
return "oct" !== key.kty && "string" == typeof key.d;
|
|
2635
|
-
}
|
|
2636
|
-
__name(isPrivateJWK, "isPrivateJWK");
|
|
2637
|
-
function isPublicJWK(key) {
|
|
2638
|
-
return "oct" !== key.kty && void 0 === key.d;
|
|
2639
|
-
}
|
|
2640
|
-
__name(isPublicJWK, "isPublicJWK");
|
|
2641
|
-
function isSecretJWK(key) {
|
|
2642
|
-
return "oct" === key.kty && "string" == typeof key.k;
|
|
2643
|
-
}
|
|
2644
|
-
__name(isSecretJWK, "isSecretJWK");
|
|
2645
|
-
var tag = /* @__PURE__ */ __name((key) => key?.[Symbol.toStringTag], "tag");
|
|
2646
|
-
var jwkMatchesOp = /* @__PURE__ */ __name((alg, key, usage) => {
|
|
2647
|
-
if (void 0 !== key.use) {
|
|
2648
|
-
let expected;
|
|
2649
|
-
switch (usage) {
|
|
2650
|
-
case "sign":
|
|
2651
|
-
case "verify":
|
|
2652
|
-
expected = "sig";
|
|
2653
|
-
break;
|
|
2654
|
-
case "encrypt":
|
|
2655
|
-
case "decrypt":
|
|
2656
|
-
expected = "enc";
|
|
2657
|
-
break;
|
|
2658
|
-
}
|
|
2659
|
-
if (key.use !== expected) throw new TypeError(`Invalid key for this operation, its "use" must be "${expected}" when present`);
|
|
2660
|
-
}
|
|
2661
|
-
if (void 0 !== key.alg && key.alg !== alg) throw new TypeError(`Invalid key for this operation, its "alg" must be "${alg}" when present`);
|
|
2662
|
-
if (Array.isArray(key.key_ops)) {
|
|
2663
|
-
let expectedKeyOp;
|
|
2664
|
-
switch (true) {
|
|
2665
|
-
case ("sign" === usage || "verify" === usage):
|
|
2666
|
-
case "dir" === alg:
|
|
2667
|
-
case alg.includes("CBC-HS"):
|
|
2668
|
-
expectedKeyOp = usage;
|
|
2669
|
-
break;
|
|
2670
|
-
case alg.startsWith("PBES2"):
|
|
2671
|
-
expectedKeyOp = "deriveBits";
|
|
2672
|
-
break;
|
|
2673
|
-
case /^A\d{3}(?:GCM)?(?:KW)?$/.test(alg):
|
|
2674
|
-
expectedKeyOp = !alg.includes("GCM") && alg.endsWith("KW") ? "encrypt" === usage ? "wrapKey" : "unwrapKey" : usage;
|
|
2675
|
-
break;
|
|
2676
|
-
case ("encrypt" === usage && alg.startsWith("RSA")):
|
|
2677
|
-
expectedKeyOp = "wrapKey";
|
|
2678
|
-
break;
|
|
2679
|
-
case "decrypt" === usage:
|
|
2680
|
-
expectedKeyOp = alg.startsWith("RSA") ? "unwrapKey" : "deriveBits";
|
|
2681
|
-
break;
|
|
2682
|
-
}
|
|
2683
|
-
if (expectedKeyOp && key.key_ops?.includes?.(expectedKeyOp) === false) throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${expectedKeyOp}" when present`);
|
|
2684
|
-
}
|
|
2685
|
-
return true;
|
|
2686
|
-
}, "jwkMatchesOp");
|
|
2687
|
-
var symmetricTypeCheck = /* @__PURE__ */ __name((alg, key, usage) => {
|
|
2688
|
-
if (key instanceof Uint8Array) return;
|
|
2689
|
-
if (isJWK(key)) {
|
|
2690
|
-
if (isSecretJWK(key) && jwkMatchesOp(alg, key, usage)) return;
|
|
2691
|
-
throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present');
|
|
2692
|
-
}
|
|
2693
|
-
if (!is_key_like(key)) throw new TypeError(withAlg(alg, key, "CryptoKey", "KeyObject", "JSON Web Key", "Uint8Array"));
|
|
2694
|
-
if ("secret" !== key.type) throw new TypeError(`${tag(key)} instances for symmetric algorithms must be of type "secret"`);
|
|
2695
|
-
}, "symmetricTypeCheck");
|
|
2696
|
-
var asymmetricTypeCheck = /* @__PURE__ */ __name((alg, key, usage) => {
|
|
2697
|
-
if (isJWK(key)) switch (usage) {
|
|
2698
|
-
case "decrypt":
|
|
2699
|
-
case "sign":
|
|
2700
|
-
if (isPrivateJWK(key) && jwkMatchesOp(alg, key, usage)) return;
|
|
2701
|
-
throw new TypeError("JSON Web Key for this operation be a private JWK");
|
|
2702
|
-
case "encrypt":
|
|
2703
|
-
case "verify":
|
|
2704
|
-
if (isPublicJWK(key) && jwkMatchesOp(alg, key, usage)) return;
|
|
2705
|
-
throw new TypeError("JSON Web Key for this operation be a public JWK");
|
|
2706
|
-
}
|
|
2707
|
-
if (!is_key_like(key)) throw new TypeError(withAlg(alg, key, "CryptoKey", "KeyObject", "JSON Web Key"));
|
|
2708
|
-
if ("secret" === key.type) throw new TypeError(`${tag(key)} instances for asymmetric algorithms must not be of type "secret"`);
|
|
2709
|
-
if ("public" === key.type) switch (usage) {
|
|
2710
|
-
case "sign":
|
|
2711
|
-
throw new TypeError(`${tag(key)} instances for asymmetric algorithm signing must be of type "private"`);
|
|
2712
|
-
case "decrypt":
|
|
2713
|
-
throw new TypeError(`${tag(key)} instances for asymmetric algorithm decryption must be of type "private"`);
|
|
2714
|
-
default:
|
|
2715
|
-
break;
|
|
2716
|
-
}
|
|
2717
|
-
if ("private" === key.type) switch (usage) {
|
|
2718
|
-
case "verify":
|
|
2719
|
-
throw new TypeError(`${tag(key)} instances for asymmetric algorithm verifying must be of type "public"`);
|
|
2720
|
-
case "encrypt":
|
|
2721
|
-
throw new TypeError(`${tag(key)} instances for asymmetric algorithm encryption must be of type "public"`);
|
|
2722
|
-
default:
|
|
2723
|
-
break;
|
|
2724
|
-
}
|
|
2725
|
-
}, "asymmetricTypeCheck");
|
|
2726
|
-
var check_key_type = /* @__PURE__ */ __name((alg, key, usage) => {
|
|
2727
|
-
const symmetric = alg.startsWith("HS") || "dir" === alg || alg.startsWith("PBES2") || /^A(?:128|192|256)(?:GCM)?(?:KW)?$/.test(alg) || /^A(?:128|192|256)CBC-HS(?:256|384|512)$/.test(alg);
|
|
2728
|
-
if (symmetric) symmetricTypeCheck(alg, key, usage);
|
|
2729
|
-
else asymmetricTypeCheck(alg, key, usage);
|
|
2730
|
-
}, "check_key_type");
|
|
2731
|
-
var validate_crit = /* @__PURE__ */ __name((Err, recognizedDefault, recognizedOption, protectedHeader, joseHeader) => {
|
|
2732
|
-
if (void 0 !== joseHeader.crit && protectedHeader?.crit === void 0) throw new Err('"crit" (Critical) Header Parameter MUST be integrity protected');
|
|
2733
|
-
if (!protectedHeader || void 0 === protectedHeader.crit) return /* @__PURE__ */ new Set();
|
|
2734
|
-
if (!Array.isArray(protectedHeader.crit) || 0 === protectedHeader.crit.length || protectedHeader.crit.some((input) => "string" != typeof input || 0 === input.length)) throw new Err('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');
|
|
2735
|
-
let recognized;
|
|
2736
|
-
recognized = void 0 !== recognizedOption ? new Map([
|
|
2737
|
-
...Object.entries(recognizedOption),
|
|
2738
|
-
...recognizedDefault.entries()
|
|
2739
|
-
]) : recognizedDefault;
|
|
2740
|
-
for (const parameter of protectedHeader.crit) {
|
|
2741
|
-
if (!recognized.has(parameter)) throw new JOSENotSupported(`Extension Header Parameter "${parameter}" is not recognized`);
|
|
2742
|
-
if (void 0 === joseHeader[parameter]) throw new Err(`Extension Header Parameter "${parameter}" is missing`);
|
|
2743
|
-
if (recognized.get(parameter) && void 0 === protectedHeader[parameter]) throw new Err(`Extension Header Parameter "${parameter}" MUST be integrity protected`);
|
|
2540
|
+
}, "is_object_default");
|
|
2541
|
+
var check_key_length_default = /* @__PURE__ */ __name((alg, key) => {
|
|
2542
|
+
if (alg.startsWith("RS") || alg.startsWith("PS")) {
|
|
2543
|
+
const { modulusLength } = key.algorithm;
|
|
2544
|
+
if (typeof modulusLength !== "number" || modulusLength < 2048) throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`);
|
|
2744
2545
|
}
|
|
2745
|
-
|
|
2746
|
-
}, "validate_crit");
|
|
2546
|
+
}, "check_key_length_default");
|
|
2747
2547
|
function subtleMapping(jwk) {
|
|
2748
2548
|
let algorithm;
|
|
2749
2549
|
let keyUsages;
|
|
2750
2550
|
switch (jwk.kty) {
|
|
2751
|
-
case "RSA":
|
|
2551
|
+
case "RSA": {
|
|
2752
2552
|
switch (jwk.alg) {
|
|
2753
2553
|
case "PS256":
|
|
2754
2554
|
case "PS384":
|
|
@@ -2757,11 +2557,7 @@ function subtleMapping(jwk) {
|
|
|
2757
2557
|
name: "RSA-PSS",
|
|
2758
2558
|
hash: `SHA-${jwk.alg.slice(-3)}`
|
|
2759
2559
|
};
|
|
2760
|
-
keyUsages = jwk.d ? [
|
|
2761
|
-
"sign"
|
|
2762
|
-
] : [
|
|
2763
|
-
"verify"
|
|
2764
|
-
];
|
|
2560
|
+
keyUsages = jwk.d ? ["sign"] : ["verify"];
|
|
2765
2561
|
break;
|
|
2766
2562
|
case "RS256":
|
|
2767
2563
|
case "RS384":
|
|
@@ -2770,11 +2566,7 @@ function subtleMapping(jwk) {
|
|
|
2770
2566
|
name: "RSASSA-PKCS1-v1_5",
|
|
2771
2567
|
hash: `SHA-${jwk.alg.slice(-3)}`
|
|
2772
2568
|
};
|
|
2773
|
-
keyUsages = jwk.d ? [
|
|
2774
|
-
"sign"
|
|
2775
|
-
] : [
|
|
2776
|
-
"verify"
|
|
2777
|
-
];
|
|
2569
|
+
keyUsages = jwk.d ? ["sign"] : ["verify"];
|
|
2778
2570
|
break;
|
|
2779
2571
|
case "RSA-OAEP":
|
|
2780
2572
|
case "RSA-OAEP-256":
|
|
@@ -2784,52 +2576,35 @@ function subtleMapping(jwk) {
|
|
|
2784
2576
|
name: "RSA-OAEP",
|
|
2785
2577
|
hash: `SHA-${parseInt(jwk.alg.slice(-3), 10) || 1}`
|
|
2786
2578
|
};
|
|
2787
|
-
keyUsages = jwk.d ? [
|
|
2788
|
-
"decrypt",
|
|
2789
|
-
"unwrapKey"
|
|
2790
|
-
] : [
|
|
2791
|
-
"encrypt",
|
|
2792
|
-
"wrapKey"
|
|
2793
|
-
];
|
|
2579
|
+
keyUsages = jwk.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
|
|
2794
2580
|
break;
|
|
2795
2581
|
default:
|
|
2796
2582
|
throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
2797
2583
|
}
|
|
2798
2584
|
break;
|
|
2799
|
-
|
|
2585
|
+
}
|
|
2586
|
+
case "EC": {
|
|
2800
2587
|
switch (jwk.alg) {
|
|
2801
2588
|
case "ES256":
|
|
2802
2589
|
algorithm = {
|
|
2803
2590
|
name: "ECDSA",
|
|
2804
2591
|
namedCurve: "P-256"
|
|
2805
2592
|
};
|
|
2806
|
-
keyUsages = jwk.d ? [
|
|
2807
|
-
"sign"
|
|
2808
|
-
] : [
|
|
2809
|
-
"verify"
|
|
2810
|
-
];
|
|
2593
|
+
keyUsages = jwk.d ? ["sign"] : ["verify"];
|
|
2811
2594
|
break;
|
|
2812
2595
|
case "ES384":
|
|
2813
2596
|
algorithm = {
|
|
2814
2597
|
name: "ECDSA",
|
|
2815
2598
|
namedCurve: "P-384"
|
|
2816
2599
|
};
|
|
2817
|
-
keyUsages = jwk.d ? [
|
|
2818
|
-
"sign"
|
|
2819
|
-
] : [
|
|
2820
|
-
"verify"
|
|
2821
|
-
];
|
|
2600
|
+
keyUsages = jwk.d ? ["sign"] : ["verify"];
|
|
2822
2601
|
break;
|
|
2823
2602
|
case "ES512":
|
|
2824
2603
|
algorithm = {
|
|
2825
2604
|
name: "ECDSA",
|
|
2826
2605
|
namedCurve: "P-521"
|
|
2827
2606
|
};
|
|
2828
|
-
keyUsages = jwk.d ? [
|
|
2829
|
-
"sign"
|
|
2830
|
-
] : [
|
|
2831
|
-
"verify"
|
|
2832
|
-
];
|
|
2607
|
+
keyUsages = jwk.d ? ["sign"] : ["verify"];
|
|
2833
2608
|
break;
|
|
2834
2609
|
case "ECDH-ES":
|
|
2835
2610
|
case "ECDH-ES+A128KW":
|
|
@@ -2839,42 +2614,32 @@ function subtleMapping(jwk) {
|
|
|
2839
2614
|
name: "ECDH",
|
|
2840
2615
|
namedCurve: jwk.crv
|
|
2841
2616
|
};
|
|
2842
|
-
keyUsages = jwk.d ? [
|
|
2843
|
-
"deriveBits"
|
|
2844
|
-
] : [];
|
|
2617
|
+
keyUsages = jwk.d ? ["deriveBits"] : [];
|
|
2845
2618
|
break;
|
|
2846
2619
|
default:
|
|
2847
2620
|
throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
2848
2621
|
}
|
|
2849
2622
|
break;
|
|
2850
|
-
|
|
2623
|
+
}
|
|
2624
|
+
case "OKP": {
|
|
2851
2625
|
switch (jwk.alg) {
|
|
2852
2626
|
case "Ed25519":
|
|
2853
2627
|
case "EdDSA":
|
|
2854
|
-
algorithm = {
|
|
2855
|
-
|
|
2856
|
-
};
|
|
2857
|
-
keyUsages = jwk.d ? [
|
|
2858
|
-
"sign"
|
|
2859
|
-
] : [
|
|
2860
|
-
"verify"
|
|
2861
|
-
];
|
|
2628
|
+
algorithm = { name: "Ed25519" };
|
|
2629
|
+
keyUsages = jwk.d ? ["sign"] : ["verify"];
|
|
2862
2630
|
break;
|
|
2863
2631
|
case "ECDH-ES":
|
|
2864
2632
|
case "ECDH-ES+A128KW":
|
|
2865
2633
|
case "ECDH-ES+A192KW":
|
|
2866
2634
|
case "ECDH-ES+A256KW":
|
|
2867
|
-
algorithm = {
|
|
2868
|
-
|
|
2869
|
-
};
|
|
2870
|
-
keyUsages = jwk.d ? [
|
|
2871
|
-
"deriveBits"
|
|
2872
|
-
] : [];
|
|
2635
|
+
algorithm = { name: jwk.crv };
|
|
2636
|
+
keyUsages = jwk.d ? ["deriveBits"] : [];
|
|
2873
2637
|
break;
|
|
2874
2638
|
default:
|
|
2875
2639
|
throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
2876
2640
|
}
|
|
2877
2641
|
break;
|
|
2642
|
+
}
|
|
2878
2643
|
default:
|
|
2879
2644
|
throw new JOSENotSupported('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
|
|
2880
2645
|
}
|
|
@@ -2884,40 +2649,71 @@ function subtleMapping(jwk) {
|
|
|
2884
2649
|
};
|
|
2885
2650
|
}
|
|
2886
2651
|
__name(subtleMapping, "subtleMapping");
|
|
2887
|
-
var
|
|
2652
|
+
var jwk_to_key_default = /* @__PURE__ */ __name(async (jwk) => {
|
|
2888
2653
|
if (!jwk.alg) throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
|
|
2889
2654
|
const { algorithm, keyUsages } = subtleMapping(jwk);
|
|
2890
|
-
const keyData = {
|
|
2891
|
-
...jwk
|
|
2892
|
-
};
|
|
2655
|
+
const keyData = { ...jwk };
|
|
2893
2656
|
delete keyData.alg;
|
|
2894
2657
|
delete keyData.use;
|
|
2895
|
-
return crypto.subtle.importKey("jwk", keyData, algorithm, jwk.ext ??
|
|
2896
|
-
}, "
|
|
2658
|
+
return crypto.subtle.importKey("jwk", keyData, algorithm, jwk.ext ?? (jwk.d ? false : true), jwk.key_ops ?? keyUsages);
|
|
2659
|
+
}, "jwk_to_key_default");
|
|
2660
|
+
var validate_crit_default = /* @__PURE__ */ __name((Err, recognizedDefault, recognizedOption, protectedHeader, joseHeader) => {
|
|
2661
|
+
if (joseHeader.crit !== void 0 && protectedHeader?.crit === void 0) throw new Err('"crit" (Critical) Header Parameter MUST be integrity protected');
|
|
2662
|
+
if (!protectedHeader || protectedHeader.crit === void 0) return /* @__PURE__ */ new Set();
|
|
2663
|
+
if (!Array.isArray(protectedHeader.crit) || protectedHeader.crit.length === 0 || protectedHeader.crit.some((input) => typeof input !== "string" || input.length === 0)) throw new Err('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');
|
|
2664
|
+
let recognized;
|
|
2665
|
+
if (recognizedOption !== void 0) recognized = new Map([...Object.entries(recognizedOption), ...recognizedDefault.entries()]);
|
|
2666
|
+
else recognized = recognizedDefault;
|
|
2667
|
+
for (const parameter of protectedHeader.crit) {
|
|
2668
|
+
if (!recognized.has(parameter)) throw new JOSENotSupported(`Extension Header Parameter "${parameter}" is not recognized`);
|
|
2669
|
+
if (joseHeader[parameter] === void 0) throw new Err(`Extension Header Parameter "${parameter}" is missing`);
|
|
2670
|
+
if (recognized.get(parameter) && protectedHeader[parameter] === void 0) throw new Err(`Extension Header Parameter "${parameter}" MUST be integrity protected`);
|
|
2671
|
+
}
|
|
2672
|
+
return new Set(protectedHeader.crit);
|
|
2673
|
+
}, "validate_crit_default");
|
|
2674
|
+
var validate_algorithms_default = /* @__PURE__ */ __name((option, algorithms) => {
|
|
2675
|
+
if (algorithms !== void 0 && (!Array.isArray(algorithms) || algorithms.some((s) => typeof s !== "string"))) throw new TypeError(`"${option}" option must be an array of strings`);
|
|
2676
|
+
if (!algorithms) return void 0;
|
|
2677
|
+
return new Set(algorithms);
|
|
2678
|
+
}, "validate_algorithms_default");
|
|
2679
|
+
function isJWK(key) {
|
|
2680
|
+
return is_object_default(key) && typeof key.kty === "string";
|
|
2681
|
+
}
|
|
2682
|
+
__name(isJWK, "isJWK");
|
|
2683
|
+
function isPrivateJWK(key) {
|
|
2684
|
+
return key.kty !== "oct" && typeof key.d === "string";
|
|
2685
|
+
}
|
|
2686
|
+
__name(isPrivateJWK, "isPrivateJWK");
|
|
2687
|
+
function isPublicJWK(key) {
|
|
2688
|
+
return key.kty !== "oct" && typeof key.d === "undefined";
|
|
2689
|
+
}
|
|
2690
|
+
__name(isPublicJWK, "isPublicJWK");
|
|
2691
|
+
function isSecretJWK(key) {
|
|
2692
|
+
return key.kty === "oct" && typeof key.k === "string";
|
|
2693
|
+
}
|
|
2694
|
+
__name(isSecretJWK, "isSecretJWK");
|
|
2897
2695
|
var cache;
|
|
2898
2696
|
var handleJWK = /* @__PURE__ */ __name(async (key, jwk, alg, freeze = false) => {
|
|
2899
2697
|
cache ||= /* @__PURE__ */ new WeakMap();
|
|
2900
2698
|
let cached = cache.get(key);
|
|
2901
2699
|
if (cached?.[alg]) return cached[alg];
|
|
2902
|
-
const cryptoKey = await
|
|
2700
|
+
const cryptoKey = await jwk_to_key_default({
|
|
2903
2701
|
...jwk,
|
|
2904
2702
|
alg
|
|
2905
2703
|
});
|
|
2906
2704
|
if (freeze) Object.freeze(key);
|
|
2907
|
-
if (cached)
|
|
2908
|
-
else
|
|
2909
|
-
[alg]: cryptoKey
|
|
2910
|
-
});
|
|
2705
|
+
if (!cached) cache.set(key, { [alg]: cryptoKey });
|
|
2706
|
+
else cached[alg] = cryptoKey;
|
|
2911
2707
|
return cryptoKey;
|
|
2912
2708
|
}, "handleJWK");
|
|
2913
2709
|
var handleKeyObject = /* @__PURE__ */ __name((keyObject, alg) => {
|
|
2914
2710
|
cache ||= /* @__PURE__ */ new WeakMap();
|
|
2915
2711
|
let cached = cache.get(keyObject);
|
|
2916
2712
|
if (cached?.[alg]) return cached[alg];
|
|
2917
|
-
const isPublic = "public"
|
|
2918
|
-
const extractable =
|
|
2713
|
+
const isPublic = keyObject.type === "public";
|
|
2714
|
+
const extractable = isPublic ? true : false;
|
|
2919
2715
|
let cryptoKey;
|
|
2920
|
-
if ("x25519"
|
|
2716
|
+
if (keyObject.asymmetricKeyType === "x25519") {
|
|
2921
2717
|
switch (alg) {
|
|
2922
2718
|
case "ECDH-ES":
|
|
2923
2719
|
case "ECDH-ES+A128KW":
|
|
@@ -2927,17 +2723,13 @@ var handleKeyObject = /* @__PURE__ */ __name((keyObject, alg) => {
|
|
|
2927
2723
|
default:
|
|
2928
2724
|
throw new TypeError("given KeyObject instance cannot be used for this algorithm");
|
|
2929
2725
|
}
|
|
2930
|
-
cryptoKey = keyObject.toCryptoKey(keyObject.asymmetricKeyType, extractable, isPublic ? [] : [
|
|
2931
|
-
"deriveBits"
|
|
2932
|
-
]);
|
|
2726
|
+
cryptoKey = keyObject.toCryptoKey(keyObject.asymmetricKeyType, extractable, isPublic ? [] : ["deriveBits"]);
|
|
2933
2727
|
}
|
|
2934
|
-
if ("ed25519"
|
|
2935
|
-
if ("EdDSA"
|
|
2936
|
-
cryptoKey = keyObject.toCryptoKey(keyObject.asymmetricKeyType, extractable, [
|
|
2937
|
-
isPublic ? "verify" : "sign"
|
|
2938
|
-
]);
|
|
2728
|
+
if (keyObject.asymmetricKeyType === "ed25519") {
|
|
2729
|
+
if (alg !== "EdDSA" && alg !== "Ed25519") throw new TypeError("given KeyObject instance cannot be used for this algorithm");
|
|
2730
|
+
cryptoKey = keyObject.toCryptoKey(keyObject.asymmetricKeyType, extractable, [isPublic ? "verify" : "sign"]);
|
|
2939
2731
|
}
|
|
2940
|
-
if ("rsa"
|
|
2732
|
+
if (keyObject.asymmetricKeyType === "rsa") {
|
|
2941
2733
|
let hash;
|
|
2942
2734
|
switch (alg) {
|
|
2943
2735
|
case "RSA-OAEP":
|
|
@@ -2964,80 +2756,53 @@ var handleKeyObject = /* @__PURE__ */ __name((keyObject, alg) => {
|
|
|
2964
2756
|
if (alg.startsWith("RSA-OAEP")) return keyObject.toCryptoKey({
|
|
2965
2757
|
name: "RSA-OAEP",
|
|
2966
2758
|
hash
|
|
2967
|
-
}, extractable, isPublic ? [
|
|
2968
|
-
"encrypt"
|
|
2969
|
-
] : [
|
|
2970
|
-
"decrypt"
|
|
2971
|
-
]);
|
|
2759
|
+
}, extractable, isPublic ? ["encrypt"] : ["decrypt"]);
|
|
2972
2760
|
cryptoKey = keyObject.toCryptoKey({
|
|
2973
2761
|
name: alg.startsWith("PS") ? "RSA-PSS" : "RSASSA-PKCS1-v1_5",
|
|
2974
2762
|
hash
|
|
2975
|
-
}, extractable, [
|
|
2976
|
-
isPublic ? "verify" : "sign"
|
|
2977
|
-
]);
|
|
2763
|
+
}, extractable, [isPublic ? "verify" : "sign"]);
|
|
2978
2764
|
}
|
|
2979
|
-
if ("ec"
|
|
2765
|
+
if (keyObject.asymmetricKeyType === "ec") {
|
|
2980
2766
|
const nist = /* @__PURE__ */ new Map([
|
|
2981
|
-
[
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
],
|
|
2985
|
-
[
|
|
2986
|
-
"secp384r1",
|
|
2987
|
-
"P-384"
|
|
2988
|
-
],
|
|
2989
|
-
[
|
|
2990
|
-
"secp521r1",
|
|
2991
|
-
"P-521"
|
|
2992
|
-
]
|
|
2767
|
+
["prime256v1", "P-256"],
|
|
2768
|
+
["secp384r1", "P-384"],
|
|
2769
|
+
["secp521r1", "P-521"]
|
|
2993
2770
|
]);
|
|
2994
2771
|
const namedCurve = nist.get(keyObject.asymmetricKeyDetails?.namedCurve);
|
|
2995
2772
|
if (!namedCurve) throw new TypeError("given KeyObject instance cannot be used for this algorithm");
|
|
2996
|
-
if ("ES256"
|
|
2773
|
+
if (alg === "ES256" && namedCurve === "P-256") cryptoKey = keyObject.toCryptoKey({
|
|
2997
2774
|
name: "ECDSA",
|
|
2998
2775
|
namedCurve
|
|
2999
|
-
}, extractable, [
|
|
3000
|
-
|
|
3001
|
-
]);
|
|
3002
|
-
if ("ES384" === alg && "P-384" === namedCurve) cryptoKey = keyObject.toCryptoKey({
|
|
2776
|
+
}, extractable, [isPublic ? "verify" : "sign"]);
|
|
2777
|
+
if (alg === "ES384" && namedCurve === "P-384") cryptoKey = keyObject.toCryptoKey({
|
|
3003
2778
|
name: "ECDSA",
|
|
3004
2779
|
namedCurve
|
|
3005
|
-
}, extractable, [
|
|
3006
|
-
|
|
3007
|
-
]);
|
|
3008
|
-
if ("ES512" === alg && "P-521" === namedCurve) cryptoKey = keyObject.toCryptoKey({
|
|
2780
|
+
}, extractable, [isPublic ? "verify" : "sign"]);
|
|
2781
|
+
if (alg === "ES512" && namedCurve === "P-521") cryptoKey = keyObject.toCryptoKey({
|
|
3009
2782
|
name: "ECDSA",
|
|
3010
2783
|
namedCurve
|
|
3011
|
-
}, extractable, [
|
|
3012
|
-
isPublic ? "verify" : "sign"
|
|
3013
|
-
]);
|
|
2784
|
+
}, extractable, [isPublic ? "verify" : "sign"]);
|
|
3014
2785
|
if (alg.startsWith("ECDH-ES")) cryptoKey = keyObject.toCryptoKey({
|
|
3015
2786
|
name: "ECDH",
|
|
3016
2787
|
namedCurve
|
|
3017
|
-
}, extractable, isPublic ? [] : [
|
|
3018
|
-
"deriveBits"
|
|
3019
|
-
]);
|
|
2788
|
+
}, extractable, isPublic ? [] : ["deriveBits"]);
|
|
3020
2789
|
}
|
|
3021
2790
|
if (!cryptoKey) throw new TypeError("given KeyObject instance cannot be used for this algorithm");
|
|
3022
|
-
if (cached)
|
|
3023
|
-
else
|
|
3024
|
-
[alg]: cryptoKey
|
|
3025
|
-
});
|
|
2791
|
+
if (!cached) cache.set(keyObject, { [alg]: cryptoKey });
|
|
2792
|
+
else cached[alg] = cryptoKey;
|
|
3026
2793
|
return cryptoKey;
|
|
3027
2794
|
}, "handleKeyObject");
|
|
3028
|
-
var
|
|
2795
|
+
var normalize_key_default = /* @__PURE__ */ __name(async (key, alg) => {
|
|
3029
2796
|
if (key instanceof Uint8Array) return key;
|
|
3030
2797
|
if (isCryptoKey(key)) return key;
|
|
3031
2798
|
if (isKeyObject(key)) {
|
|
3032
|
-
if ("secret"
|
|
3033
|
-
if ("toCryptoKey" in key &&
|
|
2799
|
+
if (key.type === "secret") return key.export();
|
|
2800
|
+
if ("toCryptoKey" in key && typeof key.toCryptoKey === "function") try {
|
|
3034
2801
|
return handleKeyObject(key, alg);
|
|
3035
2802
|
} catch (err) {
|
|
3036
2803
|
if (err instanceof TypeError) throw err;
|
|
3037
2804
|
}
|
|
3038
|
-
let jwk = key.export({
|
|
3039
|
-
format: "jwk"
|
|
3040
|
-
});
|
|
2805
|
+
let jwk = key.export({ format: "jwk" });
|
|
3041
2806
|
return handleJWK(key, jwk, alg);
|
|
3042
2807
|
}
|
|
3043
2808
|
if (isJWK(key)) {
|
|
@@ -3045,92 +2810,250 @@ var normalize_key = /* @__PURE__ */ __name(async (key, alg) => {
|
|
|
3045
2810
|
return handleJWK(key, key, alg, true);
|
|
3046
2811
|
}
|
|
3047
2812
|
throw new Error("unreachable");
|
|
3048
|
-
}, "
|
|
3049
|
-
var
|
|
3050
|
-
|
|
3051
|
-
|
|
2813
|
+
}, "normalize_key_default");
|
|
2814
|
+
var tag = /* @__PURE__ */ __name((key) => key?.[Symbol.toStringTag], "tag");
|
|
2815
|
+
var jwkMatchesOp = /* @__PURE__ */ __name((alg, key, usage) => {
|
|
2816
|
+
if (key.use !== void 0) {
|
|
2817
|
+
let expected;
|
|
2818
|
+
switch (usage) {
|
|
2819
|
+
case "sign":
|
|
2820
|
+
case "verify":
|
|
2821
|
+
expected = "sig";
|
|
2822
|
+
break;
|
|
2823
|
+
case "encrypt":
|
|
2824
|
+
case "decrypt":
|
|
2825
|
+
expected = "enc";
|
|
2826
|
+
break;
|
|
2827
|
+
}
|
|
2828
|
+
if (key.use !== expected) throw new TypeError(`Invalid key for this operation, its "use" must be "${expected}" when present`);
|
|
3052
2829
|
}
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
2830
|
+
if (key.alg !== void 0 && key.alg !== alg) throw new TypeError(`Invalid key for this operation, its "alg" must be "${alg}" when present`);
|
|
2831
|
+
if (Array.isArray(key.key_ops)) {
|
|
2832
|
+
let expectedKeyOp;
|
|
2833
|
+
switch (true) {
|
|
2834
|
+
case (usage === "sign" || usage === "verify"):
|
|
2835
|
+
case alg === "dir":
|
|
2836
|
+
case alg.includes("CBC-HS"):
|
|
2837
|
+
expectedKeyOp = usage;
|
|
2838
|
+
break;
|
|
2839
|
+
case alg.startsWith("PBES2"):
|
|
2840
|
+
expectedKeyOp = "deriveBits";
|
|
2841
|
+
break;
|
|
2842
|
+
case /^A\d{3}(?:GCM)?(?:KW)?$/.test(alg):
|
|
2843
|
+
if (!alg.includes("GCM") && alg.endsWith("KW")) expectedKeyOp = usage === "encrypt" ? "wrapKey" : "unwrapKey";
|
|
2844
|
+
else expectedKeyOp = usage;
|
|
2845
|
+
break;
|
|
2846
|
+
case (usage === "encrypt" && alg.startsWith("RSA")):
|
|
2847
|
+
expectedKeyOp = "wrapKey";
|
|
2848
|
+
break;
|
|
2849
|
+
case usage === "decrypt":
|
|
2850
|
+
expectedKeyOp = alg.startsWith("RSA") ? "unwrapKey" : "deriveBits";
|
|
2851
|
+
break;
|
|
2852
|
+
}
|
|
2853
|
+
if (expectedKeyOp && key.key_ops?.includes?.(expectedKeyOp) === false) throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${expectedKeyOp}" when present`);
|
|
3059
2854
|
}
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
2855
|
+
return true;
|
|
2856
|
+
}, "jwkMatchesOp");
|
|
2857
|
+
var symmetricTypeCheck = /* @__PURE__ */ __name((alg, key, usage) => {
|
|
2858
|
+
if (key instanceof Uint8Array) return;
|
|
2859
|
+
if (isJWK(key)) {
|
|
2860
|
+
if (isSecretJWK(key) && jwkMatchesOp(alg, key, usage)) return;
|
|
2861
|
+
throw new TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`);
|
|
3064
2862
|
}
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
2863
|
+
if (!is_key_like_default(key)) throw new TypeError(withAlg(alg, key, "CryptoKey", "KeyObject", "JSON Web Key", "Uint8Array"));
|
|
2864
|
+
if (key.type !== "secret") throw new TypeError(`${tag(key)} instances for symmetric algorithms must be of type "secret"`);
|
|
2865
|
+
}, "symmetricTypeCheck");
|
|
2866
|
+
var asymmetricTypeCheck = /* @__PURE__ */ __name((alg, key, usage) => {
|
|
2867
|
+
if (isJWK(key)) switch (usage) {
|
|
2868
|
+
case "decrypt":
|
|
2869
|
+
case "sign":
|
|
2870
|
+
if (isPrivateJWK(key) && jwkMatchesOp(alg, key, usage)) return;
|
|
2871
|
+
throw new TypeError(`JSON Web Key for this operation be a private JWK`);
|
|
2872
|
+
case "encrypt":
|
|
2873
|
+
case "verify":
|
|
2874
|
+
if (isPublicJWK(key) && jwkMatchesOp(alg, key, usage)) return;
|
|
2875
|
+
throw new TypeError(`JSON Web Key for this operation be a public JWK`);
|
|
3069
2876
|
}
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
"b64",
|
|
3080
|
-
true
|
|
3081
|
-
]
|
|
3082
|
-
]), options?.crit, this.#protectedHeader, joseHeader);
|
|
3083
|
-
let b64 = true;
|
|
3084
|
-
if (extensions.has("b64")) {
|
|
3085
|
-
b64 = this.#protectedHeader.b64;
|
|
3086
|
-
if ("boolean" != typeof b64) throw new JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
|
|
3087
|
-
}
|
|
3088
|
-
const { alg } = joseHeader;
|
|
3089
|
-
if ("string" != typeof alg || !alg) throw new JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
3090
|
-
check_key_type(alg, key, "sign");
|
|
3091
|
-
let payload = this.#payload;
|
|
3092
|
-
if (b64) payload = encoder.encode(encode(payload));
|
|
3093
|
-
let protectedHeader;
|
|
3094
|
-
protectedHeader = this.#protectedHeader ? encoder.encode(encode(JSON.stringify(this.#protectedHeader))) : encoder.encode("");
|
|
3095
|
-
const data = concat(protectedHeader, encoder.encode("."), payload);
|
|
3096
|
-
const k = await normalize_key(key, alg);
|
|
3097
|
-
const signature = await sign(alg, k, data);
|
|
3098
|
-
const jws = {
|
|
3099
|
-
signature: encode(signature),
|
|
3100
|
-
payload: ""
|
|
3101
|
-
};
|
|
3102
|
-
if (b64) jws.payload = decoder.decode(payload);
|
|
3103
|
-
if (this.#unprotectedHeader) jws.header = this.#unprotectedHeader;
|
|
3104
|
-
if (this.#protectedHeader) jws.protected = decoder.decode(protectedHeader);
|
|
3105
|
-
return jws;
|
|
2877
|
+
if (!is_key_like_default(key)) throw new TypeError(withAlg(alg, key, "CryptoKey", "KeyObject", "JSON Web Key"));
|
|
2878
|
+
if (key.type === "secret") throw new TypeError(`${tag(key)} instances for asymmetric algorithms must not be of type "secret"`);
|
|
2879
|
+
if (key.type === "public") switch (usage) {
|
|
2880
|
+
case "sign":
|
|
2881
|
+
throw new TypeError(`${tag(key)} instances for asymmetric algorithm signing must be of type "private"`);
|
|
2882
|
+
case "decrypt":
|
|
2883
|
+
throw new TypeError(`${tag(key)} instances for asymmetric algorithm decryption must be of type "private"`);
|
|
2884
|
+
default:
|
|
2885
|
+
break;
|
|
3106
2886
|
}
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
2887
|
+
if (key.type === "private") switch (usage) {
|
|
2888
|
+
case "verify":
|
|
2889
|
+
throw new TypeError(`${tag(key)} instances for asymmetric algorithm verifying must be of type "public"`);
|
|
2890
|
+
case "encrypt":
|
|
2891
|
+
throw new TypeError(`${tag(key)} instances for asymmetric algorithm encryption must be of type "public"`);
|
|
2892
|
+
default:
|
|
2893
|
+
break;
|
|
3111
2894
|
}
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
2895
|
+
}, "asymmetricTypeCheck");
|
|
2896
|
+
var check_key_type_default = /* @__PURE__ */ __name((alg, key, usage) => {
|
|
2897
|
+
const symmetric = alg.startsWith("HS") || alg === "dir" || alg.startsWith("PBES2") || /^A(?:128|192|256)(?:GCM)?(?:KW)?$/.test(alg) || /^A(?:128|192|256)CBC-HS(?:256|384|512)$/.test(alg);
|
|
2898
|
+
if (symmetric) symmetricTypeCheck(alg, key, usage);
|
|
2899
|
+
else asymmetricTypeCheck(alg, key, usage);
|
|
2900
|
+
}, "check_key_type_default");
|
|
2901
|
+
var subtle_dsa_default = /* @__PURE__ */ __name((alg, algorithm) => {
|
|
2902
|
+
const hash = `SHA-${alg.slice(-3)}`;
|
|
2903
|
+
switch (alg) {
|
|
2904
|
+
case "HS256":
|
|
2905
|
+
case "HS384":
|
|
2906
|
+
case "HS512":
|
|
2907
|
+
return {
|
|
2908
|
+
hash,
|
|
2909
|
+
name: "HMAC"
|
|
2910
|
+
};
|
|
2911
|
+
case "PS256":
|
|
2912
|
+
case "PS384":
|
|
2913
|
+
case "PS512":
|
|
2914
|
+
return {
|
|
2915
|
+
hash,
|
|
2916
|
+
name: "RSA-PSS",
|
|
2917
|
+
saltLength: parseInt(alg.slice(-3), 10) >> 3
|
|
2918
|
+
};
|
|
2919
|
+
case "RS256":
|
|
2920
|
+
case "RS384":
|
|
2921
|
+
case "RS512":
|
|
2922
|
+
return {
|
|
2923
|
+
hash,
|
|
2924
|
+
name: "RSASSA-PKCS1-v1_5"
|
|
2925
|
+
};
|
|
2926
|
+
case "ES256":
|
|
2927
|
+
case "ES384":
|
|
2928
|
+
case "ES512":
|
|
2929
|
+
return {
|
|
2930
|
+
hash,
|
|
2931
|
+
name: "ECDSA",
|
|
2932
|
+
namedCurve: algorithm.namedCurve
|
|
2933
|
+
};
|
|
2934
|
+
case "Ed25519":
|
|
2935
|
+
case "EdDSA":
|
|
2936
|
+
return { name: "Ed25519" };
|
|
2937
|
+
default:
|
|
2938
|
+
throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);
|
|
3115
2939
|
}
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
2940
|
+
}, "subtle_dsa_default");
|
|
2941
|
+
var get_sign_verify_key_default = /* @__PURE__ */ __name(async (alg, key, usage) => {
|
|
2942
|
+
if (key instanceof Uint8Array) {
|
|
2943
|
+
if (!alg.startsWith("HS")) throw new TypeError(invalid_key_input_default(key, "CryptoKey", "KeyObject", "JSON Web Key"));
|
|
2944
|
+
return crypto.subtle.importKey("raw", key, {
|
|
2945
|
+
hash: `SHA-${alg.slice(-3)}`,
|
|
2946
|
+
name: "HMAC"
|
|
2947
|
+
}, false, [usage]);
|
|
3119
2948
|
}
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
2949
|
+
checkSigCryptoKey(key, alg, usage);
|
|
2950
|
+
return key;
|
|
2951
|
+
}, "get_sign_verify_key_default");
|
|
2952
|
+
var verify_default = /* @__PURE__ */ __name(async (alg, key, signature, data) => {
|
|
2953
|
+
const cryptoKey = await get_sign_verify_key_default(alg, key, "verify");
|
|
2954
|
+
check_key_length_default(alg, cryptoKey);
|
|
2955
|
+
const algorithm = subtle_dsa_default(alg, cryptoKey.algorithm);
|
|
2956
|
+
try {
|
|
2957
|
+
return await crypto.subtle.verify(algorithm, cryptoKey, signature, data);
|
|
2958
|
+
} catch {
|
|
2959
|
+
return false;
|
|
3124
2960
|
}
|
|
3125
|
-
};
|
|
3126
|
-
|
|
2961
|
+
}, "verify_default");
|
|
2962
|
+
async function flattenedVerify(jws, key, options) {
|
|
2963
|
+
if (!is_object_default(jws)) throw new JWSInvalid("Flattened JWS must be an object");
|
|
2964
|
+
if (jws.protected === void 0 && jws.header === void 0) throw new JWSInvalid('Flattened JWS must have either of the "protected" or "header" members');
|
|
2965
|
+
if (jws.protected !== void 0 && typeof jws.protected !== "string") throw new JWSInvalid("JWS Protected Header incorrect type");
|
|
2966
|
+
if (jws.payload === void 0) throw new JWSInvalid("JWS Payload missing");
|
|
2967
|
+
if (typeof jws.signature !== "string") throw new JWSInvalid("JWS Signature missing or incorrect type");
|
|
2968
|
+
if (jws.header !== void 0 && !is_object_default(jws.header)) throw new JWSInvalid("JWS Unprotected Header incorrect type");
|
|
2969
|
+
let parsedProt = {};
|
|
2970
|
+
if (jws.protected) try {
|
|
2971
|
+
const protectedHeader = decode(jws.protected);
|
|
2972
|
+
parsedProt = JSON.parse(decoder.decode(protectedHeader));
|
|
2973
|
+
} catch {
|
|
2974
|
+
throw new JWSInvalid("JWS Protected Header is invalid");
|
|
2975
|
+
}
|
|
2976
|
+
if (!is_disjoint_default(parsedProt, jws.header)) throw new JWSInvalid("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
|
|
2977
|
+
const joseHeader = {
|
|
2978
|
+
...parsedProt,
|
|
2979
|
+
...jws.header
|
|
2980
|
+
};
|
|
2981
|
+
const extensions = validate_crit_default(JWSInvalid, /* @__PURE__ */ new Map([["b64", true]]), options?.crit, parsedProt, joseHeader);
|
|
2982
|
+
let b64 = true;
|
|
2983
|
+
if (extensions.has("b64")) {
|
|
2984
|
+
b64 = parsedProt.b64;
|
|
2985
|
+
if (typeof b64 !== "boolean") throw new JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
|
|
2986
|
+
}
|
|
2987
|
+
const { alg } = joseHeader;
|
|
2988
|
+
if (typeof alg !== "string" || !alg) throw new JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
2989
|
+
const algorithms = options && validate_algorithms_default("algorithms", options.algorithms);
|
|
2990
|
+
if (algorithms && !algorithms.has(alg)) throw new JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter value not allowed');
|
|
2991
|
+
if (b64) {
|
|
2992
|
+
if (typeof jws.payload !== "string") throw new JWSInvalid("JWS Payload must be a string");
|
|
2993
|
+
} else if (typeof jws.payload !== "string" && !(jws.payload instanceof Uint8Array)) throw new JWSInvalid("JWS Payload must be a string or an Uint8Array instance");
|
|
2994
|
+
let resolvedKey = false;
|
|
2995
|
+
if (typeof key === "function") {
|
|
2996
|
+
key = await key(parsedProt, jws);
|
|
2997
|
+
resolvedKey = true;
|
|
2998
|
+
}
|
|
2999
|
+
check_key_type_default(alg, key, "verify");
|
|
3000
|
+
const data = concat(encoder.encode(jws.protected ?? ""), encoder.encode("."), typeof jws.payload === "string" ? encoder.encode(jws.payload) : jws.payload);
|
|
3001
|
+
let signature;
|
|
3002
|
+
try {
|
|
3003
|
+
signature = decode(jws.signature);
|
|
3004
|
+
} catch {
|
|
3005
|
+
throw new JWSInvalid("Failed to base64url decode the signature");
|
|
3006
|
+
}
|
|
3007
|
+
const k = await normalize_key_default(key, alg);
|
|
3008
|
+
const verified = await verify_default(alg, k, signature, data);
|
|
3009
|
+
if (!verified) throw new JWSSignatureVerificationFailed();
|
|
3010
|
+
let payload;
|
|
3011
|
+
if (b64) try {
|
|
3012
|
+
payload = decode(jws.payload);
|
|
3013
|
+
} catch {
|
|
3014
|
+
throw new JWSInvalid("Failed to base64url decode the payload");
|
|
3015
|
+
}
|
|
3016
|
+
else if (typeof jws.payload === "string") payload = encoder.encode(jws.payload);
|
|
3017
|
+
else payload = jws.payload;
|
|
3018
|
+
const result = { payload };
|
|
3019
|
+
if (jws.protected !== void 0) result.protectedHeader = parsedProt;
|
|
3020
|
+
if (jws.header !== void 0) result.unprotectedHeader = jws.header;
|
|
3021
|
+
if (resolvedKey) return {
|
|
3022
|
+
...result,
|
|
3023
|
+
key: k
|
|
3024
|
+
};
|
|
3025
|
+
return result;
|
|
3026
|
+
}
|
|
3027
|
+
__name(flattenedVerify, "flattenedVerify");
|
|
3028
|
+
async function compactVerify(jws, key, options) {
|
|
3029
|
+
if (jws instanceof Uint8Array) jws = decoder.decode(jws);
|
|
3030
|
+
if (typeof jws !== "string") throw new JWSInvalid("Compact JWS must be a string or Uint8Array");
|
|
3031
|
+
const { 0: protectedHeader, 1: payload, 2: signature, length } = jws.split(".");
|
|
3032
|
+
if (length !== 3) throw new JWSInvalid("Invalid Compact JWS");
|
|
3033
|
+
const verified = await flattenedVerify({
|
|
3034
|
+
payload,
|
|
3035
|
+
protected: protectedHeader,
|
|
3036
|
+
signature
|
|
3037
|
+
}, key, options);
|
|
3038
|
+
const result = {
|
|
3039
|
+
payload: verified.payload,
|
|
3040
|
+
protectedHeader: verified.protectedHeader
|
|
3041
|
+
};
|
|
3042
|
+
if (typeof key === "function") return {
|
|
3043
|
+
...result,
|
|
3044
|
+
key: verified.key
|
|
3045
|
+
};
|
|
3046
|
+
return result;
|
|
3047
|
+
}
|
|
3048
|
+
__name(compactVerify, "compactVerify");
|
|
3049
|
+
var epoch_default = /* @__PURE__ */ __name((date) => Math.floor(date.getTime() / 1e3), "epoch_default");
|
|
3127
3050
|
var minute = 60;
|
|
3128
|
-
var hour =
|
|
3129
|
-
var day =
|
|
3130
|
-
var week =
|
|
3131
|
-
var year = 365.25
|
|
3051
|
+
var hour = minute * 60;
|
|
3052
|
+
var day = hour * 24;
|
|
3053
|
+
var week = day * 7;
|
|
3054
|
+
var year = day * 365.25;
|
|
3132
3055
|
var REGEX = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;
|
|
3133
|
-
var
|
|
3056
|
+
var secs_default = /* @__PURE__ */ __name((str) => {
|
|
3134
3057
|
const matched = REGEX.exec(str);
|
|
3135
3058
|
if (!matched || matched[4] && matched[1]) throw new TypeError("Invalid time period format");
|
|
3136
3059
|
const value = parseFloat(matched[2]);
|
|
@@ -3172,9 +3095,9 @@ var secs = /* @__PURE__ */ __name((str) => {
|
|
|
3172
3095
|
numericDate = Math.round(value * year);
|
|
3173
3096
|
break;
|
|
3174
3097
|
}
|
|
3175
|
-
if (
|
|
3098
|
+
if (matched[1] === "-" || matched[4] === "ago") return -numericDate;
|
|
3176
3099
|
return numericDate;
|
|
3177
|
-
}, "
|
|
3100
|
+
}, "secs_default");
|
|
3178
3101
|
function validateInput(label, input) {
|
|
3179
3102
|
if (!Number.isFinite(input)) throw new TypeError(`Invalid ${label} input`);
|
|
3180
3103
|
return input;
|
|
@@ -3182,7 +3105,7 @@ function validateInput(label, input) {
|
|
|
3182
3105
|
__name(validateInput, "validateInput");
|
|
3183
3106
|
var normalizeTyp = /* @__PURE__ */ __name((value) => value.toLowerCase().replace(/^application\//, ""), "normalizeTyp");
|
|
3184
3107
|
var checkAudiencePresence = /* @__PURE__ */ __name((audPayload, audOption) => {
|
|
3185
|
-
if ("string"
|
|
3108
|
+
if (typeof audPayload === "string") return audOption.includes(audPayload);
|
|
3186
3109
|
if (Array.isArray(audPayload)) return audOption.some(Set.prototype.has.bind(new Set(audPayload)));
|
|
3187
3110
|
return false;
|
|
3188
3111
|
}, "checkAudiencePresence");
|
|
@@ -3192,29 +3115,23 @@ function validateClaimsSet(protectedHeader, encodedPayload, options = {}) {
|
|
|
3192
3115
|
payload = JSON.parse(decoder.decode(encodedPayload));
|
|
3193
3116
|
} catch {
|
|
3194
3117
|
}
|
|
3195
|
-
if (!
|
|
3118
|
+
if (!is_object_default(payload)) throw new JWTInvalid("JWT Claims Set must be a top-level JSON object");
|
|
3196
3119
|
const { typ } = options;
|
|
3197
|
-
if (typ && (
|
|
3120
|
+
if (typ && (typeof protectedHeader.typ !== "string" || normalizeTyp(protectedHeader.typ) !== normalizeTyp(typ))) throw new JWTClaimValidationFailed('unexpected "typ" JWT header value', payload, "typ", "check_failed");
|
|
3198
3121
|
const { requiredClaims = [], issuer, subject, audience, maxTokenAge } = options;
|
|
3199
|
-
const presenceCheck = [
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
if (void 0
|
|
3203
|
-
if (void 0
|
|
3204
|
-
if (void 0 !== subject) presenceCheck.push("sub");
|
|
3205
|
-
if (void 0 !== issuer) presenceCheck.push("iss");
|
|
3122
|
+
const presenceCheck = [...requiredClaims];
|
|
3123
|
+
if (maxTokenAge !== void 0) presenceCheck.push("iat");
|
|
3124
|
+
if (audience !== void 0) presenceCheck.push("aud");
|
|
3125
|
+
if (subject !== void 0) presenceCheck.push("sub");
|
|
3126
|
+
if (issuer !== void 0) presenceCheck.push("iss");
|
|
3206
3127
|
for (const claim of new Set(presenceCheck.reverse())) if (!(claim in payload)) throw new JWTClaimValidationFailed(`missing required "${claim}" claim`, payload, claim, "missing");
|
|
3207
|
-
if (issuer && !(Array.isArray(issuer) ? issuer : [
|
|
3208
|
-
issuer
|
|
3209
|
-
]).includes(payload.iss)) throw new JWTClaimValidationFailed('unexpected "iss" claim value', payload, "iss", "check_failed");
|
|
3128
|
+
if (issuer && !(Array.isArray(issuer) ? issuer : [issuer]).includes(payload.iss)) throw new JWTClaimValidationFailed('unexpected "iss" claim value', payload, "iss", "check_failed");
|
|
3210
3129
|
if (subject && payload.sub !== subject) throw new JWTClaimValidationFailed('unexpected "sub" claim value', payload, "sub", "check_failed");
|
|
3211
|
-
if (audience && !checkAudiencePresence(payload.aud, "string"
|
|
3212
|
-
audience
|
|
3213
|
-
] : audience)) throw new JWTClaimValidationFailed('unexpected "aud" claim value', payload, "aud", "check_failed");
|
|
3130
|
+
if (audience && !checkAudiencePresence(payload.aud, typeof audience === "string" ? [audience] : audience)) throw new JWTClaimValidationFailed('unexpected "aud" claim value', payload, "aud", "check_failed");
|
|
3214
3131
|
let tolerance;
|
|
3215
3132
|
switch (typeof options.clockTolerance) {
|
|
3216
3133
|
case "string":
|
|
3217
|
-
tolerance =
|
|
3134
|
+
tolerance = secs_default(options.clockTolerance);
|
|
3218
3135
|
break;
|
|
3219
3136
|
case "number":
|
|
3220
3137
|
tolerance = options.clockTolerance;
|
|
@@ -3226,19 +3143,19 @@ function validateClaimsSet(protectedHeader, encodedPayload, options = {}) {
|
|
|
3226
3143
|
throw new TypeError("Invalid clockTolerance option type");
|
|
3227
3144
|
}
|
|
3228
3145
|
const { currentDate } = options;
|
|
3229
|
-
const now =
|
|
3230
|
-
if ((void 0
|
|
3231
|
-
if (void 0
|
|
3232
|
-
if (
|
|
3146
|
+
const now = epoch_default(currentDate || /* @__PURE__ */ new Date());
|
|
3147
|
+
if ((payload.iat !== void 0 || maxTokenAge) && typeof payload.iat !== "number") throw new JWTClaimValidationFailed('"iat" claim must be a number', payload, "iat", "invalid");
|
|
3148
|
+
if (payload.nbf !== void 0) {
|
|
3149
|
+
if (typeof payload.nbf !== "number") throw new JWTClaimValidationFailed('"nbf" claim must be a number', payload, "nbf", "invalid");
|
|
3233
3150
|
if (payload.nbf > now + tolerance) throw new JWTClaimValidationFailed('"nbf" claim timestamp check failed', payload, "nbf", "check_failed");
|
|
3234
3151
|
}
|
|
3235
|
-
if (void 0
|
|
3236
|
-
if (
|
|
3152
|
+
if (payload.exp !== void 0) {
|
|
3153
|
+
if (typeof payload.exp !== "number") throw new JWTClaimValidationFailed('"exp" claim must be a number', payload, "exp", "invalid");
|
|
3237
3154
|
if (payload.exp <= now - tolerance) throw new JWTExpired('"exp" claim timestamp check failed', payload, "exp", "check_failed");
|
|
3238
3155
|
}
|
|
3239
3156
|
if (maxTokenAge) {
|
|
3240
3157
|
const age = now - payload.iat;
|
|
3241
|
-
const max = "number"
|
|
3158
|
+
const max = typeof maxTokenAge === "number" ? maxTokenAge : secs_default(maxTokenAge);
|
|
3242
3159
|
if (age - tolerance > max) throw new JWTExpired('"iat" claim timestamp check failed (too far in the past)', payload, "iat", "check_failed");
|
|
3243
3160
|
if (age < 0 - tolerance) throw new JWTClaimValidationFailed('"iat" claim timestamp check failed (it should be in the past)', payload, "iat", "check_failed");
|
|
3244
3161
|
}
|
|
@@ -3251,7 +3168,7 @@ var JWTClaimsBuilder = class {
|
|
|
3251
3168
|
}
|
|
3252
3169
|
#payload;
|
|
3253
3170
|
constructor(payload) {
|
|
3254
|
-
if (!
|
|
3171
|
+
if (!is_object_default(payload)) throw new TypeError("JWT Claims Set MUST be an object");
|
|
3255
3172
|
this.#payload = structuredClone(payload);
|
|
3256
3173
|
}
|
|
3257
3174
|
data() {
|
|
@@ -3263,36 +3180,130 @@ var JWTClaimsBuilder = class {
|
|
|
3263
3180
|
set iss(value) {
|
|
3264
3181
|
this.#payload.iss = value;
|
|
3265
3182
|
}
|
|
3266
|
-
get sub() {
|
|
3267
|
-
return this.#payload.sub;
|
|
3183
|
+
get sub() {
|
|
3184
|
+
return this.#payload.sub;
|
|
3185
|
+
}
|
|
3186
|
+
set sub(value) {
|
|
3187
|
+
this.#payload.sub = value;
|
|
3188
|
+
}
|
|
3189
|
+
get aud() {
|
|
3190
|
+
return this.#payload.aud;
|
|
3191
|
+
}
|
|
3192
|
+
set aud(value) {
|
|
3193
|
+
this.#payload.aud = value;
|
|
3194
|
+
}
|
|
3195
|
+
set jti(value) {
|
|
3196
|
+
this.#payload.jti = value;
|
|
3197
|
+
}
|
|
3198
|
+
set nbf(value) {
|
|
3199
|
+
if (typeof value === "number") this.#payload.nbf = validateInput("setNotBefore", value);
|
|
3200
|
+
else if (value instanceof Date) this.#payload.nbf = validateInput("setNotBefore", epoch_default(value));
|
|
3201
|
+
else this.#payload.nbf = epoch_default(/* @__PURE__ */ new Date()) + secs_default(value);
|
|
3202
|
+
}
|
|
3203
|
+
set exp(value) {
|
|
3204
|
+
if (typeof value === "number") this.#payload.exp = validateInput("setExpirationTime", value);
|
|
3205
|
+
else if (value instanceof Date) this.#payload.exp = validateInput("setExpirationTime", epoch_default(value));
|
|
3206
|
+
else this.#payload.exp = epoch_default(/* @__PURE__ */ new Date()) + secs_default(value);
|
|
3207
|
+
}
|
|
3208
|
+
set iat(value) {
|
|
3209
|
+
if (typeof value === "undefined") this.#payload.iat = epoch_default(/* @__PURE__ */ new Date());
|
|
3210
|
+
else if (value instanceof Date) this.#payload.iat = validateInput("setIssuedAt", epoch_default(value));
|
|
3211
|
+
else if (typeof value === "string") this.#payload.iat = validateInput("setIssuedAt", epoch_default(/* @__PURE__ */ new Date()) + secs_default(value));
|
|
3212
|
+
else this.#payload.iat = validateInput("setIssuedAt", value);
|
|
3213
|
+
}
|
|
3214
|
+
};
|
|
3215
|
+
async function jwtVerify(jwt, key, options) {
|
|
3216
|
+
const verified = await compactVerify(jwt, key, options);
|
|
3217
|
+
if (verified.protectedHeader.crit?.includes("b64") && verified.protectedHeader.b64 === false) throw new JWTInvalid("JWTs MUST NOT use unencoded payload");
|
|
3218
|
+
const payload = validateClaimsSet(verified.protectedHeader, verified.payload, options);
|
|
3219
|
+
const result = {
|
|
3220
|
+
payload,
|
|
3221
|
+
protectedHeader: verified.protectedHeader
|
|
3222
|
+
};
|
|
3223
|
+
if (typeof key === "function") return {
|
|
3224
|
+
...result,
|
|
3225
|
+
key: verified.key
|
|
3226
|
+
};
|
|
3227
|
+
return result;
|
|
3228
|
+
}
|
|
3229
|
+
__name(jwtVerify, "jwtVerify");
|
|
3230
|
+
var sign_default = /* @__PURE__ */ __name(async (alg, key, data) => {
|
|
3231
|
+
const cryptoKey = await get_sign_verify_key_default(alg, key, "sign");
|
|
3232
|
+
check_key_length_default(alg, cryptoKey);
|
|
3233
|
+
const signature = await crypto.subtle.sign(subtle_dsa_default(alg, cryptoKey.algorithm), cryptoKey, data);
|
|
3234
|
+
return new Uint8Array(signature);
|
|
3235
|
+
}, "sign_default");
|
|
3236
|
+
var FlattenedSign = class {
|
|
3237
|
+
static {
|
|
3238
|
+
__name(this, "FlattenedSign");
|
|
3239
|
+
}
|
|
3240
|
+
#payload;
|
|
3241
|
+
#protectedHeader;
|
|
3242
|
+
#unprotectedHeader;
|
|
3243
|
+
constructor(payload) {
|
|
3244
|
+
if (!(payload instanceof Uint8Array)) throw new TypeError("payload must be an instance of Uint8Array");
|
|
3245
|
+
this.#payload = payload;
|
|
3268
3246
|
}
|
|
3269
|
-
|
|
3270
|
-
this.#
|
|
3247
|
+
setProtectedHeader(protectedHeader) {
|
|
3248
|
+
if (this.#protectedHeader) throw new TypeError("setProtectedHeader can only be called once");
|
|
3249
|
+
this.#protectedHeader = protectedHeader;
|
|
3250
|
+
return this;
|
|
3271
3251
|
}
|
|
3272
|
-
|
|
3273
|
-
|
|
3252
|
+
setUnprotectedHeader(unprotectedHeader) {
|
|
3253
|
+
if (this.#unprotectedHeader) throw new TypeError("setUnprotectedHeader can only be called once");
|
|
3254
|
+
this.#unprotectedHeader = unprotectedHeader;
|
|
3255
|
+
return this;
|
|
3274
3256
|
}
|
|
3275
|
-
|
|
3276
|
-
this.#
|
|
3257
|
+
async sign(key, options) {
|
|
3258
|
+
if (!this.#protectedHeader && !this.#unprotectedHeader) throw new JWSInvalid("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");
|
|
3259
|
+
if (!is_disjoint_default(this.#protectedHeader, this.#unprotectedHeader)) throw new JWSInvalid("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
|
|
3260
|
+
const joseHeader = {
|
|
3261
|
+
...this.#protectedHeader,
|
|
3262
|
+
...this.#unprotectedHeader
|
|
3263
|
+
};
|
|
3264
|
+
const extensions = validate_crit_default(JWSInvalid, /* @__PURE__ */ new Map([["b64", true]]), options?.crit, this.#protectedHeader, joseHeader);
|
|
3265
|
+
let b64 = true;
|
|
3266
|
+
if (extensions.has("b64")) {
|
|
3267
|
+
b64 = this.#protectedHeader.b64;
|
|
3268
|
+
if (typeof b64 !== "boolean") throw new JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
|
|
3269
|
+
}
|
|
3270
|
+
const { alg } = joseHeader;
|
|
3271
|
+
if (typeof alg !== "string" || !alg) throw new JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
3272
|
+
check_key_type_default(alg, key, "sign");
|
|
3273
|
+
let payload = this.#payload;
|
|
3274
|
+
if (b64) payload = encoder.encode(encode(payload));
|
|
3275
|
+
let protectedHeader;
|
|
3276
|
+
if (this.#protectedHeader) protectedHeader = encoder.encode(encode(JSON.stringify(this.#protectedHeader)));
|
|
3277
|
+
else protectedHeader = encoder.encode("");
|
|
3278
|
+
const data = concat(protectedHeader, encoder.encode("."), payload);
|
|
3279
|
+
const k = await normalize_key_default(key, alg);
|
|
3280
|
+
const signature = await sign_default(alg, k, data);
|
|
3281
|
+
const jws = {
|
|
3282
|
+
signature: encode(signature),
|
|
3283
|
+
payload: ""
|
|
3284
|
+
};
|
|
3285
|
+
if (b64) jws.payload = decoder.decode(payload);
|
|
3286
|
+
if (this.#unprotectedHeader) jws.header = this.#unprotectedHeader;
|
|
3287
|
+
if (this.#protectedHeader) jws.protected = decoder.decode(protectedHeader);
|
|
3288
|
+
return jws;
|
|
3277
3289
|
}
|
|
3278
|
-
|
|
3279
|
-
|
|
3290
|
+
};
|
|
3291
|
+
var CompactSign = class {
|
|
3292
|
+
static {
|
|
3293
|
+
__name(this, "CompactSign");
|
|
3280
3294
|
}
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
else this.#payload.nbf = epoch(/* @__PURE__ */ new Date()) + secs(value);
|
|
3295
|
+
#flattened;
|
|
3296
|
+
constructor(payload) {
|
|
3297
|
+
this.#flattened = new FlattenedSign(payload);
|
|
3285
3298
|
}
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
else this.#payload.exp = epoch(/* @__PURE__ */ new Date()) + secs(value);
|
|
3299
|
+
setProtectedHeader(protectedHeader) {
|
|
3300
|
+
this.#flattened.setProtectedHeader(protectedHeader);
|
|
3301
|
+
return this;
|
|
3290
3302
|
}
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
else this.#payload.iat = validateInput("setIssuedAt", value);
|
|
3303
|
+
async sign(key, options) {
|
|
3304
|
+
const jws = await this.#flattened.sign(key, options);
|
|
3305
|
+
if (jws.payload === void 0) throw new TypeError("use the flattened module for creating JWS with b64: false");
|
|
3306
|
+
return `${jws.protected}.${jws.payload}.${jws.signature}`;
|
|
3296
3307
|
}
|
|
3297
3308
|
};
|
|
3298
3309
|
var SignJWT = class {
|
|
@@ -3339,158 +3350,33 @@ var SignJWT = class {
|
|
|
3339
3350
|
async sign(key, options) {
|
|
3340
3351
|
const sig = new CompactSign(this.#jwt.data());
|
|
3341
3352
|
sig.setProtectedHeader(this.#protectedHeader);
|
|
3342
|
-
if (Array.isArray(this.#protectedHeader?.crit) && this.#protectedHeader.crit.includes("b64") &&
|
|
3353
|
+
if (Array.isArray(this.#protectedHeader?.crit) && this.#protectedHeader.crit.includes("b64") && this.#protectedHeader.b64 === false) throw new JWTInvalid("JWTs MUST NOT use unencoded payload");
|
|
3343
3354
|
return sig.sign(key, options);
|
|
3344
3355
|
}
|
|
3345
3356
|
};
|
|
3346
|
-
var withJwtSignedUrl = /* @__PURE__ */ __name(async ({
|
|
3357
|
+
var withJwtSignedUrl = /* @__PURE__ */ __name(async ({ data, reqUrl, jwtSecret }) => {
|
|
3347
3358
|
if (!data) return null;
|
|
3348
|
-
|
|
3349
|
-
|
|
3359
|
+
const { storageUri, ...rest } = data;
|
|
3360
|
+
if (data.id === NIL_UUID || !storageUri) return {
|
|
3361
|
+
...rest,
|
|
3350
3362
|
fileUrl: null
|
|
3351
3363
|
};
|
|
3352
|
-
const
|
|
3364
|
+
const storageUrl = new URL(storageUri);
|
|
3365
|
+
const key = `${storageUrl.host}${storageUrl.pathname}`;
|
|
3353
3366
|
const token = await signToken(key, jwtSecret);
|
|
3354
3367
|
const url = new URL(reqUrl);
|
|
3355
|
-
url.pathname =
|
|
3368
|
+
url.pathname = key;
|
|
3356
3369
|
url.searchParams.set("token", token);
|
|
3357
3370
|
return {
|
|
3358
|
-
...
|
|
3371
|
+
...rest,
|
|
3359
3372
|
fileUrl: url.toString()
|
|
3360
3373
|
};
|
|
3361
3374
|
}, "withJwtSignedUrl");
|
|
3362
3375
|
var signToken = /* @__PURE__ */ __name(async (key, jwtSecret) => {
|
|
3363
3376
|
const secretKey = new TextEncoder().encode(jwtSecret);
|
|
3364
|
-
const token = await new SignJWT({
|
|
3365
|
-
key
|
|
3366
|
-
}).setProtectedHeader({
|
|
3367
|
-
alg: "HS256"
|
|
3368
|
-
}).setExpirationTime("60s").sign(secretKey);
|
|
3377
|
+
const token = await new SignJWT({ key }).setProtectedHeader({ alg: "HS256" }).setExpirationTime("60s").sign(secretKey);
|
|
3369
3378
|
return token;
|
|
3370
3379
|
}, "signToken");
|
|
3371
|
-
var verify = /* @__PURE__ */ __name(async (alg, key, signature, data) => {
|
|
3372
|
-
const cryptoKey = await get_sign_verify_key(alg, key, "verify");
|
|
3373
|
-
check_key_length(alg, cryptoKey);
|
|
3374
|
-
const algorithm = subtle_dsa(alg, cryptoKey.algorithm);
|
|
3375
|
-
try {
|
|
3376
|
-
return await crypto.subtle.verify(algorithm, cryptoKey, signature, data);
|
|
3377
|
-
} catch {
|
|
3378
|
-
return false;
|
|
3379
|
-
}
|
|
3380
|
-
}, "verify");
|
|
3381
|
-
var validate_algorithms = /* @__PURE__ */ __name((option, algorithms) => {
|
|
3382
|
-
if (void 0 !== algorithms && (!Array.isArray(algorithms) || algorithms.some((s) => "string" != typeof s))) throw new TypeError(`"${option}" option must be an array of strings`);
|
|
3383
|
-
if (!algorithms) return;
|
|
3384
|
-
return new Set(algorithms);
|
|
3385
|
-
}, "validate_algorithms");
|
|
3386
|
-
async function flattenedVerify(jws, key, options) {
|
|
3387
|
-
if (!is_object(jws)) throw new JWSInvalid("Flattened JWS must be an object");
|
|
3388
|
-
if (void 0 === jws.protected && void 0 === jws.header) throw new JWSInvalid('Flattened JWS must have either of the "protected" or "header" members');
|
|
3389
|
-
if (void 0 !== jws.protected && "string" != typeof jws.protected) throw new JWSInvalid("JWS Protected Header incorrect type");
|
|
3390
|
-
if (void 0 === jws.payload) throw new JWSInvalid("JWS Payload missing");
|
|
3391
|
-
if ("string" != typeof jws.signature) throw new JWSInvalid("JWS Signature missing or incorrect type");
|
|
3392
|
-
if (void 0 !== jws.header && !is_object(jws.header)) throw new JWSInvalid("JWS Unprotected Header incorrect type");
|
|
3393
|
-
let parsedProt = {};
|
|
3394
|
-
if (jws.protected) try {
|
|
3395
|
-
const protectedHeader = decode(jws.protected);
|
|
3396
|
-
parsedProt = JSON.parse(decoder.decode(protectedHeader));
|
|
3397
|
-
} catch {
|
|
3398
|
-
throw new JWSInvalid("JWS Protected Header is invalid");
|
|
3399
|
-
}
|
|
3400
|
-
if (!is_disjoint(parsedProt, jws.header)) throw new JWSInvalid("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
|
|
3401
|
-
const joseHeader = {
|
|
3402
|
-
...parsedProt,
|
|
3403
|
-
...jws.header
|
|
3404
|
-
};
|
|
3405
|
-
const extensions = validate_crit(JWSInvalid, /* @__PURE__ */ new Map([
|
|
3406
|
-
[
|
|
3407
|
-
"b64",
|
|
3408
|
-
true
|
|
3409
|
-
]
|
|
3410
|
-
]), options?.crit, parsedProt, joseHeader);
|
|
3411
|
-
let b64 = true;
|
|
3412
|
-
if (extensions.has("b64")) {
|
|
3413
|
-
b64 = parsedProt.b64;
|
|
3414
|
-
if ("boolean" != typeof b64) throw new JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
|
|
3415
|
-
}
|
|
3416
|
-
const { alg } = joseHeader;
|
|
3417
|
-
if ("string" != typeof alg || !alg) throw new JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
3418
|
-
const algorithms = options && validate_algorithms("algorithms", options.algorithms);
|
|
3419
|
-
if (algorithms && !algorithms.has(alg)) throw new JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter value not allowed');
|
|
3420
|
-
if (b64) {
|
|
3421
|
-
if ("string" != typeof jws.payload) throw new JWSInvalid("JWS Payload must be a string");
|
|
3422
|
-
} else if ("string" != typeof jws.payload && !(jws.payload instanceof Uint8Array)) throw new JWSInvalid("JWS Payload must be a string or an Uint8Array instance");
|
|
3423
|
-
let resolvedKey = false;
|
|
3424
|
-
if ("function" == typeof key) {
|
|
3425
|
-
key = await key(parsedProt, jws);
|
|
3426
|
-
resolvedKey = true;
|
|
3427
|
-
}
|
|
3428
|
-
check_key_type(alg, key, "verify");
|
|
3429
|
-
const data = concat(encoder.encode(jws.protected ?? ""), encoder.encode("."), "string" == typeof jws.payload ? encoder.encode(jws.payload) : jws.payload);
|
|
3430
|
-
let signature;
|
|
3431
|
-
try {
|
|
3432
|
-
signature = decode(jws.signature);
|
|
3433
|
-
} catch {
|
|
3434
|
-
throw new JWSInvalid("Failed to base64url decode the signature");
|
|
3435
|
-
}
|
|
3436
|
-
const k = await normalize_key(key, alg);
|
|
3437
|
-
const verified = await verify(alg, k, signature, data);
|
|
3438
|
-
if (!verified) throw new JWSSignatureVerificationFailed();
|
|
3439
|
-
let payload;
|
|
3440
|
-
if (b64) try {
|
|
3441
|
-
payload = decode(jws.payload);
|
|
3442
|
-
} catch {
|
|
3443
|
-
throw new JWSInvalid("Failed to base64url decode the payload");
|
|
3444
|
-
}
|
|
3445
|
-
else payload = "string" == typeof jws.payload ? encoder.encode(jws.payload) : jws.payload;
|
|
3446
|
-
const result = {
|
|
3447
|
-
payload
|
|
3448
|
-
};
|
|
3449
|
-
if (void 0 !== jws.protected) result.protectedHeader = parsedProt;
|
|
3450
|
-
if (void 0 !== jws.header) result.unprotectedHeader = jws.header;
|
|
3451
|
-
if (resolvedKey) return {
|
|
3452
|
-
...result,
|
|
3453
|
-
key: k
|
|
3454
|
-
};
|
|
3455
|
-
return result;
|
|
3456
|
-
}
|
|
3457
|
-
__name(flattenedVerify, "flattenedVerify");
|
|
3458
|
-
async function compactVerify(jws, key, options) {
|
|
3459
|
-
if (jws instanceof Uint8Array) jws = decoder.decode(jws);
|
|
3460
|
-
if ("string" != typeof jws) throw new JWSInvalid("Compact JWS must be a string or Uint8Array");
|
|
3461
|
-
const { 0: protectedHeader, 1: payload, 2: signature, length } = jws.split(".");
|
|
3462
|
-
if (3 !== length) throw new JWSInvalid("Invalid Compact JWS");
|
|
3463
|
-
const verified = await flattenedVerify({
|
|
3464
|
-
payload,
|
|
3465
|
-
protected: protectedHeader,
|
|
3466
|
-
signature
|
|
3467
|
-
}, key, options);
|
|
3468
|
-
const result = {
|
|
3469
|
-
payload: verified.payload,
|
|
3470
|
-
protectedHeader: verified.protectedHeader
|
|
3471
|
-
};
|
|
3472
|
-
if ("function" == typeof key) return {
|
|
3473
|
-
...result,
|
|
3474
|
-
key: verified.key
|
|
3475
|
-
};
|
|
3476
|
-
return result;
|
|
3477
|
-
}
|
|
3478
|
-
__name(compactVerify, "compactVerify");
|
|
3479
|
-
async function jwtVerify(jwt, key, options) {
|
|
3480
|
-
const verified = await compactVerify(jwt, key, options);
|
|
3481
|
-
if (verified.protectedHeader.crit?.includes("b64") && false === verified.protectedHeader.b64) throw new JWTInvalid("JWTs MUST NOT use unencoded payload");
|
|
3482
|
-
const payload = validateClaimsSet(verified.protectedHeader, verified.payload, options);
|
|
3483
|
-
const result = {
|
|
3484
|
-
payload,
|
|
3485
|
-
protectedHeader: verified.protectedHeader
|
|
3486
|
-
};
|
|
3487
|
-
if ("function" == typeof key) return {
|
|
3488
|
-
...result,
|
|
3489
|
-
key: verified.key
|
|
3490
|
-
};
|
|
3491
|
-
return result;
|
|
3492
|
-
}
|
|
3493
|
-
__name(jwtVerify, "jwtVerify");
|
|
3494
3380
|
var verifyJwtToken = /* @__PURE__ */ __name(async ({ path, token, jwtSecret }) => {
|
|
3495
3381
|
const key = path.replace(/^\/+/, "");
|
|
3496
3382
|
if (!token) return {
|
|
@@ -3540,7 +3426,7 @@ var verifyJwtSignedUrl = /* @__PURE__ */ __name(async ({ path, token, jwtSecret,
|
|
|
3540
3426
|
jwtSecret
|
|
3541
3427
|
});
|
|
3542
3428
|
if (!result.valid) {
|
|
3543
|
-
if ("Missing token"
|
|
3429
|
+
if (result.error === "Missing token") return {
|
|
3544
3430
|
status: 400,
|
|
3545
3431
|
error: result.error
|
|
3546
3432
|
};
|
|
@@ -5142,7 +5028,7 @@ var Hono2 = class extends Hono {
|
|
|
5142
5028
|
};
|
|
5143
5029
|
|
|
5144
5030
|
// worker/src/getUpdateInfo.ts
|
|
5145
|
-
var
|
|
5031
|
+
var appVersionStrategy = /* @__PURE__ */ __name(async (DB, {
|
|
5146
5032
|
platform: platform2,
|
|
5147
5033
|
appVersion,
|
|
5148
5034
|
bundleId,
|
|
@@ -5180,6 +5066,7 @@ var getUpdateInfo = /* @__PURE__ */ __name(async (DB, {
|
|
|
5180
5066
|
b.id,
|
|
5181
5067
|
b.should_force_update,
|
|
5182
5068
|
b.message,
|
|
5069
|
+
b.storage_uri,
|
|
5183
5070
|
'UPDATE' AS status
|
|
5184
5071
|
FROM bundles b, input
|
|
5185
5072
|
WHERE b.enabled = 1
|
|
@@ -5196,6 +5083,7 @@ var getUpdateInfo = /* @__PURE__ */ __name(async (DB, {
|
|
|
5196
5083
|
b.id,
|
|
5197
5084
|
1 AS should_force_update,
|
|
5198
5085
|
b.message,
|
|
5086
|
+
b.storage_uri,
|
|
5199
5087
|
'ROLLBACK' AS status
|
|
5200
5088
|
FROM bundles b, input
|
|
5201
5089
|
WHERE b.enabled = 1
|
|
@@ -5211,7 +5099,7 @@ var getUpdateInfo = /* @__PURE__ */ __name(async (DB, {
|
|
|
5211
5099
|
SELECT * FROM rollback_candidate
|
|
5212
5100
|
WHERE NOT EXISTS (SELECT 1 FROM update_candidate)
|
|
5213
5101
|
)
|
|
5214
|
-
SELECT id, should_force_update, message, status
|
|
5102
|
+
SELECT id, should_force_update, message, status, storage_uri
|
|
5215
5103
|
FROM final_result, input
|
|
5216
5104
|
WHERE id <> bundle_id
|
|
5217
5105
|
|
|
@@ -5221,7 +5109,8 @@ var getUpdateInfo = /* @__PURE__ */ __name(async (DB, {
|
|
|
5221
5109
|
nil_uuid AS id,
|
|
5222
5110
|
1 AS should_force_update,
|
|
5223
5111
|
NULL AS message,
|
|
5224
|
-
'ROLLBACK' AS status
|
|
5112
|
+
'ROLLBACK' AS status,
|
|
5113
|
+
NULL AS storage_uri
|
|
5225
5114
|
FROM input
|
|
5226
5115
|
WHERE (SELECT COUNT(*) FROM final_result) = 0
|
|
5227
5116
|
AND bundle_id > min_bundle_id;
|
|
@@ -5235,45 +5124,234 @@ var getUpdateInfo = /* @__PURE__ */ __name(async (DB, {
|
|
|
5235
5124
|
id: result.id,
|
|
5236
5125
|
shouldForceUpdate: Boolean(result.should_force_update),
|
|
5237
5126
|
status: result.status,
|
|
5238
|
-
message: result.message
|
|
5127
|
+
message: result.message,
|
|
5128
|
+
storageUri: result.storage_uri
|
|
5129
|
+
};
|
|
5130
|
+
}, "appVersionStrategy");
|
|
5131
|
+
var fingerprintStrategy = /* @__PURE__ */ __name(async (DB, {
|
|
5132
|
+
platform: platform2,
|
|
5133
|
+
fingerprintHash,
|
|
5134
|
+
bundleId,
|
|
5135
|
+
minBundleId = NIL_UUID,
|
|
5136
|
+
channel: channel2 = "production"
|
|
5137
|
+
}) => {
|
|
5138
|
+
const sql = (
|
|
5139
|
+
/* sql */
|
|
5140
|
+
`
|
|
5141
|
+
WITH input AS (
|
|
5142
|
+
SELECT
|
|
5143
|
+
? AS app_platform,
|
|
5144
|
+
? AS bundle_id,
|
|
5145
|
+
? AS min_bundle_id,
|
|
5146
|
+
? AS channel,
|
|
5147
|
+
? AS fingerprint_hash,
|
|
5148
|
+
'00000000-0000-0000-0000-000000000000' AS nil_uuid
|
|
5149
|
+
),
|
|
5150
|
+
update_candidate AS (
|
|
5151
|
+
SELECT
|
|
5152
|
+
b.id,
|
|
5153
|
+
b.should_force_update,
|
|
5154
|
+
b.message,
|
|
5155
|
+
b.storage_uri,
|
|
5156
|
+
'UPDATE' AS status
|
|
5157
|
+
FROM bundles b, input
|
|
5158
|
+
WHERE b.enabled = 1
|
|
5159
|
+
AND b.platform = input.app_platform
|
|
5160
|
+
AND b.id >= input.bundle_id
|
|
5161
|
+
AND b.id >= input.min_bundle_id
|
|
5162
|
+
AND b.channel = input.channel
|
|
5163
|
+
AND b.fingerprint_hash = input.fingerprint_hash
|
|
5164
|
+
ORDER BY b.id DESC
|
|
5165
|
+
LIMIT 1
|
|
5166
|
+
),
|
|
5167
|
+
rollback_candidate AS (
|
|
5168
|
+
SELECT
|
|
5169
|
+
b.id,
|
|
5170
|
+
1 AS should_force_update,
|
|
5171
|
+
b.message,
|
|
5172
|
+
b.storage_uri,
|
|
5173
|
+
'ROLLBACK' AS status
|
|
5174
|
+
FROM bundles b, input
|
|
5175
|
+
WHERE b.enabled = 1
|
|
5176
|
+
AND b.platform = input.app_platform
|
|
5177
|
+
AND b.id < input.bundle_id
|
|
5178
|
+
AND b.id >= input.min_bundle_id
|
|
5179
|
+
AND b.channel = input.channel
|
|
5180
|
+
AND b.fingerprint_hash = input.fingerprint_hash
|
|
5181
|
+
ORDER BY b.id DESC
|
|
5182
|
+
LIMIT 1
|
|
5183
|
+
),
|
|
5184
|
+
final_result AS (
|
|
5185
|
+
SELECT * FROM update_candidate
|
|
5186
|
+
UNION ALL
|
|
5187
|
+
SELECT * FROM rollback_candidate
|
|
5188
|
+
WHERE NOT EXISTS (SELECT 1 FROM update_candidate)
|
|
5189
|
+
)
|
|
5190
|
+
SELECT id, should_force_update, message, status, storage_uri
|
|
5191
|
+
FROM final_result, input
|
|
5192
|
+
WHERE id <> bundle_id
|
|
5193
|
+
|
|
5194
|
+
UNION ALL
|
|
5195
|
+
|
|
5196
|
+
SELECT
|
|
5197
|
+
nil_uuid AS id,
|
|
5198
|
+
1 AS should_force_update,
|
|
5199
|
+
NULL AS message,
|
|
5200
|
+
'ROLLBACK' AS status,
|
|
5201
|
+
NULL AS storage_uri
|
|
5202
|
+
FROM input
|
|
5203
|
+
WHERE (SELECT COUNT(*) FROM final_result) = 0
|
|
5204
|
+
AND bundle_id > min_bundle_id;
|
|
5205
|
+
`
|
|
5206
|
+
);
|
|
5207
|
+
const result = await DB.prepare(sql).bind(platform2, bundleId, minBundleId, channel2, fingerprintHash).first();
|
|
5208
|
+
if (!result) {
|
|
5209
|
+
return null;
|
|
5210
|
+
}
|
|
5211
|
+
return {
|
|
5212
|
+
id: result.id,
|
|
5213
|
+
shouldForceUpdate: Boolean(result.should_force_update),
|
|
5214
|
+
status: result.status,
|
|
5215
|
+
message: result.message,
|
|
5216
|
+
storageUri: result.storage_uri
|
|
5239
5217
|
};
|
|
5218
|
+
}, "fingerprintStrategy");
|
|
5219
|
+
var getUpdateInfo = /* @__PURE__ */ __name((DB, args) => {
|
|
5220
|
+
switch (args._updateStrategy) {
|
|
5221
|
+
case "appVersion":
|
|
5222
|
+
return appVersionStrategy(DB, args);
|
|
5223
|
+
case "fingerprint":
|
|
5224
|
+
return fingerprintStrategy(DB, args);
|
|
5225
|
+
default:
|
|
5226
|
+
return null;
|
|
5227
|
+
}
|
|
5240
5228
|
}, "getUpdateInfo");
|
|
5241
5229
|
|
|
5242
5230
|
// worker/src/index.ts
|
|
5243
5231
|
var app = new Hono2();
|
|
5232
|
+
var handleUpdateRequest = /* @__PURE__ */ __name(async (db, updateConfig, reqUrl, jwtSecret) => {
|
|
5233
|
+
const updateInfo = await getUpdateInfo(db, updateConfig);
|
|
5234
|
+
if (!updateInfo) {
|
|
5235
|
+
return null;
|
|
5236
|
+
}
|
|
5237
|
+
return withJwtSignedUrl({
|
|
5238
|
+
data: updateInfo,
|
|
5239
|
+
reqUrl,
|
|
5240
|
+
jwtSecret
|
|
5241
|
+
});
|
|
5242
|
+
}, "handleUpdateRequest");
|
|
5244
5243
|
app.get("/api/check-update", async (c) => {
|
|
5245
5244
|
const bundleId = c.req.header("x-bundle-id");
|
|
5246
5245
|
const appPlatform = c.req.header("x-app-platform");
|
|
5247
|
-
const appVersion = c.req.header("x-app-version");
|
|
5248
5246
|
const minBundleId = c.req.header("x-min-bundle-id");
|
|
5247
|
+
const appVersion = c.req.header("x-app-version");
|
|
5249
5248
|
const channel2 = c.req.header("x-channel");
|
|
5250
|
-
|
|
5249
|
+
const fingerprintHash = c.req.header("x-fingerprint-hash") ?? null;
|
|
5250
|
+
if (!bundleId || !appPlatform) {
|
|
5251
|
+
return c.json(
|
|
5252
|
+
{ error: "Missing required headers (x-app-platform, x-bundle-id)." },
|
|
5253
|
+
400
|
|
5254
|
+
);
|
|
5255
|
+
}
|
|
5256
|
+
if (!appVersion && !fingerprintHash) {
|
|
5251
5257
|
return c.json(
|
|
5252
|
-
{
|
|
5258
|
+
{
|
|
5259
|
+
error: "Missing required headers (x-app-version or x-fingerprint-hash)."
|
|
5260
|
+
},
|
|
5253
5261
|
400
|
|
5254
5262
|
);
|
|
5255
5263
|
}
|
|
5256
|
-
const
|
|
5264
|
+
const updateConfig = fingerprintHash ? {
|
|
5265
|
+
fingerprintHash,
|
|
5266
|
+
bundleId,
|
|
5267
|
+
platform: appPlatform,
|
|
5268
|
+
minBundleId: minBundleId || NIL_UUID,
|
|
5269
|
+
channel: channel2 || "production",
|
|
5270
|
+
_updateStrategy: "fingerprint"
|
|
5271
|
+
} : {
|
|
5257
5272
|
appVersion,
|
|
5258
5273
|
bundleId,
|
|
5259
5274
|
platform: appPlatform,
|
|
5260
5275
|
minBundleId: minBundleId || NIL_UUID,
|
|
5261
|
-
channel: channel2 || "production"
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5276
|
+
channel: channel2 || "production",
|
|
5277
|
+
_updateStrategy: "appVersion"
|
|
5278
|
+
};
|
|
5279
|
+
const result = await handleUpdateRequest(
|
|
5280
|
+
c.env.DB,
|
|
5281
|
+
updateConfig,
|
|
5282
|
+
c.req.url,
|
|
5283
|
+
c.env.JWT_SECRET
|
|
5284
|
+
);
|
|
5285
|
+
return c.json(result, 200);
|
|
5269
5286
|
});
|
|
5287
|
+
app.get(
|
|
5288
|
+
"/api/check-update/app-version/:platform/:app-version/:channel/:minBundleId/:bundleId",
|
|
5289
|
+
async (c) => {
|
|
5290
|
+
const {
|
|
5291
|
+
platform: platform2,
|
|
5292
|
+
"app-version": appVersion,
|
|
5293
|
+
channel: channel2,
|
|
5294
|
+
minBundleId,
|
|
5295
|
+
bundleId
|
|
5296
|
+
} = c.req.param();
|
|
5297
|
+
if (!bundleId || !platform2) {
|
|
5298
|
+
return c.json(
|
|
5299
|
+
{ error: "Missing required parameters (platform, bundleId)." },
|
|
5300
|
+
400
|
|
5301
|
+
);
|
|
5302
|
+
}
|
|
5303
|
+
const updateConfig = {
|
|
5304
|
+
platform: platform2,
|
|
5305
|
+
appVersion,
|
|
5306
|
+
bundleId,
|
|
5307
|
+
minBundleId: minBundleId || NIL_UUID,
|
|
5308
|
+
channel: channel2 || "production",
|
|
5309
|
+
_updateStrategy: "appVersion"
|
|
5310
|
+
};
|
|
5311
|
+
const result = await handleUpdateRequest(
|
|
5312
|
+
c.env.DB,
|
|
5313
|
+
updateConfig,
|
|
5314
|
+
c.req.url,
|
|
5315
|
+
c.env.JWT_SECRET
|
|
5316
|
+
);
|
|
5317
|
+
return c.json(result, 200);
|
|
5318
|
+
}
|
|
5319
|
+
);
|
|
5320
|
+
app.get(
|
|
5321
|
+
"/api/check-update/fingerprint/:platform/:fingerprintHash/:channel/:minBundleId/:bundleId",
|
|
5322
|
+
async (c) => {
|
|
5323
|
+
const { platform: platform2, fingerprintHash, channel: channel2, minBundleId, bundleId } = c.req.param();
|
|
5324
|
+
if (!bundleId || !platform2) {
|
|
5325
|
+
return c.json(
|
|
5326
|
+
{ error: "Missing required parameters (platform, bundleId)." },
|
|
5327
|
+
400
|
|
5328
|
+
);
|
|
5329
|
+
}
|
|
5330
|
+
const updateConfig = {
|
|
5331
|
+
platform: platform2,
|
|
5332
|
+
fingerprintHash,
|
|
5333
|
+
bundleId,
|
|
5334
|
+
minBundleId: minBundleId || NIL_UUID,
|
|
5335
|
+
channel: channel2 || "production",
|
|
5336
|
+
_updateStrategy: "fingerprint"
|
|
5337
|
+
};
|
|
5338
|
+
const result = await handleUpdateRequest(
|
|
5339
|
+
c.env.DB,
|
|
5340
|
+
updateConfig,
|
|
5341
|
+
c.req.url,
|
|
5342
|
+
c.env.JWT_SECRET
|
|
5343
|
+
);
|
|
5344
|
+
return c.json(result, 200);
|
|
5345
|
+
}
|
|
5346
|
+
);
|
|
5270
5347
|
app.get("*", async (c) => {
|
|
5271
5348
|
const result = await verifyJwtSignedUrl({
|
|
5272
5349
|
path: c.req.path,
|
|
5273
5350
|
token: c.req.query("token"),
|
|
5274
5351
|
jwtSecret: c.env.JWT_SECRET,
|
|
5275
|
-
handler: /* @__PURE__ */ __name(async (
|
|
5276
|
-
const
|
|
5352
|
+
handler: /* @__PURE__ */ __name(async (storageUri) => {
|
|
5353
|
+
const [, ...key] = storageUri.split("/");
|
|
5354
|
+
const object = await c.env.BUCKET.get(key.join("/"));
|
|
5277
5355
|
if (!object) {
|
|
5278
5356
|
return null;
|
|
5279
5357
|
}
|