@platforma-sdk/block-tools 2.2.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +94 -238
- package/dist/cli.mjs.map +1 -1
- package/dist/config-BbxbO3Iw.mjs +1601 -0
- package/dist/config-BbxbO3Iw.mjs.map +1 -0
- package/dist/config-BczgUC2N.js +3 -0
- package/dist/config-BczgUC2N.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +184 -40
- package/dist/index.mjs.map +1 -1
- package/dist/io/folder_reader.d.ts +10 -0
- package/dist/io/folder_reader.d.ts.map +1 -0
- package/dist/io/index.d.ts +3 -0
- package/dist/io/index.d.ts.map +1 -0
- package/dist/io/storage.d.ts.map +1 -0
- package/dist/lib.d.ts +1 -0
- package/dist/lib.d.ts.map +1 -1
- package/dist/registry_v1/registry.d.ts +1 -1
- package/dist/registry_v1/registry.d.ts.map +1 -1
- package/dist/registry_v1/v1_repo_schema.d.ts +1 -1
- package/dist/registry_v1/v1_repo_schema.d.ts.map +1 -1
- package/dist/util.d.ts +1 -0
- package/dist/util.d.ts.map +1 -1
- package/dist/v2/build_dist.d.ts.map +1 -1
- package/dist/v2/index.d.ts +1 -0
- package/dist/v2/index.d.ts.map +1 -1
- package/dist/v2/model/block_components.d.ts +298 -20
- package/dist/v2/model/block_components.d.ts.map +1 -1
- package/dist/v2/model/block_description.d.ts +329 -110
- package/dist/v2/model/block_description.d.ts.map +1 -1
- package/dist/v2/model/block_meta.d.ts +554 -2
- package/dist/v2/model/block_meta.d.ts.map +1 -1
- package/dist/v2/model/content_conversion.d.ts +3 -1
- package/dist/v2/model/content_conversion.d.ts.map +1 -1
- package/dist/v2/registry/index.d.ts +4 -0
- package/dist/v2/registry/index.d.ts.map +1 -0
- package/dist/v2/registry/registry.d.ts +1 -1
- package/dist/v2/registry/registry.d.ts.map +1 -1
- package/dist/v2/registry/registry_reader.d.ts +14 -0
- package/dist/v2/registry/registry_reader.d.ts.map +1 -0
- package/dist/v2/registry/schema_public.d.ts +2048 -259
- package/dist/v2/registry/schema_public.d.ts.map +1 -1
- package/package.json +7 -4
- package/src/cmd/build-meta.ts +2 -2
- package/src/cmd/publish.ts +1 -1
- package/src/io/folder_reader.test.ts +21 -0
- package/src/io/folder_reader.ts +85 -0
- package/src/io/index.ts +2 -0
- package/src/lib.ts +1 -0
- package/src/registry_v1/config.ts +1 -1
- package/src/registry_v1/registry.test.ts +1 -1
- package/src/registry_v1/registry.ts +1 -1
- package/src/registry_v1/v1_repo_schema.ts +1 -1
- package/src/util.ts +6 -0
- package/src/v2/build_dist.ts +2 -1
- package/src/v2/index.ts +1 -0
- package/src/v2/model/block_components.ts +10 -8
- package/src/v2/model/block_meta.ts +23 -5
- package/src/v2/model/content_conversion.ts +30 -1
- package/src/v2/registry/index.ts +3 -0
- package/src/v2/registry/registry.ts +19 -15
- package/src/v2/registry/registry_reader.ts +81 -0
- package/src/v2/registry/schema_public.ts +36 -10
- package/dist/config-DJqN5LSx.js +0 -3
- package/dist/config-DJqN5LSx.js.map +0 -1
- package/dist/config-rGaQLD-7.mjs +0 -1350
- package/dist/config-rGaQLD-7.mjs.map +0 -1
- package/dist/lib/storage.d.ts.map +0 -1
- /package/dist/{lib → io}/storage.d.ts +0 -0
- /package/src/{lib → io}/storage.test.ts +0 -0
- /package/src/{lib → io}/storage.ts +0 -0
package/dist/config-rGaQLD-7.mjs
DELETED
|
@@ -1,1350 +0,0 @@
|
|
|
1
|
-
var Ct = Object.defineProperty;
|
|
2
|
-
var Ft = (r, e, t) => e in r ? Ct(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
-
var W = (r, e, t) => Ft(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { BlockPackMeta as ee, ContentAbsoluteTextLocal as ot, ContentAbsoluteBinaryLocal as ve, BlockPackMetaEmbeddedContent as Dt, DescriptionContentText as bt, DescriptionContentBinary as jt, BlockComponents as we, ContentAbsoluteFolder as _t, BlockComponentsManifest as Gt, CreateBlockPackDescriptionSchema as Ie, BlockPackDescriptionManifest as $e, addPrefixToRelative as xt, ContentRelative as be, ContentRelativeText as Ut, ContentRelativeBinary as Bt, BlockPackManifest as Vt, BlockPackManifestFile as Xt, BlockPackDescriptionFromPackageJsonRaw as ct, SemVer as Ne } from "@milaboratories/pl-model-middle-layer";
|
|
5
|
-
import { z as P } from "zod";
|
|
6
|
-
import T from "node:path";
|
|
7
|
-
import x from "node:fs/promises";
|
|
8
|
-
import * as Se from "mime-types";
|
|
9
|
-
import * as zt from "tar";
|
|
10
|
-
import { tryResolve as lt } from "@milaboratories/resolve-helper";
|
|
11
|
-
import { notEmpty as ft } from "@milaboratories/ts-helpers";
|
|
12
|
-
import Mt from "yaml";
|
|
13
|
-
import * as je from "node:os";
|
|
14
|
-
import { randomUUID as Ht } from "node:crypto";
|
|
15
|
-
import G from "node:path/posix";
|
|
16
|
-
import { S3 as Jt, paginateListObjectsV2 as qt } from "@aws-sdk/client-s3";
|
|
17
|
-
import * as H from "node:fs";
|
|
18
|
-
function Wt(r) {
|
|
19
|
-
return P.string().transform((e, t) => {
|
|
20
|
-
const s = lt(r, e);
|
|
21
|
-
return s === void 0 ? (t.addIssue({
|
|
22
|
-
code: P.ZodIssueCode.custom,
|
|
23
|
-
message: `Can't resolve ${e} against ${r}`
|
|
24
|
-
}), P.NEVER) : {
|
|
25
|
-
type: "absolute-file",
|
|
26
|
-
file: s
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
function Yt(r, ...e) {
|
|
31
|
-
return P.string().transform((t, s) => {
|
|
32
|
-
const a = t.endsWith("/") ? t : `${t}/`;
|
|
33
|
-
for (const o of e) {
|
|
34
|
-
const c = lt(r, a + o);
|
|
35
|
-
if (c !== void 0) {
|
|
36
|
-
if (!c.endsWith(o))
|
|
37
|
-
throw new Error(`Unexpected resolve result ${c} with index file ${o}`);
|
|
38
|
-
return {
|
|
39
|
-
type: "absolute-folder",
|
|
40
|
-
folder: c.slice(0, c.length - o.length)
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return s.addIssue({
|
|
45
|
-
code: P.ZodIssueCode.custom,
|
|
46
|
-
message: `Can't resolve ${t} folder against ${r}, no index file found (${e.join(", ")})`
|
|
47
|
-
}), P.NEVER;
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
function _e(r) {
|
|
51
|
-
return (e) => e.type === "relative" ? { type: "absolute-file", file: T.resolve(r, e.path) } : e;
|
|
52
|
-
}
|
|
53
|
-
function Kt() {
|
|
54
|
-
return async (r) => r.type === "absolute-file" ? await x.readFile(r.file, { encoding: "utf-8" }) : r.content;
|
|
55
|
-
}
|
|
56
|
-
function Zt() {
|
|
57
|
-
return async (r) => {
|
|
58
|
-
if (r.type === "absolute-file") {
|
|
59
|
-
const e = Se.lookup(r.file);
|
|
60
|
-
if (!e) throw new Error(`Can't recognize mime type of the file: ${r.file}.`);
|
|
61
|
-
return {
|
|
62
|
-
type: "explicit-base64",
|
|
63
|
-
mimeType: e,
|
|
64
|
-
content: await x.readFile(r.file, { encoding: "base64" })
|
|
65
|
-
};
|
|
66
|
-
} else return r;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
function me(r, e) {
|
|
70
|
-
return async (t) => {
|
|
71
|
-
if (t.type === "absolute-file") {
|
|
72
|
-
const s = T.basename(t.file), a = T.resolve(r, s);
|
|
73
|
-
return e == null || e.push(s), await x.cp(t.file, a), { type: "relative", path: s };
|
|
74
|
-
} else return t;
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
function Qt(r, e, t) {
|
|
78
|
-
if (!e.endsWith(".tgz")) throw new Error(`Unexpected tgz file name: ${e}`);
|
|
79
|
-
return async (s) => {
|
|
80
|
-
const a = T.resolve(r, e);
|
|
81
|
-
return await zt.create(
|
|
82
|
-
{
|
|
83
|
-
gzip: !0,
|
|
84
|
-
file: a,
|
|
85
|
-
cwd: s.folder
|
|
86
|
-
},
|
|
87
|
-
[s.folder]
|
|
88
|
-
), t == null || t.push(e), { type: "relative", path: e };
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
function yi(r) {
|
|
92
|
-
return async (e) => e.type === "explicit-string" ? e : { type: "explicit-string", content: (await r(e.path)).toString("utf8") };
|
|
93
|
-
}
|
|
94
|
-
function Pi(r) {
|
|
95
|
-
return async (e) => {
|
|
96
|
-
if (e.type === "explicit-base64") return e;
|
|
97
|
-
const t = Se.lookup(e.path);
|
|
98
|
-
if (!t) throw new Error(`Can't recognize mime type of the file: ${e.path}.`);
|
|
99
|
-
return {
|
|
100
|
-
type: "explicit-base64",
|
|
101
|
-
mimeType: t,
|
|
102
|
-
content: (await r(e.path)).toString("base64")
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
function Ti(r) {
|
|
107
|
-
return async (e) => {
|
|
108
|
-
if (e.type === "explicit-base64")
|
|
109
|
-
return {
|
|
110
|
-
type: "explicit-bytes",
|
|
111
|
-
mimeType: e.mimeType,
|
|
112
|
-
content: Buffer.from(e.content, "base64")
|
|
113
|
-
};
|
|
114
|
-
const t = Se.lookup(e.path);
|
|
115
|
-
if (!t) throw new Error(`Can't recognize mime type of the file: ${e.path}.`);
|
|
116
|
-
return {
|
|
117
|
-
type: "explicit-bytes",
|
|
118
|
-
mimeType: t,
|
|
119
|
-
content: await r(e.path)
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
function er(r) {
|
|
124
|
-
return ee(
|
|
125
|
-
bt.transform(_e(r)),
|
|
126
|
-
jt.transform(_e(r))
|
|
127
|
-
);
|
|
128
|
-
}
|
|
129
|
-
function tr(r, e) {
|
|
130
|
-
return ee(
|
|
131
|
-
ot.transform(me(r, e)),
|
|
132
|
-
ve.transform(me(r, e))
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
const Ai = ee(
|
|
136
|
-
ot.transform(Kt()),
|
|
137
|
-
ve.transform(Zt())
|
|
138
|
-
).pipe(Dt);
|
|
139
|
-
function rr(r) {
|
|
140
|
-
return we(
|
|
141
|
-
Wt(r),
|
|
142
|
-
Yt(r, "index.html")
|
|
143
|
-
);
|
|
144
|
-
}
|
|
145
|
-
function sr(r, e) {
|
|
146
|
-
return we(
|
|
147
|
-
ve.transform(me(r, e)),
|
|
148
|
-
_t.transform(Qt(r, "ui.tgz", e))
|
|
149
|
-
).pipe(Gt);
|
|
150
|
-
}
|
|
151
|
-
function ut(r) {
|
|
152
|
-
return Ie(
|
|
153
|
-
rr(r),
|
|
154
|
-
er(r)
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
function nr(r, e) {
|
|
158
|
-
return Ie(
|
|
159
|
-
sr(r, e),
|
|
160
|
-
tr(r, e)
|
|
161
|
-
).pipe($e);
|
|
162
|
-
}
|
|
163
|
-
function ki(r) {
|
|
164
|
-
const e = xt(r);
|
|
165
|
-
return $e.pipe(
|
|
166
|
-
Ie(
|
|
167
|
-
we(
|
|
168
|
-
be.transform(e),
|
|
169
|
-
be.transform(e)
|
|
170
|
-
),
|
|
171
|
-
ee(
|
|
172
|
-
Ut.transform(e),
|
|
173
|
-
Bt.transform(e)
|
|
174
|
-
)
|
|
175
|
-
)
|
|
176
|
-
).pipe($e);
|
|
177
|
-
}
|
|
178
|
-
async function Ci(r, e) {
|
|
179
|
-
await x.mkdir(e, { recursive: !0 });
|
|
180
|
-
const t = [], s = await nr(e, t).parseAsync(r), a = await Promise.all(
|
|
181
|
-
t.map(async (c) => {
|
|
182
|
-
const R = await x.readFile(T.resolve(e, c)), n = Buffer.from(await crypto.subtle.digest("sha-256", R)).toString("hex");
|
|
183
|
-
return { name: c, size: R.length, sha256: n };
|
|
184
|
-
})
|
|
185
|
-
), o = Vt.parse({
|
|
186
|
-
schema: "v2",
|
|
187
|
-
description: s,
|
|
188
|
-
files: a
|
|
189
|
-
});
|
|
190
|
-
return await x.writeFile(T.resolve(e, Xt), JSON.stringify(o)), o;
|
|
191
|
-
}
|
|
192
|
-
async function Oe(r, e) {
|
|
193
|
-
try {
|
|
194
|
-
return e(await x.readFile(r));
|
|
195
|
-
} catch (t) {
|
|
196
|
-
if (t.code == "ENOENT") return;
|
|
197
|
-
throw new Error("", { cause: t });
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
const ge = "block", ir = /(?:@[a-zA-Z0-9-.]+\/)?(?<organization>[a-zA-Z0-9-]+)\.(?<name>[a-zA-Z0-9-]+)/;
|
|
201
|
-
function ht(r) {
|
|
202
|
-
const e = r.match(ir);
|
|
203
|
-
if (!e)
|
|
204
|
-
throw new Error(
|
|
205
|
-
`Malformed package name (${r}), can't infer organization and block pack name.`
|
|
206
|
-
);
|
|
207
|
-
const { name: t, organization: s } = e.groups;
|
|
208
|
-
return { name: t, organization: s };
|
|
209
|
-
}
|
|
210
|
-
async function Fi(r) {
|
|
211
|
-
const e = T.resolve(r, "package.json");
|
|
212
|
-
try {
|
|
213
|
-
const t = await Oe(
|
|
214
|
-
e,
|
|
215
|
-
(c) => JSON.parse(c.toString("utf-8"))
|
|
216
|
-
);
|
|
217
|
-
if (t === void 0) return;
|
|
218
|
-
const s = t[ge];
|
|
219
|
-
if (s === void 0) return;
|
|
220
|
-
const a = {
|
|
221
|
-
...ct.parse(s),
|
|
222
|
-
id: {
|
|
223
|
-
...ht(
|
|
224
|
-
ft(t.name, `"name" not found in ${e}`)
|
|
225
|
-
),
|
|
226
|
-
version: Ne.parse(t.version)
|
|
227
|
-
}
|
|
228
|
-
}, o = await ut(r).safeParseAsync(a);
|
|
229
|
-
return o.success ? o.data : void 0;
|
|
230
|
-
} catch {
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
async function ar(r) {
|
|
235
|
-
const e = T.resolve(r, "package.json"), t = JSON.parse(await x.readFile(e, { encoding: "utf-8" })), s = t[ge];
|
|
236
|
-
if (s === void 0)
|
|
237
|
-
throw new Error(
|
|
238
|
-
`Block description (field ${ge}) not found in ${e}.`
|
|
239
|
-
);
|
|
240
|
-
return {
|
|
241
|
-
...ct.parse(s),
|
|
242
|
-
id: {
|
|
243
|
-
...ht(
|
|
244
|
-
ft(t.name, `"name" not found in ${e}`)
|
|
245
|
-
),
|
|
246
|
-
version: Ne.parse(t.version)
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
async function Di(r) {
|
|
251
|
-
const e = await ar(r);
|
|
252
|
-
return await ut(r).parseAsync(e);
|
|
253
|
-
}
|
|
254
|
-
class or {
|
|
255
|
-
constructor(e, t, s) {
|
|
256
|
-
this.client = e, this.bucket = t, this.root = s;
|
|
257
|
-
}
|
|
258
|
-
async getFile(e) {
|
|
259
|
-
try {
|
|
260
|
-
return Buffer.from(
|
|
261
|
-
await (await this.client.getObject({
|
|
262
|
-
Bucket: this.bucket,
|
|
263
|
-
Key: G.join(this.root, e)
|
|
264
|
-
})).Body.transformToByteArray()
|
|
265
|
-
);
|
|
266
|
-
} catch (t) {
|
|
267
|
-
if (t.name === "NoSuchKey") return;
|
|
268
|
-
throw t;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
async listFiles(e) {
|
|
272
|
-
const t = G.join(this.root, e), s = qt(
|
|
273
|
-
{ client: this.client },
|
|
274
|
-
{
|
|
275
|
-
Bucket: this.bucket,
|
|
276
|
-
Prefix: t
|
|
277
|
-
}
|
|
278
|
-
), a = [];
|
|
279
|
-
for await (const o of s)
|
|
280
|
-
a.push(...o.Contents.map((c) => G.relative(t, c.Key)));
|
|
281
|
-
return a;
|
|
282
|
-
}
|
|
283
|
-
async putFile(e, t) {
|
|
284
|
-
await this.client.putObject({
|
|
285
|
-
Bucket: this.bucket,
|
|
286
|
-
Key: G.join(this.root, e),
|
|
287
|
-
Body: t
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
async deleteFiles(...e) {
|
|
291
|
-
const t = await this.client.deleteObjects({
|
|
292
|
-
Bucket: this.bucket,
|
|
293
|
-
Delete: {
|
|
294
|
-
Objects: e.map((s) => ({
|
|
295
|
-
Key: G.join(this.root, s)
|
|
296
|
-
}))
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
if (t.Errors !== void 0 && t.Errors.length > 0)
|
|
300
|
-
throw new Error(`Errors encountered while deleting files: ${t.Errors.join(`
|
|
301
|
-
`)}`);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
class cr {
|
|
305
|
-
constructor(e) {
|
|
306
|
-
/** Absolute path */
|
|
307
|
-
W(this, "root");
|
|
308
|
-
this.root = T.resolve(e);
|
|
309
|
-
}
|
|
310
|
-
toAbsolutePath(e) {
|
|
311
|
-
if (G.isAbsolute(e)) throw new Error("absolute path");
|
|
312
|
-
return T.resolve(this.root, e.split(G.sep).join(T.sep));
|
|
313
|
-
}
|
|
314
|
-
async getFile(e) {
|
|
315
|
-
try {
|
|
316
|
-
return await H.promises.readFile(this.toAbsolutePath(e));
|
|
317
|
-
} catch (t) {
|
|
318
|
-
if (t.code == "ENOENT") return;
|
|
319
|
-
throw new Error("", { cause: t });
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
async listFiles(e) {
|
|
323
|
-
try {
|
|
324
|
-
const t = this.toAbsolutePath(e);
|
|
325
|
-
return (await H.promises.readdir(t, { recursive: !0, withFileTypes: !0 })).filter((s) => s.isFile()).map(
|
|
326
|
-
(s) => T.relative(t, T.resolve(s.path, s.name)).split(T.sep).join(G.sep)
|
|
327
|
-
);
|
|
328
|
-
} catch (t) {
|
|
329
|
-
if (t.code == "ENOENT") return [];
|
|
330
|
-
throw new Error("", { cause: t });
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
async putFile(e, t) {
|
|
334
|
-
const s = this.toAbsolutePath(e);
|
|
335
|
-
await H.promises.mkdir(T.dirname(s), { recursive: !0 }), await H.promises.writeFile(s, t);
|
|
336
|
-
}
|
|
337
|
-
async deleteFiles(...e) {
|
|
338
|
-
for (const t of e) await H.promises.rm(this.toAbsolutePath(t));
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
function lr(r) {
|
|
342
|
-
const e = new URL(r, `file:${T.resolve(".").split(T.sep).join(G.sep)}/`);
|
|
343
|
-
switch (e.protocol) {
|
|
344
|
-
case "file:":
|
|
345
|
-
const t = T.resolve(e.pathname);
|
|
346
|
-
return new cr(t);
|
|
347
|
-
case "s3:":
|
|
348
|
-
const s = {}, a = e.searchParams.get("region");
|
|
349
|
-
a && (s.region = a);
|
|
350
|
-
const o = e.hostname;
|
|
351
|
-
return new or(new Jt(s), o, e.pathname.replace(/^\//, ""));
|
|
352
|
-
default:
|
|
353
|
-
throw new Error(`Unknown protocol: ${e.protocol}`);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
function fr(r) {
|
|
357
|
-
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
358
|
-
}
|
|
359
|
-
var de = { exports: {} };
|
|
360
|
-
const ur = "2.0.0", pt = 256, hr = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
361
|
-
9007199254740991, pr = 16, Er = pt - 6, $r = [
|
|
362
|
-
"major",
|
|
363
|
-
"premajor",
|
|
364
|
-
"minor",
|
|
365
|
-
"preminor",
|
|
366
|
-
"patch",
|
|
367
|
-
"prepatch",
|
|
368
|
-
"prerelease"
|
|
369
|
-
];
|
|
370
|
-
var te = {
|
|
371
|
-
MAX_LENGTH: pt,
|
|
372
|
-
MAX_SAFE_COMPONENT_LENGTH: pr,
|
|
373
|
-
MAX_SAFE_BUILD_LENGTH: Er,
|
|
374
|
-
MAX_SAFE_INTEGER: hr,
|
|
375
|
-
RELEASE_TYPES: $r,
|
|
376
|
-
SEMVER_SPEC_VERSION: ur,
|
|
377
|
-
FLAG_INCLUDE_PRERELEASE: 1,
|
|
378
|
-
FLAG_LOOSE: 2
|
|
379
|
-
};
|
|
380
|
-
const mr = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...r) => console.error("SEMVER", ...r) : () => {
|
|
381
|
-
};
|
|
382
|
-
var re = mr;
|
|
383
|
-
(function(r, e) {
|
|
384
|
-
const {
|
|
385
|
-
MAX_SAFE_COMPONENT_LENGTH: t,
|
|
386
|
-
MAX_SAFE_BUILD_LENGTH: s,
|
|
387
|
-
MAX_LENGTH: a
|
|
388
|
-
} = te, o = re;
|
|
389
|
-
e = r.exports = {};
|
|
390
|
-
const c = e.re = [], R = e.safeRe = [], n = e.src = [], i = e.t = {};
|
|
391
|
-
let f = 0;
|
|
392
|
-
const p = "[a-zA-Z0-9-]", N = [
|
|
393
|
-
["\\s", 1],
|
|
394
|
-
["\\d", a],
|
|
395
|
-
[p, s]
|
|
396
|
-
], E = (C) => {
|
|
397
|
-
for (const [A, L] of N)
|
|
398
|
-
C = C.split(`${A}*`).join(`${A}{0,${L}}`).split(`${A}+`).join(`${A}{1,${L}}`);
|
|
399
|
-
return C;
|
|
400
|
-
}, u = (C, A, L) => {
|
|
401
|
-
const k = E(A), I = f++;
|
|
402
|
-
o(C, I, A), i[C] = I, n[I] = A, c[I] = new RegExp(A, L ? "g" : void 0), R[I] = new RegExp(k, L ? "g" : void 0);
|
|
403
|
-
};
|
|
404
|
-
u("NUMERICIDENTIFIER", "0|[1-9]\\d*"), u("NUMERICIDENTIFIERLOOSE", "\\d+"), u("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${p}*`), u("MAINVERSION", `(${n[i.NUMERICIDENTIFIER]})\\.(${n[i.NUMERICIDENTIFIER]})\\.(${n[i.NUMERICIDENTIFIER]})`), u("MAINVERSIONLOOSE", `(${n[i.NUMERICIDENTIFIERLOOSE]})\\.(${n[i.NUMERICIDENTIFIERLOOSE]})\\.(${n[i.NUMERICIDENTIFIERLOOSE]})`), u("PRERELEASEIDENTIFIER", `(?:${n[i.NUMERICIDENTIFIER]}|${n[i.NONNUMERICIDENTIFIER]})`), u("PRERELEASEIDENTIFIERLOOSE", `(?:${n[i.NUMERICIDENTIFIERLOOSE]}|${n[i.NONNUMERICIDENTIFIER]})`), u("PRERELEASE", `(?:-(${n[i.PRERELEASEIDENTIFIER]}(?:\\.${n[i.PRERELEASEIDENTIFIER]})*))`), u("PRERELEASELOOSE", `(?:-?(${n[i.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${n[i.PRERELEASEIDENTIFIERLOOSE]})*))`), u("BUILDIDENTIFIER", `${p}+`), u("BUILD", `(?:\\+(${n[i.BUILDIDENTIFIER]}(?:\\.${n[i.BUILDIDENTIFIER]})*))`), u("FULLPLAIN", `v?${n[i.MAINVERSION]}${n[i.PRERELEASE]}?${n[i.BUILD]}?`), u("FULL", `^${n[i.FULLPLAIN]}$`), u("LOOSEPLAIN", `[v=\\s]*${n[i.MAINVERSIONLOOSE]}${n[i.PRERELEASELOOSE]}?${n[i.BUILD]}?`), u("LOOSE", `^${n[i.LOOSEPLAIN]}$`), u("GTLT", "((?:<|>)?=?)"), u("XRANGEIDENTIFIERLOOSE", `${n[i.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), u("XRANGEIDENTIFIER", `${n[i.NUMERICIDENTIFIER]}|x|X|\\*`), u("XRANGEPLAIN", `[v=\\s]*(${n[i.XRANGEIDENTIFIER]})(?:\\.(${n[i.XRANGEIDENTIFIER]})(?:\\.(${n[i.XRANGEIDENTIFIER]})(?:${n[i.PRERELEASE]})?${n[i.BUILD]}?)?)?`), u("XRANGEPLAINLOOSE", `[v=\\s]*(${n[i.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[i.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[i.XRANGEIDENTIFIERLOOSE]})(?:${n[i.PRERELEASELOOSE]})?${n[i.BUILD]}?)?)?`), u("XRANGE", `^${n[i.GTLT]}\\s*${n[i.XRANGEPLAIN]}$`), u("XRANGELOOSE", `^${n[i.GTLT]}\\s*${n[i.XRANGEPLAINLOOSE]}$`), u("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), u("COERCE", `${n[i.COERCEPLAIN]}(?:$|[^\\d])`), u("COERCEFULL", n[i.COERCEPLAIN] + `(?:${n[i.PRERELEASE]})?(?:${n[i.BUILD]})?(?:$|[^\\d])`), u("COERCERTL", n[i.COERCE], !0), u("COERCERTLFULL", n[i.COERCEFULL], !0), u("LONETILDE", "(?:~>?)"), u("TILDETRIM", `(\\s*)${n[i.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", u("TILDE", `^${n[i.LONETILDE]}${n[i.XRANGEPLAIN]}$`), u("TILDELOOSE", `^${n[i.LONETILDE]}${n[i.XRANGEPLAINLOOSE]}$`), u("LONECARET", "(?:\\^)"), u("CARETTRIM", `(\\s*)${n[i.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", u("CARET", `^${n[i.LONECARET]}${n[i.XRANGEPLAIN]}$`), u("CARETLOOSE", `^${n[i.LONECARET]}${n[i.XRANGEPLAINLOOSE]}$`), u("COMPARATORLOOSE", `^${n[i.GTLT]}\\s*(${n[i.LOOSEPLAIN]})$|^$`), u("COMPARATOR", `^${n[i.GTLT]}\\s*(${n[i.FULLPLAIN]})$|^$`), u("COMPARATORTRIM", `(\\s*)${n[i.GTLT]}\\s*(${n[i.LOOSEPLAIN]}|${n[i.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", u("HYPHENRANGE", `^\\s*(${n[i.XRANGEPLAIN]})\\s+-\\s+(${n[i.XRANGEPLAIN]})\\s*$`), u("HYPHENRANGELOOSE", `^\\s*(${n[i.XRANGEPLAINLOOSE]})\\s+-\\s+(${n[i.XRANGEPLAINLOOSE]})\\s*$`), u("STAR", "(<|>)?=?\\s*\\*"), u("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), u("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
405
|
-
})(de, de.exports);
|
|
406
|
-
var q = de.exports;
|
|
407
|
-
const gr = Object.freeze({ loose: !0 }), dr = Object.freeze({}), Rr = (r) => r ? typeof r != "object" ? gr : r : dr;
|
|
408
|
-
var Le = Rr;
|
|
409
|
-
const Ge = /^[0-9]+$/, Et = (r, e) => {
|
|
410
|
-
const t = Ge.test(r), s = Ge.test(e);
|
|
411
|
-
return t && s && (r = +r, e = +e), r === e ? 0 : t && !s ? -1 : s && !t ? 1 : r < e ? -1 : 1;
|
|
412
|
-
}, vr = (r, e) => Et(e, r);
|
|
413
|
-
var $t = {
|
|
414
|
-
compareIdentifiers: Et,
|
|
415
|
-
rcompareIdentifiers: vr
|
|
416
|
-
};
|
|
417
|
-
const Y = re, { MAX_LENGTH: xe, MAX_SAFE_INTEGER: K } = te, { safeRe: Ue, t: Be } = q, wr = Le, { compareIdentifiers: B } = $t;
|
|
418
|
-
let Ir = class _ {
|
|
419
|
-
constructor(e, t) {
|
|
420
|
-
if (t = wr(t), e instanceof _) {
|
|
421
|
-
if (e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease)
|
|
422
|
-
return e;
|
|
423
|
-
e = e.version;
|
|
424
|
-
} else if (typeof e != "string")
|
|
425
|
-
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
|
|
426
|
-
if (e.length > xe)
|
|
427
|
-
throw new TypeError(
|
|
428
|
-
`version is longer than ${xe} characters`
|
|
429
|
-
);
|
|
430
|
-
Y("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
|
|
431
|
-
const s = e.trim().match(t.loose ? Ue[Be.LOOSE] : Ue[Be.FULL]);
|
|
432
|
-
if (!s)
|
|
433
|
-
throw new TypeError(`Invalid Version: ${e}`);
|
|
434
|
-
if (this.raw = e, this.major = +s[1], this.minor = +s[2], this.patch = +s[3], this.major > K || this.major < 0)
|
|
435
|
-
throw new TypeError("Invalid major version");
|
|
436
|
-
if (this.minor > K || this.minor < 0)
|
|
437
|
-
throw new TypeError("Invalid minor version");
|
|
438
|
-
if (this.patch > K || this.patch < 0)
|
|
439
|
-
throw new TypeError("Invalid patch version");
|
|
440
|
-
s[4] ? this.prerelease = s[4].split(".").map((a) => {
|
|
441
|
-
if (/^[0-9]+$/.test(a)) {
|
|
442
|
-
const o = +a;
|
|
443
|
-
if (o >= 0 && o < K)
|
|
444
|
-
return o;
|
|
445
|
-
}
|
|
446
|
-
return a;
|
|
447
|
-
}) : this.prerelease = [], this.build = s[5] ? s[5].split(".") : [], this.format();
|
|
448
|
-
}
|
|
449
|
-
format() {
|
|
450
|
-
return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`), this.version;
|
|
451
|
-
}
|
|
452
|
-
toString() {
|
|
453
|
-
return this.version;
|
|
454
|
-
}
|
|
455
|
-
compare(e) {
|
|
456
|
-
if (Y("SemVer.compare", this.version, this.options, e), !(e instanceof _)) {
|
|
457
|
-
if (typeof e == "string" && e === this.version)
|
|
458
|
-
return 0;
|
|
459
|
-
e = new _(e, this.options);
|
|
460
|
-
}
|
|
461
|
-
return e.version === this.version ? 0 : this.compareMain(e) || this.comparePre(e);
|
|
462
|
-
}
|
|
463
|
-
compareMain(e) {
|
|
464
|
-
return e instanceof _ || (e = new _(e, this.options)), B(this.major, e.major) || B(this.minor, e.minor) || B(this.patch, e.patch);
|
|
465
|
-
}
|
|
466
|
-
comparePre(e) {
|
|
467
|
-
if (e instanceof _ || (e = new _(e, this.options)), this.prerelease.length && !e.prerelease.length)
|
|
468
|
-
return -1;
|
|
469
|
-
if (!this.prerelease.length && e.prerelease.length)
|
|
470
|
-
return 1;
|
|
471
|
-
if (!this.prerelease.length && !e.prerelease.length)
|
|
472
|
-
return 0;
|
|
473
|
-
let t = 0;
|
|
474
|
-
do {
|
|
475
|
-
const s = this.prerelease[t], a = e.prerelease[t];
|
|
476
|
-
if (Y("prerelease compare", t, s, a), s === void 0 && a === void 0)
|
|
477
|
-
return 0;
|
|
478
|
-
if (a === void 0)
|
|
479
|
-
return 1;
|
|
480
|
-
if (s === void 0)
|
|
481
|
-
return -1;
|
|
482
|
-
if (s === a)
|
|
483
|
-
continue;
|
|
484
|
-
return B(s, a);
|
|
485
|
-
} while (++t);
|
|
486
|
-
}
|
|
487
|
-
compareBuild(e) {
|
|
488
|
-
e instanceof _ || (e = new _(e, this.options));
|
|
489
|
-
let t = 0;
|
|
490
|
-
do {
|
|
491
|
-
const s = this.build[t], a = e.build[t];
|
|
492
|
-
if (Y("build compare", t, s, a), s === void 0 && a === void 0)
|
|
493
|
-
return 0;
|
|
494
|
-
if (a === void 0)
|
|
495
|
-
return 1;
|
|
496
|
-
if (s === void 0)
|
|
497
|
-
return -1;
|
|
498
|
-
if (s === a)
|
|
499
|
-
continue;
|
|
500
|
-
return B(s, a);
|
|
501
|
-
} while (++t);
|
|
502
|
-
}
|
|
503
|
-
// preminor will bump the version up to the next minor release, and immediately
|
|
504
|
-
// down to pre-release. premajor and prepatch work the same way.
|
|
505
|
-
inc(e, t, s) {
|
|
506
|
-
switch (e) {
|
|
507
|
-
case "premajor":
|
|
508
|
-
this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", t, s);
|
|
509
|
-
break;
|
|
510
|
-
case "preminor":
|
|
511
|
-
this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", t, s);
|
|
512
|
-
break;
|
|
513
|
-
case "prepatch":
|
|
514
|
-
this.prerelease.length = 0, this.inc("patch", t, s), this.inc("pre", t, s);
|
|
515
|
-
break;
|
|
516
|
-
case "prerelease":
|
|
517
|
-
this.prerelease.length === 0 && this.inc("patch", t, s), this.inc("pre", t, s);
|
|
518
|
-
break;
|
|
519
|
-
case "major":
|
|
520
|
-
(this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
|
|
521
|
-
break;
|
|
522
|
-
case "minor":
|
|
523
|
-
(this.patch !== 0 || this.prerelease.length === 0) && this.minor++, this.patch = 0, this.prerelease = [];
|
|
524
|
-
break;
|
|
525
|
-
case "patch":
|
|
526
|
-
this.prerelease.length === 0 && this.patch++, this.prerelease = [];
|
|
527
|
-
break;
|
|
528
|
-
case "pre": {
|
|
529
|
-
const a = Number(s) ? 1 : 0;
|
|
530
|
-
if (!t && s === !1)
|
|
531
|
-
throw new Error("invalid increment argument: identifier is empty");
|
|
532
|
-
if (this.prerelease.length === 0)
|
|
533
|
-
this.prerelease = [a];
|
|
534
|
-
else {
|
|
535
|
-
let o = this.prerelease.length;
|
|
536
|
-
for (; --o >= 0; )
|
|
537
|
-
typeof this.prerelease[o] == "number" && (this.prerelease[o]++, o = -2);
|
|
538
|
-
if (o === -1) {
|
|
539
|
-
if (t === this.prerelease.join(".") && s === !1)
|
|
540
|
-
throw new Error("invalid increment argument: identifier already exists");
|
|
541
|
-
this.prerelease.push(a);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
if (t) {
|
|
545
|
-
let o = [t, a];
|
|
546
|
-
s === !1 && (o = [t]), B(this.prerelease[0], t) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = o) : this.prerelease = o;
|
|
547
|
-
}
|
|
548
|
-
break;
|
|
549
|
-
}
|
|
550
|
-
default:
|
|
551
|
-
throw new Error(`invalid increment argument: ${e}`);
|
|
552
|
-
}
|
|
553
|
-
return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
|
|
554
|
-
}
|
|
555
|
-
};
|
|
556
|
-
var F = Ir;
|
|
557
|
-
const Ve = F, Nr = (r, e, t = !1) => {
|
|
558
|
-
if (r instanceof Ve)
|
|
559
|
-
return r;
|
|
560
|
-
try {
|
|
561
|
-
return new Ve(r, e);
|
|
562
|
-
} catch (s) {
|
|
563
|
-
if (!t)
|
|
564
|
-
return null;
|
|
565
|
-
throw s;
|
|
566
|
-
}
|
|
567
|
-
};
|
|
568
|
-
var V = Nr;
|
|
569
|
-
const Sr = V, Or = (r, e) => {
|
|
570
|
-
const t = Sr(r, e);
|
|
571
|
-
return t ? t.version : null;
|
|
572
|
-
};
|
|
573
|
-
var Lr = Or;
|
|
574
|
-
const yr = V, Pr = (r, e) => {
|
|
575
|
-
const t = yr(r.trim().replace(/^[=v]+/, ""), e);
|
|
576
|
-
return t ? t.version : null;
|
|
577
|
-
};
|
|
578
|
-
var Tr = Pr;
|
|
579
|
-
const Xe = F, Ar = (r, e, t, s, a) => {
|
|
580
|
-
typeof t == "string" && (a = s, s = t, t = void 0);
|
|
581
|
-
try {
|
|
582
|
-
return new Xe(
|
|
583
|
-
r instanceof Xe ? r.version : r,
|
|
584
|
-
t
|
|
585
|
-
).inc(e, s, a).version;
|
|
586
|
-
} catch {
|
|
587
|
-
return null;
|
|
588
|
-
}
|
|
589
|
-
};
|
|
590
|
-
var kr = Ar;
|
|
591
|
-
const ze = V, Cr = (r, e) => {
|
|
592
|
-
const t = ze(r, null, !0), s = ze(e, null, !0), a = t.compare(s);
|
|
593
|
-
if (a === 0)
|
|
594
|
-
return null;
|
|
595
|
-
const o = a > 0, c = o ? t : s, R = o ? s : t, n = !!c.prerelease.length;
|
|
596
|
-
if (!!R.prerelease.length && !n)
|
|
597
|
-
return !R.patch && !R.minor ? "major" : c.patch ? "patch" : c.minor ? "minor" : "major";
|
|
598
|
-
const f = n ? "pre" : "";
|
|
599
|
-
return t.major !== s.major ? f + "major" : t.minor !== s.minor ? f + "minor" : t.patch !== s.patch ? f + "patch" : "prerelease";
|
|
600
|
-
};
|
|
601
|
-
var Fr = Cr;
|
|
602
|
-
const Dr = F, br = (r, e) => new Dr(r, e).major;
|
|
603
|
-
var jr = br;
|
|
604
|
-
const _r = F, Gr = (r, e) => new _r(r, e).minor;
|
|
605
|
-
var xr = Gr;
|
|
606
|
-
const Ur = F, Br = (r, e) => new Ur(r, e).patch;
|
|
607
|
-
var Vr = Br;
|
|
608
|
-
const Xr = V, zr = (r, e) => {
|
|
609
|
-
const t = Xr(r, e);
|
|
610
|
-
return t && t.prerelease.length ? t.prerelease : null;
|
|
611
|
-
};
|
|
612
|
-
var Mr = zr;
|
|
613
|
-
const Me = F, Hr = (r, e, t) => new Me(r, t).compare(new Me(e, t));
|
|
614
|
-
var b = Hr;
|
|
615
|
-
const Jr = b, qr = (r, e, t) => Jr(e, r, t);
|
|
616
|
-
var Wr = qr;
|
|
617
|
-
const Yr = b, Kr = (r, e) => Yr(r, e, !0);
|
|
618
|
-
var Zr = Kr;
|
|
619
|
-
const He = F, Qr = (r, e, t) => {
|
|
620
|
-
const s = new He(r, t), a = new He(e, t);
|
|
621
|
-
return s.compare(a) || s.compareBuild(a);
|
|
622
|
-
};
|
|
623
|
-
var ye = Qr;
|
|
624
|
-
const es = ye, ts = (r, e) => r.sort((t, s) => es(t, s, e));
|
|
625
|
-
var rs = ts;
|
|
626
|
-
const ss = ye, ns = (r, e) => r.sort((t, s) => ss(s, t, e));
|
|
627
|
-
var is = ns;
|
|
628
|
-
const as = b, os = (r, e, t) => as(r, e, t) > 0;
|
|
629
|
-
var se = os;
|
|
630
|
-
const cs = b, ls = (r, e, t) => cs(r, e, t) < 0;
|
|
631
|
-
var Pe = ls;
|
|
632
|
-
const fs = b, us = (r, e, t) => fs(r, e, t) === 0;
|
|
633
|
-
var mt = us;
|
|
634
|
-
const hs = b, ps = (r, e, t) => hs(r, e, t) !== 0;
|
|
635
|
-
var gt = ps;
|
|
636
|
-
const Es = b, $s = (r, e, t) => Es(r, e, t) >= 0;
|
|
637
|
-
var Te = $s;
|
|
638
|
-
const ms = b, gs = (r, e, t) => ms(r, e, t) <= 0;
|
|
639
|
-
var Ae = gs;
|
|
640
|
-
const ds = mt, Rs = gt, vs = se, ws = Te, Is = Pe, Ns = Ae, Ss = (r, e, t, s) => {
|
|
641
|
-
switch (e) {
|
|
642
|
-
case "===":
|
|
643
|
-
return typeof r == "object" && (r = r.version), typeof t == "object" && (t = t.version), r === t;
|
|
644
|
-
case "!==":
|
|
645
|
-
return typeof r == "object" && (r = r.version), typeof t == "object" && (t = t.version), r !== t;
|
|
646
|
-
case "":
|
|
647
|
-
case "=":
|
|
648
|
-
case "==":
|
|
649
|
-
return ds(r, t, s);
|
|
650
|
-
case "!=":
|
|
651
|
-
return Rs(r, t, s);
|
|
652
|
-
case ">":
|
|
653
|
-
return vs(r, t, s);
|
|
654
|
-
case ">=":
|
|
655
|
-
return ws(r, t, s);
|
|
656
|
-
case "<":
|
|
657
|
-
return Is(r, t, s);
|
|
658
|
-
case "<=":
|
|
659
|
-
return Ns(r, t, s);
|
|
660
|
-
default:
|
|
661
|
-
throw new TypeError(`Invalid operator: ${e}`);
|
|
662
|
-
}
|
|
663
|
-
};
|
|
664
|
-
var dt = Ss;
|
|
665
|
-
const Os = F, Ls = V, { safeRe: Z, t: Q } = q, ys = (r, e) => {
|
|
666
|
-
if (r instanceof Os)
|
|
667
|
-
return r;
|
|
668
|
-
if (typeof r == "number" && (r = String(r)), typeof r != "string")
|
|
669
|
-
return null;
|
|
670
|
-
e = e || {};
|
|
671
|
-
let t = null;
|
|
672
|
-
if (!e.rtl)
|
|
673
|
-
t = r.match(e.includePrerelease ? Z[Q.COERCEFULL] : Z[Q.COERCE]);
|
|
674
|
-
else {
|
|
675
|
-
const n = e.includePrerelease ? Z[Q.COERCERTLFULL] : Z[Q.COERCERTL];
|
|
676
|
-
let i;
|
|
677
|
-
for (; (i = n.exec(r)) && (!t || t.index + t[0].length !== r.length); )
|
|
678
|
-
(!t || i.index + i[0].length !== t.index + t[0].length) && (t = i), n.lastIndex = i.index + i[1].length + i[2].length;
|
|
679
|
-
n.lastIndex = -1;
|
|
680
|
-
}
|
|
681
|
-
if (t === null)
|
|
682
|
-
return null;
|
|
683
|
-
const s = t[2], a = t[3] || "0", o = t[4] || "0", c = e.includePrerelease && t[5] ? `-${t[5]}` : "", R = e.includePrerelease && t[6] ? `+${t[6]}` : "";
|
|
684
|
-
return Ls(`${s}.${a}.${o}${c}${R}`, e);
|
|
685
|
-
};
|
|
686
|
-
var Ps = ys;
|
|
687
|
-
class Ts {
|
|
688
|
-
constructor() {
|
|
689
|
-
this.max = 1e3, this.map = /* @__PURE__ */ new Map();
|
|
690
|
-
}
|
|
691
|
-
get(e) {
|
|
692
|
-
const t = this.map.get(e);
|
|
693
|
-
if (t !== void 0)
|
|
694
|
-
return this.map.delete(e), this.map.set(e, t), t;
|
|
695
|
-
}
|
|
696
|
-
delete(e) {
|
|
697
|
-
return this.map.delete(e);
|
|
698
|
-
}
|
|
699
|
-
set(e, t) {
|
|
700
|
-
if (!this.delete(e) && t !== void 0) {
|
|
701
|
-
if (this.map.size >= this.max) {
|
|
702
|
-
const a = this.map.keys().next().value;
|
|
703
|
-
this.delete(a);
|
|
704
|
-
}
|
|
705
|
-
this.map.set(e, t);
|
|
706
|
-
}
|
|
707
|
-
return this;
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
var As = Ts, oe, Je;
|
|
711
|
-
function j() {
|
|
712
|
-
if (Je) return oe;
|
|
713
|
-
Je = 1;
|
|
714
|
-
const r = /\s+/g;
|
|
715
|
-
class e {
|
|
716
|
-
constructor(l, g) {
|
|
717
|
-
if (g = a(g), l instanceof e)
|
|
718
|
-
return l.loose === !!g.loose && l.includePrerelease === !!g.includePrerelease ? l : new e(l.raw, g);
|
|
719
|
-
if (l instanceof o)
|
|
720
|
-
return this.raw = l.value, this.set = [[l]], this.formatted = void 0, this;
|
|
721
|
-
if (this.options = g, this.loose = !!g.loose, this.includePrerelease = !!g.includePrerelease, this.raw = l.trim().replace(r, " "), this.set = this.raw.split("||").map(($) => this.parseRange($.trim())).filter(($) => $.length), !this.set.length)
|
|
722
|
-
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
723
|
-
if (this.set.length > 1) {
|
|
724
|
-
const $ = this.set[0];
|
|
725
|
-
if (this.set = this.set.filter((d) => !C(d[0])), this.set.length === 0)
|
|
726
|
-
this.set = [$];
|
|
727
|
-
else if (this.set.length > 1) {
|
|
728
|
-
for (const d of this.set)
|
|
729
|
-
if (d.length === 1 && A(d[0])) {
|
|
730
|
-
this.set = [d];
|
|
731
|
-
break;
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
this.formatted = void 0;
|
|
736
|
-
}
|
|
737
|
-
get range() {
|
|
738
|
-
if (this.formatted === void 0) {
|
|
739
|
-
this.formatted = "";
|
|
740
|
-
for (let l = 0; l < this.set.length; l++) {
|
|
741
|
-
l > 0 && (this.formatted += "||");
|
|
742
|
-
const g = this.set[l];
|
|
743
|
-
for (let $ = 0; $ < g.length; $++)
|
|
744
|
-
$ > 0 && (this.formatted += " "), this.formatted += g[$].toString().trim();
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
return this.formatted;
|
|
748
|
-
}
|
|
749
|
-
format() {
|
|
750
|
-
return this.range;
|
|
751
|
-
}
|
|
752
|
-
toString() {
|
|
753
|
-
return this.range;
|
|
754
|
-
}
|
|
755
|
-
parseRange(l) {
|
|
756
|
-
const $ = ((this.options.includePrerelease && E) | (this.options.loose && u)) + ":" + l, d = s.get($);
|
|
757
|
-
if (d)
|
|
758
|
-
return d;
|
|
759
|
-
const m = this.options.loose, v = m ? n[i.HYPHENRANGELOOSE] : n[i.HYPHENRANGE];
|
|
760
|
-
l = l.replace(v, At(this.options.includePrerelease)), c("hyphen replace", l), l = l.replace(n[i.COMPARATORTRIM], f), c("comparator trim", l), l = l.replace(n[i.TILDETRIM], p), c("tilde trim", l), l = l.replace(n[i.CARETTRIM], N), c("caret trim", l);
|
|
761
|
-
let S = l.split(" ").map((y) => k(y, this.options)).join(" ").split(/\s+/).map((y) => Tt(y, this.options));
|
|
762
|
-
m && (S = S.filter((y) => (c("loose invalid filter", y, this.options), !!y.match(n[i.COMPARATORLOOSE])))), c("range list", S);
|
|
763
|
-
const w = /* @__PURE__ */ new Map(), O = S.map((y) => new o(y, this.options));
|
|
764
|
-
for (const y of O) {
|
|
765
|
-
if (C(y))
|
|
766
|
-
return [y];
|
|
767
|
-
w.set(y.value, y);
|
|
768
|
-
}
|
|
769
|
-
w.size > 1 && w.has("") && w.delete("");
|
|
770
|
-
const D = [...w.values()];
|
|
771
|
-
return s.set($, D), D;
|
|
772
|
-
}
|
|
773
|
-
intersects(l, g) {
|
|
774
|
-
if (!(l instanceof e))
|
|
775
|
-
throw new TypeError("a Range is required");
|
|
776
|
-
return this.set.some(($) => L($, g) && l.set.some((d) => L(d, g) && $.every((m) => d.every((v) => m.intersects(v, g)))));
|
|
777
|
-
}
|
|
778
|
-
// if ANY of the sets match ALL of its comparators, then pass
|
|
779
|
-
test(l) {
|
|
780
|
-
if (!l)
|
|
781
|
-
return !1;
|
|
782
|
-
if (typeof l == "string")
|
|
783
|
-
try {
|
|
784
|
-
l = new R(l, this.options);
|
|
785
|
-
} catch {
|
|
786
|
-
return !1;
|
|
787
|
-
}
|
|
788
|
-
for (let g = 0; g < this.set.length; g++)
|
|
789
|
-
if (kt(this.set[g], l, this.options))
|
|
790
|
-
return !0;
|
|
791
|
-
return !1;
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
oe = e;
|
|
795
|
-
const t = As, s = new t(), a = Le, o = ne(), c = re, R = F, {
|
|
796
|
-
safeRe: n,
|
|
797
|
-
t: i,
|
|
798
|
-
comparatorTrimReplace: f,
|
|
799
|
-
tildeTrimReplace: p,
|
|
800
|
-
caretTrimReplace: N
|
|
801
|
-
} = q, { FLAG_INCLUDE_PRERELEASE: E, FLAG_LOOSE: u } = te, C = (h) => h.value === "<0.0.0-0", A = (h) => h.value === "", L = (h, l) => {
|
|
802
|
-
let g = !0;
|
|
803
|
-
const $ = h.slice();
|
|
804
|
-
let d = $.pop();
|
|
805
|
-
for (; g && $.length; )
|
|
806
|
-
g = $.every((m) => d.intersects(m, l)), d = $.pop();
|
|
807
|
-
return g;
|
|
808
|
-
}, k = (h, l) => (c("comp", h, l), h = St(h, l), c("caret", h), h = X(h, l), c("tildes", h), h = Lt(h, l), c("xrange", h), h = Pt(h, l), c("stars", h), h), I = (h) => !h || h.toLowerCase() === "x" || h === "*", X = (h, l) => h.trim().split(/\s+/).map((g) => z(g, l)).join(" "), z = (h, l) => {
|
|
809
|
-
const g = l.loose ? n[i.TILDELOOSE] : n[i.TILDE];
|
|
810
|
-
return h.replace(g, ($, d, m, v, S) => {
|
|
811
|
-
c("tilde", h, $, d, m, v, S);
|
|
812
|
-
let w;
|
|
813
|
-
return I(d) ? w = "" : I(m) ? w = `>=${d}.0.0 <${+d + 1}.0.0-0` : I(v) ? w = `>=${d}.${m}.0 <${d}.${+m + 1}.0-0` : S ? (c("replaceTilde pr", S), w = `>=${d}.${m}.${v}-${S} <${d}.${+m + 1}.0-0`) : w = `>=${d}.${m}.${v} <${d}.${+m + 1}.0-0`, c("tilde return", w), w;
|
|
814
|
-
});
|
|
815
|
-
}, St = (h, l) => h.trim().split(/\s+/).map((g) => Ot(g, l)).join(" "), Ot = (h, l) => {
|
|
816
|
-
c("caret", h, l);
|
|
817
|
-
const g = l.loose ? n[i.CARETLOOSE] : n[i.CARET], $ = l.includePrerelease ? "-0" : "";
|
|
818
|
-
return h.replace(g, (d, m, v, S, w) => {
|
|
819
|
-
c("caret", h, d, m, v, S, w);
|
|
820
|
-
let O;
|
|
821
|
-
return I(m) ? O = "" : I(v) ? O = `>=${m}.0.0${$} <${+m + 1}.0.0-0` : I(S) ? m === "0" ? O = `>=${m}.${v}.0${$} <${m}.${+v + 1}.0-0` : O = `>=${m}.${v}.0${$} <${+m + 1}.0.0-0` : w ? (c("replaceCaret pr", w), m === "0" ? v === "0" ? O = `>=${m}.${v}.${S}-${w} <${m}.${v}.${+S + 1}-0` : O = `>=${m}.${v}.${S}-${w} <${m}.${+v + 1}.0-0` : O = `>=${m}.${v}.${S}-${w} <${+m + 1}.0.0-0`) : (c("no pr"), m === "0" ? v === "0" ? O = `>=${m}.${v}.${S}${$} <${m}.${v}.${+S + 1}-0` : O = `>=${m}.${v}.${S}${$} <${m}.${+v + 1}.0-0` : O = `>=${m}.${v}.${S} <${+m + 1}.0.0-0`), c("caret return", O), O;
|
|
822
|
-
});
|
|
823
|
-
}, Lt = (h, l) => (c("replaceXRanges", h, l), h.split(/\s+/).map((g) => yt(g, l)).join(" ")), yt = (h, l) => {
|
|
824
|
-
h = h.trim();
|
|
825
|
-
const g = l.loose ? n[i.XRANGELOOSE] : n[i.XRANGE];
|
|
826
|
-
return h.replace(g, ($, d, m, v, S, w) => {
|
|
827
|
-
c("xRange", h, $, d, m, v, S, w);
|
|
828
|
-
const O = I(m), D = O || I(v), y = D || I(S), M = y;
|
|
829
|
-
return d === "=" && M && (d = ""), w = l.includePrerelease ? "-0" : "", O ? d === ">" || d === "<" ? $ = "<0.0.0-0" : $ = "*" : d && M ? (D && (v = 0), S = 0, d === ">" ? (d = ">=", D ? (m = +m + 1, v = 0, S = 0) : (v = +v + 1, S = 0)) : d === "<=" && (d = "<", D ? m = +m + 1 : v = +v + 1), d === "<" && (w = "-0"), $ = `${d + m}.${v}.${S}${w}`) : D ? $ = `>=${m}.0.0${w} <${+m + 1}.0.0-0` : y && ($ = `>=${m}.${v}.0${w} <${m}.${+v + 1}.0-0`), c("xRange return", $), $;
|
|
830
|
-
});
|
|
831
|
-
}, Pt = (h, l) => (c("replaceStars", h, l), h.trim().replace(n[i.STAR], "")), Tt = (h, l) => (c("replaceGTE0", h, l), h.trim().replace(n[l.includePrerelease ? i.GTE0PRE : i.GTE0], "")), At = (h) => (l, g, $, d, m, v, S, w, O, D, y, M) => (I($) ? g = "" : I(d) ? g = `>=${$}.0.0${h ? "-0" : ""}` : I(m) ? g = `>=${$}.${d}.0${h ? "-0" : ""}` : v ? g = `>=${g}` : g = `>=${g}${h ? "-0" : ""}`, I(O) ? w = "" : I(D) ? w = `<${+O + 1}.0.0-0` : I(y) ? w = `<${O}.${+D + 1}.0-0` : M ? w = `<=${O}.${D}.${y}-${M}` : h ? w = `<${O}.${D}.${+y + 1}-0` : w = `<=${w}`, `${g} ${w}`.trim()), kt = (h, l, g) => {
|
|
832
|
-
for (let $ = 0; $ < h.length; $++)
|
|
833
|
-
if (!h[$].test(l))
|
|
834
|
-
return !1;
|
|
835
|
-
if (l.prerelease.length && !g.includePrerelease) {
|
|
836
|
-
for (let $ = 0; $ < h.length; $++)
|
|
837
|
-
if (c(h[$].semver), h[$].semver !== o.ANY && h[$].semver.prerelease.length > 0) {
|
|
838
|
-
const d = h[$].semver;
|
|
839
|
-
if (d.major === l.major && d.minor === l.minor && d.patch === l.patch)
|
|
840
|
-
return !0;
|
|
841
|
-
}
|
|
842
|
-
return !1;
|
|
843
|
-
}
|
|
844
|
-
return !0;
|
|
845
|
-
};
|
|
846
|
-
return oe;
|
|
847
|
-
}
|
|
848
|
-
var ce, qe;
|
|
849
|
-
function ne() {
|
|
850
|
-
if (qe) return ce;
|
|
851
|
-
qe = 1;
|
|
852
|
-
const r = Symbol("SemVer ANY");
|
|
853
|
-
class e {
|
|
854
|
-
static get ANY() {
|
|
855
|
-
return r;
|
|
856
|
-
}
|
|
857
|
-
constructor(f, p) {
|
|
858
|
-
if (p = t(p), f instanceof e) {
|
|
859
|
-
if (f.loose === !!p.loose)
|
|
860
|
-
return f;
|
|
861
|
-
f = f.value;
|
|
862
|
-
}
|
|
863
|
-
f = f.trim().split(/\s+/).join(" "), c("comparator", f, p), this.options = p, this.loose = !!p.loose, this.parse(f), this.semver === r ? this.value = "" : this.value = this.operator + this.semver.version, c("comp", this);
|
|
864
|
-
}
|
|
865
|
-
parse(f) {
|
|
866
|
-
const p = this.options.loose ? s[a.COMPARATORLOOSE] : s[a.COMPARATOR], N = f.match(p);
|
|
867
|
-
if (!N)
|
|
868
|
-
throw new TypeError(`Invalid comparator: ${f}`);
|
|
869
|
-
this.operator = N[1] !== void 0 ? N[1] : "", this.operator === "=" && (this.operator = ""), N[2] ? this.semver = new R(N[2], this.options.loose) : this.semver = r;
|
|
870
|
-
}
|
|
871
|
-
toString() {
|
|
872
|
-
return this.value;
|
|
873
|
-
}
|
|
874
|
-
test(f) {
|
|
875
|
-
if (c("Comparator.test", f, this.options.loose), this.semver === r || f === r)
|
|
876
|
-
return !0;
|
|
877
|
-
if (typeof f == "string")
|
|
878
|
-
try {
|
|
879
|
-
f = new R(f, this.options);
|
|
880
|
-
} catch {
|
|
881
|
-
return !1;
|
|
882
|
-
}
|
|
883
|
-
return o(f, this.operator, this.semver, this.options);
|
|
884
|
-
}
|
|
885
|
-
intersects(f, p) {
|
|
886
|
-
if (!(f instanceof e))
|
|
887
|
-
throw new TypeError("a Comparator is required");
|
|
888
|
-
return this.operator === "" ? this.value === "" ? !0 : new n(f.value, p).test(this.value) : f.operator === "" ? f.value === "" ? !0 : new n(this.value, p).test(f.semver) : (p = t(p), p.includePrerelease && (this.value === "<0.0.0-0" || f.value === "<0.0.0-0") || !p.includePrerelease && (this.value.startsWith("<0.0.0") || f.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && f.operator.startsWith(">") || this.operator.startsWith("<") && f.operator.startsWith("<") || this.semver.version === f.semver.version && this.operator.includes("=") && f.operator.includes("=") || o(this.semver, "<", f.semver, p) && this.operator.startsWith(">") && f.operator.startsWith("<") || o(this.semver, ">", f.semver, p) && this.operator.startsWith("<") && f.operator.startsWith(">")));
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
ce = e;
|
|
892
|
-
const t = Le, { safeRe: s, t: a } = q, o = dt, c = re, R = F, n = j();
|
|
893
|
-
return ce;
|
|
894
|
-
}
|
|
895
|
-
const ks = j(), Cs = (r, e, t) => {
|
|
896
|
-
try {
|
|
897
|
-
e = new ks(e, t);
|
|
898
|
-
} catch {
|
|
899
|
-
return !1;
|
|
900
|
-
}
|
|
901
|
-
return e.test(r);
|
|
902
|
-
};
|
|
903
|
-
var ie = Cs;
|
|
904
|
-
const Fs = j(), Ds = (r, e) => new Fs(r, e).set.map((t) => t.map((s) => s.value).join(" ").trim().split(" "));
|
|
905
|
-
var bs = Ds;
|
|
906
|
-
const js = F, _s = j(), Gs = (r, e, t) => {
|
|
907
|
-
let s = null, a = null, o = null;
|
|
908
|
-
try {
|
|
909
|
-
o = new _s(e, t);
|
|
910
|
-
} catch {
|
|
911
|
-
return null;
|
|
912
|
-
}
|
|
913
|
-
return r.forEach((c) => {
|
|
914
|
-
o.test(c) && (!s || a.compare(c) === -1) && (s = c, a = new js(s, t));
|
|
915
|
-
}), s;
|
|
916
|
-
};
|
|
917
|
-
var xs = Gs;
|
|
918
|
-
const Us = F, Bs = j(), Vs = (r, e, t) => {
|
|
919
|
-
let s = null, a = null, o = null;
|
|
920
|
-
try {
|
|
921
|
-
o = new Bs(e, t);
|
|
922
|
-
} catch {
|
|
923
|
-
return null;
|
|
924
|
-
}
|
|
925
|
-
return r.forEach((c) => {
|
|
926
|
-
o.test(c) && (!s || a.compare(c) === 1) && (s = c, a = new Us(s, t));
|
|
927
|
-
}), s;
|
|
928
|
-
};
|
|
929
|
-
var Xs = Vs;
|
|
930
|
-
const le = F, zs = j(), We = se, Ms = (r, e) => {
|
|
931
|
-
r = new zs(r, e);
|
|
932
|
-
let t = new le("0.0.0");
|
|
933
|
-
if (r.test(t) || (t = new le("0.0.0-0"), r.test(t)))
|
|
934
|
-
return t;
|
|
935
|
-
t = null;
|
|
936
|
-
for (let s = 0; s < r.set.length; ++s) {
|
|
937
|
-
const a = r.set[s];
|
|
938
|
-
let o = null;
|
|
939
|
-
a.forEach((c) => {
|
|
940
|
-
const R = new le(c.semver.version);
|
|
941
|
-
switch (c.operator) {
|
|
942
|
-
case ">":
|
|
943
|
-
R.prerelease.length === 0 ? R.patch++ : R.prerelease.push(0), R.raw = R.format();
|
|
944
|
-
case "":
|
|
945
|
-
case ">=":
|
|
946
|
-
(!o || We(R, o)) && (o = R);
|
|
947
|
-
break;
|
|
948
|
-
case "<":
|
|
949
|
-
case "<=":
|
|
950
|
-
break;
|
|
951
|
-
default:
|
|
952
|
-
throw new Error(`Unexpected operation: ${c.operator}`);
|
|
953
|
-
}
|
|
954
|
-
}), o && (!t || We(t, o)) && (t = o);
|
|
955
|
-
}
|
|
956
|
-
return t && r.test(t) ? t : null;
|
|
957
|
-
};
|
|
958
|
-
var Hs = Ms;
|
|
959
|
-
const Js = j(), qs = (r, e) => {
|
|
960
|
-
try {
|
|
961
|
-
return new Js(r, e).range || "*";
|
|
962
|
-
} catch {
|
|
963
|
-
return null;
|
|
964
|
-
}
|
|
965
|
-
};
|
|
966
|
-
var Ws = qs;
|
|
967
|
-
const Ys = F, Rt = ne(), { ANY: Ks } = Rt, Zs = j(), Qs = ie, Ye = se, Ke = Pe, en = Ae, tn = Te, rn = (r, e, t, s) => {
|
|
968
|
-
r = new Ys(r, s), e = new Zs(e, s);
|
|
969
|
-
let a, o, c, R, n;
|
|
970
|
-
switch (t) {
|
|
971
|
-
case ">":
|
|
972
|
-
a = Ye, o = en, c = Ke, R = ">", n = ">=";
|
|
973
|
-
break;
|
|
974
|
-
case "<":
|
|
975
|
-
a = Ke, o = tn, c = Ye, R = "<", n = "<=";
|
|
976
|
-
break;
|
|
977
|
-
default:
|
|
978
|
-
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
979
|
-
}
|
|
980
|
-
if (Qs(r, e, s))
|
|
981
|
-
return !1;
|
|
982
|
-
for (let i = 0; i < e.set.length; ++i) {
|
|
983
|
-
const f = e.set[i];
|
|
984
|
-
let p = null, N = null;
|
|
985
|
-
if (f.forEach((E) => {
|
|
986
|
-
E.semver === Ks && (E = new Rt(">=0.0.0")), p = p || E, N = N || E, a(E.semver, p.semver, s) ? p = E : c(E.semver, N.semver, s) && (N = E);
|
|
987
|
-
}), p.operator === R || p.operator === n || (!N.operator || N.operator === R) && o(r, N.semver))
|
|
988
|
-
return !1;
|
|
989
|
-
if (N.operator === n && c(r, N.semver))
|
|
990
|
-
return !1;
|
|
991
|
-
}
|
|
992
|
-
return !0;
|
|
993
|
-
};
|
|
994
|
-
var ke = rn;
|
|
995
|
-
const sn = ke, nn = (r, e, t) => sn(r, e, ">", t);
|
|
996
|
-
var an = nn;
|
|
997
|
-
const on = ke, cn = (r, e, t) => on(r, e, "<", t);
|
|
998
|
-
var ln = cn;
|
|
999
|
-
const Ze = j(), fn = (r, e, t) => (r = new Ze(r, t), e = new Ze(e, t), r.intersects(e, t));
|
|
1000
|
-
var un = fn;
|
|
1001
|
-
const hn = ie, pn = b;
|
|
1002
|
-
var En = (r, e, t) => {
|
|
1003
|
-
const s = [];
|
|
1004
|
-
let a = null, o = null;
|
|
1005
|
-
const c = r.sort((f, p) => pn(f, p, t));
|
|
1006
|
-
for (const f of c)
|
|
1007
|
-
hn(f, e, t) ? (o = f, a || (a = f)) : (o && s.push([a, o]), o = null, a = null);
|
|
1008
|
-
a && s.push([a, null]);
|
|
1009
|
-
const R = [];
|
|
1010
|
-
for (const [f, p] of s)
|
|
1011
|
-
f === p ? R.push(f) : !p && f === c[0] ? R.push("*") : p ? f === c[0] ? R.push(`<=${p}`) : R.push(`${f} - ${p}`) : R.push(`>=${f}`);
|
|
1012
|
-
const n = R.join(" || "), i = typeof e.raw == "string" ? e.raw : String(e);
|
|
1013
|
-
return n.length < i.length ? n : e;
|
|
1014
|
-
};
|
|
1015
|
-
const Qe = j(), Ce = ne(), { ANY: fe } = Ce, J = ie, Fe = b, $n = (r, e, t = {}) => {
|
|
1016
|
-
if (r === e)
|
|
1017
|
-
return !0;
|
|
1018
|
-
r = new Qe(r, t), e = new Qe(e, t);
|
|
1019
|
-
let s = !1;
|
|
1020
|
-
e: for (const a of r.set) {
|
|
1021
|
-
for (const o of e.set) {
|
|
1022
|
-
const c = gn(a, o, t);
|
|
1023
|
-
if (s = s || c !== null, c)
|
|
1024
|
-
continue e;
|
|
1025
|
-
}
|
|
1026
|
-
if (s)
|
|
1027
|
-
return !1;
|
|
1028
|
-
}
|
|
1029
|
-
return !0;
|
|
1030
|
-
}, mn = [new Ce(">=0.0.0-0")], et = [new Ce(">=0.0.0")], gn = (r, e, t) => {
|
|
1031
|
-
if (r === e)
|
|
1032
|
-
return !0;
|
|
1033
|
-
if (r.length === 1 && r[0].semver === fe) {
|
|
1034
|
-
if (e.length === 1 && e[0].semver === fe)
|
|
1035
|
-
return !0;
|
|
1036
|
-
t.includePrerelease ? r = mn : r = et;
|
|
1037
|
-
}
|
|
1038
|
-
if (e.length === 1 && e[0].semver === fe) {
|
|
1039
|
-
if (t.includePrerelease)
|
|
1040
|
-
return !0;
|
|
1041
|
-
e = et;
|
|
1042
|
-
}
|
|
1043
|
-
const s = /* @__PURE__ */ new Set();
|
|
1044
|
-
let a, o;
|
|
1045
|
-
for (const E of r)
|
|
1046
|
-
E.operator === ">" || E.operator === ">=" ? a = tt(a, E, t) : E.operator === "<" || E.operator === "<=" ? o = rt(o, E, t) : s.add(E.semver);
|
|
1047
|
-
if (s.size > 1)
|
|
1048
|
-
return null;
|
|
1049
|
-
let c;
|
|
1050
|
-
if (a && o) {
|
|
1051
|
-
if (c = Fe(a.semver, o.semver, t), c > 0)
|
|
1052
|
-
return null;
|
|
1053
|
-
if (c === 0 && (a.operator !== ">=" || o.operator !== "<="))
|
|
1054
|
-
return null;
|
|
1055
|
-
}
|
|
1056
|
-
for (const E of s) {
|
|
1057
|
-
if (a && !J(E, String(a), t) || o && !J(E, String(o), t))
|
|
1058
|
-
return null;
|
|
1059
|
-
for (const u of e)
|
|
1060
|
-
if (!J(E, String(u), t))
|
|
1061
|
-
return !1;
|
|
1062
|
-
return !0;
|
|
1063
|
-
}
|
|
1064
|
-
let R, n, i, f, p = o && !t.includePrerelease && o.semver.prerelease.length ? o.semver : !1, N = a && !t.includePrerelease && a.semver.prerelease.length ? a.semver : !1;
|
|
1065
|
-
p && p.prerelease.length === 1 && o.operator === "<" && p.prerelease[0] === 0 && (p = !1);
|
|
1066
|
-
for (const E of e) {
|
|
1067
|
-
if (f = f || E.operator === ">" || E.operator === ">=", i = i || E.operator === "<" || E.operator === "<=", a) {
|
|
1068
|
-
if (N && E.semver.prerelease && E.semver.prerelease.length && E.semver.major === N.major && E.semver.minor === N.minor && E.semver.patch === N.patch && (N = !1), E.operator === ">" || E.operator === ">=") {
|
|
1069
|
-
if (R = tt(a, E, t), R === E && R !== a)
|
|
1070
|
-
return !1;
|
|
1071
|
-
} else if (a.operator === ">=" && !J(a.semver, String(E), t))
|
|
1072
|
-
return !1;
|
|
1073
|
-
}
|
|
1074
|
-
if (o) {
|
|
1075
|
-
if (p && E.semver.prerelease && E.semver.prerelease.length && E.semver.major === p.major && E.semver.minor === p.minor && E.semver.patch === p.patch && (p = !1), E.operator === "<" || E.operator === "<=") {
|
|
1076
|
-
if (n = rt(o, E, t), n === E && n !== o)
|
|
1077
|
-
return !1;
|
|
1078
|
-
} else if (o.operator === "<=" && !J(o.semver, String(E), t))
|
|
1079
|
-
return !1;
|
|
1080
|
-
}
|
|
1081
|
-
if (!E.operator && (o || a) && c !== 0)
|
|
1082
|
-
return !1;
|
|
1083
|
-
}
|
|
1084
|
-
return !(a && i && !o && c !== 0 || o && f && !a && c !== 0 || N || p);
|
|
1085
|
-
}, tt = (r, e, t) => {
|
|
1086
|
-
if (!r)
|
|
1087
|
-
return e;
|
|
1088
|
-
const s = Fe(r.semver, e.semver, t);
|
|
1089
|
-
return s > 0 ? r : s < 0 || e.operator === ">" && r.operator === ">=" ? e : r;
|
|
1090
|
-
}, rt = (r, e, t) => {
|
|
1091
|
-
if (!r)
|
|
1092
|
-
return e;
|
|
1093
|
-
const s = Fe(r.semver, e.semver, t);
|
|
1094
|
-
return s < 0 ? r : s > 0 || e.operator === "<" && r.operator === "<=" ? e : r;
|
|
1095
|
-
};
|
|
1096
|
-
var dn = $n;
|
|
1097
|
-
const ue = q, st = te, Rn = F, nt = $t, vn = V, wn = Lr, In = Tr, Nn = kr, Sn = Fr, On = jr, Ln = xr, yn = Vr, Pn = Mr, Tn = b, An = Wr, kn = Zr, Cn = ye, Fn = rs, Dn = is, bn = se, jn = Pe, _n = mt, Gn = gt, xn = Te, Un = Ae, Bn = dt, Vn = Ps, Xn = ne(), zn = j(), Mn = ie, Hn = bs, Jn = xs, qn = Xs, Wn = Hs, Yn = Ws, Kn = ke, Zn = an, Qn = ln, ei = un, ti = En, ri = dn;
|
|
1098
|
-
var si = {
|
|
1099
|
-
parse: vn,
|
|
1100
|
-
valid: wn,
|
|
1101
|
-
clean: In,
|
|
1102
|
-
inc: Nn,
|
|
1103
|
-
diff: Sn,
|
|
1104
|
-
major: On,
|
|
1105
|
-
minor: Ln,
|
|
1106
|
-
patch: yn,
|
|
1107
|
-
prerelease: Pn,
|
|
1108
|
-
compare: Tn,
|
|
1109
|
-
rcompare: An,
|
|
1110
|
-
compareLoose: kn,
|
|
1111
|
-
compareBuild: Cn,
|
|
1112
|
-
sort: Fn,
|
|
1113
|
-
rsort: Dn,
|
|
1114
|
-
gt: bn,
|
|
1115
|
-
lt: jn,
|
|
1116
|
-
eq: _n,
|
|
1117
|
-
neq: Gn,
|
|
1118
|
-
gte: xn,
|
|
1119
|
-
lte: Un,
|
|
1120
|
-
cmp: Bn,
|
|
1121
|
-
coerce: Vn,
|
|
1122
|
-
Comparator: Xn,
|
|
1123
|
-
Range: zn,
|
|
1124
|
-
satisfies: Mn,
|
|
1125
|
-
toComparators: Hn,
|
|
1126
|
-
maxSatisfying: Jn,
|
|
1127
|
-
minSatisfying: qn,
|
|
1128
|
-
minVersion: Wn,
|
|
1129
|
-
validRange: Yn,
|
|
1130
|
-
outside: Kn,
|
|
1131
|
-
gtr: Zn,
|
|
1132
|
-
ltr: Qn,
|
|
1133
|
-
intersects: ei,
|
|
1134
|
-
simplifyRange: ti,
|
|
1135
|
-
subset: ri,
|
|
1136
|
-
SemVer: Rn,
|
|
1137
|
-
re: ue.re,
|
|
1138
|
-
src: ue.src,
|
|
1139
|
-
tokens: ue.t,
|
|
1140
|
-
SEMVER_SPEC_VERSION: st.SEMVER_SPEC_VERSION,
|
|
1141
|
-
RELEASE_TYPES: st.RELEASE_TYPES,
|
|
1142
|
-
compareIdentifiers: nt.compareIdentifiers,
|
|
1143
|
-
rcompareIdentifiers: nt.rcompareIdentifiers
|
|
1144
|
-
};
|
|
1145
|
-
const ni = /* @__PURE__ */ fr(si), ii = P.string().regex(/^(?:s3:|file:)/), ai = P.object({
|
|
1146
|
-
organization: P.string(),
|
|
1147
|
-
package: P.string(),
|
|
1148
|
-
version: Ne.optional(),
|
|
1149
|
-
files: P.record(P.string().regex(/^[^\/]+$/), P.string()).default({}),
|
|
1150
|
-
meta: P.object({}).passthrough()
|
|
1151
|
-
}), oi = P.object({
|
|
1152
|
-
registries: P.record(P.string(), ii).default({}),
|
|
1153
|
-
registry: P.string().optional()
|
|
1154
|
-
}), vt = oi.merge(ai).required(
|
|
1155
|
-
{ registry: !0, version: !0 }
|
|
1156
|
-
), De = vt.partial().required({
|
|
1157
|
-
registries: !0,
|
|
1158
|
-
files: !0
|
|
1159
|
-
}), ci = "pl.package.json", li = "pl.package.yaml", ae = "v1/";
|
|
1160
|
-
function bi(r) {
|
|
1161
|
-
return `${ae}${r.organization}/${r.package}/${r.version}`;
|
|
1162
|
-
}
|
|
1163
|
-
function wt(r, e) {
|
|
1164
|
-
return `${ae}${r.organization}/${r.package}/${r.version}/${e}`;
|
|
1165
|
-
}
|
|
1166
|
-
function it(r) {
|
|
1167
|
-
return `${ae}${r.organization}/${r.package}/overview.json`;
|
|
1168
|
-
}
|
|
1169
|
-
const he = `${ae}overview.json`, It = "meta.json", Re = "_updates_v1/per_package_version/";
|
|
1170
|
-
function fi(r, e) {
|
|
1171
|
-
return `${Re}${r.organization}/${r.package}/${r.version}/${e}`;
|
|
1172
|
-
}
|
|
1173
|
-
const ui = /(?<packageKeyWithoutVersion>(?<organization>[^\/]+)\/(?<pkg>[^\/]+))\/(?<version>[^\/]+)\/(?<seed>[^\/]+)$/, Nt = "_updates_v1/_global_update_in", at = "_updates_v1/_global_update_out";
|
|
1174
|
-
class hi {
|
|
1175
|
-
constructor(e, t) {
|
|
1176
|
-
this.storage = e, this.logger = t;
|
|
1177
|
-
}
|
|
1178
|
-
constructNewPackage(e) {
|
|
1179
|
-
return new pi(this.storage, e);
|
|
1180
|
-
}
|
|
1181
|
-
async updateRegistry() {
|
|
1182
|
-
var c, R, n, i, f, p, N, E;
|
|
1183
|
-
(c = this.logger) == null || c.info("Initiating registry refresh...");
|
|
1184
|
-
const e = /* @__PURE__ */ new Map(), t = [], s = await this.storage.listFiles(Re);
|
|
1185
|
-
(R = this.logger) == null || R.info("Packages to be updated:");
|
|
1186
|
-
for (const u of s) {
|
|
1187
|
-
const C = u.match(ui);
|
|
1188
|
-
if (!C) continue;
|
|
1189
|
-
t.push(u);
|
|
1190
|
-
const { packageKeyWithoutVersion: A, organization: L, pkg: k, version: I, seed: X } = C.groups;
|
|
1191
|
-
let z = e.get(A);
|
|
1192
|
-
z ? z.versions.has(I) || z.versions.add(I) : e.set(A, {
|
|
1193
|
-
package: { organization: L, package: k },
|
|
1194
|
-
versions: /* @__PURE__ */ new Set([I])
|
|
1195
|
-
}), (n = this.logger) == null || n.info(` - ${L}:${k}:${I}`);
|
|
1196
|
-
}
|
|
1197
|
-
const a = await this.storage.getFile(he);
|
|
1198
|
-
let o = a === void 0 ? [] : JSON.parse(a.toString());
|
|
1199
|
-
(i = this.logger) == null || i.info(`Global overview loaded, ${o.length} records`);
|
|
1200
|
-
for (const [, u] of e.entries()) {
|
|
1201
|
-
const C = it(u.package), A = await this.storage.getFile(C);
|
|
1202
|
-
let L = A === void 0 ? [] : JSON.parse(A.toString());
|
|
1203
|
-
(f = this.logger) == null || f.info(
|
|
1204
|
-
`Updating ${u.package.organization}:${u.package.package} overview, ${L.length} records`
|
|
1205
|
-
), L = L.filter((k) => !u.versions.has(k.version));
|
|
1206
|
-
for (const [k] of u.versions.entries()) {
|
|
1207
|
-
const I = k.toString(), X = await this.storage.getFile(
|
|
1208
|
-
wt(
|
|
1209
|
-
{
|
|
1210
|
-
...u.package,
|
|
1211
|
-
version: I
|
|
1212
|
-
},
|
|
1213
|
-
It
|
|
1214
|
-
)
|
|
1215
|
-
);
|
|
1216
|
-
X && L.push({ version: I, meta: JSON.parse(X.toString()) });
|
|
1217
|
-
}
|
|
1218
|
-
L.sort((k, I) => ni.compare(I.version, k.version)), await this.storage.putFile(C, Buffer.from(JSON.stringify(L))), (p = this.logger) == null || p.info(`Done (${L.length} records)`), o = o.filter(
|
|
1219
|
-
(k) => k.organization !== u.package.organization || k.package !== u.package.package
|
|
1220
|
-
), o.push({
|
|
1221
|
-
organization: u.package.organization,
|
|
1222
|
-
package: u.package.package,
|
|
1223
|
-
allVersions: L.map((k) => k.version).reverse(),
|
|
1224
|
-
latestVersion: L[0].version,
|
|
1225
|
-
latestMeta: L[0].meta
|
|
1226
|
-
});
|
|
1227
|
-
}
|
|
1228
|
-
await this.storage.putFile(he, Buffer.from(JSON.stringify(o))), (N = this.logger) == null || N.info(`Global overview updated (${o.length} records)`), await this.storage.deleteFiles(...t.map((u) => `${Re}${u}`)), (E = this.logger) == null || E.info("Version update requests cleared");
|
|
1229
|
-
}
|
|
1230
|
-
async updateIfNeeded(e = !1) {
|
|
1231
|
-
var a, o;
|
|
1232
|
-
(a = this.logger) == null || a.info("Checking if registry requires refresh...");
|
|
1233
|
-
const t = await this.storage.getFile(Nt), s = await this.storage.getFile(at);
|
|
1234
|
-
!e && t === void 0 && s === void 0 || !e && t !== void 0 && s !== void 0 && t.equals(s) || (await this.updateRegistry(), t && (await this.storage.putFile(at, t), (o = this.logger) == null || o.info("Refresh finished")));
|
|
1235
|
-
}
|
|
1236
|
-
async getPackageOverview(e) {
|
|
1237
|
-
const t = await this.storage.getFile(it(e));
|
|
1238
|
-
if (t !== void 0)
|
|
1239
|
-
return JSON.parse(t.toString());
|
|
1240
|
-
}
|
|
1241
|
-
async getGlobalOverview() {
|
|
1242
|
-
const e = await this.storage.getFile(he);
|
|
1243
|
-
if (e !== void 0)
|
|
1244
|
-
return JSON.parse(e.toString());
|
|
1245
|
-
}
|
|
1246
|
-
}
|
|
1247
|
-
class pi {
|
|
1248
|
-
constructor(e, t) {
|
|
1249
|
-
W(this, "metaAdded", !1);
|
|
1250
|
-
W(this, "seed", Ht());
|
|
1251
|
-
this.storage = e, this.name = t;
|
|
1252
|
-
}
|
|
1253
|
-
async addFile(e, t) {
|
|
1254
|
-
await this.storage.putFile(wt(this.name, e), t);
|
|
1255
|
-
}
|
|
1256
|
-
async writeMeta(e) {
|
|
1257
|
-
await this.addFile(It, Buffer.from(JSON.stringify(e))), this.metaAdded = !0;
|
|
1258
|
-
}
|
|
1259
|
-
async finish() {
|
|
1260
|
-
if (!this.metaAdded) throw new Error("meta not added");
|
|
1261
|
-
await this.storage.putFile(fi(this.name, this.seed), Buffer.of(0)), await this.storage.putFile(Nt, Buffer.from(this.seed));
|
|
1262
|
-
}
|
|
1263
|
-
}
|
|
1264
|
-
function U(r, e) {
|
|
1265
|
-
return e === void 0 ? r : {
|
|
1266
|
-
...r,
|
|
1267
|
-
...e,
|
|
1268
|
-
registries: { ...r.registries, ...e.registries },
|
|
1269
|
-
files: { ...r.files, ...e.files }
|
|
1270
|
-
};
|
|
1271
|
-
}
|
|
1272
|
-
async function pe(r) {
|
|
1273
|
-
return Oe(r, (e) => De.parse(JSON.parse(e.toString())));
|
|
1274
|
-
}
|
|
1275
|
-
async function Ee(r) {
|
|
1276
|
-
return Oe(r, (e) => De.parse(Mt.parse(e.toString())));
|
|
1277
|
-
}
|
|
1278
|
-
async function Ei() {
|
|
1279
|
-
let r = De.parse({});
|
|
1280
|
-
return r = U(r, await pe("./.pl.reg.json")), r = U(r, await Ee("./.pl.reg.yaml")), r = U(r, await pe(`${je.homedir()}/.pl.reg.json`)), r = U(r, await Ee(`${je.homedir()}/.pl.reg.yaml`)), r = U(r, await pe(ci)), r = U(r, await Ee(li)), r;
|
|
1281
|
-
}
|
|
1282
|
-
class $i {
|
|
1283
|
-
constructor(e) {
|
|
1284
|
-
this.conf = e;
|
|
1285
|
-
}
|
|
1286
|
-
createRegistry(e) {
|
|
1287
|
-
let t = this.conf.registry;
|
|
1288
|
-
if (!t.startsWith("file:") && !t.startsWith("s3:")) {
|
|
1289
|
-
const s = this.conf.registries[t];
|
|
1290
|
-
if (!s) throw new Error(`Registry with alias "${t}" not found`);
|
|
1291
|
-
t = s;
|
|
1292
|
-
}
|
|
1293
|
-
return new hi(lr(t), e);
|
|
1294
|
-
}
|
|
1295
|
-
get fullPackageName() {
|
|
1296
|
-
return {
|
|
1297
|
-
organization: this.conf.organization,
|
|
1298
|
-
package: this.conf.package,
|
|
1299
|
-
version: this.conf.version
|
|
1300
|
-
};
|
|
1301
|
-
}
|
|
1302
|
-
}
|
|
1303
|
-
async function ji(r) {
|
|
1304
|
-
const e = await Ei();
|
|
1305
|
-
return new $i(
|
|
1306
|
-
vt.parse(U(e, r))
|
|
1307
|
-
);
|
|
1308
|
-
}
|
|
1309
|
-
export {
|
|
1310
|
-
tr as A,
|
|
1311
|
-
Ai as B,
|
|
1312
|
-
rr as C,
|
|
1313
|
-
sr as D,
|
|
1314
|
-
ut as E,
|
|
1315
|
-
nr as F,
|
|
1316
|
-
he as G,
|
|
1317
|
-
ge as H,
|
|
1318
|
-
ht as I,
|
|
1319
|
-
Fi as J,
|
|
1320
|
-
It as M,
|
|
1321
|
-
De as P,
|
|
1322
|
-
Wt as R,
|
|
1323
|
-
er as a,
|
|
1324
|
-
Di as b,
|
|
1325
|
-
Ci as c,
|
|
1326
|
-
ki as d,
|
|
1327
|
-
lr as e,
|
|
1328
|
-
ai as f,
|
|
1329
|
-
ji as g,
|
|
1330
|
-
ci as h,
|
|
1331
|
-
li as i,
|
|
1332
|
-
oi as j,
|
|
1333
|
-
vt as k,
|
|
1334
|
-
ar as l,
|
|
1335
|
-
$i as m,
|
|
1336
|
-
it as n,
|
|
1337
|
-
wt as o,
|
|
1338
|
-
bi as p,
|
|
1339
|
-
Yt as q,
|
|
1340
|
-
_e as r,
|
|
1341
|
-
si as s,
|
|
1342
|
-
Kt as t,
|
|
1343
|
-
Zt as u,
|
|
1344
|
-
me as v,
|
|
1345
|
-
Qt as w,
|
|
1346
|
-
yi as x,
|
|
1347
|
-
Pi as y,
|
|
1348
|
-
Ti as z
|
|
1349
|
-
};
|
|
1350
|
-
//# sourceMappingURL=config-rGaQLD-7.mjs.map
|