@hot-updater/console 0.35.11 → 0.36.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/.output/nitro.json +1 -1
- package/.output/public/assets/{index-CCUspZZV.js → index-Iylis5kY.js} +2 -2
- package/.output/public/assets/routes-HT21hs0C.js +54 -0
- package/.output/public/assets/{styles-C0q26dS-.css → styles-C0Re4quB.css} +1 -1
- package/.output/server/{__23tanstack-start-server-fn-resolver-DVQ3oVr1.mjs → __23tanstack-start-server-fn-resolver-CgwgZ0-i.mjs} +17 -13
- package/.output/server/_libs/verkit.mjs +246 -0
- package/.output/server/_ssr/{api-rpc-CToa1VZt.mjs → api-rpc-BIbDUKSz.mjs} +29 -4
- package/.output/server/_ssr/{deleteBundle-De_OKj6m.mjs → deleteBundle-BgbZTtpW.mjs} +72 -46
- package/.output/server/_ssr/{router-CIjEvqDS.mjs → router-C3hqEy3k.mjs} +7 -3
- package/.output/server/_ssr/{routes-Bjhf6xFE.mjs → routes-B0lQvvlC.mjs} +77 -48
- package/.output/server/_ssr/ssr.mjs +3 -3
- package/.output/server/{_tanstack-start-manifest_v-BroBMdSR.mjs → _tanstack-start-manifest_v-Bpx52WOU.mjs} +4 -4
- package/.output/server/index.mjs +38 -38
- package/package.json +8 -9
- package/.output/public/assets/routes-D0t6y5Fr.js +0 -54
- package/.output/server/_libs/semver.mjs +0 -1385
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/verkit@0.3.2/node_modules/verkit/dist/index.js
|
|
2
|
+
var LETTER_DASH_NUMBER = "[a-zA-Z0-9-]";
|
|
3
|
+
var NUMERIC_IDENTIFIER = String.raw`0|[1-9]\d*`;
|
|
4
|
+
var NUMERIC_IDENTIFIER_LOOSE = String.raw`\d+`;
|
|
5
|
+
var NON_NUMERIC_IDENTIFIER = String.raw`\d*[a-zA-Z-]${LETTER_DASH_NUMBER}*`;
|
|
6
|
+
var MAIN_VERSION = String.raw`(${NUMERIC_IDENTIFIER})\.(${NUMERIC_IDENTIFIER})\.(${NUMERIC_IDENTIFIER})`;
|
|
7
|
+
var MAIN_VERSION_LOOSE = String.raw`(${NUMERIC_IDENTIFIER_LOOSE})\.(${NUMERIC_IDENTIFIER_LOOSE})\.(${NUMERIC_IDENTIFIER_LOOSE})`;
|
|
8
|
+
var PRERELEASE_IDENTIFIER = `(?:${NON_NUMERIC_IDENTIFIER}|${NUMERIC_IDENTIFIER})`;
|
|
9
|
+
var PRERELEASE_IDENTIFIER_LOOSE = `(?:${NON_NUMERIC_IDENTIFIER}|${NUMERIC_IDENTIFIER_LOOSE})`;
|
|
10
|
+
var PRERELEASE = String.raw`(?:-(${PRERELEASE_IDENTIFIER}(?:\.${PRERELEASE_IDENTIFIER})*))`;
|
|
11
|
+
var PRERELEASE_LOOSE = String.raw`(?:-?(${PRERELEASE_IDENTIFIER_LOOSE}(?:\.${PRERELEASE_IDENTIFIER_LOOSE})*))`;
|
|
12
|
+
var BUILD_IDENTIFIER = `${LETTER_DASH_NUMBER}+`;
|
|
13
|
+
var BUILD = String.raw`(?:\+(${BUILD_IDENTIFIER}(?:\.${BUILD_IDENTIFIER})*))`;
|
|
14
|
+
var FULL_PLAIN = `v?${MAIN_VERSION}${PRERELEASE}?${BUILD}?`;
|
|
15
|
+
var LOOSE_PLAIN = String.raw`[v=\s]*${MAIN_VERSION_LOOSE}${PRERELEASE_LOOSE}?${BUILD}?`;
|
|
16
|
+
var GREATER_LESS_THAN = "((?:<|>)?=?)";
|
|
17
|
+
var XRANGE_IDENTIFIER = String.raw`${NUMERIC_IDENTIFIER}|x|X|\*`;
|
|
18
|
+
var XRANGE_IDENTIFIER_LOOSE = String.raw`${NUMERIC_IDENTIFIER_LOOSE}|x|X|\*`;
|
|
19
|
+
var XRANGE_PLAIN = String.raw`[v=\s]*(${XRANGE_IDENTIFIER})(?:\.(${XRANGE_IDENTIFIER})(?:\.(${XRANGE_IDENTIFIER})(?:${PRERELEASE})?${BUILD}?)?)?`;
|
|
20
|
+
var XRANGE_PLAIN_LOOSE = String.raw`[v=\s]*(${XRANGE_IDENTIFIER_LOOSE})(?:\.(${XRANGE_IDENTIFIER_LOOSE})(?:\.(${XRANGE_IDENTIFIER_LOOSE})(?:${PRERELEASE_LOOSE})?${BUILD}?)?)?`;
|
|
21
|
+
var LONE_TILDE = "(?:~>?)";
|
|
22
|
+
var LONE_CARET = String.raw`(?:\^)`;
|
|
23
|
+
var COERCE_PLAIN = String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;
|
|
24
|
+
var COERCE = String.raw`${COERCE_PLAIN}(?:$|[^\d])`;
|
|
25
|
+
var COERCE_FULL = String.raw`${COERCE_PLAIN}(?:${PRERELEASE})?(?:${BUILD})?(?:$|[^\d])`;
|
|
26
|
+
function makeSafeRegexSource(source) {
|
|
27
|
+
const replacements = [
|
|
28
|
+
[String.raw`\s`, 1],
|
|
29
|
+
[String.raw`\d`, 256],
|
|
30
|
+
[LETTER_DASH_NUMBER, 250]
|
|
31
|
+
];
|
|
32
|
+
for (const [token, maximum] of replacements) source = source.split(`${token}*`).join(`${token}{0,${maximum}}`).split(`${token}+`).join(`${token}{1,${maximum}}`);
|
|
33
|
+
return source;
|
|
34
|
+
}
|
|
35
|
+
function safeRegex(source, flags) {
|
|
36
|
+
return new RegExp(makeSafeRegexSource(source), flags);
|
|
37
|
+
}
|
|
38
|
+
var FULL = safeRegex(`^${FULL_PLAIN}$`);
|
|
39
|
+
var LOOSE = safeRegex(`^${LOOSE_PLAIN}$`);
|
|
40
|
+
safeRegex(`^${PRERELEASE}$`);
|
|
41
|
+
safeRegex(`^${PRERELEASE_LOOSE}$`);
|
|
42
|
+
safeRegex(COERCE);
|
|
43
|
+
safeRegex(COERCE_FULL);
|
|
44
|
+
var NUMERIC = /^\d+$/;
|
|
45
|
+
function formatComparableVersion(version) {
|
|
46
|
+
const base = `${version.major}.${version.minor}.${version.patch}`;
|
|
47
|
+
return version.prerelease?.length ? `${base}-${version.prerelease.join(".")}` : base;
|
|
48
|
+
}
|
|
49
|
+
function parse(version, options = {}) {
|
|
50
|
+
if (typeof version !== "string") return version;
|
|
51
|
+
if (version.length > 256) throw new TypeError(`Version exceeds the maximum length of 256 characters`);
|
|
52
|
+
const match = version.trim().match(options.loose ? LOOSE : FULL);
|
|
53
|
+
if (!match) throw new TypeError(`Invalid version syntax: ${version}`);
|
|
54
|
+
const major = Number(match[1]);
|
|
55
|
+
const minor = Number(match[2]);
|
|
56
|
+
const patch = Number(match[3]);
|
|
57
|
+
if (major > Number.MAX_SAFE_INTEGER || major < 0) throw new TypeError(`Invalid major version: ${match[1]}`);
|
|
58
|
+
if (minor > Number.MAX_SAFE_INTEGER || minor < 0) throw new TypeError(`Invalid minor version: ${match[2]}`);
|
|
59
|
+
if (patch > Number.MAX_SAFE_INTEGER || patch < 0) throw new TypeError(`Invalid patch version: ${match[3]}`);
|
|
60
|
+
const prerelease = match[4] ? match[4].split(".").map((identifier) => {
|
|
61
|
+
if (NUMERIC.test(identifier)) {
|
|
62
|
+
const numeric = Number(identifier);
|
|
63
|
+
if (numeric >= 0 && numeric < Number.MAX_SAFE_INTEGER) return numeric;
|
|
64
|
+
}
|
|
65
|
+
return identifier;
|
|
66
|
+
}) : void 0;
|
|
67
|
+
return {
|
|
68
|
+
build: match[5]?.split("."),
|
|
69
|
+
major,
|
|
70
|
+
minor,
|
|
71
|
+
patch,
|
|
72
|
+
prerelease
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
var STRICT_COMPARATOR = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${FULL_PLAIN})$|^$`);
|
|
76
|
+
var LOOSE_COMPARATOR$1 = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${LOOSE_PLAIN})$|^$`);
|
|
77
|
+
function parseComparator(comparator, options = {}) {
|
|
78
|
+
const normalized = comparator.trim().replaceAll(/\s+/g, " ");
|
|
79
|
+
const match = normalized.match(options.loose ? LOOSE_COMPARATOR$1 : STRICT_COMPARATOR);
|
|
80
|
+
if (!match) throw new TypeError(`Invalid comparator: ${normalized}`);
|
|
81
|
+
const operator = match[1] === "=" ? "" : match[1] || "";
|
|
82
|
+
const version = match[2] ? parse(match[2], options) : null;
|
|
83
|
+
return {
|
|
84
|
+
operator,
|
|
85
|
+
options,
|
|
86
|
+
value: version ? `${operator}${formatComparableVersion(version)}` : "",
|
|
87
|
+
version
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
var BUILD_STRIP = new RegExp(BUILD, "g");
|
|
91
|
+
var BUILD_SAFE = safeRegex(BUILD);
|
|
92
|
+
var STRICT_HYPHEN = safeRegex(String.raw`^\s*(${XRANGE_PLAIN})\s+-\s+(${XRANGE_PLAIN})\s*$`);
|
|
93
|
+
var LOOSE_HYPHEN = safeRegex(String.raw`^\s*(${XRANGE_PLAIN_LOOSE})\s+-\s+(${XRANGE_PLAIN_LOOSE})\s*$`);
|
|
94
|
+
var COMPARATOR_TRIM = safeRegex(String.raw`(\s*)${GREATER_LESS_THAN}\s*(${LOOSE_PLAIN}|${XRANGE_PLAIN})`, "g");
|
|
95
|
+
var TILDE_TRIM = safeRegex(String.raw`(\s*)${LONE_TILDE}\s+`, "g");
|
|
96
|
+
var CARET_TRIM = safeRegex(String.raw`(\s*)${LONE_CARET}\s+`, "g");
|
|
97
|
+
var STRICT_TILDE = safeRegex(`^${LONE_TILDE}${XRANGE_PLAIN}$`);
|
|
98
|
+
var LOOSE_TILDE = safeRegex(`^${LONE_TILDE}${XRANGE_PLAIN_LOOSE}$`);
|
|
99
|
+
var STRICT_CARET = safeRegex(`^${LONE_CARET}${XRANGE_PLAIN}$`);
|
|
100
|
+
var LOOSE_CARET = safeRegex(`^${LONE_CARET}${XRANGE_PLAIN_LOOSE}$`);
|
|
101
|
+
var STRICT_XRANGE = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*${XRANGE_PLAIN}$`);
|
|
102
|
+
var LOOSE_XRANGE = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*${XRANGE_PLAIN_LOOSE}$`);
|
|
103
|
+
var STAR = safeRegex(String.raw`(<|>)?=?\s*\*`);
|
|
104
|
+
var GTE_ZERO = /^\s*>=\s*0\.0\.0\s*$/;
|
|
105
|
+
var GTE_ZERO_PRERELEASE = /^\s*>=\s*0\.0\.0-0\s*$/;
|
|
106
|
+
var LOOSE_COMPARATOR = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${LOOSE_PLAIN})$|^$`);
|
|
107
|
+
function isWildcard(value) {
|
|
108
|
+
return !value || String(value).toLowerCase() === "x" || String(value) === "*";
|
|
109
|
+
}
|
|
110
|
+
function hasInvalidWildcardOrder(major, minor, patch) {
|
|
111
|
+
return isWildcard(major) && !isWildcard(minor) || isWildcard(minor) && Boolean(patch) && !isWildcard(patch);
|
|
112
|
+
}
|
|
113
|
+
function replaceTilde(comparator, options) {
|
|
114
|
+
const expression = options.loose ? LOOSE_TILDE : STRICT_TILDE;
|
|
115
|
+
const lowerPrerelease = options.includePrerelease ? "-0" : "";
|
|
116
|
+
return comparator.replace(expression, (_match, major, minor, patch, prerelease) => {
|
|
117
|
+
if (isWildcard(major)) return "";
|
|
118
|
+
if (isWildcard(minor)) return `>=${major}.0.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
119
|
+
if (isWildcard(patch)) return `>=${major}.${minor}.0${lowerPrerelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
120
|
+
return prerelease ? `>=${major}.${minor}.${patch}-${prerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0`;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function replaceTildes(comparator, options) {
|
|
124
|
+
return comparator.trim().split(/\s+/).map((part) => replaceTilde(part, options)).join(" ");
|
|
125
|
+
}
|
|
126
|
+
function replaceCaret(comparator, options) {
|
|
127
|
+
const expression = options.loose ? LOOSE_CARET : STRICT_CARET;
|
|
128
|
+
const lowerPrerelease = options.includePrerelease ? "-0" : "";
|
|
129
|
+
return comparator.replace(expression, (_match, major, minor, patch, prerelease) => {
|
|
130
|
+
if (isWildcard(major)) return "";
|
|
131
|
+
if (isWildcard(minor)) return `>=${major}.0.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
132
|
+
if (isWildcard(patch)) return major === "0" ? `>=${major}.${minor}.0${lowerPrerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
133
|
+
if (prerelease) return major === "0" ? minor === "0" ? `>=${major}.${minor}.${patch}-${prerelease} <${major}.${minor}.${Number(patch) + 1}-0` : `>=${major}.${minor}.${patch}-${prerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch}-${prerelease} <${Number(major) + 1}.0.0-0`;
|
|
134
|
+
return major === "0" ? minor === "0" ? `>=${major}.${minor}.${patch} <${major}.${minor}.${Number(patch) + 1}-0` : `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch} <${Number(major) + 1}.0.0-0`;
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function replaceCarets(comparator, options) {
|
|
138
|
+
return comparator.trim().split(/\s+/).map((part) => replaceCaret(part, options)).join(" ");
|
|
139
|
+
}
|
|
140
|
+
function replaceXRange(comparator, options) {
|
|
141
|
+
const expression = options.loose ? LOOSE_XRANGE : STRICT_XRANGE;
|
|
142
|
+
return comparator.trim().replace(expression, (match, rawOperator, rawMajor, rawMinor, rawPatch) => {
|
|
143
|
+
let operator = rawOperator;
|
|
144
|
+
let major = rawMajor;
|
|
145
|
+
let minor = rawMinor;
|
|
146
|
+
let patch = rawPatch;
|
|
147
|
+
if (hasInvalidWildcardOrder(String(major), minor === void 0 ? void 0 : String(minor), patch === void 0 ? void 0 : String(patch))) return comparator;
|
|
148
|
+
const wildcardMajor = isWildcard(major);
|
|
149
|
+
const wildcardMinor = wildcardMajor || isWildcard(minor);
|
|
150
|
+
const wildcardPatch = wildcardMinor || isWildcard(patch);
|
|
151
|
+
if (operator === "=" && wildcardPatch) operator = "";
|
|
152
|
+
if (wildcardMajor) return operator === ">" || operator === "<" ? "<0.0.0-0" : "*";
|
|
153
|
+
let prerelease = options.includePrerelease ? "-0" : "";
|
|
154
|
+
if (operator && wildcardPatch) {
|
|
155
|
+
if (wildcardMinor) minor = 0;
|
|
156
|
+
patch = 0;
|
|
157
|
+
if (operator === ">") {
|
|
158
|
+
operator = ">=";
|
|
159
|
+
if (wildcardMinor) {
|
|
160
|
+
major = Number(major) + 1;
|
|
161
|
+
minor = 0;
|
|
162
|
+
} else minor = Number(minor) + 1;
|
|
163
|
+
} else if (operator === "<=") {
|
|
164
|
+
operator = "<";
|
|
165
|
+
if (wildcardMinor) major = Number(major) + 1;
|
|
166
|
+
else minor = Number(minor) + 1;
|
|
167
|
+
}
|
|
168
|
+
if (operator === "<") prerelease = "-0";
|
|
169
|
+
return `${operator}${major}.${minor}.${patch}${prerelease}`;
|
|
170
|
+
}
|
|
171
|
+
if (wildcardMinor) return `>=${major}.0.0${prerelease} <${Number(major) + 1}.0.0-0`;
|
|
172
|
+
if (wildcardPatch) return `>=${major}.${minor}.0${prerelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
173
|
+
return match;
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
function replaceXRanges(comparator, options) {
|
|
177
|
+
return comparator.split(/\s+/).map((part) => replaceXRange(part, options)).join(" ");
|
|
178
|
+
}
|
|
179
|
+
function replaceHyphenRange(range, options) {
|
|
180
|
+
const expression = options.loose ? LOOSE_HYPHEN : STRICT_HYPHEN;
|
|
181
|
+
return range.replace(expression, (_match, rawFrom, fromMajor, fromMinor, fromPatch, fromPrerelease, _fromBuild, rawTo, toMajor, toMinor, toPatch, toPrerelease) => {
|
|
182
|
+
let from = rawFrom;
|
|
183
|
+
let to = rawTo;
|
|
184
|
+
if (isWildcard(fromMajor)) from = "";
|
|
185
|
+
else if (isWildcard(fromMinor)) from = `>=${fromMajor}.0.0${options.includePrerelease ? "-0" : ""}`;
|
|
186
|
+
else if (isWildcard(fromPatch)) from = `>=${fromMajor}.${fromMinor}.0${options.includePrerelease ? "-0" : ""}`;
|
|
187
|
+
else if (fromPrerelease) from = `>=${from}`;
|
|
188
|
+
else from = `>=${from}${options.includePrerelease ? "-0" : ""}`;
|
|
189
|
+
if (isWildcard(toMajor)) to = "";
|
|
190
|
+
else if (isWildcard(toMinor)) to = `<${Number(toMajor) + 1}.0.0-0`;
|
|
191
|
+
else if (isWildcard(toPatch)) to = `<${toMajor}.${Number(toMinor) + 1}.0-0`;
|
|
192
|
+
else if (toPrerelease) to = `<=${toMajor}.${toMinor}.${toPatch}-${toPrerelease}`;
|
|
193
|
+
else if (options.includePrerelease) to = `<${toMajor}.${toMinor}.${Number(toPatch) + 1}-0`;
|
|
194
|
+
else to = `<=${to}`;
|
|
195
|
+
return `${from} ${to}`.trim();
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
function expandComparator(comparator, options) {
|
|
199
|
+
return replaceXRanges(replaceTildes(replaceCarets(comparator.replace(BUILD_SAFE, ""), options), options), options).trim().replace(STAR, "");
|
|
200
|
+
}
|
|
201
|
+
function parseSimpleRange(input, options) {
|
|
202
|
+
let parts = replaceHyphenRange(input.replace(BUILD_STRIP, ""), options).replace(COMPARATOR_TRIM, "$1$2$3").replace(TILDE_TRIM, "$1~").replace(CARET_TRIM, "$1^").split(" ").map((part) => expandComparator(part, options)).join(" ").split(/\s+/).map((part) => part.trim().replace(options.includePrerelease ? GTE_ZERO_PRERELEASE : GTE_ZERO, ""));
|
|
203
|
+
if (options.loose) parts = parts.filter((part) => LOOSE_COMPARATOR.test(part));
|
|
204
|
+
const unique = /* @__PURE__ */ new Map();
|
|
205
|
+
for (const comparator of parts.map((part) => parseComparator(part, options))) {
|
|
206
|
+
if (comparator.value === "<0.0.0-0") return [comparator];
|
|
207
|
+
unique.set(comparator.value, comparator);
|
|
208
|
+
}
|
|
209
|
+
if (unique.size > 1) unique.delete("");
|
|
210
|
+
return [...unique.values()];
|
|
211
|
+
}
|
|
212
|
+
function parseRange(range, options = {}) {
|
|
213
|
+
if (typeof range !== "string") return range;
|
|
214
|
+
const parsedOptions = { ...options };
|
|
215
|
+
const raw = range.trim().replaceAll(/\s+/g, " ");
|
|
216
|
+
let sets = raw.split("||").map((part) => parseSimpleRange(part.trim(), parsedOptions)).filter((set) => set.length);
|
|
217
|
+
if (!sets.length) throw new TypeError(`Range contains no valid comparator sets: ${raw}`);
|
|
218
|
+
if (sets.length > 1) {
|
|
219
|
+
const first = sets[0];
|
|
220
|
+
sets = sets.filter((set) => set[0]?.value !== "<0.0.0-0");
|
|
221
|
+
if (!sets.length) sets = [first];
|
|
222
|
+
else if (sets.length > 1) {
|
|
223
|
+
const any = sets.find((set) => set.length === 1 && set[0]?.value === "");
|
|
224
|
+
if (any) sets = [any];
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return {
|
|
228
|
+
normalized: sets.map((set) => set.map((comparator) => comparator.value).join(" ")).join("||"),
|
|
229
|
+
options: parsedOptions,
|
|
230
|
+
raw,
|
|
231
|
+
sets
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
function tryParseRange(range, options = {}) {
|
|
235
|
+
try {
|
|
236
|
+
return parseRange(range, options);
|
|
237
|
+
} catch {
|
|
238
|
+
return null;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
function normalizeRange(range, options = {}) {
|
|
242
|
+
const parsed = tryParseRange(range, options);
|
|
243
|
+
return parsed ? parsed.normalized || "*" : null;
|
|
244
|
+
}
|
|
245
|
+
//#endregion
|
|
246
|
+
export { normalizeRange as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as createServerFn, i as TSS_SERVER_FUNCTION } from "./createServerFn-DzU0k62V.mjs";
|
|
2
2
|
import { n as isRuntimeStoragePlugin } from "./storageProfile-FVkjPoGb.mjs";
|
|
3
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/api-rpc-
|
|
3
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/api-rpc-BIbDUKSz.js
|
|
4
4
|
var createServerRpc = (serverFnMeta, splitImportFn) => {
|
|
5
5
|
const url = "/_serverFn/" + serverFnMeta.id;
|
|
6
6
|
return Object.assign(splitImportFn, {
|
|
@@ -71,6 +71,7 @@ var getBundles = createServerFn({ method: "GET" }).inputValidator((input) => inp
|
|
|
71
71
|
const query = {
|
|
72
72
|
channel: data?.channel ?? void 0,
|
|
73
73
|
platform: data?.platform ?? void 0,
|
|
74
|
+
targetAppVersion: data?.targetAppVersion ?? void 0,
|
|
74
75
|
page: typeof data?.page === "number" && Number.isInteger(data.page) && data.page > 1 ? data.page : void 0,
|
|
75
76
|
limit: data?.limit ? Number(data.limit) : 20,
|
|
76
77
|
after: data?.after ?? void 0,
|
|
@@ -80,7 +81,8 @@ var getBundles = createServerFn({ method: "GET" }).inputValidator((input) => inp
|
|
|
80
81
|
const bundleQueryOptions = {
|
|
81
82
|
where: {
|
|
82
83
|
channel: query.channel,
|
|
83
|
-
platform: query.platform
|
|
84
|
+
platform: query.platform,
|
|
85
|
+
targetAppVersion: query.targetAppVersion
|
|
84
86
|
},
|
|
85
87
|
limit: query.limit,
|
|
86
88
|
page: query.page,
|
|
@@ -250,7 +252,7 @@ var deleteBundle_createServerFn_handler = createServerRpc({
|
|
|
250
252
|
var deleteBundle = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(deleteBundle_createServerFn_handler, async ({ data }) => {
|
|
251
253
|
try {
|
|
252
254
|
const { prepareConfig } = await import("./config.server-BSS366KT.mjs");
|
|
253
|
-
const { deleteBundle: deleteBundleWithStorage } = await import("./deleteBundle-
|
|
255
|
+
const { deleteBundle: deleteBundleWithStorage } = await import("./deleteBundle-BgbZTtpW.mjs");
|
|
254
256
|
const { databasePlugin, storagePlugin } = await prepareConfig();
|
|
255
257
|
await deleteBundleWithStorage(data, {
|
|
256
258
|
databasePlugin,
|
|
@@ -263,5 +265,28 @@ var deleteBundle = createServerFn({ method: "POST" }).inputValidator((input) =>
|
|
|
263
265
|
throw error;
|
|
264
266
|
}
|
|
265
267
|
});
|
|
268
|
+
var deleteBundles_createServerFn_handler = createServerRpc({
|
|
269
|
+
id: "61de3b69779c5ce2a5f5d3c27e2cfaca8fba8f14c8803559b9cd733c456494fa",
|
|
270
|
+
name: "deleteBundles",
|
|
271
|
+
filename: "src/lib/api-rpc.ts"
|
|
272
|
+
}, (opts) => deleteBundles.__executeServer(opts));
|
|
273
|
+
var deleteBundles = createServerFn({ method: "POST" }).inputValidator((input) => input).handler(deleteBundles_createServerFn_handler, async ({ data }) => {
|
|
274
|
+
try {
|
|
275
|
+
const { prepareConfig } = await import("./config.server-BSS366KT.mjs");
|
|
276
|
+
const { deleteBundles: deleteBundlesWithStorage } = await import("./deleteBundle-BgbZTtpW.mjs");
|
|
277
|
+
const { databasePlugin, storagePlugin } = await prepareConfig();
|
|
278
|
+
return {
|
|
279
|
+
success: true,
|
|
280
|
+
...await deleteBundlesWithStorage(data, {
|
|
281
|
+
databasePlugin,
|
|
282
|
+
storagePlugin,
|
|
283
|
+
waitForStorageCleanup: false
|
|
284
|
+
})
|
|
285
|
+
};
|
|
286
|
+
} catch (error) {
|
|
287
|
+
console.error("Error during bundle deletion:", error);
|
|
288
|
+
throw error;
|
|
289
|
+
}
|
|
290
|
+
});
|
|
266
291
|
//#endregion
|
|
267
|
-
export { createBundle_createServerFn_handler, deleteBundle_createServerFn_handler, getBundleChildCounts_createServerFn_handler, getBundleChildren_createServerFn_handler, getBundleDownloadUrl_createServerFn_handler, getBundle_createServerFn_handler, getBundles_createServerFn_handler, getChannels_createServerFn_handler, getConfigLoaded_createServerFn_handler, getConfig_createServerFn_handler, promoteBundle_createServerFn_handler, updateBundle_createServerFn_handler };
|
|
292
|
+
export { createBundle_createServerFn_handler, deleteBundle_createServerFn_handler, deleteBundles_createServerFn_handler, getBundleChildCounts_createServerFn_handler, getBundleChildren_createServerFn_handler, getBundleDownloadUrl_createServerFn_handler, getBundle_createServerFn_handler, getBundles_createServerFn_handler, getChannels_createServerFn_handler, getConfigLoaded_createServerFn_handler, getConfig_createServerFn_handler, promoteBundle_createServerFn_handler, updateBundle_createServerFn_handler };
|
|
@@ -2,7 +2,7 @@ import { a as getManifestStorageUri, i as getBundlePatches, r as getAssetBaseSto
|
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
5
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/deleteBundle-
|
|
5
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/deleteBundle-BgbZTtpW.js
|
|
6
6
|
var createStorageUriWithRelativePath = ({ baseStorageUri, relativePath }) => {
|
|
7
7
|
const storageUrl = new URL(baseStorageUri);
|
|
8
8
|
storageUrl.pathname = `${storageUrl.pathname.replace(/\/+$/, "")}/${relativePath.replace(/\\/g, "/").split("/").filter(Boolean).map((segment) => encodeURIComponent(segment)).join("/")}`;
|
|
@@ -58,58 +58,84 @@ async function loadBundleManifest(manifestStorageUri, storagePlugin) {
|
|
|
58
58
|
const manifestBytes = await downloadStorageBytes(manifestStorageUri, storagePlugin);
|
|
59
59
|
return JSON.parse(new TextDecoder().decode(manifestBytes));
|
|
60
60
|
}
|
|
61
|
-
async function
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
for (const
|
|
72
|
-
|
|
73
|
-
|
|
61
|
+
async function cleanupBundleStorage(bundle, storagePlugin) {
|
|
62
|
+
const cleanupUris = /* @__PURE__ */ new Set();
|
|
63
|
+
const addCleanupUri = (storageUri) => {
|
|
64
|
+
if (!storageUri) return;
|
|
65
|
+
const resolvedStorageUri = resolveStorageUriForDeletion(storageUri, storagePlugin);
|
|
66
|
+
if (resolvedStorageUri) cleanupUris.add(resolvedStorageUri);
|
|
67
|
+
};
|
|
68
|
+
addCleanupUri(bundle.storageUri);
|
|
69
|
+
addCleanupUri(getManifestStorageUri(bundle) ?? void 0);
|
|
70
|
+
addCleanupUri(getPatchStorageUri(bundle) ?? void 0);
|
|
71
|
+
for (const patch of getBundlePatches(bundle)) addCleanupUri(patch.patchStorageUri);
|
|
72
|
+
const manifestStorageUri = getManifestStorageUri(bundle);
|
|
73
|
+
const assetBaseStorageUri = getAssetBaseStorageUri(bundle);
|
|
74
|
+
if (assetBaseStorageUri) if (!manifestStorageUri) {
|
|
75
|
+
if (!isContentAddressedAssetBaseStorageUri(assetBaseStorageUri)) addCleanupUri(assetBaseStorageUri);
|
|
76
|
+
} else if (isContentAddressedAssetBaseStorageUri(assetBaseStorageUri)) {} else try {
|
|
77
|
+
const manifest = await loadBundleManifest(manifestStorageUri, storagePlugin);
|
|
78
|
+
for (const storageUri of getLegacyBundleAssetCleanupUris({
|
|
79
|
+
assetBaseStorageUri,
|
|
80
|
+
manifest
|
|
81
|
+
})) addCleanupUri(storageUri);
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.error("Failed to load bundle manifest for storage cleanup:", error);
|
|
84
|
+
if (!isContentAddressedAssetBaseStorageUri(assetBaseStorageUri)) addCleanupUri(assetBaseStorageUri);
|
|
85
|
+
}
|
|
86
|
+
if (cleanupUris.size === 0) return;
|
|
87
|
+
for (const storageUri of cleanupUris) try {
|
|
88
|
+
await storagePlugin.profiles.node.delete(storageUri);
|
|
89
|
+
} catch (error) {
|
|
90
|
+
console.error("Failed to delete bundle from storage:", error);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async function deleteBundles({ bundleIds }, { databasePlugin, storagePlugin, waitForStorageCleanup = true }) {
|
|
94
|
+
const uniqueBundleIds = [...new Set(bundleIds)];
|
|
95
|
+
const { data: matchedBundles } = await databasePlugin.getBundles({
|
|
96
|
+
where: { id: { in: uniqueBundleIds } },
|
|
97
|
+
limit: uniqueBundleIds.length
|
|
98
|
+
});
|
|
99
|
+
const matchedById = new Map(matchedBundles.map((bundle) => [bundle.id, bundle]));
|
|
100
|
+
const bundles = uniqueBundleIds.flatMap((bundleId) => {
|
|
101
|
+
const bundle = matchedById.get(bundleId);
|
|
102
|
+
return bundle ? [bundle] : [];
|
|
103
|
+
});
|
|
104
|
+
const missingBundleIds = uniqueBundleIds.filter((bundleId) => !matchedById.has(bundleId));
|
|
105
|
+
for (const bundle of bundles) {
|
|
106
|
+
const cleanupCandidates = [
|
|
107
|
+
bundle.storageUri,
|
|
108
|
+
getManifestStorageUri(bundle),
|
|
109
|
+
getAssetBaseStorageUri(bundle),
|
|
110
|
+
getPatchStorageUri(bundle),
|
|
111
|
+
...getBundlePatches(bundle).map((patch) => patch.patchStorageUri)
|
|
112
|
+
].filter((value) => Boolean(value));
|
|
113
|
+
for (const candidate of cleanupCandidates) resolveStorageUriForDeletion(candidate, storagePlugin);
|
|
114
|
+
}
|
|
115
|
+
if (bundles.length > 0) {
|
|
116
|
+
for (const bundle of bundles) await databasePlugin.deleteBundle(bundle);
|
|
117
|
+
await databasePlugin.commitBundle();
|
|
118
|
+
}
|
|
74
119
|
const cleanupStorage = async () => {
|
|
75
|
-
const
|
|
76
|
-
const addCleanupUri = (storageUri) => {
|
|
77
|
-
if (!storageUri) return;
|
|
78
|
-
const resolvedStorageUri = resolveStorageUriForDeletion(storageUri, storagePlugin);
|
|
79
|
-
if (resolvedStorageUri) cleanupUris.add(resolvedStorageUri);
|
|
80
|
-
};
|
|
81
|
-
addCleanupUri(bundle.storageUri);
|
|
82
|
-
addCleanupUri(getManifestStorageUri(bundle) ?? void 0);
|
|
83
|
-
addCleanupUri(getPatchStorageUri(bundle) ?? void 0);
|
|
84
|
-
for (const patch of getBundlePatches(bundle)) addCleanupUri(patch.patchStorageUri);
|
|
85
|
-
const manifestStorageUri = getManifestStorageUri(bundle);
|
|
86
|
-
const assetBaseStorageUri = getAssetBaseStorageUri(bundle);
|
|
87
|
-
if (assetBaseStorageUri) if (!manifestStorageUri) {
|
|
88
|
-
if (!isContentAddressedAssetBaseStorageUri(assetBaseStorageUri)) addCleanupUri(assetBaseStorageUri);
|
|
89
|
-
} else if (isContentAddressedAssetBaseStorageUri(assetBaseStorageUri)) {} else try {
|
|
90
|
-
const manifest = await loadBundleManifest(manifestStorageUri, storagePlugin);
|
|
91
|
-
for (const storageUri of getLegacyBundleAssetCleanupUris({
|
|
92
|
-
assetBaseStorageUri,
|
|
93
|
-
manifest
|
|
94
|
-
})) addCleanupUri(storageUri);
|
|
95
|
-
} catch (error) {
|
|
96
|
-
console.error("Failed to load bundle manifest for storage cleanup:", error);
|
|
97
|
-
if (!isContentAddressedAssetBaseStorageUri(assetBaseStorageUri)) addCleanupUri(assetBaseStorageUri);
|
|
98
|
-
}
|
|
99
|
-
if (cleanupUris.size === 0) return;
|
|
100
|
-
for (const storageUri of cleanupUris) try {
|
|
101
|
-
await storagePlugin.profiles.node.delete(storageUri);
|
|
102
|
-
} catch (error) {
|
|
103
|
-
console.error("Failed to delete bundle from storage:", error);
|
|
104
|
-
}
|
|
120
|
+
for (const bundle of bundles) await cleanupBundleStorage(bundle, storagePlugin);
|
|
105
121
|
};
|
|
106
122
|
if (waitForStorageCleanup) {
|
|
107
123
|
await cleanupStorage();
|
|
108
|
-
return
|
|
124
|
+
return {
|
|
125
|
+
deletedBundleIds: bundles.map((bundle) => bundle.id),
|
|
126
|
+
missingBundleIds
|
|
127
|
+
};
|
|
109
128
|
}
|
|
110
129
|
cleanupStorage().catch((error) => {
|
|
111
130
|
console.error("Failed to clean up bundle storage:", error);
|
|
112
131
|
});
|
|
132
|
+
return {
|
|
133
|
+
deletedBundleIds: bundles.map((bundle) => bundle.id),
|
|
134
|
+
missingBundleIds
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
async function deleteBundle({ bundleId }, dependencies) {
|
|
138
|
+
if ((await deleteBundles({ bundleIds: [bundleId] }, dependencies)).missingBundleIds.length > 0) throw new Error(`Bundle not found: ${bundleId}`);
|
|
113
139
|
}
|
|
114
140
|
//#endregion
|
|
115
|
-
export { deleteBundle };
|
|
141
|
+
export { deleteBundle, deleteBundles };
|
|
@@ -8,7 +8,7 @@ import { t as QueryClient } from "../_libs/tanstack__query-core.mjs";
|
|
|
8
8
|
import { r as QueryClientProvider } from "../_libs/tanstack__react-query.mjs";
|
|
9
9
|
import { t as z } from "../_libs/next-themes.mjs";
|
|
10
10
|
import { t as Toaster } from "../_libs/sonner.mjs";
|
|
11
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/router-
|
|
11
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/router-C3hqEy3k.js
|
|
12
12
|
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
13
13
|
var import_jsx_runtime = require_jsx_runtime();
|
|
14
14
|
function HotUpdaterLogo({ className }) {
|
|
@@ -118,6 +118,7 @@ function AppSidebar() {
|
|
|
118
118
|
search: {
|
|
119
119
|
channel: void 0,
|
|
120
120
|
platform: void 0,
|
|
121
|
+
targetAppVersion: void 0,
|
|
121
122
|
page: void 0,
|
|
122
123
|
after: void 0,
|
|
123
124
|
before: void 0,
|
|
@@ -146,6 +147,7 @@ function AppSidebar() {
|
|
|
146
147
|
search: {
|
|
147
148
|
channel: void 0,
|
|
148
149
|
platform: void 0,
|
|
150
|
+
targetAppVersion: void 0,
|
|
149
151
|
page: void 0,
|
|
150
152
|
after: void 0,
|
|
151
153
|
before: void 0,
|
|
@@ -166,6 +168,7 @@ function AppSidebar() {
|
|
|
166
168
|
var homeSearch = {
|
|
167
169
|
channel: void 0,
|
|
168
170
|
platform: void 0,
|
|
171
|
+
targetAppVersion: void 0,
|
|
169
172
|
page: void 0,
|
|
170
173
|
after: void 0,
|
|
171
174
|
before: void 0,
|
|
@@ -215,7 +218,7 @@ var Toaster$1 = ({ ...props }) => {
|
|
|
215
218
|
...props
|
|
216
219
|
});
|
|
217
220
|
};
|
|
218
|
-
var styles_default = "/assets/styles-
|
|
221
|
+
var styles_default = "/assets/styles-C0Re4quB.css";
|
|
219
222
|
var Route$1 = createRootRoute({
|
|
220
223
|
head: () => ({
|
|
221
224
|
meta: [
|
|
@@ -270,7 +273,7 @@ function RootLayout() {
|
|
|
270
273
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Outlet, {})
|
|
271
274
|
})] });
|
|
272
275
|
}
|
|
273
|
-
var $$splitComponentImporter = () => import("./routes-
|
|
276
|
+
var $$splitComponentImporter = () => import("./routes-B0lQvvlC.mjs");
|
|
274
277
|
var rootRouteChildren = { IndexRoute: createFileRoute("/")({
|
|
275
278
|
component: lazyRouteComponent($$splitComponentImporter, "component"),
|
|
276
279
|
validateSearch: (search) => {
|
|
@@ -278,6 +281,7 @@ var rootRouteChildren = { IndexRoute: createFileRoute("/")({
|
|
|
278
281
|
return {
|
|
279
282
|
channel: search.channel,
|
|
280
283
|
platform: search.platform,
|
|
284
|
+
targetAppVersion: search.targetAppVersion,
|
|
281
285
|
page: parsedPage !== void 0 && Number.isInteger(parsedPage) && parsedPage > 1 ? parsedPage : void 0,
|
|
282
286
|
after: search.after,
|
|
283
287
|
before: search.before,
|