@hot-updater/firebase 0.17.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/firebase/firestore.indexes.json +11 -0
- package/dist/firebase/functions/index.cjs +5107 -0
- package/dist/iac/index.cjs +8187 -8719
- package/dist/iac/index.d.cts +8 -4
- package/dist/iac/index.d.ts +8 -4
- package/dist/iac/index.js +8190 -8727
- package/dist/index.cjs +1534 -353
- package/dist/index.d.cts +12 -7
- package/dist/index.d.ts +12 -7
- package/dist/index.js +1518 -322
- package/package.json +6 -6
- package/dist/firebase/index.cjs +0 -3167
package/dist/firebase/index.cjs
DELETED
|
@@ -1,3167 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// firebase/functions/index.ts
|
|
31
|
-
var index_exports = {};
|
|
32
|
-
__export(index_exports, {
|
|
33
|
-
hot: () => hot
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(index_exports);
|
|
36
|
-
|
|
37
|
-
// ../../packages/core/dist/index.js
|
|
38
|
-
var NIL_UUID = "00000000-0000-0000-0000-000000000000";
|
|
39
|
-
|
|
40
|
-
// firebase/functions/index.ts
|
|
41
|
-
var admin = __toESM(require("firebase-admin"), 1);
|
|
42
|
-
|
|
43
|
-
// ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/body.js
|
|
44
|
-
var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
|
|
45
|
-
const { all = false, dot = false } = options;
|
|
46
|
-
const headers = request instanceof HonoRequest ? request.raw.headers : request.headers;
|
|
47
|
-
const contentType = headers.get("Content-Type");
|
|
48
|
-
if (contentType?.startsWith("multipart/form-data") || contentType?.startsWith("application/x-www-form-urlencoded")) {
|
|
49
|
-
return parseFormData(request, { all, dot });
|
|
50
|
-
}
|
|
51
|
-
return {};
|
|
52
|
-
};
|
|
53
|
-
async function parseFormData(request, options) {
|
|
54
|
-
const formData = await request.formData();
|
|
55
|
-
if (formData) {
|
|
56
|
-
return convertFormDataToBodyData(formData, options);
|
|
57
|
-
}
|
|
58
|
-
return {};
|
|
59
|
-
}
|
|
60
|
-
function convertFormDataToBodyData(formData, options) {
|
|
61
|
-
const form = /* @__PURE__ */ Object.create(null);
|
|
62
|
-
formData.forEach((value, key) => {
|
|
63
|
-
const shouldParseAllValues = options.all || key.endsWith("[]");
|
|
64
|
-
if (!shouldParseAllValues) {
|
|
65
|
-
form[key] = value;
|
|
66
|
-
} else {
|
|
67
|
-
handleParsingAllValues(form, key, value);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
if (options.dot) {
|
|
71
|
-
Object.entries(form).forEach(([key, value]) => {
|
|
72
|
-
const shouldParseDotValues = key.includes(".");
|
|
73
|
-
if (shouldParseDotValues) {
|
|
74
|
-
handleParsingNestedValues(form, key, value);
|
|
75
|
-
delete form[key];
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
return form;
|
|
80
|
-
}
|
|
81
|
-
var handleParsingAllValues = (form, key, value) => {
|
|
82
|
-
if (form[key] !== void 0) {
|
|
83
|
-
if (Array.isArray(form[key])) {
|
|
84
|
-
;
|
|
85
|
-
form[key].push(value);
|
|
86
|
-
} else {
|
|
87
|
-
form[key] = [form[key], value];
|
|
88
|
-
}
|
|
89
|
-
} else {
|
|
90
|
-
form[key] = value;
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
var handleParsingNestedValues = (form, key, value) => {
|
|
94
|
-
let nestedForm = form;
|
|
95
|
-
const keys = key.split(".");
|
|
96
|
-
keys.forEach((key2, index) => {
|
|
97
|
-
if (index === keys.length - 1) {
|
|
98
|
-
nestedForm[key2] = value;
|
|
99
|
-
} else {
|
|
100
|
-
if (!nestedForm[key2] || typeof nestedForm[key2] !== "object" || Array.isArray(nestedForm[key2]) || nestedForm[key2] instanceof File) {
|
|
101
|
-
nestedForm[key2] = /* @__PURE__ */ Object.create(null);
|
|
102
|
-
}
|
|
103
|
-
nestedForm = nestedForm[key2];
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
// ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/url.js
|
|
109
|
-
var splitPath = (path) => {
|
|
110
|
-
const paths = path.split("/");
|
|
111
|
-
if (paths[0] === "") {
|
|
112
|
-
paths.shift();
|
|
113
|
-
}
|
|
114
|
-
return paths;
|
|
115
|
-
};
|
|
116
|
-
var splitRoutingPath = (routePath) => {
|
|
117
|
-
const { groups, path } = extractGroupsFromPath(routePath);
|
|
118
|
-
const paths = splitPath(path);
|
|
119
|
-
return replaceGroupMarks(paths, groups);
|
|
120
|
-
};
|
|
121
|
-
var extractGroupsFromPath = (path) => {
|
|
122
|
-
const groups = [];
|
|
123
|
-
path = path.replace(/\{[^}]+\}/g, (match, index) => {
|
|
124
|
-
const mark = `@${index}`;
|
|
125
|
-
groups.push([mark, match]);
|
|
126
|
-
return mark;
|
|
127
|
-
});
|
|
128
|
-
return { groups, path };
|
|
129
|
-
};
|
|
130
|
-
var replaceGroupMarks = (paths, groups) => {
|
|
131
|
-
for (let i = groups.length - 1; i >= 0; i--) {
|
|
132
|
-
const [mark] = groups[i];
|
|
133
|
-
for (let j = paths.length - 1; j >= 0; j--) {
|
|
134
|
-
if (paths[j].includes(mark)) {
|
|
135
|
-
paths[j] = paths[j].replace(mark, groups[i][1]);
|
|
136
|
-
break;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return paths;
|
|
141
|
-
};
|
|
142
|
-
var patternCache = {};
|
|
143
|
-
var getPattern = (label) => {
|
|
144
|
-
if (label === "*") {
|
|
145
|
-
return "*";
|
|
146
|
-
}
|
|
147
|
-
const match = label.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);
|
|
148
|
-
if (match) {
|
|
149
|
-
if (!patternCache[label]) {
|
|
150
|
-
if (match[2]) {
|
|
151
|
-
patternCache[label] = [label, match[1], new RegExp("^" + match[2] + "$")];
|
|
152
|
-
} else {
|
|
153
|
-
patternCache[label] = [label, match[1], true];
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
return patternCache[label];
|
|
157
|
-
}
|
|
158
|
-
return null;
|
|
159
|
-
};
|
|
160
|
-
var tryDecodeURI = (str) => {
|
|
161
|
-
try {
|
|
162
|
-
return decodeURI(str);
|
|
163
|
-
} catch {
|
|
164
|
-
return str.replace(/(?:%[0-9A-Fa-f]{2})+/g, (match) => {
|
|
165
|
-
try {
|
|
166
|
-
return decodeURI(match);
|
|
167
|
-
} catch {
|
|
168
|
-
return match;
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
var getPath = (request) => {
|
|
174
|
-
const url = request.url;
|
|
175
|
-
const start = url.indexOf("/", 8);
|
|
176
|
-
let i = start;
|
|
177
|
-
for (; i < url.length; i++) {
|
|
178
|
-
const charCode = url.charCodeAt(i);
|
|
179
|
-
if (charCode === 37) {
|
|
180
|
-
const queryIndex = url.indexOf("?", i);
|
|
181
|
-
const path = url.slice(start, queryIndex === -1 ? void 0 : queryIndex);
|
|
182
|
-
return tryDecodeURI(path.includes("%25") ? path.replace(/%25/g, "%2525") : path);
|
|
183
|
-
} else if (charCode === 63) {
|
|
184
|
-
break;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
return url.slice(start, i);
|
|
188
|
-
};
|
|
189
|
-
var getPathNoStrict = (request) => {
|
|
190
|
-
const result = getPath(request);
|
|
191
|
-
return result.length > 1 && result[result.length - 1] === "/" ? result.slice(0, -1) : result;
|
|
192
|
-
};
|
|
193
|
-
var mergePath = (...paths) => {
|
|
194
|
-
let p = "";
|
|
195
|
-
let endsWithSlash = false;
|
|
196
|
-
for (let path of paths) {
|
|
197
|
-
if (p[p.length - 1] === "/") {
|
|
198
|
-
p = p.slice(0, -1);
|
|
199
|
-
endsWithSlash = true;
|
|
200
|
-
}
|
|
201
|
-
if (path[0] !== "/") {
|
|
202
|
-
path = `/${path}`;
|
|
203
|
-
}
|
|
204
|
-
if (path === "/" && endsWithSlash) {
|
|
205
|
-
p = `${p}/`;
|
|
206
|
-
} else if (path !== "/") {
|
|
207
|
-
p = `${p}${path}`;
|
|
208
|
-
}
|
|
209
|
-
if (path === "/" && p === "") {
|
|
210
|
-
p = "/";
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
return p;
|
|
214
|
-
};
|
|
215
|
-
var checkOptionalParameter = (path) => {
|
|
216
|
-
if (!path.match(/\:.+\?$/)) {
|
|
217
|
-
return null;
|
|
218
|
-
}
|
|
219
|
-
const segments = path.split("/");
|
|
220
|
-
const results = [];
|
|
221
|
-
let basePath = "";
|
|
222
|
-
segments.forEach((segment) => {
|
|
223
|
-
if (segment !== "" && !/\:/.test(segment)) {
|
|
224
|
-
basePath += "/" + segment;
|
|
225
|
-
} else if (/\:/.test(segment)) {
|
|
226
|
-
if (/\?/.test(segment)) {
|
|
227
|
-
if (results.length === 0 && basePath === "") {
|
|
228
|
-
results.push("/");
|
|
229
|
-
} else {
|
|
230
|
-
results.push(basePath);
|
|
231
|
-
}
|
|
232
|
-
const optionalSegment = segment.replace("?", "");
|
|
233
|
-
basePath += "/" + optionalSegment;
|
|
234
|
-
results.push(basePath);
|
|
235
|
-
} else {
|
|
236
|
-
basePath += "/" + segment;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
return results.filter((v, i, a) => a.indexOf(v) === i);
|
|
241
|
-
};
|
|
242
|
-
var _decodeURI = (value) => {
|
|
243
|
-
if (!/[%+]/.test(value)) {
|
|
244
|
-
return value;
|
|
245
|
-
}
|
|
246
|
-
if (value.indexOf("+") !== -1) {
|
|
247
|
-
value = value.replace(/\+/g, " ");
|
|
248
|
-
}
|
|
249
|
-
return /%/.test(value) ? decodeURIComponent_(value) : value;
|
|
250
|
-
};
|
|
251
|
-
var _getQueryParam = (url, key, multiple) => {
|
|
252
|
-
let encoded;
|
|
253
|
-
if (!multiple && key && !/[%+]/.test(key)) {
|
|
254
|
-
let keyIndex2 = url.indexOf(`?${key}`, 8);
|
|
255
|
-
if (keyIndex2 === -1) {
|
|
256
|
-
keyIndex2 = url.indexOf(`&${key}`, 8);
|
|
257
|
-
}
|
|
258
|
-
while (keyIndex2 !== -1) {
|
|
259
|
-
const trailingKeyCode = url.charCodeAt(keyIndex2 + key.length + 1);
|
|
260
|
-
if (trailingKeyCode === 61) {
|
|
261
|
-
const valueIndex = keyIndex2 + key.length + 2;
|
|
262
|
-
const endIndex = url.indexOf("&", valueIndex);
|
|
263
|
-
return _decodeURI(url.slice(valueIndex, endIndex === -1 ? void 0 : endIndex));
|
|
264
|
-
} else if (trailingKeyCode == 38 || isNaN(trailingKeyCode)) {
|
|
265
|
-
return "";
|
|
266
|
-
}
|
|
267
|
-
keyIndex2 = url.indexOf(`&${key}`, keyIndex2 + 1);
|
|
268
|
-
}
|
|
269
|
-
encoded = /[%+]/.test(url);
|
|
270
|
-
if (!encoded) {
|
|
271
|
-
return void 0;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
const results = {};
|
|
275
|
-
encoded ??= /[%+]/.test(url);
|
|
276
|
-
let keyIndex = url.indexOf("?", 8);
|
|
277
|
-
while (keyIndex !== -1) {
|
|
278
|
-
const nextKeyIndex = url.indexOf("&", keyIndex + 1);
|
|
279
|
-
let valueIndex = url.indexOf("=", keyIndex);
|
|
280
|
-
if (valueIndex > nextKeyIndex && nextKeyIndex !== -1) {
|
|
281
|
-
valueIndex = -1;
|
|
282
|
-
}
|
|
283
|
-
let name = url.slice(
|
|
284
|
-
keyIndex + 1,
|
|
285
|
-
valueIndex === -1 ? nextKeyIndex === -1 ? void 0 : nextKeyIndex : valueIndex
|
|
286
|
-
);
|
|
287
|
-
if (encoded) {
|
|
288
|
-
name = _decodeURI(name);
|
|
289
|
-
}
|
|
290
|
-
keyIndex = nextKeyIndex;
|
|
291
|
-
if (name === "") {
|
|
292
|
-
continue;
|
|
293
|
-
}
|
|
294
|
-
let value;
|
|
295
|
-
if (valueIndex === -1) {
|
|
296
|
-
value = "";
|
|
297
|
-
} else {
|
|
298
|
-
value = url.slice(valueIndex + 1, nextKeyIndex === -1 ? void 0 : nextKeyIndex);
|
|
299
|
-
if (encoded) {
|
|
300
|
-
value = _decodeURI(value);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
if (multiple) {
|
|
304
|
-
if (!(results[name] && Array.isArray(results[name]))) {
|
|
305
|
-
results[name] = [];
|
|
306
|
-
}
|
|
307
|
-
;
|
|
308
|
-
results[name].push(value);
|
|
309
|
-
} else {
|
|
310
|
-
results[name] ??= value;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
return key ? results[key] : results;
|
|
314
|
-
};
|
|
315
|
-
var getQueryParam = _getQueryParam;
|
|
316
|
-
var getQueryParams = (url, key) => {
|
|
317
|
-
return _getQueryParam(url, key, true);
|
|
318
|
-
};
|
|
319
|
-
var decodeURIComponent_ = decodeURIComponent;
|
|
320
|
-
|
|
321
|
-
// ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/request.js
|
|
322
|
-
var HonoRequest = class {
|
|
323
|
-
raw;
|
|
324
|
-
#validatedData;
|
|
325
|
-
#matchResult;
|
|
326
|
-
routeIndex = 0;
|
|
327
|
-
path;
|
|
328
|
-
bodyCache = {};
|
|
329
|
-
constructor(request, path = "/", matchResult = [[]]) {
|
|
330
|
-
this.raw = request;
|
|
331
|
-
this.path = path;
|
|
332
|
-
this.#matchResult = matchResult;
|
|
333
|
-
this.#validatedData = {};
|
|
334
|
-
}
|
|
335
|
-
param(key) {
|
|
336
|
-
return key ? this.getDecodedParam(key) : this.getAllDecodedParams();
|
|
337
|
-
}
|
|
338
|
-
getDecodedParam(key) {
|
|
339
|
-
const paramKey = this.#matchResult[0][this.routeIndex][1][key];
|
|
340
|
-
const param = this.getParamValue(paramKey);
|
|
341
|
-
return param ? /\%/.test(param) ? decodeURIComponent_(param) : param : void 0;
|
|
342
|
-
}
|
|
343
|
-
getAllDecodedParams() {
|
|
344
|
-
const decoded = {};
|
|
345
|
-
const keys = Object.keys(this.#matchResult[0][this.routeIndex][1]);
|
|
346
|
-
for (const key of keys) {
|
|
347
|
-
const value = this.getParamValue(this.#matchResult[0][this.routeIndex][1][key]);
|
|
348
|
-
if (value && typeof value === "string") {
|
|
349
|
-
decoded[key] = /\%/.test(value) ? decodeURIComponent_(value) : value;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
return decoded;
|
|
353
|
-
}
|
|
354
|
-
getParamValue(paramKey) {
|
|
355
|
-
return this.#matchResult[1] ? this.#matchResult[1][paramKey] : paramKey;
|
|
356
|
-
}
|
|
357
|
-
query(key) {
|
|
358
|
-
return getQueryParam(this.url, key);
|
|
359
|
-
}
|
|
360
|
-
queries(key) {
|
|
361
|
-
return getQueryParams(this.url, key);
|
|
362
|
-
}
|
|
363
|
-
header(name) {
|
|
364
|
-
if (name) {
|
|
365
|
-
return this.raw.headers.get(name.toLowerCase()) ?? void 0;
|
|
366
|
-
}
|
|
367
|
-
const headerData = {};
|
|
368
|
-
this.raw.headers.forEach((value, key) => {
|
|
369
|
-
headerData[key] = value;
|
|
370
|
-
});
|
|
371
|
-
return headerData;
|
|
372
|
-
}
|
|
373
|
-
async parseBody(options) {
|
|
374
|
-
return this.bodyCache.parsedBody ??= await parseBody(this, options);
|
|
375
|
-
}
|
|
376
|
-
cachedBody = (key) => {
|
|
377
|
-
const { bodyCache, raw: raw2 } = this;
|
|
378
|
-
const cachedBody = bodyCache[key];
|
|
379
|
-
if (cachedBody) {
|
|
380
|
-
return cachedBody;
|
|
381
|
-
}
|
|
382
|
-
const anyCachedKey = Object.keys(bodyCache)[0];
|
|
383
|
-
if (anyCachedKey) {
|
|
384
|
-
return bodyCache[anyCachedKey].then((body) => {
|
|
385
|
-
if (anyCachedKey === "json") {
|
|
386
|
-
body = JSON.stringify(body);
|
|
387
|
-
}
|
|
388
|
-
return new Response(body)[key]();
|
|
389
|
-
});
|
|
390
|
-
}
|
|
391
|
-
return bodyCache[key] = raw2[key]();
|
|
392
|
-
};
|
|
393
|
-
json() {
|
|
394
|
-
return this.cachedBody("json");
|
|
395
|
-
}
|
|
396
|
-
text() {
|
|
397
|
-
return this.cachedBody("text");
|
|
398
|
-
}
|
|
399
|
-
arrayBuffer() {
|
|
400
|
-
return this.cachedBody("arrayBuffer");
|
|
401
|
-
}
|
|
402
|
-
blob() {
|
|
403
|
-
return this.cachedBody("blob");
|
|
404
|
-
}
|
|
405
|
-
formData() {
|
|
406
|
-
return this.cachedBody("formData");
|
|
407
|
-
}
|
|
408
|
-
addValidatedData(target, data) {
|
|
409
|
-
this.#validatedData[target] = data;
|
|
410
|
-
}
|
|
411
|
-
valid(target) {
|
|
412
|
-
return this.#validatedData[target];
|
|
413
|
-
}
|
|
414
|
-
get url() {
|
|
415
|
-
return this.raw.url;
|
|
416
|
-
}
|
|
417
|
-
get method() {
|
|
418
|
-
return this.raw.method;
|
|
419
|
-
}
|
|
420
|
-
get matchedRoutes() {
|
|
421
|
-
return this.#matchResult[0].map(([[, route]]) => route);
|
|
422
|
-
}
|
|
423
|
-
get routePath() {
|
|
424
|
-
return this.#matchResult[0].map(([[, route]]) => route)[this.routeIndex].path;
|
|
425
|
-
}
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
// ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/html.js
|
|
429
|
-
var HtmlEscapedCallbackPhase = {
|
|
430
|
-
Stringify: 1,
|
|
431
|
-
BeforeStream: 2,
|
|
432
|
-
Stream: 3
|
|
433
|
-
};
|
|
434
|
-
var raw = (value, callbacks) => {
|
|
435
|
-
const escapedString = new String(value);
|
|
436
|
-
escapedString.isEscaped = true;
|
|
437
|
-
escapedString.callbacks = callbacks;
|
|
438
|
-
return escapedString;
|
|
439
|
-
};
|
|
440
|
-
var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => {
|
|
441
|
-
if (typeof str === "object" && !(str instanceof String)) {
|
|
442
|
-
if (!(str instanceof Promise)) {
|
|
443
|
-
str = str.toString();
|
|
444
|
-
}
|
|
445
|
-
if (str instanceof Promise) {
|
|
446
|
-
str = await str;
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
const callbacks = str.callbacks;
|
|
450
|
-
if (!callbacks?.length) {
|
|
451
|
-
return Promise.resolve(str);
|
|
452
|
-
}
|
|
453
|
-
if (buffer) {
|
|
454
|
-
buffer[0] += str;
|
|
455
|
-
} else {
|
|
456
|
-
buffer = [str];
|
|
457
|
-
}
|
|
458
|
-
const resStr = Promise.all(callbacks.map((c) => c({ phase, buffer, context }))).then(
|
|
459
|
-
(res) => Promise.all(
|
|
460
|
-
res.filter(Boolean).map((str2) => resolveCallback(str2, phase, false, context, buffer))
|
|
461
|
-
).then(() => buffer[0])
|
|
462
|
-
);
|
|
463
|
-
if (preserveCallbacks) {
|
|
464
|
-
return raw(await resStr, callbacks);
|
|
465
|
-
} else {
|
|
466
|
-
return resStr;
|
|
467
|
-
}
|
|
468
|
-
};
|
|
469
|
-
|
|
470
|
-
// ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/context.js
|
|
471
|
-
var TEXT_PLAIN = "text/plain; charset=UTF-8";
|
|
472
|
-
var setHeaders = (headers, map = {}) => {
|
|
473
|
-
Object.entries(map).forEach(([key, value]) => headers.set(key, value));
|
|
474
|
-
return headers;
|
|
475
|
-
};
|
|
476
|
-
var Context = class {
|
|
477
|
-
#rawRequest;
|
|
478
|
-
#req;
|
|
479
|
-
env = {};
|
|
480
|
-
#var;
|
|
481
|
-
finalized = false;
|
|
482
|
-
error;
|
|
483
|
-
#status = 200;
|
|
484
|
-
#executionCtx;
|
|
485
|
-
#headers;
|
|
486
|
-
#preparedHeaders;
|
|
487
|
-
#res;
|
|
488
|
-
#isFresh = true;
|
|
489
|
-
#layout;
|
|
490
|
-
#renderer;
|
|
491
|
-
#notFoundHandler;
|
|
492
|
-
#matchResult;
|
|
493
|
-
#path;
|
|
494
|
-
constructor(req, options) {
|
|
495
|
-
this.#rawRequest = req;
|
|
496
|
-
if (options) {
|
|
497
|
-
this.#executionCtx = options.executionCtx;
|
|
498
|
-
this.env = options.env;
|
|
499
|
-
this.#notFoundHandler = options.notFoundHandler;
|
|
500
|
-
this.#path = options.path;
|
|
501
|
-
this.#matchResult = options.matchResult;
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
get req() {
|
|
505
|
-
this.#req ??= new HonoRequest(this.#rawRequest, this.#path, this.#matchResult);
|
|
506
|
-
return this.#req;
|
|
507
|
-
}
|
|
508
|
-
get event() {
|
|
509
|
-
if (this.#executionCtx && "respondWith" in this.#executionCtx) {
|
|
510
|
-
return this.#executionCtx;
|
|
511
|
-
} else {
|
|
512
|
-
throw Error("This context has no FetchEvent");
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
get executionCtx() {
|
|
516
|
-
if (this.#executionCtx) {
|
|
517
|
-
return this.#executionCtx;
|
|
518
|
-
} else {
|
|
519
|
-
throw Error("This context has no ExecutionContext");
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
get res() {
|
|
523
|
-
this.#isFresh = false;
|
|
524
|
-
return this.#res ||= new Response("404 Not Found", { status: 404 });
|
|
525
|
-
}
|
|
526
|
-
set res(_res) {
|
|
527
|
-
this.#isFresh = false;
|
|
528
|
-
if (this.#res && _res) {
|
|
529
|
-
try {
|
|
530
|
-
for (const [k, v] of this.#res.headers.entries()) {
|
|
531
|
-
if (k === "content-type") {
|
|
532
|
-
continue;
|
|
533
|
-
}
|
|
534
|
-
if (k === "set-cookie") {
|
|
535
|
-
const cookies = this.#res.headers.getSetCookie();
|
|
536
|
-
_res.headers.delete("set-cookie");
|
|
537
|
-
for (const cookie of cookies) {
|
|
538
|
-
_res.headers.append("set-cookie", cookie);
|
|
539
|
-
}
|
|
540
|
-
} else {
|
|
541
|
-
_res.headers.set(k, v);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
} catch (e) {
|
|
545
|
-
if (e instanceof TypeError && e.message.includes("immutable")) {
|
|
546
|
-
this.res = new Response(_res.body, {
|
|
547
|
-
headers: _res.headers,
|
|
548
|
-
status: _res.status
|
|
549
|
-
});
|
|
550
|
-
return;
|
|
551
|
-
} else {
|
|
552
|
-
throw e;
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
this.#res = _res;
|
|
557
|
-
this.finalized = true;
|
|
558
|
-
}
|
|
559
|
-
render = (...args) => {
|
|
560
|
-
this.#renderer ??= (content) => this.html(content);
|
|
561
|
-
return this.#renderer(...args);
|
|
562
|
-
};
|
|
563
|
-
setLayout = (layout) => this.#layout = layout;
|
|
564
|
-
getLayout = () => this.#layout;
|
|
565
|
-
setRenderer = (renderer) => {
|
|
566
|
-
this.#renderer = renderer;
|
|
567
|
-
};
|
|
568
|
-
header = (name, value, options) => {
|
|
569
|
-
if (value === void 0) {
|
|
570
|
-
if (this.#headers) {
|
|
571
|
-
this.#headers.delete(name);
|
|
572
|
-
} else if (this.#preparedHeaders) {
|
|
573
|
-
delete this.#preparedHeaders[name.toLocaleLowerCase()];
|
|
574
|
-
}
|
|
575
|
-
if (this.finalized) {
|
|
576
|
-
this.res.headers.delete(name);
|
|
577
|
-
}
|
|
578
|
-
return;
|
|
579
|
-
}
|
|
580
|
-
if (options?.append) {
|
|
581
|
-
if (!this.#headers) {
|
|
582
|
-
this.#isFresh = false;
|
|
583
|
-
this.#headers = new Headers(this.#preparedHeaders);
|
|
584
|
-
this.#preparedHeaders = {};
|
|
585
|
-
}
|
|
586
|
-
this.#headers.append(name, value);
|
|
587
|
-
} else {
|
|
588
|
-
if (this.#headers) {
|
|
589
|
-
this.#headers.set(name, value);
|
|
590
|
-
} else {
|
|
591
|
-
this.#preparedHeaders ??= {};
|
|
592
|
-
this.#preparedHeaders[name.toLowerCase()] = value;
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
if (this.finalized) {
|
|
596
|
-
if (options?.append) {
|
|
597
|
-
this.res.headers.append(name, value);
|
|
598
|
-
} else {
|
|
599
|
-
this.res.headers.set(name, value);
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
};
|
|
603
|
-
status = (status) => {
|
|
604
|
-
this.#isFresh = false;
|
|
605
|
-
this.#status = status;
|
|
606
|
-
};
|
|
607
|
-
set = (key, value) => {
|
|
608
|
-
this.#var ??= /* @__PURE__ */ new Map();
|
|
609
|
-
this.#var.set(key, value);
|
|
610
|
-
};
|
|
611
|
-
get = (key) => {
|
|
612
|
-
return this.#var ? this.#var.get(key) : void 0;
|
|
613
|
-
};
|
|
614
|
-
get var() {
|
|
615
|
-
if (!this.#var) {
|
|
616
|
-
return {};
|
|
617
|
-
}
|
|
618
|
-
return Object.fromEntries(this.#var);
|
|
619
|
-
}
|
|
620
|
-
newResponse = (data, arg, headers) => {
|
|
621
|
-
if (this.#isFresh && !headers && !arg && this.#status === 200) {
|
|
622
|
-
return new Response(data, {
|
|
623
|
-
headers: this.#preparedHeaders
|
|
624
|
-
});
|
|
625
|
-
}
|
|
626
|
-
if (arg && typeof arg !== "number") {
|
|
627
|
-
const header = new Headers(arg.headers);
|
|
628
|
-
if (this.#headers) {
|
|
629
|
-
this.#headers.forEach((v, k) => {
|
|
630
|
-
if (k === "set-cookie") {
|
|
631
|
-
header.append(k, v);
|
|
632
|
-
} else {
|
|
633
|
-
header.set(k, v);
|
|
634
|
-
}
|
|
635
|
-
});
|
|
636
|
-
}
|
|
637
|
-
const headers2 = setHeaders(header, this.#preparedHeaders);
|
|
638
|
-
return new Response(data, {
|
|
639
|
-
headers: headers2,
|
|
640
|
-
status: arg.status ?? this.#status
|
|
641
|
-
});
|
|
642
|
-
}
|
|
643
|
-
const status = typeof arg === "number" ? arg : this.#status;
|
|
644
|
-
this.#preparedHeaders ??= {};
|
|
645
|
-
this.#headers ??= new Headers();
|
|
646
|
-
setHeaders(this.#headers, this.#preparedHeaders);
|
|
647
|
-
if (this.#res) {
|
|
648
|
-
this.#res.headers.forEach((v, k) => {
|
|
649
|
-
if (k === "set-cookie") {
|
|
650
|
-
this.#headers?.append(k, v);
|
|
651
|
-
} else {
|
|
652
|
-
this.#headers?.set(k, v);
|
|
653
|
-
}
|
|
654
|
-
});
|
|
655
|
-
setHeaders(this.#headers, this.#preparedHeaders);
|
|
656
|
-
}
|
|
657
|
-
headers ??= {};
|
|
658
|
-
for (const [k, v] of Object.entries(headers)) {
|
|
659
|
-
if (typeof v === "string") {
|
|
660
|
-
this.#headers.set(k, v);
|
|
661
|
-
} else {
|
|
662
|
-
this.#headers.delete(k);
|
|
663
|
-
for (const v2 of v) {
|
|
664
|
-
this.#headers.append(k, v2);
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
return new Response(data, {
|
|
669
|
-
status,
|
|
670
|
-
headers: this.#headers
|
|
671
|
-
});
|
|
672
|
-
};
|
|
673
|
-
body = (data, arg, headers) => {
|
|
674
|
-
return typeof arg === "number" ? this.newResponse(data, arg, headers) : this.newResponse(data, arg);
|
|
675
|
-
};
|
|
676
|
-
text = (text, arg, headers) => {
|
|
677
|
-
if (!this.#preparedHeaders) {
|
|
678
|
-
if (this.#isFresh && !headers && !arg) {
|
|
679
|
-
return new Response(text);
|
|
680
|
-
}
|
|
681
|
-
this.#preparedHeaders = {};
|
|
682
|
-
}
|
|
683
|
-
this.#preparedHeaders["content-type"] = TEXT_PLAIN;
|
|
684
|
-
return typeof arg === "number" ? this.newResponse(text, arg, headers) : this.newResponse(text, arg);
|
|
685
|
-
};
|
|
686
|
-
json = (object, arg, headers) => {
|
|
687
|
-
const body = JSON.stringify(object);
|
|
688
|
-
this.#preparedHeaders ??= {};
|
|
689
|
-
this.#preparedHeaders["content-type"] = "application/json; charset=UTF-8";
|
|
690
|
-
return typeof arg === "number" ? this.newResponse(body, arg, headers) : this.newResponse(body, arg);
|
|
691
|
-
};
|
|
692
|
-
html = (html, arg, headers) => {
|
|
693
|
-
this.#preparedHeaders ??= {};
|
|
694
|
-
this.#preparedHeaders["content-type"] = "text/html; charset=UTF-8";
|
|
695
|
-
if (typeof html === "object") {
|
|
696
|
-
return resolveCallback(html, HtmlEscapedCallbackPhase.Stringify, false, {}).then((html2) => {
|
|
697
|
-
return typeof arg === "number" ? this.newResponse(html2, arg, headers) : this.newResponse(html2, arg);
|
|
698
|
-
});
|
|
699
|
-
}
|
|
700
|
-
return typeof arg === "number" ? this.newResponse(html, arg, headers) : this.newResponse(html, arg);
|
|
701
|
-
};
|
|
702
|
-
redirect = (location, status) => {
|
|
703
|
-
this.#headers ??= new Headers();
|
|
704
|
-
this.#headers.set("Location", location);
|
|
705
|
-
return this.newResponse(null, status ?? 302);
|
|
706
|
-
};
|
|
707
|
-
notFound = () => {
|
|
708
|
-
this.#notFoundHandler ??= () => new Response();
|
|
709
|
-
return this.#notFoundHandler(this);
|
|
710
|
-
};
|
|
711
|
-
};
|
|
712
|
-
|
|
713
|
-
// ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/compose.js
|
|
714
|
-
var compose = (middleware, onError, onNotFound) => {
|
|
715
|
-
return (context, next) => {
|
|
716
|
-
let index = -1;
|
|
717
|
-
return dispatch(0);
|
|
718
|
-
async function dispatch(i) {
|
|
719
|
-
if (i <= index) {
|
|
720
|
-
throw new Error("next() called multiple times");
|
|
721
|
-
}
|
|
722
|
-
index = i;
|
|
723
|
-
let res;
|
|
724
|
-
let isError = false;
|
|
725
|
-
let handler;
|
|
726
|
-
if (middleware[i]) {
|
|
727
|
-
handler = middleware[i][0][0];
|
|
728
|
-
if (context instanceof Context) {
|
|
729
|
-
context.req.routeIndex = i;
|
|
730
|
-
}
|
|
731
|
-
} else {
|
|
732
|
-
handler = i === middleware.length && next || void 0;
|
|
733
|
-
}
|
|
734
|
-
if (!handler) {
|
|
735
|
-
if (context instanceof Context && context.finalized === false && onNotFound) {
|
|
736
|
-
res = await onNotFound(context);
|
|
737
|
-
}
|
|
738
|
-
} else {
|
|
739
|
-
try {
|
|
740
|
-
res = await handler(context, () => {
|
|
741
|
-
return dispatch(i + 1);
|
|
742
|
-
});
|
|
743
|
-
} catch (err) {
|
|
744
|
-
if (err instanceof Error && context instanceof Context && onError) {
|
|
745
|
-
context.error = err;
|
|
746
|
-
res = await onError(err, context);
|
|
747
|
-
isError = true;
|
|
748
|
-
} else {
|
|
749
|
-
throw err;
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
if (res && (context.finalized === false || isError)) {
|
|
754
|
-
context.res = res;
|
|
755
|
-
}
|
|
756
|
-
return context;
|
|
757
|
-
}
|
|
758
|
-
};
|
|
759
|
-
};
|
|
760
|
-
|
|
761
|
-
// ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/router.js
|
|
762
|
-
var METHOD_NAME_ALL = "ALL";
|
|
763
|
-
var METHOD_NAME_ALL_LOWERCASE = "all";
|
|
764
|
-
var METHODS = ["get", "post", "put", "delete", "options", "patch"];
|
|
765
|
-
var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built.";
|
|
766
|
-
var UnsupportedPathError = class extends Error {
|
|
767
|
-
};
|
|
768
|
-
|
|
769
|
-
// ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/hono-base.js
|
|
770
|
-
var COMPOSED_HANDLER = Symbol("composedHandler");
|
|
771
|
-
var notFoundHandler = (c) => {
|
|
772
|
-
return c.text("404 Not Found", 404);
|
|
773
|
-
};
|
|
774
|
-
var errorHandler = (err, c) => {
|
|
775
|
-
if ("getResponse" in err) {
|
|
776
|
-
return err.getResponse();
|
|
777
|
-
}
|
|
778
|
-
console.error(err);
|
|
779
|
-
return c.text("Internal Server Error", 500);
|
|
780
|
-
};
|
|
781
|
-
var Hono = class {
|
|
782
|
-
get;
|
|
783
|
-
post;
|
|
784
|
-
put;
|
|
785
|
-
delete;
|
|
786
|
-
options;
|
|
787
|
-
patch;
|
|
788
|
-
all;
|
|
789
|
-
on;
|
|
790
|
-
use;
|
|
791
|
-
router;
|
|
792
|
-
getPath;
|
|
793
|
-
_basePath = "/";
|
|
794
|
-
#path = "/";
|
|
795
|
-
routes = [];
|
|
796
|
-
constructor(options = {}) {
|
|
797
|
-
const allMethods = [...METHODS, METHOD_NAME_ALL_LOWERCASE];
|
|
798
|
-
allMethods.forEach((method) => {
|
|
799
|
-
this[method] = (args1, ...args) => {
|
|
800
|
-
if (typeof args1 === "string") {
|
|
801
|
-
this.#path = args1;
|
|
802
|
-
} else {
|
|
803
|
-
this.addRoute(method, this.#path, args1);
|
|
804
|
-
}
|
|
805
|
-
args.forEach((handler) => {
|
|
806
|
-
if (typeof handler !== "string") {
|
|
807
|
-
this.addRoute(method, this.#path, handler);
|
|
808
|
-
}
|
|
809
|
-
});
|
|
810
|
-
return this;
|
|
811
|
-
};
|
|
812
|
-
});
|
|
813
|
-
this.on = (method, path, ...handlers) => {
|
|
814
|
-
for (const p of [path].flat()) {
|
|
815
|
-
this.#path = p;
|
|
816
|
-
for (const m of [method].flat()) {
|
|
817
|
-
handlers.map((handler) => {
|
|
818
|
-
this.addRoute(m.toUpperCase(), this.#path, handler);
|
|
819
|
-
});
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
return this;
|
|
823
|
-
};
|
|
824
|
-
this.use = (arg1, ...handlers) => {
|
|
825
|
-
if (typeof arg1 === "string") {
|
|
826
|
-
this.#path = arg1;
|
|
827
|
-
} else {
|
|
828
|
-
this.#path = "*";
|
|
829
|
-
handlers.unshift(arg1);
|
|
830
|
-
}
|
|
831
|
-
handlers.forEach((handler) => {
|
|
832
|
-
this.addRoute(METHOD_NAME_ALL, this.#path, handler);
|
|
833
|
-
});
|
|
834
|
-
return this;
|
|
835
|
-
};
|
|
836
|
-
const strict = options.strict ?? true;
|
|
837
|
-
delete options.strict;
|
|
838
|
-
Object.assign(this, options);
|
|
839
|
-
this.getPath = strict ? options.getPath ?? getPath : getPathNoStrict;
|
|
840
|
-
}
|
|
841
|
-
clone() {
|
|
842
|
-
const clone = new Hono({
|
|
843
|
-
router: this.router,
|
|
844
|
-
getPath: this.getPath
|
|
845
|
-
});
|
|
846
|
-
clone.routes = this.routes;
|
|
847
|
-
return clone;
|
|
848
|
-
}
|
|
849
|
-
notFoundHandler = notFoundHandler;
|
|
850
|
-
errorHandler = errorHandler;
|
|
851
|
-
route(path, app3) {
|
|
852
|
-
const subApp = this.basePath(path);
|
|
853
|
-
app3.routes.map((r) => {
|
|
854
|
-
let handler;
|
|
855
|
-
if (app3.errorHandler === errorHandler) {
|
|
856
|
-
handler = r.handler;
|
|
857
|
-
} else {
|
|
858
|
-
handler = async (c, next) => (await compose([], app3.errorHandler)(c, () => r.handler(c, next))).res;
|
|
859
|
-
handler[COMPOSED_HANDLER] = r.handler;
|
|
860
|
-
}
|
|
861
|
-
subApp.addRoute(r.method, r.path, handler);
|
|
862
|
-
});
|
|
863
|
-
return this;
|
|
864
|
-
}
|
|
865
|
-
basePath(path) {
|
|
866
|
-
const subApp = this.clone();
|
|
867
|
-
subApp._basePath = mergePath(this._basePath, path);
|
|
868
|
-
return subApp;
|
|
869
|
-
}
|
|
870
|
-
onError = (handler) => {
|
|
871
|
-
this.errorHandler = handler;
|
|
872
|
-
return this;
|
|
873
|
-
};
|
|
874
|
-
notFound = (handler) => {
|
|
875
|
-
this.notFoundHandler = handler;
|
|
876
|
-
return this;
|
|
877
|
-
};
|
|
878
|
-
mount(path, applicationHandler, options) {
|
|
879
|
-
let replaceRequest;
|
|
880
|
-
let optionHandler;
|
|
881
|
-
if (options) {
|
|
882
|
-
if (typeof options === "function") {
|
|
883
|
-
optionHandler = options;
|
|
884
|
-
} else {
|
|
885
|
-
optionHandler = options.optionHandler;
|
|
886
|
-
replaceRequest = options.replaceRequest;
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
const getOptions = optionHandler ? (c) => {
|
|
890
|
-
const options2 = optionHandler(c);
|
|
891
|
-
return Array.isArray(options2) ? options2 : [options2];
|
|
892
|
-
} : (c) => {
|
|
893
|
-
let executionContext = void 0;
|
|
894
|
-
try {
|
|
895
|
-
executionContext = c.executionCtx;
|
|
896
|
-
} catch {
|
|
897
|
-
}
|
|
898
|
-
return [c.env, executionContext];
|
|
899
|
-
};
|
|
900
|
-
replaceRequest ||= (() => {
|
|
901
|
-
const mergedPath = mergePath(this._basePath, path);
|
|
902
|
-
const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length;
|
|
903
|
-
return (request) => {
|
|
904
|
-
const url = new URL(request.url);
|
|
905
|
-
url.pathname = url.pathname.slice(pathPrefixLength) || "/";
|
|
906
|
-
return new Request(url, request);
|
|
907
|
-
};
|
|
908
|
-
})();
|
|
909
|
-
const handler = async (c, next) => {
|
|
910
|
-
const res = await applicationHandler(replaceRequest(c.req.raw), ...getOptions(c));
|
|
911
|
-
if (res) {
|
|
912
|
-
return res;
|
|
913
|
-
}
|
|
914
|
-
await next();
|
|
915
|
-
};
|
|
916
|
-
this.addRoute(METHOD_NAME_ALL, mergePath(path, "*"), handler);
|
|
917
|
-
return this;
|
|
918
|
-
}
|
|
919
|
-
addRoute(method, path, handler) {
|
|
920
|
-
method = method.toUpperCase();
|
|
921
|
-
path = mergePath(this._basePath, path);
|
|
922
|
-
const r = { path, method, handler };
|
|
923
|
-
this.router.add(method, path, [handler, r]);
|
|
924
|
-
this.routes.push(r);
|
|
925
|
-
}
|
|
926
|
-
matchRoute(method, path) {
|
|
927
|
-
return this.router.match(method, path);
|
|
928
|
-
}
|
|
929
|
-
handleError(err, c) {
|
|
930
|
-
if (err instanceof Error) {
|
|
931
|
-
return this.errorHandler(err, c);
|
|
932
|
-
}
|
|
933
|
-
throw err;
|
|
934
|
-
}
|
|
935
|
-
dispatch(request, executionCtx, env, method) {
|
|
936
|
-
if (method === "HEAD") {
|
|
937
|
-
return (async () => new Response(null, await this.dispatch(request, executionCtx, env, "GET")))();
|
|
938
|
-
}
|
|
939
|
-
const path = this.getPath(request, { env });
|
|
940
|
-
const matchResult = this.matchRoute(method, path);
|
|
941
|
-
const c = new Context(request, {
|
|
942
|
-
path,
|
|
943
|
-
matchResult,
|
|
944
|
-
env,
|
|
945
|
-
executionCtx,
|
|
946
|
-
notFoundHandler: this.notFoundHandler
|
|
947
|
-
});
|
|
948
|
-
if (matchResult[0].length === 1) {
|
|
949
|
-
let res;
|
|
950
|
-
try {
|
|
951
|
-
res = matchResult[0][0][0][0](c, async () => {
|
|
952
|
-
c.res = await this.notFoundHandler(c);
|
|
953
|
-
});
|
|
954
|
-
} catch (err) {
|
|
955
|
-
return this.handleError(err, c);
|
|
956
|
-
}
|
|
957
|
-
return res instanceof Promise ? res.then(
|
|
958
|
-
(resolved) => resolved || (c.finalized ? c.res : this.notFoundHandler(c))
|
|
959
|
-
).catch((err) => this.handleError(err, c)) : res ?? this.notFoundHandler(c);
|
|
960
|
-
}
|
|
961
|
-
const composed = compose(matchResult[0], this.errorHandler, this.notFoundHandler);
|
|
962
|
-
return (async () => {
|
|
963
|
-
try {
|
|
964
|
-
const context = await composed(c);
|
|
965
|
-
if (!context.finalized) {
|
|
966
|
-
throw new Error(
|
|
967
|
-
"Context is not finalized. Did you forget to return a Response object or `await next()`?"
|
|
968
|
-
);
|
|
969
|
-
}
|
|
970
|
-
return context.res;
|
|
971
|
-
} catch (err) {
|
|
972
|
-
return this.handleError(err, c);
|
|
973
|
-
}
|
|
974
|
-
})();
|
|
975
|
-
}
|
|
976
|
-
fetch = (request, ...rest) => {
|
|
977
|
-
return this.dispatch(request, rest[1], rest[0], request.method);
|
|
978
|
-
};
|
|
979
|
-
request = (input, requestInit, Env, executionCtx) => {
|
|
980
|
-
if (input instanceof Request) {
|
|
981
|
-
if (requestInit !== void 0) {
|
|
982
|
-
input = new Request(input, requestInit);
|
|
983
|
-
}
|
|
984
|
-
return this.fetch(input, Env, executionCtx);
|
|
985
|
-
}
|
|
986
|
-
input = input.toString();
|
|
987
|
-
const path = /^https?:\/\//.test(input) ? input : `http://localhost${mergePath("/", input)}`;
|
|
988
|
-
const req = new Request(path, requestInit);
|
|
989
|
-
return this.fetch(req, Env, executionCtx);
|
|
990
|
-
};
|
|
991
|
-
fire = () => {
|
|
992
|
-
addEventListener("fetch", (event) => {
|
|
993
|
-
event.respondWith(this.dispatch(event.request, event, void 0, event.request.method));
|
|
994
|
-
});
|
|
995
|
-
};
|
|
996
|
-
};
|
|
997
|
-
|
|
998
|
-
// ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/router/reg-exp-router/node.js
|
|
999
|
-
var LABEL_REG_EXP_STR = "[^/]+";
|
|
1000
|
-
var ONLY_WILDCARD_REG_EXP_STR = ".*";
|
|
1001
|
-
var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
|
|
1002
|
-
var PATH_ERROR = Symbol();
|
|
1003
|
-
var regExpMetaChars = new Set(".\\+*[^]$()");
|
|
1004
|
-
function compareKey(a, b) {
|
|
1005
|
-
if (a.length === 1) {
|
|
1006
|
-
return b.length === 1 ? a < b ? -1 : 1 : -1;
|
|
1007
|
-
}
|
|
1008
|
-
if (b.length === 1) {
|
|
1009
|
-
return 1;
|
|
1010
|
-
}
|
|
1011
|
-
if (a === ONLY_WILDCARD_REG_EXP_STR || a === TAIL_WILDCARD_REG_EXP_STR) {
|
|
1012
|
-
return 1;
|
|
1013
|
-
} else if (b === ONLY_WILDCARD_REG_EXP_STR || b === TAIL_WILDCARD_REG_EXP_STR) {
|
|
1014
|
-
return -1;
|
|
1015
|
-
}
|
|
1016
|
-
if (a === LABEL_REG_EXP_STR) {
|
|
1017
|
-
return 1;
|
|
1018
|
-
} else if (b === LABEL_REG_EXP_STR) {
|
|
1019
|
-
return -1;
|
|
1020
|
-
}
|
|
1021
|
-
return a.length === b.length ? a < b ? -1 : 1 : b.length - a.length;
|
|
1022
|
-
}
|
|
1023
|
-
var Node = class {
|
|
1024
|
-
index;
|
|
1025
|
-
varIndex;
|
|
1026
|
-
children = /* @__PURE__ */ Object.create(null);
|
|
1027
|
-
insert(tokens, index, paramMap, context, pathErrorCheckOnly) {
|
|
1028
|
-
if (tokens.length === 0) {
|
|
1029
|
-
if (this.index !== void 0) {
|
|
1030
|
-
throw PATH_ERROR;
|
|
1031
|
-
}
|
|
1032
|
-
if (pathErrorCheckOnly) {
|
|
1033
|
-
return;
|
|
1034
|
-
}
|
|
1035
|
-
this.index = index;
|
|
1036
|
-
return;
|
|
1037
|
-
}
|
|
1038
|
-
const [token, ...restTokens] = tokens;
|
|
1039
|
-
const pattern = token === "*" ? restTokens.length === 0 ? ["", "", ONLY_WILDCARD_REG_EXP_STR] : ["", "", LABEL_REG_EXP_STR] : token === "/*" ? ["", "", TAIL_WILDCARD_REG_EXP_STR] : token.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);
|
|
1040
|
-
let node;
|
|
1041
|
-
if (pattern) {
|
|
1042
|
-
const name = pattern[1];
|
|
1043
|
-
let regexpStr = pattern[2] || LABEL_REG_EXP_STR;
|
|
1044
|
-
if (name && pattern[2]) {
|
|
1045
|
-
regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:");
|
|
1046
|
-
if (/\((?!\?:)/.test(regexpStr)) {
|
|
1047
|
-
throw PATH_ERROR;
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
node = this.children[regexpStr];
|
|
1051
|
-
if (!node) {
|
|
1052
|
-
if (Object.keys(this.children).some(
|
|
1053
|
-
(k) => k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR
|
|
1054
|
-
)) {
|
|
1055
|
-
throw PATH_ERROR;
|
|
1056
|
-
}
|
|
1057
|
-
if (pathErrorCheckOnly) {
|
|
1058
|
-
return;
|
|
1059
|
-
}
|
|
1060
|
-
node = this.children[regexpStr] = new Node();
|
|
1061
|
-
if (name !== "") {
|
|
1062
|
-
node.varIndex = context.varIndex++;
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
if (!pathErrorCheckOnly && name !== "") {
|
|
1066
|
-
paramMap.push([name, node.varIndex]);
|
|
1067
|
-
}
|
|
1068
|
-
} else {
|
|
1069
|
-
node = this.children[token];
|
|
1070
|
-
if (!node) {
|
|
1071
|
-
if (Object.keys(this.children).some(
|
|
1072
|
-
(k) => k.length > 1 && k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR
|
|
1073
|
-
)) {
|
|
1074
|
-
throw PATH_ERROR;
|
|
1075
|
-
}
|
|
1076
|
-
if (pathErrorCheckOnly) {
|
|
1077
|
-
return;
|
|
1078
|
-
}
|
|
1079
|
-
node = this.children[token] = new Node();
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
node.insert(restTokens, index, paramMap, context, pathErrorCheckOnly);
|
|
1083
|
-
}
|
|
1084
|
-
buildRegExpStr() {
|
|
1085
|
-
const childKeys = Object.keys(this.children).sort(compareKey);
|
|
1086
|
-
const strList = childKeys.map((k) => {
|
|
1087
|
-
const c = this.children[k];
|
|
1088
|
-
return (typeof c.varIndex === "number" ? `(${k})@${c.varIndex}` : regExpMetaChars.has(k) ? `\\${k}` : k) + c.buildRegExpStr();
|
|
1089
|
-
});
|
|
1090
|
-
if (typeof this.index === "number") {
|
|
1091
|
-
strList.unshift(`#${this.index}`);
|
|
1092
|
-
}
|
|
1093
|
-
if (strList.length === 0) {
|
|
1094
|
-
return "";
|
|
1095
|
-
}
|
|
1096
|
-
if (strList.length === 1) {
|
|
1097
|
-
return strList[0];
|
|
1098
|
-
}
|
|
1099
|
-
return "(?:" + strList.join("|") + ")";
|
|
1100
|
-
}
|
|
1101
|
-
};
|
|
1102
|
-
|
|
1103
|
-
// ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/router/reg-exp-router/trie.js
|
|
1104
|
-
var Trie = class {
|
|
1105
|
-
context = { varIndex: 0 };
|
|
1106
|
-
root = new Node();
|
|
1107
|
-
insert(path, index, pathErrorCheckOnly) {
|
|
1108
|
-
const paramAssoc = [];
|
|
1109
|
-
const groups = [];
|
|
1110
|
-
for (let i = 0; ; ) {
|
|
1111
|
-
let replaced = false;
|
|
1112
|
-
path = path.replace(/\{[^}]+\}/g, (m) => {
|
|
1113
|
-
const mark = `@\\${i}`;
|
|
1114
|
-
groups[i] = [mark, m];
|
|
1115
|
-
i++;
|
|
1116
|
-
replaced = true;
|
|
1117
|
-
return mark;
|
|
1118
|
-
});
|
|
1119
|
-
if (!replaced) {
|
|
1120
|
-
break;
|
|
1121
|
-
}
|
|
1122
|
-
}
|
|
1123
|
-
const tokens = path.match(/(?::[^\/]+)|(?:\/\*$)|./g) || [];
|
|
1124
|
-
for (let i = groups.length - 1; i >= 0; i--) {
|
|
1125
|
-
const [mark] = groups[i];
|
|
1126
|
-
for (let j = tokens.length - 1; j >= 0; j--) {
|
|
1127
|
-
if (tokens[j].indexOf(mark) !== -1) {
|
|
1128
|
-
tokens[j] = tokens[j].replace(mark, groups[i][1]);
|
|
1129
|
-
break;
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
}
|
|
1133
|
-
this.root.insert(tokens, index, paramAssoc, this.context, pathErrorCheckOnly);
|
|
1134
|
-
return paramAssoc;
|
|
1135
|
-
}
|
|
1136
|
-
buildRegExp() {
|
|
1137
|
-
let regexp = this.root.buildRegExpStr();
|
|
1138
|
-
if (regexp === "") {
|
|
1139
|
-
return [/^$/, [], []];
|
|
1140
|
-
}
|
|
1141
|
-
let captureIndex = 0;
|
|
1142
|
-
const indexReplacementMap = [];
|
|
1143
|
-
const paramReplacementMap = [];
|
|
1144
|
-
regexp = regexp.replace(/#(\d+)|@(\d+)|\.\*\$/g, (_, handlerIndex, paramIndex) => {
|
|
1145
|
-
if (typeof handlerIndex !== "undefined") {
|
|
1146
|
-
indexReplacementMap[++captureIndex] = Number(handlerIndex);
|
|
1147
|
-
return "$()";
|
|
1148
|
-
}
|
|
1149
|
-
if (typeof paramIndex !== "undefined") {
|
|
1150
|
-
paramReplacementMap[Number(paramIndex)] = ++captureIndex;
|
|
1151
|
-
return "";
|
|
1152
|
-
}
|
|
1153
|
-
return "";
|
|
1154
|
-
});
|
|
1155
|
-
return [new RegExp(`^${regexp}`), indexReplacementMap, paramReplacementMap];
|
|
1156
|
-
}
|
|
1157
|
-
};
|
|
1158
|
-
|
|
1159
|
-
// ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/router/reg-exp-router/router.js
|
|
1160
|
-
var emptyParam = [];
|
|
1161
|
-
var nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)];
|
|
1162
|
-
var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
|
|
1163
|
-
function buildWildcardRegExp(path) {
|
|
1164
|
-
return wildcardRegExpCache[path] ??= new RegExp(
|
|
1165
|
-
path === "*" ? "" : `^${path.replace(
|
|
1166
|
-
/\/\*$|([.\\+*[^\]$()])/g,
|
|
1167
|
-
(_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)"
|
|
1168
|
-
)}$`
|
|
1169
|
-
);
|
|
1170
|
-
}
|
|
1171
|
-
function clearWildcardRegExpCache() {
|
|
1172
|
-
wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
|
|
1173
|
-
}
|
|
1174
|
-
function buildMatcherFromPreprocessedRoutes(routes) {
|
|
1175
|
-
const trie = new Trie();
|
|
1176
|
-
const handlerData = [];
|
|
1177
|
-
if (routes.length === 0) {
|
|
1178
|
-
return nullMatcher;
|
|
1179
|
-
}
|
|
1180
|
-
const routesWithStaticPathFlag = routes.map(
|
|
1181
|
-
(route) => [!/\*|\/:/.test(route[0]), ...route]
|
|
1182
|
-
).sort(
|
|
1183
|
-
([isStaticA, pathA], [isStaticB, pathB]) => isStaticA ? 1 : isStaticB ? -1 : pathA.length - pathB.length
|
|
1184
|
-
);
|
|
1185
|
-
const staticMap = /* @__PURE__ */ Object.create(null);
|
|
1186
|
-
for (let i = 0, j = -1, len = routesWithStaticPathFlag.length; i < len; i++) {
|
|
1187
|
-
const [pathErrorCheckOnly, path, handlers] = routesWithStaticPathFlag[i];
|
|
1188
|
-
if (pathErrorCheckOnly) {
|
|
1189
|
-
staticMap[path] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), emptyParam];
|
|
1190
|
-
} else {
|
|
1191
|
-
j++;
|
|
1192
|
-
}
|
|
1193
|
-
let paramAssoc;
|
|
1194
|
-
try {
|
|
1195
|
-
paramAssoc = trie.insert(path, j, pathErrorCheckOnly);
|
|
1196
|
-
} catch (e) {
|
|
1197
|
-
throw e === PATH_ERROR ? new UnsupportedPathError(path) : e;
|
|
1198
|
-
}
|
|
1199
|
-
if (pathErrorCheckOnly) {
|
|
1200
|
-
continue;
|
|
1201
|
-
}
|
|
1202
|
-
handlerData[j] = handlers.map(([h, paramCount]) => {
|
|
1203
|
-
const paramIndexMap = /* @__PURE__ */ Object.create(null);
|
|
1204
|
-
paramCount -= 1;
|
|
1205
|
-
for (; paramCount >= 0; paramCount--) {
|
|
1206
|
-
const [key, value] = paramAssoc[paramCount];
|
|
1207
|
-
paramIndexMap[key] = value;
|
|
1208
|
-
}
|
|
1209
|
-
return [h, paramIndexMap];
|
|
1210
|
-
});
|
|
1211
|
-
}
|
|
1212
|
-
const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp();
|
|
1213
|
-
for (let i = 0, len = handlerData.length; i < len; i++) {
|
|
1214
|
-
for (let j = 0, len2 = handlerData[i].length; j < len2; j++) {
|
|
1215
|
-
const map = handlerData[i][j]?.[1];
|
|
1216
|
-
if (!map) {
|
|
1217
|
-
continue;
|
|
1218
|
-
}
|
|
1219
|
-
const keys = Object.keys(map);
|
|
1220
|
-
for (let k = 0, len3 = keys.length; k < len3; k++) {
|
|
1221
|
-
map[keys[k]] = paramReplacementMap[map[keys[k]]];
|
|
1222
|
-
}
|
|
1223
|
-
}
|
|
1224
|
-
}
|
|
1225
|
-
const handlerMap = [];
|
|
1226
|
-
for (const i in indexReplacementMap) {
|
|
1227
|
-
handlerMap[i] = handlerData[indexReplacementMap[i]];
|
|
1228
|
-
}
|
|
1229
|
-
return [regexp, handlerMap, staticMap];
|
|
1230
|
-
}
|
|
1231
|
-
function findMiddleware(middleware, path) {
|
|
1232
|
-
if (!middleware) {
|
|
1233
|
-
return void 0;
|
|
1234
|
-
}
|
|
1235
|
-
for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) {
|
|
1236
|
-
if (buildWildcardRegExp(k).test(path)) {
|
|
1237
|
-
return [...middleware[k]];
|
|
1238
|
-
}
|
|
1239
|
-
}
|
|
1240
|
-
return void 0;
|
|
1241
|
-
}
|
|
1242
|
-
var RegExpRouter = class {
|
|
1243
|
-
name = "RegExpRouter";
|
|
1244
|
-
middleware;
|
|
1245
|
-
routes;
|
|
1246
|
-
constructor() {
|
|
1247
|
-
this.middleware = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) };
|
|
1248
|
-
this.routes = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) };
|
|
1249
|
-
}
|
|
1250
|
-
add(method, path, handler) {
|
|
1251
|
-
const { middleware, routes } = this;
|
|
1252
|
-
if (!middleware || !routes) {
|
|
1253
|
-
throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
|
|
1254
|
-
}
|
|
1255
|
-
if (!middleware[method]) {
|
|
1256
|
-
;
|
|
1257
|
-
[middleware, routes].forEach((handlerMap) => {
|
|
1258
|
-
handlerMap[method] = /* @__PURE__ */ Object.create(null);
|
|
1259
|
-
Object.keys(handlerMap[METHOD_NAME_ALL]).forEach((p) => {
|
|
1260
|
-
handlerMap[method][p] = [...handlerMap[METHOD_NAME_ALL][p]];
|
|
1261
|
-
});
|
|
1262
|
-
});
|
|
1263
|
-
}
|
|
1264
|
-
if (path === "/*") {
|
|
1265
|
-
path = "*";
|
|
1266
|
-
}
|
|
1267
|
-
const paramCount = (path.match(/\/:/g) || []).length;
|
|
1268
|
-
if (/\*$/.test(path)) {
|
|
1269
|
-
const re = buildWildcardRegExp(path);
|
|
1270
|
-
if (method === METHOD_NAME_ALL) {
|
|
1271
|
-
Object.keys(middleware).forEach((m) => {
|
|
1272
|
-
middleware[m][path] ||= findMiddleware(middleware[m], path) || findMiddleware(middleware[METHOD_NAME_ALL], path) || [];
|
|
1273
|
-
});
|
|
1274
|
-
} else {
|
|
1275
|
-
middleware[method][path] ||= findMiddleware(middleware[method], path) || findMiddleware(middleware[METHOD_NAME_ALL], path) || [];
|
|
1276
|
-
}
|
|
1277
|
-
Object.keys(middleware).forEach((m) => {
|
|
1278
|
-
if (method === METHOD_NAME_ALL || method === m) {
|
|
1279
|
-
Object.keys(middleware[m]).forEach((p) => {
|
|
1280
|
-
re.test(p) && middleware[m][p].push([handler, paramCount]);
|
|
1281
|
-
});
|
|
1282
|
-
}
|
|
1283
|
-
});
|
|
1284
|
-
Object.keys(routes).forEach((m) => {
|
|
1285
|
-
if (method === METHOD_NAME_ALL || method === m) {
|
|
1286
|
-
Object.keys(routes[m]).forEach(
|
|
1287
|
-
(p) => re.test(p) && routes[m][p].push([handler, paramCount])
|
|
1288
|
-
);
|
|
1289
|
-
}
|
|
1290
|
-
});
|
|
1291
|
-
return;
|
|
1292
|
-
}
|
|
1293
|
-
const paths = checkOptionalParameter(path) || [path];
|
|
1294
|
-
for (let i = 0, len = paths.length; i < len; i++) {
|
|
1295
|
-
const path2 = paths[i];
|
|
1296
|
-
Object.keys(routes).forEach((m) => {
|
|
1297
|
-
if (method === METHOD_NAME_ALL || method === m) {
|
|
1298
|
-
routes[m][path2] ||= [
|
|
1299
|
-
...findMiddleware(middleware[m], path2) || findMiddleware(middleware[METHOD_NAME_ALL], path2) || []
|
|
1300
|
-
];
|
|
1301
|
-
routes[m][path2].push([handler, paramCount - len + i + 1]);
|
|
1302
|
-
}
|
|
1303
|
-
});
|
|
1304
|
-
}
|
|
1305
|
-
}
|
|
1306
|
-
match(method, path) {
|
|
1307
|
-
clearWildcardRegExpCache();
|
|
1308
|
-
const matchers = this.buildAllMatchers();
|
|
1309
|
-
this.match = (method2, path2) => {
|
|
1310
|
-
const matcher = matchers[method2] || matchers[METHOD_NAME_ALL];
|
|
1311
|
-
const staticMatch = matcher[2][path2];
|
|
1312
|
-
if (staticMatch) {
|
|
1313
|
-
return staticMatch;
|
|
1314
|
-
}
|
|
1315
|
-
const match = path2.match(matcher[0]);
|
|
1316
|
-
if (!match) {
|
|
1317
|
-
return [[], emptyParam];
|
|
1318
|
-
}
|
|
1319
|
-
const index = match.indexOf("", 1);
|
|
1320
|
-
return [matcher[1][index], match];
|
|
1321
|
-
};
|
|
1322
|
-
return this.match(method, path);
|
|
1323
|
-
}
|
|
1324
|
-
buildAllMatchers() {
|
|
1325
|
-
const matchers = /* @__PURE__ */ Object.create(null);
|
|
1326
|
-
[...Object.keys(this.routes), ...Object.keys(this.middleware)].forEach((method) => {
|
|
1327
|
-
matchers[method] ||= this.buildMatcher(method);
|
|
1328
|
-
});
|
|
1329
|
-
this.middleware = this.routes = void 0;
|
|
1330
|
-
return matchers;
|
|
1331
|
-
}
|
|
1332
|
-
buildMatcher(method) {
|
|
1333
|
-
const routes = [];
|
|
1334
|
-
let hasOwnRoute = method === METHOD_NAME_ALL;
|
|
1335
|
-
[this.middleware, this.routes].forEach((r) => {
|
|
1336
|
-
const ownRoute = r[method] ? Object.keys(r[method]).map((path) => [path, r[method][path]]) : [];
|
|
1337
|
-
if (ownRoute.length !== 0) {
|
|
1338
|
-
hasOwnRoute ||= true;
|
|
1339
|
-
routes.push(...ownRoute);
|
|
1340
|
-
} else if (method !== METHOD_NAME_ALL) {
|
|
1341
|
-
routes.push(
|
|
1342
|
-
...Object.keys(r[METHOD_NAME_ALL]).map((path) => [path, r[METHOD_NAME_ALL][path]])
|
|
1343
|
-
);
|
|
1344
|
-
}
|
|
1345
|
-
});
|
|
1346
|
-
if (!hasOwnRoute) {
|
|
1347
|
-
return null;
|
|
1348
|
-
} else {
|
|
1349
|
-
return buildMatcherFromPreprocessedRoutes(routes);
|
|
1350
|
-
}
|
|
1351
|
-
}
|
|
1352
|
-
};
|
|
1353
|
-
|
|
1354
|
-
// ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/router/smart-router/router.js
|
|
1355
|
-
var SmartRouter = class {
|
|
1356
|
-
name = "SmartRouter";
|
|
1357
|
-
routers = [];
|
|
1358
|
-
routes = [];
|
|
1359
|
-
constructor(init) {
|
|
1360
|
-
Object.assign(this, init);
|
|
1361
|
-
}
|
|
1362
|
-
add(method, path, handler) {
|
|
1363
|
-
if (!this.routes) {
|
|
1364
|
-
throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
|
|
1365
|
-
}
|
|
1366
|
-
this.routes.push([method, path, handler]);
|
|
1367
|
-
}
|
|
1368
|
-
match(method, path) {
|
|
1369
|
-
if (!this.routes) {
|
|
1370
|
-
throw new Error("Fatal error");
|
|
1371
|
-
}
|
|
1372
|
-
const { routers, routes } = this;
|
|
1373
|
-
const len = routers.length;
|
|
1374
|
-
let i = 0;
|
|
1375
|
-
let res;
|
|
1376
|
-
for (; i < len; i++) {
|
|
1377
|
-
const router = routers[i];
|
|
1378
|
-
try {
|
|
1379
|
-
routes.forEach((args) => {
|
|
1380
|
-
router.add(...args);
|
|
1381
|
-
});
|
|
1382
|
-
res = router.match(method, path);
|
|
1383
|
-
} catch (e) {
|
|
1384
|
-
if (e instanceof UnsupportedPathError) {
|
|
1385
|
-
continue;
|
|
1386
|
-
}
|
|
1387
|
-
throw e;
|
|
1388
|
-
}
|
|
1389
|
-
this.match = router.match.bind(router);
|
|
1390
|
-
this.routers = [router];
|
|
1391
|
-
this.routes = void 0;
|
|
1392
|
-
break;
|
|
1393
|
-
}
|
|
1394
|
-
if (i === len) {
|
|
1395
|
-
throw new Error("Fatal error");
|
|
1396
|
-
}
|
|
1397
|
-
this.name = `SmartRouter + ${this.activeRouter.name}`;
|
|
1398
|
-
return res;
|
|
1399
|
-
}
|
|
1400
|
-
get activeRouter() {
|
|
1401
|
-
if (this.routes || this.routers.length !== 1) {
|
|
1402
|
-
throw new Error("No active router has been determined yet.");
|
|
1403
|
-
}
|
|
1404
|
-
return this.routers[0];
|
|
1405
|
-
}
|
|
1406
|
-
};
|
|
1407
|
-
|
|
1408
|
-
// ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/router/trie-router/node.js
|
|
1409
|
-
var Node2 = class {
|
|
1410
|
-
methods;
|
|
1411
|
-
children;
|
|
1412
|
-
patterns;
|
|
1413
|
-
order = 0;
|
|
1414
|
-
name;
|
|
1415
|
-
params = /* @__PURE__ */ Object.create(null);
|
|
1416
|
-
constructor(method, handler, children) {
|
|
1417
|
-
this.children = children || /* @__PURE__ */ Object.create(null);
|
|
1418
|
-
this.methods = [];
|
|
1419
|
-
this.name = "";
|
|
1420
|
-
if (method && handler) {
|
|
1421
|
-
const m = /* @__PURE__ */ Object.create(null);
|
|
1422
|
-
m[method] = { handler, possibleKeys: [], score: 0, name: this.name };
|
|
1423
|
-
this.methods = [m];
|
|
1424
|
-
}
|
|
1425
|
-
this.patterns = [];
|
|
1426
|
-
}
|
|
1427
|
-
insert(method, path, handler) {
|
|
1428
|
-
this.name = `${method} ${path}`;
|
|
1429
|
-
this.order = ++this.order;
|
|
1430
|
-
let curNode = this;
|
|
1431
|
-
const parts = splitRoutingPath(path);
|
|
1432
|
-
const possibleKeys = [];
|
|
1433
|
-
for (let i = 0, len = parts.length; i < len; i++) {
|
|
1434
|
-
const p = parts[i];
|
|
1435
|
-
if (Object.keys(curNode.children).includes(p)) {
|
|
1436
|
-
curNode = curNode.children[p];
|
|
1437
|
-
const pattern2 = getPattern(p);
|
|
1438
|
-
if (pattern2) {
|
|
1439
|
-
possibleKeys.push(pattern2[1]);
|
|
1440
|
-
}
|
|
1441
|
-
continue;
|
|
1442
|
-
}
|
|
1443
|
-
curNode.children[p] = new Node2();
|
|
1444
|
-
const pattern = getPattern(p);
|
|
1445
|
-
if (pattern) {
|
|
1446
|
-
curNode.patterns.push(pattern);
|
|
1447
|
-
possibleKeys.push(pattern[1]);
|
|
1448
|
-
}
|
|
1449
|
-
curNode = curNode.children[p];
|
|
1450
|
-
}
|
|
1451
|
-
if (!curNode.methods.length) {
|
|
1452
|
-
curNode.methods = [];
|
|
1453
|
-
}
|
|
1454
|
-
const m = /* @__PURE__ */ Object.create(null);
|
|
1455
|
-
const handlerSet = {
|
|
1456
|
-
handler,
|
|
1457
|
-
possibleKeys: possibleKeys.filter((v, i, a) => a.indexOf(v) === i),
|
|
1458
|
-
name: this.name,
|
|
1459
|
-
score: this.order
|
|
1460
|
-
};
|
|
1461
|
-
m[method] = handlerSet;
|
|
1462
|
-
curNode.methods.push(m);
|
|
1463
|
-
return curNode;
|
|
1464
|
-
}
|
|
1465
|
-
gHSets(node, method, nodeParams, params) {
|
|
1466
|
-
const handlerSets = [];
|
|
1467
|
-
for (let i = 0, len = node.methods.length; i < len; i++) {
|
|
1468
|
-
const m = node.methods[i];
|
|
1469
|
-
const handlerSet = m[method] || m[METHOD_NAME_ALL];
|
|
1470
|
-
const processedSet = /* @__PURE__ */ Object.create(null);
|
|
1471
|
-
if (handlerSet !== void 0) {
|
|
1472
|
-
handlerSet.params = /* @__PURE__ */ Object.create(null);
|
|
1473
|
-
handlerSet.possibleKeys.forEach((key) => {
|
|
1474
|
-
const processed = processedSet[handlerSet.name];
|
|
1475
|
-
handlerSet.params[key] = params[key] && !processed ? params[key] : nodeParams[key] ?? params[key];
|
|
1476
|
-
processedSet[handlerSet.name] = true;
|
|
1477
|
-
});
|
|
1478
|
-
handlerSets.push(handlerSet);
|
|
1479
|
-
}
|
|
1480
|
-
}
|
|
1481
|
-
return handlerSets;
|
|
1482
|
-
}
|
|
1483
|
-
search(method, path) {
|
|
1484
|
-
const handlerSets = [];
|
|
1485
|
-
this.params = /* @__PURE__ */ Object.create(null);
|
|
1486
|
-
const curNode = this;
|
|
1487
|
-
let curNodes = [curNode];
|
|
1488
|
-
const parts = splitPath(path);
|
|
1489
|
-
for (let i = 0, len = parts.length; i < len; i++) {
|
|
1490
|
-
const part = parts[i];
|
|
1491
|
-
const isLast = i === len - 1;
|
|
1492
|
-
const tempNodes = [];
|
|
1493
|
-
for (let j = 0, len2 = curNodes.length; j < len2; j++) {
|
|
1494
|
-
const node = curNodes[j];
|
|
1495
|
-
const nextNode = node.children[part];
|
|
1496
|
-
if (nextNode) {
|
|
1497
|
-
nextNode.params = node.params;
|
|
1498
|
-
if (isLast === true) {
|
|
1499
|
-
if (nextNode.children["*"]) {
|
|
1500
|
-
handlerSets.push(
|
|
1501
|
-
...this.gHSets(nextNode.children["*"], method, node.params, /* @__PURE__ */ Object.create(null))
|
|
1502
|
-
);
|
|
1503
|
-
}
|
|
1504
|
-
handlerSets.push(...this.gHSets(nextNode, method, node.params, /* @__PURE__ */ Object.create(null)));
|
|
1505
|
-
} else {
|
|
1506
|
-
tempNodes.push(nextNode);
|
|
1507
|
-
}
|
|
1508
|
-
}
|
|
1509
|
-
for (let k = 0, len3 = node.patterns.length; k < len3; k++) {
|
|
1510
|
-
const pattern = node.patterns[k];
|
|
1511
|
-
const params = { ...node.params };
|
|
1512
|
-
if (pattern === "*") {
|
|
1513
|
-
const astNode = node.children["*"];
|
|
1514
|
-
if (astNode) {
|
|
1515
|
-
handlerSets.push(...this.gHSets(astNode, method, node.params, /* @__PURE__ */ Object.create(null)));
|
|
1516
|
-
tempNodes.push(astNode);
|
|
1517
|
-
}
|
|
1518
|
-
continue;
|
|
1519
|
-
}
|
|
1520
|
-
if (part === "") {
|
|
1521
|
-
continue;
|
|
1522
|
-
}
|
|
1523
|
-
const [key, name, matcher] = pattern;
|
|
1524
|
-
const child = node.children[key];
|
|
1525
|
-
const restPathString = parts.slice(i).join("/");
|
|
1526
|
-
if (matcher instanceof RegExp && matcher.test(restPathString)) {
|
|
1527
|
-
params[name] = restPathString;
|
|
1528
|
-
handlerSets.push(...this.gHSets(child, method, node.params, params));
|
|
1529
|
-
continue;
|
|
1530
|
-
}
|
|
1531
|
-
if (matcher === true || matcher instanceof RegExp && matcher.test(part)) {
|
|
1532
|
-
if (typeof key === "string") {
|
|
1533
|
-
params[name] = part;
|
|
1534
|
-
if (isLast === true) {
|
|
1535
|
-
handlerSets.push(...this.gHSets(child, method, params, node.params));
|
|
1536
|
-
if (child.children["*"]) {
|
|
1537
|
-
handlerSets.push(...this.gHSets(child.children["*"], method, params, node.params));
|
|
1538
|
-
}
|
|
1539
|
-
} else {
|
|
1540
|
-
child.params = params;
|
|
1541
|
-
tempNodes.push(child);
|
|
1542
|
-
}
|
|
1543
|
-
}
|
|
1544
|
-
}
|
|
1545
|
-
}
|
|
1546
|
-
}
|
|
1547
|
-
curNodes = tempNodes;
|
|
1548
|
-
}
|
|
1549
|
-
const results = handlerSets.sort((a, b) => {
|
|
1550
|
-
return a.score - b.score;
|
|
1551
|
-
});
|
|
1552
|
-
return [results.map(({ handler, params }) => [handler, params])];
|
|
1553
|
-
}
|
|
1554
|
-
};
|
|
1555
|
-
|
|
1556
|
-
// ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/router/trie-router/router.js
|
|
1557
|
-
var TrieRouter = class {
|
|
1558
|
-
name = "TrieRouter";
|
|
1559
|
-
node;
|
|
1560
|
-
constructor() {
|
|
1561
|
-
this.node = new Node2();
|
|
1562
|
-
}
|
|
1563
|
-
add(method, path, handler) {
|
|
1564
|
-
const results = checkOptionalParameter(path);
|
|
1565
|
-
if (results) {
|
|
1566
|
-
for (const p of results) {
|
|
1567
|
-
this.node.insert(method, p, handler);
|
|
1568
|
-
}
|
|
1569
|
-
return;
|
|
1570
|
-
}
|
|
1571
|
-
this.node.insert(method, path, handler);
|
|
1572
|
-
}
|
|
1573
|
-
match(method, path) {
|
|
1574
|
-
return this.node.search(method, path);
|
|
1575
|
-
}
|
|
1576
|
-
};
|
|
1577
|
-
|
|
1578
|
-
// ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/hono.js
|
|
1579
|
-
var Hono2 = class extends Hono {
|
|
1580
|
-
constructor(options = {}) {
|
|
1581
|
-
super(options);
|
|
1582
|
-
this.router = options.router ?? new SmartRouter({
|
|
1583
|
-
routers: [new RegExpRouter(), new TrieRouter()]
|
|
1584
|
-
});
|
|
1585
|
-
}
|
|
1586
|
-
};
|
|
1587
|
-
|
|
1588
|
-
// firebase/functions/createFirebaseApp.ts
|
|
1589
|
-
var import_https = require("firebase-functions/v2/https");
|
|
1590
|
-
function createFirebaseApp({
|
|
1591
|
-
region
|
|
1592
|
-
}) {
|
|
1593
|
-
return (app3) => {
|
|
1594
|
-
return (0, import_https.onRequest)(
|
|
1595
|
-
{
|
|
1596
|
-
region
|
|
1597
|
-
},
|
|
1598
|
-
async (req, res) => {
|
|
1599
|
-
const host = req.hostname;
|
|
1600
|
-
const path = req.originalUrl || req.url;
|
|
1601
|
-
const fullUrl = new URL(path, `https://${host}`).toString();
|
|
1602
|
-
const request = new Request(fullUrl, {
|
|
1603
|
-
method: req.method,
|
|
1604
|
-
headers: req.headers,
|
|
1605
|
-
body: req.method !== "GET" && req.method !== "HEAD" ? req.body : void 0
|
|
1606
|
-
});
|
|
1607
|
-
const honoResponse = await app3.fetch(request);
|
|
1608
|
-
res.status(honoResponse.status);
|
|
1609
|
-
for (const [key, value] of honoResponse.headers.entries()) {
|
|
1610
|
-
res.setHeader(key, value);
|
|
1611
|
-
}
|
|
1612
|
-
const body = await honoResponse.text();
|
|
1613
|
-
res.send(body);
|
|
1614
|
-
}
|
|
1615
|
-
);
|
|
1616
|
-
};
|
|
1617
|
-
}
|
|
1618
|
-
|
|
1619
|
-
// ../js/dist/index.js
|
|
1620
|
-
var __webpack_modules__ = {
|
|
1621
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/comparator.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
1622
|
-
const ANY = Symbol("SemVer ANY");
|
|
1623
|
-
class Comparator {
|
|
1624
|
-
static get ANY() {
|
|
1625
|
-
return ANY;
|
|
1626
|
-
}
|
|
1627
|
-
constructor(comp, options) {
|
|
1628
|
-
options = parseOptions(options);
|
|
1629
|
-
if (comp instanceof Comparator) if (!!options.loose === comp.loose) return comp;
|
|
1630
|
-
else comp = comp.value;
|
|
1631
|
-
comp = comp.trim().split(/\s+/).join(" ");
|
|
1632
|
-
debug("comparator", comp, options);
|
|
1633
|
-
this.options = options;
|
|
1634
|
-
this.loose = !!options.loose;
|
|
1635
|
-
this.parse(comp);
|
|
1636
|
-
if (this.semver === ANY) this.value = "";
|
|
1637
|
-
else this.value = this.operator + this.semver.version;
|
|
1638
|
-
debug("comp", this);
|
|
1639
|
-
}
|
|
1640
|
-
parse(comp) {
|
|
1641
|
-
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
1642
|
-
const m = comp.match(r);
|
|
1643
|
-
if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
|
|
1644
|
-
this.operator = void 0 !== m[1] ? m[1] : "";
|
|
1645
|
-
if ("=" === this.operator) this.operator = "";
|
|
1646
|
-
if (m[2]) this.semver = new SemVer(m[2], this.options.loose);
|
|
1647
|
-
else this.semver = ANY;
|
|
1648
|
-
}
|
|
1649
|
-
toString() {
|
|
1650
|
-
return this.value;
|
|
1651
|
-
}
|
|
1652
|
-
test(version) {
|
|
1653
|
-
debug("Comparator.test", version, this.options.loose);
|
|
1654
|
-
if (this.semver === ANY || version === ANY) return true;
|
|
1655
|
-
if ("string" == typeof version) try {
|
|
1656
|
-
version = new SemVer(version, this.options);
|
|
1657
|
-
} catch (er) {
|
|
1658
|
-
return false;
|
|
1659
|
-
}
|
|
1660
|
-
return cmp(version, this.operator, this.semver, this.options);
|
|
1661
|
-
}
|
|
1662
|
-
intersects(comp, options) {
|
|
1663
|
-
if (!(comp instanceof Comparator)) throw new TypeError("a Comparator is required");
|
|
1664
|
-
if ("" === this.operator) {
|
|
1665
|
-
if ("" === this.value) return true;
|
|
1666
|
-
return new Range(comp.value, options).test(this.value);
|
|
1667
|
-
}
|
|
1668
|
-
if ("" === comp.operator) {
|
|
1669
|
-
if ("" === comp.value) return true;
|
|
1670
|
-
return new Range(this.value, options).test(comp.semver);
|
|
1671
|
-
}
|
|
1672
|
-
options = parseOptions(options);
|
|
1673
|
-
if (options.includePrerelease && ("<0.0.0-0" === this.value || "<0.0.0-0" === comp.value)) return false;
|
|
1674
|
-
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) return false;
|
|
1675
|
-
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
|
|
1676
|
-
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
|
|
1677
|
-
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
|
|
1678
|
-
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
|
|
1679
|
-
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
|
|
1680
|
-
return false;
|
|
1681
|
-
}
|
|
1682
|
-
}
|
|
1683
|
-
module2.exports = Comparator;
|
|
1684
|
-
const parseOptions = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/parse-options.js");
|
|
1685
|
-
const { safeRe: re, t } = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js");
|
|
1686
|
-
const cmp = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/cmp.js");
|
|
1687
|
-
const debug = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js");
|
|
1688
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1689
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
1690
|
-
},
|
|
1691
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
1692
|
-
const SPACE_CHARACTERS = /\s+/g;
|
|
1693
|
-
class Range {
|
|
1694
|
-
constructor(range, options) {
|
|
1695
|
-
options = parseOptions(options);
|
|
1696
|
-
if (range instanceof Range) if (!!options.loose === range.loose && !!options.includePrerelease === range.includePrerelease) return range;
|
|
1697
|
-
else return new Range(range.raw, options);
|
|
1698
|
-
if (range instanceof Comparator) {
|
|
1699
|
-
this.raw = range.value;
|
|
1700
|
-
this.set = [
|
|
1701
|
-
[
|
|
1702
|
-
range
|
|
1703
|
-
]
|
|
1704
|
-
];
|
|
1705
|
-
this.formatted = void 0;
|
|
1706
|
-
return this;
|
|
1707
|
-
}
|
|
1708
|
-
this.options = options;
|
|
1709
|
-
this.loose = !!options.loose;
|
|
1710
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
1711
|
-
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
1712
|
-
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
1713
|
-
if (!this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
1714
|
-
if (this.set.length > 1) {
|
|
1715
|
-
const first = this.set[0];
|
|
1716
|
-
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
1717
|
-
if (0 === this.set.length) this.set = [
|
|
1718
|
-
first
|
|
1719
|
-
];
|
|
1720
|
-
else if (this.set.length > 1) {
|
|
1721
|
-
for (const c of this.set) if (1 === c.length && isAny(c[0])) {
|
|
1722
|
-
this.set = [
|
|
1723
|
-
c
|
|
1724
|
-
];
|
|
1725
|
-
break;
|
|
1726
|
-
}
|
|
1727
|
-
}
|
|
1728
|
-
}
|
|
1729
|
-
this.formatted = void 0;
|
|
1730
|
-
}
|
|
1731
|
-
get range() {
|
|
1732
|
-
if (void 0 === this.formatted) {
|
|
1733
|
-
this.formatted = "";
|
|
1734
|
-
for (let i = 0; i < this.set.length; i++) {
|
|
1735
|
-
if (i > 0) this.formatted += "||";
|
|
1736
|
-
const comps = this.set[i];
|
|
1737
|
-
for (let k = 0; k < comps.length; k++) {
|
|
1738
|
-
if (k > 0) this.formatted += " ";
|
|
1739
|
-
this.formatted += comps[k].toString().trim();
|
|
1740
|
-
}
|
|
1741
|
-
}
|
|
1742
|
-
}
|
|
1743
|
-
return this.formatted;
|
|
1744
|
-
}
|
|
1745
|
-
format() {
|
|
1746
|
-
return this.range;
|
|
1747
|
-
}
|
|
1748
|
-
toString() {
|
|
1749
|
-
return this.range;
|
|
1750
|
-
}
|
|
1751
|
-
parseRange(range) {
|
|
1752
|
-
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
1753
|
-
const memoKey = memoOpts + ":" + range;
|
|
1754
|
-
const cached = cache.get(memoKey);
|
|
1755
|
-
if (cached) return cached;
|
|
1756
|
-
const loose = this.options.loose;
|
|
1757
|
-
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
1758
|
-
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
1759
|
-
debug("hyphen replace", range);
|
|
1760
|
-
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
1761
|
-
debug("comparator trim", range);
|
|
1762
|
-
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
1763
|
-
debug("tilde trim", range);
|
|
1764
|
-
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
1765
|
-
debug("caret trim", range);
|
|
1766
|
-
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
1767
|
-
if (loose) rangeList = rangeList.filter((comp) => {
|
|
1768
|
-
debug("loose invalid filter", comp, this.options);
|
|
1769
|
-
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
1770
|
-
});
|
|
1771
|
-
debug("range list", rangeList);
|
|
1772
|
-
const rangeMap = /* @__PURE__ */ new Map();
|
|
1773
|
-
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
1774
|
-
for (const comp of comparators) {
|
|
1775
|
-
if (isNullSet(comp)) return [
|
|
1776
|
-
comp
|
|
1777
|
-
];
|
|
1778
|
-
rangeMap.set(comp.value, comp);
|
|
1779
|
-
}
|
|
1780
|
-
if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete("");
|
|
1781
|
-
const result = [
|
|
1782
|
-
...rangeMap.values()
|
|
1783
|
-
];
|
|
1784
|
-
cache.set(memoKey, result);
|
|
1785
|
-
return result;
|
|
1786
|
-
}
|
|
1787
|
-
intersects(range, options) {
|
|
1788
|
-
if (!(range instanceof Range)) throw new TypeError("a Range is required");
|
|
1789
|
-
return this.set.some((thisComparators) => isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => rangeComparators.every((rangeComparator) => thisComparator.intersects(rangeComparator, options)))));
|
|
1790
|
-
}
|
|
1791
|
-
test(version) {
|
|
1792
|
-
if (!version) return false;
|
|
1793
|
-
if ("string" == typeof version) try {
|
|
1794
|
-
version = new SemVer(version, this.options);
|
|
1795
|
-
} catch (er) {
|
|
1796
|
-
return false;
|
|
1797
|
-
}
|
|
1798
|
-
for (let i = 0; i < this.set.length; i++) if (testSet(this.set[i], version, this.options)) return true;
|
|
1799
|
-
return false;
|
|
1800
|
-
}
|
|
1801
|
-
}
|
|
1802
|
-
module2.exports = Range;
|
|
1803
|
-
const LRU = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/lrucache.js");
|
|
1804
|
-
const cache = new LRU();
|
|
1805
|
-
const parseOptions = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/parse-options.js");
|
|
1806
|
-
const Comparator = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/comparator.js");
|
|
1807
|
-
const debug = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js");
|
|
1808
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1809
|
-
const { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js");
|
|
1810
|
-
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js");
|
|
1811
|
-
const isNullSet = (c) => "<0.0.0-0" === c.value;
|
|
1812
|
-
const isAny = (c) => "" === c.value;
|
|
1813
|
-
const isSatisfiable = (comparators, options) => {
|
|
1814
|
-
let result = true;
|
|
1815
|
-
const remainingComparators = comparators.slice();
|
|
1816
|
-
let testComparator = remainingComparators.pop();
|
|
1817
|
-
while (result && remainingComparators.length) {
|
|
1818
|
-
result = remainingComparators.every((otherComparator) => testComparator.intersects(otherComparator, options));
|
|
1819
|
-
testComparator = remainingComparators.pop();
|
|
1820
|
-
}
|
|
1821
|
-
return result;
|
|
1822
|
-
};
|
|
1823
|
-
const parseComparator = (comp, options) => {
|
|
1824
|
-
debug("comp", comp, options);
|
|
1825
|
-
comp = replaceCarets(comp, options);
|
|
1826
|
-
debug("caret", comp);
|
|
1827
|
-
comp = replaceTildes(comp, options);
|
|
1828
|
-
debug("tildes", comp);
|
|
1829
|
-
comp = replaceXRanges(comp, options);
|
|
1830
|
-
debug("xrange", comp);
|
|
1831
|
-
comp = replaceStars(comp, options);
|
|
1832
|
-
debug("stars", comp);
|
|
1833
|
-
return comp;
|
|
1834
|
-
};
|
|
1835
|
-
const isX = (id) => !id || "x" === id.toLowerCase() || "*" === id;
|
|
1836
|
-
const replaceTildes = (comp, options) => comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
1837
|
-
const replaceTilde = (comp, options) => {
|
|
1838
|
-
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
1839
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1840
|
-
debug("tilde", comp, _, M, m, p, pr);
|
|
1841
|
-
let ret;
|
|
1842
|
-
if (isX(M)) ret = "";
|
|
1843
|
-
else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
1844
|
-
else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
1845
|
-
else if (pr) {
|
|
1846
|
-
debug("replaceTilde pr", pr);
|
|
1847
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1848
|
-
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1849
|
-
debug("tilde return", ret);
|
|
1850
|
-
return ret;
|
|
1851
|
-
});
|
|
1852
|
-
};
|
|
1853
|
-
const replaceCarets = (comp, options) => comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
1854
|
-
const replaceCaret = (comp, options) => {
|
|
1855
|
-
debug("caret", comp, options);
|
|
1856
|
-
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
1857
|
-
const z = options.includePrerelease ? "-0" : "";
|
|
1858
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1859
|
-
debug("caret", comp, _, M, m, p, pr);
|
|
1860
|
-
let ret;
|
|
1861
|
-
if (isX(M)) ret = "";
|
|
1862
|
-
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
1863
|
-
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`;
|
|
1864
|
-
else if (pr) {
|
|
1865
|
-
debug("replaceCaret pr", pr);
|
|
1866
|
-
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`;
|
|
1867
|
-
} else {
|
|
1868
|
-
debug("no pr");
|
|
1869
|
-
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`;
|
|
1870
|
-
}
|
|
1871
|
-
debug("caret return", ret);
|
|
1872
|
-
return ret;
|
|
1873
|
-
});
|
|
1874
|
-
};
|
|
1875
|
-
const replaceXRanges = (comp, options) => {
|
|
1876
|
-
debug("replaceXRanges", comp, options);
|
|
1877
|
-
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
1878
|
-
};
|
|
1879
|
-
const replaceXRange = (comp, options) => {
|
|
1880
|
-
comp = comp.trim();
|
|
1881
|
-
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
1882
|
-
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1883
|
-
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1884
|
-
const xM = isX(M);
|
|
1885
|
-
const xm = xM || isX(m);
|
|
1886
|
-
const xp = xm || isX(p);
|
|
1887
|
-
const anyX = xp;
|
|
1888
|
-
if ("=" === gtlt && anyX) gtlt = "";
|
|
1889
|
-
pr = options.includePrerelease ? "-0" : "";
|
|
1890
|
-
if (xM) ret = ">" === gtlt || "<" === gtlt ? "<0.0.0-0" : "*";
|
|
1891
|
-
else if (gtlt && anyX) {
|
|
1892
|
-
if (xm) m = 0;
|
|
1893
|
-
p = 0;
|
|
1894
|
-
if (">" === gtlt) {
|
|
1895
|
-
gtlt = ">=";
|
|
1896
|
-
if (xm) {
|
|
1897
|
-
M = +M + 1;
|
|
1898
|
-
m = 0;
|
|
1899
|
-
p = 0;
|
|
1900
|
-
} else {
|
|
1901
|
-
m = +m + 1;
|
|
1902
|
-
p = 0;
|
|
1903
|
-
}
|
|
1904
|
-
} else if ("<=" === gtlt) {
|
|
1905
|
-
gtlt = "<";
|
|
1906
|
-
if (xm) M = +M + 1;
|
|
1907
|
-
else m = +m + 1;
|
|
1908
|
-
}
|
|
1909
|
-
if ("<" === gtlt) pr = "-0";
|
|
1910
|
-
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
1911
|
-
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
1912
|
-
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1913
|
-
debug("xRange return", ret);
|
|
1914
|
-
return ret;
|
|
1915
|
-
});
|
|
1916
|
-
};
|
|
1917
|
-
const replaceStars = (comp, options) => {
|
|
1918
|
-
debug("replaceStars", comp, options);
|
|
1919
|
-
return comp.trim().replace(re[t.STAR], "");
|
|
1920
|
-
};
|
|
1921
|
-
const replaceGTE0 = (comp, options) => {
|
|
1922
|
-
debug("replaceGTE0", comp, options);
|
|
1923
|
-
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
1924
|
-
};
|
|
1925
|
-
const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
1926
|
-
from = isX(fM) ? "" : isX(fm) ? `>=${fM}.0.0${incPr ? "-0" : ""}` : isX(fp) ? `>=${fM}.${fm}.0${incPr ? "-0" : ""}` : fpr ? `>=${from}` : `>=${from}${incPr ? "-0" : ""}`;
|
|
1927
|
-
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}`;
|
|
1928
|
-
return `${from} ${to}`.trim();
|
|
1929
|
-
};
|
|
1930
|
-
const testSet = (set, version, options) => {
|
|
1931
|
-
for (let i = 0; i < set.length; i++) if (!set[i].test(version)) return false;
|
|
1932
|
-
if (version.prerelease.length && !options.includePrerelease) {
|
|
1933
|
-
for (let i = 0; i < set.length; i++) {
|
|
1934
|
-
debug(set[i].semver);
|
|
1935
|
-
if (set[i].semver !== Comparator.ANY) {
|
|
1936
|
-
if (set[i].semver.prerelease.length > 0) {
|
|
1937
|
-
const allowed = set[i].semver;
|
|
1938
|
-
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true;
|
|
1939
|
-
}
|
|
1940
|
-
}
|
|
1941
|
-
}
|
|
1942
|
-
return false;
|
|
1943
|
-
}
|
|
1944
|
-
return true;
|
|
1945
|
-
};
|
|
1946
|
-
},
|
|
1947
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
1948
|
-
const debug = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js");
|
|
1949
|
-
const { MAX_LENGTH, MAX_SAFE_INTEGER } = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js");
|
|
1950
|
-
const { safeRe: re, safeSrc: src, t } = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js");
|
|
1951
|
-
const parseOptions = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/parse-options.js");
|
|
1952
|
-
const { compareIdentifiers } = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/identifiers.js");
|
|
1953
|
-
class SemVer {
|
|
1954
|
-
constructor(version, options) {
|
|
1955
|
-
options = parseOptions(options);
|
|
1956
|
-
if (version instanceof SemVer) if (!!options.loose === version.loose && !!options.includePrerelease === version.includePrerelease) return version;
|
|
1957
|
-
else version = version.version;
|
|
1958
|
-
else if ("string" != typeof version) throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
1959
|
-
if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
1960
|
-
debug("SemVer", version, options);
|
|
1961
|
-
this.options = options;
|
|
1962
|
-
this.loose = !!options.loose;
|
|
1963
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
1964
|
-
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
1965
|
-
if (!m) throw new TypeError(`Invalid Version: ${version}`);
|
|
1966
|
-
this.raw = version;
|
|
1967
|
-
this.major = +m[1];
|
|
1968
|
-
this.minor = +m[2];
|
|
1969
|
-
this.patch = +m[3];
|
|
1970
|
-
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
|
|
1971
|
-
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
|
|
1972
|
-
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
|
|
1973
|
-
if (m[4]) this.prerelease = m[4].split(".").map((id) => {
|
|
1974
|
-
if (/^[0-9]+$/.test(id)) {
|
|
1975
|
-
const num = +id;
|
|
1976
|
-
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
1977
|
-
}
|
|
1978
|
-
return id;
|
|
1979
|
-
});
|
|
1980
|
-
else this.prerelease = [];
|
|
1981
|
-
this.build = m[5] ? m[5].split(".") : [];
|
|
1982
|
-
this.format();
|
|
1983
|
-
}
|
|
1984
|
-
format() {
|
|
1985
|
-
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
1986
|
-
if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
|
|
1987
|
-
return this.version;
|
|
1988
|
-
}
|
|
1989
|
-
toString() {
|
|
1990
|
-
return this.version;
|
|
1991
|
-
}
|
|
1992
|
-
compare(other) {
|
|
1993
|
-
debug("SemVer.compare", this.version, this.options, other);
|
|
1994
|
-
if (!(other instanceof SemVer)) {
|
|
1995
|
-
if ("string" == typeof other && other === this.version) return 0;
|
|
1996
|
-
other = new SemVer(other, this.options);
|
|
1997
|
-
}
|
|
1998
|
-
if (other.version === this.version) return 0;
|
|
1999
|
-
return this.compareMain(other) || this.comparePre(other);
|
|
2000
|
-
}
|
|
2001
|
-
compareMain(other) {
|
|
2002
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
2003
|
-
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
|
2004
|
-
}
|
|
2005
|
-
comparePre(other) {
|
|
2006
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
2007
|
-
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
2008
|
-
if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
2009
|
-
if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
2010
|
-
let i = 0;
|
|
2011
|
-
do {
|
|
2012
|
-
const a = this.prerelease[i];
|
|
2013
|
-
const b = other.prerelease[i];
|
|
2014
|
-
debug("prerelease compare", i, a, b);
|
|
2015
|
-
if (void 0 === a && void 0 === b) return 0;
|
|
2016
|
-
if (void 0 === b) return 1;
|
|
2017
|
-
if (void 0 === a) return -1;
|
|
2018
|
-
else if (a === b) continue;
|
|
2019
|
-
else return compareIdentifiers(a, b);
|
|
2020
|
-
} while (++i);
|
|
2021
|
-
}
|
|
2022
|
-
compareBuild(other) {
|
|
2023
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
2024
|
-
let i = 0;
|
|
2025
|
-
do {
|
|
2026
|
-
const a = this.build[i];
|
|
2027
|
-
const b = other.build[i];
|
|
2028
|
-
debug("build compare", i, a, b);
|
|
2029
|
-
if (void 0 === a && void 0 === b) return 0;
|
|
2030
|
-
if (void 0 === b) return 1;
|
|
2031
|
-
if (void 0 === a) return -1;
|
|
2032
|
-
else if (a === b) continue;
|
|
2033
|
-
else return compareIdentifiers(a, b);
|
|
2034
|
-
} while (++i);
|
|
2035
|
-
}
|
|
2036
|
-
inc(release, identifier, identifierBase) {
|
|
2037
|
-
if (release.startsWith("pre")) {
|
|
2038
|
-
if (!identifier && false === identifierBase) throw new Error("invalid increment argument: identifier is empty");
|
|
2039
|
-
if (identifier) {
|
|
2040
|
-
const r = new RegExp(`^${this.options.loose ? src[t.PRERELEASELOOSE] : src[t.PRERELEASE]}$`);
|
|
2041
|
-
const match = `-${identifier}`.match(r);
|
|
2042
|
-
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
2043
|
-
}
|
|
2044
|
-
}
|
|
2045
|
-
switch (release) {
|
|
2046
|
-
case "premajor":
|
|
2047
|
-
this.prerelease.length = 0;
|
|
2048
|
-
this.patch = 0;
|
|
2049
|
-
this.minor = 0;
|
|
2050
|
-
this.major++;
|
|
2051
|
-
this.inc("pre", identifier, identifierBase);
|
|
2052
|
-
break;
|
|
2053
|
-
case "preminor":
|
|
2054
|
-
this.prerelease.length = 0;
|
|
2055
|
-
this.patch = 0;
|
|
2056
|
-
this.minor++;
|
|
2057
|
-
this.inc("pre", identifier, identifierBase);
|
|
2058
|
-
break;
|
|
2059
|
-
case "prepatch":
|
|
2060
|
-
this.prerelease.length = 0;
|
|
2061
|
-
this.inc("patch", identifier, identifierBase);
|
|
2062
|
-
this.inc("pre", identifier, identifierBase);
|
|
2063
|
-
break;
|
|
2064
|
-
case "prerelease":
|
|
2065
|
-
if (0 === this.prerelease.length) this.inc("patch", identifier, identifierBase);
|
|
2066
|
-
this.inc("pre", identifier, identifierBase);
|
|
2067
|
-
break;
|
|
2068
|
-
case "release":
|
|
2069
|
-
if (0 === this.prerelease.length) throw new Error(`version ${this.raw} is not a prerelease`);
|
|
2070
|
-
this.prerelease.length = 0;
|
|
2071
|
-
break;
|
|
2072
|
-
case "major":
|
|
2073
|
-
if (0 !== this.minor || 0 !== this.patch || 0 === this.prerelease.length) this.major++;
|
|
2074
|
-
this.minor = 0;
|
|
2075
|
-
this.patch = 0;
|
|
2076
|
-
this.prerelease = [];
|
|
2077
|
-
break;
|
|
2078
|
-
case "minor":
|
|
2079
|
-
if (0 !== this.patch || 0 === this.prerelease.length) this.minor++;
|
|
2080
|
-
this.patch = 0;
|
|
2081
|
-
this.prerelease = [];
|
|
2082
|
-
break;
|
|
2083
|
-
case "patch":
|
|
2084
|
-
if (0 === this.prerelease.length) this.patch++;
|
|
2085
|
-
this.prerelease = [];
|
|
2086
|
-
break;
|
|
2087
|
-
case "pre": {
|
|
2088
|
-
const base = Number(identifierBase) ? 1 : 0;
|
|
2089
|
-
if (0 === this.prerelease.length) this.prerelease = [
|
|
2090
|
-
base
|
|
2091
|
-
];
|
|
2092
|
-
else {
|
|
2093
|
-
let i = this.prerelease.length;
|
|
2094
|
-
while (--i >= 0) if ("number" == typeof this.prerelease[i]) {
|
|
2095
|
-
this.prerelease[i]++;
|
|
2096
|
-
i = -2;
|
|
2097
|
-
}
|
|
2098
|
-
if (-1 === i) {
|
|
2099
|
-
if (identifier === this.prerelease.join(".") && false === identifierBase) throw new Error("invalid increment argument: identifier already exists");
|
|
2100
|
-
this.prerelease.push(base);
|
|
2101
|
-
}
|
|
2102
|
-
}
|
|
2103
|
-
if (identifier) {
|
|
2104
|
-
let prerelease = [
|
|
2105
|
-
identifier,
|
|
2106
|
-
base
|
|
2107
|
-
];
|
|
2108
|
-
if (false === identifierBase) prerelease = [
|
|
2109
|
-
identifier
|
|
2110
|
-
];
|
|
2111
|
-
if (0 === compareIdentifiers(this.prerelease[0], identifier)) {
|
|
2112
|
-
if (isNaN(this.prerelease[1])) this.prerelease = prerelease;
|
|
2113
|
-
} else this.prerelease = prerelease;
|
|
2114
|
-
}
|
|
2115
|
-
break;
|
|
2116
|
-
}
|
|
2117
|
-
default:
|
|
2118
|
-
throw new Error(`invalid increment argument: ${release}`);
|
|
2119
|
-
}
|
|
2120
|
-
this.raw = this.format();
|
|
2121
|
-
if (this.build.length) this.raw += `+${this.build.join(".")}`;
|
|
2122
|
-
return this;
|
|
2123
|
-
}
|
|
2124
|
-
}
|
|
2125
|
-
module2.exports = SemVer;
|
|
2126
|
-
},
|
|
2127
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/clean.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2128
|
-
const parse = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js");
|
|
2129
|
-
const clean = (version, options) => {
|
|
2130
|
-
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
2131
|
-
return s ? s.version : null;
|
|
2132
|
-
};
|
|
2133
|
-
module2.exports = clean;
|
|
2134
|
-
},
|
|
2135
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/cmp.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2136
|
-
const eq = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/eq.js");
|
|
2137
|
-
const neq = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/neq.js");
|
|
2138
|
-
const gt = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js");
|
|
2139
|
-
const gte = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gte.js");
|
|
2140
|
-
const lt = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lt.js");
|
|
2141
|
-
const lte = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lte.js");
|
|
2142
|
-
const cmp = (a, op, b, loose) => {
|
|
2143
|
-
switch (op) {
|
|
2144
|
-
case "===":
|
|
2145
|
-
if ("object" == typeof a) a = a.version;
|
|
2146
|
-
if ("object" == typeof b) b = b.version;
|
|
2147
|
-
return a === b;
|
|
2148
|
-
case "!==":
|
|
2149
|
-
if ("object" == typeof a) a = a.version;
|
|
2150
|
-
if ("object" == typeof b) b = b.version;
|
|
2151
|
-
return a !== b;
|
|
2152
|
-
case "":
|
|
2153
|
-
case "=":
|
|
2154
|
-
case "==":
|
|
2155
|
-
return eq(a, b, loose);
|
|
2156
|
-
case "!=":
|
|
2157
|
-
return neq(a, b, loose);
|
|
2158
|
-
case ">":
|
|
2159
|
-
return gt(a, b, loose);
|
|
2160
|
-
case ">=":
|
|
2161
|
-
return gte(a, b, loose);
|
|
2162
|
-
case "<":
|
|
2163
|
-
return lt(a, b, loose);
|
|
2164
|
-
case "<=":
|
|
2165
|
-
return lte(a, b, loose);
|
|
2166
|
-
default:
|
|
2167
|
-
throw new TypeError(`Invalid operator: ${op}`);
|
|
2168
|
-
}
|
|
2169
|
-
};
|
|
2170
|
-
module2.exports = cmp;
|
|
2171
|
-
},
|
|
2172
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/coerce.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2173
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
2174
|
-
const parse = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js");
|
|
2175
|
-
const { safeRe: re, t } = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js");
|
|
2176
|
-
const coerce = (version, options) => {
|
|
2177
|
-
if (version instanceof SemVer) return version;
|
|
2178
|
-
if ("number" == typeof version) version = String(version);
|
|
2179
|
-
if ("string" != typeof version) return null;
|
|
2180
|
-
options = options || {};
|
|
2181
|
-
let match = null;
|
|
2182
|
-
if (options.rtl) {
|
|
2183
|
-
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
2184
|
-
let next;
|
|
2185
|
-
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
2186
|
-
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
2187
|
-
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
2188
|
-
}
|
|
2189
|
-
coerceRtlRegex.lastIndex = -1;
|
|
2190
|
-
} else match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
2191
|
-
if (null === match) return null;
|
|
2192
|
-
const major = match[2];
|
|
2193
|
-
const minor = match[3] || "0";
|
|
2194
|
-
const patch = match[4] || "0";
|
|
2195
|
-
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
2196
|
-
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
2197
|
-
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
2198
|
-
};
|
|
2199
|
-
module2.exports = coerce;
|
|
2200
|
-
},
|
|
2201
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-build.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2202
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
2203
|
-
const compareBuild = (a, b, loose) => {
|
|
2204
|
-
const versionA = new SemVer(a, loose);
|
|
2205
|
-
const versionB = new SemVer(b, loose);
|
|
2206
|
-
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
2207
|
-
};
|
|
2208
|
-
module2.exports = compareBuild;
|
|
2209
|
-
},
|
|
2210
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-loose.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2211
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
2212
|
-
const compareLoose = (a, b) => compare(a, b, true);
|
|
2213
|
-
module2.exports = compareLoose;
|
|
2214
|
-
},
|
|
2215
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2216
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
2217
|
-
const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
2218
|
-
module2.exports = compare;
|
|
2219
|
-
},
|
|
2220
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/diff.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2221
|
-
const parse = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js");
|
|
2222
|
-
const diff = (version1, version2) => {
|
|
2223
|
-
const v1 = parse(version1, null, true);
|
|
2224
|
-
const v2 = parse(version2, null, true);
|
|
2225
|
-
const comparison = v1.compare(v2);
|
|
2226
|
-
if (0 === comparison) return null;
|
|
2227
|
-
const v1Higher = comparison > 0;
|
|
2228
|
-
const highVersion = v1Higher ? v1 : v2;
|
|
2229
|
-
const lowVersion = v1Higher ? v2 : v1;
|
|
2230
|
-
const highHasPre = !!highVersion.prerelease.length;
|
|
2231
|
-
const lowHasPre = !!lowVersion.prerelease.length;
|
|
2232
|
-
if (lowHasPre && !highHasPre) {
|
|
2233
|
-
if (!lowVersion.patch && !lowVersion.minor) return "major";
|
|
2234
|
-
if (0 === lowVersion.compareMain(highVersion)) {
|
|
2235
|
-
if (lowVersion.minor && !lowVersion.patch) return "minor";
|
|
2236
|
-
return "patch";
|
|
2237
|
-
}
|
|
2238
|
-
}
|
|
2239
|
-
const prefix = highHasPre ? "pre" : "";
|
|
2240
|
-
if (v1.major !== v2.major) return prefix + "major";
|
|
2241
|
-
if (v1.minor !== v2.minor) return prefix + "minor";
|
|
2242
|
-
if (v1.patch !== v2.patch) return prefix + "patch";
|
|
2243
|
-
return "prerelease";
|
|
2244
|
-
};
|
|
2245
|
-
module2.exports = diff;
|
|
2246
|
-
},
|
|
2247
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/eq.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2248
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
2249
|
-
const eq = (a, b, loose) => 0 === compare(a, b, loose);
|
|
2250
|
-
module2.exports = eq;
|
|
2251
|
-
},
|
|
2252
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2253
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
2254
|
-
const gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
2255
|
-
module2.exports = gt;
|
|
2256
|
-
},
|
|
2257
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gte.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2258
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
2259
|
-
const gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
2260
|
-
module2.exports = gte;
|
|
2261
|
-
},
|
|
2262
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/inc.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2263
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
2264
|
-
const inc = (version, release, options, identifier, identifierBase) => {
|
|
2265
|
-
if ("string" == typeof options) {
|
|
2266
|
-
identifierBase = identifier;
|
|
2267
|
-
identifier = options;
|
|
2268
|
-
options = void 0;
|
|
2269
|
-
}
|
|
2270
|
-
try {
|
|
2271
|
-
return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier, identifierBase).version;
|
|
2272
|
-
} catch (er) {
|
|
2273
|
-
return null;
|
|
2274
|
-
}
|
|
2275
|
-
};
|
|
2276
|
-
module2.exports = inc;
|
|
2277
|
-
},
|
|
2278
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lt.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2279
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
2280
|
-
const lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
2281
|
-
module2.exports = lt;
|
|
2282
|
-
},
|
|
2283
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lte.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2284
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
2285
|
-
const lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
2286
|
-
module2.exports = lte;
|
|
2287
|
-
},
|
|
2288
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/major.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2289
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
2290
|
-
const major = (a, loose) => new SemVer(a, loose).major;
|
|
2291
|
-
module2.exports = major;
|
|
2292
|
-
},
|
|
2293
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/minor.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2294
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
2295
|
-
const minor = (a, loose) => new SemVer(a, loose).minor;
|
|
2296
|
-
module2.exports = minor;
|
|
2297
|
-
},
|
|
2298
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/neq.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2299
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
2300
|
-
const neq = (a, b, loose) => 0 !== compare(a, b, loose);
|
|
2301
|
-
module2.exports = neq;
|
|
2302
|
-
},
|
|
2303
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2304
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
2305
|
-
const parse = (version, options, throwErrors = false) => {
|
|
2306
|
-
if (version instanceof SemVer) return version;
|
|
2307
|
-
try {
|
|
2308
|
-
return new SemVer(version, options);
|
|
2309
|
-
} catch (er) {
|
|
2310
|
-
if (!throwErrors) return null;
|
|
2311
|
-
throw er;
|
|
2312
|
-
}
|
|
2313
|
-
};
|
|
2314
|
-
module2.exports = parse;
|
|
2315
|
-
},
|
|
2316
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/patch.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2317
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
2318
|
-
const patch = (a, loose) => new SemVer(a, loose).patch;
|
|
2319
|
-
module2.exports = patch;
|
|
2320
|
-
},
|
|
2321
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/prerelease.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2322
|
-
const parse = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js");
|
|
2323
|
-
const prerelease = (version, options) => {
|
|
2324
|
-
const parsed = parse(version, options);
|
|
2325
|
-
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
2326
|
-
};
|
|
2327
|
-
module2.exports = prerelease;
|
|
2328
|
-
},
|
|
2329
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rcompare.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2330
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
2331
|
-
const rcompare = (a, b, loose) => compare(b, a, loose);
|
|
2332
|
-
module2.exports = rcompare;
|
|
2333
|
-
},
|
|
2334
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rsort.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2335
|
-
const compareBuild = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-build.js");
|
|
2336
|
-
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
2337
|
-
module2.exports = rsort;
|
|
2338
|
-
},
|
|
2339
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/satisfies.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2340
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
2341
|
-
const satisfies = (version, range, options) => {
|
|
2342
|
-
try {
|
|
2343
|
-
range = new Range(range, options);
|
|
2344
|
-
} catch (er) {
|
|
2345
|
-
return false;
|
|
2346
|
-
}
|
|
2347
|
-
return range.test(version);
|
|
2348
|
-
};
|
|
2349
|
-
module2.exports = satisfies;
|
|
2350
|
-
},
|
|
2351
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/sort.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2352
|
-
const compareBuild = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-build.js");
|
|
2353
|
-
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
2354
|
-
module2.exports = sort;
|
|
2355
|
-
},
|
|
2356
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/valid.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2357
|
-
const parse = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js");
|
|
2358
|
-
const valid = (version, options) => {
|
|
2359
|
-
const v = parse(version, options);
|
|
2360
|
-
return v ? v.version : null;
|
|
2361
|
-
};
|
|
2362
|
-
module2.exports = valid;
|
|
2363
|
-
},
|
|
2364
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/index.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2365
|
-
const internalRe = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js");
|
|
2366
|
-
const constants = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js");
|
|
2367
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
2368
|
-
const identifiers = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/identifiers.js");
|
|
2369
|
-
const parse = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js");
|
|
2370
|
-
const valid = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/valid.js");
|
|
2371
|
-
const clean = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/clean.js");
|
|
2372
|
-
const inc = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/inc.js");
|
|
2373
|
-
const diff = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/diff.js");
|
|
2374
|
-
const major = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/major.js");
|
|
2375
|
-
const minor = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/minor.js");
|
|
2376
|
-
const patch = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/patch.js");
|
|
2377
|
-
const prerelease = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/prerelease.js");
|
|
2378
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
2379
|
-
const rcompare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rcompare.js");
|
|
2380
|
-
const compareLoose = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-loose.js");
|
|
2381
|
-
const compareBuild = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-build.js");
|
|
2382
|
-
const sort = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/sort.js");
|
|
2383
|
-
const rsort = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rsort.js");
|
|
2384
|
-
const gt = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js");
|
|
2385
|
-
const lt = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lt.js");
|
|
2386
|
-
const eq = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/eq.js");
|
|
2387
|
-
const neq = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/neq.js");
|
|
2388
|
-
const gte = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gte.js");
|
|
2389
|
-
const lte = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lte.js");
|
|
2390
|
-
const cmp = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/cmp.js");
|
|
2391
|
-
const coerce = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/coerce.js");
|
|
2392
|
-
const Comparator = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/comparator.js");
|
|
2393
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
2394
|
-
const satisfies = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/satisfies.js");
|
|
2395
|
-
const toComparators = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/to-comparators.js");
|
|
2396
|
-
const maxSatisfying = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/max-satisfying.js");
|
|
2397
|
-
const minSatisfying = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/min-satisfying.js");
|
|
2398
|
-
const minVersion = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/min-version.js");
|
|
2399
|
-
const validRange = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/valid.js");
|
|
2400
|
-
const outside = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/outside.js");
|
|
2401
|
-
const gtr = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/gtr.js");
|
|
2402
|
-
const ltr = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/ltr.js");
|
|
2403
|
-
const intersects = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/intersects.js");
|
|
2404
|
-
const simplifyRange = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/simplify.js");
|
|
2405
|
-
const subset = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/subset.js");
|
|
2406
|
-
module2.exports = {
|
|
2407
|
-
parse,
|
|
2408
|
-
valid,
|
|
2409
|
-
clean,
|
|
2410
|
-
inc,
|
|
2411
|
-
diff,
|
|
2412
|
-
major,
|
|
2413
|
-
minor,
|
|
2414
|
-
patch,
|
|
2415
|
-
prerelease,
|
|
2416
|
-
compare,
|
|
2417
|
-
rcompare,
|
|
2418
|
-
compareLoose,
|
|
2419
|
-
compareBuild,
|
|
2420
|
-
sort,
|
|
2421
|
-
rsort,
|
|
2422
|
-
gt,
|
|
2423
|
-
lt,
|
|
2424
|
-
eq,
|
|
2425
|
-
neq,
|
|
2426
|
-
gte,
|
|
2427
|
-
lte,
|
|
2428
|
-
cmp,
|
|
2429
|
-
coerce,
|
|
2430
|
-
Comparator,
|
|
2431
|
-
Range,
|
|
2432
|
-
satisfies,
|
|
2433
|
-
toComparators,
|
|
2434
|
-
maxSatisfying,
|
|
2435
|
-
minSatisfying,
|
|
2436
|
-
minVersion,
|
|
2437
|
-
validRange,
|
|
2438
|
-
outside,
|
|
2439
|
-
gtr,
|
|
2440
|
-
ltr,
|
|
2441
|
-
intersects,
|
|
2442
|
-
simplifyRange,
|
|
2443
|
-
subset,
|
|
2444
|
-
SemVer,
|
|
2445
|
-
re: internalRe.re,
|
|
2446
|
-
src: internalRe.src,
|
|
2447
|
-
tokens: internalRe.t,
|
|
2448
|
-
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
2449
|
-
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
2450
|
-
compareIdentifiers: identifiers.compareIdentifiers,
|
|
2451
|
-
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
2452
|
-
};
|
|
2453
|
-
},
|
|
2454
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js": function(module2) {
|
|
2455
|
-
const SEMVER_SPEC_VERSION = "2.0.0";
|
|
2456
|
-
const MAX_LENGTH = 256;
|
|
2457
|
-
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
2458
|
-
const MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
2459
|
-
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
2460
|
-
const RELEASE_TYPES = [
|
|
2461
|
-
"major",
|
|
2462
|
-
"premajor",
|
|
2463
|
-
"minor",
|
|
2464
|
-
"preminor",
|
|
2465
|
-
"patch",
|
|
2466
|
-
"prepatch",
|
|
2467
|
-
"prerelease"
|
|
2468
|
-
];
|
|
2469
|
-
module2.exports = {
|
|
2470
|
-
MAX_LENGTH,
|
|
2471
|
-
MAX_SAFE_COMPONENT_LENGTH,
|
|
2472
|
-
MAX_SAFE_BUILD_LENGTH,
|
|
2473
|
-
MAX_SAFE_INTEGER,
|
|
2474
|
-
RELEASE_TYPES,
|
|
2475
|
-
SEMVER_SPEC_VERSION,
|
|
2476
|
-
FLAG_INCLUDE_PRERELEASE: 1,
|
|
2477
|
-
FLAG_LOOSE: 2
|
|
2478
|
-
};
|
|
2479
|
-
},
|
|
2480
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js": function(module2) {
|
|
2481
|
-
const debug = "object" == typeof process && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
2482
|
-
};
|
|
2483
|
-
module2.exports = debug;
|
|
2484
|
-
},
|
|
2485
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/identifiers.js": function(module2) {
|
|
2486
|
-
const numeric = /^[0-9]+$/;
|
|
2487
|
-
const compareIdentifiers = (a, b) => {
|
|
2488
|
-
const anum = numeric.test(a);
|
|
2489
|
-
const bnum = numeric.test(b);
|
|
2490
|
-
if (anum && bnum) {
|
|
2491
|
-
a *= 1;
|
|
2492
|
-
b *= 1;
|
|
2493
|
-
}
|
|
2494
|
-
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
2495
|
-
};
|
|
2496
|
-
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
2497
|
-
module2.exports = {
|
|
2498
|
-
compareIdentifiers,
|
|
2499
|
-
rcompareIdentifiers
|
|
2500
|
-
};
|
|
2501
|
-
},
|
|
2502
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/lrucache.js": function(module2) {
|
|
2503
|
-
class LRUCache {
|
|
2504
|
-
constructor() {
|
|
2505
|
-
this.max = 1e3;
|
|
2506
|
-
this.map = /* @__PURE__ */ new Map();
|
|
2507
|
-
}
|
|
2508
|
-
get(key) {
|
|
2509
|
-
const value = this.map.get(key);
|
|
2510
|
-
if (void 0 === value) return;
|
|
2511
|
-
this.map.delete(key);
|
|
2512
|
-
this.map.set(key, value);
|
|
2513
|
-
return value;
|
|
2514
|
-
}
|
|
2515
|
-
delete(key) {
|
|
2516
|
-
return this.map.delete(key);
|
|
2517
|
-
}
|
|
2518
|
-
set(key, value) {
|
|
2519
|
-
const deleted = this.delete(key);
|
|
2520
|
-
if (!deleted && void 0 !== value) {
|
|
2521
|
-
if (this.map.size >= this.max) {
|
|
2522
|
-
const firstKey = this.map.keys().next().value;
|
|
2523
|
-
this.delete(firstKey);
|
|
2524
|
-
}
|
|
2525
|
-
this.map.set(key, value);
|
|
2526
|
-
}
|
|
2527
|
-
return this;
|
|
2528
|
-
}
|
|
2529
|
-
}
|
|
2530
|
-
module2.exports = LRUCache;
|
|
2531
|
-
},
|
|
2532
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/parse-options.js": function(module2) {
|
|
2533
|
-
const looseOption = Object.freeze({
|
|
2534
|
-
loose: true
|
|
2535
|
-
});
|
|
2536
|
-
const emptyOpts = Object.freeze({});
|
|
2537
|
-
const parseOptions = (options) => {
|
|
2538
|
-
if (!options) return emptyOpts;
|
|
2539
|
-
if ("object" != typeof options) return looseOption;
|
|
2540
|
-
return options;
|
|
2541
|
-
};
|
|
2542
|
-
module2.exports = parseOptions;
|
|
2543
|
-
},
|
|
2544
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js": function(module2, exports2, __webpack_require__2) {
|
|
2545
|
-
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js");
|
|
2546
|
-
const debug = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js");
|
|
2547
|
-
exports2 = module2.exports = {};
|
|
2548
|
-
const re = exports2.re = [];
|
|
2549
|
-
const safeRe = exports2.safeRe = [];
|
|
2550
|
-
const src = exports2.src = [];
|
|
2551
|
-
const safeSrc = exports2.safeSrc = [];
|
|
2552
|
-
const t = exports2.t = {};
|
|
2553
|
-
let R = 0;
|
|
2554
|
-
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
2555
|
-
const safeRegexReplacements = [
|
|
2556
|
-
[
|
|
2557
|
-
"\\s",
|
|
2558
|
-
1
|
|
2559
|
-
],
|
|
2560
|
-
[
|
|
2561
|
-
"\\d",
|
|
2562
|
-
MAX_LENGTH
|
|
2563
|
-
],
|
|
2564
|
-
[
|
|
2565
|
-
LETTERDASHNUMBER,
|
|
2566
|
-
MAX_SAFE_BUILD_LENGTH
|
|
2567
|
-
]
|
|
2568
|
-
];
|
|
2569
|
-
const makeSafeRegex = (value) => {
|
|
2570
|
-
for (const [token, max] of safeRegexReplacements) value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
2571
|
-
return value;
|
|
2572
|
-
};
|
|
2573
|
-
const createToken = (name, value, isGlobal) => {
|
|
2574
|
-
const safe = makeSafeRegex(value);
|
|
2575
|
-
const index = R++;
|
|
2576
|
-
debug(name, index, value);
|
|
2577
|
-
t[name] = index;
|
|
2578
|
-
src[index] = value;
|
|
2579
|
-
safeSrc[index] = safe;
|
|
2580
|
-
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
2581
|
-
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
2582
|
-
};
|
|
2583
|
-
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
2584
|
-
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
2585
|
-
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
2586
|
-
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
2587
|
-
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
2588
|
-
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
|
|
2589
|
-
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
|
|
2590
|
-
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
2591
|
-
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
2592
|
-
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
2593
|
-
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
2594
|
-
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
2595
|
-
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
2596
|
-
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
2597
|
-
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
2598
|
-
createToken("GTLT", "((?:<|>)?=?)");
|
|
2599
|
-
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
2600
|
-
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
2601
|
-
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
2602
|
-
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
2603
|
-
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
2604
|
-
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
2605
|
-
createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
2606
|
-
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
2607
|
-
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
2608
|
-
createToken("COERCERTL", src[t.COERCE], true);
|
|
2609
|
-
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
2610
|
-
createToken("LONETILDE", "(?:~>?)");
|
|
2611
|
-
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
2612
|
-
exports2.tildeTrimReplace = "$1~";
|
|
2613
|
-
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
2614
|
-
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
2615
|
-
createToken("LONECARET", "(?:\\^)");
|
|
2616
|
-
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
2617
|
-
exports2.caretTrimReplace = "$1^";
|
|
2618
|
-
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
2619
|
-
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
2620
|
-
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
2621
|
-
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
2622
|
-
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
2623
|
-
exports2.comparatorTrimReplace = "$1$2$3";
|
|
2624
|
-
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
2625
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
2626
|
-
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
2627
|
-
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
2628
|
-
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
2629
|
-
},
|
|
2630
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/gtr.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2631
|
-
const outside = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/outside.js");
|
|
2632
|
-
const gtr = (version, range, options) => outside(version, range, ">", options);
|
|
2633
|
-
module2.exports = gtr;
|
|
2634
|
-
},
|
|
2635
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/intersects.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2636
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
2637
|
-
const intersects = (r1, r2, options) => {
|
|
2638
|
-
r1 = new Range(r1, options);
|
|
2639
|
-
r2 = new Range(r2, options);
|
|
2640
|
-
return r1.intersects(r2, options);
|
|
2641
|
-
};
|
|
2642
|
-
module2.exports = intersects;
|
|
2643
|
-
},
|
|
2644
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/ltr.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2645
|
-
const outside = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/outside.js");
|
|
2646
|
-
const ltr = (version, range, options) => outside(version, range, "<", options);
|
|
2647
|
-
module2.exports = ltr;
|
|
2648
|
-
},
|
|
2649
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/max-satisfying.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2650
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
2651
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
2652
|
-
const maxSatisfying = (versions, range, options) => {
|
|
2653
|
-
let max = null;
|
|
2654
|
-
let maxSV = null;
|
|
2655
|
-
let rangeObj = null;
|
|
2656
|
-
try {
|
|
2657
|
-
rangeObj = new Range(range, options);
|
|
2658
|
-
} catch (er) {
|
|
2659
|
-
return null;
|
|
2660
|
-
}
|
|
2661
|
-
versions.forEach((v) => {
|
|
2662
|
-
if (rangeObj.test(v)) {
|
|
2663
|
-
if (!max || -1 === maxSV.compare(v)) {
|
|
2664
|
-
max = v;
|
|
2665
|
-
maxSV = new SemVer(max, options);
|
|
2666
|
-
}
|
|
2667
|
-
}
|
|
2668
|
-
});
|
|
2669
|
-
return max;
|
|
2670
|
-
};
|
|
2671
|
-
module2.exports = maxSatisfying;
|
|
2672
|
-
},
|
|
2673
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/min-satisfying.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2674
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
2675
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
2676
|
-
const minSatisfying = (versions, range, options) => {
|
|
2677
|
-
let min = null;
|
|
2678
|
-
let minSV = null;
|
|
2679
|
-
let rangeObj = null;
|
|
2680
|
-
try {
|
|
2681
|
-
rangeObj = new Range(range, options);
|
|
2682
|
-
} catch (er) {
|
|
2683
|
-
return null;
|
|
2684
|
-
}
|
|
2685
|
-
versions.forEach((v) => {
|
|
2686
|
-
if (rangeObj.test(v)) {
|
|
2687
|
-
if (!min || 1 === minSV.compare(v)) {
|
|
2688
|
-
min = v;
|
|
2689
|
-
minSV = new SemVer(min, options);
|
|
2690
|
-
}
|
|
2691
|
-
}
|
|
2692
|
-
});
|
|
2693
|
-
return min;
|
|
2694
|
-
};
|
|
2695
|
-
module2.exports = minSatisfying;
|
|
2696
|
-
},
|
|
2697
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/min-version.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2698
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
2699
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
2700
|
-
const gt = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js");
|
|
2701
|
-
const minVersion = (range, loose) => {
|
|
2702
|
-
range = new Range(range, loose);
|
|
2703
|
-
let minver = new SemVer("0.0.0");
|
|
2704
|
-
if (range.test(minver)) return minver;
|
|
2705
|
-
minver = new SemVer("0.0.0-0");
|
|
2706
|
-
if (range.test(minver)) return minver;
|
|
2707
|
-
minver = null;
|
|
2708
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
2709
|
-
const comparators = range.set[i];
|
|
2710
|
-
let setMin = null;
|
|
2711
|
-
comparators.forEach((comparator) => {
|
|
2712
|
-
const compver = new SemVer(comparator.semver.version);
|
|
2713
|
-
switch (comparator.operator) {
|
|
2714
|
-
case ">":
|
|
2715
|
-
if (0 === compver.prerelease.length) compver.patch++;
|
|
2716
|
-
else compver.prerelease.push(0);
|
|
2717
|
-
compver.raw = compver.format();
|
|
2718
|
-
case "":
|
|
2719
|
-
case ">=":
|
|
2720
|
-
if (!setMin || gt(compver, setMin)) setMin = compver;
|
|
2721
|
-
break;
|
|
2722
|
-
case "<":
|
|
2723
|
-
case "<=":
|
|
2724
|
-
break;
|
|
2725
|
-
default:
|
|
2726
|
-
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
2727
|
-
}
|
|
2728
|
-
});
|
|
2729
|
-
if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
|
|
2730
|
-
}
|
|
2731
|
-
if (minver && range.test(minver)) return minver;
|
|
2732
|
-
return null;
|
|
2733
|
-
};
|
|
2734
|
-
module2.exports = minVersion;
|
|
2735
|
-
},
|
|
2736
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/outside.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2737
|
-
const SemVer = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
2738
|
-
const Comparator = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/comparator.js");
|
|
2739
|
-
const { ANY } = Comparator;
|
|
2740
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
2741
|
-
const satisfies = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/satisfies.js");
|
|
2742
|
-
const gt = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js");
|
|
2743
|
-
const lt = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lt.js");
|
|
2744
|
-
const lte = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lte.js");
|
|
2745
|
-
const gte = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gte.js");
|
|
2746
|
-
const outside = (version, range, hilo, options) => {
|
|
2747
|
-
version = new SemVer(version, options);
|
|
2748
|
-
range = new Range(range, options);
|
|
2749
|
-
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
2750
|
-
switch (hilo) {
|
|
2751
|
-
case ">":
|
|
2752
|
-
gtfn = gt;
|
|
2753
|
-
ltefn = lte;
|
|
2754
|
-
ltfn = lt;
|
|
2755
|
-
comp = ">";
|
|
2756
|
-
ecomp = ">=";
|
|
2757
|
-
break;
|
|
2758
|
-
case "<":
|
|
2759
|
-
gtfn = lt;
|
|
2760
|
-
ltefn = gte;
|
|
2761
|
-
ltfn = gt;
|
|
2762
|
-
comp = "<";
|
|
2763
|
-
ecomp = "<=";
|
|
2764
|
-
break;
|
|
2765
|
-
default:
|
|
2766
|
-
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
2767
|
-
}
|
|
2768
|
-
if (satisfies(version, range, options)) return false;
|
|
2769
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
2770
|
-
const comparators = range.set[i];
|
|
2771
|
-
let high = null;
|
|
2772
|
-
let low = null;
|
|
2773
|
-
comparators.forEach((comparator) => {
|
|
2774
|
-
if (comparator.semver === ANY) comparator = new Comparator(">=0.0.0");
|
|
2775
|
-
high = high || comparator;
|
|
2776
|
-
low = low || comparator;
|
|
2777
|
-
if (gtfn(comparator.semver, high.semver, options)) high = comparator;
|
|
2778
|
-
else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
|
|
2779
|
-
});
|
|
2780
|
-
if (high.operator === comp || high.operator === ecomp) return false;
|
|
2781
|
-
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) return false;
|
|
2782
|
-
if (low.operator === ecomp && ltfn(version, low.semver)) return false;
|
|
2783
|
-
}
|
|
2784
|
-
return true;
|
|
2785
|
-
};
|
|
2786
|
-
module2.exports = outside;
|
|
2787
|
-
},
|
|
2788
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/simplify.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2789
|
-
const satisfies = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/satisfies.js");
|
|
2790
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
2791
|
-
module2.exports = (versions, range, options) => {
|
|
2792
|
-
const set = [];
|
|
2793
|
-
let first = null;
|
|
2794
|
-
let prev = null;
|
|
2795
|
-
const v = versions.sort((a, b) => compare(a, b, options));
|
|
2796
|
-
for (const version of v) {
|
|
2797
|
-
const included = satisfies(version, range, options);
|
|
2798
|
-
if (included) {
|
|
2799
|
-
prev = version;
|
|
2800
|
-
if (!first) first = version;
|
|
2801
|
-
} else {
|
|
2802
|
-
if (prev) set.push([
|
|
2803
|
-
first,
|
|
2804
|
-
prev
|
|
2805
|
-
]);
|
|
2806
|
-
prev = null;
|
|
2807
|
-
first = null;
|
|
2808
|
-
}
|
|
2809
|
-
}
|
|
2810
|
-
if (first) set.push([
|
|
2811
|
-
first,
|
|
2812
|
-
null
|
|
2813
|
-
]);
|
|
2814
|
-
const ranges = [];
|
|
2815
|
-
for (const [min, max] of set) if (min === max) ranges.push(min);
|
|
2816
|
-
else if (max || min !== v[0]) if (max) if (min === v[0]) ranges.push(`<=${max}`);
|
|
2817
|
-
else ranges.push(`${min} - ${max}`);
|
|
2818
|
-
else ranges.push(`>=${min}`);
|
|
2819
|
-
else ranges.push("*");
|
|
2820
|
-
const simplified = ranges.join(" || ");
|
|
2821
|
-
const original = "string" == typeof range.raw ? range.raw : String(range);
|
|
2822
|
-
return simplified.length < original.length ? simplified : range;
|
|
2823
|
-
};
|
|
2824
|
-
},
|
|
2825
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/subset.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2826
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
2827
|
-
const Comparator = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/comparator.js");
|
|
2828
|
-
const { ANY } = Comparator;
|
|
2829
|
-
const satisfies = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/satisfies.js");
|
|
2830
|
-
const compare = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
2831
|
-
const subset = (sub, dom, options = {}) => {
|
|
2832
|
-
if (sub === dom) return true;
|
|
2833
|
-
sub = new Range(sub, options);
|
|
2834
|
-
dom = new Range(dom, options);
|
|
2835
|
-
let sawNonNull = false;
|
|
2836
|
-
OUTER: for (const simpleSub of sub.set) {
|
|
2837
|
-
for (const simpleDom of dom.set) {
|
|
2838
|
-
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
2839
|
-
sawNonNull = sawNonNull || null !== isSub;
|
|
2840
|
-
if (isSub) continue OUTER;
|
|
2841
|
-
}
|
|
2842
|
-
if (sawNonNull) return false;
|
|
2843
|
-
}
|
|
2844
|
-
return true;
|
|
2845
|
-
};
|
|
2846
|
-
const minimumVersionWithPreRelease = [
|
|
2847
|
-
new Comparator(">=0.0.0-0")
|
|
2848
|
-
];
|
|
2849
|
-
const minimumVersion = [
|
|
2850
|
-
new Comparator(">=0.0.0")
|
|
2851
|
-
];
|
|
2852
|
-
const simpleSubset = (sub, dom, options) => {
|
|
2853
|
-
if (sub === dom) return true;
|
|
2854
|
-
if (1 === sub.length && sub[0].semver === ANY) if (1 === dom.length && dom[0].semver === ANY) return true;
|
|
2855
|
-
else sub = options.includePrerelease ? minimumVersionWithPreRelease : minimumVersion;
|
|
2856
|
-
if (1 === dom.length && dom[0].semver === ANY) if (options.includePrerelease) return true;
|
|
2857
|
-
else dom = minimumVersion;
|
|
2858
|
-
const eqSet = /* @__PURE__ */ new Set();
|
|
2859
|
-
let gt, lt;
|
|
2860
|
-
for (const c of sub) if (">" === c.operator || ">=" === c.operator) gt = higherGT(gt, c, options);
|
|
2861
|
-
else if ("<" === c.operator || "<=" === c.operator) lt = lowerLT(lt, c, options);
|
|
2862
|
-
else eqSet.add(c.semver);
|
|
2863
|
-
if (eqSet.size > 1) return null;
|
|
2864
|
-
let gtltComp;
|
|
2865
|
-
if (gt && lt) {
|
|
2866
|
-
gtltComp = compare(gt.semver, lt.semver, options);
|
|
2867
|
-
if (gtltComp > 0) return null;
|
|
2868
|
-
if (0 === gtltComp && (">=" !== gt.operator || "<=" !== lt.operator)) return null;
|
|
2869
|
-
}
|
|
2870
|
-
for (const eq of eqSet) {
|
|
2871
|
-
if (gt && !satisfies(eq, String(gt), options)) return null;
|
|
2872
|
-
if (lt && !satisfies(eq, String(lt), options)) return null;
|
|
2873
|
-
for (const c of dom) if (!satisfies(eq, String(c), options)) return false;
|
|
2874
|
-
return true;
|
|
2875
|
-
}
|
|
2876
|
-
let higher, lower;
|
|
2877
|
-
let hasDomLT, hasDomGT;
|
|
2878
|
-
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
2879
|
-
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
2880
|
-
if (needDomLTPre && 1 === needDomLTPre.prerelease.length && "<" === lt.operator && 0 === needDomLTPre.prerelease[0]) needDomLTPre = false;
|
|
2881
|
-
for (const c of dom) {
|
|
2882
|
-
hasDomGT = hasDomGT || ">" === c.operator || ">=" === c.operator;
|
|
2883
|
-
hasDomLT = hasDomLT || "<" === c.operator || "<=" === c.operator;
|
|
2884
|
-
if (gt) {
|
|
2885
|
-
if (needDomGTPre) {
|
|
2886
|
-
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;
|
|
2887
|
-
}
|
|
2888
|
-
if (">" === c.operator || ">=" === c.operator) {
|
|
2889
|
-
higher = higherGT(gt, c, options);
|
|
2890
|
-
if (higher === c && higher !== gt) return false;
|
|
2891
|
-
} else if (">=" === gt.operator && !satisfies(gt.semver, String(c), options)) return false;
|
|
2892
|
-
}
|
|
2893
|
-
if (lt) {
|
|
2894
|
-
if (needDomLTPre) {
|
|
2895
|
-
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;
|
|
2896
|
-
}
|
|
2897
|
-
if ("<" === c.operator || "<=" === c.operator) {
|
|
2898
|
-
lower = lowerLT(lt, c, options);
|
|
2899
|
-
if (lower === c && lower !== lt) return false;
|
|
2900
|
-
} else if ("<=" === lt.operator && !satisfies(lt.semver, String(c), options)) return false;
|
|
2901
|
-
}
|
|
2902
|
-
if (!c.operator && (lt || gt) && 0 !== gtltComp) return false;
|
|
2903
|
-
}
|
|
2904
|
-
if (gt && hasDomLT && !lt && 0 !== gtltComp) return false;
|
|
2905
|
-
if (lt && hasDomGT && !gt && 0 !== gtltComp) return false;
|
|
2906
|
-
if (needDomGTPre || needDomLTPre) return false;
|
|
2907
|
-
return true;
|
|
2908
|
-
};
|
|
2909
|
-
const higherGT = (a, b, options) => {
|
|
2910
|
-
if (!a) return b;
|
|
2911
|
-
const comp = compare(a.semver, b.semver, options);
|
|
2912
|
-
return comp > 0 ? a : comp < 0 ? b : ">" === b.operator && ">=" === a.operator ? b : a;
|
|
2913
|
-
};
|
|
2914
|
-
const lowerLT = (a, b, options) => {
|
|
2915
|
-
if (!a) return b;
|
|
2916
|
-
const comp = compare(a.semver, b.semver, options);
|
|
2917
|
-
return comp < 0 ? a : comp > 0 ? b : "<" === b.operator && "<=" === a.operator ? b : a;
|
|
2918
|
-
};
|
|
2919
|
-
module2.exports = subset;
|
|
2920
|
-
},
|
|
2921
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/to-comparators.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2922
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
2923
|
-
const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
2924
|
-
module2.exports = toComparators;
|
|
2925
|
-
},
|
|
2926
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/valid.js": function(module2, __unused_webpack_exports, __webpack_require__2) {
|
|
2927
|
-
const Range = __webpack_require__2("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
2928
|
-
const validRange = (range, options) => {
|
|
2929
|
-
try {
|
|
2930
|
-
return new Range(range, options).range || "*";
|
|
2931
|
-
} catch (er) {
|
|
2932
|
-
return null;
|
|
2933
|
-
}
|
|
2934
|
-
};
|
|
2935
|
-
module2.exports = validRange;
|
|
2936
|
-
}
|
|
2937
|
-
};
|
|
2938
|
-
var __webpack_module_cache__ = {};
|
|
2939
|
-
function __webpack_require__(moduleId) {
|
|
2940
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
2941
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
2942
|
-
var module2 = __webpack_module_cache__[moduleId] = {
|
|
2943
|
-
exports: {}
|
|
2944
|
-
};
|
|
2945
|
-
__webpack_modules__[moduleId](module2, module2.exports, __webpack_require__);
|
|
2946
|
-
return module2.exports;
|
|
2947
|
-
}
|
|
2948
|
-
(() => {
|
|
2949
|
-
__webpack_require__.n = (module2) => {
|
|
2950
|
-
var getter = module2 && module2.__esModule ? () => module2["default"] : () => module2;
|
|
2951
|
-
__webpack_require__.d(getter, {
|
|
2952
|
-
a: getter
|
|
2953
|
-
});
|
|
2954
|
-
return getter;
|
|
2955
|
-
};
|
|
2956
|
-
})();
|
|
2957
|
-
(() => {
|
|
2958
|
-
__webpack_require__.d = (exports2, definition) => {
|
|
2959
|
-
for (var key in definition) if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports2, key)) Object.defineProperty(exports2, key, {
|
|
2960
|
-
enumerable: true,
|
|
2961
|
-
get: definition[key]
|
|
2962
|
-
});
|
|
2963
|
-
};
|
|
2964
|
-
})();
|
|
2965
|
-
(() => {
|
|
2966
|
-
__webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
2967
|
-
})();
|
|
2968
|
-
var semver = __webpack_require__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/index.js");
|
|
2969
|
-
var semver_default = /* @__PURE__ */ __webpack_require__.n(semver);
|
|
2970
|
-
var semverSatisfies = (targetAppVersion, currentVersion) => {
|
|
2971
|
-
const currentCoerce = semver_default().coerce(currentVersion);
|
|
2972
|
-
if (!currentCoerce) return false;
|
|
2973
|
-
return semver_default().satisfies(currentCoerce.version, targetAppVersion);
|
|
2974
|
-
};
|
|
2975
|
-
var filterCompatibleAppVersions = (targetAppVersionList, currentVersion) => {
|
|
2976
|
-
const compatibleAppVersionList = targetAppVersionList.filter((version) => semverSatisfies(version, currentVersion));
|
|
2977
|
-
return compatibleAppVersionList.sort((a, b) => b.localeCompare(a));
|
|
2978
|
-
};
|
|
2979
|
-
var encoder = new TextEncoder();
|
|
2980
|
-
var decoder = new TextDecoder();
|
|
2981
|
-
var minute = 60;
|
|
2982
|
-
var hour = 60 * minute;
|
|
2983
|
-
var day = 24 * hour;
|
|
2984
|
-
var week = 7 * day;
|
|
2985
|
-
var year = 365.25 * day;
|
|
2986
|
-
|
|
2987
|
-
// firebase/functions/getUpdateInfo.ts
|
|
2988
|
-
var NIL_UUID2 = "00000000-0000-0000-0000-000000000000";
|
|
2989
|
-
var INIT_BUNDLE_ROLLBACK_UPDATE_INFO = {
|
|
2990
|
-
id: NIL_UUID2,
|
|
2991
|
-
shouldForceUpdate: true,
|
|
2992
|
-
message: null,
|
|
2993
|
-
status: "ROLLBACK"
|
|
2994
|
-
};
|
|
2995
|
-
var convertToBundle = (data) => ({
|
|
2996
|
-
id: data.id,
|
|
2997
|
-
enabled: Boolean(data.enabled),
|
|
2998
|
-
shouldForceUpdate: Boolean(data.should_force_update),
|
|
2999
|
-
message: data.message || null,
|
|
3000
|
-
targetAppVersion: data.target_app_version,
|
|
3001
|
-
platform: data.platform,
|
|
3002
|
-
channel: data.channel || "production",
|
|
3003
|
-
fileHash: data.file_hash || "",
|
|
3004
|
-
gitCommitHash: data.git_commit_hash || ""
|
|
3005
|
-
});
|
|
3006
|
-
var makeResponse = (bundle, status) => ({
|
|
3007
|
-
id: bundle.id,
|
|
3008
|
-
message: bundle.message,
|
|
3009
|
-
shouldForceUpdate: status === "ROLLBACK" ? true : bundle.shouldForceUpdate,
|
|
3010
|
-
status
|
|
3011
|
-
});
|
|
3012
|
-
var getUpdateInfo = async (db, {
|
|
3013
|
-
platform,
|
|
3014
|
-
appVersion,
|
|
3015
|
-
bundleId,
|
|
3016
|
-
minBundleId = NIL_UUID2,
|
|
3017
|
-
channel = "production"
|
|
3018
|
-
}) => {
|
|
3019
|
-
try {
|
|
3020
|
-
let currentBundle = null;
|
|
3021
|
-
if (bundleId !== NIL_UUID2) {
|
|
3022
|
-
const doc = await db.collection("bundles").doc(bundleId).get();
|
|
3023
|
-
if (doc.exists) {
|
|
3024
|
-
const data = doc.data();
|
|
3025
|
-
if (data.channel !== channel) {
|
|
3026
|
-
return null;
|
|
3027
|
-
}
|
|
3028
|
-
currentBundle = convertToBundle(data);
|
|
3029
|
-
}
|
|
3030
|
-
}
|
|
3031
|
-
if (bundleId.localeCompare(minBundleId) < 0) {
|
|
3032
|
-
return null;
|
|
3033
|
-
}
|
|
3034
|
-
const appVersionsSnapshot = await db.collection("target_app_versions").where("platform", "==", platform).where("channel", "==", channel).select("target_app_version").get();
|
|
3035
|
-
const appVersions = Array.from(
|
|
3036
|
-
new Set(
|
|
3037
|
-
appVersionsSnapshot.docs.map(
|
|
3038
|
-
(doc) => doc.data().target_app_version
|
|
3039
|
-
)
|
|
3040
|
-
)
|
|
3041
|
-
);
|
|
3042
|
-
const targetAppVersionList = filterCompatibleAppVersions(
|
|
3043
|
-
appVersions,
|
|
3044
|
-
appVersion
|
|
3045
|
-
);
|
|
3046
|
-
if (targetAppVersionList.length === 0) {
|
|
3047
|
-
return bundleId === minBundleId ? null : INIT_BUNDLE_ROLLBACK_UPDATE_INFO;
|
|
3048
|
-
}
|
|
3049
|
-
const baseQuery = db.collection("bundles").where("platform", "==", platform).where("channel", "==", channel).where("enabled", "==", true).where("id", ">=", minBundleId).where("target_app_version", "in", targetAppVersionList);
|
|
3050
|
-
let updateCandidate = null;
|
|
3051
|
-
let rollbackCandidate = null;
|
|
3052
|
-
if (bundleId === NIL_UUID2) {
|
|
3053
|
-
const snap = await baseQuery.orderBy("id", "desc").limit(1).get();
|
|
3054
|
-
if (!snap.empty) {
|
|
3055
|
-
const data = snap.docs[0].data();
|
|
3056
|
-
updateCandidate = convertToBundle(data);
|
|
3057
|
-
}
|
|
3058
|
-
} else {
|
|
3059
|
-
const updateSnap = await baseQuery.where("id", ">=", bundleId).orderBy("id", "desc").limit(1).get();
|
|
3060
|
-
if (!updateSnap.empty) {
|
|
3061
|
-
const data = updateSnap.docs[0].data();
|
|
3062
|
-
updateCandidate = convertToBundle(data);
|
|
3063
|
-
}
|
|
3064
|
-
const rollbackSnap = await baseQuery.where("id", "<", bundleId).orderBy("id", "desc").limit(1).get();
|
|
3065
|
-
if (!rollbackSnap.empty) {
|
|
3066
|
-
const data = rollbackSnap.docs[0].data();
|
|
3067
|
-
rollbackCandidate = convertToBundle(data);
|
|
3068
|
-
}
|
|
3069
|
-
}
|
|
3070
|
-
if (bundleId === NIL_UUID2) {
|
|
3071
|
-
return updateCandidate ? makeResponse(updateCandidate, "UPDATE") : null;
|
|
3072
|
-
}
|
|
3073
|
-
if (updateCandidate && updateCandidate.id !== bundleId) {
|
|
3074
|
-
return makeResponse(updateCandidate, "UPDATE");
|
|
3075
|
-
}
|
|
3076
|
-
if (updateCandidate && updateCandidate.id === bundleId) {
|
|
3077
|
-
if (currentBundle?.enabled) {
|
|
3078
|
-
return null;
|
|
3079
|
-
}
|
|
3080
|
-
return rollbackCandidate ? makeResponse(rollbackCandidate, "ROLLBACK") : INIT_BUNDLE_ROLLBACK_UPDATE_INFO;
|
|
3081
|
-
}
|
|
3082
|
-
if (!updateCandidate) {
|
|
3083
|
-
if (rollbackCandidate) {
|
|
3084
|
-
return makeResponse(rollbackCandidate, "ROLLBACK");
|
|
3085
|
-
}
|
|
3086
|
-
return bundleId === minBundleId ? null : INIT_BUNDLE_ROLLBACK_UPDATE_INFO;
|
|
3087
|
-
}
|
|
3088
|
-
return null;
|
|
3089
|
-
} catch (error) {
|
|
3090
|
-
console.error("Error in getUpdateInfo:", error);
|
|
3091
|
-
throw error;
|
|
3092
|
-
}
|
|
3093
|
-
};
|
|
3094
|
-
|
|
3095
|
-
// firebase/functions/index.ts
|
|
3096
|
-
if (!admin.apps.length) {
|
|
3097
|
-
admin.initializeApp();
|
|
3098
|
-
}
|
|
3099
|
-
var app2 = new Hono2();
|
|
3100
|
-
app2.get("/ping", (c) => {
|
|
3101
|
-
return c.text("pong");
|
|
3102
|
-
});
|
|
3103
|
-
app2.get("/api/check-update", async (c) => {
|
|
3104
|
-
try {
|
|
3105
|
-
const platform = c.req.header("x-app-platform");
|
|
3106
|
-
const appVersion = c.req.header("x-app-version");
|
|
3107
|
-
const bundleId = c.req.header("x-bundle-id");
|
|
3108
|
-
const minBundleId = c.req.header("x-min-bundle-id");
|
|
3109
|
-
const channel = c.req.header("x-channel");
|
|
3110
|
-
if (!platform || !appVersion || !bundleId) {
|
|
3111
|
-
return c.json(
|
|
3112
|
-
{
|
|
3113
|
-
error: "Missing required headers (x-app-platform, x-app-version, x-bundle-id)"
|
|
3114
|
-
},
|
|
3115
|
-
400
|
|
3116
|
-
);
|
|
3117
|
-
}
|
|
3118
|
-
const db = admin.firestore();
|
|
3119
|
-
const updateInfo = await getUpdateInfo(db, {
|
|
3120
|
-
platform,
|
|
3121
|
-
appVersion,
|
|
3122
|
-
bundleId,
|
|
3123
|
-
minBundleId: minBundleId || NIL_UUID,
|
|
3124
|
-
channel: channel || "production"
|
|
3125
|
-
});
|
|
3126
|
-
if (!updateInfo) {
|
|
3127
|
-
return c.json(null, 200);
|
|
3128
|
-
}
|
|
3129
|
-
if (updateInfo.id === NIL_UUID) {
|
|
3130
|
-
return c.json({
|
|
3131
|
-
...updateInfo,
|
|
3132
|
-
fileUrl: null
|
|
3133
|
-
});
|
|
3134
|
-
}
|
|
3135
|
-
const [signedUrl] = await admin.storage().bucket(admin.app().options.storageBucket).file([updateInfo.id, "bundle.zip"].join("/")).getSignedUrl({
|
|
3136
|
-
action: "read",
|
|
3137
|
-
expires: Date.now() + 60 * 1e3
|
|
3138
|
-
});
|
|
3139
|
-
return c.json(
|
|
3140
|
-
{
|
|
3141
|
-
...updateInfo,
|
|
3142
|
-
fileUrl: signedUrl
|
|
3143
|
-
},
|
|
3144
|
-
200
|
|
3145
|
-
);
|
|
3146
|
-
} catch (error) {
|
|
3147
|
-
if (error instanceof Error) {
|
|
3148
|
-
return c.json(
|
|
3149
|
-
{
|
|
3150
|
-
error: error.message
|
|
3151
|
-
},
|
|
3152
|
-
500
|
|
3153
|
-
);
|
|
3154
|
-
}
|
|
3155
|
-
return c.json({ error: "Internal server error" }, 500);
|
|
3156
|
-
}
|
|
3157
|
-
});
|
|
3158
|
-
var hotUpdaterFunction = createFirebaseApp({
|
|
3159
|
-
region: HotUpdater.REGION
|
|
3160
|
-
})(app2);
|
|
3161
|
-
var hot = {
|
|
3162
|
-
updater: hotUpdaterFunction
|
|
3163
|
-
};
|
|
3164
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
3165
|
-
0 && (module.exports = {
|
|
3166
|
-
hot
|
|
3167
|
-
});
|