@platforma-sdk/block-tools 2.6.62 → 2.6.64
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/cli.js +3 -6
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +372 -417
- package/dist/cli.mjs.map +1 -1
- package/dist/config-CZZ2gdZH.mjs +1696 -0
- package/dist/config-CZZ2gdZH.mjs.map +1 -0
- package/dist/config-DXWEXkqY.js +3 -0
- package/dist/config-DXWEXkqY.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -299
- package/dist/index.mjs.map +1 -1
- package/dist/util.d.ts +1 -1
- package/dist/v2/model/block_components.d.ts +88 -88
- package/dist/v2/model/block_description.d.ts +1340 -1340
- package/dist/v2/model/block_meta.d.ts +226 -226
- package/package.json +9 -9
- package/src/util.ts +5 -2
- package/src/v2/model/content_conversion.ts +2 -2
- package/dist/config-Cc8_zV3b.mjs +0 -2050
- package/dist/config-Cc8_zV3b.mjs.map +0 -1
- package/dist/config-Ycas5fbX.js +0 -3
- package/dist/config-Ycas5fbX.js.map +0 -1
package/dist/config-Cc8_zV3b.mjs
DELETED
|
@@ -1,2050 +0,0 @@
|
|
|
1
|
-
var fs = Object.defineProperty;
|
|
2
|
-
var us = (t, e, r) => e in t ? fs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
-
var X = (t, e, r) => us(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import { BlockPackMeta as V, ContentAbsoluteTextLocal as Ct, ContentAbsoluteBinaryLocal as le, BlockPackMetaEmbeddedBase64 as hs, BlockPackMetaEmbeddedBytes as Vr, DescriptionContentText as ps, DescriptionContentBinary as gs, ContentRelativeText as ee, ContentRelativeBinary as te, BlockComponents as fe, ContentAbsoluteFolder as ds, BlockComponentsManifest as ue, ContentRelative as oe, mapRemoteToAbsolute as Ut, addPrefixToRelative as ms, BlockPackDescriptionManifest as J, CreateBlockPackDescriptionSchema as W, BlockPackManifest as Mr, BlockPackManifestFile as vs, SemVer as Tt, BlockPackDescriptionFromPackageJsonRaw as Xr, Sha256Schema as St, BlockPackIdNoVersion as Es, VersionWithChannels as $s, AnyChannel as ce, blockPackIdToString as Oe } from "@milaboratories/pl-model-middle-layer";
|
|
5
|
-
import { z as L } from "zod";
|
|
6
|
-
import B from "node:path";
|
|
7
|
-
import U from "node:fs/promises";
|
|
8
|
-
import * as he from "mime-types";
|
|
9
|
-
import * as ws from "tar";
|
|
10
|
-
import { tryResolve as Jr } from "@milaboratories/resolve-helper";
|
|
11
|
-
import { notEmpty as Wr, ConsoleLoggerAdapter as Rs } from "@milaboratories/ts-helpers";
|
|
12
|
-
import { gzip as Ss, gunzip as ys } from "node:zlib";
|
|
13
|
-
import { promisify as zt } from "node:util";
|
|
14
|
-
import { extractConfigGeneric as Os } from "@milaboratories/pl-model-common";
|
|
15
|
-
import { createHash as Ps, randomUUID as Hr } from "node:crypto";
|
|
16
|
-
import Is from "yaml";
|
|
17
|
-
import * as Vt from "node:os";
|
|
18
|
-
import z from "node:path/posix";
|
|
19
|
-
import { S3 as Ns, paginateListObjectsV2 as ks } from "@aws-sdk/client-s3";
|
|
20
|
-
import * as Q from "node:fs";
|
|
21
|
-
function Ls(t) {
|
|
22
|
-
return L.string().transform((e, r) => {
|
|
23
|
-
const s = Jr(t, e);
|
|
24
|
-
return s === void 0 ? (r.addIssue({
|
|
25
|
-
code: L.ZodIssueCode.custom,
|
|
26
|
-
message: `Can't resolve ${e} against ${t}`
|
|
27
|
-
}), L.NEVER) : {
|
|
28
|
-
type: "absolute-file",
|
|
29
|
-
file: s
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
function Cs(t, ...e) {
|
|
34
|
-
return L.string().transform((r, s) => {
|
|
35
|
-
const i = r.endsWith("/") ? r : `${r}/`;
|
|
36
|
-
for (const l of e) {
|
|
37
|
-
const a = Jr(t, i + l);
|
|
38
|
-
if (a !== void 0) {
|
|
39
|
-
if (!a.endsWith(l))
|
|
40
|
-
throw new Error(`Unexpected resolve result ${a} with index file ${l}`);
|
|
41
|
-
return {
|
|
42
|
-
type: "absolute-folder",
|
|
43
|
-
folder: a.slice(0, a.length - l.length)
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return s.addIssue({
|
|
48
|
-
code: L.ZodIssueCode.custom,
|
|
49
|
-
message: `Can't resolve ${r} folder against ${t}, no index file found (${e.join(", ")})`
|
|
50
|
-
}), L.NEVER;
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
function Mt(t) {
|
|
54
|
-
return (e) => e.type === "relative" ? { type: "absolute-file", file: B.resolve(t, e.path) } : e;
|
|
55
|
-
}
|
|
56
|
-
function Yr() {
|
|
57
|
-
return async (t) => t.type === "absolute-file" ? await U.readFile(t.file, { encoding: "utf-8" }) : t.content;
|
|
58
|
-
}
|
|
59
|
-
function Ts() {
|
|
60
|
-
return async (t) => {
|
|
61
|
-
if (t.type === "absolute-file") {
|
|
62
|
-
const e = he.lookup(t.file);
|
|
63
|
-
if (!e) throw new Error(`Can't recognize mime type of the file: ${t.file}.`);
|
|
64
|
-
return {
|
|
65
|
-
type: "explicit-base64",
|
|
66
|
-
mimeType: e,
|
|
67
|
-
content: await U.readFile(t.file, { encoding: "base64" })
|
|
68
|
-
};
|
|
69
|
-
} else return t;
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
function As() {
|
|
73
|
-
return async (t) => {
|
|
74
|
-
if (t.type === "absolute-file") {
|
|
75
|
-
const e = he.lookup(t.file);
|
|
76
|
-
if (!e) throw new Error(`Can't recognize mime type of the file: ${t.file}.`);
|
|
77
|
-
return {
|
|
78
|
-
type: "explicit-bytes",
|
|
79
|
-
mimeType: e,
|
|
80
|
-
content: Buffer.from(await U.readFile(t.file))
|
|
81
|
-
};
|
|
82
|
-
} else return t.type === "explicit-base64" ? {
|
|
83
|
-
type: "explicit-bytes",
|
|
84
|
-
mimeType: t.mimeType,
|
|
85
|
-
content: Buffer.from(t.content, "base64")
|
|
86
|
-
} : t;
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
function yt(t, e) {
|
|
90
|
-
return async (r) => {
|
|
91
|
-
if (r.type === "absolute-file") {
|
|
92
|
-
const s = B.basename(r.file), i = B.resolve(t, s);
|
|
93
|
-
return e == null || e.push(s), await U.cp(r.file, i), { type: "relative", path: s };
|
|
94
|
-
} else return r;
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
function Fs(t, e, r) {
|
|
98
|
-
if (!e.endsWith(".tgz")) throw new Error(`Unexpected tgz file name: ${e}`);
|
|
99
|
-
return async (s) => {
|
|
100
|
-
const i = B.resolve(t, e);
|
|
101
|
-
return await ws.create(
|
|
102
|
-
{
|
|
103
|
-
gzip: !0,
|
|
104
|
-
file: i,
|
|
105
|
-
cwd: s.folder
|
|
106
|
-
},
|
|
107
|
-
["."]
|
|
108
|
-
), r == null || r.push(e), { type: "relative", path: e };
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
function At(t) {
|
|
112
|
-
return async (e) => e.type === "explicit-string" ? e : { type: "explicit-string", content: (await t(e.path)).toString("utf8") };
|
|
113
|
-
}
|
|
114
|
-
function bs(t) {
|
|
115
|
-
return async (e) => e.type === "explicit-string" ? e.content : (await t(e.path)).toString("utf8");
|
|
116
|
-
}
|
|
117
|
-
function ri(t) {
|
|
118
|
-
return async (e) => {
|
|
119
|
-
if (e.type === "explicit-base64") return e;
|
|
120
|
-
const r = he.lookup(e.path);
|
|
121
|
-
if (!r) throw new Error(`Can't recognize mime type of the file: ${e.path}.`);
|
|
122
|
-
return {
|
|
123
|
-
type: "explicit-base64",
|
|
124
|
-
mimeType: r,
|
|
125
|
-
content: (await t(e.path)).toString("base64")
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
function pe(t) {
|
|
130
|
-
return async (e) => {
|
|
131
|
-
if (e.type === "explicit-base64")
|
|
132
|
-
return {
|
|
133
|
-
type: "explicit-bytes",
|
|
134
|
-
mimeType: e.mimeType,
|
|
135
|
-
content: Buffer.from(e.content, "base64")
|
|
136
|
-
};
|
|
137
|
-
const r = he.lookup(e.path);
|
|
138
|
-
if (!r) throw new Error(`Can't recognize mime type of the file: ${e.path}.`);
|
|
139
|
-
return {
|
|
140
|
-
type: "explicit-bytes",
|
|
141
|
-
mimeType: r,
|
|
142
|
-
content: await t(e.path)
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
function qs(t) {
|
|
147
|
-
return V(
|
|
148
|
-
ps.transform(Mt(t)),
|
|
149
|
-
gs.transform(Mt(t))
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
function Ds(t, e) {
|
|
153
|
-
return V(
|
|
154
|
-
Ct.transform(yt(t, e)),
|
|
155
|
-
le.transform(yt(t, e))
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
const si = V(
|
|
159
|
-
Ct.transform(Yr()),
|
|
160
|
-
le.transform(Ts())
|
|
161
|
-
).pipe(hs), ni = V(
|
|
162
|
-
Ct.transform(Yr()),
|
|
163
|
-
le.transform(As())
|
|
164
|
-
).pipe(Vr);
|
|
165
|
-
function ii(t) {
|
|
166
|
-
return V(
|
|
167
|
-
ee.transform(bs(t)),
|
|
168
|
-
te.transform(pe(t))
|
|
169
|
-
).pipe(Vr);
|
|
170
|
-
}
|
|
171
|
-
function Bs(t) {
|
|
172
|
-
return fe(
|
|
173
|
-
Ls(t),
|
|
174
|
-
Cs(t, "index.html")
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
function _s(t, e) {
|
|
178
|
-
return fe(
|
|
179
|
-
le.transform(yt(t, e)),
|
|
180
|
-
ds.transform(Fs(t, "ui.tgz", e))
|
|
181
|
-
).pipe(ue);
|
|
182
|
-
}
|
|
183
|
-
function ai(t) {
|
|
184
|
-
return fe(
|
|
185
|
-
oe.transform(Ut(t)),
|
|
186
|
-
oe.transform(Ut(t))
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
function Zr(t) {
|
|
190
|
-
return W(
|
|
191
|
-
Bs(t),
|
|
192
|
-
qs(t)
|
|
193
|
-
).transform(async (e, r) => {
|
|
194
|
-
const i = Os(
|
|
195
|
-
JSON.parse(
|
|
196
|
-
await U.readFile(e.components.model.file, "utf-8")
|
|
197
|
-
)
|
|
198
|
-
).featureFlags;
|
|
199
|
-
return {
|
|
200
|
-
...e,
|
|
201
|
-
featureFlags: i
|
|
202
|
-
};
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
function Gs(t, e) {
|
|
206
|
-
return W(
|
|
207
|
-
_s(t, e),
|
|
208
|
-
Ds(t, e)
|
|
209
|
-
).pipe(J);
|
|
210
|
-
}
|
|
211
|
-
function Xt(t) {
|
|
212
|
-
const e = ms(t);
|
|
213
|
-
return J.pipe(
|
|
214
|
-
W(
|
|
215
|
-
fe(
|
|
216
|
-
oe.transform(e),
|
|
217
|
-
oe.transform(e)
|
|
218
|
-
),
|
|
219
|
-
V(
|
|
220
|
-
ee.transform(e),
|
|
221
|
-
te.transform(e)
|
|
222
|
-
)
|
|
223
|
-
)
|
|
224
|
-
).pipe(J);
|
|
225
|
-
}
|
|
226
|
-
async function Ft(t, e) {
|
|
227
|
-
try {
|
|
228
|
-
return e(await U.readFile(t));
|
|
229
|
-
} catch (r) {
|
|
230
|
-
if (r instanceof Error && "code" in r && r.code === "ENOENT") return;
|
|
231
|
-
throw r;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
function Ot(t) {
|
|
235
|
-
return Promise.resolve(
|
|
236
|
-
Ps("sha256").update(Buffer.from(t)).digest("hex").toUpperCase()
|
|
237
|
-
);
|
|
238
|
-
}
|
|
239
|
-
async function oi(t, e) {
|
|
240
|
-
await U.mkdir(e, { recursive: !0 });
|
|
241
|
-
const r = [], s = await Gs(e, r).parseAsync(t), i = await Promise.all(
|
|
242
|
-
r.map(async (a) => {
|
|
243
|
-
const h = await U.readFile(B.resolve(e, a)), c = await Ot(h);
|
|
244
|
-
return { name: a, size: h.length, sha256: c };
|
|
245
|
-
})
|
|
246
|
-
), l = Mr.parse({
|
|
247
|
-
schema: "v2",
|
|
248
|
-
description: {
|
|
249
|
-
...s
|
|
250
|
-
},
|
|
251
|
-
files: i,
|
|
252
|
-
timestamp: Date.now()
|
|
253
|
-
});
|
|
254
|
-
return await U.writeFile(B.resolve(e, vs), JSON.stringify(l)), l;
|
|
255
|
-
}
|
|
256
|
-
const Pt = "block", xs = /(?:@[a-zA-Z0-9-.]+\/)?(?<organization>[a-zA-Z0-9-]+)\.(?<name>[a-zA-Z0-9-]+)/;
|
|
257
|
-
function Kr(t) {
|
|
258
|
-
const e = t.match(xs);
|
|
259
|
-
if (!e)
|
|
260
|
-
throw new Error(
|
|
261
|
-
`Malformed package name (${t}), can't infer organization and block pack name.`
|
|
262
|
-
);
|
|
263
|
-
const { name: r, organization: s } = e.groups;
|
|
264
|
-
return { name: r, organization: s };
|
|
265
|
-
}
|
|
266
|
-
async function ci(t, e) {
|
|
267
|
-
const r = B.resolve(t, "package.json");
|
|
268
|
-
try {
|
|
269
|
-
const s = await Ft(
|
|
270
|
-
r,
|
|
271
|
-
(h) => JSON.parse(h.toString("utf-8"))
|
|
272
|
-
);
|
|
273
|
-
if (s === void 0) return;
|
|
274
|
-
const i = s[Pt];
|
|
275
|
-
if (i === void 0) return;
|
|
276
|
-
const l = {
|
|
277
|
-
...Xr.parse(i),
|
|
278
|
-
id: {
|
|
279
|
-
...Kr(
|
|
280
|
-
Wr(
|
|
281
|
-
s.name,
|
|
282
|
-
`"name" not found in ${r}`
|
|
283
|
-
)
|
|
284
|
-
),
|
|
285
|
-
version: Tt.parse(s.version)
|
|
286
|
-
}
|
|
287
|
-
}, a = await Zr(t).safeParseAsync(l);
|
|
288
|
-
if (a.success) return a.data;
|
|
289
|
-
e == null || e.warn(a.error);
|
|
290
|
-
return;
|
|
291
|
-
} catch (s) {
|
|
292
|
-
e == null || e.warn(s);
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
async function js(t) {
|
|
297
|
-
const e = B.resolve(t, "package.json"), r = JSON.parse(
|
|
298
|
-
await U.readFile(e, { encoding: "utf-8" })
|
|
299
|
-
), s = r[Pt];
|
|
300
|
-
if (s === void 0)
|
|
301
|
-
throw new Error(
|
|
302
|
-
`Block description (field ${Pt}) not found in ${e}.`
|
|
303
|
-
);
|
|
304
|
-
return {
|
|
305
|
-
...Xr.parse(s),
|
|
306
|
-
id: {
|
|
307
|
-
...Kr(
|
|
308
|
-
Wr(
|
|
309
|
-
r.name,
|
|
310
|
-
`"name" not found in ${e}`
|
|
311
|
-
)
|
|
312
|
-
),
|
|
313
|
-
version: Tt.parse(r.version)
|
|
314
|
-
},
|
|
315
|
-
featureFlags: {}
|
|
316
|
-
};
|
|
317
|
-
}
|
|
318
|
-
async function li(t) {
|
|
319
|
-
const e = await js(t);
|
|
320
|
-
return await Zr(t).parseAsync(e);
|
|
321
|
-
}
|
|
322
|
-
var se = { exports: {} }, Pe, Jt;
|
|
323
|
-
function ge() {
|
|
324
|
-
if (Jt) return Pe;
|
|
325
|
-
Jt = 1;
|
|
326
|
-
const t = "2.0.0", e = 256, r = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
327
|
-
9007199254740991, s = 16, i = e - 6;
|
|
328
|
-
return Pe = {
|
|
329
|
-
MAX_LENGTH: e,
|
|
330
|
-
MAX_SAFE_COMPONENT_LENGTH: s,
|
|
331
|
-
MAX_SAFE_BUILD_LENGTH: i,
|
|
332
|
-
MAX_SAFE_INTEGER: r,
|
|
333
|
-
RELEASE_TYPES: [
|
|
334
|
-
"major",
|
|
335
|
-
"premajor",
|
|
336
|
-
"minor",
|
|
337
|
-
"preminor",
|
|
338
|
-
"patch",
|
|
339
|
-
"prepatch",
|
|
340
|
-
"prerelease"
|
|
341
|
-
],
|
|
342
|
-
SEMVER_SPEC_VERSION: t,
|
|
343
|
-
FLAG_INCLUDE_PRERELEASE: 1,
|
|
344
|
-
FLAG_LOOSE: 2
|
|
345
|
-
}, Pe;
|
|
346
|
-
}
|
|
347
|
-
var Ie, Wt;
|
|
348
|
-
function de() {
|
|
349
|
-
return Wt || (Wt = 1, Ie = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...e) => console.error("SEMVER", ...e) : () => {
|
|
350
|
-
}), Ie;
|
|
351
|
-
}
|
|
352
|
-
var Ht;
|
|
353
|
-
function re() {
|
|
354
|
-
return Ht || (Ht = 1, function(t, e) {
|
|
355
|
-
const {
|
|
356
|
-
MAX_SAFE_COMPONENT_LENGTH: r,
|
|
357
|
-
MAX_SAFE_BUILD_LENGTH: s,
|
|
358
|
-
MAX_LENGTH: i
|
|
359
|
-
} = ge(), l = de();
|
|
360
|
-
e = t.exports = {};
|
|
361
|
-
const a = e.re = [], h = e.safeRe = [], c = e.src = [], o = e.safeSrc = [], n = e.t = {};
|
|
362
|
-
let f = 0;
|
|
363
|
-
const u = "[a-zA-Z0-9-]", g = [
|
|
364
|
-
["\\s", 1],
|
|
365
|
-
["\\d", i],
|
|
366
|
-
[u, s]
|
|
367
|
-
], m = (S) => {
|
|
368
|
-
for (const [P, w] of g)
|
|
369
|
-
S = S.split(`${P}*`).join(`${P}{0,${w}}`).split(`${P}+`).join(`${P}{1,${w}}`);
|
|
370
|
-
return S;
|
|
371
|
-
}, p = (S, P, w) => {
|
|
372
|
-
const R = m(P), T = f++;
|
|
373
|
-
l(S, T, P), n[S] = T, c[T] = P, o[T] = R, a[T] = new RegExp(P, w ? "g" : void 0), h[T] = new RegExp(R, w ? "g" : void 0);
|
|
374
|
-
};
|
|
375
|
-
p("NUMERICIDENTIFIER", "0|[1-9]\\d*"), p("NUMERICIDENTIFIERLOOSE", "\\d+"), p("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${u}*`), p("MAINVERSION", `(${c[n.NUMERICIDENTIFIER]})\\.(${c[n.NUMERICIDENTIFIER]})\\.(${c[n.NUMERICIDENTIFIER]})`), p("MAINVERSIONLOOSE", `(${c[n.NUMERICIDENTIFIERLOOSE]})\\.(${c[n.NUMERICIDENTIFIERLOOSE]})\\.(${c[n.NUMERICIDENTIFIERLOOSE]})`), p("PRERELEASEIDENTIFIER", `(?:${c[n.NONNUMERICIDENTIFIER]}|${c[n.NUMERICIDENTIFIER]})`), p("PRERELEASEIDENTIFIERLOOSE", `(?:${c[n.NONNUMERICIDENTIFIER]}|${c[n.NUMERICIDENTIFIERLOOSE]})`), p("PRERELEASE", `(?:-(${c[n.PRERELEASEIDENTIFIER]}(?:\\.${c[n.PRERELEASEIDENTIFIER]})*))`), p("PRERELEASELOOSE", `(?:-?(${c[n.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[n.PRERELEASEIDENTIFIERLOOSE]})*))`), p("BUILDIDENTIFIER", `${u}+`), p("BUILD", `(?:\\+(${c[n.BUILDIDENTIFIER]}(?:\\.${c[n.BUILDIDENTIFIER]})*))`), p("FULLPLAIN", `v?${c[n.MAINVERSION]}${c[n.PRERELEASE]}?${c[n.BUILD]}?`), p("FULL", `^${c[n.FULLPLAIN]}$`), p("LOOSEPLAIN", `[v=\\s]*${c[n.MAINVERSIONLOOSE]}${c[n.PRERELEASELOOSE]}?${c[n.BUILD]}?`), p("LOOSE", `^${c[n.LOOSEPLAIN]}$`), p("GTLT", "((?:<|>)?=?)"), p("XRANGEIDENTIFIERLOOSE", `${c[n.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), p("XRANGEIDENTIFIER", `${c[n.NUMERICIDENTIFIER]}|x|X|\\*`), p("XRANGEPLAIN", `[v=\\s]*(${c[n.XRANGEIDENTIFIER]})(?:\\.(${c[n.XRANGEIDENTIFIER]})(?:\\.(${c[n.XRANGEIDENTIFIER]})(?:${c[n.PRERELEASE]})?${c[n.BUILD]}?)?)?`), p("XRANGEPLAINLOOSE", `[v=\\s]*(${c[n.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[n.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[n.XRANGEIDENTIFIERLOOSE]})(?:${c[n.PRERELEASELOOSE]})?${c[n.BUILD]}?)?)?`), p("XRANGE", `^${c[n.GTLT]}\\s*${c[n.XRANGEPLAIN]}$`), p("XRANGELOOSE", `^${c[n.GTLT]}\\s*${c[n.XRANGEPLAINLOOSE]}$`), p("COERCEPLAIN", `(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`), p("COERCE", `${c[n.COERCEPLAIN]}(?:$|[^\\d])`), p("COERCEFULL", c[n.COERCEPLAIN] + `(?:${c[n.PRERELEASE]})?(?:${c[n.BUILD]})?(?:$|[^\\d])`), p("COERCERTL", c[n.COERCE], !0), p("COERCERTLFULL", c[n.COERCEFULL], !0), p("LONETILDE", "(?:~>?)"), p("TILDETRIM", `(\\s*)${c[n.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", p("TILDE", `^${c[n.LONETILDE]}${c[n.XRANGEPLAIN]}$`), p("TILDELOOSE", `^${c[n.LONETILDE]}${c[n.XRANGEPLAINLOOSE]}$`), p("LONECARET", "(?:\\^)"), p("CARETTRIM", `(\\s*)${c[n.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", p("CARET", `^${c[n.LONECARET]}${c[n.XRANGEPLAIN]}$`), p("CARETLOOSE", `^${c[n.LONECARET]}${c[n.XRANGEPLAINLOOSE]}$`), p("COMPARATORLOOSE", `^${c[n.GTLT]}\\s*(${c[n.LOOSEPLAIN]})$|^$`), p("COMPARATOR", `^${c[n.GTLT]}\\s*(${c[n.FULLPLAIN]})$|^$`), p("COMPARATORTRIM", `(\\s*)${c[n.GTLT]}\\s*(${c[n.LOOSEPLAIN]}|${c[n.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", p("HYPHENRANGE", `^\\s*(${c[n.XRANGEPLAIN]})\\s+-\\s+(${c[n.XRANGEPLAIN]})\\s*$`), p("HYPHENRANGELOOSE", `^\\s*(${c[n.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[n.XRANGEPLAINLOOSE]})\\s*$`), p("STAR", "(<|>)?=?\\s*\\*"), p("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), p("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
376
|
-
}(se, se.exports)), se.exports;
|
|
377
|
-
}
|
|
378
|
-
var Ne, Yt;
|
|
379
|
-
function bt() {
|
|
380
|
-
if (Yt) return Ne;
|
|
381
|
-
Yt = 1;
|
|
382
|
-
const t = Object.freeze({ loose: !0 }), e = Object.freeze({});
|
|
383
|
-
return Ne = (s) => s ? typeof s != "object" ? t : s : e, Ne;
|
|
384
|
-
}
|
|
385
|
-
var ke, Zt;
|
|
386
|
-
function Qr() {
|
|
387
|
-
if (Zt) return ke;
|
|
388
|
-
Zt = 1;
|
|
389
|
-
const t = /^[0-9]+$/, e = (s, i) => {
|
|
390
|
-
const l = t.test(s), a = t.test(i);
|
|
391
|
-
return l && a && (s = +s, i = +i), s === i ? 0 : l && !a ? -1 : a && !l ? 1 : s < i ? -1 : 1;
|
|
392
|
-
};
|
|
393
|
-
return ke = {
|
|
394
|
-
compareIdentifiers: e,
|
|
395
|
-
rcompareIdentifiers: (s, i) => e(i, s)
|
|
396
|
-
}, ke;
|
|
397
|
-
}
|
|
398
|
-
var Le, Kt;
|
|
399
|
-
function G() {
|
|
400
|
-
if (Kt) return Le;
|
|
401
|
-
Kt = 1;
|
|
402
|
-
const t = de(), { MAX_LENGTH: e, MAX_SAFE_INTEGER: r } = ge(), { safeRe: s, t: i } = re(), l = bt(), { compareIdentifiers: a } = Qr();
|
|
403
|
-
class h {
|
|
404
|
-
constructor(o, n) {
|
|
405
|
-
if (n = l(n), o instanceof h) {
|
|
406
|
-
if (o.loose === !!n.loose && o.includePrerelease === !!n.includePrerelease)
|
|
407
|
-
return o;
|
|
408
|
-
o = o.version;
|
|
409
|
-
} else if (typeof o != "string")
|
|
410
|
-
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof o}".`);
|
|
411
|
-
if (o.length > e)
|
|
412
|
-
throw new TypeError(
|
|
413
|
-
`version is longer than ${e} characters`
|
|
414
|
-
);
|
|
415
|
-
t("SemVer", o, n), this.options = n, this.loose = !!n.loose, this.includePrerelease = !!n.includePrerelease;
|
|
416
|
-
const f = o.trim().match(n.loose ? s[i.LOOSE] : s[i.FULL]);
|
|
417
|
-
if (!f)
|
|
418
|
-
throw new TypeError(`Invalid Version: ${o}`);
|
|
419
|
-
if (this.raw = o, this.major = +f[1], this.minor = +f[2], this.patch = +f[3], this.major > r || this.major < 0)
|
|
420
|
-
throw new TypeError("Invalid major version");
|
|
421
|
-
if (this.minor > r || this.minor < 0)
|
|
422
|
-
throw new TypeError("Invalid minor version");
|
|
423
|
-
if (this.patch > r || this.patch < 0)
|
|
424
|
-
throw new TypeError("Invalid patch version");
|
|
425
|
-
f[4] ? this.prerelease = f[4].split(".").map((u) => {
|
|
426
|
-
if (/^[0-9]+$/.test(u)) {
|
|
427
|
-
const g = +u;
|
|
428
|
-
if (g >= 0 && g < r)
|
|
429
|
-
return g;
|
|
430
|
-
}
|
|
431
|
-
return u;
|
|
432
|
-
}) : this.prerelease = [], this.build = f[5] ? f[5].split(".") : [], this.format();
|
|
433
|
-
}
|
|
434
|
-
format() {
|
|
435
|
-
return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`), this.version;
|
|
436
|
-
}
|
|
437
|
-
toString() {
|
|
438
|
-
return this.version;
|
|
439
|
-
}
|
|
440
|
-
compare(o) {
|
|
441
|
-
if (t("SemVer.compare", this.version, this.options, o), !(o instanceof h)) {
|
|
442
|
-
if (typeof o == "string" && o === this.version)
|
|
443
|
-
return 0;
|
|
444
|
-
o = new h(o, this.options);
|
|
445
|
-
}
|
|
446
|
-
return o.version === this.version ? 0 : this.compareMain(o) || this.comparePre(o);
|
|
447
|
-
}
|
|
448
|
-
compareMain(o) {
|
|
449
|
-
return o instanceof h || (o = new h(o, this.options)), a(this.major, o.major) || a(this.minor, o.minor) || a(this.patch, o.patch);
|
|
450
|
-
}
|
|
451
|
-
comparePre(o) {
|
|
452
|
-
if (o instanceof h || (o = new h(o, this.options)), this.prerelease.length && !o.prerelease.length)
|
|
453
|
-
return -1;
|
|
454
|
-
if (!this.prerelease.length && o.prerelease.length)
|
|
455
|
-
return 1;
|
|
456
|
-
if (!this.prerelease.length && !o.prerelease.length)
|
|
457
|
-
return 0;
|
|
458
|
-
let n = 0;
|
|
459
|
-
do {
|
|
460
|
-
const f = this.prerelease[n], u = o.prerelease[n];
|
|
461
|
-
if (t("prerelease compare", n, f, u), f === void 0 && u === void 0)
|
|
462
|
-
return 0;
|
|
463
|
-
if (u === void 0)
|
|
464
|
-
return 1;
|
|
465
|
-
if (f === void 0)
|
|
466
|
-
return -1;
|
|
467
|
-
if (f === u)
|
|
468
|
-
continue;
|
|
469
|
-
return a(f, u);
|
|
470
|
-
} while (++n);
|
|
471
|
-
}
|
|
472
|
-
compareBuild(o) {
|
|
473
|
-
o instanceof h || (o = new h(o, this.options));
|
|
474
|
-
let n = 0;
|
|
475
|
-
do {
|
|
476
|
-
const f = this.build[n], u = o.build[n];
|
|
477
|
-
if (t("build compare", n, f, u), f === void 0 && u === void 0)
|
|
478
|
-
return 0;
|
|
479
|
-
if (u === void 0)
|
|
480
|
-
return 1;
|
|
481
|
-
if (f === void 0)
|
|
482
|
-
return -1;
|
|
483
|
-
if (f === u)
|
|
484
|
-
continue;
|
|
485
|
-
return a(f, u);
|
|
486
|
-
} while (++n);
|
|
487
|
-
}
|
|
488
|
-
// preminor will bump the version up to the next minor release, and immediately
|
|
489
|
-
// down to pre-release. premajor and prepatch work the same way.
|
|
490
|
-
inc(o, n, f) {
|
|
491
|
-
if (o.startsWith("pre")) {
|
|
492
|
-
if (!n && f === !1)
|
|
493
|
-
throw new Error("invalid increment argument: identifier is empty");
|
|
494
|
-
if (n) {
|
|
495
|
-
const u = `-${n}`.match(this.options.loose ? s[i.PRERELEASELOOSE] : s[i.PRERELEASE]);
|
|
496
|
-
if (!u || u[1] !== n)
|
|
497
|
-
throw new Error(`invalid identifier: ${n}`);
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
switch (o) {
|
|
501
|
-
case "premajor":
|
|
502
|
-
this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", n, f);
|
|
503
|
-
break;
|
|
504
|
-
case "preminor":
|
|
505
|
-
this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", n, f);
|
|
506
|
-
break;
|
|
507
|
-
case "prepatch":
|
|
508
|
-
this.prerelease.length = 0, this.inc("patch", n, f), this.inc("pre", n, f);
|
|
509
|
-
break;
|
|
510
|
-
// If the input is a non-prerelease version, this acts the same as
|
|
511
|
-
// prepatch.
|
|
512
|
-
case "prerelease":
|
|
513
|
-
this.prerelease.length === 0 && this.inc("patch", n, f), this.inc("pre", n, f);
|
|
514
|
-
break;
|
|
515
|
-
case "release":
|
|
516
|
-
if (this.prerelease.length === 0)
|
|
517
|
-
throw new Error(`version ${this.raw} is not a prerelease`);
|
|
518
|
-
this.prerelease.length = 0;
|
|
519
|
-
break;
|
|
520
|
-
case "major":
|
|
521
|
-
(this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
|
|
522
|
-
break;
|
|
523
|
-
case "minor":
|
|
524
|
-
(this.patch !== 0 || this.prerelease.length === 0) && this.minor++, this.patch = 0, this.prerelease = [];
|
|
525
|
-
break;
|
|
526
|
-
case "patch":
|
|
527
|
-
this.prerelease.length === 0 && this.patch++, this.prerelease = [];
|
|
528
|
-
break;
|
|
529
|
-
// This probably shouldn't be used publicly.
|
|
530
|
-
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
531
|
-
case "pre": {
|
|
532
|
-
const u = Number(f) ? 1 : 0;
|
|
533
|
-
if (this.prerelease.length === 0)
|
|
534
|
-
this.prerelease = [u];
|
|
535
|
-
else {
|
|
536
|
-
let g = this.prerelease.length;
|
|
537
|
-
for (; --g >= 0; )
|
|
538
|
-
typeof this.prerelease[g] == "number" && (this.prerelease[g]++, g = -2);
|
|
539
|
-
if (g === -1) {
|
|
540
|
-
if (n === this.prerelease.join(".") && f === !1)
|
|
541
|
-
throw new Error("invalid increment argument: identifier already exists");
|
|
542
|
-
this.prerelease.push(u);
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
if (n) {
|
|
546
|
-
let g = [n, u];
|
|
547
|
-
f === !1 && (g = [n]), a(this.prerelease[0], n) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = g) : this.prerelease = g;
|
|
548
|
-
}
|
|
549
|
-
break;
|
|
550
|
-
}
|
|
551
|
-
default:
|
|
552
|
-
throw new Error(`invalid increment argument: ${o}`);
|
|
553
|
-
}
|
|
554
|
-
return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
return Le = h, Le;
|
|
558
|
-
}
|
|
559
|
-
var Ce, Qt;
|
|
560
|
-
function H() {
|
|
561
|
-
if (Qt) return Ce;
|
|
562
|
-
Qt = 1;
|
|
563
|
-
const t = G();
|
|
564
|
-
return Ce = (r, s, i = !1) => {
|
|
565
|
-
if (r instanceof t)
|
|
566
|
-
return r;
|
|
567
|
-
try {
|
|
568
|
-
return new t(r, s);
|
|
569
|
-
} catch (l) {
|
|
570
|
-
if (!i)
|
|
571
|
-
return null;
|
|
572
|
-
throw l;
|
|
573
|
-
}
|
|
574
|
-
}, Ce;
|
|
575
|
-
}
|
|
576
|
-
var Te, er;
|
|
577
|
-
function Us() {
|
|
578
|
-
if (er) return Te;
|
|
579
|
-
er = 1;
|
|
580
|
-
const t = H();
|
|
581
|
-
return Te = (r, s) => {
|
|
582
|
-
const i = t(r, s);
|
|
583
|
-
return i ? i.version : null;
|
|
584
|
-
}, Te;
|
|
585
|
-
}
|
|
586
|
-
var Ae, tr;
|
|
587
|
-
function zs() {
|
|
588
|
-
if (tr) return Ae;
|
|
589
|
-
tr = 1;
|
|
590
|
-
const t = H();
|
|
591
|
-
return Ae = (r, s) => {
|
|
592
|
-
const i = t(r.trim().replace(/^[=v]+/, ""), s);
|
|
593
|
-
return i ? i.version : null;
|
|
594
|
-
}, Ae;
|
|
595
|
-
}
|
|
596
|
-
var Fe, rr;
|
|
597
|
-
function Vs() {
|
|
598
|
-
if (rr) return Fe;
|
|
599
|
-
rr = 1;
|
|
600
|
-
const t = G();
|
|
601
|
-
return Fe = (r, s, i, l, a) => {
|
|
602
|
-
typeof i == "string" && (a = l, l = i, i = void 0);
|
|
603
|
-
try {
|
|
604
|
-
return new t(
|
|
605
|
-
r instanceof t ? r.version : r,
|
|
606
|
-
i
|
|
607
|
-
).inc(s, l, a).version;
|
|
608
|
-
} catch {
|
|
609
|
-
return null;
|
|
610
|
-
}
|
|
611
|
-
}, Fe;
|
|
612
|
-
}
|
|
613
|
-
var be, sr;
|
|
614
|
-
function Ms() {
|
|
615
|
-
if (sr) return be;
|
|
616
|
-
sr = 1;
|
|
617
|
-
const t = H();
|
|
618
|
-
return be = (r, s) => {
|
|
619
|
-
const i = t(r, null, !0), l = t(s, null, !0), a = i.compare(l);
|
|
620
|
-
if (a === 0)
|
|
621
|
-
return null;
|
|
622
|
-
const h = a > 0, c = h ? i : l, o = h ? l : i, n = !!c.prerelease.length;
|
|
623
|
-
if (!!o.prerelease.length && !n) {
|
|
624
|
-
if (!o.patch && !o.minor)
|
|
625
|
-
return "major";
|
|
626
|
-
if (o.compareMain(c) === 0)
|
|
627
|
-
return o.minor && !o.patch ? "minor" : "patch";
|
|
628
|
-
}
|
|
629
|
-
const u = n ? "pre" : "";
|
|
630
|
-
return i.major !== l.major ? u + "major" : i.minor !== l.minor ? u + "minor" : i.patch !== l.patch ? u + "patch" : "prerelease";
|
|
631
|
-
}, be;
|
|
632
|
-
}
|
|
633
|
-
var qe, nr;
|
|
634
|
-
function Xs() {
|
|
635
|
-
if (nr) return qe;
|
|
636
|
-
nr = 1;
|
|
637
|
-
const t = G();
|
|
638
|
-
return qe = (r, s) => new t(r, s).major, qe;
|
|
639
|
-
}
|
|
640
|
-
var De, ir;
|
|
641
|
-
function Js() {
|
|
642
|
-
if (ir) return De;
|
|
643
|
-
ir = 1;
|
|
644
|
-
const t = G();
|
|
645
|
-
return De = (r, s) => new t(r, s).minor, De;
|
|
646
|
-
}
|
|
647
|
-
var Be, ar;
|
|
648
|
-
function Ws() {
|
|
649
|
-
if (ar) return Be;
|
|
650
|
-
ar = 1;
|
|
651
|
-
const t = G();
|
|
652
|
-
return Be = (r, s) => new t(r, s).patch, Be;
|
|
653
|
-
}
|
|
654
|
-
var _e, or;
|
|
655
|
-
function Hs() {
|
|
656
|
-
if (or) return _e;
|
|
657
|
-
or = 1;
|
|
658
|
-
const t = H();
|
|
659
|
-
return _e = (r, s) => {
|
|
660
|
-
const i = t(r, s);
|
|
661
|
-
return i && i.prerelease.length ? i.prerelease : null;
|
|
662
|
-
}, _e;
|
|
663
|
-
}
|
|
664
|
-
var Ge, cr;
|
|
665
|
-
function x() {
|
|
666
|
-
if (cr) return Ge;
|
|
667
|
-
cr = 1;
|
|
668
|
-
const t = G();
|
|
669
|
-
return Ge = (r, s, i) => new t(r, i).compare(new t(s, i)), Ge;
|
|
670
|
-
}
|
|
671
|
-
var xe, lr;
|
|
672
|
-
function Ys() {
|
|
673
|
-
if (lr) return xe;
|
|
674
|
-
lr = 1;
|
|
675
|
-
const t = x();
|
|
676
|
-
return xe = (r, s, i) => t(s, r, i), xe;
|
|
677
|
-
}
|
|
678
|
-
var je, fr;
|
|
679
|
-
function Zs() {
|
|
680
|
-
if (fr) return je;
|
|
681
|
-
fr = 1;
|
|
682
|
-
const t = x();
|
|
683
|
-
return je = (r, s) => t(r, s, !0), je;
|
|
684
|
-
}
|
|
685
|
-
var Ue, ur;
|
|
686
|
-
function qt() {
|
|
687
|
-
if (ur) return Ue;
|
|
688
|
-
ur = 1;
|
|
689
|
-
const t = G();
|
|
690
|
-
return Ue = (r, s, i) => {
|
|
691
|
-
const l = new t(r, i), a = new t(s, i);
|
|
692
|
-
return l.compare(a) || l.compareBuild(a);
|
|
693
|
-
}, Ue;
|
|
694
|
-
}
|
|
695
|
-
var ze, hr;
|
|
696
|
-
function Ks() {
|
|
697
|
-
if (hr) return ze;
|
|
698
|
-
hr = 1;
|
|
699
|
-
const t = qt();
|
|
700
|
-
return ze = (r, s) => r.sort((i, l) => t(i, l, s)), ze;
|
|
701
|
-
}
|
|
702
|
-
var Ve, pr;
|
|
703
|
-
function Qs() {
|
|
704
|
-
if (pr) return Ve;
|
|
705
|
-
pr = 1;
|
|
706
|
-
const t = qt();
|
|
707
|
-
return Ve = (r, s) => r.sort((i, l) => t(l, i, s)), Ve;
|
|
708
|
-
}
|
|
709
|
-
var Me, gr;
|
|
710
|
-
function me() {
|
|
711
|
-
if (gr) return Me;
|
|
712
|
-
gr = 1;
|
|
713
|
-
const t = x();
|
|
714
|
-
return Me = (r, s, i) => t(r, s, i) > 0, Me;
|
|
715
|
-
}
|
|
716
|
-
var Xe, dr;
|
|
717
|
-
function Dt() {
|
|
718
|
-
if (dr) return Xe;
|
|
719
|
-
dr = 1;
|
|
720
|
-
const t = x();
|
|
721
|
-
return Xe = (r, s, i) => t(r, s, i) < 0, Xe;
|
|
722
|
-
}
|
|
723
|
-
var Je, mr;
|
|
724
|
-
function es() {
|
|
725
|
-
if (mr) return Je;
|
|
726
|
-
mr = 1;
|
|
727
|
-
const t = x();
|
|
728
|
-
return Je = (r, s, i) => t(r, s, i) === 0, Je;
|
|
729
|
-
}
|
|
730
|
-
var We, vr;
|
|
731
|
-
function ts() {
|
|
732
|
-
if (vr) return We;
|
|
733
|
-
vr = 1;
|
|
734
|
-
const t = x();
|
|
735
|
-
return We = (r, s, i) => t(r, s, i) !== 0, We;
|
|
736
|
-
}
|
|
737
|
-
var He, Er;
|
|
738
|
-
function Bt() {
|
|
739
|
-
if (Er) return He;
|
|
740
|
-
Er = 1;
|
|
741
|
-
const t = x();
|
|
742
|
-
return He = (r, s, i) => t(r, s, i) >= 0, He;
|
|
743
|
-
}
|
|
744
|
-
var Ye, $r;
|
|
745
|
-
function _t() {
|
|
746
|
-
if ($r) return Ye;
|
|
747
|
-
$r = 1;
|
|
748
|
-
const t = x();
|
|
749
|
-
return Ye = (r, s, i) => t(r, s, i) <= 0, Ye;
|
|
750
|
-
}
|
|
751
|
-
var Ze, wr;
|
|
752
|
-
function rs() {
|
|
753
|
-
if (wr) return Ze;
|
|
754
|
-
wr = 1;
|
|
755
|
-
const t = es(), e = ts(), r = me(), s = Bt(), i = Dt(), l = _t();
|
|
756
|
-
return Ze = (h, c, o, n) => {
|
|
757
|
-
switch (c) {
|
|
758
|
-
case "===":
|
|
759
|
-
return typeof h == "object" && (h = h.version), typeof o == "object" && (o = o.version), h === o;
|
|
760
|
-
case "!==":
|
|
761
|
-
return typeof h == "object" && (h = h.version), typeof o == "object" && (o = o.version), h !== o;
|
|
762
|
-
case "":
|
|
763
|
-
case "=":
|
|
764
|
-
case "==":
|
|
765
|
-
return t(h, o, n);
|
|
766
|
-
case "!=":
|
|
767
|
-
return e(h, o, n);
|
|
768
|
-
case ">":
|
|
769
|
-
return r(h, o, n);
|
|
770
|
-
case ">=":
|
|
771
|
-
return s(h, o, n);
|
|
772
|
-
case "<":
|
|
773
|
-
return i(h, o, n);
|
|
774
|
-
case "<=":
|
|
775
|
-
return l(h, o, n);
|
|
776
|
-
default:
|
|
777
|
-
throw new TypeError(`Invalid operator: ${c}`);
|
|
778
|
-
}
|
|
779
|
-
}, Ze;
|
|
780
|
-
}
|
|
781
|
-
var Ke, Rr;
|
|
782
|
-
function en() {
|
|
783
|
-
if (Rr) return Ke;
|
|
784
|
-
Rr = 1;
|
|
785
|
-
const t = G(), e = H(), { safeRe: r, t: s } = re();
|
|
786
|
-
return Ke = (l, a) => {
|
|
787
|
-
if (l instanceof t)
|
|
788
|
-
return l;
|
|
789
|
-
if (typeof l == "number" && (l = String(l)), typeof l != "string")
|
|
790
|
-
return null;
|
|
791
|
-
a = a || {};
|
|
792
|
-
let h = null;
|
|
793
|
-
if (!a.rtl)
|
|
794
|
-
h = l.match(a.includePrerelease ? r[s.COERCEFULL] : r[s.COERCE]);
|
|
795
|
-
else {
|
|
796
|
-
const g = a.includePrerelease ? r[s.COERCERTLFULL] : r[s.COERCERTL];
|
|
797
|
-
let m;
|
|
798
|
-
for (; (m = g.exec(l)) && (!h || h.index + h[0].length !== l.length); )
|
|
799
|
-
(!h || m.index + m[0].length !== h.index + h[0].length) && (h = m), g.lastIndex = m.index + m[1].length + m[2].length;
|
|
800
|
-
g.lastIndex = -1;
|
|
801
|
-
}
|
|
802
|
-
if (h === null)
|
|
803
|
-
return null;
|
|
804
|
-
const c = h[2], o = h[3] || "0", n = h[4] || "0", f = a.includePrerelease && h[5] ? `-${h[5]}` : "", u = a.includePrerelease && h[6] ? `+${h[6]}` : "";
|
|
805
|
-
return e(`${c}.${o}.${n}${f}${u}`, a);
|
|
806
|
-
}, Ke;
|
|
807
|
-
}
|
|
808
|
-
var Qe, Sr;
|
|
809
|
-
function tn() {
|
|
810
|
-
if (Sr) return Qe;
|
|
811
|
-
Sr = 1;
|
|
812
|
-
class t {
|
|
813
|
-
constructor() {
|
|
814
|
-
this.max = 1e3, this.map = /* @__PURE__ */ new Map();
|
|
815
|
-
}
|
|
816
|
-
get(r) {
|
|
817
|
-
const s = this.map.get(r);
|
|
818
|
-
if (s !== void 0)
|
|
819
|
-
return this.map.delete(r), this.map.set(r, s), s;
|
|
820
|
-
}
|
|
821
|
-
delete(r) {
|
|
822
|
-
return this.map.delete(r);
|
|
823
|
-
}
|
|
824
|
-
set(r, s) {
|
|
825
|
-
if (!this.delete(r) && s !== void 0) {
|
|
826
|
-
if (this.map.size >= this.max) {
|
|
827
|
-
const l = this.map.keys().next().value;
|
|
828
|
-
this.delete(l);
|
|
829
|
-
}
|
|
830
|
-
this.map.set(r, s);
|
|
831
|
-
}
|
|
832
|
-
return this;
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
return Qe = t, Qe;
|
|
836
|
-
}
|
|
837
|
-
var et, yr;
|
|
838
|
-
function j() {
|
|
839
|
-
if (yr) return et;
|
|
840
|
-
yr = 1;
|
|
841
|
-
const t = /\s+/g;
|
|
842
|
-
class e {
|
|
843
|
-
constructor(d, y) {
|
|
844
|
-
if (y = i(y), d instanceof e)
|
|
845
|
-
return d.loose === !!y.loose && d.includePrerelease === !!y.includePrerelease ? d : new e(d.raw, y);
|
|
846
|
-
if (d instanceof l)
|
|
847
|
-
return this.raw = d.value, this.set = [[d]], this.formatted = void 0, this;
|
|
848
|
-
if (this.options = y, this.loose = !!y.loose, this.includePrerelease = !!y.includePrerelease, this.raw = d.trim().replace(t, " "), this.set = this.raw.split("||").map((E) => this.parseRange(E.trim())).filter((E) => E.length), !this.set.length)
|
|
849
|
-
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
850
|
-
if (this.set.length > 1) {
|
|
851
|
-
const E = this.set[0];
|
|
852
|
-
if (this.set = this.set.filter((O) => !p(O[0])), this.set.length === 0)
|
|
853
|
-
this.set = [E];
|
|
854
|
-
else if (this.set.length > 1) {
|
|
855
|
-
for (const O of this.set)
|
|
856
|
-
if (O.length === 1 && S(O[0])) {
|
|
857
|
-
this.set = [O];
|
|
858
|
-
break;
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
this.formatted = void 0;
|
|
863
|
-
}
|
|
864
|
-
get range() {
|
|
865
|
-
if (this.formatted === void 0) {
|
|
866
|
-
this.formatted = "";
|
|
867
|
-
for (let d = 0; d < this.set.length; d++) {
|
|
868
|
-
d > 0 && (this.formatted += "||");
|
|
869
|
-
const y = this.set[d];
|
|
870
|
-
for (let E = 0; E < y.length; E++)
|
|
871
|
-
E > 0 && (this.formatted += " "), this.formatted += y[E].toString().trim();
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
return this.formatted;
|
|
875
|
-
}
|
|
876
|
-
format() {
|
|
877
|
-
return this.range;
|
|
878
|
-
}
|
|
879
|
-
toString() {
|
|
880
|
-
return this.range;
|
|
881
|
-
}
|
|
882
|
-
parseRange(d) {
|
|
883
|
-
const E = ((this.options.includePrerelease && g) | (this.options.loose && m)) + ":" + d, O = s.get(E);
|
|
884
|
-
if (O)
|
|
885
|
-
return O;
|
|
886
|
-
const $ = this.options.loose, N = $ ? c[o.HYPHENRANGELOOSE] : c[o.HYPHENRANGE];
|
|
887
|
-
d = d.replace(N, Se(this.options.includePrerelease)), a("hyphen replace", d), d = d.replace(c[o.COMPARATORTRIM], n), a("comparator trim", d), d = d.replace(c[o.TILDETRIM], f), a("tilde trim", d), d = d.replace(c[o.CARETTRIM], u), a("caret trim", d);
|
|
888
|
-
let C = d.split(" ").map((D) => w(D, this.options)).join(" ").split(/\s+/).map((D) => Re(D, this.options));
|
|
889
|
-
$ && (C = C.filter((D) => (a("loose invalid filter", D, this.options), !!D.match(c[o.COMPARATORLOOSE])))), a("range list", C);
|
|
890
|
-
const k = /* @__PURE__ */ new Map(), F = C.map((D) => new l(D, this.options));
|
|
891
|
-
for (const D of F) {
|
|
892
|
-
if (p(D))
|
|
893
|
-
return [D];
|
|
894
|
-
k.set(D.value, D);
|
|
895
|
-
}
|
|
896
|
-
k.size > 1 && k.has("") && k.delete("");
|
|
897
|
-
const _ = [...k.values()];
|
|
898
|
-
return s.set(E, _), _;
|
|
899
|
-
}
|
|
900
|
-
intersects(d, y) {
|
|
901
|
-
if (!(d instanceof e))
|
|
902
|
-
throw new TypeError("a Range is required");
|
|
903
|
-
return this.set.some((E) => P(E, y) && d.set.some((O) => P(O, y) && E.every(($) => O.every((N) => $.intersects(N, y)))));
|
|
904
|
-
}
|
|
905
|
-
// if ANY of the sets match ALL of its comparators, then pass
|
|
906
|
-
test(d) {
|
|
907
|
-
if (!d)
|
|
908
|
-
return !1;
|
|
909
|
-
if (typeof d == "string")
|
|
910
|
-
try {
|
|
911
|
-
d = new h(d, this.options);
|
|
912
|
-
} catch {
|
|
913
|
-
return !1;
|
|
914
|
-
}
|
|
915
|
-
for (let y = 0; y < this.set.length; y++)
|
|
916
|
-
if (ye(this.set[y], d, this.options))
|
|
917
|
-
return !0;
|
|
918
|
-
return !1;
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
|
-
et = e;
|
|
922
|
-
const r = tn(), s = new r(), i = bt(), l = ve(), a = de(), h = G(), {
|
|
923
|
-
safeRe: c,
|
|
924
|
-
t: o,
|
|
925
|
-
comparatorTrimReplace: n,
|
|
926
|
-
tildeTrimReplace: f,
|
|
927
|
-
caretTrimReplace: u
|
|
928
|
-
} = re(), { FLAG_INCLUDE_PRERELEASE: g, FLAG_LOOSE: m } = ge(), p = (v) => v.value === "<0.0.0-0", S = (v) => v.value === "", P = (v, d) => {
|
|
929
|
-
let y = !0;
|
|
930
|
-
const E = v.slice();
|
|
931
|
-
let O = E.pop();
|
|
932
|
-
for (; y && E.length; )
|
|
933
|
-
y = E.every(($) => O.intersects($, d)), O = E.pop();
|
|
934
|
-
return y;
|
|
935
|
-
}, w = (v, d) => (a("comp", v, d), v = A(v, d), a("caret", v), v = T(v, d), a("tildes", v), v = I(v, d), a("xrange", v), v = we(v, d), a("stars", v), v), R = (v) => !v || v.toLowerCase() === "x" || v === "*", T = (v, d) => v.trim().split(/\s+/).map((y) => b(y, d)).join(" "), b = (v, d) => {
|
|
936
|
-
const y = d.loose ? c[o.TILDELOOSE] : c[o.TILDE];
|
|
937
|
-
return v.replace(y, (E, O, $, N, C) => {
|
|
938
|
-
a("tilde", v, E, O, $, N, C);
|
|
939
|
-
let k;
|
|
940
|
-
return R(O) ? k = "" : R($) ? k = `>=${O}.0.0 <${+O + 1}.0.0-0` : R(N) ? k = `>=${O}.${$}.0 <${O}.${+$ + 1}.0-0` : C ? (a("replaceTilde pr", C), k = `>=${O}.${$}.${N}-${C} <${O}.${+$ + 1}.0-0`) : k = `>=${O}.${$}.${N} <${O}.${+$ + 1}.0-0`, a("tilde return", k), k;
|
|
941
|
-
});
|
|
942
|
-
}, A = (v, d) => v.trim().split(/\s+/).map((y) => q(y, d)).join(" "), q = (v, d) => {
|
|
943
|
-
a("caret", v, d);
|
|
944
|
-
const y = d.loose ? c[o.CARETLOOSE] : c[o.CARET], E = d.includePrerelease ? "-0" : "";
|
|
945
|
-
return v.replace(y, (O, $, N, C, k) => {
|
|
946
|
-
a("caret", v, O, $, N, C, k);
|
|
947
|
-
let F;
|
|
948
|
-
return R($) ? F = "" : R(N) ? F = `>=${$}.0.0${E} <${+$ + 1}.0.0-0` : R(C) ? $ === "0" ? F = `>=${$}.${N}.0${E} <${$}.${+N + 1}.0-0` : F = `>=${$}.${N}.0${E} <${+$ + 1}.0.0-0` : k ? (a("replaceCaret pr", k), $ === "0" ? N === "0" ? F = `>=${$}.${N}.${C}-${k} <${$}.${N}.${+C + 1}-0` : F = `>=${$}.${N}.${C}-${k} <${$}.${+N + 1}.0-0` : F = `>=${$}.${N}.${C}-${k} <${+$ + 1}.0.0-0`) : (a("no pr"), $ === "0" ? N === "0" ? F = `>=${$}.${N}.${C}${E} <${$}.${N}.${+C + 1}-0` : F = `>=${$}.${N}.${C}${E} <${$}.${+N + 1}.0-0` : F = `>=${$}.${N}.${C} <${+$ + 1}.0.0-0`), a("caret return", F), F;
|
|
949
|
-
});
|
|
950
|
-
}, I = (v, d) => (a("replaceXRanges", v, d), v.split(/\s+/).map((y) => Z(y, d)).join(" ")), Z = (v, d) => {
|
|
951
|
-
v = v.trim();
|
|
952
|
-
const y = d.loose ? c[o.XRANGELOOSE] : c[o.XRANGE];
|
|
953
|
-
return v.replace(y, (E, O, $, N, C, k) => {
|
|
954
|
-
a("xRange", v, E, O, $, N, C, k);
|
|
955
|
-
const F = R($), _ = F || R(N), D = _ || R(C), K = D;
|
|
956
|
-
return O === "=" && K && (O = ""), k = d.includePrerelease ? "-0" : "", F ? O === ">" || O === "<" ? E = "<0.0.0-0" : E = "*" : O && K ? (_ && (N = 0), C = 0, O === ">" ? (O = ">=", _ ? ($ = +$ + 1, N = 0, C = 0) : (N = +N + 1, C = 0)) : O === "<=" && (O = "<", _ ? $ = +$ + 1 : N = +N + 1), O === "<" && (k = "-0"), E = `${O + $}.${N}.${C}${k}`) : _ ? E = `>=${$}.0.0${k} <${+$ + 1}.0.0-0` : D && (E = `>=${$}.${N}.0${k} <${$}.${+N + 1}.0-0`), a("xRange return", E), E;
|
|
957
|
-
});
|
|
958
|
-
}, we = (v, d) => (a("replaceStars", v, d), v.trim().replace(c[o.STAR], "")), Re = (v, d) => (a("replaceGTE0", v, d), v.trim().replace(c[d.includePrerelease ? o.GTE0PRE : o.GTE0], "")), Se = (v) => (d, y, E, O, $, N, C, k, F, _, D, K) => (R(E) ? y = "" : R(O) ? y = `>=${E}.0.0${v ? "-0" : ""}` : R($) ? y = `>=${E}.${O}.0${v ? "-0" : ""}` : N ? y = `>=${y}` : y = `>=${y}${v ? "-0" : ""}`, R(F) ? k = "" : R(_) ? k = `<${+F + 1}.0.0-0` : R(D) ? k = `<${F}.${+_ + 1}.0-0` : K ? k = `<=${F}.${_}.${D}-${K}` : v ? k = `<${F}.${_}.${+D + 1}-0` : k = `<=${k}`, `${y} ${k}`.trim()), ye = (v, d, y) => {
|
|
959
|
-
for (let E = 0; E < v.length; E++)
|
|
960
|
-
if (!v[E].test(d))
|
|
961
|
-
return !1;
|
|
962
|
-
if (d.prerelease.length && !y.includePrerelease) {
|
|
963
|
-
for (let E = 0; E < v.length; E++)
|
|
964
|
-
if (a(v[E].semver), v[E].semver !== l.ANY && v[E].semver.prerelease.length > 0) {
|
|
965
|
-
const O = v[E].semver;
|
|
966
|
-
if (O.major === d.major && O.minor === d.minor && O.patch === d.patch)
|
|
967
|
-
return !0;
|
|
968
|
-
}
|
|
969
|
-
return !1;
|
|
970
|
-
}
|
|
971
|
-
return !0;
|
|
972
|
-
};
|
|
973
|
-
return et;
|
|
974
|
-
}
|
|
975
|
-
var tt, Or;
|
|
976
|
-
function ve() {
|
|
977
|
-
if (Or) return tt;
|
|
978
|
-
Or = 1;
|
|
979
|
-
const t = Symbol("SemVer ANY");
|
|
980
|
-
class e {
|
|
981
|
-
static get ANY() {
|
|
982
|
-
return t;
|
|
983
|
-
}
|
|
984
|
-
constructor(n, f) {
|
|
985
|
-
if (f = r(f), n instanceof e) {
|
|
986
|
-
if (n.loose === !!f.loose)
|
|
987
|
-
return n;
|
|
988
|
-
n = n.value;
|
|
989
|
-
}
|
|
990
|
-
n = n.trim().split(/\s+/).join(" "), a("comparator", n, f), this.options = f, this.loose = !!f.loose, this.parse(n), this.semver === t ? this.value = "" : this.value = this.operator + this.semver.version, a("comp", this);
|
|
991
|
-
}
|
|
992
|
-
parse(n) {
|
|
993
|
-
const f = this.options.loose ? s[i.COMPARATORLOOSE] : s[i.COMPARATOR], u = n.match(f);
|
|
994
|
-
if (!u)
|
|
995
|
-
throw new TypeError(`Invalid comparator: ${n}`);
|
|
996
|
-
this.operator = u[1] !== void 0 ? u[1] : "", this.operator === "=" && (this.operator = ""), u[2] ? this.semver = new h(u[2], this.options.loose) : this.semver = t;
|
|
997
|
-
}
|
|
998
|
-
toString() {
|
|
999
|
-
return this.value;
|
|
1000
|
-
}
|
|
1001
|
-
test(n) {
|
|
1002
|
-
if (a("Comparator.test", n, this.options.loose), this.semver === t || n === t)
|
|
1003
|
-
return !0;
|
|
1004
|
-
if (typeof n == "string")
|
|
1005
|
-
try {
|
|
1006
|
-
n = new h(n, this.options);
|
|
1007
|
-
} catch {
|
|
1008
|
-
return !1;
|
|
1009
|
-
}
|
|
1010
|
-
return l(n, this.operator, this.semver, this.options);
|
|
1011
|
-
}
|
|
1012
|
-
intersects(n, f) {
|
|
1013
|
-
if (!(n instanceof e))
|
|
1014
|
-
throw new TypeError("a Comparator is required");
|
|
1015
|
-
return this.operator === "" ? this.value === "" ? !0 : new c(n.value, f).test(this.value) : n.operator === "" ? n.value === "" ? !0 : new c(this.value, f).test(n.semver) : (f = r(f), f.includePrerelease && (this.value === "<0.0.0-0" || n.value === "<0.0.0-0") || !f.includePrerelease && (this.value.startsWith("<0.0.0") || n.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && n.operator.startsWith(">") || this.operator.startsWith("<") && n.operator.startsWith("<") || this.semver.version === n.semver.version && this.operator.includes("=") && n.operator.includes("=") || l(this.semver, "<", n.semver, f) && this.operator.startsWith(">") && n.operator.startsWith("<") || l(this.semver, ">", n.semver, f) && this.operator.startsWith("<") && n.operator.startsWith(">")));
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
tt = e;
|
|
1019
|
-
const r = bt(), { safeRe: s, t: i } = re(), l = rs(), a = de(), h = G(), c = j();
|
|
1020
|
-
return tt;
|
|
1021
|
-
}
|
|
1022
|
-
var rt, Pr;
|
|
1023
|
-
function Ee() {
|
|
1024
|
-
if (Pr) return rt;
|
|
1025
|
-
Pr = 1;
|
|
1026
|
-
const t = j();
|
|
1027
|
-
return rt = (r, s, i) => {
|
|
1028
|
-
try {
|
|
1029
|
-
s = new t(s, i);
|
|
1030
|
-
} catch {
|
|
1031
|
-
return !1;
|
|
1032
|
-
}
|
|
1033
|
-
return s.test(r);
|
|
1034
|
-
}, rt;
|
|
1035
|
-
}
|
|
1036
|
-
var st, Ir;
|
|
1037
|
-
function rn() {
|
|
1038
|
-
if (Ir) return st;
|
|
1039
|
-
Ir = 1;
|
|
1040
|
-
const t = j();
|
|
1041
|
-
return st = (r, s) => new t(r, s).set.map((i) => i.map((l) => l.value).join(" ").trim().split(" ")), st;
|
|
1042
|
-
}
|
|
1043
|
-
var nt, Nr;
|
|
1044
|
-
function sn() {
|
|
1045
|
-
if (Nr) return nt;
|
|
1046
|
-
Nr = 1;
|
|
1047
|
-
const t = G(), e = j();
|
|
1048
|
-
return nt = (s, i, l) => {
|
|
1049
|
-
let a = null, h = null, c = null;
|
|
1050
|
-
try {
|
|
1051
|
-
c = new e(i, l);
|
|
1052
|
-
} catch {
|
|
1053
|
-
return null;
|
|
1054
|
-
}
|
|
1055
|
-
return s.forEach((o) => {
|
|
1056
|
-
c.test(o) && (!a || h.compare(o) === -1) && (a = o, h = new t(a, l));
|
|
1057
|
-
}), a;
|
|
1058
|
-
}, nt;
|
|
1059
|
-
}
|
|
1060
|
-
var it, kr;
|
|
1061
|
-
function nn() {
|
|
1062
|
-
if (kr) return it;
|
|
1063
|
-
kr = 1;
|
|
1064
|
-
const t = G(), e = j();
|
|
1065
|
-
return it = (s, i, l) => {
|
|
1066
|
-
let a = null, h = null, c = null;
|
|
1067
|
-
try {
|
|
1068
|
-
c = new e(i, l);
|
|
1069
|
-
} catch {
|
|
1070
|
-
return null;
|
|
1071
|
-
}
|
|
1072
|
-
return s.forEach((o) => {
|
|
1073
|
-
c.test(o) && (!a || h.compare(o) === 1) && (a = o, h = new t(a, l));
|
|
1074
|
-
}), a;
|
|
1075
|
-
}, it;
|
|
1076
|
-
}
|
|
1077
|
-
var at, Lr;
|
|
1078
|
-
function an() {
|
|
1079
|
-
if (Lr) return at;
|
|
1080
|
-
Lr = 1;
|
|
1081
|
-
const t = G(), e = j(), r = me();
|
|
1082
|
-
return at = (i, l) => {
|
|
1083
|
-
i = new e(i, l);
|
|
1084
|
-
let a = new t("0.0.0");
|
|
1085
|
-
if (i.test(a) || (a = new t("0.0.0-0"), i.test(a)))
|
|
1086
|
-
return a;
|
|
1087
|
-
a = null;
|
|
1088
|
-
for (let h = 0; h < i.set.length; ++h) {
|
|
1089
|
-
const c = i.set[h];
|
|
1090
|
-
let o = null;
|
|
1091
|
-
c.forEach((n) => {
|
|
1092
|
-
const f = new t(n.semver.version);
|
|
1093
|
-
switch (n.operator) {
|
|
1094
|
-
case ">":
|
|
1095
|
-
f.prerelease.length === 0 ? f.patch++ : f.prerelease.push(0), f.raw = f.format();
|
|
1096
|
-
/* fallthrough */
|
|
1097
|
-
case "":
|
|
1098
|
-
case ">=":
|
|
1099
|
-
(!o || r(f, o)) && (o = f);
|
|
1100
|
-
break;
|
|
1101
|
-
case "<":
|
|
1102
|
-
case "<=":
|
|
1103
|
-
break;
|
|
1104
|
-
/* istanbul ignore next */
|
|
1105
|
-
default:
|
|
1106
|
-
throw new Error(`Unexpected operation: ${n.operator}`);
|
|
1107
|
-
}
|
|
1108
|
-
}), o && (!a || r(a, o)) && (a = o);
|
|
1109
|
-
}
|
|
1110
|
-
return a && i.test(a) ? a : null;
|
|
1111
|
-
}, at;
|
|
1112
|
-
}
|
|
1113
|
-
var ot, Cr;
|
|
1114
|
-
function on() {
|
|
1115
|
-
if (Cr) return ot;
|
|
1116
|
-
Cr = 1;
|
|
1117
|
-
const t = j();
|
|
1118
|
-
return ot = (r, s) => {
|
|
1119
|
-
try {
|
|
1120
|
-
return new t(r, s).range || "*";
|
|
1121
|
-
} catch {
|
|
1122
|
-
return null;
|
|
1123
|
-
}
|
|
1124
|
-
}, ot;
|
|
1125
|
-
}
|
|
1126
|
-
var ct, Tr;
|
|
1127
|
-
function Gt() {
|
|
1128
|
-
if (Tr) return ct;
|
|
1129
|
-
Tr = 1;
|
|
1130
|
-
const t = G(), e = ve(), { ANY: r } = e, s = j(), i = Ee(), l = me(), a = Dt(), h = _t(), c = Bt();
|
|
1131
|
-
return ct = (n, f, u, g) => {
|
|
1132
|
-
n = new t(n, g), f = new s(f, g);
|
|
1133
|
-
let m, p, S, P, w;
|
|
1134
|
-
switch (u) {
|
|
1135
|
-
case ">":
|
|
1136
|
-
m = l, p = h, S = a, P = ">", w = ">=";
|
|
1137
|
-
break;
|
|
1138
|
-
case "<":
|
|
1139
|
-
m = a, p = c, S = l, P = "<", w = "<=";
|
|
1140
|
-
break;
|
|
1141
|
-
default:
|
|
1142
|
-
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
1143
|
-
}
|
|
1144
|
-
if (i(n, f, g))
|
|
1145
|
-
return !1;
|
|
1146
|
-
for (let R = 0; R < f.set.length; ++R) {
|
|
1147
|
-
const T = f.set[R];
|
|
1148
|
-
let b = null, A = null;
|
|
1149
|
-
if (T.forEach((q) => {
|
|
1150
|
-
q.semver === r && (q = new e(">=0.0.0")), b = b || q, A = A || q, m(q.semver, b.semver, g) ? b = q : S(q.semver, A.semver, g) && (A = q);
|
|
1151
|
-
}), b.operator === P || b.operator === w || (!A.operator || A.operator === P) && p(n, A.semver))
|
|
1152
|
-
return !1;
|
|
1153
|
-
if (A.operator === w && S(n, A.semver))
|
|
1154
|
-
return !1;
|
|
1155
|
-
}
|
|
1156
|
-
return !0;
|
|
1157
|
-
}, ct;
|
|
1158
|
-
}
|
|
1159
|
-
var lt, Ar;
|
|
1160
|
-
function cn() {
|
|
1161
|
-
if (Ar) return lt;
|
|
1162
|
-
Ar = 1;
|
|
1163
|
-
const t = Gt();
|
|
1164
|
-
return lt = (r, s, i) => t(r, s, ">", i), lt;
|
|
1165
|
-
}
|
|
1166
|
-
var ft, Fr;
|
|
1167
|
-
function ln() {
|
|
1168
|
-
if (Fr) return ft;
|
|
1169
|
-
Fr = 1;
|
|
1170
|
-
const t = Gt();
|
|
1171
|
-
return ft = (r, s, i) => t(r, s, "<", i), ft;
|
|
1172
|
-
}
|
|
1173
|
-
var ut, br;
|
|
1174
|
-
function fn() {
|
|
1175
|
-
if (br) return ut;
|
|
1176
|
-
br = 1;
|
|
1177
|
-
const t = j();
|
|
1178
|
-
return ut = (r, s, i) => (r = new t(r, i), s = new t(s, i), r.intersects(s, i)), ut;
|
|
1179
|
-
}
|
|
1180
|
-
var ht, qr;
|
|
1181
|
-
function un() {
|
|
1182
|
-
if (qr) return ht;
|
|
1183
|
-
qr = 1;
|
|
1184
|
-
const t = Ee(), e = x();
|
|
1185
|
-
return ht = (r, s, i) => {
|
|
1186
|
-
const l = [];
|
|
1187
|
-
let a = null, h = null;
|
|
1188
|
-
const c = r.sort((u, g) => e(u, g, i));
|
|
1189
|
-
for (const u of c)
|
|
1190
|
-
t(u, s, i) ? (h = u, a || (a = u)) : (h && l.push([a, h]), h = null, a = null);
|
|
1191
|
-
a && l.push([a, null]);
|
|
1192
|
-
const o = [];
|
|
1193
|
-
for (const [u, g] of l)
|
|
1194
|
-
u === g ? o.push(u) : !g && u === c[0] ? o.push("*") : g ? u === c[0] ? o.push(`<=${g}`) : o.push(`${u} - ${g}`) : o.push(`>=${u}`);
|
|
1195
|
-
const n = o.join(" || "), f = typeof s.raw == "string" ? s.raw : String(s);
|
|
1196
|
-
return n.length < f.length ? n : s;
|
|
1197
|
-
}, ht;
|
|
1198
|
-
}
|
|
1199
|
-
var pt, Dr;
|
|
1200
|
-
function hn() {
|
|
1201
|
-
if (Dr) return pt;
|
|
1202
|
-
Dr = 1;
|
|
1203
|
-
const t = j(), e = ve(), { ANY: r } = e, s = Ee(), i = x(), l = (f, u, g = {}) => {
|
|
1204
|
-
if (f === u)
|
|
1205
|
-
return !0;
|
|
1206
|
-
f = new t(f, g), u = new t(u, g);
|
|
1207
|
-
let m = !1;
|
|
1208
|
-
e: for (const p of f.set) {
|
|
1209
|
-
for (const S of u.set) {
|
|
1210
|
-
const P = c(p, S, g);
|
|
1211
|
-
if (m = m || P !== null, P)
|
|
1212
|
-
continue e;
|
|
1213
|
-
}
|
|
1214
|
-
if (m)
|
|
1215
|
-
return !1;
|
|
1216
|
-
}
|
|
1217
|
-
return !0;
|
|
1218
|
-
}, a = [new e(">=0.0.0-0")], h = [new e(">=0.0.0")], c = (f, u, g) => {
|
|
1219
|
-
if (f === u)
|
|
1220
|
-
return !0;
|
|
1221
|
-
if (f.length === 1 && f[0].semver === r) {
|
|
1222
|
-
if (u.length === 1 && u[0].semver === r)
|
|
1223
|
-
return !0;
|
|
1224
|
-
g.includePrerelease ? f = a : f = h;
|
|
1225
|
-
}
|
|
1226
|
-
if (u.length === 1 && u[0].semver === r) {
|
|
1227
|
-
if (g.includePrerelease)
|
|
1228
|
-
return !0;
|
|
1229
|
-
u = h;
|
|
1230
|
-
}
|
|
1231
|
-
const m = /* @__PURE__ */ new Set();
|
|
1232
|
-
let p, S;
|
|
1233
|
-
for (const I of f)
|
|
1234
|
-
I.operator === ">" || I.operator === ">=" ? p = o(p, I, g) : I.operator === "<" || I.operator === "<=" ? S = n(S, I, g) : m.add(I.semver);
|
|
1235
|
-
if (m.size > 1)
|
|
1236
|
-
return null;
|
|
1237
|
-
let P;
|
|
1238
|
-
if (p && S) {
|
|
1239
|
-
if (P = i(p.semver, S.semver, g), P > 0)
|
|
1240
|
-
return null;
|
|
1241
|
-
if (P === 0 && (p.operator !== ">=" || S.operator !== "<="))
|
|
1242
|
-
return null;
|
|
1243
|
-
}
|
|
1244
|
-
for (const I of m) {
|
|
1245
|
-
if (p && !s(I, String(p), g) || S && !s(I, String(S), g))
|
|
1246
|
-
return null;
|
|
1247
|
-
for (const Z of u)
|
|
1248
|
-
if (!s(I, String(Z), g))
|
|
1249
|
-
return !1;
|
|
1250
|
-
return !0;
|
|
1251
|
-
}
|
|
1252
|
-
let w, R, T, b, A = S && !g.includePrerelease && S.semver.prerelease.length ? S.semver : !1, q = p && !g.includePrerelease && p.semver.prerelease.length ? p.semver : !1;
|
|
1253
|
-
A && A.prerelease.length === 1 && S.operator === "<" && A.prerelease[0] === 0 && (A = !1);
|
|
1254
|
-
for (const I of u) {
|
|
1255
|
-
if (b = b || I.operator === ">" || I.operator === ">=", T = T || I.operator === "<" || I.operator === "<=", p) {
|
|
1256
|
-
if (q && I.semver.prerelease && I.semver.prerelease.length && I.semver.major === q.major && I.semver.minor === q.minor && I.semver.patch === q.patch && (q = !1), I.operator === ">" || I.operator === ">=") {
|
|
1257
|
-
if (w = o(p, I, g), w === I && w !== p)
|
|
1258
|
-
return !1;
|
|
1259
|
-
} else if (p.operator === ">=" && !s(p.semver, String(I), g))
|
|
1260
|
-
return !1;
|
|
1261
|
-
}
|
|
1262
|
-
if (S) {
|
|
1263
|
-
if (A && I.semver.prerelease && I.semver.prerelease.length && I.semver.major === A.major && I.semver.minor === A.minor && I.semver.patch === A.patch && (A = !1), I.operator === "<" || I.operator === "<=") {
|
|
1264
|
-
if (R = n(S, I, g), R === I && R !== S)
|
|
1265
|
-
return !1;
|
|
1266
|
-
} else if (S.operator === "<=" && !s(S.semver, String(I), g))
|
|
1267
|
-
return !1;
|
|
1268
|
-
}
|
|
1269
|
-
if (!I.operator && (S || p) && P !== 0)
|
|
1270
|
-
return !1;
|
|
1271
|
-
}
|
|
1272
|
-
return !(p && T && !S && P !== 0 || S && b && !p && P !== 0 || q || A);
|
|
1273
|
-
}, o = (f, u, g) => {
|
|
1274
|
-
if (!f)
|
|
1275
|
-
return u;
|
|
1276
|
-
const m = i(f.semver, u.semver, g);
|
|
1277
|
-
return m > 0 ? f : m < 0 || u.operator === ">" && f.operator === ">=" ? u : f;
|
|
1278
|
-
}, n = (f, u, g) => {
|
|
1279
|
-
if (!f)
|
|
1280
|
-
return u;
|
|
1281
|
-
const m = i(f.semver, u.semver, g);
|
|
1282
|
-
return m < 0 ? f : m > 0 || u.operator === "<" && f.operator === "<=" ? u : f;
|
|
1283
|
-
};
|
|
1284
|
-
return pt = l, pt;
|
|
1285
|
-
}
|
|
1286
|
-
var gt, Br;
|
|
1287
|
-
function pn() {
|
|
1288
|
-
if (Br) return gt;
|
|
1289
|
-
Br = 1;
|
|
1290
|
-
const t = re(), e = ge(), r = G(), s = Qr(), i = H(), l = Us(), a = zs(), h = Vs(), c = Ms(), o = Xs(), n = Js(), f = Ws(), u = Hs(), g = x(), m = Ys(), p = Zs(), S = qt(), P = Ks(), w = Qs(), R = me(), T = Dt(), b = es(), A = ts(), q = Bt(), I = _t(), Z = rs(), we = en(), Re = ve(), Se = j(), ye = Ee(), v = rn(), d = sn(), y = nn(), E = an(), O = on(), $ = Gt(), N = cn(), C = ln(), k = fn(), F = un(), _ = hn();
|
|
1291
|
-
return gt = {
|
|
1292
|
-
parse: i,
|
|
1293
|
-
valid: l,
|
|
1294
|
-
clean: a,
|
|
1295
|
-
inc: h,
|
|
1296
|
-
diff: c,
|
|
1297
|
-
major: o,
|
|
1298
|
-
minor: n,
|
|
1299
|
-
patch: f,
|
|
1300
|
-
prerelease: u,
|
|
1301
|
-
compare: g,
|
|
1302
|
-
rcompare: m,
|
|
1303
|
-
compareLoose: p,
|
|
1304
|
-
compareBuild: S,
|
|
1305
|
-
sort: P,
|
|
1306
|
-
rsort: w,
|
|
1307
|
-
gt: R,
|
|
1308
|
-
lt: T,
|
|
1309
|
-
eq: b,
|
|
1310
|
-
neq: A,
|
|
1311
|
-
gte: q,
|
|
1312
|
-
lte: I,
|
|
1313
|
-
cmp: Z,
|
|
1314
|
-
coerce: we,
|
|
1315
|
-
Comparator: Re,
|
|
1316
|
-
Range: Se,
|
|
1317
|
-
satisfies: ye,
|
|
1318
|
-
toComparators: v,
|
|
1319
|
-
maxSatisfying: d,
|
|
1320
|
-
minSatisfying: y,
|
|
1321
|
-
minVersion: E,
|
|
1322
|
-
validRange: O,
|
|
1323
|
-
outside: $,
|
|
1324
|
-
gtr: N,
|
|
1325
|
-
ltr: C,
|
|
1326
|
-
intersects: k,
|
|
1327
|
-
simplifyRange: F,
|
|
1328
|
-
subset: _,
|
|
1329
|
-
SemVer: r,
|
|
1330
|
-
re: t.re,
|
|
1331
|
-
src: t.src,
|
|
1332
|
-
tokens: t.t,
|
|
1333
|
-
SEMVER_SPEC_VERSION: e.SEMVER_SPEC_VERSION,
|
|
1334
|
-
RELEASE_TYPES: e.RELEASE_TYPES,
|
|
1335
|
-
compareIdentifiers: s.compareIdentifiers,
|
|
1336
|
-
rcompareIdentifiers: s.rcompareIdentifiers
|
|
1337
|
-
}, gt;
|
|
1338
|
-
}
|
|
1339
|
-
var ss = pn();
|
|
1340
|
-
const It = "_updates_v2/per_package_version/";
|
|
1341
|
-
function gn(t, e) {
|
|
1342
|
-
return `${It}${t.organization}/${t.name}/${t.version}/${e}`;
|
|
1343
|
-
}
|
|
1344
|
-
const dn = /(?<packageKeyWithoutVersion>(?<organization>[^/]+)\/(?<name>[^/]+))\/(?<version>[^/]+)\/(?<seed>[^/]+)$/, dt = "_updates_v2/_global_update_in", _r = "_updates_v2/_global_update_out", Nt = "_overview_snapshots_v2/global/", mn = "_overview_snapshots_v2/per_package/", vn = /^(?<timestamp>\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}\.\d{3}Z-[a-z0-9]+)\.json\.gz$/;
|
|
1345
|
-
function Gr(t) {
|
|
1346
|
-
return `${Nt}${t}.json.gz`;
|
|
1347
|
-
}
|
|
1348
|
-
function En(t, e) {
|
|
1349
|
-
return `${mn}${t.organization}/${t.name}/${e}.json.gz`;
|
|
1350
|
-
}
|
|
1351
|
-
const Y = "v2/", $n = "overview.json", wn = "overview.json.gz", Rn = "overview.json", ae = "manifest.json", kt = "channels", mt = /^[-a-z0-9]+$/;
|
|
1352
|
-
function ns(t) {
|
|
1353
|
-
return `${t.organization}/${t.name}/${t.version}`;
|
|
1354
|
-
}
|
|
1355
|
-
function ne(t) {
|
|
1356
|
-
return `${Y}${ns(t)}`;
|
|
1357
|
-
}
|
|
1358
|
-
const Sn = "/" + ae, yn = L.object({
|
|
1359
|
-
description: J,
|
|
1360
|
-
channels: L.array(L.string()).default(() => []),
|
|
1361
|
-
manifestSha256: St
|
|
1362
|
-
}).passthrough(), vt = L.object({
|
|
1363
|
-
schema: L.literal("v2"),
|
|
1364
|
-
versions: L.array(yn)
|
|
1365
|
-
}).passthrough();
|
|
1366
|
-
function On(t) {
|
|
1367
|
-
return `${t.organization}/${t.name}/${Rn}`;
|
|
1368
|
-
}
|
|
1369
|
-
function xr(t) {
|
|
1370
|
-
return `${Y}${On(t)}`;
|
|
1371
|
-
}
|
|
1372
|
-
function Pn(t) {
|
|
1373
|
-
return `${ns(t)}/${kt}/`;
|
|
1374
|
-
}
|
|
1375
|
-
function In(t) {
|
|
1376
|
-
return `${Y}${Pn(t)}`;
|
|
1377
|
-
}
|
|
1378
|
-
const Nn = /(?<packageKeyWithoutVersion>(?<organization>[^/]+)\/(?<name>[^/]+))\/(?<version>[^/]+)\/manifest\.json$/, ie = `${Y}${$n}`, jr = `${Y}${wn}`;
|
|
1379
|
-
function is(t) {
|
|
1380
|
-
const e = L.object({
|
|
1381
|
-
id: Es,
|
|
1382
|
-
/** @deprecated to be removed at some point, not used, left for compatibility with older versions */
|
|
1383
|
-
allVersions: L.array(L.string()).optional(),
|
|
1384
|
-
allVersionsWithChannels: L.array($s).optional(),
|
|
1385
|
-
/** @deprecated to be removed at some point, not used, left for compatibility with older versions */
|
|
1386
|
-
latest: t,
|
|
1387
|
-
/** @deprecated to be removed at some point, not used, left for compatibility with older versions */
|
|
1388
|
-
latestManifestSha256: St,
|
|
1389
|
-
latestByChannel: L.record(
|
|
1390
|
-
L.string(),
|
|
1391
|
-
L.object({
|
|
1392
|
-
description: t,
|
|
1393
|
-
manifestSha256: St
|
|
1394
|
-
}).passthrough()
|
|
1395
|
-
).default({})
|
|
1396
|
-
}).passthrough();
|
|
1397
|
-
return e.transform((r) => r.allVersionsWithChannels ? r : {
|
|
1398
|
-
...r,
|
|
1399
|
-
allVersionsWithChannels: r.allVersions.map((s) => ({ version: s, channels: [] }))
|
|
1400
|
-
}).transform(
|
|
1401
|
-
(r) => r.latestByChannel[ce] ? r : {
|
|
1402
|
-
...r,
|
|
1403
|
-
latestByChannel: {
|
|
1404
|
-
...r.latestByChannel,
|
|
1405
|
-
[ce]: { description: r.latest, manifestSha256: r.latestManifestSha256 }
|
|
1406
|
-
}
|
|
1407
|
-
}
|
|
1408
|
-
).pipe(e.required({ allVersionsWithChannels: !0 }));
|
|
1409
|
-
}
|
|
1410
|
-
const fi = is(J);
|
|
1411
|
-
function xt(t) {
|
|
1412
|
-
return L.object({
|
|
1413
|
-
schema: L.literal("v2"),
|
|
1414
|
-
packages: L.array(is(t))
|
|
1415
|
-
}).passthrough();
|
|
1416
|
-
}
|
|
1417
|
-
const Et = xt(J);
|
|
1418
|
-
function ui(t) {
|
|
1419
|
-
return W(
|
|
1420
|
-
ue,
|
|
1421
|
-
V(
|
|
1422
|
-
ee.transform(At(t)),
|
|
1423
|
-
te.transform(pe(t))
|
|
1424
|
-
)
|
|
1425
|
-
);
|
|
1426
|
-
}
|
|
1427
|
-
function hi(t) {
|
|
1428
|
-
return xt(
|
|
1429
|
-
W(
|
|
1430
|
-
ue,
|
|
1431
|
-
V(
|
|
1432
|
-
ee.transform(At(t)),
|
|
1433
|
-
te.transform(pe(t))
|
|
1434
|
-
)
|
|
1435
|
-
)
|
|
1436
|
-
);
|
|
1437
|
-
}
|
|
1438
|
-
function pi(t) {
|
|
1439
|
-
return xt(
|
|
1440
|
-
W(
|
|
1441
|
-
ue,
|
|
1442
|
-
V(
|
|
1443
|
-
ee.transform(At(t)),
|
|
1444
|
-
te.transform(pe(t))
|
|
1445
|
-
)
|
|
1446
|
-
)
|
|
1447
|
-
);
|
|
1448
|
-
}
|
|
1449
|
-
class gi {
|
|
1450
|
-
constructor(e, r = new Rs(), s = {}) {
|
|
1451
|
-
X(this, "gzipAsync", zt(Ss));
|
|
1452
|
-
X(this, "gunzipAsync", zt(ys));
|
|
1453
|
-
this.storage = e, this.logger = r, this.settings = s;
|
|
1454
|
-
}
|
|
1455
|
-
generateTimestamp() {
|
|
1456
|
-
const e = (/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-").replace(/\.(\d{3})Z$/, ".$1Z"), r = Math.random().toString(36).substring(2, 6);
|
|
1457
|
-
return `${e}-${r}`;
|
|
1458
|
-
}
|
|
1459
|
-
generatePreWriteTimestamp() {
|
|
1460
|
-
const e = (/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-").replace(/\.(\d{3})Z$/, ".$1Z"), r = Math.random().toString(36).substring(2, 6);
|
|
1461
|
-
return `${e}-prewrite-${r}`;
|
|
1462
|
-
}
|
|
1463
|
-
async createGlobalOverviewSnapshot(e, r) {
|
|
1464
|
-
if (!this.settings.skipSnapshotCreation)
|
|
1465
|
-
try {
|
|
1466
|
-
const s = await this.gzipAsync(e), i = Gr(r);
|
|
1467
|
-
await this.storage.putFile(i, Buffer.from(s)), this.logger.info(`Global overview snapshot created at ${i}`);
|
|
1468
|
-
} catch (s) {
|
|
1469
|
-
this.logger.warn(`Failed to create global overview snapshot: ${String(s)}`);
|
|
1470
|
-
}
|
|
1471
|
-
}
|
|
1472
|
-
async createPackageOverviewSnapshot(e, r, s) {
|
|
1473
|
-
if (!this.settings.skipSnapshotCreation)
|
|
1474
|
-
try {
|
|
1475
|
-
const i = JSON.stringify(r), l = await this.gzipAsync(i), a = En(e, s);
|
|
1476
|
-
await this.storage.putFile(a, Buffer.from(l)), this.logger.info(
|
|
1477
|
-
`Package overview snapshot created at ${a} for ${e.organization}:${e.name}`
|
|
1478
|
-
);
|
|
1479
|
-
} catch (i) {
|
|
1480
|
-
this.logger.warn(
|
|
1481
|
-
`Failed to create package overview snapshot for ${e.organization}:${e.name}: ${String(i)}`
|
|
1482
|
-
);
|
|
1483
|
-
}
|
|
1484
|
-
}
|
|
1485
|
-
async updateRegistry(e = "normal") {
|
|
1486
|
-
this.logger.info("Initiating registry refresh...");
|
|
1487
|
-
const r = this.generateTimestamp(), s = /* @__PURE__ */ new Map(), i = [], l = await this.storage.listFiles(It), a = ({ organization: n, name: f, version: u }) => {
|
|
1488
|
-
const g = `${n}:${f}`, m = s.get(g);
|
|
1489
|
-
if (m) {
|
|
1490
|
-
if (!m.versions.has(u))
|
|
1491
|
-
return m.versions.add(u), !0;
|
|
1492
|
-
} else return s.set(g, {
|
|
1493
|
-
package: { organization: n, name: f },
|
|
1494
|
-
versions: /* @__PURE__ */ new Set([u])
|
|
1495
|
-
}), !0;
|
|
1496
|
-
return !1;
|
|
1497
|
-
};
|
|
1498
|
-
this.logger.info("Packages to be updated:");
|
|
1499
|
-
for (const n of l) {
|
|
1500
|
-
const f = n.match(dn);
|
|
1501
|
-
if (!f) continue;
|
|
1502
|
-
i.push(n);
|
|
1503
|
-
const { organization: u, name: g, version: m, seed: p } = f.groups, S = a({ organization: u, name: g, version: m });
|
|
1504
|
-
this.logger.info(` - ${u}:${g}:${m} added:${S}`);
|
|
1505
|
-
}
|
|
1506
|
-
if (e === "force") {
|
|
1507
|
-
const n = await this.storage.listFiles(Y);
|
|
1508
|
-
for (const f of n) {
|
|
1509
|
-
const u = f.match(Nn);
|
|
1510
|
-
if (!u) continue;
|
|
1511
|
-
const { organization: g, name: m, version: p } = u.groups, S = a({ organization: g, name: m, version: p });
|
|
1512
|
-
this.logger.info(` - ${g}:${m}:${p} force_added:${S}`);
|
|
1513
|
-
}
|
|
1514
|
-
}
|
|
1515
|
-
const h = await this.storage.getFile(ie);
|
|
1516
|
-
if (e === "force" && h !== void 0) {
|
|
1517
|
-
const n = this.generatePreWriteTimestamp();
|
|
1518
|
-
await this.createGlobalOverviewSnapshot(h.toString(), n);
|
|
1519
|
-
}
|
|
1520
|
-
let o = (e === "force" ? { packages: [] } : h === void 0 ? { packages: [] } : Et.parse(JSON.parse(h.toString()))).packages;
|
|
1521
|
-
this.logger.info(
|
|
1522
|
-
`Global overview ${e === "force" ? "starting empty (force mode)" : "loaded"}, ${o.length} records`
|
|
1523
|
-
);
|
|
1524
|
-
for (const [, n] of s.entries()) {
|
|
1525
|
-
const f = xr(n.package), u = await this.storage.getFile(f);
|
|
1526
|
-
if (e === "force" && u !== void 0) {
|
|
1527
|
-
const w = this.generatePreWriteTimestamp(), R = vt.parse(JSON.parse(u.toString()));
|
|
1528
|
-
await this.createPackageOverviewSnapshot(
|
|
1529
|
-
n.package,
|
|
1530
|
-
R,
|
|
1531
|
-
w
|
|
1532
|
-
);
|
|
1533
|
-
}
|
|
1534
|
-
const g = e === "force" ? { versions: [] } : u === void 0 ? { versions: [] } : vt.parse(JSON.parse(u.toString()));
|
|
1535
|
-
this.logger.info(
|
|
1536
|
-
`Updating ${n.package.organization}:${n.package.name} overview${e === "force" ? " (starting empty in force mode)" : ""}, ${g.versions.length} records`
|
|
1537
|
-
);
|
|
1538
|
-
const m = g.versions.filter(
|
|
1539
|
-
(w) => !n.versions.has(w.description.id.version)
|
|
1540
|
-
);
|
|
1541
|
-
for (const [w] of n.versions.entries()) {
|
|
1542
|
-
const R = w.toString(), T = {
|
|
1543
|
-
...n.package,
|
|
1544
|
-
version: R
|
|
1545
|
-
}, b = await this.storage.getFile(
|
|
1546
|
-
ne(T) + Sn
|
|
1547
|
-
);
|
|
1548
|
-
if (!b) continue;
|
|
1549
|
-
const A = await Ot(b), q = (await this.storage.listFiles(In(T))).filter((I) => I.match(mt) ? !0 : (this.logger.warn(`Unexpected channel in ${Oe(T)}: ${I}`), !1));
|
|
1550
|
-
m.push({
|
|
1551
|
-
description: Xt(R).parse(
|
|
1552
|
-
Mr.parse(JSON.parse(b.toString("utf8"))).description
|
|
1553
|
-
),
|
|
1554
|
-
manifestSha256: A,
|
|
1555
|
-
channels: q
|
|
1556
|
-
});
|
|
1557
|
-
}
|
|
1558
|
-
m.sort(
|
|
1559
|
-
(w, R) => ss.compare(R.description.id.version, w.description.id.version)
|
|
1560
|
-
);
|
|
1561
|
-
const p = { schema: "v2", versions: m };
|
|
1562
|
-
e !== "dry-run" && (await this.storage.putFile(f, Buffer.from(JSON.stringify(p))), await this.createPackageOverviewSnapshot(
|
|
1563
|
-
n.package,
|
|
1564
|
-
p,
|
|
1565
|
-
r
|
|
1566
|
-
)), this.logger.info(`Done (${m.length} records)`);
|
|
1567
|
-
const S = /* @__PURE__ */ new Set();
|
|
1568
|
-
for (const w of m) for (const R of w.channels) S.add(R);
|
|
1569
|
-
o = o.filter(
|
|
1570
|
-
(w) => w.id.organization !== n.package.organization || w.id.name !== n.package.name
|
|
1571
|
-
);
|
|
1572
|
-
const P = Xt(
|
|
1573
|
-
`${n.package.organization}/${n.package.name}`
|
|
1574
|
-
);
|
|
1575
|
-
o.push({
|
|
1576
|
-
id: {
|
|
1577
|
-
organization: n.package.organization,
|
|
1578
|
-
name: n.package.name
|
|
1579
|
-
},
|
|
1580
|
-
// left for backward compatibility
|
|
1581
|
-
allVersions: m.map((w) => w.description.id.version).reverse(),
|
|
1582
|
-
allVersionsWithChannels: m.map((w) => ({ version: w.description.id.version, channels: w.channels })).reverse(),
|
|
1583
|
-
// left for backward compatibility
|
|
1584
|
-
latest: P.parse(m[0].description),
|
|
1585
|
-
// left for backward compatibility
|
|
1586
|
-
latestManifestSha256: m[0].manifestSha256,
|
|
1587
|
-
latestByChannel: Object.fromEntries(
|
|
1588
|
-
[...S, ce].map((w) => {
|
|
1589
|
-
const R = m.find((T) => w === ce || T.channels.indexOf(w) !== -1);
|
|
1590
|
-
if (!R) throw new Error("Assertion error");
|
|
1591
|
-
return [
|
|
1592
|
-
w,
|
|
1593
|
-
{
|
|
1594
|
-
description: P.parse(R.description),
|
|
1595
|
-
manifestSha256: R == null ? void 0 : R.manifestSha256
|
|
1596
|
-
}
|
|
1597
|
-
];
|
|
1598
|
-
})
|
|
1599
|
-
)
|
|
1600
|
-
});
|
|
1601
|
-
}
|
|
1602
|
-
if (e !== "dry-run") {
|
|
1603
|
-
const n = JSON.stringify({
|
|
1604
|
-
schema: "v2",
|
|
1605
|
-
packages: o
|
|
1606
|
-
}), f = Buffer.from(n);
|
|
1607
|
-
await this.storage.putFile(ie, f);
|
|
1608
|
-
const u = await this.gzipAsync(n);
|
|
1609
|
-
await this.storage.putFile(jr, Buffer.from(u)), await this.createGlobalOverviewSnapshot(n, r);
|
|
1610
|
-
}
|
|
1611
|
-
this.logger.info(`Global overview updated (${o.length} records)`), e !== "dry-run" && await this.storage.deleteFiles(...i.map((n) => `${It}${n}`)), this.logger.info("Version update requests cleared");
|
|
1612
|
-
}
|
|
1613
|
-
async updateIfNeeded(e = "normal") {
|
|
1614
|
-
this.logger.info("Checking if registry requires refresh...");
|
|
1615
|
-
const r = await this.storage.getFile(dt), s = await this.storage.getFile(_r);
|
|
1616
|
-
if (e !== "force" && r === void 0 && s === void 0) {
|
|
1617
|
-
this.logger.info("No global seed files found, update not needed.");
|
|
1618
|
-
return;
|
|
1619
|
-
}
|
|
1620
|
-
if (e !== "force" && r !== void 0 && s !== void 0 && r.equals(s)) {
|
|
1621
|
-
this.logger.info("Registry is up to date.");
|
|
1622
|
-
return;
|
|
1623
|
-
}
|
|
1624
|
-
await this.updateRegistry(e), r && (e !== "dry-run" && await this.storage.putFile(_r, r), this.logger.info("Refresh finished."));
|
|
1625
|
-
}
|
|
1626
|
-
async getPackageOverview(e) {
|
|
1627
|
-
const r = await this.storage.getFile(xr(e));
|
|
1628
|
-
if (r !== void 0)
|
|
1629
|
-
return vt.parse(JSON.parse(r.toString()));
|
|
1630
|
-
}
|
|
1631
|
-
async getGlobalOverview() {
|
|
1632
|
-
const e = await this.storage.getFile(ie);
|
|
1633
|
-
if (e !== void 0)
|
|
1634
|
-
return Et.parse(JSON.parse(e.toString()));
|
|
1635
|
-
}
|
|
1636
|
-
async marchChanged(e) {
|
|
1637
|
-
const r = Hr(), s = gn(e, r);
|
|
1638
|
-
this.logger.info(`Creating update seed at ${s} ...`), await this.storage.putFile(s, Buffer.from(r)), this.logger.info(`Touching global update seed ${dt} ...`), await this.storage.putFile(dt, Buffer.from(r));
|
|
1639
|
-
}
|
|
1640
|
-
async addPackageToChannel(e, r) {
|
|
1641
|
-
if (!r.match(mt))
|
|
1642
|
-
throw new Error(`Illegal characters in channel name: ${r}`);
|
|
1643
|
-
const s = ne(e);
|
|
1644
|
-
if (await this.storage.getFile(`${s}/${ae}`) === void 0)
|
|
1645
|
-
throw new Error(`Package ${Oe(e)} not found in the registry.`);
|
|
1646
|
-
await this.storage.putFile(`${s}/${kt}/${r}`, Buffer.from(r)), await this.marchChanged(e);
|
|
1647
|
-
}
|
|
1648
|
-
async removePackageFromChannel(e, r) {
|
|
1649
|
-
if (!r.match(mt))
|
|
1650
|
-
throw new Error(`Illegal characters in channel name: ${r}`);
|
|
1651
|
-
const s = ne(e);
|
|
1652
|
-
if (await this.storage.getFile(`${s}/${ae}`) === void 0)
|
|
1653
|
-
throw new Error(`Package ${Oe(e)} not found in the registry.`);
|
|
1654
|
-
await this.storage.deleteFiles(`${s}/${kt}/${r}`), await this.marchChanged(e);
|
|
1655
|
-
}
|
|
1656
|
-
async listGlobalOverviewSnapshots() {
|
|
1657
|
-
const e = await this.storage.listFiles(Nt), r = [];
|
|
1658
|
-
for (const s of e) {
|
|
1659
|
-
const i = s.indexOf("/") === -1 ? s : s.substring(s.lastIndexOf("/") + 1), l = i.match(vn);
|
|
1660
|
-
l && r.push({
|
|
1661
|
-
timestamp: l.groups.timestamp,
|
|
1662
|
-
path: Nt + i
|
|
1663
|
-
});
|
|
1664
|
-
}
|
|
1665
|
-
return r.sort((s, i) => i.timestamp.localeCompare(s.timestamp)), r;
|
|
1666
|
-
}
|
|
1667
|
-
async restoreGlobalOverviewFromSnapshot(e) {
|
|
1668
|
-
const r = Gr(e), s = await this.storage.getFile(r);
|
|
1669
|
-
if (!s)
|
|
1670
|
-
throw new Error(`Snapshot ${e} not found at ${r}`);
|
|
1671
|
-
const l = (await this.gunzipAsync(s)).toString("utf8");
|
|
1672
|
-
try {
|
|
1673
|
-
Et.parse(JSON.parse(l));
|
|
1674
|
-
} catch (c) {
|
|
1675
|
-
throw new Error(`Invalid snapshot data in ${e}: ${String(c)}`);
|
|
1676
|
-
}
|
|
1677
|
-
const a = Buffer.from(l);
|
|
1678
|
-
await this.storage.putFile(ie, a);
|
|
1679
|
-
const h = await this.gzipAsync(l);
|
|
1680
|
-
await this.storage.putFile(jr, Buffer.from(h)), this.logger.info(`Global overview restored from snapshot ${e}`);
|
|
1681
|
-
}
|
|
1682
|
-
async publishPackage(e, r) {
|
|
1683
|
-
const s = ne(e.description.id);
|
|
1684
|
-
for (const l of e.files) {
|
|
1685
|
-
const a = await r(l.name);
|
|
1686
|
-
if (a.length !== l.size)
|
|
1687
|
-
throw new Error(
|
|
1688
|
-
`Actual file size don't match file size from the manifest file for ${l.name} (actual = ${a.length}; manifest = ${l.size})`
|
|
1689
|
-
);
|
|
1690
|
-
const h = await Ot(a);
|
|
1691
|
-
if (h !== l.sha256.toUpperCase())
|
|
1692
|
-
throw new Error(
|
|
1693
|
-
`Actual file SHA-256 don't match the checksum from the manifest file for ${l.name} (actual = ${h}; manifest = ${l.sha256.toUpperCase()})`
|
|
1694
|
-
);
|
|
1695
|
-
const c = s + "/" + l.name;
|
|
1696
|
-
this.logger.info(`Uploading ${l.name} -> ${c} ...`), await this.storage.putFile(c, a);
|
|
1697
|
-
}
|
|
1698
|
-
const i = s + "/" + ae;
|
|
1699
|
-
this.logger.info(`Uploading manifest to ${i} ...`), await this.storage.putFile(i, Buffer.from(JSON.stringify(e))), await this.marchChanged(e.description.id);
|
|
1700
|
-
}
|
|
1701
|
-
}
|
|
1702
|
-
class kn {
|
|
1703
|
-
constructor(e, r, s) {
|
|
1704
|
-
this.client = e, this.bucket = r, this.root = s;
|
|
1705
|
-
}
|
|
1706
|
-
async getFile(e) {
|
|
1707
|
-
try {
|
|
1708
|
-
return Buffer.from(
|
|
1709
|
-
await (await this.client.getObject({
|
|
1710
|
-
Bucket: this.bucket,
|
|
1711
|
-
Key: z.join(this.root, e)
|
|
1712
|
-
})).Body.transformToByteArray()
|
|
1713
|
-
);
|
|
1714
|
-
} catch (r) {
|
|
1715
|
-
if (r instanceof Error && r.name === "NoSuchKey") return;
|
|
1716
|
-
throw r;
|
|
1717
|
-
}
|
|
1718
|
-
}
|
|
1719
|
-
async listFiles(e) {
|
|
1720
|
-
const r = z.join(this.root, e), s = ks(
|
|
1721
|
-
{ client: this.client },
|
|
1722
|
-
{
|
|
1723
|
-
Bucket: this.bucket,
|
|
1724
|
-
Prefix: r
|
|
1725
|
-
}
|
|
1726
|
-
), i = [];
|
|
1727
|
-
for await (const l of s)
|
|
1728
|
-
i.push(...(l.Contents ?? []).map((a) => z.relative(r, a.Key)));
|
|
1729
|
-
return i;
|
|
1730
|
-
}
|
|
1731
|
-
async putFile(e, r) {
|
|
1732
|
-
await this.client.putObject({
|
|
1733
|
-
Bucket: this.bucket,
|
|
1734
|
-
Key: z.join(this.root, e),
|
|
1735
|
-
Body: r
|
|
1736
|
-
});
|
|
1737
|
-
}
|
|
1738
|
-
async deleteFiles(...e) {
|
|
1739
|
-
const r = await this.client.deleteObjects({
|
|
1740
|
-
Bucket: this.bucket,
|
|
1741
|
-
Delete: {
|
|
1742
|
-
Objects: e.map((s) => ({
|
|
1743
|
-
Key: z.join(this.root, s)
|
|
1744
|
-
}))
|
|
1745
|
-
}
|
|
1746
|
-
});
|
|
1747
|
-
if (r.Errors !== void 0 && r.Errors.length > 0)
|
|
1748
|
-
throw new Error(
|
|
1749
|
-
`Errors encountered while deleting files: ${r.Errors.map((s) => s.Message ?? s.Code ?? "Unknown error").join(`
|
|
1750
|
-
`)}`
|
|
1751
|
-
);
|
|
1752
|
-
}
|
|
1753
|
-
}
|
|
1754
|
-
class Ln {
|
|
1755
|
-
constructor(e) {
|
|
1756
|
-
/** Absolute path */
|
|
1757
|
-
X(this, "root");
|
|
1758
|
-
this.root = B.resolve(e);
|
|
1759
|
-
}
|
|
1760
|
-
toAbsolutePath(e) {
|
|
1761
|
-
if (z.isAbsolute(e)) throw new Error("absolute path");
|
|
1762
|
-
return B.resolve(this.root, e.split(z.sep).join(B.sep));
|
|
1763
|
-
}
|
|
1764
|
-
async getFile(e) {
|
|
1765
|
-
try {
|
|
1766
|
-
return await Q.promises.readFile(this.toAbsolutePath(e));
|
|
1767
|
-
} catch (r) {
|
|
1768
|
-
if (r instanceof Error && "code" in r && r.code === "ENOENT") return;
|
|
1769
|
-
throw r;
|
|
1770
|
-
}
|
|
1771
|
-
}
|
|
1772
|
-
async listFiles(e) {
|
|
1773
|
-
try {
|
|
1774
|
-
const r = this.toAbsolutePath(e);
|
|
1775
|
-
return (await Q.promises.readdir(r, { recursive: !0, withFileTypes: !0 })).filter((s) => s.isFile()).map(
|
|
1776
|
-
(s) => B.relative(r, B.resolve(s.parentPath, s.name)).split(B.sep).join(z.sep)
|
|
1777
|
-
);
|
|
1778
|
-
} catch (r) {
|
|
1779
|
-
if (r instanceof Error && "code" in r && r.code === "ENOENT") return [];
|
|
1780
|
-
throw r;
|
|
1781
|
-
}
|
|
1782
|
-
}
|
|
1783
|
-
async putFile(e, r) {
|
|
1784
|
-
const s = this.toAbsolutePath(e);
|
|
1785
|
-
await Q.promises.mkdir(B.dirname(s), { recursive: !0 }), await Q.promises.writeFile(s, r);
|
|
1786
|
-
}
|
|
1787
|
-
async deleteFiles(...e) {
|
|
1788
|
-
for (const r of e) await Q.promises.rm(this.toAbsolutePath(r));
|
|
1789
|
-
}
|
|
1790
|
-
}
|
|
1791
|
-
function Cn(t) {
|
|
1792
|
-
const e = new URL(t, `file:${B.resolve(".").split(B.sep).join(z.sep)}/`);
|
|
1793
|
-
switch (e.protocol) {
|
|
1794
|
-
case "file:": {
|
|
1795
|
-
const r = B.resolve(e.pathname);
|
|
1796
|
-
return new Ln(r);
|
|
1797
|
-
}
|
|
1798
|
-
case "s3:": {
|
|
1799
|
-
const r = {}, s = e.searchParams.get("region");
|
|
1800
|
-
s && (r.region = s);
|
|
1801
|
-
const i = e.hostname;
|
|
1802
|
-
return new kn(new Ns(r), i, e.pathname.replace(/^\//, ""));
|
|
1803
|
-
}
|
|
1804
|
-
default:
|
|
1805
|
-
throw new Error(`Unknown protocol: ${e.protocol}`);
|
|
1806
|
-
}
|
|
1807
|
-
}
|
|
1808
|
-
const Tn = L.string().regex(/^(?:s3:|file:)/), An = L.object({
|
|
1809
|
-
organization: L.string(),
|
|
1810
|
-
package: L.string(),
|
|
1811
|
-
version: Tt.optional(),
|
|
1812
|
-
files: L.record(L.string().regex(/^[^/]+$/), L.string()).default({}),
|
|
1813
|
-
meta: L.object({}).passthrough()
|
|
1814
|
-
}), Fn = L.object({
|
|
1815
|
-
registries: L.record(L.string(), Tn).default({}),
|
|
1816
|
-
registry: L.string().optional()
|
|
1817
|
-
}), as = Fn.merge(An).required(
|
|
1818
|
-
{ registry: !0, version: !0 }
|
|
1819
|
-
), jt = as.partial().required({
|
|
1820
|
-
registries: !0,
|
|
1821
|
-
files: !0
|
|
1822
|
-
}), bn = "pl.package.json", qn = "pl.package.yaml", $e = "v1/";
|
|
1823
|
-
function di(t) {
|
|
1824
|
-
return `${$e}${t.organization}/${t.package}/${t.version}`;
|
|
1825
|
-
}
|
|
1826
|
-
function os(t, e) {
|
|
1827
|
-
return `${$e}${t.organization}/${t.package}/${t.version}/${e}`;
|
|
1828
|
-
}
|
|
1829
|
-
function Ur(t) {
|
|
1830
|
-
return `${$e}${t.organization}/${t.package}/overview.json`;
|
|
1831
|
-
}
|
|
1832
|
-
const $t = `${$e}overview.json`, cs = "meta.json", Lt = "_updates_v1/per_package_version/";
|
|
1833
|
-
function Dn(t, e) {
|
|
1834
|
-
return `${Lt}${t.organization}/${t.package}/${t.version}/${e}`;
|
|
1835
|
-
}
|
|
1836
|
-
const Bn = /(?<packageKeyWithoutVersion>(?<organization>[^/]+)\/(?<pkg>[^/]+))\/(?<version>[^/]+)\/(?<seed>[^/]+)$/, ls = "_updates_v1/_global_update_in", zr = "_updates_v1/_global_update_out";
|
|
1837
|
-
class _n {
|
|
1838
|
-
constructor(e, r) {
|
|
1839
|
-
this.storage = e, this.logger = r;
|
|
1840
|
-
}
|
|
1841
|
-
constructNewPackage(e) {
|
|
1842
|
-
return new Gn(this.storage, e);
|
|
1843
|
-
}
|
|
1844
|
-
async updateRegistry() {
|
|
1845
|
-
var a, h, c, o, n, f, u, g;
|
|
1846
|
-
(a = this.logger) == null || a.info("Initiating registry refresh...");
|
|
1847
|
-
const e = /* @__PURE__ */ new Map(), r = [], s = await this.storage.listFiles(Lt);
|
|
1848
|
-
(h = this.logger) == null || h.info("Packages to be updated:");
|
|
1849
|
-
for (const m of s) {
|
|
1850
|
-
const p = m.match(Bn);
|
|
1851
|
-
if (!p) continue;
|
|
1852
|
-
r.push(m);
|
|
1853
|
-
const { packageKeyWithoutVersion: S, organization: P, pkg: w, version: R, seed: T } = p.groups, b = e.get(S);
|
|
1854
|
-
b ? b.versions.has(R) || b.versions.add(R) : e.set(S, {
|
|
1855
|
-
package: { organization: P, package: w },
|
|
1856
|
-
versions: /* @__PURE__ */ new Set([R])
|
|
1857
|
-
}), (c = this.logger) == null || c.info(` - ${P}:${w}:${R}`);
|
|
1858
|
-
}
|
|
1859
|
-
const i = await this.storage.getFile($t);
|
|
1860
|
-
let l = i === void 0 ? [] : JSON.parse(i.toString());
|
|
1861
|
-
(o = this.logger) == null || o.info(`Global overview loaded, ${l.length} records`);
|
|
1862
|
-
for (const [, m] of e.entries()) {
|
|
1863
|
-
const p = Ur(m.package), S = await this.storage.getFile(p);
|
|
1864
|
-
let P = S === void 0 ? [] : JSON.parse(S.toString());
|
|
1865
|
-
(n = this.logger) == null || n.info(
|
|
1866
|
-
`Updating ${m.package.organization}:${m.package.package} overview, ${P.length} records`
|
|
1867
|
-
), P = P.filter((w) => !m.versions.has(w.version));
|
|
1868
|
-
for (const [w] of m.versions.entries()) {
|
|
1869
|
-
const R = w.toString(), T = await this.storage.getFile(
|
|
1870
|
-
os(
|
|
1871
|
-
{
|
|
1872
|
-
...m.package,
|
|
1873
|
-
version: R
|
|
1874
|
-
},
|
|
1875
|
-
cs
|
|
1876
|
-
)
|
|
1877
|
-
);
|
|
1878
|
-
T && P.push({
|
|
1879
|
-
version: R,
|
|
1880
|
-
meta: JSON.parse(T.toString())
|
|
1881
|
-
});
|
|
1882
|
-
}
|
|
1883
|
-
P.sort((w, R) => ss.compare(R.version, w.version)), await this.storage.putFile(p, Buffer.from(JSON.stringify(P))), (f = this.logger) == null || f.info(`Done (${P.length} records)`), l = l.filter(
|
|
1884
|
-
(w) => w.organization !== m.package.organization || w.package !== m.package.package
|
|
1885
|
-
), l.push({
|
|
1886
|
-
organization: m.package.organization,
|
|
1887
|
-
package: m.package.package,
|
|
1888
|
-
allVersions: P.map((w) => w.version).reverse(),
|
|
1889
|
-
latestVersion: P[0].version,
|
|
1890
|
-
latestMeta: P[0].meta
|
|
1891
|
-
});
|
|
1892
|
-
}
|
|
1893
|
-
await this.storage.putFile($t, Buffer.from(JSON.stringify(l))), (u = this.logger) == null || u.info(`Global overview updated (${l.length} records)`), await this.storage.deleteFiles(...r.map((m) => `${Lt}${m}`)), (g = this.logger) == null || g.info("Version update requests cleared");
|
|
1894
|
-
}
|
|
1895
|
-
async updateIfNeeded(e = !1) {
|
|
1896
|
-
var i, l;
|
|
1897
|
-
(i = this.logger) == null || i.info("Checking if registry requires refresh...");
|
|
1898
|
-
const r = await this.storage.getFile(ls), s = await this.storage.getFile(zr);
|
|
1899
|
-
!e && r === void 0 && s === void 0 || !e && r !== void 0 && s !== void 0 && r.equals(s) || (await this.updateRegistry(), r && (await this.storage.putFile(zr, r), (l = this.logger) == null || l.info("Refresh finished")));
|
|
1900
|
-
}
|
|
1901
|
-
async getPackageOverview(e) {
|
|
1902
|
-
const r = await this.storage.getFile(Ur(e));
|
|
1903
|
-
if (r !== void 0)
|
|
1904
|
-
return JSON.parse(r.toString());
|
|
1905
|
-
}
|
|
1906
|
-
async getGlobalOverview() {
|
|
1907
|
-
const e = await this.storage.getFile($t);
|
|
1908
|
-
if (e !== void 0)
|
|
1909
|
-
return JSON.parse(e.toString());
|
|
1910
|
-
}
|
|
1911
|
-
}
|
|
1912
|
-
class Gn {
|
|
1913
|
-
constructor(e, r) {
|
|
1914
|
-
X(this, "metaAdded", !1);
|
|
1915
|
-
X(this, "seed", Hr());
|
|
1916
|
-
this.storage = e, this.name = r;
|
|
1917
|
-
}
|
|
1918
|
-
async addFile(e, r) {
|
|
1919
|
-
await this.storage.putFile(os(this.name, e), r);
|
|
1920
|
-
}
|
|
1921
|
-
async writeMeta(e) {
|
|
1922
|
-
await this.addFile(cs, Buffer.from(JSON.stringify(e))), this.metaAdded = !0;
|
|
1923
|
-
}
|
|
1924
|
-
async finish() {
|
|
1925
|
-
if (!this.metaAdded) throw new Error("meta not added");
|
|
1926
|
-
await this.storage.putFile(Dn(this.name, this.seed), Buffer.of(0)), await this.storage.putFile(ls, Buffer.from(this.seed));
|
|
1927
|
-
}
|
|
1928
|
-
}
|
|
1929
|
-
function M(t, e) {
|
|
1930
|
-
return e === void 0 ? t : {
|
|
1931
|
-
...t,
|
|
1932
|
-
...e,
|
|
1933
|
-
registries: { ...t.registries, ...e.registries },
|
|
1934
|
-
files: { ...t.files, ...e.files }
|
|
1935
|
-
};
|
|
1936
|
-
}
|
|
1937
|
-
async function wt(t) {
|
|
1938
|
-
return Ft(t, (e) => jt.parse(JSON.parse(e.toString())));
|
|
1939
|
-
}
|
|
1940
|
-
async function Rt(t) {
|
|
1941
|
-
return Ft(t, (e) => jt.parse(Is.parse(e.toString())));
|
|
1942
|
-
}
|
|
1943
|
-
async function xn() {
|
|
1944
|
-
let t = jt.parse({});
|
|
1945
|
-
return t = M(t, await wt("./.pl.reg.json")), t = M(t, await Rt("./.pl.reg.yaml")), t = M(t, await wt(`${Vt.homedir()}/.pl.reg.json`)), t = M(t, await Rt(`${Vt.homedir()}/.pl.reg.yaml`)), t = M(t, await wt(bn)), t = M(t, await Rt(qn)), t;
|
|
1946
|
-
}
|
|
1947
|
-
class jn {
|
|
1948
|
-
constructor(e) {
|
|
1949
|
-
this.conf = e;
|
|
1950
|
-
}
|
|
1951
|
-
createRegistry(e) {
|
|
1952
|
-
let r = this.conf.registry;
|
|
1953
|
-
if (!r.startsWith("file:") && !r.startsWith("s3:")) {
|
|
1954
|
-
const s = this.conf.registries[r];
|
|
1955
|
-
if (!s) throw new Error(`Registry with alias "${r}" not found`);
|
|
1956
|
-
r = s;
|
|
1957
|
-
}
|
|
1958
|
-
return new _n(Cn(r), e);
|
|
1959
|
-
}
|
|
1960
|
-
get fullPackageName() {
|
|
1961
|
-
return {
|
|
1962
|
-
organization: this.conf.organization,
|
|
1963
|
-
package: this.conf.package,
|
|
1964
|
-
version: this.conf.version
|
|
1965
|
-
};
|
|
1966
|
-
}
|
|
1967
|
-
}
|
|
1968
|
-
async function mi(t) {
|
|
1969
|
-
const e = await xn();
|
|
1970
|
-
return new jn(
|
|
1971
|
-
as.parse(M(e, t))
|
|
1972
|
-
);
|
|
1973
|
-
}
|
|
1974
|
-
export {
|
|
1975
|
-
ci as $,
|
|
1976
|
-
Cs as A,
|
|
1977
|
-
si as B,
|
|
1978
|
-
Mt as C,
|
|
1979
|
-
Yr as D,
|
|
1980
|
-
Ts as E,
|
|
1981
|
-
Ln as F,
|
|
1982
|
-
Et as G,
|
|
1983
|
-
As as H,
|
|
1984
|
-
yt as I,
|
|
1985
|
-
Fs as J,
|
|
1986
|
-
At as K,
|
|
1987
|
-
bs as L,
|
|
1988
|
-
ae as M,
|
|
1989
|
-
ri as N,
|
|
1990
|
-
pe as O,
|
|
1991
|
-
jt as P,
|
|
1992
|
-
Ds as Q,
|
|
1993
|
-
Ls as R,
|
|
1994
|
-
kn as S,
|
|
1995
|
-
ni as T,
|
|
1996
|
-
Bs as U,
|
|
1997
|
-
_s as V,
|
|
1998
|
-
Zr as W,
|
|
1999
|
-
Gs as X,
|
|
2000
|
-
Xt as Y,
|
|
2001
|
-
Pt as Z,
|
|
2002
|
-
Kr as _,
|
|
2003
|
-
qs as a,
|
|
2004
|
-
wn as a0,
|
|
2005
|
-
Rn as a1,
|
|
2006
|
-
kt as a2,
|
|
2007
|
-
mt as a3,
|
|
2008
|
-
ne as a4,
|
|
2009
|
-
yn as a5,
|
|
2010
|
-
vt as a6,
|
|
2011
|
-
On as a7,
|
|
2012
|
-
xr as a8,
|
|
2013
|
-
Pn as a9,
|
|
2014
|
-
In as aa,
|
|
2015
|
-
Nn as ab,
|
|
2016
|
-
ie as ac,
|
|
2017
|
-
jr as ad,
|
|
2018
|
-
is as ae,
|
|
2019
|
-
fi as af,
|
|
2020
|
-
xt as ag,
|
|
2021
|
-
ui as ah,
|
|
2022
|
-
hi as ai,
|
|
2023
|
-
pi as aj,
|
|
2024
|
-
gi as b,
|
|
2025
|
-
li as c,
|
|
2026
|
-
oi as d,
|
|
2027
|
-
ss as e,
|
|
2028
|
-
Y as f,
|
|
2029
|
-
mi as g,
|
|
2030
|
-
ii as h,
|
|
2031
|
-
$n as i,
|
|
2032
|
-
Sn as j,
|
|
2033
|
-
Ot as k,
|
|
2034
|
-
js as l,
|
|
2035
|
-
ai as m,
|
|
2036
|
-
$t as n,
|
|
2037
|
-
cs as o,
|
|
2038
|
-
ns as p,
|
|
2039
|
-
An as q,
|
|
2040
|
-
bn as r,
|
|
2041
|
-
Cn as s,
|
|
2042
|
-
qn as t,
|
|
2043
|
-
Fn as u,
|
|
2044
|
-
as as v,
|
|
2045
|
-
jn as w,
|
|
2046
|
-
di as x,
|
|
2047
|
-
Ur as y,
|
|
2048
|
-
os as z
|
|
2049
|
-
};
|
|
2050
|
-
//# sourceMappingURL=config-Cc8_zV3b.mjs.map
|