@hot-updater/postgres 0.17.0 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2073 -2116
- package/dist/index.d.cts +22 -0
- package/dist/index.d.ts +22 -2
- package/dist/index.js +2052 -2068
- package/package.json +5 -5
- package/sql/bundles.sql +10 -2
- package/sql/get_update_info.spec.ts +35 -7
- package/sql/{get_update_info.sql → get_update_info_by_app_version.sql} +9 -5
- package/sql/get_update_info_by_fingerprint_hash.sql +87 -0
- package/dist/getUpdateInfo.d.ts +0 -3
- package/dist/postgres.d.ts +0 -5
- package/dist/types.d.ts +0 -4
package/dist/index.js
CHANGED
|
@@ -1,2086 +1,2064 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
Object.freeze(parsingErrorCode);
|
|
18
|
-
const errorMessages = [
|
|
19
|
-
{
|
|
20
|
-
name: 'unclosedMLC',
|
|
21
|
-
message: 'Unclosed multi-line comment.'
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: 'unclosedText',
|
|
25
|
-
message: 'Unclosed text block.'
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
name: 'unclosedQI',
|
|
29
|
-
message: 'Unclosed quoted identifier.'
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
name: 'multiLineQI',
|
|
33
|
-
message: 'Multi-line quoted identifiers are not supported.'
|
|
34
|
-
}
|
|
35
|
-
];
|
|
36
|
-
class SQLParsingError extends Error {
|
|
37
|
-
constructor(code, position){
|
|
38
|
-
const err = errorMessages[code].message;
|
|
39
|
-
const message = `Error parsing SQL at {line:${position.line},col:${position.column}}: ${err}`;
|
|
40
|
-
super(message);
|
|
41
|
-
this.name = this.constructor.name;
|
|
42
|
-
this.error = err;
|
|
43
|
-
this.code = code;
|
|
44
|
-
this.position = position;
|
|
45
|
-
Error.captureStackTrace(this, this.constructor);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
SQLParsingError.prototype.toString = function(level) {
|
|
49
|
-
level = level > 0 ? parseInt(level) : 0;
|
|
50
|
-
const gap = messageGap(level + 1);
|
|
51
|
-
const lines = [
|
|
52
|
-
'SQLParsingError {',
|
|
53
|
-
`${gap}code: parsingErrorCode.${errorMessages[this.code].name}`,
|
|
54
|
-
`${gap}error: "${this.error}"`,
|
|
55
|
-
`${gap}position: {line: ${this.position.line}, col: ${this.position.column}}`,
|
|
56
|
-
`${messageGap(level)}}`
|
|
57
|
-
];
|
|
58
|
-
return lines.join(EOL);
|
|
59
|
-
};
|
|
60
|
-
addInspection(SQLParsingError.prototype, function() {
|
|
61
|
-
return this.toString();
|
|
62
|
-
});
|
|
63
|
-
module.exports = {
|
|
64
|
-
SQLParsingError,
|
|
65
|
-
parsingErrorCode
|
|
66
|
-
};
|
|
67
|
-
},
|
|
68
|
-
"../../node_modules/.pnpm/pg-minify@1.6.5/node_modules/pg-minify/lib/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
69
|
-
const parser = __webpack_require__("../../node_modules/.pnpm/pg-minify@1.6.5/node_modules/pg-minify/lib/parser.js");
|
|
70
|
-
const error = __webpack_require__("../../node_modules/.pnpm/pg-minify@1.6.5/node_modules/pg-minify/lib/error.js");
|
|
71
|
-
parser.SQLParsingError = error.SQLParsingError;
|
|
72
|
-
parser.parsingErrorCode = error.parsingErrorCode;
|
|
73
|
-
module.exports = parser;
|
|
74
|
-
},
|
|
75
|
-
"../../node_modules/.pnpm/pg-minify@1.6.5/node_modules/pg-minify/lib/parser.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
76
|
-
const { parsingErrorCode, SQLParsingError } = __webpack_require__("../../node_modules/.pnpm/pg-minify@1.6.5/node_modules/pg-minify/lib/error.js");
|
|
77
|
-
const { getIndexPos } = __webpack_require__("../../node_modules/.pnpm/pg-minify@1.6.5/node_modules/pg-minify/lib/utils.js");
|
|
78
|
-
const compressors = '.,;:()[]=<>+-*/|!?@#';
|
|
79
|
-
function minify(sql, options) {
|
|
80
|
-
if ('string' != typeof sql) throw new TypeError('Input SQL must be a text string.');
|
|
81
|
-
if (!sql.length) return '';
|
|
82
|
-
sql = sql.replace(/\r\n/g, '\n');
|
|
83
|
-
options = options || {};
|
|
84
|
-
let idx = 0, result = '', space = false;
|
|
85
|
-
const len = sql.length;
|
|
86
|
-
do {
|
|
87
|
-
const s = sql[idx], s1 = sql[idx + 1];
|
|
88
|
-
if (isGap(s)) {
|
|
89
|
-
while(++idx < len && isGap(sql[idx]));
|
|
90
|
-
if (idx < len) space = true;
|
|
91
|
-
idx--;
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
if ('-' === s && '-' === s1) {
|
|
95
|
-
const lb = sql.indexOf('\n', idx + 2);
|
|
96
|
-
if (lb < 0) break;
|
|
97
|
-
idx = lb - 1;
|
|
98
|
-
skipGaps();
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
if ('/' === s && '*' === s1) {
|
|
102
|
-
let c = idx + 1, open = 0, close = 0, lastOpen, lastClose;
|
|
103
|
-
while(++c < len - 1 && close <= open)if ('/' === sql[c] && '*' === sql[c + 1]) {
|
|
104
|
-
lastOpen = c;
|
|
105
|
-
open++;
|
|
106
|
-
c++;
|
|
107
|
-
} else if ('*' === sql[c] && '/' === sql[c + 1]) {
|
|
108
|
-
lastClose = c;
|
|
109
|
-
close++;
|
|
110
|
-
c++;
|
|
111
|
-
}
|
|
112
|
-
if (close <= open) {
|
|
113
|
-
idx = lastOpen;
|
|
114
|
-
throwError(parsingErrorCode.unclosedMLC);
|
|
115
|
-
}
|
|
116
|
-
if ('!' === sql[idx + 2] && !options.removeAll) {
|
|
117
|
-
if (options.compress) space = false;
|
|
118
|
-
addSpace();
|
|
119
|
-
result += sql.substring(idx, lastClose + 2).replace(/\n/g, '\r\n');
|
|
120
|
-
}
|
|
121
|
-
idx = lastClose + 1;
|
|
122
|
-
skipGaps();
|
|
123
|
-
continue;
|
|
124
|
-
}
|
|
125
|
-
let closeIdx, text;
|
|
126
|
-
if ('"' === s) {
|
|
127
|
-
closeIdx = sql.indexOf('"', idx + 1);
|
|
128
|
-
if (closeIdx < 0) throwError(parsingErrorCode.unclosedQI);
|
|
129
|
-
text = sql.substring(idx, closeIdx + 1);
|
|
130
|
-
if (text.indexOf('\n') > 0) throwError(parsingErrorCode.multiLineQI);
|
|
131
|
-
if (options.compress) space = false;
|
|
132
|
-
addSpace();
|
|
133
|
-
result += text;
|
|
134
|
-
idx = closeIdx;
|
|
135
|
-
skipGaps();
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
if ('\'' === s) {
|
|
139
|
-
closeIdx = idx;
|
|
140
|
-
do {
|
|
141
|
-
closeIdx = sql.indexOf('\'', closeIdx + 1);
|
|
142
|
-
if (closeIdx > 0) {
|
|
143
|
-
let i = closeIdx;
|
|
144
|
-
while('\\' === sql[--i]);
|
|
145
|
-
if ((closeIdx - i) % 2) {
|
|
146
|
-
let step = closeIdx;
|
|
147
|
-
while(++step < len && '\'' === sql[step]);
|
|
148
|
-
if ((step - closeIdx) % 2) {
|
|
149
|
-
closeIdx = step - 1;
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
closeIdx = step === len ? -1 : step;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}while (closeIdx > 0);
|
|
156
|
-
if (closeIdx < 0) throwError(parsingErrorCode.unclosedText);
|
|
157
|
-
if (options.compress) space = false;
|
|
158
|
-
addSpace();
|
|
159
|
-
text = sql.substring(idx, closeIdx + 1);
|
|
160
|
-
const hasLB = text.indexOf('\n') > 0;
|
|
161
|
-
if (hasLB) text = text.split('\n').map((m)=>m.replace(/^\s+|\s+$/g, '')).join('\\n');
|
|
162
|
-
const hasTabs = text.indexOf('\t') > 0;
|
|
163
|
-
if (hasLB || hasTabs) {
|
|
164
|
-
const prev = idx ? sql[idx - 1] : '';
|
|
165
|
-
if ('E' !== prev && 'e' !== prev) {
|
|
166
|
-
const r = result ? result[result.length - 1] : '';
|
|
167
|
-
if (r && ' ' !== r && compressors.indexOf(r) < 0) result += ' ';
|
|
168
|
-
result += 'E';
|
|
169
|
-
}
|
|
170
|
-
if (hasTabs) text = text.replace(/\t/g, '\\t');
|
|
171
|
-
}
|
|
172
|
-
result += text;
|
|
173
|
-
idx = closeIdx;
|
|
174
|
-
skipGaps();
|
|
175
|
-
continue;
|
|
176
|
-
}
|
|
177
|
-
if (options.compress && compressors.indexOf(s) >= 0) {
|
|
178
|
-
space = false;
|
|
179
|
-
skipGaps();
|
|
180
|
-
}
|
|
181
|
-
addSpace();
|
|
182
|
-
result += s;
|
|
183
|
-
}while (++idx < len);
|
|
184
|
-
return result;
|
|
185
|
-
function skipGaps() {
|
|
186
|
-
if (options.compress) while(idx < len - 1 && isGap(sql[idx + 1]) && idx++);
|
|
187
|
-
}
|
|
188
|
-
function addSpace() {
|
|
189
|
-
if (space) {
|
|
190
|
-
if (result.length) result += ' ';
|
|
191
|
-
space = false;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
function throwError(code) {
|
|
195
|
-
const position = getIndexPos(sql, idx);
|
|
196
|
-
throw new SQLParsingError(code, position);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
function isGap(s) {
|
|
200
|
-
return ' ' === s || '\t' === s || '\r' === s || '\n' === s;
|
|
201
|
-
}
|
|
202
|
-
module.exports = minify;
|
|
203
|
-
},
|
|
204
|
-
"../../node_modules/.pnpm/pg-minify@1.6.5/node_modules/pg-minify/lib/utils.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
205
|
-
const { inspect } = __webpack_require__("util");
|
|
206
|
-
function getIndexPos(text, index) {
|
|
207
|
-
let lineIdx = 0, colIdx = index, pos = 0;
|
|
208
|
-
do {
|
|
209
|
-
pos = text.indexOf('\n', pos);
|
|
210
|
-
if (-1 === pos || index < pos + 1) break;
|
|
211
|
-
lineIdx++;
|
|
212
|
-
pos++;
|
|
213
|
-
colIdx = index - pos;
|
|
214
|
-
}while (pos < index);
|
|
215
|
-
return {
|
|
216
|
-
line: lineIdx + 1,
|
|
217
|
-
column: colIdx + 1
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
function messageGap(level) {
|
|
221
|
-
return ' '.repeat(4 * level);
|
|
222
|
-
}
|
|
223
|
-
function addInspection(type, cb) {
|
|
224
|
-
type[inspect.custom] = cb;
|
|
225
|
-
}
|
|
226
|
-
module.exports = {
|
|
227
|
-
getIndexPos,
|
|
228
|
-
messageGap,
|
|
229
|
-
addInspection
|
|
230
|
-
};
|
|
231
|
-
},
|
|
232
|
-
os: function(module) {
|
|
233
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_os__;
|
|
234
|
-
},
|
|
235
|
-
util: function(module) {
|
|
236
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_util__;
|
|
237
|
-
}
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { createDatabasePlugin } from "@hot-updater/plugin-core";
|
|
3
|
+
import { Kysely, PostgresDialect } from "kysely";
|
|
4
|
+
import { Pool } from "pg";
|
|
5
|
+
import { NIL_UUID } from "@hot-updater/core";
|
|
6
|
+
|
|
7
|
+
//#region rolldown:runtime
|
|
8
|
+
var __create$1 = Object.create;
|
|
9
|
+
var __defProp$1 = Object.defineProperty;
|
|
10
|
+
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
11
|
+
var __getOwnPropNames$1 = Object.getOwnPropertyNames;
|
|
12
|
+
var __getProtoOf$1 = Object.getPrototypeOf;
|
|
13
|
+
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __commonJS$1 = (cb, mod) => function() {
|
|
15
|
+
return mod || (0, cb[__getOwnPropNames$1(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
238
16
|
};
|
|
239
|
-
var
|
|
240
|
-
function
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
(()=>{
|
|
250
|
-
__webpack_require__.n = (module)=>{
|
|
251
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
252
|
-
__webpack_require__.d(getter, {
|
|
253
|
-
a: getter
|
|
254
|
-
});
|
|
255
|
-
return getter;
|
|
256
|
-
};
|
|
257
|
-
})();
|
|
258
|
-
(()=>{
|
|
259
|
-
__webpack_require__.d = (exports, definition)=>{
|
|
260
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
261
|
-
enumerable: true,
|
|
262
|
-
get: definition[key]
|
|
263
|
-
});
|
|
264
|
-
};
|
|
265
|
-
})();
|
|
266
|
-
(()=>{
|
|
267
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
268
|
-
})();
|
|
269
|
-
const postgres = (config, hooks)=>{
|
|
270
|
-
const pool = new __WEBPACK_EXTERNAL_MODULE_pg__.Pool(config);
|
|
271
|
-
const dialect = new __WEBPACK_EXTERNAL_MODULE_kysely__.PostgresDialect({
|
|
272
|
-
pool
|
|
273
|
-
});
|
|
274
|
-
const db = new __WEBPACK_EXTERNAL_MODULE_kysely__.Kysely({
|
|
275
|
-
dialect
|
|
276
|
-
});
|
|
277
|
-
return (0, __WEBPACK_EXTERNAL_MODULE__hot_updater_plugin_core_40c1c502__.createDatabasePlugin)("postgres", {
|
|
278
|
-
async onUnmount () {
|
|
279
|
-
await db.destroy();
|
|
280
|
-
await pool.end();
|
|
281
|
-
},
|
|
282
|
-
async getBundleById (bundleId) {
|
|
283
|
-
const data = await db.selectFrom("bundles").selectAll().where("id", "=", bundleId).executeTakeFirst();
|
|
284
|
-
if (!data) return null;
|
|
285
|
-
return {
|
|
286
|
-
enabled: data.enabled,
|
|
287
|
-
shouldForceUpdate: data.should_force_update,
|
|
288
|
-
fileHash: data.file_hash,
|
|
289
|
-
gitCommitHash: data.git_commit_hash,
|
|
290
|
-
id: data.id,
|
|
291
|
-
message: data.message,
|
|
292
|
-
platform: data.platform,
|
|
293
|
-
targetAppVersion: data.target_app_version,
|
|
294
|
-
channel: data.channel
|
|
295
|
-
};
|
|
296
|
-
},
|
|
297
|
-
async getBundles (options) {
|
|
298
|
-
const { where, limit, offset = 0 } = options ?? {};
|
|
299
|
-
let query = db.selectFrom("bundles").orderBy("id", "desc");
|
|
300
|
-
if (where?.channel) query = query.where("channel", "=", where.channel);
|
|
301
|
-
if (where?.platform) query = query.where("platform", "=", where.platform);
|
|
302
|
-
if (limit) query = query.limit(limit);
|
|
303
|
-
if (offset) query = query.offset(offset);
|
|
304
|
-
const data = await query.selectAll().execute();
|
|
305
|
-
return data.map((bundle)=>({
|
|
306
|
-
enabled: bundle.enabled,
|
|
307
|
-
shouldForceUpdate: bundle.should_force_update,
|
|
308
|
-
fileHash: bundle.file_hash,
|
|
309
|
-
gitCommitHash: bundle.git_commit_hash,
|
|
310
|
-
id: bundle.id,
|
|
311
|
-
message: bundle.message,
|
|
312
|
-
platform: bundle.platform,
|
|
313
|
-
targetAppVersion: bundle.target_app_version,
|
|
314
|
-
channel: bundle.channel
|
|
315
|
-
}));
|
|
316
|
-
},
|
|
317
|
-
async getChannels () {
|
|
318
|
-
const data = await db.selectFrom("bundles").select("channel").groupBy("channel").execute();
|
|
319
|
-
return data.map((bundle)=>bundle.channel);
|
|
320
|
-
},
|
|
321
|
-
async commitBundle ({ changedSets }) {
|
|
322
|
-
if (0 === changedSets.length) return;
|
|
323
|
-
const bundles = changedSets.map((op)=>op.data);
|
|
324
|
-
await db.transaction().execute(async (tx)=>{
|
|
325
|
-
for (const bundle of bundles)await tx.insertInto("bundles").values({
|
|
326
|
-
id: bundle.id,
|
|
327
|
-
enabled: bundle.enabled,
|
|
328
|
-
should_force_update: bundle.shouldForceUpdate,
|
|
329
|
-
file_hash: bundle.fileHash,
|
|
330
|
-
git_commit_hash: bundle.gitCommitHash,
|
|
331
|
-
message: bundle.message,
|
|
332
|
-
platform: bundle.platform,
|
|
333
|
-
target_app_version: bundle.targetAppVersion,
|
|
334
|
-
channel: bundle.channel
|
|
335
|
-
}).onConflict((oc)=>oc.column("id").doUpdateSet({
|
|
336
|
-
enabled: bundle.enabled,
|
|
337
|
-
should_force_update: bundle.shouldForceUpdate,
|
|
338
|
-
file_hash: bundle.fileHash,
|
|
339
|
-
git_commit_hash: bundle.gitCommitHash,
|
|
340
|
-
message: bundle.message,
|
|
341
|
-
platform: bundle.platform,
|
|
342
|
-
target_app_version: bundle.targetAppVersion,
|
|
343
|
-
channel: bundle.channel
|
|
344
|
-
})).execute();
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
}, hooks);
|
|
17
|
+
var __copyProps$1 = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$1(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
19
|
+
key = keys[i];
|
|
20
|
+
if (!__hasOwnProp$1.call(to, key) && key !== except) __defProp$1(to, key, {
|
|
21
|
+
get: ((k) => from[k]).bind(null, key),
|
|
22
|
+
enumerable: !(desc = __getOwnPropDesc$1(from, key)) || desc.enumerable
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
348
26
|
};
|
|
349
|
-
var
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
if (0 === this.set.length) this.set = [
|
|
447
|
-
first
|
|
448
|
-
];
|
|
449
|
-
else if (this.set.length > 1) {
|
|
450
|
-
for (const c of this.set)if (1 === c.length && isAny(c[0])) {
|
|
451
|
-
this.set = [
|
|
452
|
-
c
|
|
453
|
-
];
|
|
454
|
-
break;
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
this.formatted = void 0;
|
|
459
|
-
}
|
|
460
|
-
get range() {
|
|
461
|
-
if (void 0 === this.formatted) {
|
|
462
|
-
this.formatted = '';
|
|
463
|
-
for(let i = 0; i < this.set.length; i++){
|
|
464
|
-
if (i > 0) this.formatted += '||';
|
|
465
|
-
const comps = this.set[i];
|
|
466
|
-
for(let k = 0; k < comps.length; k++){
|
|
467
|
-
if (k > 0) this.formatted += ' ';
|
|
468
|
-
this.formatted += comps[k].toString().trim();
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
return this.formatted;
|
|
473
|
-
}
|
|
474
|
-
format() {
|
|
475
|
-
return this.range;
|
|
476
|
-
}
|
|
477
|
-
toString() {
|
|
478
|
-
return this.range;
|
|
479
|
-
}
|
|
480
|
-
parseRange(range) {
|
|
481
|
-
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
482
|
-
const memoKey = memoOpts + ':' + range;
|
|
483
|
-
const cached = cache.get(memoKey);
|
|
484
|
-
if (cached) return cached;
|
|
485
|
-
const loose = this.options.loose;
|
|
486
|
-
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
487
|
-
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
488
|
-
debug('hyphen replace', range);
|
|
489
|
-
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
490
|
-
debug('comparator trim', range);
|
|
491
|
-
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
492
|
-
debug('tilde trim', range);
|
|
493
|
-
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
494
|
-
debug('caret trim', range);
|
|
495
|
-
let rangeList = range.split(' ').map((comp)=>parseComparator(comp, this.options)).join(' ').split(/\s+/).map((comp)=>replaceGTE0(comp, this.options));
|
|
496
|
-
if (loose) rangeList = rangeList.filter((comp)=>{
|
|
497
|
-
debug('loose invalid filter', comp, this.options);
|
|
498
|
-
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
499
|
-
});
|
|
500
|
-
debug('range list', rangeList);
|
|
501
|
-
const rangeMap = new Map();
|
|
502
|
-
const comparators = rangeList.map((comp)=>new Comparator(comp, this.options));
|
|
503
|
-
for (const comp of comparators){
|
|
504
|
-
if (isNullSet(comp)) return [
|
|
505
|
-
comp
|
|
506
|
-
];
|
|
507
|
-
rangeMap.set(comp.value, comp);
|
|
508
|
-
}
|
|
509
|
-
if (rangeMap.size > 1 && rangeMap.has('')) rangeMap.delete('');
|
|
510
|
-
const result = [
|
|
511
|
-
...rangeMap.values()
|
|
512
|
-
];
|
|
513
|
-
cache.set(memoKey, result);
|
|
514
|
-
return result;
|
|
515
|
-
}
|
|
516
|
-
intersects(range, options) {
|
|
517
|
-
if (!(range instanceof Range)) throw new TypeError('a Range is required');
|
|
518
|
-
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)))));
|
|
519
|
-
}
|
|
520
|
-
test(version) {
|
|
521
|
-
if (!version) return false;
|
|
522
|
-
if ('string' == typeof version) try {
|
|
523
|
-
version = new SemVer(version, this.options);
|
|
524
|
-
} catch (er) {
|
|
525
|
-
return false;
|
|
526
|
-
}
|
|
527
|
-
for(let i = 0; i < this.set.length; i++)if (testSet(this.set[i], version, this.options)) return true;
|
|
528
|
-
return false;
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
module.exports = Range;
|
|
532
|
-
const LRU = __nested_webpack_require_4513_4532__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/lrucache.js");
|
|
533
|
-
const cache = new LRU();
|
|
534
|
-
const parseOptions = __nested_webpack_require_4513_4532__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/parse-options.js");
|
|
535
|
-
const Comparator = __nested_webpack_require_4513_4532__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/comparator.js");
|
|
536
|
-
const debug = __nested_webpack_require_4513_4532__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js");
|
|
537
|
-
const SemVer = __nested_webpack_require_4513_4532__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
538
|
-
const { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = __nested_webpack_require_4513_4532__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js");
|
|
539
|
-
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = __nested_webpack_require_4513_4532__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js");
|
|
540
|
-
const isNullSet = (c)=>'<0.0.0-0' === c.value;
|
|
541
|
-
const isAny = (c)=>'' === c.value;
|
|
542
|
-
const isSatisfiable = (comparators, options)=>{
|
|
543
|
-
let result = true;
|
|
544
|
-
const remainingComparators = comparators.slice();
|
|
545
|
-
let testComparator = remainingComparators.pop();
|
|
546
|
-
while(result && remainingComparators.length){
|
|
547
|
-
result = remainingComparators.every((otherComparator)=>testComparator.intersects(otherComparator, options));
|
|
548
|
-
testComparator = remainingComparators.pop();
|
|
549
|
-
}
|
|
550
|
-
return result;
|
|
551
|
-
};
|
|
552
|
-
const parseComparator = (comp, options)=>{
|
|
553
|
-
debug('comp', comp, options);
|
|
554
|
-
comp = replaceCarets(comp, options);
|
|
555
|
-
debug('caret', comp);
|
|
556
|
-
comp = replaceTildes(comp, options);
|
|
557
|
-
debug('tildes', comp);
|
|
558
|
-
comp = replaceXRanges(comp, options);
|
|
559
|
-
debug('xrange', comp);
|
|
560
|
-
comp = replaceStars(comp, options);
|
|
561
|
-
debug('stars', comp);
|
|
562
|
-
return comp;
|
|
563
|
-
};
|
|
564
|
-
const isX = (id)=>!id || 'x' === id.toLowerCase() || '*' === id;
|
|
565
|
-
const replaceTildes = (comp, options)=>comp.trim().split(/\s+/).map((c)=>replaceTilde(c, options)).join(' ');
|
|
566
|
-
const replaceTilde = (comp, options)=>{
|
|
567
|
-
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
568
|
-
return comp.replace(r, (_, M, m, p, pr)=>{
|
|
569
|
-
debug('tilde', comp, _, M, m, p, pr);
|
|
570
|
-
let ret;
|
|
571
|
-
if (isX(M)) ret = '';
|
|
572
|
-
else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
573
|
-
else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
574
|
-
else if (pr) {
|
|
575
|
-
debug('replaceTilde pr', pr);
|
|
576
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
577
|
-
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
578
|
-
debug('tilde return', ret);
|
|
579
|
-
return ret;
|
|
580
|
-
});
|
|
581
|
-
};
|
|
582
|
-
const replaceCarets = (comp, options)=>comp.trim().split(/\s+/).map((c)=>replaceCaret(c, options)).join(' ');
|
|
583
|
-
const replaceCaret = (comp, options)=>{
|
|
584
|
-
debug('caret', comp, options);
|
|
585
|
-
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
586
|
-
const z = options.includePrerelease ? '-0' : '';
|
|
587
|
-
return comp.replace(r, (_, M, m, p, pr)=>{
|
|
588
|
-
debug('caret', comp, _, M, m, p, pr);
|
|
589
|
-
let ret;
|
|
590
|
-
if (isX(M)) ret = '';
|
|
591
|
-
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
592
|
-
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`;
|
|
593
|
-
else if (pr) {
|
|
594
|
-
debug('replaceCaret pr', pr);
|
|
595
|
-
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`;
|
|
596
|
-
} else {
|
|
597
|
-
debug('no pr');
|
|
598
|
-
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`;
|
|
599
|
-
}
|
|
600
|
-
debug('caret return', ret);
|
|
601
|
-
return ret;
|
|
602
|
-
});
|
|
603
|
-
};
|
|
604
|
-
const replaceXRanges = (comp, options)=>{
|
|
605
|
-
debug('replaceXRanges', comp, options);
|
|
606
|
-
return comp.split(/\s+/).map((c)=>replaceXRange(c, options)).join(' ');
|
|
607
|
-
};
|
|
608
|
-
const replaceXRange = (comp, options)=>{
|
|
609
|
-
comp = comp.trim();
|
|
610
|
-
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
611
|
-
return comp.replace(r, (ret, gtlt, M, m, p, pr)=>{
|
|
612
|
-
debug('xRange', comp, ret, gtlt, M, m, p, pr);
|
|
613
|
-
const xM = isX(M);
|
|
614
|
-
const xm = xM || isX(m);
|
|
615
|
-
const xp = xm || isX(p);
|
|
616
|
-
const anyX = xp;
|
|
617
|
-
if ('=' === gtlt && anyX) gtlt = '';
|
|
618
|
-
pr = options.includePrerelease ? '-0' : '';
|
|
619
|
-
if (xM) ret = '>' === gtlt || '<' === gtlt ? '<0.0.0-0' : '*';
|
|
620
|
-
else if (gtlt && anyX) {
|
|
621
|
-
if (xm) m = 0;
|
|
622
|
-
p = 0;
|
|
623
|
-
if ('>' === gtlt) {
|
|
624
|
-
gtlt = '>=';
|
|
625
|
-
if (xm) {
|
|
626
|
-
M = +M + 1;
|
|
627
|
-
m = 0;
|
|
628
|
-
p = 0;
|
|
629
|
-
} else {
|
|
630
|
-
m = +m + 1;
|
|
631
|
-
p = 0;
|
|
632
|
-
}
|
|
633
|
-
} else if ('<=' === gtlt) {
|
|
634
|
-
gtlt = '<';
|
|
635
|
-
if (xm) M = +M + 1;
|
|
636
|
-
else m = +m + 1;
|
|
637
|
-
}
|
|
638
|
-
if ('<' === gtlt) pr = '-0';
|
|
639
|
-
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
640
|
-
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
641
|
-
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
642
|
-
debug('xRange return', ret);
|
|
643
|
-
return ret;
|
|
644
|
-
});
|
|
645
|
-
};
|
|
646
|
-
const replaceStars = (comp, options)=>{
|
|
647
|
-
debug('replaceStars', comp, options);
|
|
648
|
-
return comp.trim().replace(re[t.STAR], '');
|
|
649
|
-
};
|
|
650
|
-
const replaceGTE0 = (comp, options)=>{
|
|
651
|
-
debug('replaceGTE0', comp, options);
|
|
652
|
-
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '');
|
|
653
|
-
};
|
|
654
|
-
const hyphenReplace = (incPr)=>($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr)=>{
|
|
655
|
-
from = isX(fM) ? '' : isX(fm) ? `>=${fM}.0.0${incPr ? '-0' : ''}` : isX(fp) ? `>=${fM}.${fm}.0${incPr ? '-0' : ''}` : fpr ? `>=${from}` : `>=${from}${incPr ? '-0' : ''}`;
|
|
656
|
-
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}`;
|
|
657
|
-
return `${from} ${to}`.trim();
|
|
658
|
-
};
|
|
659
|
-
const testSet = (set, version, options)=>{
|
|
660
|
-
for(let i = 0; i < set.length; i++)if (!set[i].test(version)) return false;
|
|
661
|
-
if (version.prerelease.length && !options.includePrerelease) {
|
|
662
|
-
for(let i = 0; i < set.length; i++){
|
|
663
|
-
debug(set[i].semver);
|
|
664
|
-
if (set[i].semver !== Comparator.ANY) {
|
|
665
|
-
if (set[i].semver.prerelease.length > 0) {
|
|
666
|
-
const allowed = set[i].semver;
|
|
667
|
-
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true;
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
return false;
|
|
672
|
-
}
|
|
673
|
-
return true;
|
|
674
|
-
};
|
|
675
|
-
},
|
|
676
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js": function(module, __unused_webpack_exports, __nested_webpack_require_18066_18085__) {
|
|
677
|
-
const debug = __nested_webpack_require_18066_18085__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js");
|
|
678
|
-
const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nested_webpack_require_18066_18085__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js");
|
|
679
|
-
const { safeRe: re, safeSrc: src, t } = __nested_webpack_require_18066_18085__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js");
|
|
680
|
-
const parseOptions = __nested_webpack_require_18066_18085__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/parse-options.js");
|
|
681
|
-
const { compareIdentifiers } = __nested_webpack_require_18066_18085__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/identifiers.js");
|
|
682
|
-
class SemVer {
|
|
683
|
-
constructor(version, options){
|
|
684
|
-
options = parseOptions(options);
|
|
685
|
-
if (version instanceof SemVer) if (!!options.loose === version.loose && !!options.includePrerelease === version.includePrerelease) return version;
|
|
686
|
-
else version = version.version;
|
|
687
|
-
else if ('string' != typeof version) throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
688
|
-
if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
689
|
-
debug('SemVer', version, options);
|
|
690
|
-
this.options = options;
|
|
691
|
-
this.loose = !!options.loose;
|
|
692
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
693
|
-
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
694
|
-
if (!m) throw new TypeError(`Invalid Version: ${version}`);
|
|
695
|
-
this.raw = version;
|
|
696
|
-
this.major = +m[1];
|
|
697
|
-
this.minor = +m[2];
|
|
698
|
-
this.patch = +m[3];
|
|
699
|
-
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError('Invalid major version');
|
|
700
|
-
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError('Invalid minor version');
|
|
701
|
-
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError('Invalid patch version');
|
|
702
|
-
if (m[4]) this.prerelease = m[4].split('.').map((id)=>{
|
|
703
|
-
if (/^[0-9]+$/.test(id)) {
|
|
704
|
-
const num = +id;
|
|
705
|
-
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
706
|
-
}
|
|
707
|
-
return id;
|
|
708
|
-
});
|
|
709
|
-
else this.prerelease = [];
|
|
710
|
-
this.build = m[5] ? m[5].split('.') : [];
|
|
711
|
-
this.format();
|
|
712
|
-
}
|
|
713
|
-
format() {
|
|
714
|
-
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
715
|
-
if (this.prerelease.length) this.version += `-${this.prerelease.join('.')}`;
|
|
716
|
-
return this.version;
|
|
717
|
-
}
|
|
718
|
-
toString() {
|
|
719
|
-
return this.version;
|
|
720
|
-
}
|
|
721
|
-
compare(other) {
|
|
722
|
-
debug('SemVer.compare', this.version, this.options, other);
|
|
723
|
-
if (!(other instanceof SemVer)) {
|
|
724
|
-
if ('string' == typeof other && other === this.version) return 0;
|
|
725
|
-
other = new SemVer(other, this.options);
|
|
726
|
-
}
|
|
727
|
-
if (other.version === this.version) return 0;
|
|
728
|
-
return this.compareMain(other) || this.comparePre(other);
|
|
729
|
-
}
|
|
730
|
-
compareMain(other) {
|
|
731
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
732
|
-
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
|
733
|
-
}
|
|
734
|
-
comparePre(other) {
|
|
735
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
736
|
-
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
737
|
-
if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
738
|
-
if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
739
|
-
let i = 0;
|
|
740
|
-
do {
|
|
741
|
-
const a = this.prerelease[i];
|
|
742
|
-
const b = other.prerelease[i];
|
|
743
|
-
debug('prerelease compare', i, a, b);
|
|
744
|
-
if (void 0 === a && void 0 === b) return 0;
|
|
745
|
-
if (void 0 === b) return 1;
|
|
746
|
-
if (void 0 === a) return -1;
|
|
747
|
-
if (a === b) continue;
|
|
748
|
-
return compareIdentifiers(a, b);
|
|
749
|
-
}while (++i);
|
|
750
|
-
}
|
|
751
|
-
compareBuild(other) {
|
|
752
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
753
|
-
let i = 0;
|
|
754
|
-
do {
|
|
755
|
-
const a = this.build[i];
|
|
756
|
-
const b = other.build[i];
|
|
757
|
-
debug('build compare', i, a, b);
|
|
758
|
-
if (void 0 === a && void 0 === b) return 0;
|
|
759
|
-
if (void 0 === b) return 1;
|
|
760
|
-
if (void 0 === a) return -1;
|
|
761
|
-
if (a === b) continue;
|
|
762
|
-
return compareIdentifiers(a, b);
|
|
763
|
-
}while (++i);
|
|
764
|
-
}
|
|
765
|
-
inc(release, identifier, identifierBase) {
|
|
766
|
-
if (release.startsWith('pre')) {
|
|
767
|
-
if (!identifier && false === identifierBase) throw new Error('invalid increment argument: identifier is empty');
|
|
768
|
-
if (identifier) {
|
|
769
|
-
const r = new RegExp(`^${this.options.loose ? src[t.PRERELEASELOOSE] : src[t.PRERELEASE]}$`);
|
|
770
|
-
const match = `-${identifier}`.match(r);
|
|
771
|
-
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
switch(release){
|
|
775
|
-
case 'premajor':
|
|
776
|
-
this.prerelease.length = 0;
|
|
777
|
-
this.patch = 0;
|
|
778
|
-
this.minor = 0;
|
|
779
|
-
this.major++;
|
|
780
|
-
this.inc('pre', identifier, identifierBase);
|
|
781
|
-
break;
|
|
782
|
-
case 'preminor':
|
|
783
|
-
this.prerelease.length = 0;
|
|
784
|
-
this.patch = 0;
|
|
785
|
-
this.minor++;
|
|
786
|
-
this.inc('pre', identifier, identifierBase);
|
|
787
|
-
break;
|
|
788
|
-
case 'prepatch':
|
|
789
|
-
this.prerelease.length = 0;
|
|
790
|
-
this.inc('patch', identifier, identifierBase);
|
|
791
|
-
this.inc('pre', identifier, identifierBase);
|
|
792
|
-
break;
|
|
793
|
-
case 'prerelease':
|
|
794
|
-
if (0 === this.prerelease.length) this.inc('patch', identifier, identifierBase);
|
|
795
|
-
this.inc('pre', identifier, identifierBase);
|
|
796
|
-
break;
|
|
797
|
-
case 'release':
|
|
798
|
-
if (0 === this.prerelease.length) throw new Error(`version ${this.raw} is not a prerelease`);
|
|
799
|
-
this.prerelease.length = 0;
|
|
800
|
-
break;
|
|
801
|
-
case 'major':
|
|
802
|
-
if (0 !== this.minor || 0 !== this.patch || 0 === this.prerelease.length) this.major++;
|
|
803
|
-
this.minor = 0;
|
|
804
|
-
this.patch = 0;
|
|
805
|
-
this.prerelease = [];
|
|
806
|
-
break;
|
|
807
|
-
case 'minor':
|
|
808
|
-
if (0 !== this.patch || 0 === this.prerelease.length) this.minor++;
|
|
809
|
-
this.patch = 0;
|
|
810
|
-
this.prerelease = [];
|
|
811
|
-
break;
|
|
812
|
-
case 'patch':
|
|
813
|
-
if (0 === this.prerelease.length) this.patch++;
|
|
814
|
-
this.prerelease = [];
|
|
815
|
-
break;
|
|
816
|
-
case 'pre':
|
|
817
|
-
{
|
|
818
|
-
const base = Number(identifierBase) ? 1 : 0;
|
|
819
|
-
if (0 === this.prerelease.length) this.prerelease = [
|
|
820
|
-
base
|
|
821
|
-
];
|
|
822
|
-
else {
|
|
823
|
-
let i = this.prerelease.length;
|
|
824
|
-
while(--i >= 0)if ('number' == typeof this.prerelease[i]) {
|
|
825
|
-
this.prerelease[i]++;
|
|
826
|
-
i = -2;
|
|
827
|
-
}
|
|
828
|
-
if (-1 === i) {
|
|
829
|
-
if (identifier === this.prerelease.join('.') && false === identifierBase) throw new Error('invalid increment argument: identifier already exists');
|
|
830
|
-
this.prerelease.push(base);
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
if (identifier) {
|
|
834
|
-
let prerelease = [
|
|
835
|
-
identifier,
|
|
836
|
-
base
|
|
837
|
-
];
|
|
838
|
-
if (false === identifierBase) prerelease = [
|
|
839
|
-
identifier
|
|
840
|
-
];
|
|
841
|
-
if (0 === compareIdentifiers(this.prerelease[0], identifier)) {
|
|
842
|
-
if (isNaN(this.prerelease[1])) this.prerelease = prerelease;
|
|
843
|
-
} else this.prerelease = prerelease;
|
|
844
|
-
}
|
|
845
|
-
break;
|
|
846
|
-
}
|
|
847
|
-
default:
|
|
848
|
-
throw new Error(`invalid increment argument: ${release}`);
|
|
849
|
-
}
|
|
850
|
-
this.raw = this.format();
|
|
851
|
-
if (this.build.length) this.raw += `+${this.build.join('.')}`;
|
|
852
|
-
return this;
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
module.exports = SemVer;
|
|
856
|
-
},
|
|
857
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/clean.js": function(module, __unused_webpack_exports, __nested_webpack_require_28161_28180__) {
|
|
858
|
-
const parse = __nested_webpack_require_28161_28180__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js");
|
|
859
|
-
const clean = (version, options)=>{
|
|
860
|
-
const s = parse(version.trim().replace(/^[=v]+/, ''), options);
|
|
861
|
-
return s ? s.version : null;
|
|
862
|
-
};
|
|
863
|
-
module.exports = clean;
|
|
864
|
-
},
|
|
865
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/cmp.js": function(module, __unused_webpack_exports, __nested_webpack_require_28643_28662__) {
|
|
866
|
-
const eq = __nested_webpack_require_28643_28662__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/eq.js");
|
|
867
|
-
const neq = __nested_webpack_require_28643_28662__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/neq.js");
|
|
868
|
-
const gt = __nested_webpack_require_28643_28662__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js");
|
|
869
|
-
const gte = __nested_webpack_require_28643_28662__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gte.js");
|
|
870
|
-
const lt = __nested_webpack_require_28643_28662__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lt.js");
|
|
871
|
-
const lte = __nested_webpack_require_28643_28662__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lte.js");
|
|
872
|
-
const cmp = (a, op, b, loose)=>{
|
|
873
|
-
switch(op){
|
|
874
|
-
case '===':
|
|
875
|
-
if ('object' == typeof a) a = a.version;
|
|
876
|
-
if ('object' == typeof b) b = b.version;
|
|
877
|
-
return a === b;
|
|
878
|
-
case '!==':
|
|
879
|
-
if ('object' == typeof a) a = a.version;
|
|
880
|
-
if ('object' == typeof b) b = b.version;
|
|
881
|
-
return a !== b;
|
|
882
|
-
case '':
|
|
883
|
-
case '=':
|
|
884
|
-
case '==':
|
|
885
|
-
return eq(a, b, loose);
|
|
886
|
-
case '!=':
|
|
887
|
-
return neq(a, b, loose);
|
|
888
|
-
case '>':
|
|
889
|
-
return gt(a, b, loose);
|
|
890
|
-
case '>=':
|
|
891
|
-
return gte(a, b, loose);
|
|
892
|
-
case '<':
|
|
893
|
-
return lt(a, b, loose);
|
|
894
|
-
case '<=':
|
|
895
|
-
return lte(a, b, loose);
|
|
896
|
-
default:
|
|
897
|
-
throw new TypeError(`Invalid operator: ${op}`);
|
|
898
|
-
}
|
|
899
|
-
};
|
|
900
|
-
module.exports = cmp;
|
|
901
|
-
},
|
|
902
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/coerce.js": function(module, __unused_webpack_exports, __nested_webpack_require_30572_30591__) {
|
|
903
|
-
const SemVer = __nested_webpack_require_30572_30591__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
904
|
-
const parse = __nested_webpack_require_30572_30591__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js");
|
|
905
|
-
const { safeRe: re, t } = __nested_webpack_require_30572_30591__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js");
|
|
906
|
-
const coerce = (version, options)=>{
|
|
907
|
-
if (version instanceof SemVer) return version;
|
|
908
|
-
if ('number' == typeof version) version = String(version);
|
|
909
|
-
if ('string' != typeof version) return null;
|
|
910
|
-
options = options || {};
|
|
911
|
-
let match = null;
|
|
912
|
-
if (options.rtl) {
|
|
913
|
-
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
914
|
-
let next;
|
|
915
|
-
while((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)){
|
|
916
|
-
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
917
|
-
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
918
|
-
}
|
|
919
|
-
coerceRtlRegex.lastIndex = -1;
|
|
920
|
-
} else match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
921
|
-
if (null === match) return null;
|
|
922
|
-
const major = match[2];
|
|
923
|
-
const minor = match[3] || '0';
|
|
924
|
-
const patch = match[4] || '0';
|
|
925
|
-
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '';
|
|
926
|
-
const build = options.includePrerelease && match[6] ? `+${match[6]}` : '';
|
|
927
|
-
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
928
|
-
};
|
|
929
|
-
module.exports = coerce;
|
|
930
|
-
},
|
|
931
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-build.js": function(module, __unused_webpack_exports, __nested_webpack_require_32550_32569__) {
|
|
932
|
-
const SemVer = __nested_webpack_require_32550_32569__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
933
|
-
const compareBuild = (a, b, loose)=>{
|
|
934
|
-
const versionA = new SemVer(a, loose);
|
|
935
|
-
const versionB = new SemVer(b, loose);
|
|
936
|
-
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
937
|
-
};
|
|
938
|
-
module.exports = compareBuild;
|
|
939
|
-
},
|
|
940
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-loose.js": function(module, __unused_webpack_exports, __nested_webpack_require_33118_33137__) {
|
|
941
|
-
const compare = __nested_webpack_require_33118_33137__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
942
|
-
const compareLoose = (a, b)=>compare(a, b, true);
|
|
943
|
-
module.exports = compareLoose;
|
|
944
|
-
},
|
|
945
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js": function(module, __unused_webpack_exports, __nested_webpack_require_33501_33520__) {
|
|
946
|
-
const SemVer = __nested_webpack_require_33501_33520__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
947
|
-
const compare = (a, b, loose)=>new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
948
|
-
module.exports = compare;
|
|
949
|
-
},
|
|
950
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/diff.js": function(module, __unused_webpack_exports, __nested_webpack_require_33905_33924__) {
|
|
951
|
-
const parse = __nested_webpack_require_33905_33924__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js");
|
|
952
|
-
const diff = (version1, version2)=>{
|
|
953
|
-
const v1 = parse(version1, null, true);
|
|
954
|
-
const v2 = parse(version2, null, true);
|
|
955
|
-
const comparison = v1.compare(v2);
|
|
956
|
-
if (0 === comparison) return null;
|
|
957
|
-
const v1Higher = comparison > 0;
|
|
958
|
-
const highVersion = v1Higher ? v1 : v2;
|
|
959
|
-
const lowVersion = v1Higher ? v2 : v1;
|
|
960
|
-
const highHasPre = !!highVersion.prerelease.length;
|
|
961
|
-
const lowHasPre = !!lowVersion.prerelease.length;
|
|
962
|
-
if (lowHasPre && !highHasPre) {
|
|
963
|
-
if (!lowVersion.patch && !lowVersion.minor) return 'major';
|
|
964
|
-
if (0 === lowVersion.compareMain(highVersion)) {
|
|
965
|
-
if (lowVersion.minor && !lowVersion.patch) return 'minor';
|
|
966
|
-
return 'patch';
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
const prefix = highHasPre ? 'pre' : '';
|
|
970
|
-
if (v1.major !== v2.major) return prefix + 'major';
|
|
971
|
-
if (v1.minor !== v2.minor) return prefix + 'minor';
|
|
972
|
-
if (v1.patch !== v2.patch) return prefix + 'patch';
|
|
973
|
-
return 'prerelease';
|
|
974
|
-
};
|
|
975
|
-
module.exports = diff;
|
|
976
|
-
},
|
|
977
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/eq.js": function(module, __unused_webpack_exports, __nested_webpack_require_35350_35369__) {
|
|
978
|
-
const compare = __nested_webpack_require_35350_35369__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
979
|
-
const eq = (a, b, loose)=>0 === compare(a, b, loose);
|
|
980
|
-
module.exports = eq;
|
|
981
|
-
},
|
|
982
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js": function(module, __unused_webpack_exports, __nested_webpack_require_35722_35741__) {
|
|
983
|
-
const compare = __nested_webpack_require_35722_35741__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
984
|
-
const gt = (a, b, loose)=>compare(a, b, loose) > 0;
|
|
985
|
-
module.exports = gt;
|
|
986
|
-
},
|
|
987
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gte.js": function(module, __unused_webpack_exports, __nested_webpack_require_36093_36112__) {
|
|
988
|
-
const compare = __nested_webpack_require_36093_36112__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
989
|
-
const gte = (a, b, loose)=>compare(a, b, loose) >= 0;
|
|
990
|
-
module.exports = gte;
|
|
991
|
-
},
|
|
992
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/inc.js": function(module, __unused_webpack_exports, __nested_webpack_require_36467_36486__) {
|
|
993
|
-
const SemVer = __nested_webpack_require_36467_36486__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
994
|
-
const inc = (version, release, options, identifier, identifierBase)=>{
|
|
995
|
-
if ('string' == typeof options) {
|
|
996
|
-
identifierBase = identifier;
|
|
997
|
-
identifier = options;
|
|
998
|
-
options = void 0;
|
|
999
|
-
}
|
|
1000
|
-
try {
|
|
1001
|
-
return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier, identifierBase).version;
|
|
1002
|
-
} catch (er) {
|
|
1003
|
-
return null;
|
|
1004
|
-
}
|
|
1005
|
-
};
|
|
1006
|
-
module.exports = inc;
|
|
1007
|
-
},
|
|
1008
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lt.js": function(module, __unused_webpack_exports, __nested_webpack_require_37277_37296__) {
|
|
1009
|
-
const compare = __nested_webpack_require_37277_37296__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
1010
|
-
const lt = (a, b, loose)=>compare(a, b, loose) < 0;
|
|
1011
|
-
module.exports = lt;
|
|
1012
|
-
},
|
|
1013
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lte.js": function(module, __unused_webpack_exports, __nested_webpack_require_37648_37667__) {
|
|
1014
|
-
const compare = __nested_webpack_require_37648_37667__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
1015
|
-
const lte = (a, b, loose)=>compare(a, b, loose) <= 0;
|
|
1016
|
-
module.exports = lte;
|
|
1017
|
-
},
|
|
1018
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/major.js": function(module, __unused_webpack_exports, __nested_webpack_require_38024_38043__) {
|
|
1019
|
-
const SemVer = __nested_webpack_require_38024_38043__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1020
|
-
const major = (a, loose)=>new SemVer(a, loose).major;
|
|
1021
|
-
module.exports = major;
|
|
1022
|
-
},
|
|
1023
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/minor.js": function(module, __unused_webpack_exports, __nested_webpack_require_38398_38417__) {
|
|
1024
|
-
const SemVer = __nested_webpack_require_38398_38417__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1025
|
-
const minor = (a, loose)=>new SemVer(a, loose).minor;
|
|
1026
|
-
module.exports = minor;
|
|
1027
|
-
},
|
|
1028
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/neq.js": function(module, __unused_webpack_exports, __nested_webpack_require_38770_38789__) {
|
|
1029
|
-
const compare = __nested_webpack_require_38770_38789__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
1030
|
-
const neq = (a, b, loose)=>0 !== compare(a, b, loose);
|
|
1031
|
-
module.exports = neq;
|
|
1032
|
-
},
|
|
1033
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js": function(module, __unused_webpack_exports, __nested_webpack_require_39147_39166__) {
|
|
1034
|
-
const SemVer = __nested_webpack_require_39147_39166__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1035
|
-
const parse = (version, options, throwErrors = false)=>{
|
|
1036
|
-
if (version instanceof SemVer) return version;
|
|
1037
|
-
try {
|
|
1038
|
-
return new SemVer(version, options);
|
|
1039
|
-
} catch (er) {
|
|
1040
|
-
if (!throwErrors) return null;
|
|
1041
|
-
throw er;
|
|
1042
|
-
}
|
|
1043
|
-
};
|
|
1044
|
-
module.exports = parse;
|
|
1045
|
-
},
|
|
1046
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/patch.js": function(module, __unused_webpack_exports, __nested_webpack_require_39779_39798__) {
|
|
1047
|
-
const SemVer = __nested_webpack_require_39779_39798__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1048
|
-
const patch = (a, loose)=>new SemVer(a, loose).patch;
|
|
1049
|
-
module.exports = patch;
|
|
1050
|
-
},
|
|
1051
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/prerelease.js": function(module, __unused_webpack_exports, __nested_webpack_require_40158_40177__) {
|
|
1052
|
-
const parse = __nested_webpack_require_40158_40177__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js");
|
|
1053
|
-
const prerelease = (version, options)=>{
|
|
1054
|
-
const parsed = parse(version, options);
|
|
1055
|
-
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
1056
|
-
};
|
|
1057
|
-
module.exports = prerelease;
|
|
1058
|
-
},
|
|
1059
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rcompare.js": function(module, __unused_webpack_exports, __nested_webpack_require_40672_40691__) {
|
|
1060
|
-
const compare = __nested_webpack_require_40672_40691__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
1061
|
-
const rcompare = (a, b, loose)=>compare(b, a, loose);
|
|
1062
|
-
module.exports = rcompare;
|
|
1063
|
-
},
|
|
1064
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rsort.js": function(module, __unused_webpack_exports, __nested_webpack_require_41053_41072__) {
|
|
1065
|
-
const compareBuild = __nested_webpack_require_41053_41072__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-build.js");
|
|
1066
|
-
const rsort = (list, loose)=>list.sort((a, b)=>compareBuild(b, a, loose));
|
|
1067
|
-
module.exports = rsort;
|
|
1068
|
-
},
|
|
1069
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/satisfies.js": function(module, __unused_webpack_exports, __nested_webpack_require_41467_41486__) {
|
|
1070
|
-
const Range = __nested_webpack_require_41467_41486__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
1071
|
-
const satisfies = (version, range, options)=>{
|
|
1072
|
-
try {
|
|
1073
|
-
range = new Range(range, options);
|
|
1074
|
-
} catch (er) {
|
|
1075
|
-
return false;
|
|
1076
|
-
}
|
|
1077
|
-
return range.test(version);
|
|
1078
|
-
};
|
|
1079
|
-
module.exports = satisfies;
|
|
1080
|
-
},
|
|
1081
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/sort.js": function(module, __unused_webpack_exports, __nested_webpack_require_42026_42045__) {
|
|
1082
|
-
const compareBuild = __nested_webpack_require_42026_42045__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-build.js");
|
|
1083
|
-
const sort = (list, loose)=>list.sort((a, b)=>compareBuild(a, b, loose));
|
|
1084
|
-
module.exports = sort;
|
|
1085
|
-
},
|
|
1086
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/valid.js": function(module, __unused_webpack_exports, __nested_webpack_require_42434_42453__) {
|
|
1087
|
-
const parse = __nested_webpack_require_42434_42453__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js");
|
|
1088
|
-
const valid = (version, options)=>{
|
|
1089
|
-
const v = parse(version, options);
|
|
1090
|
-
return v ? v.version : null;
|
|
1091
|
-
};
|
|
1092
|
-
module.exports = valid;
|
|
1093
|
-
},
|
|
1094
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/index.js": function(module, __unused_webpack_exports, __nested_webpack_require_42879_42898__) {
|
|
1095
|
-
const internalRe = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js");
|
|
1096
|
-
const constants = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js");
|
|
1097
|
-
const SemVer = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1098
|
-
const identifiers = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/identifiers.js");
|
|
1099
|
-
const parse = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js");
|
|
1100
|
-
const valid = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/valid.js");
|
|
1101
|
-
const clean = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/clean.js");
|
|
1102
|
-
const inc = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/inc.js");
|
|
1103
|
-
const diff = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/diff.js");
|
|
1104
|
-
const major = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/major.js");
|
|
1105
|
-
const minor = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/minor.js");
|
|
1106
|
-
const patch = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/patch.js");
|
|
1107
|
-
const prerelease = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/prerelease.js");
|
|
1108
|
-
const compare = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
1109
|
-
const rcompare = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rcompare.js");
|
|
1110
|
-
const compareLoose = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-loose.js");
|
|
1111
|
-
const compareBuild = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-build.js");
|
|
1112
|
-
const sort = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/sort.js");
|
|
1113
|
-
const rsort = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rsort.js");
|
|
1114
|
-
const gt = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js");
|
|
1115
|
-
const lt = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lt.js");
|
|
1116
|
-
const eq = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/eq.js");
|
|
1117
|
-
const neq = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/neq.js");
|
|
1118
|
-
const gte = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gte.js");
|
|
1119
|
-
const lte = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lte.js");
|
|
1120
|
-
const cmp = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/cmp.js");
|
|
1121
|
-
const coerce = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/coerce.js");
|
|
1122
|
-
const Comparator = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/comparator.js");
|
|
1123
|
-
const Range = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
1124
|
-
const satisfies = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/satisfies.js");
|
|
1125
|
-
const toComparators = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/to-comparators.js");
|
|
1126
|
-
const maxSatisfying = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/max-satisfying.js");
|
|
1127
|
-
const minSatisfying = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/min-satisfying.js");
|
|
1128
|
-
const minVersion = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/min-version.js");
|
|
1129
|
-
const validRange = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/valid.js");
|
|
1130
|
-
const outside = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/outside.js");
|
|
1131
|
-
const gtr = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/gtr.js");
|
|
1132
|
-
const ltr = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/ltr.js");
|
|
1133
|
-
const intersects = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/intersects.js");
|
|
1134
|
-
const simplifyRange = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/simplify.js");
|
|
1135
|
-
const subset = __nested_webpack_require_42879_42898__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/subset.js");
|
|
1136
|
-
module.exports = {
|
|
1137
|
-
parse,
|
|
1138
|
-
valid,
|
|
1139
|
-
clean,
|
|
1140
|
-
inc,
|
|
1141
|
-
diff,
|
|
1142
|
-
major,
|
|
1143
|
-
minor,
|
|
1144
|
-
patch,
|
|
1145
|
-
prerelease,
|
|
1146
|
-
compare,
|
|
1147
|
-
rcompare,
|
|
1148
|
-
compareLoose,
|
|
1149
|
-
compareBuild,
|
|
1150
|
-
sort,
|
|
1151
|
-
rsort,
|
|
1152
|
-
gt,
|
|
1153
|
-
lt,
|
|
1154
|
-
eq,
|
|
1155
|
-
neq,
|
|
1156
|
-
gte,
|
|
1157
|
-
lte,
|
|
1158
|
-
cmp,
|
|
1159
|
-
coerce,
|
|
1160
|
-
Comparator,
|
|
1161
|
-
Range,
|
|
1162
|
-
satisfies,
|
|
1163
|
-
toComparators,
|
|
1164
|
-
maxSatisfying,
|
|
1165
|
-
minSatisfying,
|
|
1166
|
-
minVersion,
|
|
1167
|
-
validRange,
|
|
1168
|
-
outside,
|
|
1169
|
-
gtr,
|
|
1170
|
-
ltr,
|
|
1171
|
-
intersects,
|
|
1172
|
-
simplifyRange,
|
|
1173
|
-
subset,
|
|
1174
|
-
SemVer,
|
|
1175
|
-
re: internalRe.re,
|
|
1176
|
-
src: internalRe.src,
|
|
1177
|
-
tokens: internalRe.t,
|
|
1178
|
-
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
1179
|
-
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
1180
|
-
compareIdentifiers: identifiers.compareIdentifiers,
|
|
1181
|
-
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
1182
|
-
};
|
|
1183
|
-
},
|
|
1184
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js": function(module) {
|
|
1185
|
-
const SEMVER_SPEC_VERSION = '2.0.0';
|
|
1186
|
-
const MAX_LENGTH = 256;
|
|
1187
|
-
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
1188
|
-
const MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
1189
|
-
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
1190
|
-
const RELEASE_TYPES = [
|
|
1191
|
-
'major',
|
|
1192
|
-
'premajor',
|
|
1193
|
-
'minor',
|
|
1194
|
-
'preminor',
|
|
1195
|
-
'patch',
|
|
1196
|
-
'prepatch',
|
|
1197
|
-
'prerelease'
|
|
1198
|
-
];
|
|
1199
|
-
module.exports = {
|
|
1200
|
-
MAX_LENGTH,
|
|
1201
|
-
MAX_SAFE_COMPONENT_LENGTH,
|
|
1202
|
-
MAX_SAFE_BUILD_LENGTH,
|
|
1203
|
-
MAX_SAFE_INTEGER,
|
|
1204
|
-
RELEASE_TYPES,
|
|
1205
|
-
SEMVER_SPEC_VERSION,
|
|
1206
|
-
FLAG_INCLUDE_PRERELEASE: 1,
|
|
1207
|
-
FLAG_LOOSE: 2
|
|
1208
|
-
};
|
|
1209
|
-
},
|
|
1210
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js": function(module) {
|
|
1211
|
-
const debug = 'object' == typeof process && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args)=>console.error('SEMVER', ...args) : ()=>{};
|
|
1212
|
-
module.exports = debug;
|
|
1213
|
-
},
|
|
1214
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/identifiers.js": function(module) {
|
|
1215
|
-
const numeric = /^[0-9]+$/;
|
|
1216
|
-
const compareIdentifiers = (a, b)=>{
|
|
1217
|
-
const anum = numeric.test(a);
|
|
1218
|
-
const bnum = numeric.test(b);
|
|
1219
|
-
if (anum && bnum) {
|
|
1220
|
-
a *= 1;
|
|
1221
|
-
b *= 1;
|
|
1222
|
-
}
|
|
1223
|
-
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
1224
|
-
};
|
|
1225
|
-
const rcompareIdentifiers = (a, b)=>compareIdentifiers(b, a);
|
|
1226
|
-
module.exports = {
|
|
1227
|
-
compareIdentifiers,
|
|
1228
|
-
rcompareIdentifiers
|
|
1229
|
-
};
|
|
1230
|
-
},
|
|
1231
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/lrucache.js": function(module) {
|
|
1232
|
-
class LRUCache {
|
|
1233
|
-
constructor(){
|
|
1234
|
-
this.max = 1000;
|
|
1235
|
-
this.map = new Map();
|
|
1236
|
-
}
|
|
1237
|
-
get(key) {
|
|
1238
|
-
const value = this.map.get(key);
|
|
1239
|
-
if (void 0 === value) return;
|
|
1240
|
-
this.map.delete(key);
|
|
1241
|
-
this.map.set(key, value);
|
|
1242
|
-
return value;
|
|
1243
|
-
}
|
|
1244
|
-
delete(key) {
|
|
1245
|
-
return this.map.delete(key);
|
|
1246
|
-
}
|
|
1247
|
-
set(key, value) {
|
|
1248
|
-
const deleted = this.delete(key);
|
|
1249
|
-
if (!deleted && void 0 !== value) {
|
|
1250
|
-
if (this.map.size >= this.max) {
|
|
1251
|
-
const firstKey = this.map.keys().next().value;
|
|
1252
|
-
this.delete(firstKey);
|
|
1253
|
-
}
|
|
1254
|
-
this.map.set(key, value);
|
|
1255
|
-
}
|
|
1256
|
-
return this;
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1259
|
-
module.exports = LRUCache;
|
|
1260
|
-
},
|
|
1261
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/parse-options.js": function(module) {
|
|
1262
|
-
const looseOption = Object.freeze({
|
|
1263
|
-
loose: true
|
|
1264
|
-
});
|
|
1265
|
-
const emptyOpts = Object.freeze({});
|
|
1266
|
-
const parseOptions = (options)=>{
|
|
1267
|
-
if (!options) return emptyOpts;
|
|
1268
|
-
if ('object' != typeof options) return looseOption;
|
|
1269
|
-
return options;
|
|
1270
|
-
};
|
|
1271
|
-
module.exports = parseOptions;
|
|
1272
|
-
},
|
|
1273
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js": function(module, exports, __nested_webpack_require_52683_52702__) {
|
|
1274
|
-
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = __nested_webpack_require_52683_52702__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js");
|
|
1275
|
-
const debug = __nested_webpack_require_52683_52702__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js");
|
|
1276
|
-
exports = module.exports = {};
|
|
1277
|
-
const re = exports.re = [];
|
|
1278
|
-
const safeRe = exports.safeRe = [];
|
|
1279
|
-
const src = exports.src = [];
|
|
1280
|
-
const safeSrc = exports.safeSrc = [];
|
|
1281
|
-
const t = exports.t = {};
|
|
1282
|
-
let R = 0;
|
|
1283
|
-
const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
|
|
1284
|
-
const safeRegexReplacements = [
|
|
1285
|
-
[
|
|
1286
|
-
'\\s',
|
|
1287
|
-
1
|
|
1288
|
-
],
|
|
1289
|
-
[
|
|
1290
|
-
'\\d',
|
|
1291
|
-
MAX_LENGTH
|
|
1292
|
-
],
|
|
1293
|
-
[
|
|
1294
|
-
LETTERDASHNUMBER,
|
|
1295
|
-
MAX_SAFE_BUILD_LENGTH
|
|
1296
|
-
]
|
|
1297
|
-
];
|
|
1298
|
-
const makeSafeRegex = (value)=>{
|
|
1299
|
-
for (const [token, max] of safeRegexReplacements)value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
1300
|
-
return value;
|
|
1301
|
-
};
|
|
1302
|
-
const createToken = (name, value, isGlobal)=>{
|
|
1303
|
-
const safe = makeSafeRegex(value);
|
|
1304
|
-
const index = R++;
|
|
1305
|
-
debug(name, index, value);
|
|
1306
|
-
t[name] = index;
|
|
1307
|
-
src[index] = value;
|
|
1308
|
-
safeSrc[index] = safe;
|
|
1309
|
-
re[index] = new RegExp(value, isGlobal ? 'g' : void 0);
|
|
1310
|
-
safeRe[index] = new RegExp(safe, isGlobal ? 'g' : void 0);
|
|
1311
|
-
};
|
|
1312
|
-
createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
|
|
1313
|
-
createToken('NUMERICIDENTIFIERLOOSE', '\\d+');
|
|
1314
|
-
createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
1315
|
-
createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
1316
|
-
createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
1317
|
-
createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
|
|
1318
|
-
createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
|
|
1319
|
-
createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
1320
|
-
createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
1321
|
-
createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`);
|
|
1322
|
-
createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
1323
|
-
createToken('FULLPLAIN', `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
1324
|
-
createToken('FULL', `^${src[t.FULLPLAIN]}$`);
|
|
1325
|
-
createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
1326
|
-
createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`);
|
|
1327
|
-
createToken('GTLT', '((?:<|>)?=?)');
|
|
1328
|
-
createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
1329
|
-
createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
1330
|
-
createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
1331
|
-
createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
1332
|
-
createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
1333
|
-
createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
1334
|
-
createToken('COERCEPLAIN', `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
1335
|
-
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
1336
|
-
createToken('COERCEFULL', src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?` + `(?:${src[t.BUILD]})?` + "(?:$|[^\\d])");
|
|
1337
|
-
createToken('COERCERTL', src[t.COERCE], true);
|
|
1338
|
-
createToken('COERCERTLFULL', src[t.COERCEFULL], true);
|
|
1339
|
-
createToken('LONETILDE', '(?:~>?)');
|
|
1340
|
-
createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
1341
|
-
exports.tildeTrimReplace = '$1~';
|
|
1342
|
-
createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
1343
|
-
createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
1344
|
-
createToken('LONECARET', '(?:\\^)');
|
|
1345
|
-
createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
1346
|
-
exports.caretTrimReplace = '$1^';
|
|
1347
|
-
createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
1348
|
-
createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
1349
|
-
createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
1350
|
-
createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
1351
|
-
createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
1352
|
-
exports.comparatorTrimReplace = '$1$2$3';
|
|
1353
|
-
createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*\$`);
|
|
1354
|
-
createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*\$`);
|
|
1355
|
-
createToken('STAR', '(<|>)?=?\\s*\\*');
|
|
1356
|
-
createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$');
|
|
1357
|
-
createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$');
|
|
1358
|
-
},
|
|
1359
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/gtr.js": function(module, __unused_webpack_exports, __nested_webpack_require_58504_58523__) {
|
|
1360
|
-
const outside = __nested_webpack_require_58504_58523__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/outside.js");
|
|
1361
|
-
const gtr = (version, range, options)=>outside(version, range, '>', options);
|
|
1362
|
-
module.exports = gtr;
|
|
1363
|
-
},
|
|
1364
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/intersects.js": function(module, __unused_webpack_exports, __nested_webpack_require_58903_58922__) {
|
|
1365
|
-
const Range = __nested_webpack_require_58903_58922__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
1366
|
-
const intersects = (r1, r2, options)=>{
|
|
1367
|
-
r1 = new Range(r1, options);
|
|
1368
|
-
r2 = new Range(r2, options);
|
|
1369
|
-
return r1.intersects(r2, options);
|
|
1370
|
-
};
|
|
1371
|
-
module.exports = intersects;
|
|
1372
|
-
},
|
|
1373
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/ltr.js": function(module, __unused_webpack_exports, __nested_webpack_require_59401_59420__) {
|
|
1374
|
-
const outside = __nested_webpack_require_59401_59420__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/outside.js");
|
|
1375
|
-
const ltr = (version, range, options)=>outside(version, range, '<', options);
|
|
1376
|
-
module.exports = ltr;
|
|
1377
|
-
},
|
|
1378
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/max-satisfying.js": function(module, __unused_webpack_exports, __nested_webpack_require_59804_59823__) {
|
|
1379
|
-
const SemVer = __nested_webpack_require_59804_59823__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1380
|
-
const Range = __nested_webpack_require_59804_59823__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
1381
|
-
const maxSatisfying = (versions, range, options)=>{
|
|
1382
|
-
let max = null;
|
|
1383
|
-
let maxSV = null;
|
|
1384
|
-
let rangeObj = null;
|
|
1385
|
-
try {
|
|
1386
|
-
rangeObj = new Range(range, options);
|
|
1387
|
-
} catch (er) {
|
|
1388
|
-
return null;
|
|
1389
|
-
}
|
|
1390
|
-
versions.forEach((v)=>{
|
|
1391
|
-
if (rangeObj.test(v)) {
|
|
1392
|
-
if (!max || -1 === maxSV.compare(v)) {
|
|
1393
|
-
max = v;
|
|
1394
|
-
maxSV = new SemVer(max, options);
|
|
1395
|
-
}
|
|
1396
|
-
}
|
|
1397
|
-
});
|
|
1398
|
-
return max;
|
|
1399
|
-
};
|
|
1400
|
-
module.exports = maxSatisfying;
|
|
1401
|
-
},
|
|
1402
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/min-satisfying.js": function(module, __unused_webpack_exports, __nested_webpack_require_60861_60880__) {
|
|
1403
|
-
const SemVer = __nested_webpack_require_60861_60880__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1404
|
-
const Range = __nested_webpack_require_60861_60880__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
1405
|
-
const minSatisfying = (versions, range, options)=>{
|
|
1406
|
-
let min = null;
|
|
1407
|
-
let minSV = null;
|
|
1408
|
-
let rangeObj = null;
|
|
1409
|
-
try {
|
|
1410
|
-
rangeObj = new Range(range, options);
|
|
1411
|
-
} catch (er) {
|
|
1412
|
-
return null;
|
|
1413
|
-
}
|
|
1414
|
-
versions.forEach((v)=>{
|
|
1415
|
-
if (rangeObj.test(v)) {
|
|
1416
|
-
if (!min || 1 === minSV.compare(v)) {
|
|
1417
|
-
min = v;
|
|
1418
|
-
minSV = new SemVer(min, options);
|
|
1419
|
-
}
|
|
1420
|
-
}
|
|
1421
|
-
});
|
|
1422
|
-
return min;
|
|
1423
|
-
};
|
|
1424
|
-
module.exports = minSatisfying;
|
|
1425
|
-
},
|
|
1426
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/min-version.js": function(module, __unused_webpack_exports, __nested_webpack_require_61914_61933__) {
|
|
1427
|
-
const SemVer = __nested_webpack_require_61914_61933__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1428
|
-
const Range = __nested_webpack_require_61914_61933__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
1429
|
-
const gt = __nested_webpack_require_61914_61933__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js");
|
|
1430
|
-
const minVersion = (range, loose)=>{
|
|
1431
|
-
range = new Range(range, loose);
|
|
1432
|
-
let minver = new SemVer('0.0.0');
|
|
1433
|
-
if (range.test(minver)) return minver;
|
|
1434
|
-
minver = new SemVer('0.0.0-0');
|
|
1435
|
-
if (range.test(minver)) return minver;
|
|
1436
|
-
minver = null;
|
|
1437
|
-
for(let i = 0; i < range.set.length; ++i){
|
|
1438
|
-
const comparators = range.set[i];
|
|
1439
|
-
let setMin = null;
|
|
1440
|
-
comparators.forEach((comparator)=>{
|
|
1441
|
-
const compver = new SemVer(comparator.semver.version);
|
|
1442
|
-
switch(comparator.operator){
|
|
1443
|
-
case '>':
|
|
1444
|
-
if (0 === compver.prerelease.length) compver.patch++;
|
|
1445
|
-
else compver.prerelease.push(0);
|
|
1446
|
-
compver.raw = compver.format();
|
|
1447
|
-
case '':
|
|
1448
|
-
case '>=':
|
|
1449
|
-
if (!setMin || gt(compver, setMin)) setMin = compver;
|
|
1450
|
-
break;
|
|
1451
|
-
case '<':
|
|
1452
|
-
case '<=':
|
|
1453
|
-
break;
|
|
1454
|
-
default:
|
|
1455
|
-
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1456
|
-
}
|
|
1457
|
-
});
|
|
1458
|
-
if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
|
|
1459
|
-
}
|
|
1460
|
-
if (minver && range.test(minver)) return minver;
|
|
1461
|
-
return null;
|
|
1462
|
-
};
|
|
1463
|
-
module.exports = minVersion;
|
|
1464
|
-
},
|
|
1465
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/outside.js": function(module, __unused_webpack_exports, __nested_webpack_require_63978_63997__) {
|
|
1466
|
-
const SemVer = __nested_webpack_require_63978_63997__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js");
|
|
1467
|
-
const Comparator = __nested_webpack_require_63978_63997__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/comparator.js");
|
|
1468
|
-
const { ANY } = Comparator;
|
|
1469
|
-
const Range = __nested_webpack_require_63978_63997__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
1470
|
-
const satisfies = __nested_webpack_require_63978_63997__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/satisfies.js");
|
|
1471
|
-
const gt = __nested_webpack_require_63978_63997__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js");
|
|
1472
|
-
const lt = __nested_webpack_require_63978_63997__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lt.js");
|
|
1473
|
-
const lte = __nested_webpack_require_63978_63997__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lte.js");
|
|
1474
|
-
const gte = __nested_webpack_require_63978_63997__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gte.js");
|
|
1475
|
-
const outside = (version, range, hilo, options)=>{
|
|
1476
|
-
version = new SemVer(version, options);
|
|
1477
|
-
range = new Range(range, options);
|
|
1478
|
-
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1479
|
-
switch(hilo){
|
|
1480
|
-
case '>':
|
|
1481
|
-
gtfn = gt;
|
|
1482
|
-
ltefn = lte;
|
|
1483
|
-
ltfn = lt;
|
|
1484
|
-
comp = '>';
|
|
1485
|
-
ecomp = '>=';
|
|
1486
|
-
break;
|
|
1487
|
-
case '<':
|
|
1488
|
-
gtfn = lt;
|
|
1489
|
-
ltefn = gte;
|
|
1490
|
-
ltfn = gt;
|
|
1491
|
-
comp = '<';
|
|
1492
|
-
ecomp = '<=';
|
|
1493
|
-
break;
|
|
1494
|
-
default:
|
|
1495
|
-
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
1496
|
-
}
|
|
1497
|
-
if (satisfies(version, range, options)) return false;
|
|
1498
|
-
for(let i = 0; i < range.set.length; ++i){
|
|
1499
|
-
const comparators = range.set[i];
|
|
1500
|
-
let high = null;
|
|
1501
|
-
let low = null;
|
|
1502
|
-
comparators.forEach((comparator)=>{
|
|
1503
|
-
if (comparator.semver === ANY) comparator = new Comparator('>=0.0.0');
|
|
1504
|
-
high = high || comparator;
|
|
1505
|
-
low = low || comparator;
|
|
1506
|
-
if (gtfn(comparator.semver, high.semver, options)) high = comparator;
|
|
1507
|
-
else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
|
|
1508
|
-
});
|
|
1509
|
-
if (high.operator === comp || high.operator === ecomp) return false;
|
|
1510
|
-
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) return false;
|
|
1511
|
-
if (low.operator === ecomp && ltfn(version, low.semver)) return false;
|
|
1512
|
-
}
|
|
1513
|
-
return true;
|
|
1514
|
-
};
|
|
1515
|
-
module.exports = outside;
|
|
1516
|
-
},
|
|
1517
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/simplify.js": function(module, __unused_webpack_exports, __nested_webpack_require_66966_66985__) {
|
|
1518
|
-
const satisfies = __nested_webpack_require_66966_66985__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/satisfies.js");
|
|
1519
|
-
const compare = __nested_webpack_require_66966_66985__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
1520
|
-
module.exports = (versions, range, options)=>{
|
|
1521
|
-
const set = [];
|
|
1522
|
-
let first = null;
|
|
1523
|
-
let prev = null;
|
|
1524
|
-
const v = versions.sort((a, b)=>compare(a, b, options));
|
|
1525
|
-
for (const version of v){
|
|
1526
|
-
const included = satisfies(version, range, options);
|
|
1527
|
-
if (included) {
|
|
1528
|
-
prev = version;
|
|
1529
|
-
if (!first) first = version;
|
|
1530
|
-
} else {
|
|
1531
|
-
if (prev) set.push([
|
|
1532
|
-
first,
|
|
1533
|
-
prev
|
|
1534
|
-
]);
|
|
1535
|
-
prev = null;
|
|
1536
|
-
first = null;
|
|
1537
|
-
}
|
|
1538
|
-
}
|
|
1539
|
-
if (first) set.push([
|
|
1540
|
-
first,
|
|
1541
|
-
null
|
|
1542
|
-
]);
|
|
1543
|
-
const ranges = [];
|
|
1544
|
-
for (const [min, max] of set)if (min === max) ranges.push(min);
|
|
1545
|
-
else if (max || min !== v[0]) if (max) if (min === v[0]) ranges.push(`<=${max}`);
|
|
1546
|
-
else ranges.push(`${min} - ${max}`);
|
|
1547
|
-
else ranges.push(`>=${min}`);
|
|
1548
|
-
else ranges.push('*');
|
|
1549
|
-
const simplified = ranges.join(' || ');
|
|
1550
|
-
const original = 'string' == typeof range.raw ? range.raw : String(range);
|
|
1551
|
-
return simplified.length < original.length ? simplified : range;
|
|
1552
|
-
};
|
|
1553
|
-
},
|
|
1554
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/subset.js": function(module, __unused_webpack_exports, __nested_webpack_require_68711_68730__) {
|
|
1555
|
-
const Range = __nested_webpack_require_68711_68730__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
1556
|
-
const Comparator = __nested_webpack_require_68711_68730__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/comparator.js");
|
|
1557
|
-
const { ANY } = Comparator;
|
|
1558
|
-
const satisfies = __nested_webpack_require_68711_68730__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/satisfies.js");
|
|
1559
|
-
const compare = __nested_webpack_require_68711_68730__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js");
|
|
1560
|
-
const subset = (sub, dom, options = {})=>{
|
|
1561
|
-
if (sub === dom) return true;
|
|
1562
|
-
sub = new Range(sub, options);
|
|
1563
|
-
dom = new Range(dom, options);
|
|
1564
|
-
let sawNonNull = false;
|
|
1565
|
-
OUTER: for (const simpleSub of sub.set){
|
|
1566
|
-
for (const simpleDom of dom.set){
|
|
1567
|
-
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
1568
|
-
sawNonNull = sawNonNull || null !== isSub;
|
|
1569
|
-
if (isSub) continue OUTER;
|
|
1570
|
-
}
|
|
1571
|
-
if (sawNonNull) return false;
|
|
1572
|
-
}
|
|
1573
|
-
return true;
|
|
1574
|
-
};
|
|
1575
|
-
const minimumVersionWithPreRelease = [
|
|
1576
|
-
new Comparator('>=0.0.0-0')
|
|
1577
|
-
];
|
|
1578
|
-
const minimumVersion = [
|
|
1579
|
-
new Comparator('>=0.0.0')
|
|
1580
|
-
];
|
|
1581
|
-
const simpleSubset = (sub, dom, options)=>{
|
|
1582
|
-
if (sub === dom) return true;
|
|
1583
|
-
if (1 === sub.length && sub[0].semver === ANY) if (1 === dom.length && dom[0].semver === ANY) return true;
|
|
1584
|
-
else sub = options.includePrerelease ? minimumVersionWithPreRelease : minimumVersion;
|
|
1585
|
-
if (1 === dom.length && dom[0].semver === ANY) if (options.includePrerelease) return true;
|
|
1586
|
-
else dom = minimumVersion;
|
|
1587
|
-
const eqSet = new Set();
|
|
1588
|
-
let gt, lt;
|
|
1589
|
-
for (const c of sub)if ('>' === c.operator || '>=' === c.operator) gt = higherGT(gt, c, options);
|
|
1590
|
-
else if ('<' === c.operator || '<=' === c.operator) lt = lowerLT(lt, c, options);
|
|
1591
|
-
else eqSet.add(c.semver);
|
|
1592
|
-
if (eqSet.size > 1) return null;
|
|
1593
|
-
let gtltComp;
|
|
1594
|
-
if (gt && lt) {
|
|
1595
|
-
gtltComp = compare(gt.semver, lt.semver, options);
|
|
1596
|
-
if (gtltComp > 0) return null;
|
|
1597
|
-
if (0 === gtltComp && ('>=' !== gt.operator || '<=' !== lt.operator)) return null;
|
|
1598
|
-
}
|
|
1599
|
-
for (const eq of eqSet){
|
|
1600
|
-
if (gt && !satisfies(eq, String(gt), options)) return null;
|
|
1601
|
-
if (lt && !satisfies(eq, String(lt), options)) return null;
|
|
1602
|
-
for (const c of dom)if (!satisfies(eq, String(c), options)) return false;
|
|
1603
|
-
return true;
|
|
1604
|
-
}
|
|
1605
|
-
let higher, lower;
|
|
1606
|
-
let hasDomLT, hasDomGT;
|
|
1607
|
-
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
1608
|
-
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
1609
|
-
if (needDomLTPre && 1 === needDomLTPre.prerelease.length && '<' === lt.operator && 0 === needDomLTPre.prerelease[0]) needDomLTPre = false;
|
|
1610
|
-
for (const c of dom){
|
|
1611
|
-
hasDomGT = hasDomGT || '>' === c.operator || '>=' === c.operator;
|
|
1612
|
-
hasDomLT = hasDomLT || '<' === c.operator || '<=' === c.operator;
|
|
1613
|
-
if (gt) {
|
|
1614
|
-
if (needDomGTPre) {
|
|
1615
|
-
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;
|
|
1616
|
-
}
|
|
1617
|
-
if ('>' === c.operator || '>=' === c.operator) {
|
|
1618
|
-
higher = higherGT(gt, c, options);
|
|
1619
|
-
if (higher === c && higher !== gt) return false;
|
|
1620
|
-
} else if ('>=' === gt.operator && !satisfies(gt.semver, String(c), options)) return false;
|
|
1621
|
-
}
|
|
1622
|
-
if (lt) {
|
|
1623
|
-
if (needDomLTPre) {
|
|
1624
|
-
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;
|
|
1625
|
-
}
|
|
1626
|
-
if ('<' === c.operator || '<=' === c.operator) {
|
|
1627
|
-
lower = lowerLT(lt, c, options);
|
|
1628
|
-
if (lower === c && lower !== lt) return false;
|
|
1629
|
-
} else if ('<=' === lt.operator && !satisfies(lt.semver, String(c), options)) return false;
|
|
1630
|
-
}
|
|
1631
|
-
if (!c.operator && (lt || gt) && 0 !== gtltComp) return false;
|
|
1632
|
-
}
|
|
1633
|
-
if (gt && hasDomLT && !lt && 0 !== gtltComp) return false;
|
|
1634
|
-
if (lt && hasDomGT && !gt && 0 !== gtltComp) return false;
|
|
1635
|
-
if (needDomGTPre || needDomLTPre) return false;
|
|
1636
|
-
return true;
|
|
1637
|
-
};
|
|
1638
|
-
const higherGT = (a, b, options)=>{
|
|
1639
|
-
if (!a) return b;
|
|
1640
|
-
const comp = compare(a.semver, b.semver, options);
|
|
1641
|
-
return comp > 0 ? a : comp < 0 ? b : '>' === b.operator && '>=' === a.operator ? b : a;
|
|
1642
|
-
};
|
|
1643
|
-
const lowerLT = (a, b, options)=>{
|
|
1644
|
-
if (!a) return b;
|
|
1645
|
-
const comp = compare(a.semver, b.semver, options);
|
|
1646
|
-
return comp < 0 ? a : comp > 0 ? b : '<' === b.operator && '<=' === a.operator ? b : a;
|
|
1647
|
-
};
|
|
1648
|
-
module.exports = subset;
|
|
1649
|
-
},
|
|
1650
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/to-comparators.js": function(module, __unused_webpack_exports, __nested_webpack_require_74414_74433__) {
|
|
1651
|
-
const Range = __nested_webpack_require_74414_74433__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
1652
|
-
const toComparators = (range, options)=>new Range(range, options).set.map((comp)=>comp.map((c)=>c.value).join(' ').trim().split(' '));
|
|
1653
|
-
module.exports = toComparators;
|
|
1654
|
-
},
|
|
1655
|
-
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/valid.js": function(module, __unused_webpack_exports, __nested_webpack_require_74872_74891__) {
|
|
1656
|
-
const Range = __nested_webpack_require_74872_74891__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js");
|
|
1657
|
-
const validRange = (range, options)=>{
|
|
1658
|
-
try {
|
|
1659
|
-
return new Range(range, options).range || '*';
|
|
1660
|
-
} catch (er) {
|
|
1661
|
-
return null;
|
|
1662
|
-
}
|
|
1663
|
-
};
|
|
1664
|
-
module.exports = validRange;
|
|
1665
|
-
}
|
|
27
|
+
var __toESM$1 = (mod, isNodeMode, target) => (target = mod != null ? __create$1(__getProtoOf$1(mod)) : {}, __copyProps$1(isNodeMode || !mod || !mod.__esModule ? __defProp$1(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/postgres.ts
|
|
35
|
+
const postgres = (config, hooks) => {
|
|
36
|
+
return createDatabasePlugin("postgres", {
|
|
37
|
+
getContext: () => {
|
|
38
|
+
const pool = new Pool(config);
|
|
39
|
+
const dialect = new PostgresDialect({ pool });
|
|
40
|
+
const db = new Kysely({ dialect });
|
|
41
|
+
return {
|
|
42
|
+
db,
|
|
43
|
+
pool
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
async onUnmount(context) {
|
|
47
|
+
await context.db.destroy();
|
|
48
|
+
await context.pool.end();
|
|
49
|
+
},
|
|
50
|
+
async getBundleById(context, bundleId) {
|
|
51
|
+
const data = await context.db.selectFrom("bundles").selectAll().where("id", "=", bundleId).executeTakeFirst();
|
|
52
|
+
if (!data) return null;
|
|
53
|
+
return {
|
|
54
|
+
enabled: data.enabled,
|
|
55
|
+
shouldForceUpdate: data.should_force_update,
|
|
56
|
+
fileHash: data.file_hash,
|
|
57
|
+
gitCommitHash: data.git_commit_hash,
|
|
58
|
+
id: data.id,
|
|
59
|
+
message: data.message,
|
|
60
|
+
platform: data.platform,
|
|
61
|
+
targetAppVersion: data.target_app_version,
|
|
62
|
+
channel: data.channel,
|
|
63
|
+
storageUri: data.storage_uri,
|
|
64
|
+
fingerprintHash: data.fingerprint_hash
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
async getBundles(context, options) {
|
|
68
|
+
const { where, limit, offset = 0 } = options ?? {};
|
|
69
|
+
let query = context.db.selectFrom("bundles").orderBy("id", "desc");
|
|
70
|
+
if (where?.channel) query = query.where("channel", "=", where.channel);
|
|
71
|
+
if (where?.platform) query = query.where("platform", "=", where.platform);
|
|
72
|
+
if (limit) query = query.limit(limit);
|
|
73
|
+
if (offset) query = query.offset(offset);
|
|
74
|
+
const data = await query.selectAll().execute();
|
|
75
|
+
return data.map((bundle) => ({
|
|
76
|
+
enabled: bundle.enabled,
|
|
77
|
+
shouldForceUpdate: bundle.should_force_update,
|
|
78
|
+
fileHash: bundle.file_hash,
|
|
79
|
+
gitCommitHash: bundle.git_commit_hash,
|
|
80
|
+
id: bundle.id,
|
|
81
|
+
message: bundle.message,
|
|
82
|
+
platform: bundle.platform,
|
|
83
|
+
targetAppVersion: bundle.target_app_version,
|
|
84
|
+
channel: bundle.channel,
|
|
85
|
+
storageUri: bundle.storage_uri,
|
|
86
|
+
fingerprintHash: bundle.fingerprint_hash
|
|
87
|
+
}));
|
|
88
|
+
},
|
|
89
|
+
async getChannels(context) {
|
|
90
|
+
const data = await context.db.selectFrom("bundles").select("channel").groupBy("channel").execute();
|
|
91
|
+
return data.map((bundle) => bundle.channel);
|
|
92
|
+
},
|
|
93
|
+
async commitBundle(context, { changedSets }) {
|
|
94
|
+
if (changedSets.length === 0) return;
|
|
95
|
+
const bundles = changedSets.map((op) => op.data);
|
|
96
|
+
await context.db.transaction().execute(async (tx) => {
|
|
97
|
+
for (const bundle of bundles) await tx.insertInto("bundles").values({
|
|
98
|
+
id: bundle.id,
|
|
99
|
+
enabled: bundle.enabled,
|
|
100
|
+
should_force_update: bundle.shouldForceUpdate,
|
|
101
|
+
file_hash: bundle.fileHash,
|
|
102
|
+
git_commit_hash: bundle.gitCommitHash,
|
|
103
|
+
message: bundle.message,
|
|
104
|
+
platform: bundle.platform,
|
|
105
|
+
target_app_version: bundle.targetAppVersion,
|
|
106
|
+
channel: bundle.channel,
|
|
107
|
+
storage_uri: bundle.storageUri,
|
|
108
|
+
fingerprint_hash: bundle.fingerprintHash
|
|
109
|
+
}).onConflict((oc) => oc.column("id").doUpdateSet({
|
|
110
|
+
enabled: bundle.enabled,
|
|
111
|
+
should_force_update: bundle.shouldForceUpdate,
|
|
112
|
+
file_hash: bundle.fileHash,
|
|
113
|
+
git_commit_hash: bundle.gitCommitHash,
|
|
114
|
+
message: bundle.message,
|
|
115
|
+
platform: bundle.platform,
|
|
116
|
+
target_app_version: bundle.targetAppVersion,
|
|
117
|
+
channel: bundle.channel,
|
|
118
|
+
storage_uri: bundle.storageUri,
|
|
119
|
+
fingerprint_hash: bundle.fingerprintHash
|
|
120
|
+
})).execute();
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}, hooks);
|
|
1666
124
|
};
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
(()
|
|
1678
|
-
__nested_webpack_require_75306__.n = (module)=>{
|
|
1679
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
1680
|
-
__nested_webpack_require_75306__.d(getter, {
|
|
1681
|
-
a: getter
|
|
1682
|
-
});
|
|
1683
|
-
return getter;
|
|
1684
|
-
};
|
|
1685
|
-
})();
|
|
1686
|
-
(()=>{
|
|
1687
|
-
__nested_webpack_require_75306__.d = (exports, definition)=>{
|
|
1688
|
-
for(var key in definition)if (__nested_webpack_require_75306__.o(definition, key) && !__nested_webpack_require_75306__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
1689
|
-
enumerable: true,
|
|
1690
|
-
get: definition[key]
|
|
1691
|
-
});
|
|
1692
|
-
};
|
|
1693
|
-
})();
|
|
1694
|
-
(()=>{
|
|
1695
|
-
__nested_webpack_require_75306__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
1696
|
-
})();
|
|
1697
|
-
var semver = __nested_webpack_require_75306__("../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/index.js");
|
|
1698
|
-
var semver_default = /*#__PURE__*/ __nested_webpack_require_75306__.n(semver);
|
|
1699
|
-
const semverSatisfies = (targetAppVersion, currentVersion)=>{
|
|
1700
|
-
const currentCoerce = semver_default().coerce(currentVersion);
|
|
1701
|
-
if (!currentCoerce) return false;
|
|
1702
|
-
return semver_default().satisfies(currentCoerce.version, targetAppVersion);
|
|
125
|
+
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region ../js/dist/index.js
|
|
128
|
+
var __create = Object.create;
|
|
129
|
+
var __defProp = Object.defineProperty;
|
|
130
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
131
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
132
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
133
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
134
|
+
var __commonJS = (cb, mod) => function() {
|
|
135
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
1703
136
|
};
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
137
|
+
var __copyProps = (to, from, except, desc) => {
|
|
138
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
139
|
+
key = keys[i];
|
|
140
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
141
|
+
get: ((k) => from[k]).bind(null, key),
|
|
142
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return to;
|
|
1708
146
|
};
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
147
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
148
|
+
value: mod,
|
|
149
|
+
enumerable: true
|
|
150
|
+
}) : target, mod));
|
|
151
|
+
var require_constants = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js"(exports, module$1) {
|
|
152
|
+
const SEMVER_SPEC_VERSION = "2.0.0";
|
|
153
|
+
const MAX_LENGTH$2 = 256;
|
|
154
|
+
const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
155
|
+
const MAX_SAFE_COMPONENT_LENGTH$1 = 16;
|
|
156
|
+
const MAX_SAFE_BUILD_LENGTH$1 = MAX_LENGTH$2 - 6;
|
|
157
|
+
const RELEASE_TYPES = [
|
|
158
|
+
"major",
|
|
159
|
+
"premajor",
|
|
160
|
+
"minor",
|
|
161
|
+
"preminor",
|
|
162
|
+
"patch",
|
|
163
|
+
"prepatch",
|
|
164
|
+
"prerelease"
|
|
165
|
+
];
|
|
166
|
+
module$1.exports = {
|
|
167
|
+
MAX_LENGTH: MAX_LENGTH$2,
|
|
168
|
+
MAX_SAFE_COMPONENT_LENGTH: MAX_SAFE_COMPONENT_LENGTH$1,
|
|
169
|
+
MAX_SAFE_BUILD_LENGTH: MAX_SAFE_BUILD_LENGTH$1,
|
|
170
|
+
MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
|
|
171
|
+
RELEASE_TYPES,
|
|
172
|
+
SEMVER_SPEC_VERSION,
|
|
173
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
174
|
+
FLAG_LOOSE: 2
|
|
175
|
+
};
|
|
176
|
+
} });
|
|
177
|
+
var require_debug = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/debug.js"(exports, module$1) {
|
|
178
|
+
const debug$4 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
|
|
179
|
+
module$1.exports = debug$4;
|
|
180
|
+
} });
|
|
181
|
+
var require_re = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/re.js"(exports, module$1) {
|
|
182
|
+
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH: MAX_LENGTH$1 } = require_constants();
|
|
183
|
+
const debug$3 = require_debug();
|
|
184
|
+
exports = module$1.exports = {};
|
|
185
|
+
const re$4 = exports.re = [];
|
|
186
|
+
const safeRe = exports.safeRe = [];
|
|
187
|
+
const src = exports.src = [];
|
|
188
|
+
const safeSrc = exports.safeSrc = [];
|
|
189
|
+
const t$4 = exports.t = {};
|
|
190
|
+
let R = 0;
|
|
191
|
+
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
192
|
+
const safeRegexReplacements = [
|
|
193
|
+
["\\s", 1],
|
|
194
|
+
["\\d", MAX_LENGTH$1],
|
|
195
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
196
|
+
];
|
|
197
|
+
const makeSafeRegex = (value) => {
|
|
198
|
+
for (const [token, max] of safeRegexReplacements) value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
199
|
+
return value;
|
|
200
|
+
};
|
|
201
|
+
const createToken = (name, value, isGlobal) => {
|
|
202
|
+
const safe = makeSafeRegex(value);
|
|
203
|
+
const index = R++;
|
|
204
|
+
debug$3(name, index, value);
|
|
205
|
+
t$4[name] = index;
|
|
206
|
+
src[index] = value;
|
|
207
|
+
safeSrc[index] = safe;
|
|
208
|
+
re$4[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
209
|
+
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
210
|
+
};
|
|
211
|
+
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
212
|
+
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
213
|
+
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
214
|
+
createToken("MAINVERSION", `(${src[t$4.NUMERICIDENTIFIER]})\\.(${src[t$4.NUMERICIDENTIFIER]})\\.(${src[t$4.NUMERICIDENTIFIER]})`);
|
|
215
|
+
createToken("MAINVERSIONLOOSE", `(${src[t$4.NUMERICIDENTIFIERLOOSE]})\\.(${src[t$4.NUMERICIDENTIFIERLOOSE]})\\.(${src[t$4.NUMERICIDENTIFIERLOOSE]})`);
|
|
216
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t$4.NONNUMERICIDENTIFIER]}|${src[t$4.NUMERICIDENTIFIER]})`);
|
|
217
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t$4.NONNUMERICIDENTIFIER]}|${src[t$4.NUMERICIDENTIFIERLOOSE]})`);
|
|
218
|
+
createToken("PRERELEASE", `(?:-(${src[t$4.PRERELEASEIDENTIFIER]}(?:\\.${src[t$4.PRERELEASEIDENTIFIER]})*))`);
|
|
219
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t$4.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t$4.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
220
|
+
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
221
|
+
createToken("BUILD", `(?:\\+(${src[t$4.BUILDIDENTIFIER]}(?:\\.${src[t$4.BUILDIDENTIFIER]})*))`);
|
|
222
|
+
createToken("FULLPLAIN", `v?${src[t$4.MAINVERSION]}${src[t$4.PRERELEASE]}?${src[t$4.BUILD]}?`);
|
|
223
|
+
createToken("FULL", `^${src[t$4.FULLPLAIN]}$`);
|
|
224
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t$4.MAINVERSIONLOOSE]}${src[t$4.PRERELEASELOOSE]}?${src[t$4.BUILD]}?`);
|
|
225
|
+
createToken("LOOSE", `^${src[t$4.LOOSEPLAIN]}$`);
|
|
226
|
+
createToken("GTLT", "((?:<|>)?=?)");
|
|
227
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t$4.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
228
|
+
createToken("XRANGEIDENTIFIER", `${src[t$4.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
229
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t$4.XRANGEIDENTIFIER]})(?:\\.(${src[t$4.XRANGEIDENTIFIER]})(?:\\.(${src[t$4.XRANGEIDENTIFIER]})(?:${src[t$4.PRERELEASE]})?${src[t$4.BUILD]}?)?)?`);
|
|
230
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:${src[t$4.PRERELEASELOOSE]})?${src[t$4.BUILD]}?)?)?`);
|
|
231
|
+
createToken("XRANGE", `^${src[t$4.GTLT]}\\s*${src[t$4.XRANGEPLAIN]}$`);
|
|
232
|
+
createToken("XRANGELOOSE", `^${src[t$4.GTLT]}\\s*${src[t$4.XRANGEPLAINLOOSE]}$`);
|
|
233
|
+
createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
234
|
+
createToken("COERCE", `${src[t$4.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
235
|
+
createToken("COERCEFULL", src[t$4.COERCEPLAIN] + `(?:${src[t$4.PRERELEASE]})?(?:${src[t$4.BUILD]})?(?:$|[^\\d])`);
|
|
236
|
+
createToken("COERCERTL", src[t$4.COERCE], true);
|
|
237
|
+
createToken("COERCERTLFULL", src[t$4.COERCEFULL], true);
|
|
238
|
+
createToken("LONETILDE", "(?:~>?)");
|
|
239
|
+
createToken("TILDETRIM", `(\\s*)${src[t$4.LONETILDE]}\\s+`, true);
|
|
240
|
+
exports.tildeTrimReplace = "$1~";
|
|
241
|
+
createToken("TILDE", `^${src[t$4.LONETILDE]}${src[t$4.XRANGEPLAIN]}$`);
|
|
242
|
+
createToken("TILDELOOSE", `^${src[t$4.LONETILDE]}${src[t$4.XRANGEPLAINLOOSE]}$`);
|
|
243
|
+
createToken("LONECARET", "(?:\\^)");
|
|
244
|
+
createToken("CARETTRIM", `(\\s*)${src[t$4.LONECARET]}\\s+`, true);
|
|
245
|
+
exports.caretTrimReplace = "$1^";
|
|
246
|
+
createToken("CARET", `^${src[t$4.LONECARET]}${src[t$4.XRANGEPLAIN]}$`);
|
|
247
|
+
createToken("CARETLOOSE", `^${src[t$4.LONECARET]}${src[t$4.XRANGEPLAINLOOSE]}$`);
|
|
248
|
+
createToken("COMPARATORLOOSE", `^${src[t$4.GTLT]}\\s*(${src[t$4.LOOSEPLAIN]})$|^$`);
|
|
249
|
+
createToken("COMPARATOR", `^${src[t$4.GTLT]}\\s*(${src[t$4.FULLPLAIN]})$|^$`);
|
|
250
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t$4.GTLT]}\\s*(${src[t$4.LOOSEPLAIN]}|${src[t$4.XRANGEPLAIN]})`, true);
|
|
251
|
+
exports.comparatorTrimReplace = "$1$2$3";
|
|
252
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t$4.XRANGEPLAIN]})\\s+-\\s+(${src[t$4.XRANGEPLAIN]})\\s*$`);
|
|
253
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t$4.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t$4.XRANGEPLAINLOOSE]})\\s*$`);
|
|
254
|
+
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
255
|
+
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
256
|
+
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
257
|
+
} });
|
|
258
|
+
var require_parse_options = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/parse-options.js"(exports, module$1) {
|
|
259
|
+
const looseOption = Object.freeze({ loose: true });
|
|
260
|
+
const emptyOpts = Object.freeze({});
|
|
261
|
+
const parseOptions$3 = (options) => {
|
|
262
|
+
if (!options) return emptyOpts;
|
|
263
|
+
if (typeof options !== "object") return looseOption;
|
|
264
|
+
return options;
|
|
265
|
+
};
|
|
266
|
+
module$1.exports = parseOptions$3;
|
|
267
|
+
} });
|
|
268
|
+
var require_identifiers = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/identifiers.js"(exports, module$1) {
|
|
269
|
+
const numeric = /^[0-9]+$/;
|
|
270
|
+
const compareIdentifiers$1 = (a, b) => {
|
|
271
|
+
const anum = numeric.test(a);
|
|
272
|
+
const bnum = numeric.test(b);
|
|
273
|
+
if (anum && bnum) {
|
|
274
|
+
a = +a;
|
|
275
|
+
b = +b;
|
|
276
|
+
}
|
|
277
|
+
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
278
|
+
};
|
|
279
|
+
const rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a);
|
|
280
|
+
module$1.exports = {
|
|
281
|
+
compareIdentifiers: compareIdentifiers$1,
|
|
282
|
+
rcompareIdentifiers
|
|
283
|
+
};
|
|
284
|
+
} });
|
|
285
|
+
var require_semver$1 = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js"(exports, module$1) {
|
|
286
|
+
const debug$2 = require_debug();
|
|
287
|
+
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
288
|
+
const { safeRe: re$3, t: t$3 } = require_re();
|
|
289
|
+
const parseOptions$2 = require_parse_options();
|
|
290
|
+
const { compareIdentifiers } = require_identifiers();
|
|
291
|
+
var SemVer$15 = class SemVer$15$1 {
|
|
292
|
+
constructor(version, options) {
|
|
293
|
+
options = parseOptions$2(options);
|
|
294
|
+
if (version instanceof SemVer$15$1) if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) return version;
|
|
295
|
+
else version = version.version;
|
|
296
|
+
else if (typeof version !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
297
|
+
if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
298
|
+
debug$2("SemVer", version, options);
|
|
299
|
+
this.options = options;
|
|
300
|
+
this.loose = !!options.loose;
|
|
301
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
302
|
+
const m = version.trim().match(options.loose ? re$3[t$3.LOOSE] : re$3[t$3.FULL]);
|
|
303
|
+
if (!m) throw new TypeError(`Invalid Version: ${version}`);
|
|
304
|
+
this.raw = version;
|
|
305
|
+
this.major = +m[1];
|
|
306
|
+
this.minor = +m[2];
|
|
307
|
+
this.patch = +m[3];
|
|
308
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
|
|
309
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
|
|
310
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
|
|
311
|
+
if (!m[4]) this.prerelease = [];
|
|
312
|
+
else this.prerelease = m[4].split(".").map((id) => {
|
|
313
|
+
if (/^[0-9]+$/.test(id)) {
|
|
314
|
+
const num = +id;
|
|
315
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
316
|
+
}
|
|
317
|
+
return id;
|
|
318
|
+
});
|
|
319
|
+
this.build = m[5] ? m[5].split(".") : [];
|
|
320
|
+
this.format();
|
|
321
|
+
}
|
|
322
|
+
format() {
|
|
323
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
324
|
+
if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
|
|
325
|
+
return this.version;
|
|
326
|
+
}
|
|
327
|
+
toString() {
|
|
328
|
+
return this.version;
|
|
329
|
+
}
|
|
330
|
+
compare(other) {
|
|
331
|
+
debug$2("SemVer.compare", this.version, this.options, other);
|
|
332
|
+
if (!(other instanceof SemVer$15$1)) {
|
|
333
|
+
if (typeof other === "string" && other === this.version) return 0;
|
|
334
|
+
other = new SemVer$15$1(other, this.options);
|
|
335
|
+
}
|
|
336
|
+
if (other.version === this.version) return 0;
|
|
337
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
338
|
+
}
|
|
339
|
+
compareMain(other) {
|
|
340
|
+
if (!(other instanceof SemVer$15$1)) other = new SemVer$15$1(other, this.options);
|
|
341
|
+
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
|
342
|
+
}
|
|
343
|
+
comparePre(other) {
|
|
344
|
+
if (!(other instanceof SemVer$15$1)) other = new SemVer$15$1(other, this.options);
|
|
345
|
+
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
346
|
+
else if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
347
|
+
else if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
348
|
+
let i = 0;
|
|
349
|
+
do {
|
|
350
|
+
const a = this.prerelease[i];
|
|
351
|
+
const b = other.prerelease[i];
|
|
352
|
+
debug$2("prerelease compare", i, a, b);
|
|
353
|
+
if (a === void 0 && b === void 0) return 0;
|
|
354
|
+
else if (b === void 0) return 1;
|
|
355
|
+
else if (a === void 0) return -1;
|
|
356
|
+
else if (a === b) continue;
|
|
357
|
+
else return compareIdentifiers(a, b);
|
|
358
|
+
} while (++i);
|
|
359
|
+
}
|
|
360
|
+
compareBuild(other) {
|
|
361
|
+
if (!(other instanceof SemVer$15$1)) other = new SemVer$15$1(other, this.options);
|
|
362
|
+
let i = 0;
|
|
363
|
+
do {
|
|
364
|
+
const a = this.build[i];
|
|
365
|
+
const b = other.build[i];
|
|
366
|
+
debug$2("build compare", i, a, b);
|
|
367
|
+
if (a === void 0 && b === void 0) return 0;
|
|
368
|
+
else if (b === void 0) return 1;
|
|
369
|
+
else if (a === void 0) return -1;
|
|
370
|
+
else if (a === b) continue;
|
|
371
|
+
else return compareIdentifiers(a, b);
|
|
372
|
+
} while (++i);
|
|
373
|
+
}
|
|
374
|
+
inc(release, identifier, identifierBase) {
|
|
375
|
+
if (release.startsWith("pre")) {
|
|
376
|
+
if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
|
|
377
|
+
if (identifier) {
|
|
378
|
+
const match = `-${identifier}`.match(this.options.loose ? re$3[t$3.PRERELEASELOOSE] : re$3[t$3.PRERELEASE]);
|
|
379
|
+
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
switch (release) {
|
|
383
|
+
case "premajor":
|
|
384
|
+
this.prerelease.length = 0;
|
|
385
|
+
this.patch = 0;
|
|
386
|
+
this.minor = 0;
|
|
387
|
+
this.major++;
|
|
388
|
+
this.inc("pre", identifier, identifierBase);
|
|
389
|
+
break;
|
|
390
|
+
case "preminor":
|
|
391
|
+
this.prerelease.length = 0;
|
|
392
|
+
this.patch = 0;
|
|
393
|
+
this.minor++;
|
|
394
|
+
this.inc("pre", identifier, identifierBase);
|
|
395
|
+
break;
|
|
396
|
+
case "prepatch":
|
|
397
|
+
this.prerelease.length = 0;
|
|
398
|
+
this.inc("patch", identifier, identifierBase);
|
|
399
|
+
this.inc("pre", identifier, identifierBase);
|
|
400
|
+
break;
|
|
401
|
+
case "prerelease":
|
|
402
|
+
if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase);
|
|
403
|
+
this.inc("pre", identifier, identifierBase);
|
|
404
|
+
break;
|
|
405
|
+
case "release":
|
|
406
|
+
if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`);
|
|
407
|
+
this.prerelease.length = 0;
|
|
408
|
+
break;
|
|
409
|
+
case "major":
|
|
410
|
+
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++;
|
|
411
|
+
this.minor = 0;
|
|
412
|
+
this.patch = 0;
|
|
413
|
+
this.prerelease = [];
|
|
414
|
+
break;
|
|
415
|
+
case "minor":
|
|
416
|
+
if (this.patch !== 0 || this.prerelease.length === 0) this.minor++;
|
|
417
|
+
this.patch = 0;
|
|
418
|
+
this.prerelease = [];
|
|
419
|
+
break;
|
|
420
|
+
case "patch":
|
|
421
|
+
if (this.prerelease.length === 0) this.patch++;
|
|
422
|
+
this.prerelease = [];
|
|
423
|
+
break;
|
|
424
|
+
case "pre": {
|
|
425
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
426
|
+
if (this.prerelease.length === 0) this.prerelease = [base];
|
|
427
|
+
else {
|
|
428
|
+
let i = this.prerelease.length;
|
|
429
|
+
while (--i >= 0) if (typeof this.prerelease[i] === "number") {
|
|
430
|
+
this.prerelease[i]++;
|
|
431
|
+
i = -2;
|
|
432
|
+
}
|
|
433
|
+
if (i === -1) {
|
|
434
|
+
if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists");
|
|
435
|
+
this.prerelease.push(base);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
if (identifier) {
|
|
439
|
+
let prerelease$2 = [identifier, base];
|
|
440
|
+
if (identifierBase === false) prerelease$2 = [identifier];
|
|
441
|
+
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
442
|
+
if (isNaN(this.prerelease[1])) this.prerelease = prerelease$2;
|
|
443
|
+
} else this.prerelease = prerelease$2;
|
|
444
|
+
}
|
|
445
|
+
break;
|
|
446
|
+
}
|
|
447
|
+
default: throw new Error(`invalid increment argument: ${release}`);
|
|
448
|
+
}
|
|
449
|
+
this.raw = this.format();
|
|
450
|
+
if (this.build.length) this.raw += `+${this.build.join(".")}`;
|
|
451
|
+
return this;
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
module$1.exports = SemVer$15;
|
|
455
|
+
} });
|
|
456
|
+
var require_parse = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/parse.js"(exports, module$1) {
|
|
457
|
+
const SemVer$14 = require_semver$1();
|
|
458
|
+
const parse$6 = (version, options, throwErrors = false) => {
|
|
459
|
+
if (version instanceof SemVer$14) return version;
|
|
460
|
+
try {
|
|
461
|
+
return new SemVer$14(version, options);
|
|
462
|
+
} catch (er) {
|
|
463
|
+
if (!throwErrors) return null;
|
|
464
|
+
throw er;
|
|
465
|
+
}
|
|
466
|
+
};
|
|
467
|
+
module$1.exports = parse$6;
|
|
468
|
+
} });
|
|
469
|
+
var require_valid$1 = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/valid.js"(exports, module$1) {
|
|
470
|
+
const parse$5 = require_parse();
|
|
471
|
+
const valid$1 = (version, options) => {
|
|
472
|
+
const v = parse$5(version, options);
|
|
473
|
+
return v ? v.version : null;
|
|
474
|
+
};
|
|
475
|
+
module$1.exports = valid$1;
|
|
476
|
+
} });
|
|
477
|
+
var require_clean = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/clean.js"(exports, module$1) {
|
|
478
|
+
const parse$4 = require_parse();
|
|
479
|
+
const clean$1 = (version, options) => {
|
|
480
|
+
const s = parse$4(version.trim().replace(/^[=v]+/, ""), options);
|
|
481
|
+
return s ? s.version : null;
|
|
482
|
+
};
|
|
483
|
+
module$1.exports = clean$1;
|
|
484
|
+
} });
|
|
485
|
+
var require_inc = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/inc.js"(exports, module$1) {
|
|
486
|
+
const SemVer$13 = require_semver$1();
|
|
487
|
+
const inc$1 = (version, release, options, identifier, identifierBase) => {
|
|
488
|
+
if (typeof options === "string") {
|
|
489
|
+
identifierBase = identifier;
|
|
490
|
+
identifier = options;
|
|
491
|
+
options = void 0;
|
|
492
|
+
}
|
|
493
|
+
try {
|
|
494
|
+
return new SemVer$13(version instanceof SemVer$13 ? version.version : version, options).inc(release, identifier, identifierBase).version;
|
|
495
|
+
} catch (er) {
|
|
496
|
+
return null;
|
|
497
|
+
}
|
|
498
|
+
};
|
|
499
|
+
module$1.exports = inc$1;
|
|
500
|
+
} });
|
|
501
|
+
var require_diff = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/diff.js"(exports, module$1) {
|
|
502
|
+
const parse$3 = require_parse();
|
|
503
|
+
const diff$1 = (version1, version2) => {
|
|
504
|
+
const v1 = parse$3(version1, null, true);
|
|
505
|
+
const v2 = parse$3(version2, null, true);
|
|
506
|
+
const comparison = v1.compare(v2);
|
|
507
|
+
if (comparison === 0) return null;
|
|
508
|
+
const v1Higher = comparison > 0;
|
|
509
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
510
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
511
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
512
|
+
const lowHasPre = !!lowVersion.prerelease.length;
|
|
513
|
+
if (lowHasPre && !highHasPre) {
|
|
514
|
+
if (!lowVersion.patch && !lowVersion.minor) return "major";
|
|
515
|
+
if (lowVersion.compareMain(highVersion) === 0) {
|
|
516
|
+
if (lowVersion.minor && !lowVersion.patch) return "minor";
|
|
517
|
+
return "patch";
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
const prefix = highHasPre ? "pre" : "";
|
|
521
|
+
if (v1.major !== v2.major) return prefix + "major";
|
|
522
|
+
if (v1.minor !== v2.minor) return prefix + "minor";
|
|
523
|
+
if (v1.patch !== v2.patch) return prefix + "patch";
|
|
524
|
+
return "prerelease";
|
|
525
|
+
};
|
|
526
|
+
module$1.exports = diff$1;
|
|
527
|
+
} });
|
|
528
|
+
var require_major = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/major.js"(exports, module$1) {
|
|
529
|
+
const SemVer$12 = require_semver$1();
|
|
530
|
+
const major$1 = (a, loose) => new SemVer$12(a, loose).major;
|
|
531
|
+
module$1.exports = major$1;
|
|
532
|
+
} });
|
|
533
|
+
var require_minor = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/minor.js"(exports, module$1) {
|
|
534
|
+
const SemVer$11 = require_semver$1();
|
|
535
|
+
const minor$1 = (a, loose) => new SemVer$11(a, loose).minor;
|
|
536
|
+
module$1.exports = minor$1;
|
|
537
|
+
} });
|
|
538
|
+
var require_patch = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/patch.js"(exports, module$1) {
|
|
539
|
+
const SemVer$10 = require_semver$1();
|
|
540
|
+
const patch$1 = (a, loose) => new SemVer$10(a, loose).patch;
|
|
541
|
+
module$1.exports = patch$1;
|
|
542
|
+
} });
|
|
543
|
+
var require_prerelease = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/prerelease.js"(exports, module$1) {
|
|
544
|
+
const parse$2 = require_parse();
|
|
545
|
+
const prerelease$1 = (version, options) => {
|
|
546
|
+
const parsed = parse$2(version, options);
|
|
547
|
+
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
548
|
+
};
|
|
549
|
+
module$1.exports = prerelease$1;
|
|
550
|
+
} });
|
|
551
|
+
var require_compare = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js"(exports, module$1) {
|
|
552
|
+
const SemVer$9 = require_semver$1();
|
|
553
|
+
const compare$11 = (a, b, loose) => new SemVer$9(a, loose).compare(new SemVer$9(b, loose));
|
|
554
|
+
module$1.exports = compare$11;
|
|
555
|
+
} });
|
|
556
|
+
var require_rcompare = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rcompare.js"(exports, module$1) {
|
|
557
|
+
const compare$10 = require_compare();
|
|
558
|
+
const rcompare$1 = (a, b, loose) => compare$10(b, a, loose);
|
|
559
|
+
module$1.exports = rcompare$1;
|
|
560
|
+
} });
|
|
561
|
+
var require_compare_loose = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-loose.js"(exports, module$1) {
|
|
562
|
+
const compare$9 = require_compare();
|
|
563
|
+
const compareLoose$1 = (a, b) => compare$9(a, b, true);
|
|
564
|
+
module$1.exports = compareLoose$1;
|
|
565
|
+
} });
|
|
566
|
+
var require_compare_build = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-build.js"(exports, module$1) {
|
|
567
|
+
const SemVer$8 = require_semver$1();
|
|
568
|
+
const compareBuild$3 = (a, b, loose) => {
|
|
569
|
+
const versionA = new SemVer$8(a, loose);
|
|
570
|
+
const versionB = new SemVer$8(b, loose);
|
|
571
|
+
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
572
|
+
};
|
|
573
|
+
module$1.exports = compareBuild$3;
|
|
574
|
+
} });
|
|
575
|
+
var require_sort = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/sort.js"(exports, module$1) {
|
|
576
|
+
const compareBuild$2 = require_compare_build();
|
|
577
|
+
const sort$1 = (list, loose) => list.sort((a, b) => compareBuild$2(a, b, loose));
|
|
578
|
+
module$1.exports = sort$1;
|
|
579
|
+
} });
|
|
580
|
+
var require_rsort = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rsort.js"(exports, module$1) {
|
|
581
|
+
const compareBuild$1 = require_compare_build();
|
|
582
|
+
const rsort$1 = (list, loose) => list.sort((a, b) => compareBuild$1(b, a, loose));
|
|
583
|
+
module$1.exports = rsort$1;
|
|
584
|
+
} });
|
|
585
|
+
var require_gt = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gt.js"(exports, module$1) {
|
|
586
|
+
const compare$8 = require_compare();
|
|
587
|
+
const gt$4 = (a, b, loose) => compare$8(a, b, loose) > 0;
|
|
588
|
+
module$1.exports = gt$4;
|
|
589
|
+
} });
|
|
590
|
+
var require_lt = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lt.js"(exports, module$1) {
|
|
591
|
+
const compare$7 = require_compare();
|
|
592
|
+
const lt$3 = (a, b, loose) => compare$7(a, b, loose) < 0;
|
|
593
|
+
module$1.exports = lt$3;
|
|
594
|
+
} });
|
|
595
|
+
var require_eq = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/eq.js"(exports, module$1) {
|
|
596
|
+
const compare$6 = require_compare();
|
|
597
|
+
const eq$2 = (a, b, loose) => compare$6(a, b, loose) === 0;
|
|
598
|
+
module$1.exports = eq$2;
|
|
599
|
+
} });
|
|
600
|
+
var require_neq = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/neq.js"(exports, module$1) {
|
|
601
|
+
const compare$5 = require_compare();
|
|
602
|
+
const neq$2 = (a, b, loose) => compare$5(a, b, loose) !== 0;
|
|
603
|
+
module$1.exports = neq$2;
|
|
604
|
+
} });
|
|
605
|
+
var require_gte = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js"(exports, module$1) {
|
|
606
|
+
const compare$4 = require_compare();
|
|
607
|
+
const gte$3 = (a, b, loose) => compare$4(a, b, loose) >= 0;
|
|
608
|
+
module$1.exports = gte$3;
|
|
609
|
+
} });
|
|
610
|
+
var require_lte = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lte.js"(exports, module$1) {
|
|
611
|
+
const compare$3 = require_compare();
|
|
612
|
+
const lte$3 = (a, b, loose) => compare$3(a, b, loose) <= 0;
|
|
613
|
+
module$1.exports = lte$3;
|
|
614
|
+
} });
|
|
615
|
+
var require_cmp = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/cmp.js"(exports, module$1) {
|
|
616
|
+
const eq$1 = require_eq();
|
|
617
|
+
const neq$1 = require_neq();
|
|
618
|
+
const gt$3 = require_gt();
|
|
619
|
+
const gte$2 = require_gte();
|
|
620
|
+
const lt$2 = require_lt();
|
|
621
|
+
const lte$2 = require_lte();
|
|
622
|
+
const cmp$2 = (a, op, b, loose) => {
|
|
623
|
+
switch (op) {
|
|
624
|
+
case "===":
|
|
625
|
+
if (typeof a === "object") a = a.version;
|
|
626
|
+
if (typeof b === "object") b = b.version;
|
|
627
|
+
return a === b;
|
|
628
|
+
case "!==":
|
|
629
|
+
if (typeof a === "object") a = a.version;
|
|
630
|
+
if (typeof b === "object") b = b.version;
|
|
631
|
+
return a !== b;
|
|
632
|
+
case "":
|
|
633
|
+
case "=":
|
|
634
|
+
case "==": return eq$1(a, b, loose);
|
|
635
|
+
case "!=": return neq$1(a, b, loose);
|
|
636
|
+
case ">": return gt$3(a, b, loose);
|
|
637
|
+
case ">=": return gte$2(a, b, loose);
|
|
638
|
+
case "<": return lt$2(a, b, loose);
|
|
639
|
+
case "<=": return lte$2(a, b, loose);
|
|
640
|
+
default: throw new TypeError(`Invalid operator: ${op}`);
|
|
641
|
+
}
|
|
642
|
+
};
|
|
643
|
+
module$1.exports = cmp$2;
|
|
644
|
+
} });
|
|
645
|
+
var require_coerce = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/coerce.js"(exports, module$1) {
|
|
646
|
+
const SemVer$7 = require_semver$1();
|
|
647
|
+
const parse$1 = require_parse();
|
|
648
|
+
const { safeRe: re$2, t: t$2 } = require_re();
|
|
649
|
+
const coerce$1 = (version, options) => {
|
|
650
|
+
if (version instanceof SemVer$7) return version;
|
|
651
|
+
if (typeof version === "number") version = String(version);
|
|
652
|
+
if (typeof version !== "string") return null;
|
|
653
|
+
options = options || {};
|
|
654
|
+
let match = null;
|
|
655
|
+
if (!options.rtl) match = version.match(options.includePrerelease ? re$2[t$2.COERCEFULL] : re$2[t$2.COERCE]);
|
|
656
|
+
else {
|
|
657
|
+
const coerceRtlRegex = options.includePrerelease ? re$2[t$2.COERCERTLFULL] : re$2[t$2.COERCERTL];
|
|
658
|
+
let next;
|
|
659
|
+
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
660
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
661
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
662
|
+
}
|
|
663
|
+
coerceRtlRegex.lastIndex = -1;
|
|
664
|
+
}
|
|
665
|
+
if (match === null) return null;
|
|
666
|
+
const major$2 = match[2];
|
|
667
|
+
const minor$2 = match[3] || "0";
|
|
668
|
+
const patch$2 = match[4] || "0";
|
|
669
|
+
const prerelease$2 = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
670
|
+
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
671
|
+
return parse$1(`${major$2}.${minor$2}.${patch$2}${prerelease$2}${build}`, options);
|
|
672
|
+
};
|
|
673
|
+
module$1.exports = coerce$1;
|
|
674
|
+
} });
|
|
675
|
+
var require_lrucache = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/lrucache.js"(exports, module$1) {
|
|
676
|
+
var LRUCache = class {
|
|
677
|
+
constructor() {
|
|
678
|
+
this.max = 1e3;
|
|
679
|
+
this.map = new Map();
|
|
680
|
+
}
|
|
681
|
+
get(key) {
|
|
682
|
+
const value = this.map.get(key);
|
|
683
|
+
if (value === void 0) return void 0;
|
|
684
|
+
else {
|
|
685
|
+
this.map.delete(key);
|
|
686
|
+
this.map.set(key, value);
|
|
687
|
+
return value;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
delete(key) {
|
|
691
|
+
return this.map.delete(key);
|
|
692
|
+
}
|
|
693
|
+
set(key, value) {
|
|
694
|
+
const deleted = this.delete(key);
|
|
695
|
+
if (!deleted && value !== void 0) {
|
|
696
|
+
if (this.map.size >= this.max) {
|
|
697
|
+
const firstKey = this.map.keys().next().value;
|
|
698
|
+
this.delete(firstKey);
|
|
699
|
+
}
|
|
700
|
+
this.map.set(key, value);
|
|
701
|
+
}
|
|
702
|
+
return this;
|
|
703
|
+
}
|
|
704
|
+
};
|
|
705
|
+
module$1.exports = LRUCache;
|
|
706
|
+
} });
|
|
707
|
+
var require_range = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/range.js"(exports, module$1) {
|
|
708
|
+
const SPACE_CHARACTERS = /\s+/g;
|
|
709
|
+
var Range$11 = class Range$11$1 {
|
|
710
|
+
constructor(range, options) {
|
|
711
|
+
options = parseOptions$1(options);
|
|
712
|
+
if (range instanceof Range$11$1) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
|
|
713
|
+
else return new Range$11$1(range.raw, options);
|
|
714
|
+
if (range instanceof Comparator$4) {
|
|
715
|
+
this.raw = range.value;
|
|
716
|
+
this.set = [[range]];
|
|
717
|
+
this.formatted = void 0;
|
|
718
|
+
return this;
|
|
719
|
+
}
|
|
720
|
+
this.options = options;
|
|
721
|
+
this.loose = !!options.loose;
|
|
722
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
723
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
724
|
+
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
725
|
+
if (!this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
726
|
+
if (this.set.length > 1) {
|
|
727
|
+
const first = this.set[0];
|
|
728
|
+
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
729
|
+
if (this.set.length === 0) this.set = [first];
|
|
730
|
+
else if (this.set.length > 1) {
|
|
731
|
+
for (const c of this.set) if (c.length === 1 && isAny(c[0])) {
|
|
732
|
+
this.set = [c];
|
|
733
|
+
break;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
this.formatted = void 0;
|
|
738
|
+
}
|
|
739
|
+
get range() {
|
|
740
|
+
if (this.formatted === void 0) {
|
|
741
|
+
this.formatted = "";
|
|
742
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
743
|
+
if (i > 0) this.formatted += "||";
|
|
744
|
+
const comps = this.set[i];
|
|
745
|
+
for (let k = 0; k < comps.length; k++) {
|
|
746
|
+
if (k > 0) this.formatted += " ";
|
|
747
|
+
this.formatted += comps[k].toString().trim();
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
return this.formatted;
|
|
752
|
+
}
|
|
753
|
+
format() {
|
|
754
|
+
return this.range;
|
|
755
|
+
}
|
|
756
|
+
toString() {
|
|
757
|
+
return this.range;
|
|
758
|
+
}
|
|
759
|
+
parseRange(range) {
|
|
760
|
+
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
761
|
+
const memoKey = memoOpts + ":" + range;
|
|
762
|
+
const cached = cache$1.get(memoKey);
|
|
763
|
+
if (cached) return cached;
|
|
764
|
+
const loose = this.options.loose;
|
|
765
|
+
const hr = loose ? re$1[t$1.HYPHENRANGELOOSE] : re$1[t$1.HYPHENRANGE];
|
|
766
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
767
|
+
debug$1("hyphen replace", range);
|
|
768
|
+
range = range.replace(re$1[t$1.COMPARATORTRIM], comparatorTrimReplace);
|
|
769
|
+
debug$1("comparator trim", range);
|
|
770
|
+
range = range.replace(re$1[t$1.TILDETRIM], tildeTrimReplace);
|
|
771
|
+
debug$1("tilde trim", range);
|
|
772
|
+
range = range.replace(re$1[t$1.CARETTRIM], caretTrimReplace);
|
|
773
|
+
debug$1("caret trim", range);
|
|
774
|
+
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
775
|
+
if (loose) rangeList = rangeList.filter((comp) => {
|
|
776
|
+
debug$1("loose invalid filter", comp, this.options);
|
|
777
|
+
return !!comp.match(re$1[t$1.COMPARATORLOOSE]);
|
|
778
|
+
});
|
|
779
|
+
debug$1("range list", rangeList);
|
|
780
|
+
const rangeMap = new Map();
|
|
781
|
+
const comparators = rangeList.map((comp) => new Comparator$4(comp, this.options));
|
|
782
|
+
for (const comp of comparators) {
|
|
783
|
+
if (isNullSet(comp)) return [comp];
|
|
784
|
+
rangeMap.set(comp.value, comp);
|
|
785
|
+
}
|
|
786
|
+
if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete("");
|
|
787
|
+
const result = [...rangeMap.values()];
|
|
788
|
+
cache$1.set(memoKey, result);
|
|
789
|
+
return result;
|
|
790
|
+
}
|
|
791
|
+
intersects(range, options) {
|
|
792
|
+
if (!(range instanceof Range$11$1)) throw new TypeError("a Range is required");
|
|
793
|
+
return this.set.some((thisComparators) => {
|
|
794
|
+
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
795
|
+
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
796
|
+
return rangeComparators.every((rangeComparator) => {
|
|
797
|
+
return thisComparator.intersects(rangeComparator, options);
|
|
798
|
+
});
|
|
799
|
+
});
|
|
800
|
+
});
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
test(version) {
|
|
804
|
+
if (!version) return false;
|
|
805
|
+
if (typeof version === "string") try {
|
|
806
|
+
version = new SemVer$6(version, this.options);
|
|
807
|
+
} catch (er) {
|
|
808
|
+
return false;
|
|
809
|
+
}
|
|
810
|
+
for (let i = 0; i < this.set.length; i++) if (testSet(this.set[i], version, this.options)) return true;
|
|
811
|
+
return false;
|
|
812
|
+
}
|
|
813
|
+
};
|
|
814
|
+
module$1.exports = Range$11;
|
|
815
|
+
const LRU = require_lrucache();
|
|
816
|
+
const cache$1 = new LRU();
|
|
817
|
+
const parseOptions$1 = require_parse_options();
|
|
818
|
+
const Comparator$4 = require_comparator();
|
|
819
|
+
const debug$1 = require_debug();
|
|
820
|
+
const SemVer$6 = require_semver$1();
|
|
821
|
+
const { safeRe: re$1, t: t$1, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
|
|
822
|
+
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
823
|
+
const isNullSet = (c) => c.value === "<0.0.0-0";
|
|
824
|
+
const isAny = (c) => c.value === "";
|
|
825
|
+
const isSatisfiable = (comparators, options) => {
|
|
826
|
+
let result = true;
|
|
827
|
+
const remainingComparators = comparators.slice();
|
|
828
|
+
let testComparator = remainingComparators.pop();
|
|
829
|
+
while (result && remainingComparators.length) {
|
|
830
|
+
result = remainingComparators.every((otherComparator) => {
|
|
831
|
+
return testComparator.intersects(otherComparator, options);
|
|
832
|
+
});
|
|
833
|
+
testComparator = remainingComparators.pop();
|
|
834
|
+
}
|
|
835
|
+
return result;
|
|
836
|
+
};
|
|
837
|
+
const parseComparator = (comp, options) => {
|
|
838
|
+
debug$1("comp", comp, options);
|
|
839
|
+
comp = replaceCarets(comp, options);
|
|
840
|
+
debug$1("caret", comp);
|
|
841
|
+
comp = replaceTildes(comp, options);
|
|
842
|
+
debug$1("tildes", comp);
|
|
843
|
+
comp = replaceXRanges(comp, options);
|
|
844
|
+
debug$1("xrange", comp);
|
|
845
|
+
comp = replaceStars(comp, options);
|
|
846
|
+
debug$1("stars", comp);
|
|
847
|
+
return comp;
|
|
848
|
+
};
|
|
849
|
+
const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
850
|
+
const replaceTildes = (comp, options) => {
|
|
851
|
+
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
852
|
+
};
|
|
853
|
+
const replaceTilde = (comp, options) => {
|
|
854
|
+
const r = options.loose ? re$1[t$1.TILDELOOSE] : re$1[t$1.TILDE];
|
|
855
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
856
|
+
debug$1("tilde", comp, _, M, m, p, pr);
|
|
857
|
+
let ret;
|
|
858
|
+
if (isX(M)) ret = "";
|
|
859
|
+
else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
860
|
+
else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
861
|
+
else if (pr) {
|
|
862
|
+
debug$1("replaceTilde pr", pr);
|
|
863
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
864
|
+
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
865
|
+
debug$1("tilde return", ret);
|
|
866
|
+
return ret;
|
|
867
|
+
});
|
|
868
|
+
};
|
|
869
|
+
const replaceCarets = (comp, options) => {
|
|
870
|
+
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
871
|
+
};
|
|
872
|
+
const replaceCaret = (comp, options) => {
|
|
873
|
+
debug$1("caret", comp, options);
|
|
874
|
+
const r = options.loose ? re$1[t$1.CARETLOOSE] : re$1[t$1.CARET];
|
|
875
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
876
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
877
|
+
debug$1("caret", comp, _, M, m, p, pr);
|
|
878
|
+
let ret;
|
|
879
|
+
if (isX(M)) ret = "";
|
|
880
|
+
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
881
|
+
else if (isX(p)) if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
882
|
+
else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
883
|
+
else if (pr) {
|
|
884
|
+
debug$1("replaceCaret pr", pr);
|
|
885
|
+
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
886
|
+
else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
887
|
+
else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
888
|
+
} else {
|
|
889
|
+
debug$1("no pr");
|
|
890
|
+
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
891
|
+
else ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
|
892
|
+
else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
893
|
+
}
|
|
894
|
+
debug$1("caret return", ret);
|
|
895
|
+
return ret;
|
|
896
|
+
});
|
|
897
|
+
};
|
|
898
|
+
const replaceXRanges = (comp, options) => {
|
|
899
|
+
debug$1("replaceXRanges", comp, options);
|
|
900
|
+
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
901
|
+
};
|
|
902
|
+
const replaceXRange = (comp, options) => {
|
|
903
|
+
comp = comp.trim();
|
|
904
|
+
const r = options.loose ? re$1[t$1.XRANGELOOSE] : re$1[t$1.XRANGE];
|
|
905
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
906
|
+
debug$1("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
907
|
+
const xM = isX(M);
|
|
908
|
+
const xm = xM || isX(m);
|
|
909
|
+
const xp = xm || isX(p);
|
|
910
|
+
const anyX = xp;
|
|
911
|
+
if (gtlt === "=" && anyX) gtlt = "";
|
|
912
|
+
pr = options.includePrerelease ? "-0" : "";
|
|
913
|
+
if (xM) if (gtlt === ">" || gtlt === "<") ret = "<0.0.0-0";
|
|
914
|
+
else ret = "*";
|
|
915
|
+
else if (gtlt && anyX) {
|
|
916
|
+
if (xm) m = 0;
|
|
917
|
+
p = 0;
|
|
918
|
+
if (gtlt === ">") {
|
|
919
|
+
gtlt = ">=";
|
|
920
|
+
if (xm) {
|
|
921
|
+
M = +M + 1;
|
|
922
|
+
m = 0;
|
|
923
|
+
p = 0;
|
|
924
|
+
} else {
|
|
925
|
+
m = +m + 1;
|
|
926
|
+
p = 0;
|
|
927
|
+
}
|
|
928
|
+
} else if (gtlt === "<=") {
|
|
929
|
+
gtlt = "<";
|
|
930
|
+
if (xm) M = +M + 1;
|
|
931
|
+
else m = +m + 1;
|
|
932
|
+
}
|
|
933
|
+
if (gtlt === "<") pr = "-0";
|
|
934
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
935
|
+
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
936
|
+
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
937
|
+
debug$1("xRange return", ret);
|
|
938
|
+
return ret;
|
|
939
|
+
});
|
|
940
|
+
};
|
|
941
|
+
const replaceStars = (comp, options) => {
|
|
942
|
+
debug$1("replaceStars", comp, options);
|
|
943
|
+
return comp.trim().replace(re$1[t$1.STAR], "");
|
|
944
|
+
};
|
|
945
|
+
const replaceGTE0 = (comp, options) => {
|
|
946
|
+
debug$1("replaceGTE0", comp, options);
|
|
947
|
+
return comp.trim().replace(re$1[options.includePrerelease ? t$1.GTE0PRE : t$1.GTE0], "");
|
|
948
|
+
};
|
|
949
|
+
const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
950
|
+
if (isX(fM)) from = "";
|
|
951
|
+
else if (isX(fm)) from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
952
|
+
else if (isX(fp)) from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
953
|
+
else if (fpr) from = `>=${from}`;
|
|
954
|
+
else from = `>=${from}${incPr ? "-0" : ""}`;
|
|
955
|
+
if (isX(tM)) to = "";
|
|
956
|
+
else if (isX(tm)) to = `<${+tM + 1}.0.0-0`;
|
|
957
|
+
else if (isX(tp)) to = `<${tM}.${+tm + 1}.0-0`;
|
|
958
|
+
else if (tpr) to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
959
|
+
else if (incPr) to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
960
|
+
else to = `<=${to}`;
|
|
961
|
+
return `${from} ${to}`.trim();
|
|
962
|
+
};
|
|
963
|
+
const testSet = (set, version, options) => {
|
|
964
|
+
for (let i = 0; i < set.length; i++) if (!set[i].test(version)) return false;
|
|
965
|
+
if (version.prerelease.length && !options.includePrerelease) {
|
|
966
|
+
for (let i = 0; i < set.length; i++) {
|
|
967
|
+
debug$1(set[i].semver);
|
|
968
|
+
if (set[i].semver === Comparator$4.ANY) continue;
|
|
969
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
970
|
+
const allowed = set[i].semver;
|
|
971
|
+
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
return false;
|
|
975
|
+
}
|
|
976
|
+
return true;
|
|
977
|
+
};
|
|
978
|
+
} });
|
|
979
|
+
var require_comparator = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/comparator.js"(exports, module$1) {
|
|
980
|
+
const ANY$2 = Symbol("SemVer ANY");
|
|
981
|
+
var Comparator$3 = class Comparator$3$1 {
|
|
982
|
+
static get ANY() {
|
|
983
|
+
return ANY$2;
|
|
984
|
+
}
|
|
985
|
+
constructor(comp, options) {
|
|
986
|
+
options = parseOptions(options);
|
|
987
|
+
if (comp instanceof Comparator$3$1) if (comp.loose === !!options.loose) return comp;
|
|
988
|
+
else comp = comp.value;
|
|
989
|
+
comp = comp.trim().split(/\s+/).join(" ");
|
|
990
|
+
debug("comparator", comp, options);
|
|
991
|
+
this.options = options;
|
|
992
|
+
this.loose = !!options.loose;
|
|
993
|
+
this.parse(comp);
|
|
994
|
+
if (this.semver === ANY$2) this.value = "";
|
|
995
|
+
else this.value = this.operator + this.semver.version;
|
|
996
|
+
debug("comp", this);
|
|
997
|
+
}
|
|
998
|
+
parse(comp) {
|
|
999
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
1000
|
+
const m = comp.match(r);
|
|
1001
|
+
if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
|
|
1002
|
+
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
1003
|
+
if (this.operator === "=") this.operator = "";
|
|
1004
|
+
if (!m[2]) this.semver = ANY$2;
|
|
1005
|
+
else this.semver = new SemVer$5(m[2], this.options.loose);
|
|
1006
|
+
}
|
|
1007
|
+
toString() {
|
|
1008
|
+
return this.value;
|
|
1009
|
+
}
|
|
1010
|
+
test(version) {
|
|
1011
|
+
debug("Comparator.test", version, this.options.loose);
|
|
1012
|
+
if (this.semver === ANY$2 || version === ANY$2) return true;
|
|
1013
|
+
if (typeof version === "string") try {
|
|
1014
|
+
version = new SemVer$5(version, this.options);
|
|
1015
|
+
} catch (er) {
|
|
1016
|
+
return false;
|
|
1017
|
+
}
|
|
1018
|
+
return cmp$1(version, this.operator, this.semver, this.options);
|
|
1019
|
+
}
|
|
1020
|
+
intersects(comp, options) {
|
|
1021
|
+
if (!(comp instanceof Comparator$3$1)) throw new TypeError("a Comparator is required");
|
|
1022
|
+
if (this.operator === "") {
|
|
1023
|
+
if (this.value === "") return true;
|
|
1024
|
+
return new Range$10(comp.value, options).test(this.value);
|
|
1025
|
+
} else if (comp.operator === "") {
|
|
1026
|
+
if (comp.value === "") return true;
|
|
1027
|
+
return new Range$10(this.value, options).test(comp.semver);
|
|
1028
|
+
}
|
|
1029
|
+
options = parseOptions(options);
|
|
1030
|
+
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
|
|
1031
|
+
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) return false;
|
|
1032
|
+
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
|
|
1033
|
+
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
|
|
1034
|
+
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
|
|
1035
|
+
if (cmp$1(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
|
|
1036
|
+
if (cmp$1(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
|
|
1037
|
+
return false;
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
1040
|
+
module$1.exports = Comparator$3;
|
|
1041
|
+
const parseOptions = require_parse_options();
|
|
1042
|
+
const { safeRe: re, t } = require_re();
|
|
1043
|
+
const cmp$1 = require_cmp();
|
|
1044
|
+
const debug = require_debug();
|
|
1045
|
+
const SemVer$5 = require_semver$1();
|
|
1046
|
+
const Range$10 = require_range();
|
|
1047
|
+
} });
|
|
1048
|
+
var require_satisfies = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/satisfies.js"(exports, module$1) {
|
|
1049
|
+
const Range$9 = require_range();
|
|
1050
|
+
const satisfies$4 = (version, range, options) => {
|
|
1051
|
+
try {
|
|
1052
|
+
range = new Range$9(range, options);
|
|
1053
|
+
} catch (er) {
|
|
1054
|
+
return false;
|
|
1055
|
+
}
|
|
1056
|
+
return range.test(version);
|
|
1057
|
+
};
|
|
1058
|
+
module$1.exports = satisfies$4;
|
|
1059
|
+
} });
|
|
1060
|
+
var require_to_comparators = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/to-comparators.js"(exports, module$1) {
|
|
1061
|
+
const Range$8 = require_range();
|
|
1062
|
+
const toComparators$1 = (range, options) => new Range$8(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1063
|
+
module$1.exports = toComparators$1;
|
|
1064
|
+
} });
|
|
1065
|
+
var require_max_satisfying = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/max-satisfying.js"(exports, module$1) {
|
|
1066
|
+
const SemVer$4 = require_semver$1();
|
|
1067
|
+
const Range$7 = require_range();
|
|
1068
|
+
const maxSatisfying$1 = (versions, range, options) => {
|
|
1069
|
+
let max = null;
|
|
1070
|
+
let maxSV = null;
|
|
1071
|
+
let rangeObj = null;
|
|
1072
|
+
try {
|
|
1073
|
+
rangeObj = new Range$7(range, options);
|
|
1074
|
+
} catch (er) {
|
|
1075
|
+
return null;
|
|
1076
|
+
}
|
|
1077
|
+
versions.forEach((v) => {
|
|
1078
|
+
if (rangeObj.test(v)) {
|
|
1079
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
1080
|
+
max = v;
|
|
1081
|
+
maxSV = new SemVer$4(max, options);
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
});
|
|
1085
|
+
return max;
|
|
1086
|
+
};
|
|
1087
|
+
module$1.exports = maxSatisfying$1;
|
|
1088
|
+
} });
|
|
1089
|
+
var require_min_satisfying = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-satisfying.js"(exports, module$1) {
|
|
1090
|
+
const SemVer$3 = require_semver$1();
|
|
1091
|
+
const Range$6 = require_range();
|
|
1092
|
+
const minSatisfying$1 = (versions, range, options) => {
|
|
1093
|
+
let min = null;
|
|
1094
|
+
let minSV = null;
|
|
1095
|
+
let rangeObj = null;
|
|
1096
|
+
try {
|
|
1097
|
+
rangeObj = new Range$6(range, options);
|
|
1098
|
+
} catch (er) {
|
|
1099
|
+
return null;
|
|
1100
|
+
}
|
|
1101
|
+
versions.forEach((v) => {
|
|
1102
|
+
if (rangeObj.test(v)) {
|
|
1103
|
+
if (!min || minSV.compare(v) === 1) {
|
|
1104
|
+
min = v;
|
|
1105
|
+
minSV = new SemVer$3(min, options);
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
});
|
|
1109
|
+
return min;
|
|
1110
|
+
};
|
|
1111
|
+
module$1.exports = minSatisfying$1;
|
|
1112
|
+
} });
|
|
1113
|
+
var require_min_version = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-version.js"(exports, module$1) {
|
|
1114
|
+
const SemVer$2 = require_semver$1();
|
|
1115
|
+
const Range$5 = require_range();
|
|
1116
|
+
const gt$2 = require_gt();
|
|
1117
|
+
const minVersion$1 = (range, loose) => {
|
|
1118
|
+
range = new Range$5(range, loose);
|
|
1119
|
+
let minver = new SemVer$2("0.0.0");
|
|
1120
|
+
if (range.test(minver)) return minver;
|
|
1121
|
+
minver = new SemVer$2("0.0.0-0");
|
|
1122
|
+
if (range.test(minver)) return minver;
|
|
1123
|
+
minver = null;
|
|
1124
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1125
|
+
const comparators = range.set[i];
|
|
1126
|
+
let setMin = null;
|
|
1127
|
+
comparators.forEach((comparator) => {
|
|
1128
|
+
const compver = new SemVer$2(comparator.semver.version);
|
|
1129
|
+
switch (comparator.operator) {
|
|
1130
|
+
case ">":
|
|
1131
|
+
if (compver.prerelease.length === 0) compver.patch++;
|
|
1132
|
+
else compver.prerelease.push(0);
|
|
1133
|
+
compver.raw = compver.format();
|
|
1134
|
+
case "":
|
|
1135
|
+
case ">=":
|
|
1136
|
+
if (!setMin || gt$2(compver, setMin)) setMin = compver;
|
|
1137
|
+
break;
|
|
1138
|
+
case "<":
|
|
1139
|
+
case "<=": break;
|
|
1140
|
+
default: throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1141
|
+
}
|
|
1142
|
+
});
|
|
1143
|
+
if (setMin && (!minver || gt$2(minver, setMin))) minver = setMin;
|
|
1144
|
+
}
|
|
1145
|
+
if (minver && range.test(minver)) return minver;
|
|
1146
|
+
return null;
|
|
1147
|
+
};
|
|
1148
|
+
module$1.exports = minVersion$1;
|
|
1149
|
+
} });
|
|
1150
|
+
var require_valid = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/valid.js"(exports, module$1) {
|
|
1151
|
+
const Range$4 = require_range();
|
|
1152
|
+
const validRange$1 = (range, options) => {
|
|
1153
|
+
try {
|
|
1154
|
+
return new Range$4(range, options).range || "*";
|
|
1155
|
+
} catch (er) {
|
|
1156
|
+
return null;
|
|
1157
|
+
}
|
|
1158
|
+
};
|
|
1159
|
+
module$1.exports = validRange$1;
|
|
1160
|
+
} });
|
|
1161
|
+
var require_outside = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/outside.js"(exports, module$1) {
|
|
1162
|
+
const SemVer$1 = require_semver$1();
|
|
1163
|
+
const Comparator$2 = require_comparator();
|
|
1164
|
+
const { ANY: ANY$1 } = Comparator$2;
|
|
1165
|
+
const Range$3 = require_range();
|
|
1166
|
+
const satisfies$3 = require_satisfies();
|
|
1167
|
+
const gt$1 = require_gt();
|
|
1168
|
+
const lt$1 = require_lt();
|
|
1169
|
+
const lte$1 = require_lte();
|
|
1170
|
+
const gte$1 = require_gte();
|
|
1171
|
+
const outside$3 = (version, range, hilo, options) => {
|
|
1172
|
+
version = new SemVer$1(version, options);
|
|
1173
|
+
range = new Range$3(range, options);
|
|
1174
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1175
|
+
switch (hilo) {
|
|
1176
|
+
case ">":
|
|
1177
|
+
gtfn = gt$1;
|
|
1178
|
+
ltefn = lte$1;
|
|
1179
|
+
ltfn = lt$1;
|
|
1180
|
+
comp = ">";
|
|
1181
|
+
ecomp = ">=";
|
|
1182
|
+
break;
|
|
1183
|
+
case "<":
|
|
1184
|
+
gtfn = lt$1;
|
|
1185
|
+
ltefn = gte$1;
|
|
1186
|
+
ltfn = gt$1;
|
|
1187
|
+
comp = "<";
|
|
1188
|
+
ecomp = "<=";
|
|
1189
|
+
break;
|
|
1190
|
+
default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
|
|
1191
|
+
}
|
|
1192
|
+
if (satisfies$3(version, range, options)) return false;
|
|
1193
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1194
|
+
const comparators = range.set[i];
|
|
1195
|
+
let high = null;
|
|
1196
|
+
let low = null;
|
|
1197
|
+
comparators.forEach((comparator) => {
|
|
1198
|
+
if (comparator.semver === ANY$1) comparator = new Comparator$2(">=0.0.0");
|
|
1199
|
+
high = high || comparator;
|
|
1200
|
+
low = low || comparator;
|
|
1201
|
+
if (gtfn(comparator.semver, high.semver, options)) high = comparator;
|
|
1202
|
+
else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
|
|
1203
|
+
});
|
|
1204
|
+
if (high.operator === comp || high.operator === ecomp) return false;
|
|
1205
|
+
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) return false;
|
|
1206
|
+
else if (low.operator === ecomp && ltfn(version, low.semver)) return false;
|
|
1207
|
+
}
|
|
1208
|
+
return true;
|
|
1209
|
+
};
|
|
1210
|
+
module$1.exports = outside$3;
|
|
1211
|
+
} });
|
|
1212
|
+
var require_gtr = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/gtr.js"(exports, module$1) {
|
|
1213
|
+
const outside$2 = require_outside();
|
|
1214
|
+
const gtr$1 = (version, range, options) => outside$2(version, range, ">", options);
|
|
1215
|
+
module$1.exports = gtr$1;
|
|
1216
|
+
} });
|
|
1217
|
+
var require_ltr = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/ltr.js"(exports, module$1) {
|
|
1218
|
+
const outside$1 = require_outside();
|
|
1219
|
+
const ltr$1 = (version, range, options) => outside$1(version, range, "<", options);
|
|
1220
|
+
module$1.exports = ltr$1;
|
|
1221
|
+
} });
|
|
1222
|
+
var require_intersects = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/intersects.js"(exports, module$1) {
|
|
1223
|
+
const Range$2 = require_range();
|
|
1224
|
+
const intersects$1 = (r1, r2, options) => {
|
|
1225
|
+
r1 = new Range$2(r1, options);
|
|
1226
|
+
r2 = new Range$2(r2, options);
|
|
1227
|
+
return r1.intersects(r2, options);
|
|
1228
|
+
};
|
|
1229
|
+
module$1.exports = intersects$1;
|
|
1230
|
+
} });
|
|
1231
|
+
var require_simplify = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/simplify.js"(exports, module$1) {
|
|
1232
|
+
const satisfies$2 = require_satisfies();
|
|
1233
|
+
const compare$2 = require_compare();
|
|
1234
|
+
module$1.exports = (versions, range, options) => {
|
|
1235
|
+
const set = [];
|
|
1236
|
+
let first = null;
|
|
1237
|
+
let prev = null;
|
|
1238
|
+
const v = versions.sort((a, b) => compare$2(a, b, options));
|
|
1239
|
+
for (const version of v) {
|
|
1240
|
+
const included = satisfies$2(version, range, options);
|
|
1241
|
+
if (included) {
|
|
1242
|
+
prev = version;
|
|
1243
|
+
if (!first) first = version;
|
|
1244
|
+
} else {
|
|
1245
|
+
if (prev) set.push([first, prev]);
|
|
1246
|
+
prev = null;
|
|
1247
|
+
first = null;
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
if (first) set.push([first, null]);
|
|
1251
|
+
const ranges = [];
|
|
1252
|
+
for (const [min, max] of set) if (min === max) ranges.push(min);
|
|
1253
|
+
else if (!max && min === v[0]) ranges.push("*");
|
|
1254
|
+
else if (!max) ranges.push(`>=${min}`);
|
|
1255
|
+
else if (min === v[0]) ranges.push(`<=${max}`);
|
|
1256
|
+
else ranges.push(`${min} - ${max}`);
|
|
1257
|
+
const simplified = ranges.join(" || ");
|
|
1258
|
+
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
1259
|
+
return simplified.length < original.length ? simplified : range;
|
|
1260
|
+
};
|
|
1261
|
+
} });
|
|
1262
|
+
var require_subset = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/subset.js"(exports, module$1) {
|
|
1263
|
+
const Range$1 = require_range();
|
|
1264
|
+
const Comparator$1 = require_comparator();
|
|
1265
|
+
const { ANY } = Comparator$1;
|
|
1266
|
+
const satisfies$1 = require_satisfies();
|
|
1267
|
+
const compare$1 = require_compare();
|
|
1268
|
+
const subset$1 = (sub, dom, options = {}) => {
|
|
1269
|
+
if (sub === dom) return true;
|
|
1270
|
+
sub = new Range$1(sub, options);
|
|
1271
|
+
dom = new Range$1(dom, options);
|
|
1272
|
+
let sawNonNull = false;
|
|
1273
|
+
OUTER: for (const simpleSub of sub.set) {
|
|
1274
|
+
for (const simpleDom of dom.set) {
|
|
1275
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
1276
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
1277
|
+
if (isSub) continue OUTER;
|
|
1278
|
+
}
|
|
1279
|
+
if (sawNonNull) return false;
|
|
1280
|
+
}
|
|
1281
|
+
return true;
|
|
1282
|
+
};
|
|
1283
|
+
const minimumVersionWithPreRelease = [new Comparator$1(">=0.0.0-0")];
|
|
1284
|
+
const minimumVersion = [new Comparator$1(">=0.0.0")];
|
|
1285
|
+
const simpleSubset = (sub, dom, options) => {
|
|
1286
|
+
if (sub === dom) return true;
|
|
1287
|
+
if (sub.length === 1 && sub[0].semver === ANY) if (dom.length === 1 && dom[0].semver === ANY) return true;
|
|
1288
|
+
else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
|
|
1289
|
+
else sub = minimumVersion;
|
|
1290
|
+
if (dom.length === 1 && dom[0].semver === ANY) if (options.includePrerelease) return true;
|
|
1291
|
+
else dom = minimumVersion;
|
|
1292
|
+
const eqSet = new Set();
|
|
1293
|
+
let gt$5, lt$4;
|
|
1294
|
+
for (const c of sub) if (c.operator === ">" || c.operator === ">=") gt$5 = higherGT(gt$5, c, options);
|
|
1295
|
+
else if (c.operator === "<" || c.operator === "<=") lt$4 = lowerLT(lt$4, c, options);
|
|
1296
|
+
else eqSet.add(c.semver);
|
|
1297
|
+
if (eqSet.size > 1) return null;
|
|
1298
|
+
let gtltComp;
|
|
1299
|
+
if (gt$5 && lt$4) {
|
|
1300
|
+
gtltComp = compare$1(gt$5.semver, lt$4.semver, options);
|
|
1301
|
+
if (gtltComp > 0) return null;
|
|
1302
|
+
else if (gtltComp === 0 && (gt$5.operator !== ">=" || lt$4.operator !== "<=")) return null;
|
|
1303
|
+
}
|
|
1304
|
+
for (const eq$3 of eqSet) {
|
|
1305
|
+
if (gt$5 && !satisfies$1(eq$3, String(gt$5), options)) return null;
|
|
1306
|
+
if (lt$4 && !satisfies$1(eq$3, String(lt$4), options)) return null;
|
|
1307
|
+
for (const c of dom) if (!satisfies$1(eq$3, String(c), options)) return false;
|
|
1308
|
+
return true;
|
|
1309
|
+
}
|
|
1310
|
+
let higher, lower;
|
|
1311
|
+
let hasDomLT, hasDomGT;
|
|
1312
|
+
let needDomLTPre = lt$4 && !options.includePrerelease && lt$4.semver.prerelease.length ? lt$4.semver : false;
|
|
1313
|
+
let needDomGTPre = gt$5 && !options.includePrerelease && gt$5.semver.prerelease.length ? gt$5.semver : false;
|
|
1314
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt$4.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
|
|
1315
|
+
for (const c of dom) {
|
|
1316
|
+
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
1317
|
+
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
1318
|
+
if (gt$5) {
|
|
1319
|
+
if (needDomGTPre) {
|
|
1320
|
+
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;
|
|
1321
|
+
}
|
|
1322
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
1323
|
+
higher = higherGT(gt$5, c, options);
|
|
1324
|
+
if (higher === c && higher !== gt$5) return false;
|
|
1325
|
+
} else if (gt$5.operator === ">=" && !satisfies$1(gt$5.semver, String(c), options)) return false;
|
|
1326
|
+
}
|
|
1327
|
+
if (lt$4) {
|
|
1328
|
+
if (needDomLTPre) {
|
|
1329
|
+
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;
|
|
1330
|
+
}
|
|
1331
|
+
if (c.operator === "<" || c.operator === "<=") {
|
|
1332
|
+
lower = lowerLT(lt$4, c, options);
|
|
1333
|
+
if (lower === c && lower !== lt$4) return false;
|
|
1334
|
+
} else if (lt$4.operator === "<=" && !satisfies$1(lt$4.semver, String(c), options)) return false;
|
|
1335
|
+
}
|
|
1336
|
+
if (!c.operator && (lt$4 || gt$5) && gtltComp !== 0) return false;
|
|
1337
|
+
}
|
|
1338
|
+
if (gt$5 && hasDomLT && !lt$4 && gtltComp !== 0) return false;
|
|
1339
|
+
if (lt$4 && hasDomGT && !gt$5 && gtltComp !== 0) return false;
|
|
1340
|
+
if (needDomGTPre || needDomLTPre) return false;
|
|
1341
|
+
return true;
|
|
1342
|
+
};
|
|
1343
|
+
const higherGT = (a, b, options) => {
|
|
1344
|
+
if (!a) return b;
|
|
1345
|
+
const comp = compare$1(a.semver, b.semver, options);
|
|
1346
|
+
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
1347
|
+
};
|
|
1348
|
+
const lowerLT = (a, b, options) => {
|
|
1349
|
+
if (!a) return b;
|
|
1350
|
+
const comp = compare$1(a.semver, b.semver, options);
|
|
1351
|
+
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
1352
|
+
};
|
|
1353
|
+
module$1.exports = subset$1;
|
|
1354
|
+
} });
|
|
1355
|
+
var require_semver = __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/index.js"(exports, module$1) {
|
|
1356
|
+
const internalRe = require_re();
|
|
1357
|
+
const constants = require_constants();
|
|
1358
|
+
const SemVer = require_semver$1();
|
|
1359
|
+
const identifiers = require_identifiers();
|
|
1360
|
+
const parse = require_parse();
|
|
1361
|
+
const valid = require_valid$1();
|
|
1362
|
+
const clean = require_clean();
|
|
1363
|
+
const inc = require_inc();
|
|
1364
|
+
const diff = require_diff();
|
|
1365
|
+
const major = require_major();
|
|
1366
|
+
const minor = require_minor();
|
|
1367
|
+
const patch = require_patch();
|
|
1368
|
+
const prerelease = require_prerelease();
|
|
1369
|
+
const compare = require_compare();
|
|
1370
|
+
const rcompare = require_rcompare();
|
|
1371
|
+
const compareLoose = require_compare_loose();
|
|
1372
|
+
const compareBuild = require_compare_build();
|
|
1373
|
+
const sort = require_sort();
|
|
1374
|
+
const rsort = require_rsort();
|
|
1375
|
+
const gt = require_gt();
|
|
1376
|
+
const lt = require_lt();
|
|
1377
|
+
const eq = require_eq();
|
|
1378
|
+
const neq = require_neq();
|
|
1379
|
+
const gte = require_gte();
|
|
1380
|
+
const lte = require_lte();
|
|
1381
|
+
const cmp = require_cmp();
|
|
1382
|
+
const coerce = require_coerce();
|
|
1383
|
+
const Comparator = require_comparator();
|
|
1384
|
+
const Range = require_range();
|
|
1385
|
+
const satisfies = require_satisfies();
|
|
1386
|
+
const toComparators = require_to_comparators();
|
|
1387
|
+
const maxSatisfying = require_max_satisfying();
|
|
1388
|
+
const minSatisfying = require_min_satisfying();
|
|
1389
|
+
const minVersion = require_min_version();
|
|
1390
|
+
const validRange = require_valid();
|
|
1391
|
+
const outside = require_outside();
|
|
1392
|
+
const gtr = require_gtr();
|
|
1393
|
+
const ltr = require_ltr();
|
|
1394
|
+
const intersects = require_intersects();
|
|
1395
|
+
const simplifyRange = require_simplify();
|
|
1396
|
+
const subset = require_subset();
|
|
1397
|
+
module$1.exports = {
|
|
1398
|
+
parse,
|
|
1399
|
+
valid,
|
|
1400
|
+
clean,
|
|
1401
|
+
inc,
|
|
1402
|
+
diff,
|
|
1403
|
+
major,
|
|
1404
|
+
minor,
|
|
1405
|
+
patch,
|
|
1406
|
+
prerelease,
|
|
1407
|
+
compare,
|
|
1408
|
+
rcompare,
|
|
1409
|
+
compareLoose,
|
|
1410
|
+
compareBuild,
|
|
1411
|
+
sort,
|
|
1412
|
+
rsort,
|
|
1413
|
+
gt,
|
|
1414
|
+
lt,
|
|
1415
|
+
eq,
|
|
1416
|
+
neq,
|
|
1417
|
+
gte,
|
|
1418
|
+
lte,
|
|
1419
|
+
cmp,
|
|
1420
|
+
coerce,
|
|
1421
|
+
Comparator,
|
|
1422
|
+
Range,
|
|
1423
|
+
satisfies,
|
|
1424
|
+
toComparators,
|
|
1425
|
+
maxSatisfying,
|
|
1426
|
+
minSatisfying,
|
|
1427
|
+
minVersion,
|
|
1428
|
+
validRange,
|
|
1429
|
+
outside,
|
|
1430
|
+
gtr,
|
|
1431
|
+
ltr,
|
|
1432
|
+
intersects,
|
|
1433
|
+
simplifyRange,
|
|
1434
|
+
subset,
|
|
1435
|
+
SemVer,
|
|
1436
|
+
re: internalRe.re,
|
|
1437
|
+
src: internalRe.src,
|
|
1438
|
+
tokens: internalRe.t,
|
|
1439
|
+
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
1440
|
+
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
1441
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
1442
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
1443
|
+
};
|
|
1444
|
+
} });
|
|
1445
|
+
var import_semver = __toESM(require_semver(), 1);
|
|
1446
|
+
const semverSatisfies = (targetAppVersion, currentVersion) => {
|
|
1447
|
+
const currentCoerce = import_semver.default.coerce(currentVersion);
|
|
1448
|
+
if (!currentCoerce) return false;
|
|
1449
|
+
return import_semver.default.satisfies(currentCoerce.version, targetAppVersion);
|
|
1450
|
+
};
|
|
1451
|
+
/**
|
|
1452
|
+
* Filters target app versions that are compatible with the current app version.
|
|
1453
|
+
* Returns only versions that are compatible with the current version according to semver rules.
|
|
1454
|
+
*
|
|
1455
|
+
* @param targetAppVersionList - List of target app versions to filter
|
|
1456
|
+
* @param currentVersion - Current app version
|
|
1457
|
+
* @returns Array of target app versions compatible with the current version
|
|
1458
|
+
*/
|
|
1459
|
+
const filterCompatibleAppVersions = (targetAppVersionList, currentVersion) => {
|
|
1460
|
+
const compatibleAppVersionList = targetAppVersionList.filter((version) => semverSatisfies(version, currentVersion));
|
|
1461
|
+
return compatibleAppVersionList.sort((a, b) => b.localeCompare(a));
|
|
1462
|
+
};
|
|
1463
|
+
const encoder = new TextEncoder();
|
|
1464
|
+
const decoder = new TextDecoder();
|
|
1465
|
+
const MAX_INT32 = 2 ** 32;
|
|
1466
|
+
var JOSEError = class extends Error {
|
|
1467
|
+
static code = "ERR_JOSE_GENERIC";
|
|
1468
|
+
code = "ERR_JOSE_GENERIC";
|
|
1469
|
+
constructor(message$1, options) {
|
|
1470
|
+
super(message$1, options);
|
|
1471
|
+
this.name = this.constructor.name;
|
|
1472
|
+
Error.captureStackTrace?.(this, this.constructor);
|
|
1473
|
+
}
|
|
1474
|
+
};
|
|
1475
|
+
var JWKSMultipleMatchingKeys = class extends JOSEError {
|
|
1476
|
+
[Symbol.asyncIterator];
|
|
1477
|
+
static code = "ERR_JWKS_MULTIPLE_MATCHING_KEYS";
|
|
1478
|
+
code = "ERR_JWKS_MULTIPLE_MATCHING_KEYS";
|
|
1479
|
+
constructor(message$1 = "multiple matching keys found in the JSON Web Key Set", options) {
|
|
1480
|
+
super(message$1, options);
|
|
1481
|
+
}
|
|
1482
|
+
};
|
|
1483
|
+
const minute = 60;
|
|
1484
|
+
const hour = minute * 60;
|
|
1485
|
+
const day = hour * 24;
|
|
1486
|
+
const week = day * 7;
|
|
1487
|
+
const year = day * 365.25;
|
|
1488
|
+
|
|
1489
|
+
//#endregion
|
|
1490
|
+
//#region ../../node_modules/.pnpm/map-obj@5.0.0/node_modules/map-obj/index.js
|
|
1491
|
+
const isObject$1 = (value) => typeof value === "object" && value !== null;
|
|
1492
|
+
const isObjectCustom = (value) => isObject$1(value) && !(value instanceof RegExp) && !(value instanceof Error) && !(value instanceof Date);
|
|
1493
|
+
const mapObjectSkip = Symbol("mapObjectSkip");
|
|
1494
|
+
const _mapObject = (object, mapper, options, isSeen = new WeakMap()) => {
|
|
1495
|
+
options = {
|
|
1496
|
+
deep: false,
|
|
1497
|
+
target: {},
|
|
1498
|
+
...options
|
|
1499
|
+
};
|
|
1500
|
+
if (isSeen.has(object)) return isSeen.get(object);
|
|
1501
|
+
isSeen.set(object, options.target);
|
|
1502
|
+
const { target } = options;
|
|
1503
|
+
delete options.target;
|
|
1504
|
+
const mapArray = (array) => array.map((element) => isObjectCustom(element) ? _mapObject(element, mapper, options, isSeen) : element);
|
|
1505
|
+
if (Array.isArray(object)) return mapArray(object);
|
|
1506
|
+
for (const [key, value] of Object.entries(object)) {
|
|
1507
|
+
const mapResult = mapper(key, value, object);
|
|
1508
|
+
if (mapResult === mapObjectSkip) continue;
|
|
1509
|
+
let [newKey, newValue, { shouldRecurse = true } = {}] = mapResult;
|
|
1510
|
+
if (newKey === "__proto__") continue;
|
|
1511
|
+
if (options.deep && shouldRecurse && isObjectCustom(newValue)) newValue = Array.isArray(newValue) ? mapArray(newValue) : _mapObject(newValue, mapper, options, isSeen);
|
|
1512
|
+
target[newKey] = newValue;
|
|
1513
|
+
}
|
|
1514
|
+
return target;
|
|
1753
1515
|
};
|
|
1754
1516
|
function mapObject(object, mapper, options) {
|
|
1755
|
-
|
|
1756
|
-
|
|
1517
|
+
if (!isObject$1(object)) throw new TypeError(`Expected an object, got \`${object}\` (${typeof object})`);
|
|
1518
|
+
return _mapObject(object, mapper, options);
|
|
1757
1519
|
}
|
|
1520
|
+
|
|
1521
|
+
//#endregion
|
|
1522
|
+
//#region ../../node_modules/.pnpm/camelcase@8.0.0/node_modules/camelcase/index.js
|
|
1758
1523
|
const UPPERCASE = /[\p{Lu}]/u;
|
|
1759
1524
|
const LOWERCASE = /[\p{Ll}]/u;
|
|
1760
1525
|
const LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
|
|
1761
1526
|
const IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
|
|
1762
1527
|
const SEPARATORS = /[_.\- ]+/;
|
|
1763
|
-
const LEADING_SEPARATORS = new RegExp(
|
|
1764
|
-
const SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source,
|
|
1765
|
-
const NUMBERS_AND_IDENTIFIER = new RegExp(
|
|
1766
|
-
const preserveCamelCase = (string, toLowerCase, toUpperCase, preserveConsecutiveUppercase)=>{
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1528
|
+
const LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);
|
|
1529
|
+
const SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
|
|
1530
|
+
const NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
|
|
1531
|
+
const preserveCamelCase = (string, toLowerCase, toUpperCase, preserveConsecutiveUppercase$1) => {
|
|
1532
|
+
let isLastCharLower = false;
|
|
1533
|
+
let isLastCharUpper = false;
|
|
1534
|
+
let isLastLastCharUpper = false;
|
|
1535
|
+
let isLastLastCharPreserved = false;
|
|
1536
|
+
for (let index = 0; index < string.length; index++) {
|
|
1537
|
+
const character = string[index];
|
|
1538
|
+
isLastLastCharPreserved = index > 2 ? string[index - 3] === "-" : true;
|
|
1539
|
+
if (isLastCharLower && UPPERCASE.test(character)) {
|
|
1540
|
+
string = string.slice(0, index) + "-" + string.slice(index);
|
|
1541
|
+
isLastCharLower = false;
|
|
1542
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
1543
|
+
isLastCharUpper = true;
|
|
1544
|
+
index++;
|
|
1545
|
+
} else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character) && (!isLastLastCharPreserved || preserveConsecutiveUppercase$1)) {
|
|
1546
|
+
string = string.slice(0, index - 1) + "-" + string.slice(index - 1);
|
|
1547
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
1548
|
+
isLastCharUpper = false;
|
|
1549
|
+
isLastCharLower = true;
|
|
1550
|
+
} else {
|
|
1551
|
+
isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
|
|
1552
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
1553
|
+
isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
return string;
|
|
1792
1557
|
};
|
|
1793
|
-
const
|
|
1794
|
-
|
|
1795
|
-
|
|
1558
|
+
const preserveConsecutiveUppercase = (input, toLowerCase) => {
|
|
1559
|
+
LEADING_CAPITAL.lastIndex = 0;
|
|
1560
|
+
return input.replaceAll(LEADING_CAPITAL, (match) => toLowerCase(match));
|
|
1796
1561
|
};
|
|
1797
|
-
const postProcess = (input, toUpperCase)=>{
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
'_',
|
|
1802
|
-
'-'
|
|
1803
|
-
].includes(input.charAt(offset + match.length)) ? match : toUpperCase(match)).replaceAll(SEPARATORS_AND_IDENTIFIER, (_, identifier)=>toUpperCase(identifier));
|
|
1562
|
+
const postProcess = (input, toUpperCase) => {
|
|
1563
|
+
SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
|
|
1564
|
+
NUMBERS_AND_IDENTIFIER.lastIndex = 0;
|
|
1565
|
+
return input.replaceAll(NUMBERS_AND_IDENTIFIER, (match, pattern, offset) => ["_", "-"].includes(input.charAt(offset + match.length)) ? match : toUpperCase(match)).replaceAll(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier));
|
|
1804
1566
|
};
|
|
1805
1567
|
function camelCase(input, options) {
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
class QuickLRU extends Map {
|
|
1828
|
-
constructor(options = {}){
|
|
1829
|
-
super();
|
|
1830
|
-
if (!(options.maxSize && options.maxSize > 0)) throw new TypeError('`maxSize` must be a number greater than 0');
|
|
1831
|
-
if ('number' == typeof options.maxAge && 0 === options.maxAge) throw new TypeError('`maxAge` must be a number greater than 0');
|
|
1832
|
-
this.maxSize = options.maxSize;
|
|
1833
|
-
this.maxAge = options.maxAge || Number.POSITIVE_INFINITY;
|
|
1834
|
-
this.onEviction = options.onEviction;
|
|
1835
|
-
this.cache = new Map();
|
|
1836
|
-
this.oldCache = new Map();
|
|
1837
|
-
this._size = 0;
|
|
1838
|
-
}
|
|
1839
|
-
_emitEvictions(cache) {
|
|
1840
|
-
if ('function' != typeof this.onEviction) return;
|
|
1841
|
-
for (const [key, item] of cache)this.onEviction(key, item.value);
|
|
1842
|
-
}
|
|
1843
|
-
_deleteIfExpired(key, item) {
|
|
1844
|
-
if ('number' == typeof item.expiry && item.expiry <= Date.now()) {
|
|
1845
|
-
if ('function' == typeof this.onEviction) this.onEviction(key, item.value);
|
|
1846
|
-
return this.delete(key);
|
|
1847
|
-
}
|
|
1848
|
-
return false;
|
|
1849
|
-
}
|
|
1850
|
-
_getOrDeleteIfExpired(key, item) {
|
|
1851
|
-
const deleted = this._deleteIfExpired(key, item);
|
|
1852
|
-
if (false === deleted) return item.value;
|
|
1853
|
-
}
|
|
1854
|
-
_getItemValue(key, item) {
|
|
1855
|
-
return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value;
|
|
1856
|
-
}
|
|
1857
|
-
_peek(key, cache) {
|
|
1858
|
-
const item = cache.get(key);
|
|
1859
|
-
return this._getItemValue(key, item);
|
|
1860
|
-
}
|
|
1861
|
-
_set(key, value) {
|
|
1862
|
-
this.cache.set(key, value);
|
|
1863
|
-
this._size++;
|
|
1864
|
-
if (this._size >= this.maxSize) {
|
|
1865
|
-
this._size = 0;
|
|
1866
|
-
this._emitEvictions(this.oldCache);
|
|
1867
|
-
this.oldCache = this.cache;
|
|
1868
|
-
this.cache = new Map();
|
|
1869
|
-
}
|
|
1870
|
-
}
|
|
1871
|
-
_moveToRecent(key, item) {
|
|
1872
|
-
this.oldCache.delete(key);
|
|
1873
|
-
this._set(key, item);
|
|
1874
|
-
}
|
|
1875
|
-
*_entriesAscending() {
|
|
1876
|
-
for (const item of this.oldCache){
|
|
1877
|
-
const [key, value] = item;
|
|
1878
|
-
if (!this.cache.has(key)) {
|
|
1879
|
-
const deleted = this._deleteIfExpired(key, value);
|
|
1880
|
-
if (false === deleted) yield item;
|
|
1881
|
-
}
|
|
1882
|
-
}
|
|
1883
|
-
for (const item of this.cache){
|
|
1884
|
-
const [key, value] = item;
|
|
1885
|
-
const deleted = this._deleteIfExpired(key, value);
|
|
1886
|
-
if (false === deleted) yield item;
|
|
1887
|
-
}
|
|
1888
|
-
}
|
|
1889
|
-
get(key) {
|
|
1890
|
-
if (this.cache.has(key)) {
|
|
1891
|
-
const item = this.cache.get(key);
|
|
1892
|
-
return this._getItemValue(key, item);
|
|
1893
|
-
}
|
|
1894
|
-
if (this.oldCache.has(key)) {
|
|
1895
|
-
const item = this.oldCache.get(key);
|
|
1896
|
-
if (false === this._deleteIfExpired(key, item)) {
|
|
1897
|
-
this._moveToRecent(key, item);
|
|
1898
|
-
return item.value;
|
|
1899
|
-
}
|
|
1900
|
-
}
|
|
1901
|
-
}
|
|
1902
|
-
set(key, value, { maxAge = this.maxAge } = {}) {
|
|
1903
|
-
const expiry = 'number' == typeof maxAge && maxAge !== Number.POSITIVE_INFINITY ? Date.now() + maxAge : void 0;
|
|
1904
|
-
if (this.cache.has(key)) this.cache.set(key, {
|
|
1905
|
-
value,
|
|
1906
|
-
expiry
|
|
1907
|
-
});
|
|
1908
|
-
else this._set(key, {
|
|
1909
|
-
value,
|
|
1910
|
-
expiry
|
|
1911
|
-
});
|
|
1912
|
-
return this;
|
|
1913
|
-
}
|
|
1914
|
-
has(key) {
|
|
1915
|
-
if (this.cache.has(key)) return !this._deleteIfExpired(key, this.cache.get(key));
|
|
1916
|
-
if (this.oldCache.has(key)) return !this._deleteIfExpired(key, this.oldCache.get(key));
|
|
1917
|
-
return false;
|
|
1918
|
-
}
|
|
1919
|
-
peek(key) {
|
|
1920
|
-
if (this.cache.has(key)) return this._peek(key, this.cache);
|
|
1921
|
-
if (this.oldCache.has(key)) return this._peek(key, this.oldCache);
|
|
1922
|
-
}
|
|
1923
|
-
delete(key) {
|
|
1924
|
-
const deleted = this.cache.delete(key);
|
|
1925
|
-
if (deleted) this._size--;
|
|
1926
|
-
return this.oldCache.delete(key) || deleted;
|
|
1927
|
-
}
|
|
1928
|
-
clear() {
|
|
1929
|
-
this.cache.clear();
|
|
1930
|
-
this.oldCache.clear();
|
|
1931
|
-
this._size = 0;
|
|
1932
|
-
}
|
|
1933
|
-
resize(newSize) {
|
|
1934
|
-
if (!(newSize && newSize > 0)) throw new TypeError('`maxSize` must be a number greater than 0');
|
|
1935
|
-
const items = [
|
|
1936
|
-
...this._entriesAscending()
|
|
1937
|
-
];
|
|
1938
|
-
const removeCount = items.length - newSize;
|
|
1939
|
-
if (removeCount < 0) {
|
|
1940
|
-
this.cache = new Map(items);
|
|
1941
|
-
this.oldCache = new Map();
|
|
1942
|
-
this._size = items.length;
|
|
1943
|
-
} else {
|
|
1944
|
-
if (removeCount > 0) this._emitEvictions(items.slice(0, removeCount));
|
|
1945
|
-
this.oldCache = new Map(items.slice(removeCount));
|
|
1946
|
-
this.cache = new Map();
|
|
1947
|
-
this._size = 0;
|
|
1948
|
-
}
|
|
1949
|
-
this.maxSize = newSize;
|
|
1950
|
-
}
|
|
1951
|
-
*keys() {
|
|
1952
|
-
for (const [key] of this)yield key;
|
|
1953
|
-
}
|
|
1954
|
-
*values() {
|
|
1955
|
-
for (const [, value] of this)yield value;
|
|
1956
|
-
}
|
|
1957
|
-
*[Symbol.iterator]() {
|
|
1958
|
-
for (const item of this.cache){
|
|
1959
|
-
const [key, value] = item;
|
|
1960
|
-
const deleted = this._deleteIfExpired(key, value);
|
|
1961
|
-
if (false === deleted) yield [
|
|
1962
|
-
key,
|
|
1963
|
-
value.value
|
|
1964
|
-
];
|
|
1965
|
-
}
|
|
1966
|
-
for (const item of this.oldCache){
|
|
1967
|
-
const [key, value] = item;
|
|
1968
|
-
if (!this.cache.has(key)) {
|
|
1969
|
-
const deleted = this._deleteIfExpired(key, value);
|
|
1970
|
-
if (false === deleted) yield [
|
|
1971
|
-
key,
|
|
1972
|
-
value.value
|
|
1973
|
-
];
|
|
1974
|
-
}
|
|
1975
|
-
}
|
|
1976
|
-
}
|
|
1977
|
-
*entriesDescending() {
|
|
1978
|
-
let items = [
|
|
1979
|
-
...this.cache
|
|
1980
|
-
];
|
|
1981
|
-
for(let i = items.length - 1; i >= 0; --i){
|
|
1982
|
-
const item = items[i];
|
|
1983
|
-
const [key, value] = item;
|
|
1984
|
-
const deleted = this._deleteIfExpired(key, value);
|
|
1985
|
-
if (false === deleted) yield [
|
|
1986
|
-
key,
|
|
1987
|
-
value.value
|
|
1988
|
-
];
|
|
1989
|
-
}
|
|
1990
|
-
items = [
|
|
1991
|
-
...this.oldCache
|
|
1992
|
-
];
|
|
1993
|
-
for(let i = items.length - 1; i >= 0; --i){
|
|
1994
|
-
const item = items[i];
|
|
1995
|
-
const [key, value] = item;
|
|
1996
|
-
if (!this.cache.has(key)) {
|
|
1997
|
-
const deleted = this._deleteIfExpired(key, value);
|
|
1998
|
-
if (false === deleted) yield [
|
|
1999
|
-
key,
|
|
2000
|
-
value.value
|
|
2001
|
-
];
|
|
2002
|
-
}
|
|
2003
|
-
}
|
|
2004
|
-
}
|
|
2005
|
-
*entriesAscending() {
|
|
2006
|
-
for (const [key, value] of this._entriesAscending())yield [
|
|
2007
|
-
key,
|
|
2008
|
-
value.value
|
|
2009
|
-
];
|
|
2010
|
-
}
|
|
2011
|
-
get size() {
|
|
2012
|
-
if (!this._size) return this.oldCache.size;
|
|
2013
|
-
let oldCacheSize = 0;
|
|
2014
|
-
for (const key of this.oldCache.keys())if (!this.cache.has(key)) oldCacheSize++;
|
|
2015
|
-
return Math.min(this._size + oldCacheSize, this.maxSize);
|
|
2016
|
-
}
|
|
2017
|
-
entries() {
|
|
2018
|
-
return this.entriesAscending();
|
|
2019
|
-
}
|
|
2020
|
-
forEach(callbackFunction, thisArgument = this) {
|
|
2021
|
-
for (const [key, value] of this.entriesAscending())callbackFunction.call(thisArgument, value, key, this);
|
|
2022
|
-
}
|
|
2023
|
-
get [Symbol.toStringTag]() {
|
|
2024
|
-
return JSON.stringify([
|
|
2025
|
-
...this.entriesAscending()
|
|
2026
|
-
]);
|
|
2027
|
-
}
|
|
1568
|
+
if (!(typeof input === "string" || Array.isArray(input))) throw new TypeError("Expected the input to be `string | string[]`");
|
|
1569
|
+
options = {
|
|
1570
|
+
pascalCase: false,
|
|
1571
|
+
preserveConsecutiveUppercase: false,
|
|
1572
|
+
...options
|
|
1573
|
+
};
|
|
1574
|
+
if (Array.isArray(input)) input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
|
|
1575
|
+
else input = input.trim();
|
|
1576
|
+
if (input.length === 0) return "";
|
|
1577
|
+
const toLowerCase = options.locale === false ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale);
|
|
1578
|
+
const toUpperCase = options.locale === false ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale);
|
|
1579
|
+
if (input.length === 1) {
|
|
1580
|
+
if (SEPARATORS.test(input)) return "";
|
|
1581
|
+
return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
|
|
1582
|
+
}
|
|
1583
|
+
const hasUpperCase = input !== toLowerCase(input);
|
|
1584
|
+
if (hasUpperCase) input = preserveCamelCase(input, toLowerCase, toUpperCase, options.preserveConsecutiveUppercase);
|
|
1585
|
+
input = input.replace(LEADING_SEPARATORS, "");
|
|
1586
|
+
input = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input);
|
|
1587
|
+
if (options.pascalCase) input = toUpperCase(input.charAt(0)) + input.slice(1);
|
|
1588
|
+
return postProcess(input, toUpperCase);
|
|
2028
1589
|
}
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
1590
|
+
|
|
1591
|
+
//#endregion
|
|
1592
|
+
//#region ../../node_modules/.pnpm/quick-lru@6.1.2/node_modules/quick-lru/index.js
|
|
1593
|
+
var QuickLRU = class extends Map {
|
|
1594
|
+
constructor(options = {}) {
|
|
1595
|
+
super();
|
|
1596
|
+
if (!(options.maxSize && options.maxSize > 0)) throw new TypeError("`maxSize` must be a number greater than 0");
|
|
1597
|
+
if (typeof options.maxAge === "number" && options.maxAge === 0) throw new TypeError("`maxAge` must be a number greater than 0");
|
|
1598
|
+
this.maxSize = options.maxSize;
|
|
1599
|
+
this.maxAge = options.maxAge || Number.POSITIVE_INFINITY;
|
|
1600
|
+
this.onEviction = options.onEviction;
|
|
1601
|
+
this.cache = new Map();
|
|
1602
|
+
this.oldCache = new Map();
|
|
1603
|
+
this._size = 0;
|
|
1604
|
+
}
|
|
1605
|
+
_emitEvictions(cache$1) {
|
|
1606
|
+
if (typeof this.onEviction !== "function") return;
|
|
1607
|
+
for (const [key, item] of cache$1) this.onEviction(key, item.value);
|
|
1608
|
+
}
|
|
1609
|
+
_deleteIfExpired(key, item) {
|
|
1610
|
+
if (typeof item.expiry === "number" && item.expiry <= Date.now()) {
|
|
1611
|
+
if (typeof this.onEviction === "function") this.onEviction(key, item.value);
|
|
1612
|
+
return this.delete(key);
|
|
1613
|
+
}
|
|
1614
|
+
return false;
|
|
1615
|
+
}
|
|
1616
|
+
_getOrDeleteIfExpired(key, item) {
|
|
1617
|
+
const deleted = this._deleteIfExpired(key, item);
|
|
1618
|
+
if (deleted === false) return item.value;
|
|
1619
|
+
}
|
|
1620
|
+
_getItemValue(key, item) {
|
|
1621
|
+
return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value;
|
|
1622
|
+
}
|
|
1623
|
+
_peek(key, cache$1) {
|
|
1624
|
+
const item = cache$1.get(key);
|
|
1625
|
+
return this._getItemValue(key, item);
|
|
1626
|
+
}
|
|
1627
|
+
_set(key, value) {
|
|
1628
|
+
this.cache.set(key, value);
|
|
1629
|
+
this._size++;
|
|
1630
|
+
if (this._size >= this.maxSize) {
|
|
1631
|
+
this._size = 0;
|
|
1632
|
+
this._emitEvictions(this.oldCache);
|
|
1633
|
+
this.oldCache = this.cache;
|
|
1634
|
+
this.cache = new Map();
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
_moveToRecent(key, item) {
|
|
1638
|
+
this.oldCache.delete(key);
|
|
1639
|
+
this._set(key, item);
|
|
1640
|
+
}
|
|
1641
|
+
*_entriesAscending() {
|
|
1642
|
+
for (const item of this.oldCache) {
|
|
1643
|
+
const [key, value] = item;
|
|
1644
|
+
if (!this.cache.has(key)) {
|
|
1645
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
1646
|
+
if (deleted === false) yield item;
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
for (const item of this.cache) {
|
|
1650
|
+
const [key, value] = item;
|
|
1651
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
1652
|
+
if (deleted === false) yield item;
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
get(key) {
|
|
1656
|
+
if (this.cache.has(key)) {
|
|
1657
|
+
const item = this.cache.get(key);
|
|
1658
|
+
return this._getItemValue(key, item);
|
|
1659
|
+
}
|
|
1660
|
+
if (this.oldCache.has(key)) {
|
|
1661
|
+
const item = this.oldCache.get(key);
|
|
1662
|
+
if (this._deleteIfExpired(key, item) === false) {
|
|
1663
|
+
this._moveToRecent(key, item);
|
|
1664
|
+
return item.value;
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
set(key, value, { maxAge = this.maxAge } = {}) {
|
|
1669
|
+
const expiry = typeof maxAge === "number" && maxAge !== Number.POSITIVE_INFINITY ? Date.now() + maxAge : void 0;
|
|
1670
|
+
if (this.cache.has(key)) this.cache.set(key, {
|
|
1671
|
+
value,
|
|
1672
|
+
expiry
|
|
1673
|
+
});
|
|
1674
|
+
else this._set(key, {
|
|
1675
|
+
value,
|
|
1676
|
+
expiry
|
|
1677
|
+
});
|
|
1678
|
+
return this;
|
|
1679
|
+
}
|
|
1680
|
+
has(key) {
|
|
1681
|
+
if (this.cache.has(key)) return !this._deleteIfExpired(key, this.cache.get(key));
|
|
1682
|
+
if (this.oldCache.has(key)) return !this._deleteIfExpired(key, this.oldCache.get(key));
|
|
1683
|
+
return false;
|
|
1684
|
+
}
|
|
1685
|
+
peek(key) {
|
|
1686
|
+
if (this.cache.has(key)) return this._peek(key, this.cache);
|
|
1687
|
+
if (this.oldCache.has(key)) return this._peek(key, this.oldCache);
|
|
1688
|
+
}
|
|
1689
|
+
delete(key) {
|
|
1690
|
+
const deleted = this.cache.delete(key);
|
|
1691
|
+
if (deleted) this._size--;
|
|
1692
|
+
return this.oldCache.delete(key) || deleted;
|
|
1693
|
+
}
|
|
1694
|
+
clear() {
|
|
1695
|
+
this.cache.clear();
|
|
1696
|
+
this.oldCache.clear();
|
|
1697
|
+
this._size = 0;
|
|
1698
|
+
}
|
|
1699
|
+
resize(newSize) {
|
|
1700
|
+
if (!(newSize && newSize > 0)) throw new TypeError("`maxSize` must be a number greater than 0");
|
|
1701
|
+
const items = [...this._entriesAscending()];
|
|
1702
|
+
const removeCount = items.length - newSize;
|
|
1703
|
+
if (removeCount < 0) {
|
|
1704
|
+
this.cache = new Map(items);
|
|
1705
|
+
this.oldCache = new Map();
|
|
1706
|
+
this._size = items.length;
|
|
1707
|
+
} else {
|
|
1708
|
+
if (removeCount > 0) this._emitEvictions(items.slice(0, removeCount));
|
|
1709
|
+
this.oldCache = new Map(items.slice(removeCount));
|
|
1710
|
+
this.cache = new Map();
|
|
1711
|
+
this._size = 0;
|
|
1712
|
+
}
|
|
1713
|
+
this.maxSize = newSize;
|
|
1714
|
+
}
|
|
1715
|
+
*keys() {
|
|
1716
|
+
for (const [key] of this) yield key;
|
|
1717
|
+
}
|
|
1718
|
+
*values() {
|
|
1719
|
+
for (const [, value] of this) yield value;
|
|
1720
|
+
}
|
|
1721
|
+
*[Symbol.iterator]() {
|
|
1722
|
+
for (const item of this.cache) {
|
|
1723
|
+
const [key, value] = item;
|
|
1724
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
1725
|
+
if (deleted === false) yield [key, value.value];
|
|
1726
|
+
}
|
|
1727
|
+
for (const item of this.oldCache) {
|
|
1728
|
+
const [key, value] = item;
|
|
1729
|
+
if (!this.cache.has(key)) {
|
|
1730
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
1731
|
+
if (deleted === false) yield [key, value.value];
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
*entriesDescending() {
|
|
1736
|
+
let items = [...this.cache];
|
|
1737
|
+
for (let i = items.length - 1; i >= 0; --i) {
|
|
1738
|
+
const item = items[i];
|
|
1739
|
+
const [key, value] = item;
|
|
1740
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
1741
|
+
if (deleted === false) yield [key, value.value];
|
|
1742
|
+
}
|
|
1743
|
+
items = [...this.oldCache];
|
|
1744
|
+
for (let i = items.length - 1; i >= 0; --i) {
|
|
1745
|
+
const item = items[i];
|
|
1746
|
+
const [key, value] = item;
|
|
1747
|
+
if (!this.cache.has(key)) {
|
|
1748
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
1749
|
+
if (deleted === false) yield [key, value.value];
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
*entriesAscending() {
|
|
1754
|
+
for (const [key, value] of this._entriesAscending()) yield [key, value.value];
|
|
1755
|
+
}
|
|
1756
|
+
get size() {
|
|
1757
|
+
if (!this._size) return this.oldCache.size;
|
|
1758
|
+
let oldCacheSize = 0;
|
|
1759
|
+
for (const key of this.oldCache.keys()) if (!this.cache.has(key)) oldCacheSize++;
|
|
1760
|
+
return Math.min(this._size + oldCacheSize, this.maxSize);
|
|
1761
|
+
}
|
|
1762
|
+
entries() {
|
|
1763
|
+
return this.entriesAscending();
|
|
1764
|
+
}
|
|
1765
|
+
forEach(callbackFunction, thisArgument = this) {
|
|
1766
|
+
for (const [key, value] of this.entriesAscending()) callbackFunction.call(thisArgument, value, key, this);
|
|
1767
|
+
}
|
|
1768
|
+
get [Symbol.toStringTag]() {
|
|
1769
|
+
return JSON.stringify([...this.entriesAscending()]);
|
|
1770
|
+
}
|
|
1771
|
+
};
|
|
1772
|
+
|
|
1773
|
+
//#endregion
|
|
1774
|
+
//#region ../../node_modules/.pnpm/camelcase-keys@9.1.3/node_modules/camelcase-keys/index.js
|
|
1775
|
+
const has = (array, key) => array.some((element) => {
|
|
1776
|
+
if (typeof element === "string") return element === key;
|
|
1777
|
+
element.lastIndex = 0;
|
|
1778
|
+
return element.test(key);
|
|
2036
1779
|
});
|
|
2037
|
-
const
|
|
2038
|
-
const
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
};
|
|
2065
|
-
return mapObject(input, makeMapper(void 0));
|
|
1780
|
+
const cache = new QuickLRU({ maxSize: 1e5 });
|
|
1781
|
+
const isObject = (value) => typeof value === "object" && value !== null && !(value instanceof RegExp) && !(value instanceof Error) && !(value instanceof Date);
|
|
1782
|
+
const transform = (input, options = {}) => {
|
|
1783
|
+
if (!isObject(input)) return input;
|
|
1784
|
+
const { exclude, pascalCase = false, stopPaths, deep = false, preserveConsecutiveUppercase: preserveConsecutiveUppercase$1 = false } = options;
|
|
1785
|
+
const stopPathsSet = new Set(stopPaths);
|
|
1786
|
+
const makeMapper = (parentPath) => (key, value) => {
|
|
1787
|
+
if (deep && isObject(value)) {
|
|
1788
|
+
const path = parentPath === void 0 ? key : `${parentPath}.${key}`;
|
|
1789
|
+
if (!stopPathsSet.has(path)) value = mapObject(value, makeMapper(path));
|
|
1790
|
+
}
|
|
1791
|
+
if (!(exclude && has(exclude, key))) {
|
|
1792
|
+
const cacheKey = pascalCase ? `${key}_` : key;
|
|
1793
|
+
if (cache.has(cacheKey)) key = cache.get(cacheKey);
|
|
1794
|
+
else {
|
|
1795
|
+
const returnValue = camelCase(key, {
|
|
1796
|
+
pascalCase,
|
|
1797
|
+
locale: false,
|
|
1798
|
+
preserveConsecutiveUppercase: preserveConsecutiveUppercase$1
|
|
1799
|
+
});
|
|
1800
|
+
if (key.length < 100) cache.set(cacheKey, returnValue);
|
|
1801
|
+
key = returnValue;
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
return [key, value];
|
|
1805
|
+
};
|
|
1806
|
+
return mapObject(input, makeMapper(void 0));
|
|
2066
1807
|
};
|
|
2067
1808
|
function camelcaseKeys(input, options) {
|
|
2068
|
-
|
|
2069
|
-
|
|
1809
|
+
if (Array.isArray(input)) return Object.keys(input).map((key) => transform(input[key], options));
|
|
1810
|
+
return transform(input, options);
|
|
2070
1811
|
}
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
1812
|
+
|
|
1813
|
+
//#endregion
|
|
1814
|
+
//#region ../../node_modules/.pnpm/pg-minify@1.6.5/node_modules/pg-minify/lib/utils.js
|
|
1815
|
+
var require_utils = __commonJS$1({ "../../node_modules/.pnpm/pg-minify@1.6.5/node_modules/pg-minify/lib/utils.js"(exports, module) {
|
|
1816
|
+
const { inspect } = __require("util");
|
|
1817
|
+
function getIndexPos$1(text, index) {
|
|
1818
|
+
let lineIdx = 0, colIdx = index, pos = 0;
|
|
1819
|
+
do {
|
|
1820
|
+
pos = text.indexOf("\n", pos);
|
|
1821
|
+
if (pos === -1 || index < pos + 1) break;
|
|
1822
|
+
lineIdx++;
|
|
1823
|
+
pos++;
|
|
1824
|
+
colIdx = index - pos;
|
|
1825
|
+
} while (pos < index);
|
|
1826
|
+
return {
|
|
1827
|
+
line: lineIdx + 1,
|
|
1828
|
+
column: colIdx + 1
|
|
1829
|
+
};
|
|
1830
|
+
}
|
|
1831
|
+
function messageGap$1(level) {
|
|
1832
|
+
return " ".repeat(level * 4);
|
|
1833
|
+
}
|
|
1834
|
+
function addInspection$1(type, cb) {
|
|
1835
|
+
type[inspect.custom] = cb;
|
|
1836
|
+
}
|
|
1837
|
+
module.exports = {
|
|
1838
|
+
getIndexPos: getIndexPos$1,
|
|
1839
|
+
messageGap: messageGap$1,
|
|
1840
|
+
addInspection: addInspection$1
|
|
1841
|
+
};
|
|
1842
|
+
} });
|
|
1843
|
+
|
|
1844
|
+
//#endregion
|
|
1845
|
+
//#region ../../node_modules/.pnpm/pg-minify@1.6.5/node_modules/pg-minify/lib/error.js
|
|
1846
|
+
var require_error = __commonJS$1({ "../../node_modules/.pnpm/pg-minify@1.6.5/node_modules/pg-minify/lib/error.js"(exports, module) {
|
|
1847
|
+
const { EOL } = __require("os");
|
|
1848
|
+
const { addInspection, messageGap } = require_utils();
|
|
1849
|
+
const parsingErrorCode$1 = {
|
|
1850
|
+
unclosedMLC: 0,
|
|
1851
|
+
unclosedText: 1,
|
|
1852
|
+
unclosedQI: 2,
|
|
1853
|
+
multiLineQI: 3
|
|
1854
|
+
};
|
|
1855
|
+
Object.freeze(parsingErrorCode$1);
|
|
1856
|
+
const errorMessages = [
|
|
1857
|
+
{
|
|
1858
|
+
name: "unclosedMLC",
|
|
1859
|
+
message: "Unclosed multi-line comment."
|
|
1860
|
+
},
|
|
1861
|
+
{
|
|
1862
|
+
name: "unclosedText",
|
|
1863
|
+
message: "Unclosed text block."
|
|
1864
|
+
},
|
|
1865
|
+
{
|
|
1866
|
+
name: "unclosedQI",
|
|
1867
|
+
message: "Unclosed quoted identifier."
|
|
1868
|
+
},
|
|
1869
|
+
{
|
|
1870
|
+
name: "multiLineQI",
|
|
1871
|
+
message: "Multi-line quoted identifiers are not supported."
|
|
1872
|
+
}
|
|
1873
|
+
];
|
|
1874
|
+
var SQLParsingError$1 = class extends Error {
|
|
1875
|
+
constructor(code, position) {
|
|
1876
|
+
const err = errorMessages[code].message;
|
|
1877
|
+
const message = `Error parsing SQL at {line:${position.line},col:${position.column}}: ${err}`;
|
|
1878
|
+
super(message);
|
|
1879
|
+
this.name = this.constructor.name;
|
|
1880
|
+
this.error = err;
|
|
1881
|
+
this.code = code;
|
|
1882
|
+
this.position = position;
|
|
1883
|
+
Error.captureStackTrace(this, this.constructor);
|
|
1884
|
+
}
|
|
1885
|
+
};
|
|
1886
|
+
SQLParsingError$1.prototype.toString = function(level) {
|
|
1887
|
+
level = level > 0 ? parseInt(level) : 0;
|
|
1888
|
+
const gap = messageGap(level + 1);
|
|
1889
|
+
const lines = [
|
|
1890
|
+
"SQLParsingError {",
|
|
1891
|
+
`${gap}code: parsingErrorCode.${errorMessages[this.code].name}`,
|
|
1892
|
+
`${gap}error: "${this.error}"`,
|
|
1893
|
+
`${gap}position: {line: ${this.position.line}, col: ${this.position.column}}`,
|
|
1894
|
+
`${messageGap(level)}}`
|
|
1895
|
+
];
|
|
1896
|
+
return lines.join(EOL);
|
|
1897
|
+
};
|
|
1898
|
+
addInspection(SQLParsingError$1.prototype, function() {
|
|
1899
|
+
return this.toString();
|
|
1900
|
+
});
|
|
1901
|
+
module.exports = {
|
|
1902
|
+
SQLParsingError: SQLParsingError$1,
|
|
1903
|
+
parsingErrorCode: parsingErrorCode$1
|
|
1904
|
+
};
|
|
1905
|
+
} });
|
|
1906
|
+
|
|
1907
|
+
//#endregion
|
|
1908
|
+
//#region ../../node_modules/.pnpm/pg-minify@1.6.5/node_modules/pg-minify/lib/parser.js
|
|
1909
|
+
var require_parser = __commonJS$1({ "../../node_modules/.pnpm/pg-minify@1.6.5/node_modules/pg-minify/lib/parser.js"(exports, module) {
|
|
1910
|
+
const { parsingErrorCode, SQLParsingError } = require_error();
|
|
1911
|
+
const { getIndexPos } = require_utils();
|
|
1912
|
+
const compressors = ".,;:()[]=<>+-*/|!?@#";
|
|
1913
|
+
function minify$1(sql, options) {
|
|
1914
|
+
if (typeof sql !== "string") throw new TypeError("Input SQL must be a text string.");
|
|
1915
|
+
if (!sql.length) return "";
|
|
1916
|
+
sql = sql.replace(/\r\n/g, "\n");
|
|
1917
|
+
options = options || {};
|
|
1918
|
+
let idx = 0, result = "", space = false;
|
|
1919
|
+
const len = sql.length;
|
|
1920
|
+
do {
|
|
1921
|
+
const s = sql[idx], s1 = sql[idx + 1];
|
|
1922
|
+
if (isGap(s)) {
|
|
1923
|
+
while (++idx < len && isGap(sql[idx]));
|
|
1924
|
+
if (idx < len) space = true;
|
|
1925
|
+
idx--;
|
|
1926
|
+
continue;
|
|
1927
|
+
}
|
|
1928
|
+
if (s === "-" && s1 === "-") {
|
|
1929
|
+
const lb = sql.indexOf("\n", idx + 2);
|
|
1930
|
+
if (lb < 0) break;
|
|
1931
|
+
idx = lb - 1;
|
|
1932
|
+
skipGaps();
|
|
1933
|
+
continue;
|
|
1934
|
+
}
|
|
1935
|
+
if (s === "/" && s1 === "*") {
|
|
1936
|
+
let c = idx + 1, open = 0, close = 0, lastOpen, lastClose;
|
|
1937
|
+
while (++c < len - 1 && close <= open) if (sql[c] === "/" && sql[c + 1] === "*") {
|
|
1938
|
+
lastOpen = c;
|
|
1939
|
+
open++;
|
|
1940
|
+
c++;
|
|
1941
|
+
} else if (sql[c] === "*" && sql[c + 1] === "/") {
|
|
1942
|
+
lastClose = c;
|
|
1943
|
+
close++;
|
|
1944
|
+
c++;
|
|
1945
|
+
}
|
|
1946
|
+
if (close <= open) {
|
|
1947
|
+
idx = lastOpen;
|
|
1948
|
+
throwError(parsingErrorCode.unclosedMLC);
|
|
1949
|
+
}
|
|
1950
|
+
if (sql[idx + 2] === "!" && !options.removeAll) {
|
|
1951
|
+
if (options.compress) space = false;
|
|
1952
|
+
addSpace();
|
|
1953
|
+
result += sql.substring(idx, lastClose + 2).replace(/\n/g, "\r\n");
|
|
1954
|
+
}
|
|
1955
|
+
idx = lastClose + 1;
|
|
1956
|
+
skipGaps();
|
|
1957
|
+
continue;
|
|
1958
|
+
}
|
|
1959
|
+
let closeIdx, text;
|
|
1960
|
+
if (s === "\"") {
|
|
1961
|
+
closeIdx = sql.indexOf("\"", idx + 1);
|
|
1962
|
+
if (closeIdx < 0) throwError(parsingErrorCode.unclosedQI);
|
|
1963
|
+
text = sql.substring(idx, closeIdx + 1);
|
|
1964
|
+
if (text.indexOf("\n") > 0) throwError(parsingErrorCode.multiLineQI);
|
|
1965
|
+
if (options.compress) space = false;
|
|
1966
|
+
addSpace();
|
|
1967
|
+
result += text;
|
|
1968
|
+
idx = closeIdx;
|
|
1969
|
+
skipGaps();
|
|
1970
|
+
continue;
|
|
1971
|
+
}
|
|
1972
|
+
if (s === "'") {
|
|
1973
|
+
closeIdx = idx;
|
|
1974
|
+
do {
|
|
1975
|
+
closeIdx = sql.indexOf("'", closeIdx + 1);
|
|
1976
|
+
if (closeIdx > 0) {
|
|
1977
|
+
let i = closeIdx;
|
|
1978
|
+
while (sql[--i] === "\\");
|
|
1979
|
+
if ((closeIdx - i) % 2) {
|
|
1980
|
+
let step = closeIdx;
|
|
1981
|
+
while (++step < len && sql[step] === "'");
|
|
1982
|
+
if ((step - closeIdx) % 2) {
|
|
1983
|
+
closeIdx = step - 1;
|
|
1984
|
+
break;
|
|
1985
|
+
}
|
|
1986
|
+
closeIdx = step === len ? -1 : step;
|
|
1987
|
+
}
|
|
1988
|
+
}
|
|
1989
|
+
} while (closeIdx > 0);
|
|
1990
|
+
if (closeIdx < 0) throwError(parsingErrorCode.unclosedText);
|
|
1991
|
+
if (options.compress) space = false;
|
|
1992
|
+
addSpace();
|
|
1993
|
+
text = sql.substring(idx, closeIdx + 1);
|
|
1994
|
+
const hasLB = text.indexOf("\n") > 0;
|
|
1995
|
+
if (hasLB) text = text.split("\n").map((m) => {
|
|
1996
|
+
return m.replace(/^\s+|\s+$/g, "");
|
|
1997
|
+
}).join("\\n");
|
|
1998
|
+
const hasTabs = text.indexOf(" ") > 0;
|
|
1999
|
+
if (hasLB || hasTabs) {
|
|
2000
|
+
const prev = idx ? sql[idx - 1] : "";
|
|
2001
|
+
if (prev !== "E" && prev !== "e") {
|
|
2002
|
+
const r = result ? result[result.length - 1] : "";
|
|
2003
|
+
if (r && r !== " " && compressors.indexOf(r) < 0) result += " ";
|
|
2004
|
+
result += "E";
|
|
2005
|
+
}
|
|
2006
|
+
if (hasTabs) text = text.replace(/\t/g, "\\t");
|
|
2007
|
+
}
|
|
2008
|
+
result += text;
|
|
2009
|
+
idx = closeIdx;
|
|
2010
|
+
skipGaps();
|
|
2011
|
+
continue;
|
|
2012
|
+
}
|
|
2013
|
+
if (options.compress && compressors.indexOf(s) >= 0) {
|
|
2014
|
+
space = false;
|
|
2015
|
+
skipGaps();
|
|
2016
|
+
}
|
|
2017
|
+
addSpace();
|
|
2018
|
+
result += s;
|
|
2019
|
+
} while (++idx < len);
|
|
2020
|
+
return result;
|
|
2021
|
+
function skipGaps() {
|
|
2022
|
+
if (options.compress) while (idx < len - 1 && isGap(sql[idx + 1]) && idx++);
|
|
2023
|
+
}
|
|
2024
|
+
function addSpace() {
|
|
2025
|
+
if (space) {
|
|
2026
|
+
if (result.length) result += " ";
|
|
2027
|
+
space = false;
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
function throwError(code) {
|
|
2031
|
+
const position = getIndexPos(sql, idx);
|
|
2032
|
+
throw new SQLParsingError(code, position);
|
|
2033
|
+
}
|
|
2034
|
+
}
|
|
2035
|
+
function isGap(s) {
|
|
2036
|
+
return s === " " || s === " " || s === "\r" || s === "\n";
|
|
2037
|
+
}
|
|
2038
|
+
module.exports = minify$1;
|
|
2039
|
+
} });
|
|
2040
|
+
|
|
2041
|
+
//#endregion
|
|
2042
|
+
//#region ../../node_modules/.pnpm/pg-minify@1.6.5/node_modules/pg-minify/lib/index.js
|
|
2043
|
+
var require_lib = __commonJS$1({ "../../node_modules/.pnpm/pg-minify@1.6.5/node_modules/pg-minify/lib/index.js"(exports, module) {
|
|
2044
|
+
const parser = require_parser();
|
|
2045
|
+
const error = require_error();
|
|
2046
|
+
parser.SQLParsingError = error.SQLParsingError;
|
|
2047
|
+
parser.parsingErrorCode = error.parsingErrorCode;
|
|
2048
|
+
module.exports = parser;
|
|
2049
|
+
} });
|
|
2050
|
+
|
|
2051
|
+
//#endregion
|
|
2052
|
+
//#region src/getUpdateInfo.ts
|
|
2053
|
+
var import_lib = __toESM$1(require_lib(), 1);
|
|
2054
|
+
const appVersionStrategy = async (pool, { platform, appVersion, bundleId, minBundleId = NIL_UUID, channel = "production" }) => {
|
|
2055
|
+
const sqlGetTargetAppVersionList = (0, import_lib.default)(`
|
|
2075
2056
|
SELECT target_app_version
|
|
2076
2057
|
FROM get_target_app_version_list($1, $2);
|
|
2077
2058
|
`);
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
]);
|
|
2082
|
-
const targetAppVersionList = filterCompatibleAppVersions(appVersionList?.map((group)=>group.target_app_version) ?? [], appVersion);
|
|
2083
|
-
const sqlGetUpdateInfo = lib_default()(`
|
|
2059
|
+
const { rows: appVersionList } = await pool.query(sqlGetTargetAppVersionList, [platform, minBundleId]);
|
|
2060
|
+
const targetAppVersionList = filterCompatibleAppVersions(appVersionList?.map((group) => group.target_app_version) ?? [], appVersion);
|
|
2061
|
+
const sqlGetUpdateInfo = (0, import_lib.default)(`
|
|
2084
2062
|
SELECT *
|
|
2085
2063
|
FROM get_update_info(
|
|
2086
2064
|
$1, -- platform
|
|
@@ -2091,14 +2069,20 @@ const getUpdateInfo_getUpdateInfo = async (pool, { platform, appVersion, bundleI
|
|
|
2091
2069
|
$6 -- targetAppVersionList (text array)
|
|
2092
2070
|
);
|
|
2093
2071
|
`);
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2072
|
+
const result = await pool.query(sqlGetUpdateInfo, [
|
|
2073
|
+
platform,
|
|
2074
|
+
appVersion,
|
|
2075
|
+
bundleId,
|
|
2076
|
+
minBundleId ?? NIL_UUID,
|
|
2077
|
+
channel,
|
|
2078
|
+
targetAppVersionList
|
|
2079
|
+
]);
|
|
2080
|
+
return result.rows[0] ? camelcaseKeys(result.rows[0]) : null;
|
|
2081
|
+
};
|
|
2082
|
+
const getUpdateInfo = (pool, args) => {
|
|
2083
|
+
if (args._updateStrategy === "appVersion") return appVersionStrategy(pool, args);
|
|
2084
|
+
return null;
|
|
2103
2085
|
};
|
|
2104
|
-
|
|
2086
|
+
|
|
2087
|
+
//#endregion
|
|
2088
|
+
export { appVersionStrategy, getUpdateInfo, postgres };
|