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