@milaboratories/pl-middle-layer 1.22.6 → 1.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1070 -983
- package/dist/index.mjs.map +1 -1
- package/dist/mutator/template/direct_template_loader.d.ts +4 -0
- package/dist/mutator/template/direct_template_loader.d.ts.map +1 -0
- package/dist/mutator/template/template_loading.d.ts.map +1 -1
- package/package.json +8 -6
- package/src/mutator/template/direct_template_loader.ts +177 -0
- package/src/mutator/template/template_loading.ts +9 -6
package/dist/index.mjs
CHANGED
|
@@ -1,70 +1,71 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var S = (s, e, t) =>
|
|
4
|
-
import { mapValueInVOE as
|
|
1
|
+
var gs = Object.defineProperty;
|
|
2
|
+
var ms = (s, e, t) => e in s ? gs(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var S = (s, e, t) => ms(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { mapValueInVOE as Pr, executePSpecPredicate as vs, mapPObjectData as le, mapPTableDef as Or, JsRenderInternal as ys, extractConfig as $r, isConfigLambda as Ir, DefaultNavigationState as ws, extractAllColumns as Ss } from "@platforma-sdk/model";
|
|
5
5
|
export * from "@platforma-sdk/model";
|
|
6
|
-
import { AnyChannel as
|
|
6
|
+
import { AnyChannel as Re, StableChannel as ne, blockPackIdToString as jt, blockPackIdEquals as xt } from "@milaboratories/pl-model-middle-layer";
|
|
7
7
|
export * from "@milaboratories/pl-model-middle-layer";
|
|
8
|
-
import { request as ie, RetryAgent as
|
|
9
|
-
import { RegistryV1 as
|
|
8
|
+
import { request as ie, RetryAgent as bs } from "undici";
|
|
9
|
+
import { RegistryV1 as ue, tryLoadPackDescription as lt, BlockPackMetaEmbedAbsoluteBytes as Rs, RegistryV2Reader as Es, folderReaderByUrl as Cs, loadPackDescription as Vt } from "@platforma-sdk/block-tools";
|
|
10
10
|
import q from "node:fs";
|
|
11
11
|
import H from "node:path";
|
|
12
|
-
import
|
|
13
|
-
import { assertNever as
|
|
14
|
-
import * as
|
|
15
|
-
import { tryResolve as
|
|
16
|
-
import { resourceTypesEqual as ae, field as
|
|
12
|
+
import ks from "yaml";
|
|
13
|
+
import { assertNever as G, notEmpty as B, ConsoleLoggerAdapter as Ps, ConcurrencyLimitingExecutor as Os, HmacSha256Signer as Fr } from "@milaboratories/ts-helpers";
|
|
14
|
+
import * as Tr from "node:fs/promises";
|
|
15
|
+
import { tryResolve as $s } from "@milaboratories/resolve-helper";
|
|
16
|
+
import { resourceTypesEqual as ae, field as j, Pl as T, PlClient as Is, isNullResourceId as Ge, ensureResourceIdNotNull as ut, isResource as Fs, isResourceRef as Ts, isNotNullResourceId as Ut, resourceType as Fe, resourceTypeToString as As, resourceIdToString as Ar, isNotFoundError as Ls, isTimeoutOrCancelError as Ns, toGlobalResourceId as Ds, plAddressToConfig as Bs, UnauthenticatedPlClient as Gt } from "@milaboratories/pl-client";
|
|
17
17
|
export * from "@milaboratories/pl-client";
|
|
18
|
-
import { SynchronizedTreeState as
|
|
19
|
-
import { Computable as V, ChangeSource as
|
|
20
|
-
import { randomUUID as
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
|
|
18
|
+
import { SynchronizedTreeState as Lr, PlError as js, isPlTreeNodeAccessor as xs } from "@milaboratories/pl-tree";
|
|
19
|
+
import { Computable as V, ChangeSource as Jt, PollComputablePool as Vs, WatchableValue as Us } from "@milaboratories/computable";
|
|
20
|
+
import { randomUUID as Oe, createHash as Te } from "node:crypto";
|
|
21
|
+
import { parseTemplate as Gs, PlTemplateV1 as ce, PlTemplateOverrideV1 as Ee, PlTemplateLibV1 as Le, PlTemplateSoftwareV1 as we } from "@milaboratories/pl-model-backend";
|
|
22
|
+
import Nr from "denque";
|
|
23
|
+
import { Templates as Js } from "@platforma-sdk/workflow-tengo";
|
|
24
|
+
import ve from "canonicalize";
|
|
25
|
+
import Ms from "node:assert";
|
|
26
|
+
import { Scope as dt, getQuickJS as _s } from "quickjs-emscripten";
|
|
27
|
+
import { setTimeout as Dr } from "node:timers/promises";
|
|
28
|
+
import { createDownloadClient as Ks, createLogsClient as Hs, createUploadBlobClient as Ws, createUploadProgressClient as zs, DownloadDriver as Xs, UploadDriver as qs, LogsStreamDriver as Ys, LogsDriver as Zs, LsDriver as Qs, DownloadUrlDriver as eo } from "@milaboratories/pl-drivers";
|
|
29
|
+
import { PFrame as to } from "@milaboratories/pframes-node";
|
|
30
|
+
import { LRUCache as ro } from "lru-cache";
|
|
31
|
+
import { channel as so } from "node:diagnostics_channel";
|
|
32
|
+
async function Mt(s) {
|
|
32
33
|
try {
|
|
33
|
-
return await
|
|
34
|
+
return await Tr.stat(s, { bigint: !0 });
|
|
34
35
|
} catch (e) {
|
|
35
36
|
if (e.code === "ENOENT")
|
|
36
37
|
return;
|
|
37
38
|
throw e;
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
const oo = [ue.PlPackageYamlConfigFile], no = [ue.PlPackageJsonConfigFile], bt = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], Rt = ["config", "dist", "config.json"], Br = ["frontend", "dist"], _t = "block-model/dist/config.json", io = "block-ui/package.json", ao = [
|
|
42
|
+
bt,
|
|
43
|
+
Rt,
|
|
44
|
+
oo,
|
|
45
|
+
no,
|
|
46
|
+
Br
|
|
46
47
|
];
|
|
47
|
-
async function
|
|
48
|
-
return await
|
|
48
|
+
async function co(s) {
|
|
49
|
+
return await Mt(H.join(s, ...Rt)) !== void 0 || await Mt(H.join(s, ...bt)) !== void 0;
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
-
const t =
|
|
51
|
+
function Qe(s, e) {
|
|
52
|
+
const t = $s(s, e);
|
|
52
53
|
if (t === void 0) throw new Error(`Can't resolve ${e} against ${s}`);
|
|
53
54
|
return t;
|
|
54
55
|
}
|
|
55
|
-
async function
|
|
56
|
-
if (H.isAbsolute(s) || (s = H.resolve(s)), await
|
|
56
|
+
async function Kt(s, e) {
|
|
57
|
+
if (H.isAbsolute(s) || (s = H.resolve(s)), await co(s))
|
|
57
58
|
return {
|
|
58
|
-
workflow: H.join(s, ...
|
|
59
|
-
config: H.join(s, ...
|
|
60
|
-
ui: H.join(s, ...
|
|
59
|
+
workflow: H.join(s, ...bt),
|
|
60
|
+
config: H.join(s, ...Rt),
|
|
61
|
+
ui: H.join(s, ...Br)
|
|
61
62
|
};
|
|
62
63
|
{
|
|
63
|
-
const t =
|
|
64
|
+
const t = Qe(s, _t), r = Qe(s, _t), o = Qe(s, io);
|
|
64
65
|
return { workflow: t, config: r, ui: H.resolve(o, "..", "dist") };
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
|
-
async function
|
|
68
|
+
async function lo(s) {
|
|
68
69
|
try {
|
|
69
70
|
return await q.promises.readFile(s, "utf8");
|
|
70
71
|
} catch (e) {
|
|
@@ -73,7 +74,7 @@ async function to(s) {
|
|
|
73
74
|
throw e;
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
|
-
async function
|
|
77
|
+
async function uo(s) {
|
|
77
78
|
try {
|
|
78
79
|
return await q.promises.stat(s, { bigint: !0 });
|
|
79
80
|
} catch (e) {
|
|
@@ -82,21 +83,21 @@ async function ro(s) {
|
|
|
82
83
|
throw e;
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
|
-
async function
|
|
86
|
+
async function jr(s) {
|
|
86
87
|
let e = 0n;
|
|
87
|
-
for (const t of
|
|
88
|
-
const r = H.join(s, ...t), o = await
|
|
88
|
+
for (const t of ao) {
|
|
89
|
+
const r = H.join(s, ...t), o = await uo(r);
|
|
89
90
|
o !== void 0 && e < o.mtimeNs && (e = o.mtimeNs);
|
|
90
91
|
}
|
|
91
92
|
return e.toString();
|
|
92
93
|
}
|
|
93
|
-
async function
|
|
94
|
+
async function Et(s) {
|
|
94
95
|
const e = await q.promises.stat(s.components.workflow.main.file, {
|
|
95
96
|
bigint: !0
|
|
96
97
|
}), t = await q.promises.stat(s.components.model.file, { bigint: !0 });
|
|
97
98
|
return (e.mtimeNs > t.mtimeNs ? e.mtimeNs : t.mtimeNs).toString();
|
|
98
99
|
}
|
|
99
|
-
class
|
|
100
|
+
class Bl {
|
|
100
101
|
constructor(e, t, r) {
|
|
101
102
|
this.v2Provider = e, this.registries = t, this.http = r;
|
|
102
103
|
}
|
|
@@ -105,7 +106,7 @@ class Il {
|
|
|
105
106
|
switch (r.type) {
|
|
106
107
|
case "remote-v1":
|
|
107
108
|
const o = this.http !== void 0 ? { dispatcher: this.http } : {}, i = await (await ie(
|
|
108
|
-
`${r.url}/${
|
|
109
|
+
`${r.url}/${ue.GlobalOverviewPath}`,
|
|
109
110
|
o
|
|
110
111
|
)).body.json();
|
|
111
112
|
for (const c of i) {
|
|
@@ -133,7 +134,7 @@ class Il {
|
|
|
133
134
|
registryId: e.id,
|
|
134
135
|
id: m,
|
|
135
136
|
latestByChannel: {
|
|
136
|
-
[
|
|
137
|
+
[Re]: h,
|
|
137
138
|
[ne]: h
|
|
138
139
|
},
|
|
139
140
|
allVersions: c.allVersions.map((f) => ({ version: f, channels: [] }))
|
|
@@ -149,7 +150,7 @@ class Il {
|
|
|
149
150
|
...c,
|
|
150
151
|
latestByChannel: {
|
|
151
152
|
...c.latestByChannel,
|
|
152
|
-
[ne]: ((a) => a.spec.type === "from-registry-v2" ? { ...a, spec: { ...a.spec, channel: ne } } : a)(c.latestByChannel[
|
|
153
|
+
[ne]: ((a) => a.spec.type === "from-registry-v2" ? { ...a, spec: { ...a.spec, channel: ne } } : a)(c.latestByChannel[Re])
|
|
153
154
|
},
|
|
154
155
|
registryId: e.id
|
|
155
156
|
}
|
|
@@ -157,11 +158,11 @@ class Il {
|
|
|
157
158
|
case "local-dev":
|
|
158
159
|
for (const c of await q.promises.readdir(r.path, { withFileTypes: !0 })) {
|
|
159
160
|
if (!c.isDirectory()) continue;
|
|
160
|
-
const a = H.join(r.path, c.name), l = await
|
|
161
|
-
H.join(a,
|
|
161
|
+
const a = H.join(r.path, c.name), l = await lo(
|
|
162
|
+
H.join(a, ue.PlPackageYamlConfigFile)
|
|
162
163
|
);
|
|
163
164
|
if (l !== void 0) {
|
|
164
|
-
const u =
|
|
165
|
+
const u = ue.PlPackageConfigData.parse(ks.parse(l)), d = await jr(a), m = {
|
|
165
166
|
organization: u.organization,
|
|
166
167
|
name: u.package,
|
|
167
168
|
version: "DEV"
|
|
@@ -185,21 +186,21 @@ class Il {
|
|
|
185
186
|
registryId: e.id,
|
|
186
187
|
id: m,
|
|
187
188
|
latestByChannel: {
|
|
188
|
-
[
|
|
189
|
+
[Re]: h,
|
|
189
190
|
[ne]: h
|
|
190
191
|
},
|
|
191
192
|
allVersions: []
|
|
192
193
|
});
|
|
193
194
|
} else {
|
|
194
|
-
let u = a, d = await
|
|
195
|
+
let u = a, d = await lt(u);
|
|
195
196
|
if (d === void 0) {
|
|
196
197
|
for (const m of ["block", "meta"])
|
|
197
|
-
if (u = H.join(a, m), d = await
|
|
198
|
+
if (u = H.join(a, m), d = await lt(u), d !== void 0) break;
|
|
198
199
|
}
|
|
199
200
|
if (d !== void 0) {
|
|
200
|
-
const m = await
|
|
201
|
+
const m = await Et(d), h = {
|
|
201
202
|
id: d.id,
|
|
202
|
-
meta: await
|
|
203
|
+
meta: await Rs.parseAsync(d.meta),
|
|
203
204
|
spec: {
|
|
204
205
|
type: "dev-v2",
|
|
205
206
|
folder: u,
|
|
@@ -210,7 +211,7 @@ class Il {
|
|
|
210
211
|
registryId: e.id,
|
|
211
212
|
id: d.id,
|
|
212
213
|
latestByChannel: {
|
|
213
|
-
[
|
|
214
|
+
[Re]: h,
|
|
214
215
|
[ne]: h
|
|
215
216
|
},
|
|
216
217
|
allVersions: []
|
|
@@ -220,7 +221,7 @@ class Il {
|
|
|
220
221
|
}
|
|
221
222
|
return t;
|
|
222
223
|
default:
|
|
223
|
-
return
|
|
224
|
+
return G(r);
|
|
224
225
|
}
|
|
225
226
|
}
|
|
226
227
|
async listBlockPacks() {
|
|
@@ -240,7 +241,7 @@ class Il {
|
|
|
240
241
|
return await this.v2Provider.getRegistry(o.url).getSpecificOverview(t, r);
|
|
241
242
|
}
|
|
242
243
|
}
|
|
243
|
-
class
|
|
244
|
+
class po {
|
|
244
245
|
constructor(e) {
|
|
245
246
|
S(this, "registries", /* @__PURE__ */ new Map());
|
|
246
247
|
this.http = e;
|
|
@@ -248,62 +249,62 @@ class so {
|
|
|
248
249
|
getRegistry(e) {
|
|
249
250
|
const t = this.registries.get(e);
|
|
250
251
|
if (t) return t;
|
|
251
|
-
const r = new
|
|
252
|
+
const r = new Es(Cs(e, this.http));
|
|
252
253
|
return this.registries.set(e, r), r;
|
|
253
254
|
}
|
|
254
255
|
}
|
|
255
|
-
const
|
|
256
|
+
const jl = {
|
|
256
257
|
type: "remote-v2",
|
|
257
258
|
url: "https://blocks.pl-open.science/"
|
|
258
|
-
},
|
|
259
|
+
}, xl = {
|
|
259
260
|
type: "remote-v1",
|
|
260
261
|
url: "https://block.registry.platforma.bio/releases"
|
|
261
|
-
},
|
|
262
|
+
}, Vl = {
|
|
262
263
|
type: "remote-v1",
|
|
263
264
|
url: "https://block.registry.platforma.bio/dev"
|
|
264
|
-
},
|
|
265
|
+
}, ho = {
|
|
265
266
|
groups: [{ id: "default", label: "Default", blocks: [] }]
|
|
266
|
-
},
|
|
267
|
+
}, fo = {
|
|
267
268
|
stagingRefreshTimestamp: 0,
|
|
268
269
|
blocksInLimbo: []
|
|
269
|
-
},
|
|
270
|
+
}, go = {
|
|
270
271
|
label: "New Project"
|
|
271
|
-
},
|
|
272
|
-
function
|
|
273
|
-
return `${
|
|
272
|
+
}, mo = { name: "UserProject", version: "2" }, xr = "SchemaVersion", Vr = "1", Ct = "ProjectCreated", $e = "ProjectLastModified", Ie = "ProjectMeta", de = "ProjectStructure", Je = "BlockRenderingState", vo = "BlockFrontendState/", yo = /^BlockFrontendState\/(?<blockid>.*)$/;
|
|
273
|
+
function pt(s) {
|
|
274
|
+
return `${vo}${s}`;
|
|
274
275
|
}
|
|
275
|
-
const
|
|
276
|
-
function
|
|
277
|
-
return `${
|
|
276
|
+
const wo = "BlockArgsAuthor/";
|
|
277
|
+
function ht(s) {
|
|
278
|
+
return `${wo}${s}`;
|
|
278
279
|
}
|
|
279
|
-
const
|
|
280
|
-
function
|
|
281
|
-
const e = s.match(
|
|
280
|
+
const ft = "ProjectStructureAuthor";
|
|
281
|
+
function So(s) {
|
|
282
|
+
const e = s.match(yo);
|
|
282
283
|
if (e !== null)
|
|
283
284
|
return e.groups.blockid;
|
|
284
285
|
}
|
|
285
|
-
const
|
|
286
|
-
function
|
|
287
|
-
return `${
|
|
286
|
+
const bo = "__serviceTemplate_";
|
|
287
|
+
function gt(s) {
|
|
288
|
+
return `${bo}${s}`;
|
|
288
289
|
}
|
|
289
290
|
function U(s, e) {
|
|
290
291
|
return `${s}-${e}`;
|
|
291
292
|
}
|
|
292
|
-
const
|
|
293
|
-
function
|
|
294
|
-
const e = s.match(
|
|
293
|
+
const Ro = /^(?<blockId>.*)-(?<fieldName>blockPack|prodArgs|currentArgs|prodCtx|prodUiCtx|prodOutput|prodCtxPrevious|prodUiCtxPrevious|prodOutputPrevious|stagingCtx|stagingUiCtx|stagingOutput|stagingCtxPrevious|stagingUiCtxPrevious|stagingOutputPrevious)$/;
|
|
294
|
+
function Eo(s) {
|
|
295
|
+
const e = s.match(Ro);
|
|
295
296
|
if (e === null) return;
|
|
296
297
|
const { blockId: t, fieldName: r } = e.groups;
|
|
297
298
|
return { blockId: t, fieldName: r };
|
|
298
299
|
}
|
|
299
|
-
const
|
|
300
|
-
async function
|
|
301
|
-
const o = await
|
|
300
|
+
const Co = "projects", Ur = { name: "Projects", version: "1" }, ko = (s) => ae(s.type, Ur) ? s.fields : [];
|
|
301
|
+
async function Po(s, e, t, r) {
|
|
302
|
+
const o = await Lr.init(
|
|
302
303
|
s,
|
|
303
304
|
e,
|
|
304
305
|
{
|
|
305
306
|
...r.ops.defaultTreeOptions,
|
|
306
|
-
pruning:
|
|
307
|
+
pruning: ko
|
|
307
308
|
},
|
|
308
309
|
r.logger
|
|
309
310
|
);
|
|
@@ -314,7 +315,7 @@ async function yo(s, e, t, r) {
|
|
|
314
315
|
for (const u of c.listDynamicFields()) {
|
|
315
316
|
const d = c.traverse(u);
|
|
316
317
|
if (d === void 0) continue;
|
|
317
|
-
const m =
|
|
318
|
+
const m = B(d.getKeyValueAsJson(Ie)), h = B(d.getKeyValueAsJson(Ct)), f = B(d.getKeyValueAsJson($e));
|
|
318
319
|
l.push({
|
|
319
320
|
id: u,
|
|
320
321
|
rid: d.id,
|
|
@@ -327,40 +328,130 @@ async function yo(s, e, t, r) {
|
|
|
327
328
|
return l.sort((u) => -u.lastModified.valueOf()), l;
|
|
328
329
|
}).withStableType(), tree: o };
|
|
329
330
|
}
|
|
330
|
-
const
|
|
331
|
+
const Oo = {
|
|
331
332
|
name: "EphRenderTemplate",
|
|
332
333
|
version: "1"
|
|
333
|
-
},
|
|
334
|
+
}, $o = {
|
|
334
335
|
name: "RenderTemplate",
|
|
335
336
|
version: "1"
|
|
336
337
|
};
|
|
337
|
-
function
|
|
338
|
+
function Gr(s, e, t, r, o) {
|
|
338
339
|
if (o.length === 0) throw new Error("Zero output names provided");
|
|
339
|
-
const n = t ? s.createEphemeral(
|
|
340
|
+
const n = t ? s.createEphemeral(Oo) : s.createStruct($o), i = j(n, "template"), c = j(n, "inputs");
|
|
340
341
|
return s.createField(i, "Input", e), s.createField(c, "Input", T.createPlMap(s, r, t)), s.lockInputs(n), T.futureRecord(s, n, o, "Output", "outputs/");
|
|
341
342
|
}
|
|
342
|
-
const
|
|
343
|
-
function
|
|
344
|
-
return
|
|
343
|
+
const Io = { name: "BContextEnd", version: "1" }, Fo = { name: "BContext", version: "1" }, To = "id", Ao = "parent/", Lo = ["context", "result"];
|
|
344
|
+
function Ht(s, e, t) {
|
|
345
|
+
return Gr(s, e, !0, t, Lo);
|
|
345
346
|
}
|
|
346
|
-
function
|
|
347
|
-
const e = s.createEphemeral(
|
|
347
|
+
function No(s) {
|
|
348
|
+
const e = s.createEphemeral(Io);
|
|
348
349
|
return s.lock(e), e;
|
|
349
350
|
}
|
|
350
|
-
function
|
|
351
|
-
if (e.length === 0) return
|
|
351
|
+
function Do(s, e) {
|
|
352
|
+
if (e.length === 0) return No(s);
|
|
352
353
|
if (e.length === 1) return e[0];
|
|
353
|
-
const t = s.createEphemeral(
|
|
354
|
-
s.createField(
|
|
354
|
+
const t = s.createEphemeral(Fo);
|
|
355
|
+
s.createField(j(t, To), "Input", T.createPlString(s, Oe()));
|
|
355
356
|
for (let r = 0; r < e.length; r++)
|
|
356
|
-
s.createField(
|
|
357
|
+
s.createField(j(t, `${Ao}${r}`), "Input", e[r]);
|
|
357
358
|
return s.lock(t), t;
|
|
358
359
|
}
|
|
359
|
-
|
|
360
|
+
function Bo(s, e) {
|
|
361
|
+
const t = Gs(e.content), r = t.type;
|
|
362
|
+
switch (r) {
|
|
363
|
+
case "pl.tengo-template.v2":
|
|
364
|
+
return Mr(s, t);
|
|
365
|
+
default:
|
|
366
|
+
G(r);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
const Jr = {
|
|
370
|
+
hash(s, e) {
|
|
371
|
+
e.update(Le.type.name).update(Le.type.version).update(s.name).update(s.version).update(s.src);
|
|
372
|
+
},
|
|
373
|
+
render(s, e, t) {
|
|
374
|
+
return e.createValue(
|
|
375
|
+
Le.type,
|
|
376
|
+
JSON.stringify(Le.fromV2Data(s).data)
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
}, Me = {
|
|
380
|
+
hash(s, e) {
|
|
381
|
+
e.update(we.type.name).update(we.type.version).update(s.name).update(s.version).update(s.src);
|
|
382
|
+
},
|
|
383
|
+
render(s, e, t) {
|
|
384
|
+
const r = we.fromV2Data(s), o = e.createStruct(we.type, r.data);
|
|
385
|
+
return e.setKValue(o, we.metaNameKey, JSON.stringify(r.name)), e.lock(o), o;
|
|
386
|
+
}
|
|
387
|
+
}, jo = {
|
|
388
|
+
hash(s, e) {
|
|
389
|
+
e.update(ce.type.name).update(ce.type.version).update(s.hashOverride ?? "").update(s.name).update(s.version).update(s.src);
|
|
390
|
+
const t = (r) => (r.sort((o, n) => o[0] === n[0] ? 0 : o[0] < n[0] ? -1 : 1), r);
|
|
391
|
+
for (const [r, o] of t(Object.entries(s.libs ?? {})))
|
|
392
|
+
e.update("lib:" + r), Jr.hash(o, e);
|
|
393
|
+
for (const [r, o] of t(Object.entries(s.software ?? {})))
|
|
394
|
+
e.update("soft:" + r), Me.hash(o, e);
|
|
395
|
+
for (const [r, o] of t(Object.entries(s.assets ?? {})))
|
|
396
|
+
e.update("asset:" + r), Me.hash(o, e);
|
|
397
|
+
for (const [r, o] of t(Object.entries(s.templates ?? {})))
|
|
398
|
+
e.update("tpl:" + r), this.hash(o, e);
|
|
399
|
+
},
|
|
400
|
+
render(s, e, t) {
|
|
401
|
+
return e.createStruct(
|
|
402
|
+
ce.type,
|
|
403
|
+
JSON.stringify(ce.fromV2Data(s).data)
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
}, xo = {
|
|
407
|
+
hash(s, e) {
|
|
408
|
+
e.update(Ee.type.name).update(Ee.type.version).update(s.hashOverride ?? "");
|
|
409
|
+
},
|
|
410
|
+
render(s, e, t) {
|
|
411
|
+
return e.createStruct(
|
|
412
|
+
Ee.type,
|
|
413
|
+
JSON.stringify(Ee.fromV2Data(s))
|
|
414
|
+
);
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
function Mr(s, e, t) {
|
|
418
|
+
t || (t = /* @__PURE__ */ new Map());
|
|
419
|
+
const r = (c, a) => {
|
|
420
|
+
const l = Te("sha256");
|
|
421
|
+
a.hash(c, l);
|
|
422
|
+
const u = l.digest("hex");
|
|
423
|
+
if (!t.has(u)) {
|
|
424
|
+
const d = a.render(c, s, r);
|
|
425
|
+
t.set(u, d);
|
|
426
|
+
}
|
|
427
|
+
return t.get(u);
|
|
428
|
+
}, o = r(e, jo);
|
|
429
|
+
for (const [c, a] of Object.entries(e.libs ?? {})) {
|
|
430
|
+
const l = ce.libField(o, c);
|
|
431
|
+
s.createField(l, "Input"), s.setField(l, r(a, Jr));
|
|
432
|
+
}
|
|
433
|
+
for (const [c, a] of Object.entries(e.software ?? {})) {
|
|
434
|
+
const l = ce.swField(o, c);
|
|
435
|
+
s.createField(l, "Input"), s.setField(l, r(a, Me));
|
|
436
|
+
}
|
|
437
|
+
for (const [c, a] of Object.entries(e.assets ?? {})) {
|
|
438
|
+
const l = ce.swField(o, c);
|
|
439
|
+
s.createField(l, "Input"), s.setField(l, r(a, Me));
|
|
440
|
+
}
|
|
441
|
+
for (const [c, a] of Object.entries(e.templates ?? {})) {
|
|
442
|
+
const l = ce.tplField(o, c);
|
|
443
|
+
s.createField(l, "Input"), s.setField(l, Mr(s, a, t));
|
|
444
|
+
}
|
|
445
|
+
if (s.lock(o), !e.hashOverride)
|
|
446
|
+
return o;
|
|
447
|
+
const n = r(e, xo), i = Ee.tplField(n);
|
|
448
|
+
return s.createField(i, "Service"), s.setField(i, o), s.lock(o), n;
|
|
449
|
+
}
|
|
450
|
+
const Vo = { name: "TengoTemplateGet", version: "1" }, Uo = "registry", Go = "templateURI", Jo = "template", Ul = { name: "TengoTemplatePack", version: "1" }, Gl = {
|
|
360
451
|
name: "TengoTemplatePackConvert",
|
|
361
452
|
version: "1"
|
|
362
|
-
},
|
|
363
|
-
async function
|
|
453
|
+
}, Jl = "templatePack", Ml = "template";
|
|
454
|
+
async function Mo(s) {
|
|
364
455
|
switch (s.type) {
|
|
365
456
|
case "from-file":
|
|
366
457
|
return {
|
|
@@ -371,55 +462,51 @@ async function Bo(s) {
|
|
|
371
462
|
case "explicit":
|
|
372
463
|
return s;
|
|
373
464
|
default:
|
|
374
|
-
return
|
|
465
|
+
return G(s);
|
|
375
466
|
}
|
|
376
467
|
}
|
|
377
|
-
function
|
|
378
|
-
const t = s.createStruct(
|
|
468
|
+
function _o(s, e) {
|
|
469
|
+
const t = s.createStruct(Vo), r = j(t, Uo), o = j(t, Go), n = j(t, Jo);
|
|
379
470
|
return s.setField(r, s.createValue(T.JsonString, Buffer.from(JSON.stringify(e.registry)))), s.setField(o, s.createValue(T.JsonString, Buffer.from(JSON.stringify(e.path)))), n;
|
|
380
471
|
}
|
|
381
|
-
function
|
|
382
|
-
const t = s.createValue(Fo, e.content), r = s.createStruct(Lo), o = D(r, No), n = D(r, Do);
|
|
383
|
-
return s.setField(o, t), n;
|
|
384
|
-
}
|
|
385
|
-
function St(s, e) {
|
|
472
|
+
function kt(s, e) {
|
|
386
473
|
switch (e.type) {
|
|
387
474
|
case "from-registry":
|
|
388
|
-
return
|
|
475
|
+
return _o(s, e);
|
|
389
476
|
case "explicit":
|
|
390
|
-
return
|
|
477
|
+
return Bo(s, e);
|
|
391
478
|
default:
|
|
392
|
-
return
|
|
479
|
+
return G(e);
|
|
393
480
|
}
|
|
394
481
|
}
|
|
395
|
-
const
|
|
482
|
+
const _r = { name: "Frontend/FromUrl", version: "1" }, Kr = {
|
|
396
483
|
name: "Frontend/FromFolder",
|
|
397
484
|
version: "1"
|
|
398
485
|
};
|
|
399
|
-
function
|
|
486
|
+
function Ko(s, e) {
|
|
400
487
|
switch (e.type) {
|
|
401
488
|
case "url":
|
|
402
489
|
return s.createValue(
|
|
403
|
-
|
|
490
|
+
_r,
|
|
404
491
|
JSON.stringify({ url: e.url })
|
|
405
492
|
);
|
|
406
493
|
case "local":
|
|
407
494
|
return s.createValue(
|
|
408
|
-
|
|
495
|
+
Kr,
|
|
409
496
|
JSON.stringify({
|
|
410
497
|
path: e.path,
|
|
411
498
|
signature: e.signature
|
|
412
499
|
})
|
|
413
500
|
);
|
|
414
501
|
default:
|
|
415
|
-
return
|
|
502
|
+
return G(e);
|
|
416
503
|
}
|
|
417
504
|
}
|
|
418
|
-
const
|
|
419
|
-
function
|
|
505
|
+
const Ho = { name: "BlockPackCustom", version: "1" }, Hr = "template", Wr = "frontend";
|
|
506
|
+
function Wt(s) {
|
|
420
507
|
return s.endsWith("/") ? s : `${s}/`;
|
|
421
508
|
}
|
|
422
|
-
class
|
|
509
|
+
class Wo {
|
|
423
510
|
constructor(e, t, r) {
|
|
424
511
|
this.v2RegistryProvider = e, this.signer = t, this.http = r;
|
|
425
512
|
}
|
|
@@ -428,17 +515,17 @@ class Go {
|
|
|
428
515
|
case "explicit":
|
|
429
516
|
return e.config;
|
|
430
517
|
case "dev-v1": {
|
|
431
|
-
const t = await
|
|
518
|
+
const t = await Kt(e.folder), r = await q.promises.readFile(t.config, { encoding: "utf-8" });
|
|
432
519
|
return JSON.parse(r);
|
|
433
520
|
}
|
|
434
521
|
case "dev-v2": {
|
|
435
|
-
const t = await
|
|
522
|
+
const t = await Vt(e.folder), r = await q.promises.readFile(t.components.model.file, {
|
|
436
523
|
encoding: "utf-8"
|
|
437
524
|
});
|
|
438
525
|
return JSON.parse(r);
|
|
439
526
|
}
|
|
440
527
|
case "from-registry-v1": {
|
|
441
|
-
const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${
|
|
528
|
+
const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${Wt(e.registryUrl)}${ue.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`;
|
|
442
529
|
return await (await ie(`${r}/config.json`, t)).body.json();
|
|
443
530
|
}
|
|
444
531
|
case "from-registry-v2": {
|
|
@@ -446,7 +533,7 @@ class Go {
|
|
|
446
533
|
return await (await ie(o.model.url, t)).body.json();
|
|
447
534
|
}
|
|
448
535
|
default:
|
|
449
|
-
return
|
|
536
|
+
return G(e);
|
|
450
537
|
}
|
|
451
538
|
}
|
|
452
539
|
async prepare(e) {
|
|
@@ -454,7 +541,7 @@ class Go {
|
|
|
454
541
|
case "explicit":
|
|
455
542
|
return e;
|
|
456
543
|
case "dev-v1": {
|
|
457
|
-
const t = await
|
|
544
|
+
const t = await Kt(e.folder), r = await q.promises.readFile(t.workflow), o = JSON.parse(
|
|
458
545
|
await q.promises.readFile(t.config, "utf-8")
|
|
459
546
|
), n = t.ui;
|
|
460
547
|
return {
|
|
@@ -473,14 +560,14 @@ class Go {
|
|
|
473
560
|
};
|
|
474
561
|
}
|
|
475
562
|
case "dev-v2": {
|
|
476
|
-
const t = await
|
|
563
|
+
const t = await Vt(e.folder), r = JSON.parse(
|
|
477
564
|
await q.promises.readFile(t.components.model.file, {
|
|
478
565
|
encoding: "utf-8"
|
|
479
566
|
})
|
|
480
567
|
), o = await q.promises.readFile(
|
|
481
568
|
t.components.workflow.main.file
|
|
482
569
|
), n = t.components.ui.folder, i = { ...e };
|
|
483
|
-
return e.mtime === void 0 && (i.mtime = await
|
|
570
|
+
return e.mtime === void 0 && (i.mtime = await Et(t)), {
|
|
484
571
|
type: "explicit",
|
|
485
572
|
template: {
|
|
486
573
|
type: "explicit",
|
|
@@ -496,7 +583,7 @@ class Go {
|
|
|
496
583
|
};
|
|
497
584
|
}
|
|
498
585
|
case "from-registry-v1": {
|
|
499
|
-
const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${
|
|
586
|
+
const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${Wt(e.registryUrl)}${ue.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, o = `${r}/template.plj.gz`, n = await ie(o, t);
|
|
500
587
|
if (n.statusCode !== 200)
|
|
501
588
|
throw new Error(
|
|
502
589
|
`Block not found in registry (url = ${o} ; code = ${n.statusCode}): ` + JSON.stringify(e)
|
|
@@ -533,29 +620,29 @@ class Go {
|
|
|
533
620
|
};
|
|
534
621
|
}
|
|
535
622
|
default:
|
|
536
|
-
return
|
|
623
|
+
return G(e);
|
|
537
624
|
}
|
|
538
625
|
}
|
|
539
626
|
}
|
|
540
|
-
function
|
|
541
|
-
const t = { config: e.config, source: e.source }, r = s.createStruct(
|
|
542
|
-
return s.createField(
|
|
627
|
+
function zo(s, e) {
|
|
628
|
+
const t = { config: e.config, source: e.source }, r = s.createStruct(Ho, JSON.stringify(t));
|
|
629
|
+
return s.createField(j(r, Hr), "Input", kt(s, e.template)), s.createField(j(r, Wr), "Input", Ko(s, e.frontend)), s.lock(r), r;
|
|
543
630
|
}
|
|
544
|
-
function
|
|
631
|
+
function zt(s, e) {
|
|
545
632
|
switch (e.type) {
|
|
546
633
|
case "explicit":
|
|
547
|
-
return
|
|
634
|
+
return zo(s, e);
|
|
548
635
|
default:
|
|
549
|
-
return
|
|
636
|
+
return G(e.type);
|
|
550
637
|
}
|
|
551
638
|
}
|
|
552
|
-
function
|
|
639
|
+
function Ne(s, e) {
|
|
553
640
|
return { __isRef: !0, blockId: s, name: e };
|
|
554
641
|
}
|
|
555
|
-
function
|
|
642
|
+
function Xo(s) {
|
|
556
643
|
return typeof s == "object" && s !== null && s.__isRef === !0 && "blockId" in s && "name" in s;
|
|
557
644
|
}
|
|
558
|
-
function
|
|
645
|
+
function mt(s, e, t) {
|
|
559
646
|
const r = typeof e;
|
|
560
647
|
switch (r) {
|
|
561
648
|
case "function":
|
|
@@ -568,21 +655,21 @@ function dt(s, e, t) {
|
|
|
568
655
|
return;
|
|
569
656
|
case "object":
|
|
570
657
|
if (e === null) return;
|
|
571
|
-
if (
|
|
658
|
+
if (Xo(e))
|
|
572
659
|
t === void 0 || t.has(e.blockId) ? s.upstreams.add(e.blockId) : s.missingReferences = !0;
|
|
573
660
|
else if (Array.isArray(e))
|
|
574
|
-
for (const o of e)
|
|
661
|
+
for (const o of e) mt(s, o, t);
|
|
575
662
|
else
|
|
576
663
|
for (const [, o] of Object.entries(e))
|
|
577
|
-
|
|
664
|
+
mt(s, o, t);
|
|
578
665
|
return;
|
|
579
666
|
default:
|
|
580
|
-
|
|
667
|
+
G(r);
|
|
581
668
|
}
|
|
582
669
|
}
|
|
583
|
-
function
|
|
670
|
+
function qo(s, e) {
|
|
584
671
|
const t = { upstreams: /* @__PURE__ */ new Set(), missingReferences: !1 };
|
|
585
|
-
return
|
|
672
|
+
return mt(t, s, e), t;
|
|
586
673
|
}
|
|
587
674
|
function te(s) {
|
|
588
675
|
return {
|
|
@@ -591,7 +678,7 @@ function te(s) {
|
|
|
591
678
|
}
|
|
592
679
|
};
|
|
593
680
|
}
|
|
594
|
-
class
|
|
681
|
+
class zr {
|
|
595
682
|
constructor(e) {
|
|
596
683
|
/** Nodes are stored in the map in topological order */
|
|
597
684
|
S(this, "nodes");
|
|
@@ -621,7 +708,7 @@ class Gr {
|
|
|
621
708
|
}
|
|
622
709
|
}
|
|
623
710
|
}
|
|
624
|
-
function
|
|
711
|
+
function vt(s) {
|
|
625
712
|
const e = /* @__PURE__ */ new Map();
|
|
626
713
|
let t;
|
|
627
714
|
for (const { id: r } of te(s)) {
|
|
@@ -631,14 +718,14 @@ function pt(s) {
|
|
|
631
718
|
};
|
|
632
719
|
e.set(r, o), t === void 0 ? o.upstream = /* @__PURE__ */ new Set() : (o.upstream = /* @__PURE__ */ new Set([t.id]), t.downstream = /* @__PURE__ */ new Set([o.id])), t = o;
|
|
633
720
|
}
|
|
634
|
-
return t !== void 0 && (t.downstream = /* @__PURE__ */ new Set()), new
|
|
721
|
+
return t !== void 0 && (t.downstream = /* @__PURE__ */ new Set()), new zr(e);
|
|
635
722
|
}
|
|
636
|
-
function
|
|
723
|
+
function Ue(s, e) {
|
|
637
724
|
const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
|
|
638
725
|
for (const { id: o } of te(s)) {
|
|
639
726
|
const n = e(o);
|
|
640
727
|
if (n === void 0) continue;
|
|
641
|
-
const i =
|
|
728
|
+
const i = qo(n, r), c = {
|
|
642
729
|
id: o,
|
|
643
730
|
missingReferences: i.missingReferences,
|
|
644
731
|
upstream: i.upstreams,
|
|
@@ -647,41 +734,41 @@ function De(s, e) {
|
|
|
647
734
|
};
|
|
648
735
|
t.set(o, c), i.upstreams.forEach((a) => t.get(a).downstream.add(o)), r.add(o);
|
|
649
736
|
}
|
|
650
|
-
return new
|
|
737
|
+
return new zr(t);
|
|
651
738
|
}
|
|
652
|
-
function
|
|
739
|
+
function Yo(s, e) {
|
|
653
740
|
if (s.size !== e.size) return !1;
|
|
654
741
|
for (const t of s) if (!e.has(t)) return !1;
|
|
655
742
|
return !0;
|
|
656
743
|
}
|
|
657
|
-
function
|
|
658
|
-
if (s.size > e.size) return
|
|
744
|
+
function yt(s, e) {
|
|
745
|
+
if (s.size > e.size) return yt(e, s);
|
|
659
746
|
for (const t of s) if (e.has(t)) return !0;
|
|
660
747
|
return !1;
|
|
661
748
|
}
|
|
662
|
-
function
|
|
749
|
+
function Xt(s, e) {
|
|
663
750
|
const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
|
|
664
751
|
return s.nodes.forEach((n) => {
|
|
665
752
|
const i = e.nodes.get(n.id);
|
|
666
|
-
i === void 0 ? t.add(n.id) : (!
|
|
753
|
+
i === void 0 ? t.add(n.id) : (!Yo(n.upstream, i.upstream) || yt(n.upstream, o)) && o.add(n.id);
|
|
667
754
|
}), e.nodes.forEach((n) => {
|
|
668
|
-
s.nodes.has(n.id) ?
|
|
755
|
+
s.nodes.has(n.id) ? yt(n.upstream, o) && o.add(n.id) : r.add(n.id);
|
|
669
756
|
}), { onlyInA: t, onlyInB: r, different: o };
|
|
670
757
|
}
|
|
671
|
-
let
|
|
672
|
-
async function
|
|
673
|
-
if (
|
|
674
|
-
const s = await
|
|
758
|
+
let et;
|
|
759
|
+
async function Xr() {
|
|
760
|
+
if (et === void 0) {
|
|
761
|
+
const s = await Mo(Js["pframes.export-pframe"]);
|
|
675
762
|
if (s.type !== "explicit") throw new Error("Unexpected prepared template type.");
|
|
676
|
-
const e =
|
|
677
|
-
|
|
763
|
+
const e = Te("sha256").update(s.content).digest("hex");
|
|
764
|
+
et = { spec: s, hash: e };
|
|
678
765
|
}
|
|
679
|
-
return
|
|
766
|
+
return et;
|
|
680
767
|
}
|
|
681
|
-
function
|
|
682
|
-
return
|
|
768
|
+
function Zo(s, e, t) {
|
|
769
|
+
return Gr(s, e, !0, { pf: t }, ["result"]).result;
|
|
683
770
|
}
|
|
684
|
-
function
|
|
771
|
+
function tt(s, e) {
|
|
685
772
|
let t = !1, r, o;
|
|
686
773
|
return () => {
|
|
687
774
|
if (!t)
|
|
@@ -690,13 +777,13 @@ function qe(s, e) {
|
|
|
690
777
|
return r !== n && (r = n, o = e()), e();
|
|
691
778
|
};
|
|
692
779
|
}
|
|
693
|
-
class
|
|
780
|
+
class qt {
|
|
694
781
|
constructor(e, t) {
|
|
695
|
-
S(this, "currentInputsC",
|
|
782
|
+
S(this, "currentInputsC", tt(
|
|
696
783
|
() => this.fields.currentArgs.modCount,
|
|
697
784
|
() => JSON.parse(Buffer.from(this.fields.currentArgs.value).toString())
|
|
698
785
|
));
|
|
699
|
-
S(this, "actualProductionInputsC",
|
|
786
|
+
S(this, "actualProductionInputsC", tt(
|
|
700
787
|
() => {
|
|
701
788
|
var e;
|
|
702
789
|
return (e = this.fields.prodArgs) == null ? void 0 : e.modCount;
|
|
@@ -708,7 +795,7 @@ class Kt {
|
|
|
708
795
|
return JSON.parse(Buffer.from(e).toString());
|
|
709
796
|
}
|
|
710
797
|
));
|
|
711
|
-
S(this, "productionStaleC",
|
|
798
|
+
S(this, "productionStaleC", tt(
|
|
712
799
|
() => {
|
|
713
800
|
var e;
|
|
714
801
|
return `${this.fields.currentArgs.modCount}_${(e = this.fields.prodArgs) == null ? void 0 : e.modCount}`;
|
|
@@ -750,15 +837,15 @@ class Kt {
|
|
|
750
837
|
getTemplate(e) {
|
|
751
838
|
return e.getFutureFieldValue(
|
|
752
839
|
T.unwrapHolder(e, this.fields.blockPack.ref),
|
|
753
|
-
|
|
840
|
+
Hr,
|
|
754
841
|
"Input"
|
|
755
842
|
);
|
|
756
843
|
}
|
|
757
844
|
}
|
|
758
|
-
const
|
|
845
|
+
const Qo = (s) => {
|
|
759
846
|
throw new Error(`No new block info for ${s}`);
|
|
760
847
|
};
|
|
761
|
-
class
|
|
848
|
+
class _e {
|
|
762
849
|
constructor(e, t, r, o, n, i, c, a, l, u, d, m) {
|
|
763
850
|
S(this, "globalModCount", 0);
|
|
764
851
|
S(this, "fieldsChanged", !1);
|
|
@@ -792,16 +879,16 @@ class je {
|
|
|
792
879
|
return JSON.parse(JSON.stringify(this.struct));
|
|
793
880
|
}
|
|
794
881
|
getStagingGraph() {
|
|
795
|
-
return this.stagingGraph === void 0 && (this.stagingGraph =
|
|
882
|
+
return this.stagingGraph === void 0 && (this.stagingGraph = vt(this.struct)), this.stagingGraph;
|
|
796
883
|
}
|
|
797
884
|
getPendingProductionGraph() {
|
|
798
|
-
return this.pendingProductionGraph === void 0 && (this.pendingProductionGraph =
|
|
885
|
+
return this.pendingProductionGraph === void 0 && (this.pendingProductionGraph = Ue(
|
|
799
886
|
this.struct,
|
|
800
887
|
(e) => this.getBlockInfo(e).currentInputs
|
|
801
888
|
)), this.pendingProductionGraph;
|
|
802
889
|
}
|
|
803
890
|
getActualProductionGraph() {
|
|
804
|
-
return this.actualProductionGraph === void 0 && (this.actualProductionGraph =
|
|
891
|
+
return this.actualProductionGraph === void 0 && (this.actualProductionGraph = Ue(
|
|
805
892
|
this.struct,
|
|
806
893
|
(e) => this.getBlockInfo(e).actualProductionInputs
|
|
807
894
|
)), this.actualProductionGraph;
|
|
@@ -810,14 +897,14 @@ class je {
|
|
|
810
897
|
// Generic helpers to interact with project state
|
|
811
898
|
//
|
|
812
899
|
getBlockInfo(e) {
|
|
813
|
-
return
|
|
900
|
+
return B(this.blockInfos.get(e));
|
|
814
901
|
}
|
|
815
902
|
getBlock(e) {
|
|
816
903
|
for (const t of te(this.struct)) if (t.id === e) return t;
|
|
817
904
|
throw new Error("block not found");
|
|
818
905
|
}
|
|
819
906
|
setBlockFieldObj(e, t, r) {
|
|
820
|
-
const o =
|
|
907
|
+
const o = j(this.rid, U(e, t));
|
|
821
908
|
if (r.ref === void 0) throw new Error("Can't set value with empty ref");
|
|
822
909
|
this.getBlockInfo(e).fields[t] === void 0 ? this.tx.createField(o, "Dynamic", r.ref) : this.tx.setField(o, r.ref), this.getBlockInfo(e).fields[t] = {
|
|
823
910
|
modCount: this.globalModCount++,
|
|
@@ -832,7 +919,7 @@ class je {
|
|
|
832
919
|
const o = this.getBlockInfo(e);
|
|
833
920
|
for (const n of t) {
|
|
834
921
|
const i = o.fields;
|
|
835
|
-
n in i && (this.tx.removeField(
|
|
922
|
+
n in i && (this.tx.removeField(j(this.rid, U(e, n))), delete i[n], this.fieldsChanged = !0, r = !0);
|
|
836
923
|
}
|
|
837
924
|
return r;
|
|
838
925
|
}
|
|
@@ -900,16 +987,16 @@ class je {
|
|
|
900
987
|
if (n.fields[t] === void 0 || n.fields[t].ref === void 0)
|
|
901
988
|
throw new Error("One of the upstreams staging is not rendered.");
|
|
902
989
|
r.push(T.unwrapHolder(this.tx, n.fields[t].ref));
|
|
903
|
-
}),
|
|
990
|
+
}), Do(this.tx, r);
|
|
904
991
|
}
|
|
905
992
|
exportCtx(e) {
|
|
906
|
-
return
|
|
993
|
+
return Zo(this.tx, T.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
|
|
907
994
|
}
|
|
908
995
|
renderStagingFor(e) {
|
|
909
996
|
this.resetStaging(e);
|
|
910
997
|
const t = this.getBlockInfo(e), r = this.createCtx(this.getStagingGraph().nodes.get(e).upstream, "stagingCtx");
|
|
911
998
|
if (this.getBlock(e).renderingMode !== "Heavy") throw new Error("not supported yet");
|
|
912
|
-
const o = t.getTemplate(this.tx), n =
|
|
999
|
+
const o = t.getTemplate(this.tx), n = Ht(this.tx, o, {
|
|
913
1000
|
args: t.fields.currentArgs.ref,
|
|
914
1001
|
blockId: this.tx.createValue(T.JsonString, JSON.stringify(e)),
|
|
915
1002
|
isProduction: this.tx.createValue(T.JsonBool, JSON.stringify(!1)),
|
|
@@ -930,7 +1017,7 @@ class je {
|
|
|
930
1017
|
);
|
|
931
1018
|
if (this.getBlock(e).renderingMode === "Light")
|
|
932
1019
|
throw new Error("Can't render production for light block.");
|
|
933
|
-
const o = t.getTemplate(this.tx), n =
|
|
1020
|
+
const o = t.getTemplate(this.tx), n = Ht(this.tx, o, {
|
|
934
1021
|
args: t.fields.currentArgs.ref,
|
|
935
1022
|
blockId: this.tx.createValue(T.JsonString, JSON.stringify(e)),
|
|
936
1023
|
isProduction: this.tx.createValue(T.JsonBool, JSON.stringify(!0)),
|
|
@@ -947,22 +1034,22 @@ class je {
|
|
|
947
1034
|
// Structure changes
|
|
948
1035
|
//
|
|
949
1036
|
/** Very generic method, better check for more specialized case-specific methods first. */
|
|
950
|
-
updateStructure(e, t =
|
|
951
|
-
const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n =
|
|
1037
|
+
updateStructure(e, t = Qo) {
|
|
1038
|
+
const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n = vt(e), i = Ue(
|
|
952
1039
|
e,
|
|
953
1040
|
(l) => {
|
|
954
1041
|
var u;
|
|
955
1042
|
return (u = this.blockInfos.get(l)) == null ? void 0 : u.actualProductionInputs;
|
|
956
1043
|
}
|
|
957
|
-
), c =
|
|
1044
|
+
), c = Xt(r, n), a = Xt(o, i);
|
|
958
1045
|
for (const l of c.onlyInA) {
|
|
959
1046
|
const { fields: u } = this.getBlockInfo(l);
|
|
960
1047
|
this.deleteBlockFields(l, ...Object.keys(u)), this.blockInfos.delete(l), this.blocksInLimbo.delete(l) && (this.renderingStateChanged = !0), this.blockFrontendStates.delete(l) && this.changedBlockFrontendStates.add(l);
|
|
961
1048
|
}
|
|
962
1049
|
for (const l of c.onlyInB) {
|
|
963
|
-
const u = new
|
|
1050
|
+
const u = new qt(l, {});
|
|
964
1051
|
this.blockInfos.set(l, u);
|
|
965
|
-
const d = t(l), m =
|
|
1052
|
+
const d = t(l), m = zt(this.tx, d.blockPack);
|
|
966
1053
|
this.setBlockField(l, "blockPack", T.wrapInHolder(this.tx, m), "NotReady");
|
|
967
1054
|
const h = Buffer.from(d.args), f = this.tx.createValue(T.JsonObject, h);
|
|
968
1055
|
this.setBlockField(l, "currentArgs", f, "Ready", h), d.uiState && (this.blockFrontendStates.set(l, d.uiState), this.changedBlockFrontendStates.add(l)), u.check();
|
|
@@ -1016,7 +1103,7 @@ class je {
|
|
|
1016
1103
|
this.setBlockField(
|
|
1017
1104
|
e,
|
|
1018
1105
|
"blockPack",
|
|
1019
|
-
T.wrapInHolder(this.tx,
|
|
1106
|
+
T.wrapInHolder(this.tx, zt(this.tx, t)),
|
|
1020
1107
|
"NotReady"
|
|
1021
1108
|
), r !== void 0 ? (this.setArgs([{ blockId: e, args: r }]), this.setUiState(e, void 0)) : this.getStagingGraph().traverse("downstream", [e], ({ id: n }) => this.resetStaging(n)), o.productionRendered && this.getActualProductionGraph().traverse(
|
|
1022
1109
|
"downstream",
|
|
@@ -1062,7 +1149,7 @@ class je {
|
|
|
1062
1149
|
* accordingly */
|
|
1063
1150
|
stopProduction(...e) {
|
|
1064
1151
|
var i, c;
|
|
1065
|
-
const t = this.getActualProductionGraph(), r = new
|
|
1152
|
+
const t = this.getActualProductionGraph(), r = new Nr(e), o = new Set(e), n = [];
|
|
1066
1153
|
for (; !r.isEmpty(); ) {
|
|
1067
1154
|
const a = r.shift(), l = this.getBlockInfo(a).fields;
|
|
1068
1155
|
if (!(((i = l.prodOutput) == null ? void 0 : i.status) === "Ready" && ((c = l.prodCtx) == null ? void 0 : c.status) === "Ready") && this.deleteBlockFields(a, "prodOutput", "prodCtx", "prodUiCtx", "prodArgs")) {
|
|
@@ -1122,34 +1209,34 @@ class je {
|
|
|
1122
1209
|
assignAuthorMarkers() {
|
|
1123
1210
|
const e = this.author ? JSON.stringify(this.author) : void 0;
|
|
1124
1211
|
for (const t of this.blocksWithChangedInputs)
|
|
1125
|
-
e === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1126
|
-
(this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1212
|
+
e === void 0 ? this.tx.deleteKValue(this.rid, ht(t)) : this.tx.setKValue(this.rid, ht(t), e);
|
|
1213
|
+
(this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid, ft) : this.tx.setKValue(this.rid, ft, e));
|
|
1127
1214
|
}
|
|
1128
1215
|
save() {
|
|
1129
1216
|
if (this.wasModified) {
|
|
1130
|
-
this.lastModifiedChanged && this.tx.setKValue(this.rid,
|
|
1217
|
+
this.lastModifiedChanged && this.tx.setKValue(this.rid, $e, JSON.stringify(this.lastModified)), this.structureChanged && this.tx.setKValue(this.rid, de, JSON.stringify(this.struct)), this.renderingStateChanged && this.tx.setKValue(
|
|
1131
1218
|
this.rid,
|
|
1132
|
-
|
|
1219
|
+
Je,
|
|
1133
1220
|
JSON.stringify({
|
|
1134
1221
|
...this.renderingState,
|
|
1135
1222
|
blocksInLimbo: [...this.blocksInLimbo]
|
|
1136
1223
|
})
|
|
1137
|
-
), this.metaChanged && this.tx.setKValue(this.rid,
|
|
1224
|
+
), this.metaChanged && this.tx.setKValue(this.rid, Ie, JSON.stringify(this.meta));
|
|
1138
1225
|
for (const e of this.changedBlockFrontendStates) {
|
|
1139
1226
|
const t = this.blockFrontendStates.get(e);
|
|
1140
|
-
t === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1227
|
+
t === void 0 ? this.tx.deleteKValue(this.rid, pt(e)) : this.tx.setKValue(this.rid, pt(e), t);
|
|
1141
1228
|
}
|
|
1142
1229
|
this.assignAuthorMarkers();
|
|
1143
1230
|
}
|
|
1144
1231
|
}
|
|
1145
1232
|
static async load(e, t, r) {
|
|
1146
|
-
const o = e.getResourceData(t, !0), n = e.getKValueJson(t,
|
|
1233
|
+
const o = e.getResourceData(t, !0), n = e.getKValueJson(t, xr), i = e.getKValueJson(t, $e), c = e.getKValueJson(t, Ie), a = e.getKValueJson(t, de), l = e.getKValueJson(t, Je), u = e.listKeyValuesString(t), [
|
|
1147
1234
|
d,
|
|
1148
1235
|
m,
|
|
1149
1236
|
h,
|
|
1150
1237
|
f,
|
|
1151
1238
|
I,
|
|
1152
|
-
{ stagingRefreshTimestamp:
|
|
1239
|
+
{ stagingRefreshTimestamp: F, blocksInLimbo: D },
|
|
1153
1240
|
_
|
|
1154
1241
|
] = await Promise.all([
|
|
1155
1242
|
o,
|
|
@@ -1160,61 +1247,61 @@ class je {
|
|
|
1160
1247
|
l,
|
|
1161
1248
|
u
|
|
1162
1249
|
]);
|
|
1163
|
-
if (m !==
|
|
1250
|
+
if (m !== Vr)
|
|
1164
1251
|
throw new Error(
|
|
1165
1252
|
`Can't act on this project resource because it has a wrong schema version: ${m}`
|
|
1166
1253
|
);
|
|
1167
1254
|
const k = /* @__PURE__ */ new Map();
|
|
1168
1255
|
for (const p of d.fields) {
|
|
1169
|
-
const y =
|
|
1256
|
+
const y = Eo(p.name);
|
|
1170
1257
|
if (y === void 0) continue;
|
|
1171
1258
|
let g = k.get(y.blockId);
|
|
1172
1259
|
g === void 0 && (g = {
|
|
1173
1260
|
id: y.blockId,
|
|
1174
1261
|
fields: {}
|
|
1175
|
-
}, k.set(y.blockId, g)), g.fields[y.fieldName] =
|
|
1262
|
+
}, k.set(y.blockId, g)), g.fields[y.fieldName] = Ge(p.value) ? { modCount: 0 } : { modCount: 0, ref: p.value };
|
|
1176
1263
|
}
|
|
1177
|
-
const se = await
|
|
1178
|
-
(p) => p.name ===
|
|
1264
|
+
const se = await Xr(), pe = gt(se.hash), A = d.fields.find(
|
|
1265
|
+
(p) => p.name === pe
|
|
1179
1266
|
);
|
|
1180
1267
|
let z;
|
|
1181
|
-
|
|
1182
|
-
|
|
1268
|
+
A !== void 0 ? z = ut(A.value) : (z = T.wrapInHolder(e, kt(e, se.spec)), e.createField(
|
|
1269
|
+
j(t, gt(se.hash)),
|
|
1183
1270
|
"Dynamic",
|
|
1184
1271
|
z
|
|
1185
1272
|
));
|
|
1186
|
-
const oe = { stagingRefreshTimestamp:
|
|
1273
|
+
const oe = { stagingRefreshTimestamp: F }, K = new Set(D), J = /* @__PURE__ */ new Map();
|
|
1187
1274
|
for (const p of _) {
|
|
1188
|
-
const y =
|
|
1189
|
-
y !== void 0 &&
|
|
1275
|
+
const y = So(p.key);
|
|
1276
|
+
y !== void 0 && J.set(y, p.value);
|
|
1190
1277
|
}
|
|
1191
|
-
const
|
|
1278
|
+
const x = [];
|
|
1192
1279
|
k.forEach(({ id: p, fields: y }) => {
|
|
1193
1280
|
for (const [, g] of Object.entries(y))
|
|
1194
1281
|
if (g.ref !== void 0) {
|
|
1195
|
-
if (!
|
|
1282
|
+
if (!Fs(g.ref) || Ts(g.ref))
|
|
1196
1283
|
throw new Error("unexpected behaviour");
|
|
1197
|
-
|
|
1284
|
+
x.push([g, e.getResourceData(g.ref, !1)]);
|
|
1198
1285
|
}
|
|
1199
1286
|
});
|
|
1200
|
-
for (const [p, y] of
|
|
1287
|
+
for (const [p, y] of x) {
|
|
1201
1288
|
const g = await y;
|
|
1202
|
-
p.value = g.data,
|
|
1289
|
+
p.value = g.data, Ut(g.error) ? p.status = "Error" : g.resourceReady || Ut(g.originalResourceId) ? p.status = "Ready" : p.status = "NotReady";
|
|
1203
1290
|
}
|
|
1204
1291
|
const X = /* @__PURE__ */ new Map();
|
|
1205
|
-
k.forEach(({ id: p, fields: y }) => X.set(p, new
|
|
1206
|
-
const
|
|
1292
|
+
k.forEach(({ id: p, fields: y }) => X.set(p, new qt(p, y)));
|
|
1293
|
+
const he = /* @__PURE__ */ new Set();
|
|
1207
1294
|
for (const p of te(I)) {
|
|
1208
1295
|
if (!X.has(p.id))
|
|
1209
1296
|
throw new Error(`Inconsistent project structure: no inputs for ${p.id}`);
|
|
1210
|
-
|
|
1297
|
+
he.add(p.id);
|
|
1211
1298
|
}
|
|
1212
1299
|
X.forEach((p) => {
|
|
1213
|
-
if (!
|
|
1300
|
+
if (!he.has(p.id))
|
|
1214
1301
|
throw new Error(`Inconsistent project structure: no structure entry for ${p.id}`);
|
|
1215
1302
|
p.check();
|
|
1216
1303
|
});
|
|
1217
|
-
const v = new
|
|
1304
|
+
const v = new _e(
|
|
1218
1305
|
t,
|
|
1219
1306
|
e,
|
|
1220
1307
|
r,
|
|
@@ -1225,39 +1312,39 @@ class je {
|
|
|
1225
1312
|
oe,
|
|
1226
1313
|
K,
|
|
1227
1314
|
X,
|
|
1228
|
-
|
|
1315
|
+
J,
|
|
1229
1316
|
z
|
|
1230
1317
|
);
|
|
1231
1318
|
return v.fixProblems(), v;
|
|
1232
1319
|
}
|
|
1233
1320
|
}
|
|
1234
|
-
async function
|
|
1235
|
-
const t = s.createEphemeral(
|
|
1321
|
+
async function en(s, e = go) {
|
|
1322
|
+
const t = s.createEphemeral(mo);
|
|
1236
1323
|
s.lock(t);
|
|
1237
1324
|
const r = String(Date.now());
|
|
1238
|
-
s.setKValue(t,
|
|
1239
|
-
const o = await
|
|
1325
|
+
s.setKValue(t, xr, JSON.stringify(Vr)), s.setKValue(t, Ct, r), s.setKValue(t, $e, r), s.setKValue(t, Ie, JSON.stringify(e)), s.setKValue(t, de, JSON.stringify(ho)), s.setKValue(t, Je, JSON.stringify(fo));
|
|
1326
|
+
const o = await Xr();
|
|
1240
1327
|
return s.createField(
|
|
1241
|
-
|
|
1328
|
+
j(t, gt(o.hash)),
|
|
1242
1329
|
"Dynamic",
|
|
1243
|
-
T.wrapInHolder(s,
|
|
1330
|
+
T.wrapInHolder(s, kt(s, o.spec))
|
|
1244
1331
|
), t;
|
|
1245
1332
|
}
|
|
1246
|
-
async function
|
|
1333
|
+
async function rt(s, e, t) {
|
|
1247
1334
|
return ee(s, e, void 0, t);
|
|
1248
1335
|
}
|
|
1249
1336
|
async function ee(s, e, t, r) {
|
|
1250
|
-
if (s instanceof
|
|
1337
|
+
if (s instanceof Is)
|
|
1251
1338
|
return await s.withWriteTx("ProjectAction", async (o) => {
|
|
1252
|
-
const n = await
|
|
1339
|
+
const n = await _e.load(o, e, t), i = await r(n);
|
|
1253
1340
|
return n.wasModified && (n.save(), await o.commit()), i;
|
|
1254
1341
|
});
|
|
1255
1342
|
{
|
|
1256
|
-
const o = await
|
|
1343
|
+
const o = await _e.load(s, e, t), n = await r(o);
|
|
1257
1344
|
return o.save(), n;
|
|
1258
1345
|
}
|
|
1259
1346
|
}
|
|
1260
|
-
function*
|
|
1347
|
+
function* tn(s) {
|
|
1261
1348
|
switch (s.type) {
|
|
1262
1349
|
case "Json":
|
|
1263
1350
|
return;
|
|
@@ -1269,52 +1356,52 @@ function* Xo(s) {
|
|
|
1269
1356
|
yield e, yield t;
|
|
1270
1357
|
return;
|
|
1271
1358
|
default:
|
|
1272
|
-
|
|
1359
|
+
G(s);
|
|
1273
1360
|
}
|
|
1274
1361
|
}
|
|
1275
|
-
function
|
|
1362
|
+
function Yt(s, e) {
|
|
1276
1363
|
return Object.fromEntries(
|
|
1277
1364
|
Object.entries(s).map(([t, r]) => [t, e(r, t)])
|
|
1278
1365
|
);
|
|
1279
1366
|
}
|
|
1280
|
-
function
|
|
1367
|
+
function rn(s, e) {
|
|
1281
1368
|
switch (s.type) {
|
|
1282
1369
|
case "Json":
|
|
1283
1370
|
return { ...s };
|
|
1284
1371
|
case "JsonPartitioned":
|
|
1285
|
-
return { ...s, parts:
|
|
1372
|
+
return { ...s, parts: Yt(s.parts, e) };
|
|
1286
1373
|
case "BinaryPartitioned":
|
|
1287
1374
|
return {
|
|
1288
1375
|
...s,
|
|
1289
|
-
parts:
|
|
1376
|
+
parts: Yt(s.parts, (t) => ({
|
|
1290
1377
|
index: e(t.index),
|
|
1291
1378
|
values: e(t.values)
|
|
1292
1379
|
}))
|
|
1293
1380
|
};
|
|
1294
1381
|
default:
|
|
1295
|
-
|
|
1382
|
+
G(s);
|
|
1296
1383
|
}
|
|
1297
1384
|
}
|
|
1298
|
-
const
|
|
1385
|
+
const sn = Fe("PColumnData/JsonPartitioned", "1"), on = Fe(
|
|
1299
1386
|
"PColumnData/Partitioned/JsonPartitioned",
|
|
1300
1387
|
"1"
|
|
1301
|
-
),
|
|
1388
|
+
), nn = Fe("PColumnData/BinaryPartitioned", "1"), an = Fe(
|
|
1302
1389
|
"PColumnData/Partitioned/BinaryPartitioned",
|
|
1303
1390
|
"1"
|
|
1304
|
-
),
|
|
1305
|
-
function
|
|
1391
|
+
), cn = Fe("PColumnData/Json", "1");
|
|
1392
|
+
function ln(s) {
|
|
1306
1393
|
if (!s.getIsReadyOrError()) throw new Error("Data not ready.");
|
|
1307
1394
|
const e = s.getDataAsJson();
|
|
1308
1395
|
if (e === void 0)
|
|
1309
1396
|
throw new Error("unexpected data info structure, no resource data");
|
|
1310
|
-
if (ae(s.resourceType,
|
|
1397
|
+
if (ae(s.resourceType, cn)) {
|
|
1311
1398
|
const t = e;
|
|
1312
1399
|
return {
|
|
1313
1400
|
type: "Json",
|
|
1314
1401
|
keyLength: t.keyLength,
|
|
1315
1402
|
data: t.data
|
|
1316
1403
|
};
|
|
1317
|
-
} else if (ae(s.resourceType,
|
|
1404
|
+
} else if (ae(s.resourceType, sn)) {
|
|
1318
1405
|
const t = e, r = Object.fromEntries(
|
|
1319
1406
|
s.listInputFields().map((o) => [o, s.traverse({ field: o, errorIfFieldNotSet: !0 }).resourceInfo])
|
|
1320
1407
|
);
|
|
@@ -1323,7 +1410,7 @@ function rn(s) {
|
|
|
1323
1410
|
partitionKeyLength: t.partitionKeyLength,
|
|
1324
1411
|
parts: r
|
|
1325
1412
|
};
|
|
1326
|
-
} else if (ae(s.resourceType,
|
|
1413
|
+
} else if (ae(s.resourceType, on)) {
|
|
1327
1414
|
const t = e, r = {};
|
|
1328
1415
|
for (const o of s.listInputFields()) {
|
|
1329
1416
|
const n = s.traverse({ field: o, errorIfFieldNotSet: !0 }), i = n.listInputFields();
|
|
@@ -1338,7 +1425,7 @@ function rn(s) {
|
|
|
1338
1425
|
partitionKeyLength: t.superPartitionKeyLength + t.partitionKeyLength,
|
|
1339
1426
|
parts: r
|
|
1340
1427
|
};
|
|
1341
|
-
} else if (ae(s.resourceType,
|
|
1428
|
+
} else if (ae(s.resourceType, nn)) {
|
|
1342
1429
|
const t = e, r = {};
|
|
1343
1430
|
for (const o of s.listInputFields())
|
|
1344
1431
|
if (o.endsWith(".index")) {
|
|
@@ -1359,7 +1446,7 @@ function rn(s) {
|
|
|
1359
1446
|
partitionKeyLength: t.partitionKeyLength,
|
|
1360
1447
|
parts: r
|
|
1361
1448
|
};
|
|
1362
|
-
} else if (ae(s.resourceType,
|
|
1449
|
+
} else if (ae(s.resourceType, an)) {
|
|
1363
1450
|
const t = e, r = {};
|
|
1364
1451
|
for (const o of s.listInputFields()) {
|
|
1365
1452
|
const n = s.traverse({ field: o, errorIfFieldNotSet: !0 }), i = n.listInputFields();
|
|
@@ -1387,9 +1474,9 @@ function rn(s) {
|
|
|
1387
1474
|
parts: r
|
|
1388
1475
|
};
|
|
1389
1476
|
}
|
|
1390
|
-
throw new Error(`unsupported resource type: ${
|
|
1477
|
+
throw new Error(`unsupported resource type: ${As(s.resourceType)}`);
|
|
1391
1478
|
}
|
|
1392
|
-
function
|
|
1479
|
+
function un(s, e) {
|
|
1393
1480
|
const t = s.axesSpec.length, r = {};
|
|
1394
1481
|
for (const { key: o, val: n } of e) {
|
|
1395
1482
|
if (o.length !== t)
|
|
@@ -1402,17 +1489,17 @@ function sn(s, e) {
|
|
|
1402
1489
|
data: r
|
|
1403
1490
|
};
|
|
1404
1491
|
}
|
|
1405
|
-
function
|
|
1406
|
-
const t =
|
|
1407
|
-
return t.update(
|
|
1492
|
+
function dn(s, e) {
|
|
1493
|
+
const t = Te("sha256");
|
|
1494
|
+
return t.update(ve(s)), t.update(String(Ge(e.originalId) ? e.id : e.originalId)), t.digest().toString("hex");
|
|
1408
1495
|
}
|
|
1409
|
-
function
|
|
1410
|
-
return
|
|
1496
|
+
function Zt(s, e) {
|
|
1497
|
+
return ve({ __isRef: !0, blockId: s, name: e });
|
|
1411
1498
|
}
|
|
1412
|
-
function
|
|
1413
|
-
return
|
|
1499
|
+
function pn(s, e) {
|
|
1500
|
+
return ve({ resolvePath: s, name: e });
|
|
1414
1501
|
}
|
|
1415
|
-
function
|
|
1502
|
+
function qr(s, e = !0, t = !1, r = "") {
|
|
1416
1503
|
var c, a, l;
|
|
1417
1504
|
const o = /^(?<name>.*)\.(?<type>spec|data)$/, n = /* @__PURE__ */ new Map();
|
|
1418
1505
|
for (const u of s.listInputFields()) {
|
|
@@ -1421,13 +1508,13 @@ function Mr(s, e = !0, t = !1, r = "") {
|
|
|
1421
1508
|
if (e) throw new Error(`unexpected field name ${u}`);
|
|
1422
1509
|
continue;
|
|
1423
1510
|
}
|
|
1424
|
-
let m =
|
|
1511
|
+
let m = B((c = d.groups) == null ? void 0 : c.name);
|
|
1425
1512
|
if (!m.startsWith(r)) {
|
|
1426
1513
|
if (e) throw new Error(`unexpected field name ${u}`);
|
|
1427
1514
|
continue;
|
|
1428
1515
|
}
|
|
1429
1516
|
m = m.slice(r.length);
|
|
1430
|
-
const h =
|
|
1517
|
+
const h = B((a = d.groups) == null ? void 0 : a.type);
|
|
1431
1518
|
let f = n.get(m);
|
|
1432
1519
|
switch (f === void 0 && (f = {}, n.set(m, f)), h) {
|
|
1433
1520
|
case "spec":
|
|
@@ -1451,10 +1538,10 @@ function Mr(s, e = !0, t = !1, r = "") {
|
|
|
1451
1538
|
for (const [, u] of n) u.data === void 0 && (u.hasData = !1);
|
|
1452
1539
|
return { locked: i, results: n };
|
|
1453
1540
|
}
|
|
1454
|
-
function
|
|
1541
|
+
function hn(s, e = !0, t = "", r) {
|
|
1455
1542
|
if (!s.getIsReadyOrError()) throw new Error("resource is not ready");
|
|
1456
|
-
const o =
|
|
1457
|
-
|
|
1543
|
+
const o = qr(s, e, !1, t);
|
|
1544
|
+
Ms(o.locked);
|
|
1458
1545
|
const n = {};
|
|
1459
1546
|
for (const [i, c] of o.results) {
|
|
1460
1547
|
if (c.spec === void 0) throw new Error(`no spec for key ${i}`);
|
|
@@ -1462,16 +1549,16 @@ function an(s, e = !0, t = "", r) {
|
|
|
1462
1549
|
throw new Error(`no data for key ${i}`);
|
|
1463
1550
|
const a = c.data();
|
|
1464
1551
|
if (a === void 0) throw new Error(`no data for key ${i}`);
|
|
1465
|
-
if (!a.ok) throw new
|
|
1552
|
+
if (!a.ok) throw new js(a.error);
|
|
1466
1553
|
n[i] = {
|
|
1467
|
-
id: r.length === 0 ?
|
|
1554
|
+
id: r.length === 0 ? dn(c.spec, a.value) : pn(r, i),
|
|
1468
1555
|
spec: c.spec,
|
|
1469
1556
|
data: a.value
|
|
1470
1557
|
};
|
|
1471
1558
|
}
|
|
1472
1559
|
return n;
|
|
1473
1560
|
}
|
|
1474
|
-
class
|
|
1561
|
+
class Pt {
|
|
1475
1562
|
constructor(e, t) {
|
|
1476
1563
|
S(this, "allSpecsAvailable");
|
|
1477
1564
|
this.ctx = e, this.blocks = t;
|
|
@@ -1505,8 +1592,8 @@ class bt {
|
|
|
1505
1592
|
if (r === void 0) return;
|
|
1506
1593
|
let o = (c = (i = r.prod) == null ? void 0 : i.results) == null ? void 0 : c.get(t), n = (a = o == null ? void 0 : o.data) == null ? void 0 : a.call(o);
|
|
1507
1594
|
if (o !== void 0 && o.spec !== void 0 && n !== void 0)
|
|
1508
|
-
return
|
|
1509
|
-
id:
|
|
1595
|
+
return Pr(n, (l) => ({
|
|
1596
|
+
id: Zt(e, t),
|
|
1510
1597
|
spec: o.spec,
|
|
1511
1598
|
data: l
|
|
1512
1599
|
}));
|
|
@@ -1543,9 +1630,9 @@ class bt {
|
|
|
1543
1630
|
if (a.spec !== void 0 && a.hasData === !0 && a.data !== void 0) {
|
|
1544
1631
|
const l = a.data();
|
|
1545
1632
|
l !== void 0 ? e.push({
|
|
1546
|
-
ref:
|
|
1633
|
+
ref: Ne(i, c),
|
|
1547
1634
|
obj: {
|
|
1548
|
-
id: l.ok ?
|
|
1635
|
+
id: l.ok ? Zt(i, c) : void 0,
|
|
1549
1636
|
spec: a.spec,
|
|
1550
1637
|
data: l
|
|
1551
1638
|
}
|
|
@@ -1579,7 +1666,7 @@ class bt {
|
|
|
1579
1666
|
i.staging.locked || o(`staging_not_locked:${n}`);
|
|
1580
1667
|
for (const [a, l] of i.staging.results)
|
|
1581
1668
|
l.spec !== void 0 && (e.push({
|
|
1582
|
-
ref:
|
|
1669
|
+
ref: Ne(n, a),
|
|
1583
1670
|
obj: l.spec
|
|
1584
1671
|
}), c.add(a));
|
|
1585
1672
|
} else o(`staging_not_rendered:${n}`);
|
|
@@ -1587,7 +1674,7 @@ class bt {
|
|
|
1587
1674
|
i.prod.locked || o(`prod_not_locked:${n}`);
|
|
1588
1675
|
for (const [a, l] of i.prod.results)
|
|
1589
1676
|
c.has(a) || l.spec !== void 0 && e.push({
|
|
1590
|
-
ref:
|
|
1677
|
+
ref: Ne(n, a),
|
|
1591
1678
|
obj: l.spec
|
|
1592
1679
|
});
|
|
1593
1680
|
}
|
|
@@ -1599,9 +1686,9 @@ class bt {
|
|
|
1599
1686
|
for (const r of this.blocks.values()) {
|
|
1600
1687
|
const o = /* @__PURE__ */ new Set(), n = (i) => {
|
|
1601
1688
|
for (const [c, a] of i.results)
|
|
1602
|
-
o.has(c) || a.spec === void 0 || (o.add(c),
|
|
1689
|
+
o.has(c) || a.spec === void 0 || (o.add(c), vs(e, a.spec) && t.push({
|
|
1603
1690
|
label: r.info.label + " / " + c,
|
|
1604
|
-
ref:
|
|
1691
|
+
ref: Ne(r.info.id, c),
|
|
1605
1692
|
spec: a.spec
|
|
1606
1693
|
}));
|
|
1607
1694
|
};
|
|
@@ -1610,10 +1697,10 @@ class bt {
|
|
|
1610
1697
|
return t;
|
|
1611
1698
|
}
|
|
1612
1699
|
static create(e, t, r) {
|
|
1613
|
-
const o = e.accessor(t).node(), n =
|
|
1700
|
+
const o = e.accessor(t).node(), n = B(o.getKeyValueAsJson(de)), c = vt(n).traverseIds("upstream", r), a = /* @__PURE__ */ new Map();
|
|
1614
1701
|
for (const l of te(n)) {
|
|
1615
1702
|
if (!c.has(l.id)) continue;
|
|
1616
|
-
const u =
|
|
1703
|
+
const u = Qt(
|
|
1617
1704
|
o.traverse({
|
|
1618
1705
|
field: U(l.id, "prodCtx"),
|
|
1619
1706
|
ignoreError: !0,
|
|
@@ -1624,7 +1711,7 @@ class bt {
|
|
|
1624
1711
|
field: U(l.id, "prodUiCtx"),
|
|
1625
1712
|
stableIfNotFound: !0
|
|
1626
1713
|
})
|
|
1627
|
-
), d =
|
|
1714
|
+
), d = Qt(
|
|
1628
1715
|
o.traverse({
|
|
1629
1716
|
field: U(l.id, "stagingCtx"),
|
|
1630
1717
|
ignoreError: !0,
|
|
@@ -1636,34 +1723,34 @@ class bt {
|
|
|
1636
1723
|
);
|
|
1637
1724
|
a.set(l.id, { info: l, prod: u, staging: d });
|
|
1638
1725
|
}
|
|
1639
|
-
return new
|
|
1726
|
+
return new Pt(e, a);
|
|
1640
1727
|
}
|
|
1641
1728
|
}
|
|
1642
|
-
function
|
|
1729
|
+
function Qt(s, e) {
|
|
1643
1730
|
if (e === void 0)
|
|
1644
1731
|
return s ? { locked: !1, results: /* @__PURE__ */ new Map() } : void 0;
|
|
1645
|
-
if (e.ok) return
|
|
1732
|
+
if (e.ok) return qr(e.value, !1, !0);
|
|
1646
1733
|
}
|
|
1647
|
-
function
|
|
1734
|
+
function Ot(s, e) {
|
|
1648
1735
|
return {
|
|
1649
1736
|
blockId: e,
|
|
1650
|
-
args: (o) =>
|
|
1737
|
+
args: (o) => B(
|
|
1651
1738
|
o.accessor(s).node().traverse({
|
|
1652
1739
|
field: U(e, "currentArgs"),
|
|
1653
1740
|
errorIfFieldNotSet: !0
|
|
1654
1741
|
}).getDataAsString()
|
|
1655
1742
|
),
|
|
1656
|
-
uiState: (o) => o.accessor(s).node().getKeyValueAsString(
|
|
1743
|
+
uiState: (o) => o.accessor(s).node().getKeyValueAsString(pt(e)),
|
|
1657
1744
|
blockMeta: (o) => {
|
|
1658
|
-
const n = o.accessor(s).node(), i =
|
|
1745
|
+
const n = o.accessor(s).node(), i = B(n.getKeyValueAsJson(de)), c = /* @__PURE__ */ new Map();
|
|
1659
1746
|
for (const a of te(i)) c.set(a.id, a);
|
|
1660
1747
|
return c;
|
|
1661
1748
|
}
|
|
1662
1749
|
};
|
|
1663
1750
|
}
|
|
1664
|
-
function
|
|
1751
|
+
function Yr(s, e) {
|
|
1665
1752
|
return {
|
|
1666
|
-
...
|
|
1753
|
+
...Ot(s, e),
|
|
1667
1754
|
prod: (t) => {
|
|
1668
1755
|
var r;
|
|
1669
1756
|
return (r = t.accessor(s).node({ ignoreError: !0 }).traverse({
|
|
@@ -1680,7 +1767,7 @@ function _r(s, e) {
|
|
|
1680
1767
|
})) == null ? void 0 : o.persist();
|
|
1681
1768
|
return r === void 0 && t.markUnstable("staging_not_rendered"), r;
|
|
1682
1769
|
},
|
|
1683
|
-
getResultsPool: (t) =>
|
|
1770
|
+
getResultsPool: (t) => Pt.create(t, s, e)
|
|
1684
1771
|
};
|
|
1685
1772
|
}
|
|
1686
1773
|
function* W(s, e) {
|
|
@@ -1730,18 +1817,18 @@ function* W(s, e) {
|
|
|
1730
1817
|
yield* W(s.operand1), yield* W(s.operand2);
|
|
1731
1818
|
return;
|
|
1732
1819
|
default:
|
|
1733
|
-
|
|
1820
|
+
G(s);
|
|
1734
1821
|
}
|
|
1735
1822
|
}
|
|
1736
|
-
function
|
|
1823
|
+
function fn(s, e) {
|
|
1737
1824
|
const t = {};
|
|
1738
1825
|
for (const [r, o] of Object.entries(s)) t[r] = e(o);
|
|
1739
1826
|
return t;
|
|
1740
1827
|
}
|
|
1741
|
-
function
|
|
1828
|
+
function Ce(s, e) {
|
|
1742
1829
|
return s === void 0 ? void 0 : e(s);
|
|
1743
1830
|
}
|
|
1744
|
-
function
|
|
1831
|
+
function gn(s) {
|
|
1745
1832
|
switch (s.type) {
|
|
1746
1833
|
case "GetImportProgress":
|
|
1747
1834
|
return !0;
|
|
@@ -1749,121 +1836,121 @@ function ln(s) {
|
|
|
1749
1836
|
return !1;
|
|
1750
1837
|
}
|
|
1751
1838
|
}
|
|
1752
|
-
function
|
|
1753
|
-
for (const e of W(s)) if (
|
|
1839
|
+
function mn(s) {
|
|
1840
|
+
for (const e of W(s)) if (gn(e)) return !0;
|
|
1754
1841
|
return !1;
|
|
1755
1842
|
}
|
|
1756
|
-
function
|
|
1843
|
+
function He(s) {
|
|
1757
1844
|
return {
|
|
1758
1845
|
type: "ReturnResult",
|
|
1759
1846
|
result: s
|
|
1760
1847
|
};
|
|
1761
1848
|
}
|
|
1762
|
-
function
|
|
1763
|
-
return () =>
|
|
1849
|
+
function C(s) {
|
|
1850
|
+
return () => He(s);
|
|
1764
1851
|
}
|
|
1765
|
-
const
|
|
1852
|
+
const vn = (s) => {
|
|
1766
1853
|
const e = {};
|
|
1767
1854
|
for (const [t, r] of Object.entries(s)) e[t] = r;
|
|
1768
|
-
return
|
|
1769
|
-
},
|
|
1855
|
+
return C(e);
|
|
1856
|
+
}, yn = (s) => {
|
|
1770
1857
|
const e = s.source;
|
|
1771
|
-
if (e === void 0) return
|
|
1858
|
+
if (e === void 0) return C(void 0);
|
|
1772
1859
|
const t = [];
|
|
1773
1860
|
for (const r of e)
|
|
1774
1861
|
r instanceof Array ? t.push(...r) : t.push(r);
|
|
1775
|
-
return
|
|
1776
|
-
},
|
|
1862
|
+
return C(t);
|
|
1863
|
+
}, wn = (s) => {
|
|
1777
1864
|
const e = s.source, t = s.field;
|
|
1778
|
-
return e === void 0 || t === void 0 ?
|
|
1865
|
+
return e === void 0 || t === void 0 ? C(void 0) : ({ cCtx: r }) => {
|
|
1779
1866
|
var o;
|
|
1780
|
-
return
|
|
1867
|
+
return He((o = r.accessor(e).node().traverse(t)) == null ? void 0 : o.persist());
|
|
1781
1868
|
};
|
|
1782
1869
|
};
|
|
1783
|
-
function
|
|
1870
|
+
function Zr(s, e) {
|
|
1784
1871
|
const t = {}, r = s.length;
|
|
1785
1872
|
for (let o = 0; o < r; o++) t[String(o)] = e(s[o]);
|
|
1786
1873
|
return t;
|
|
1787
1874
|
}
|
|
1788
|
-
function
|
|
1875
|
+
function Sn(s, e) {
|
|
1789
1876
|
return (t) => {
|
|
1790
1877
|
const r = t.source;
|
|
1791
|
-
return r === void 0 ?
|
|
1878
|
+
return r === void 0 ? C(void 0) : () => ({
|
|
1792
1879
|
type: "ScheduleSubroutine",
|
|
1793
|
-
subroutine:
|
|
1794
|
-
args:
|
|
1880
|
+
subroutine: Qr(r.length),
|
|
1881
|
+
args: Zr(r, (o) => O({ ...s, [e.itVar]: o }, e.mapping))
|
|
1795
1882
|
});
|
|
1796
1883
|
};
|
|
1797
1884
|
}
|
|
1798
|
-
function
|
|
1885
|
+
function Qr(s) {
|
|
1799
1886
|
return (e) => {
|
|
1800
1887
|
const t = [];
|
|
1801
1888
|
for (let r = 0; r < s; r++) t.push(e[String(r)]);
|
|
1802
|
-
return
|
|
1889
|
+
return C(t);
|
|
1803
1890
|
};
|
|
1804
1891
|
}
|
|
1805
|
-
function
|
|
1892
|
+
function bn(s, e) {
|
|
1806
1893
|
return (t) => {
|
|
1807
1894
|
const r = t.source;
|
|
1808
|
-
if (r === void 0) return
|
|
1895
|
+
if (r === void 0) return C(void 0);
|
|
1809
1896
|
const o = {};
|
|
1810
1897
|
for (const [n, i] of Object.entries(r)) {
|
|
1811
1898
|
const c = { ...s, [e.itVar]: i };
|
|
1812
|
-
o[n] =
|
|
1899
|
+
o[n] = O(c, e.mapping);
|
|
1813
1900
|
}
|
|
1814
1901
|
return () => ({
|
|
1815
1902
|
type: "ScheduleSubroutine",
|
|
1816
|
-
subroutine:
|
|
1903
|
+
subroutine: Rn,
|
|
1817
1904
|
args: o
|
|
1818
1905
|
});
|
|
1819
1906
|
};
|
|
1820
1907
|
}
|
|
1821
|
-
const
|
|
1908
|
+
const Rn = (s) => C(s), En = (s) => {
|
|
1822
1909
|
const e = s.arg;
|
|
1823
|
-
return
|
|
1824
|
-
},
|
|
1910
|
+
return C(e === void 0 ? void 0 : e.length === 0);
|
|
1911
|
+
}, Cn = (s) => {
|
|
1825
1912
|
const e = s.operand;
|
|
1826
|
-
return
|
|
1827
|
-
},
|
|
1913
|
+
return C(e === void 0 ? void 0 : !e);
|
|
1914
|
+
}, kn = (s) => {
|
|
1828
1915
|
const e = s.operand1, t = s.operand2;
|
|
1829
|
-
return
|
|
1830
|
-
},
|
|
1916
|
+
return C(e === void 0 || t === void 0 ? void 0 : e && t);
|
|
1917
|
+
}, Pn = (s) => {
|
|
1831
1918
|
const e = s.operand1, t = s.operand2;
|
|
1832
|
-
return
|
|
1833
|
-
},
|
|
1919
|
+
return C(e === void 0 || t === void 0 ? void 0 : e || t);
|
|
1920
|
+
}, On = (s) => {
|
|
1834
1921
|
const e = s.source;
|
|
1835
|
-
return e === void 0 ?
|
|
1922
|
+
return e === void 0 ? C(void 0) : ({ cCtx: t }) => {
|
|
1836
1923
|
var r;
|
|
1837
|
-
return
|
|
1924
|
+
return He((r = t.accessor(e).node()) == null ? void 0 : r.getDataAsJson());
|
|
1838
1925
|
};
|
|
1839
|
-
},
|
|
1926
|
+
}, $n = (s) => {
|
|
1840
1927
|
const e = s.source, t = s.field;
|
|
1841
|
-
return
|
|
1928
|
+
return C(e === void 0 || t === void 0 ? void 0 : e[t]);
|
|
1842
1929
|
};
|
|
1843
|
-
function
|
|
1930
|
+
function In(s, e) {
|
|
1844
1931
|
return (t) => {
|
|
1845
1932
|
const r = t.source;
|
|
1846
|
-
return r === void 0 ?
|
|
1933
|
+
return r === void 0 ? C(void 0) : ({ cCtx: o }) => {
|
|
1847
1934
|
const n = o.accessor(r).node(), i = {};
|
|
1848
1935
|
for (const c of n.listInputFields()) {
|
|
1849
1936
|
const a = n.traverse(c);
|
|
1850
|
-
if (a === void 0) i[c] =
|
|
1937
|
+
if (a === void 0) i[c] = C(void 0);
|
|
1851
1938
|
else {
|
|
1852
1939
|
const l = { ...s, [e.itVar]: a.persist() };
|
|
1853
|
-
i[c] =
|
|
1940
|
+
i[c] = O(l, e.mapping);
|
|
1854
1941
|
}
|
|
1855
1942
|
}
|
|
1856
1943
|
return {
|
|
1857
1944
|
type: "ScheduleSubroutine",
|
|
1858
|
-
subroutine:
|
|
1945
|
+
subroutine: Fn,
|
|
1859
1946
|
args: i
|
|
1860
1947
|
};
|
|
1861
1948
|
};
|
|
1862
1949
|
};
|
|
1863
1950
|
}
|
|
1864
|
-
const
|
|
1951
|
+
const Fn = (s) => C(s), Tn = (s) => {
|
|
1865
1952
|
const e = s.source;
|
|
1866
|
-
return e === void 0 ?
|
|
1953
|
+
return e === void 0 ? C(void 0) : ({ drivers: t }) => ({
|
|
1867
1954
|
type: "ScheduleComputable",
|
|
1868
1955
|
computable: V.make(
|
|
1869
1956
|
(r) => t.blobDriver.getDownloadedBlob(r.accessor(e).node().resourceInfo),
|
|
@@ -1875,9 +1962,9 @@ const Rn = (s) => R(s), kn = (s) => {
|
|
|
1875
1962
|
}
|
|
1876
1963
|
)
|
|
1877
1964
|
});
|
|
1878
|
-
},
|
|
1965
|
+
}, An = (s) => {
|
|
1879
1966
|
const e = s.source;
|
|
1880
|
-
return e === void 0 ?
|
|
1967
|
+
return e === void 0 ? C(void 0) : ({ cCtx: t, drivers: r }) => {
|
|
1881
1968
|
const o = t.accessor(e).node().resourceInfo;
|
|
1882
1969
|
return {
|
|
1883
1970
|
type: "ScheduleComputable",
|
|
@@ -1886,9 +1973,9 @@ const Rn = (s) => R(s), kn = (s) => {
|
|
|
1886
1973
|
})
|
|
1887
1974
|
};
|
|
1888
1975
|
};
|
|
1889
|
-
},
|
|
1976
|
+
}, Ln = (s) => {
|
|
1890
1977
|
const e = s.source;
|
|
1891
|
-
return e === void 0 ?
|
|
1978
|
+
return e === void 0 ? C(void 0) : ({ drivers: t }) => ({
|
|
1892
1979
|
type: "ScheduleComputable",
|
|
1893
1980
|
computable: V.make(
|
|
1894
1981
|
(r) => t.blobDriver.getDownloadedBlob(r.accessor(e).node().resourceInfo),
|
|
@@ -1902,237 +1989,237 @@ const Rn = (s) => R(s), kn = (s) => {
|
|
|
1902
1989
|
}
|
|
1903
1990
|
)
|
|
1904
1991
|
});
|
|
1905
|
-
},
|
|
1992
|
+
}, Nn = (s) => {
|
|
1906
1993
|
const e = s.source;
|
|
1907
|
-
return e === void 0 ?
|
|
1994
|
+
return e === void 0 ? C(void 0) : ({ drivers: t }) => ({
|
|
1908
1995
|
type: "ScheduleComputable",
|
|
1909
1996
|
computable: t.blobDriver.getDownloadedBlob(e)
|
|
1910
1997
|
});
|
|
1911
|
-
},
|
|
1998
|
+
}, Dn = (s) => {
|
|
1912
1999
|
const e = s.source;
|
|
1913
|
-
return e === void 0 ?
|
|
2000
|
+
return e === void 0 ? C(void 0) : ({ drivers: t }) => ({
|
|
1914
2001
|
type: "ScheduleComputable",
|
|
1915
2002
|
computable: t.blobDriver.getOnDemandBlob(e)
|
|
1916
2003
|
});
|
|
1917
|
-
},
|
|
2004
|
+
}, Bn = (s) => {
|
|
1918
2005
|
const e = s.source;
|
|
1919
|
-
return e === void 0 ?
|
|
2006
|
+
return e === void 0 ? C(void 0) : ({ drivers: t }) => ({
|
|
1920
2007
|
type: "ScheduleComputable",
|
|
1921
2008
|
computable: t.uploadDriver.getProgressId(e)
|
|
1922
2009
|
});
|
|
1923
|
-
},
|
|
2010
|
+
}, jn = (s) => (e) => {
|
|
1924
2011
|
const t = e.source;
|
|
1925
|
-
return t === void 0 ?
|
|
2012
|
+
return t === void 0 ? C(void 0) : ({ drivers: r }) => ({
|
|
1926
2013
|
type: "ScheduleComputable",
|
|
1927
2014
|
computable: r.logDriver.getLastLogs(t, s)
|
|
1928
2015
|
});
|
|
1929
|
-
},
|
|
2016
|
+
}, xn = (s) => (e) => {
|
|
1930
2017
|
const t = e.source;
|
|
1931
|
-
return t === void 0 ?
|
|
2018
|
+
return t === void 0 ? C(void 0) : ({ drivers: r }) => ({
|
|
1932
2019
|
type: "ScheduleComputable",
|
|
1933
2020
|
computable: r.logDriver.getProgressLog(t, s)
|
|
1934
2021
|
});
|
|
1935
|
-
},
|
|
2022
|
+
}, Vn = (s) => {
|
|
1936
2023
|
const e = s.source;
|
|
1937
|
-
return e === void 0 ?
|
|
2024
|
+
return e === void 0 ? C(void 0) : ({ drivers: t }) => ({
|
|
1938
2025
|
type: "ScheduleComputable",
|
|
1939
2026
|
computable: t.logDriver.getLogHandle(e)
|
|
1940
2027
|
});
|
|
1941
2028
|
};
|
|
1942
|
-
function
|
|
2029
|
+
function O(s, e) {
|
|
1943
2030
|
switch (e.type) {
|
|
1944
2031
|
case "GetFromCtx":
|
|
1945
2032
|
const t = s[e.variable];
|
|
1946
|
-
return typeof t == "function" ? (r) =>
|
|
2033
|
+
return typeof t == "function" ? (r) => He(t(r.cCtx)) : C(t);
|
|
1947
2034
|
case "Isolate":
|
|
1948
2035
|
return ({ drivers: r }) => ({
|
|
1949
2036
|
type: "ScheduleComputable",
|
|
1950
|
-
computable:
|
|
2037
|
+
computable: rs(r, s, e.cfg)
|
|
1951
2038
|
});
|
|
1952
2039
|
case "Immediate":
|
|
1953
|
-
return
|
|
2040
|
+
return C(e.value);
|
|
1954
2041
|
case "GetJsonField":
|
|
1955
2042
|
return () => ({
|
|
1956
2043
|
type: "ScheduleSubroutine",
|
|
1957
|
-
subroutine:
|
|
2044
|
+
subroutine: $n,
|
|
1958
2045
|
args: {
|
|
1959
|
-
source:
|
|
1960
|
-
field:
|
|
2046
|
+
source: O(s, e.source),
|
|
2047
|
+
field: O(s, e.field)
|
|
1961
2048
|
}
|
|
1962
2049
|
});
|
|
1963
2050
|
case "MapArrayValues":
|
|
1964
2051
|
return () => ({
|
|
1965
2052
|
type: "ScheduleSubroutine",
|
|
1966
|
-
subroutine:
|
|
2053
|
+
subroutine: Sn(s, e),
|
|
1967
2054
|
args: {
|
|
1968
|
-
source:
|
|
2055
|
+
source: O(s, e.source)
|
|
1969
2056
|
}
|
|
1970
2057
|
});
|
|
1971
2058
|
case "MapRecordValues":
|
|
1972
2059
|
return () => ({
|
|
1973
2060
|
type: "ScheduleSubroutine",
|
|
1974
|
-
subroutine:
|
|
2061
|
+
subroutine: bn(s, e),
|
|
1975
2062
|
args: {
|
|
1976
|
-
source:
|
|
2063
|
+
source: O(s, e.source)
|
|
1977
2064
|
}
|
|
1978
2065
|
});
|
|
1979
2066
|
case "MakeObject":
|
|
1980
2067
|
return () => ({
|
|
1981
2068
|
type: "ScheduleSubroutine",
|
|
1982
|
-
subroutine:
|
|
1983
|
-
args:
|
|
2069
|
+
subroutine: vn,
|
|
2070
|
+
args: fn(e.template, (r) => O(s, r))
|
|
1984
2071
|
});
|
|
1985
2072
|
case "MakeArray":
|
|
1986
2073
|
return () => ({
|
|
1987
2074
|
type: "ScheduleSubroutine",
|
|
1988
|
-
subroutine:
|
|
1989
|
-
args:
|
|
2075
|
+
subroutine: Qr(e.template.length),
|
|
2076
|
+
args: Zr(e.template, (r) => O(s, r))
|
|
1990
2077
|
});
|
|
1991
2078
|
case "Flatten":
|
|
1992
2079
|
return () => ({
|
|
1993
2080
|
type: "ScheduleSubroutine",
|
|
1994
|
-
subroutine:
|
|
2081
|
+
subroutine: yn,
|
|
1995
2082
|
args: {
|
|
1996
|
-
source:
|
|
2083
|
+
source: O(s, e.source)
|
|
1997
2084
|
}
|
|
1998
2085
|
});
|
|
1999
2086
|
case "IsEmpty":
|
|
2000
2087
|
return () => ({
|
|
2001
2088
|
type: "ScheduleSubroutine",
|
|
2002
|
-
subroutine:
|
|
2089
|
+
subroutine: En,
|
|
2003
2090
|
args: {
|
|
2004
|
-
arg:
|
|
2091
|
+
arg: O(s, e.arg)
|
|
2005
2092
|
}
|
|
2006
2093
|
});
|
|
2007
2094
|
case "Not":
|
|
2008
2095
|
return () => ({
|
|
2009
2096
|
type: "ScheduleSubroutine",
|
|
2010
|
-
subroutine:
|
|
2097
|
+
subroutine: Cn,
|
|
2011
2098
|
args: {
|
|
2012
|
-
operand:
|
|
2099
|
+
operand: O(s, e.operand)
|
|
2013
2100
|
}
|
|
2014
2101
|
});
|
|
2015
2102
|
case "And":
|
|
2016
2103
|
return () => ({
|
|
2017
2104
|
type: "ScheduleSubroutine",
|
|
2018
|
-
subroutine:
|
|
2105
|
+
subroutine: kn,
|
|
2019
2106
|
args: {
|
|
2020
|
-
operand1:
|
|
2021
|
-
operand2:
|
|
2107
|
+
operand1: O(s, e.operand1),
|
|
2108
|
+
operand2: O(s, e.operand2)
|
|
2022
2109
|
}
|
|
2023
2110
|
});
|
|
2024
2111
|
case "Or":
|
|
2025
2112
|
return () => ({
|
|
2026
2113
|
type: "ScheduleSubroutine",
|
|
2027
|
-
subroutine:
|
|
2114
|
+
subroutine: Pn,
|
|
2028
2115
|
args: {
|
|
2029
|
-
operand1:
|
|
2030
|
-
operand2:
|
|
2116
|
+
operand1: O(s, e.operand1),
|
|
2117
|
+
operand2: O(s, e.operand2)
|
|
2031
2118
|
}
|
|
2032
2119
|
});
|
|
2033
2120
|
case "MapResourceFields":
|
|
2034
2121
|
return () => ({
|
|
2035
2122
|
type: "ScheduleSubroutine",
|
|
2036
|
-
subroutine:
|
|
2123
|
+
subroutine: In(s, e),
|
|
2037
2124
|
args: {
|
|
2038
|
-
source:
|
|
2125
|
+
source: O(s, e.source)
|
|
2039
2126
|
}
|
|
2040
2127
|
});
|
|
2041
2128
|
case "GetResourceField":
|
|
2042
2129
|
return () => ({
|
|
2043
2130
|
type: "ScheduleSubroutine",
|
|
2044
|
-
subroutine:
|
|
2131
|
+
subroutine: wn,
|
|
2045
2132
|
args: {
|
|
2046
|
-
source:
|
|
2047
|
-
field:
|
|
2133
|
+
source: O(s, e.source),
|
|
2134
|
+
field: O(s, e.field)
|
|
2048
2135
|
}
|
|
2049
2136
|
});
|
|
2050
2137
|
case "GetResourceValueAsJson":
|
|
2051
2138
|
return () => ({
|
|
2052
2139
|
type: "ScheduleSubroutine",
|
|
2053
|
-
subroutine:
|
|
2140
|
+
subroutine: On,
|
|
2054
2141
|
args: {
|
|
2055
|
-
source:
|
|
2142
|
+
source: O(s, e.source)
|
|
2056
2143
|
}
|
|
2057
2144
|
});
|
|
2058
2145
|
case "GetBlobContent":
|
|
2059
2146
|
return () => ({
|
|
2060
2147
|
type: "ScheduleSubroutine",
|
|
2061
|
-
subroutine:
|
|
2148
|
+
subroutine: Tn,
|
|
2062
2149
|
args: {
|
|
2063
|
-
source:
|
|
2150
|
+
source: O(s, e.source)
|
|
2064
2151
|
}
|
|
2065
2152
|
});
|
|
2066
2153
|
case "GetBlobContentAsString":
|
|
2067
2154
|
return () => ({
|
|
2068
2155
|
type: "ScheduleSubroutine",
|
|
2069
|
-
subroutine:
|
|
2156
|
+
subroutine: An,
|
|
2070
2157
|
args: {
|
|
2071
|
-
source:
|
|
2158
|
+
source: O(s, e.source)
|
|
2072
2159
|
}
|
|
2073
2160
|
});
|
|
2074
2161
|
case "GetBlobContentAsJson":
|
|
2075
2162
|
return () => ({
|
|
2076
2163
|
type: "ScheduleSubroutine",
|
|
2077
|
-
subroutine:
|
|
2164
|
+
subroutine: Ln,
|
|
2078
2165
|
args: {
|
|
2079
|
-
source:
|
|
2166
|
+
source: O(s, e.source)
|
|
2080
2167
|
}
|
|
2081
2168
|
});
|
|
2082
2169
|
case "GetDownloadedBlobContent":
|
|
2083
2170
|
return () => ({
|
|
2084
2171
|
type: "ScheduleSubroutine",
|
|
2085
|
-
subroutine:
|
|
2172
|
+
subroutine: Nn,
|
|
2086
2173
|
args: {
|
|
2087
|
-
source:
|
|
2174
|
+
source: O(s, e.source)
|
|
2088
2175
|
}
|
|
2089
2176
|
});
|
|
2090
2177
|
case "GetOnDemandBlobContent":
|
|
2091
2178
|
return () => ({
|
|
2092
2179
|
type: "ScheduleSubroutine",
|
|
2093
|
-
subroutine:
|
|
2180
|
+
subroutine: Dn,
|
|
2094
2181
|
args: {
|
|
2095
|
-
source:
|
|
2182
|
+
source: O(s, e.source)
|
|
2096
2183
|
}
|
|
2097
2184
|
});
|
|
2098
2185
|
case "GetImportProgress":
|
|
2099
2186
|
return () => ({
|
|
2100
2187
|
type: "ScheduleSubroutine",
|
|
2101
|
-
subroutine:
|
|
2188
|
+
subroutine: Bn,
|
|
2102
2189
|
args: {
|
|
2103
|
-
source:
|
|
2190
|
+
source: O(s, e.source)
|
|
2104
2191
|
}
|
|
2105
2192
|
});
|
|
2106
2193
|
case "GetLastLogs":
|
|
2107
2194
|
return () => ({
|
|
2108
2195
|
type: "ScheduleSubroutine",
|
|
2109
|
-
subroutine:
|
|
2196
|
+
subroutine: jn(e.lines),
|
|
2110
2197
|
args: {
|
|
2111
|
-
source:
|
|
2198
|
+
source: O(s, e.source)
|
|
2112
2199
|
}
|
|
2113
2200
|
});
|
|
2114
2201
|
case "GetProgressLog":
|
|
2115
2202
|
return () => ({
|
|
2116
2203
|
type: "ScheduleSubroutine",
|
|
2117
|
-
subroutine:
|
|
2204
|
+
subroutine: xn(e.patternToSearch),
|
|
2118
2205
|
args: {
|
|
2119
|
-
source:
|
|
2206
|
+
source: O(s, e.source)
|
|
2120
2207
|
}
|
|
2121
2208
|
});
|
|
2122
2209
|
case "GetLogHandle":
|
|
2123
2210
|
return () => ({
|
|
2124
2211
|
type: "ScheduleSubroutine",
|
|
2125
|
-
subroutine:
|
|
2212
|
+
subroutine: Vn,
|
|
2126
2213
|
args: {
|
|
2127
|
-
source:
|
|
2214
|
+
source: O(s, e.source)
|
|
2128
2215
|
}
|
|
2129
2216
|
});
|
|
2130
2217
|
default:
|
|
2131
|
-
return
|
|
2218
|
+
return G(e);
|
|
2132
2219
|
}
|
|
2133
2220
|
}
|
|
2134
|
-
const
|
|
2135
|
-
function
|
|
2221
|
+
const Un = ["$prod", "$staging"];
|
|
2222
|
+
function Gn(s) {
|
|
2136
2223
|
return {
|
|
2137
2224
|
$blockId: s.blockId,
|
|
2138
2225
|
$args: (e) => JSON.parse(s.args(e)),
|
|
@@ -2144,18 +2231,18 @@ function Dn(s) {
|
|
|
2144
2231
|
$staging: s.staging
|
|
2145
2232
|
};
|
|
2146
2233
|
}
|
|
2147
|
-
const
|
|
2148
|
-
function
|
|
2149
|
-
return s.op ==
|
|
2234
|
+
const es = Symbol(), ts = "return", Jn = { op: es, arg: ts };
|
|
2235
|
+
function Mn(s) {
|
|
2236
|
+
return s.op == es && s.arg == ts;
|
|
2150
2237
|
}
|
|
2151
|
-
function
|
|
2238
|
+
function _n() {
|
|
2152
2239
|
return { pendingSubroutines: /* @__PURE__ */ new Map() };
|
|
2153
2240
|
}
|
|
2154
|
-
function
|
|
2155
|
-
const o = new
|
|
2156
|
-
if (
|
|
2241
|
+
function er(s, e, t, r) {
|
|
2242
|
+
const o = new Nr(t), n = (c, a) => {
|
|
2243
|
+
if (Mn(c))
|
|
2157
2244
|
return e.result = a, !1;
|
|
2158
|
-
const l =
|
|
2245
|
+
const l = B(e.pendingSubroutines.get(c.op));
|
|
2159
2246
|
if (c.arg in l.args) throw new Error("argument already set");
|
|
2160
2247
|
return l.args[c.arg] = a, l.argCounter--, l.argCounter === 0 && (e.pendingSubroutines.delete(c.op), o.push({
|
|
2161
2248
|
destination: l.destination,
|
|
@@ -2198,32 +2285,32 @@ function Xt(s, e, t, r) {
|
|
|
2198
2285
|
});
|
|
2199
2286
|
break;
|
|
2200
2287
|
default:
|
|
2201
|
-
|
|
2288
|
+
G(a);
|
|
2202
2289
|
}
|
|
2203
2290
|
}
|
|
2204
2291
|
return i;
|
|
2205
2292
|
}
|
|
2206
|
-
function
|
|
2207
|
-
return
|
|
2293
|
+
function Kn(s, e, t, r = {}) {
|
|
2294
|
+
return rs(s, Gn(e), t, r);
|
|
2208
2295
|
}
|
|
2209
|
-
function
|
|
2210
|
-
const o = `${e.blockId}#` +
|
|
2296
|
+
function rs(s, e, t, r = {}) {
|
|
2297
|
+
const o = `${e.blockId}#` + ve({
|
|
2211
2298
|
ctx: Object.fromEntries(
|
|
2212
|
-
Object.entries(e).filter(([n]) =>
|
|
2299
|
+
Object.entries(e).filter(([n]) => Un.indexOf(n) === -1)
|
|
2213
2300
|
),
|
|
2214
2301
|
cfg: t
|
|
2215
2302
|
});
|
|
2216
2303
|
return V.makeRaw(
|
|
2217
2304
|
(n) => {
|
|
2218
|
-
const i = { drivers: s, cCtx: n }, c =
|
|
2305
|
+
const i = { drivers: s, cCtx: n }, c = _n();
|
|
2219
2306
|
return {
|
|
2220
|
-
ir:
|
|
2307
|
+
ir: er(
|
|
2221
2308
|
i,
|
|
2222
2309
|
c,
|
|
2223
2310
|
[
|
|
2224
2311
|
{
|
|
2225
|
-
destination:
|
|
2226
|
-
operation:
|
|
2312
|
+
destination: Jn,
|
|
2313
|
+
operation: O(e, t)
|
|
2227
2314
|
}
|
|
2228
2315
|
],
|
|
2229
2316
|
!0
|
|
@@ -2231,7 +2318,7 @@ function Xr(s, e, t, r = {}) {
|
|
|
2231
2318
|
async postprocessValue(l) {
|
|
2232
2319
|
const u = [];
|
|
2233
2320
|
for (const f of l)
|
|
2234
|
-
u.push({ destination: f.destination, operation:
|
|
2321
|
+
u.push({ destination: f.destination, operation: C(f.computable) });
|
|
2235
2322
|
const d = {
|
|
2236
2323
|
drivers: s,
|
|
2237
2324
|
get cCtx() {
|
|
@@ -2244,7 +2331,7 @@ function Xr(s, e, t, r = {}) {
|
|
|
2244
2331
|
result: c.result,
|
|
2245
2332
|
pendingSubroutines: m
|
|
2246
2333
|
};
|
|
2247
|
-
if (
|
|
2334
|
+
if (er(d, h, u, !1), !("result" in h))
|
|
2248
2335
|
throw new Error("illegal cfg rendering stack state, no result");
|
|
2249
2336
|
return h.result;
|
|
2250
2337
|
}
|
|
@@ -2253,13 +2340,13 @@ function Xr(s, e, t, r = {}) {
|
|
|
2253
2340
|
{ ...r, key: o }
|
|
2254
2341
|
);
|
|
2255
2342
|
}
|
|
2256
|
-
function
|
|
2343
|
+
function Hn(s) {
|
|
2257
2344
|
return s instanceof ArrayBuffer || ArrayBuffer.isView(s);
|
|
2258
2345
|
}
|
|
2259
|
-
function
|
|
2346
|
+
function tr(s) {
|
|
2260
2347
|
return s !== void 0 ? Buffer.from(s).toString("base64") : void 0;
|
|
2261
2348
|
}
|
|
2262
|
-
class
|
|
2349
|
+
class Ke {
|
|
2263
2350
|
constructor(e, t, r, o, n) {
|
|
2264
2351
|
S(this, "callbackRegistry");
|
|
2265
2352
|
S(this, "fnJSONStringify");
|
|
@@ -2291,12 +2378,12 @@ class Ve {
|
|
|
2291
2378
|
try {
|
|
2292
2379
|
this.vm.unwrapResult(this.vm.evalCode(e, "bundle.js", { type: "global" })).dispose();
|
|
2293
2380
|
} catch (t) {
|
|
2294
|
-
throw
|
|
2381
|
+
throw Ke.cleanErrorContext(t), t;
|
|
2295
2382
|
}
|
|
2296
2383
|
}
|
|
2297
2384
|
runCallback(e, ...t) {
|
|
2298
2385
|
try {
|
|
2299
|
-
return
|
|
2386
|
+
return dt.withScope((r) => {
|
|
2300
2387
|
const o = r.manage(this.vm.getProp(this.callbackRegistry, e));
|
|
2301
2388
|
if (this.vm.typeof(o) !== "function")
|
|
2302
2389
|
throw new Error(`No such callback: ${e}`);
|
|
@@ -2311,7 +2398,7 @@ class Ve {
|
|
|
2311
2398
|
);
|
|
2312
2399
|
});
|
|
2313
2400
|
} catch (r) {
|
|
2314
|
-
throw
|
|
2401
|
+
throw Ke.cleanErrorContext(r), r;
|
|
2315
2402
|
}
|
|
2316
2403
|
}
|
|
2317
2404
|
//
|
|
@@ -2366,13 +2453,13 @@ class Ve {
|
|
|
2366
2453
|
return this.getAccessor(e).listDynamicFields();
|
|
2367
2454
|
}
|
|
2368
2455
|
getKeyValueBase64(e, t) {
|
|
2369
|
-
return
|
|
2456
|
+
return tr(this.getAccessor(e).getKeyValue(t));
|
|
2370
2457
|
}
|
|
2371
2458
|
getKeyValueAsString(e, t) {
|
|
2372
2459
|
return this.getAccessor(e).getKeyValueAsString(t);
|
|
2373
2460
|
}
|
|
2374
2461
|
getDataBase64(e) {
|
|
2375
|
-
return
|
|
2462
|
+
return tr(this.getAccessor(e).getData());
|
|
2376
2463
|
}
|
|
2377
2464
|
getDataAsString(e) {
|
|
2378
2465
|
return this.getAccessor(e).getDataAsString();
|
|
@@ -2383,16 +2470,16 @@ class Ve {
|
|
|
2383
2470
|
parsePObjectCollection(e, t, r, ...o) {
|
|
2384
2471
|
const n = this.getAccessor(e);
|
|
2385
2472
|
if (!n.getIsReadyOrError()) return;
|
|
2386
|
-
const i =
|
|
2473
|
+
const i = hn(n, t, r, o), c = {};
|
|
2387
2474
|
for (const [a, l] of Object.entries(i))
|
|
2388
|
-
c[a] =
|
|
2475
|
+
c[a] = le(l, (u) => this.wrapAccessor(u));
|
|
2389
2476
|
return c;
|
|
2390
2477
|
}
|
|
2391
2478
|
//
|
|
2392
2479
|
// Blobs
|
|
2393
2480
|
//
|
|
2394
2481
|
registerComputable(e, t) {
|
|
2395
|
-
const r = `${e}_${
|
|
2482
|
+
const r = `${e}_${Oe()}`;
|
|
2396
2483
|
return this.computablesToResolve[r] = t, r;
|
|
2397
2484
|
}
|
|
2398
2485
|
getBlobContentAsString(e) {
|
|
@@ -2485,7 +2572,7 @@ class Ve {
|
|
|
2485
2572
|
throw new Error(
|
|
2486
2573
|
"can't use result pool in this context (most porbably called from the future mapper)"
|
|
2487
2574
|
);
|
|
2488
|
-
this._resultPool =
|
|
2575
|
+
this._resultPool = B(
|
|
2489
2576
|
this.blockCtx.getResultsPool,
|
|
2490
2577
|
"getResultsPool"
|
|
2491
2578
|
)(this.computableCtx);
|
|
@@ -2501,7 +2588,7 @@ class Ve {
|
|
|
2501
2588
|
isComplete: e.isComplete,
|
|
2502
2589
|
entries: e.entries.map((t) => ({
|
|
2503
2590
|
ref: t.ref,
|
|
2504
|
-
obj:
|
|
2591
|
+
obj: le(t.obj, (r) => this.wrapAccessor(r))
|
|
2505
2592
|
}))
|
|
2506
2593
|
};
|
|
2507
2594
|
}
|
|
@@ -2514,7 +2601,7 @@ class Ve {
|
|
|
2514
2601
|
obj: {
|
|
2515
2602
|
id: t.obj.id,
|
|
2516
2603
|
spec: t.obj.spec,
|
|
2517
|
-
data:
|
|
2604
|
+
data: Pr(t.obj.data, (r) => this.wrapAccessor(r))
|
|
2518
2605
|
}
|
|
2519
2606
|
}))
|
|
2520
2607
|
};
|
|
@@ -2527,7 +2614,7 @@ class Ve {
|
|
|
2527
2614
|
return this.resultPool.getSpecByRef(e, t);
|
|
2528
2615
|
}
|
|
2529
2616
|
getDataFromResultPoolByRef(e, t) {
|
|
2530
|
-
return
|
|
2617
|
+
return le(
|
|
2531
2618
|
this.resultPool.getDataByRef(e, t),
|
|
2532
2619
|
(r) => this.wrapAccessor(r)
|
|
2533
2620
|
);
|
|
@@ -2541,7 +2628,7 @@ class Ve {
|
|
|
2541
2628
|
"can't instantiate PFrames from this context (most porbably called from the future mapper)"
|
|
2542
2629
|
);
|
|
2543
2630
|
return this.env.driverKit.pFrameDriver.createPFrame(
|
|
2544
|
-
e.map((t) =>
|
|
2631
|
+
e.map((t) => le(
|
|
2545
2632
|
t,
|
|
2546
2633
|
(r) => typeof r == "string" ? this.getAccessor(r) : r
|
|
2547
2634
|
)),
|
|
@@ -2554,7 +2641,7 @@ class Ve {
|
|
|
2554
2641
|
"can't instantiate PTable from this context (most porbably called from the future mapper)"
|
|
2555
2642
|
);
|
|
2556
2643
|
return this.env.driverKit.pFrameDriver.createPTable(
|
|
2557
|
-
|
|
2644
|
+
Or(e, (t) => le(
|
|
2558
2645
|
t,
|
|
2559
2646
|
(r) => typeof r == "string" ? this.getAccessor(r) : r
|
|
2560
2647
|
)),
|
|
@@ -2578,7 +2665,7 @@ class Ve {
|
|
|
2578
2665
|
}
|
|
2579
2666
|
wrapAccessor(e) {
|
|
2580
2667
|
if (e !== void 0) {
|
|
2581
|
-
const t =
|
|
2668
|
+
const t = Oe();
|
|
2582
2669
|
return this.accessors.set(t, e), t;
|
|
2583
2670
|
}
|
|
2584
2671
|
}
|
|
@@ -2610,7 +2697,7 @@ class Ve {
|
|
|
2610
2697
|
r = this.vm.null;
|
|
2611
2698
|
break;
|
|
2612
2699
|
}
|
|
2613
|
-
if (
|
|
2700
|
+
if (Hn(e)) {
|
|
2614
2701
|
r = this.vm.newArrayBuffer(e), o = !0;
|
|
2615
2702
|
break;
|
|
2616
2703
|
}
|
|
@@ -2646,12 +2733,12 @@ class Ve {
|
|
|
2646
2733
|
return JSON.parse(t);
|
|
2647
2734
|
}
|
|
2648
2735
|
injectCtx() {
|
|
2649
|
-
|
|
2736
|
+
dt.withScope((e) => {
|
|
2650
2737
|
const t = e.manage(this.vm.newObject()), r = this.blockCtx.args(this.computableCtx), o = this.blockCtx.uiState(this.computableCtx);
|
|
2651
2738
|
this.vm.setProp(t, "args", e.manage(this.vm.newString(r))), o !== void 0 && this.vm.setProp(t, "uiState", e.manage(this.vm.newString(o))), this.vm.setProp(t, "callbackRegistry", this.callbackRegistry), this.vm.setProp(
|
|
2652
2739
|
t,
|
|
2653
2740
|
"featureFlags",
|
|
2654
|
-
this.exportObjectUniversal(
|
|
2741
|
+
this.exportObjectUniversal(ys.GlobalCfgRenderCtxFeatureFlags, e)
|
|
2655
2742
|
);
|
|
2656
2743
|
const n = (i, c) => {
|
|
2657
2744
|
this.vm.newFunction(i, c).consume((a) => this.vm.setProp(t, i, a));
|
|
@@ -2729,8 +2816,8 @@ class Ve {
|
|
|
2729
2816
|
});
|
|
2730
2817
|
}
|
|
2731
2818
|
}
|
|
2732
|
-
function
|
|
2733
|
-
return
|
|
2819
|
+
function We(s, e) {
|
|
2820
|
+
return Ce(
|
|
2734
2821
|
s.traverse(
|
|
2735
2822
|
{
|
|
2736
2823
|
field: U(e, "blockPack"),
|
|
@@ -2740,149 +2827,149 @@ function Je(s, e) {
|
|
|
2740
2827
|
{ field: T.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 }
|
|
2741
2828
|
),
|
|
2742
2829
|
(t) => {
|
|
2743
|
-
const r = t.getDataAsJson(), o =
|
|
2830
|
+
const r = t.getDataAsJson(), o = $r(r.config);
|
|
2744
2831
|
return { bpId: t.resourceInfo.id.toString(), info: r, cfg: o };
|
|
2745
2832
|
}
|
|
2746
2833
|
);
|
|
2747
2834
|
}
|
|
2748
|
-
const
|
|
2749
|
-
function
|
|
2835
|
+
const De = process.env.MI_LOG_OUTPUT_STATUS;
|
|
2836
|
+
function Wn(s, e, t, r, o, n = {}) {
|
|
2750
2837
|
const i = `${e.blockId}#lambda#${o}#${t.handle}`;
|
|
2751
2838
|
return n = { ...n, key: i }, n.mode === void 0 && t.retentive === !0 && (n.mode = "StableOnlyRetentive"), V.makeRaw((c) => {
|
|
2752
|
-
const a = new
|
|
2839
|
+
const a = new dt();
|
|
2753
2840
|
c.addOnDestroy(() => a.dispose());
|
|
2754
2841
|
const l = a.manage(s.quickJs.newRuntime());
|
|
2755
2842
|
l.setMemoryLimit(1024 * 640), l.setMaxStackSize(1024 * 320);
|
|
2756
|
-
const u = a.manage(l.newContext()), d = new
|
|
2843
|
+
const u = a.manage(l.newContext()), d = new Ke(a, u, e, s, c);
|
|
2757
2844
|
d.evaluateBundle(r.content);
|
|
2758
2845
|
const m = d.runCallback(t.handle);
|
|
2759
2846
|
d.resetComputableCtx();
|
|
2760
2847
|
let h = 0;
|
|
2761
|
-
return
|
|
2848
|
+
return De && De !== "unstable-only" && console.log(`Output ${t.handle} scaffold calculated.`), {
|
|
2762
2849
|
ir: d.computablesToResolve,
|
|
2763
|
-
postprocessValue: async (f, { unstableMarker: I, stable:
|
|
2850
|
+
postprocessValue: async (f, { unstableMarker: I, stable: F }) => {
|
|
2764
2851
|
for (const [_, k] of Object.entries(f)) d.runCallback(_, k);
|
|
2765
|
-
const
|
|
2766
|
-
return h++,
|
|
2767
|
-
|
|
2768
|
-
),
|
|
2852
|
+
const D = d.importObjectUniversal(m);
|
|
2853
|
+
return h++, De && (De !== "unstable-only" || !F) && console.log(
|
|
2854
|
+
F ? `Stable output ${t.handle} calculated ${D !== void 0 ? "defined" : "undefined"}; (#${h})` : `Unstable output ${t.handle}; marker = ${I}; ${D !== void 0 ? "defined" : "undefined"} (#${h})`
|
|
2855
|
+
), D;
|
|
2769
2856
|
}
|
|
2770
2857
|
};
|
|
2771
2858
|
}, n);
|
|
2772
2859
|
}
|
|
2773
|
-
function
|
|
2774
|
-
return
|
|
2860
|
+
function zn(s) {
|
|
2861
|
+
return Ir(s) ? s.isActive === !0 : mn(s);
|
|
2775
2862
|
}
|
|
2776
|
-
function
|
|
2777
|
-
if (
|
|
2863
|
+
function ke(s, e, t, r, o, n = {}) {
|
|
2864
|
+
if (Ir(t)) {
|
|
2778
2865
|
if (r === void 0) throw new Error("No code bundle.");
|
|
2779
|
-
return
|
|
2780
|
-
} else return
|
|
2866
|
+
return Wn(s, e, t, r, o, n);
|
|
2867
|
+
} else return Kn(s.driverKit, e, t, n);
|
|
2781
2868
|
}
|
|
2782
|
-
function
|
|
2869
|
+
function Xn(s, e, t) {
|
|
2783
2870
|
return V.make(
|
|
2784
2871
|
(r) => {
|
|
2785
|
-
var f, I,
|
|
2786
|
-
const o = r.accessor(s).node(), n =
|
|
2787
|
-
o.getKeyValueAsJson(
|
|
2872
|
+
var f, I, F, D, _, k, se, pe;
|
|
2873
|
+
const o = r.accessor(s).node(), n = B(o.getKeyValueAsJson(Ct)), i = B(o.getKeyValueAsJson($e)), c = B(o.getKeyValueAsJson(Ie)), a = B(o.getKeyValueAsJson(de)), l = B(
|
|
2874
|
+
o.getKeyValueAsJson(Je)
|
|
2788
2875
|
), u = /* @__PURE__ */ new Map();
|
|
2789
|
-
for (const { id:
|
|
2876
|
+
for (const { id: A } of te(a)) {
|
|
2790
2877
|
const z = o.traverse({
|
|
2791
|
-
field: U(
|
|
2878
|
+
field: U(A, "currentArgs"),
|
|
2792
2879
|
assertFieldType: "Dynamic",
|
|
2793
2880
|
errorIfFieldNotSet: !0
|
|
2794
2881
|
});
|
|
2795
2882
|
let oe;
|
|
2796
2883
|
const K = o.traverse({
|
|
2797
|
-
field: U(
|
|
2884
|
+
field: U(A, "prodArgs"),
|
|
2798
2885
|
assertFieldType: "Dynamic",
|
|
2799
2886
|
stableIfNotFound: !0
|
|
2800
2887
|
});
|
|
2801
2888
|
if (K !== void 0) {
|
|
2802
|
-
const
|
|
2803
|
-
field: U(
|
|
2889
|
+
const J = o.getField({
|
|
2890
|
+
field: U(A, "prodOutput"),
|
|
2804
2891
|
assertFieldType: "Dynamic",
|
|
2805
2892
|
errorIfFieldNotFound: !0
|
|
2806
|
-
}),
|
|
2807
|
-
field: U(
|
|
2893
|
+
}), x = o.getField({
|
|
2894
|
+
field: U(A, "prodUiCtx"),
|
|
2808
2895
|
assertFieldType: "Dynamic",
|
|
2809
2896
|
errorIfFieldNotFound: !0
|
|
2810
2897
|
});
|
|
2811
2898
|
oe = {
|
|
2812
2899
|
arguments: K.getDataAsJson(),
|
|
2813
2900
|
stale: z.id !== K.id,
|
|
2814
|
-
outputError:
|
|
2815
|
-
outputsError: ((
|
|
2816
|
-
exportsError: ((k =
|
|
2817
|
-
finished: (
|
|
2901
|
+
outputError: J.error !== void 0 || x.error !== void 0 || ((f = J.value) == null ? void 0 : f.getError()) !== void 0 || ((I = x.value) == null ? void 0 : I.getError()) !== void 0,
|
|
2902
|
+
outputsError: ((F = J.error) == null ? void 0 : F.getDataAsString()) ?? ((_ = (D = J.value) == null ? void 0 : D.getError()) == null ? void 0 : _.getDataAsString()),
|
|
2903
|
+
exportsError: ((k = x.error) == null ? void 0 : k.getDataAsString()) ?? ((pe = (se = x.value) == null ? void 0 : se.getError()) == null ? void 0 : pe.getDataAsString()),
|
|
2904
|
+
finished: (J.value !== void 0 && J.value.getIsReadyOrError() || J.error !== void 0 && J.error.getIsReadyOrError()) && (x.value !== void 0 && x.value.getIsReadyOrError() || x.error !== void 0 && x.error.getIsReadyOrError())
|
|
2818
2905
|
};
|
|
2819
2906
|
}
|
|
2820
|
-
u.set(
|
|
2907
|
+
u.set(A, { currentArguments: z.getDataAsJson(), prod: oe });
|
|
2821
2908
|
}
|
|
2822
|
-
const d =
|
|
2823
|
-
var b, w,
|
|
2824
|
-
const K =
|
|
2825
|
-
let
|
|
2826
|
-
K.prod !== void 0 && (m.has(
|
|
2827
|
-
const X =
|
|
2828
|
-
const re =
|
|
2909
|
+
const d = Ue(a, (A) => u.get(A).currentArguments), m = new Set(l.blocksInLimbo), h = [...te(a)].map(({ id: A, label: z, renderingMode: oe }) => {
|
|
2910
|
+
var b, w, R, P, E;
|
|
2911
|
+
const K = B(u.get(A)), J = B(d.nodes.get(A));
|
|
2912
|
+
let x = "NotCalculated";
|
|
2913
|
+
K.prod !== void 0 && (m.has(A) ? x = "Limbo" : x = K.prod.finished ? "Done" : "Running");
|
|
2914
|
+
const X = We(o, A), { sections: he, title: v, inputsValid: p, sdkVersion: y } = Ce(X, ({ bpId: $, cfg: L, info: N }) => {
|
|
2915
|
+
const re = Ot(s, A);
|
|
2829
2916
|
return {
|
|
2830
|
-
sections:
|
|
2917
|
+
sections: ke(
|
|
2831
2918
|
t,
|
|
2832
2919
|
re,
|
|
2833
2920
|
L.sections,
|
|
2834
2921
|
L.code,
|
|
2835
|
-
|
|
2922
|
+
$
|
|
2836
2923
|
),
|
|
2837
|
-
title:
|
|
2924
|
+
title: Ce(
|
|
2838
2925
|
L.title,
|
|
2839
|
-
(
|
|
2926
|
+
(fs) => ke(
|
|
2840
2927
|
t,
|
|
2841
2928
|
re,
|
|
2842
|
-
|
|
2929
|
+
fs,
|
|
2843
2930
|
L.code,
|
|
2844
|
-
|
|
2931
|
+
$
|
|
2845
2932
|
)
|
|
2846
2933
|
),
|
|
2847
|
-
inputsValid:
|
|
2934
|
+
inputsValid: ke(
|
|
2848
2935
|
t,
|
|
2849
2936
|
re,
|
|
2850
2937
|
L.inputsValid,
|
|
2851
2938
|
L.code,
|
|
2852
|
-
|
|
2939
|
+
$
|
|
2853
2940
|
),
|
|
2854
2941
|
sdkVersion: L.sdkVersion
|
|
2855
2942
|
};
|
|
2856
|
-
}) || {}, g =
|
|
2943
|
+
}) || {}, g = Ce(
|
|
2857
2944
|
X,
|
|
2858
|
-
({ info:
|
|
2945
|
+
({ info: $ }) => t.blockUpdateWatcher.get($.source)
|
|
2859
2946
|
);
|
|
2860
2947
|
return {
|
|
2861
|
-
id:
|
|
2948
|
+
id: A,
|
|
2862
2949
|
label: v ?? z,
|
|
2863
2950
|
title: v ?? z,
|
|
2864
2951
|
renderingMode: oe,
|
|
2865
|
-
stale: ((b = K.prod) == null ? void 0 : b.stale) !== !1 ||
|
|
2866
|
-
missingReference:
|
|
2867
|
-
upstreams: [...d.traverseIdsExcludingRoots("upstream",
|
|
2868
|
-
downstreams: [...d.traverseIdsExcludingRoots("downstream",
|
|
2869
|
-
calculationStatus:
|
|
2952
|
+
stale: ((b = K.prod) == null ? void 0 : b.stale) !== !1 || x === "Limbo",
|
|
2953
|
+
missingReference: J.missingReferences,
|
|
2954
|
+
upstreams: [...d.traverseIdsExcludingRoots("upstream", A)],
|
|
2955
|
+
downstreams: [...d.traverseIdsExcludingRoots("downstream", A)],
|
|
2956
|
+
calculationStatus: x,
|
|
2870
2957
|
outputErrors: ((w = K.prod) == null ? void 0 : w.outputError) === !0,
|
|
2871
|
-
outputsError: (
|
|
2958
|
+
outputsError: (R = K.prod) == null ? void 0 : R.outputsError,
|
|
2872
2959
|
exportsError: (P = K.prod) == null ? void 0 : P.exportsError,
|
|
2873
|
-
sections:
|
|
2960
|
+
sections: he,
|
|
2874
2961
|
inputsValid: p,
|
|
2875
2962
|
currentBlockPack: (E = X == null ? void 0 : X.info) == null ? void 0 : E.source,
|
|
2876
2963
|
updatedBlockPack: g,
|
|
2877
2964
|
sdkVersion: y,
|
|
2878
|
-
navigationState: e.getState(
|
|
2965
|
+
navigationState: e.getState(A)
|
|
2879
2966
|
};
|
|
2880
2967
|
});
|
|
2881
2968
|
return {
|
|
2882
2969
|
meta: c,
|
|
2883
2970
|
created: new Date(n),
|
|
2884
2971
|
lastModified: new Date(i),
|
|
2885
|
-
authorMarker: o.getKeyValueAsJson(
|
|
2972
|
+
authorMarker: o.getKeyValueAsJson(ft),
|
|
2886
2973
|
blocks: h
|
|
2887
2974
|
};
|
|
2888
2975
|
},
|
|
@@ -2901,13 +2988,13 @@ function Mn(s, e, t) {
|
|
|
2901
2988
|
}
|
|
2902
2989
|
).withStableType();
|
|
2903
2990
|
}
|
|
2904
|
-
function
|
|
2991
|
+
function qn(s, e) {
|
|
2905
2992
|
const t = s.node();
|
|
2906
|
-
if (ae(t.resourceType,
|
|
2993
|
+
if (ae(t.resourceType, _r)) {
|
|
2907
2994
|
const r = t.getDataAsJson();
|
|
2908
2995
|
if (r === void 0) throw new Error("No resource data.");
|
|
2909
2996
|
return e.frontendDownloadDriver.getPath(new URL(r.url)).withStableType();
|
|
2910
|
-
} else if (ae(t.resourceType,
|
|
2997
|
+
} else if (ae(t.resourceType, Kr)) {
|
|
2911
2998
|
const r = t.getDataAsJson();
|
|
2912
2999
|
if (r === void 0) throw new Error("No resource data.");
|
|
2913
3000
|
return e.signer.verify(
|
|
@@ -2918,10 +3005,10 @@ function _n(s, e) {
|
|
|
2918
3005
|
} else
|
|
2919
3006
|
throw new Error(`Unsupported resource type: ${JSON.stringify(t.resourceType)}`);
|
|
2920
3007
|
}
|
|
2921
|
-
function
|
|
3008
|
+
function Yn(s, e) {
|
|
2922
3009
|
if (s !== void 0)
|
|
2923
3010
|
return V.make(
|
|
2924
|
-
(t) =>
|
|
3011
|
+
(t) => qn(t.accessor(s), e),
|
|
2925
3012
|
{
|
|
2926
3013
|
postprocessValue: (t) => {
|
|
2927
3014
|
if (t !== void 0) {
|
|
@@ -2933,86 +3020,86 @@ function Kn(s, e) {
|
|
|
2933
3020
|
}
|
|
2934
3021
|
).withStableType();
|
|
2935
3022
|
}
|
|
2936
|
-
function
|
|
3023
|
+
function Zn(s, e, t) {
|
|
2937
3024
|
return V.make(
|
|
2938
3025
|
(r) => {
|
|
2939
3026
|
var c;
|
|
2940
|
-
const o = r.accessor(s).node(), n =
|
|
3027
|
+
const o = r.accessor(s).node(), n = We(o, e), i = (c = o.traverse(
|
|
2941
3028
|
{
|
|
2942
3029
|
field: U(e, "blockPack"),
|
|
2943
3030
|
assertFieldType: "Dynamic"
|
|
2944
3031
|
},
|
|
2945
3032
|
{ field: T.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 },
|
|
2946
|
-
{ field:
|
|
3033
|
+
{ field: Wr, assertFieldType: "Input" }
|
|
2947
3034
|
)) == null ? void 0 : c.persist();
|
|
2948
3035
|
return {
|
|
2949
|
-
path:
|
|
3036
|
+
path: Yn(i, t),
|
|
2950
3037
|
sdkVersion: n == null ? void 0 : n.cfg.sdkVersion
|
|
2951
3038
|
};
|
|
2952
3039
|
},
|
|
2953
3040
|
{ mode: "StableOnlyLive" }
|
|
2954
3041
|
);
|
|
2955
3042
|
}
|
|
2956
|
-
function
|
|
3043
|
+
function ss(s, e, t) {
|
|
2957
3044
|
if (t === void 0)
|
|
2958
|
-
return V.make((i) =>
|
|
2959
|
-
key: `inputs#${
|
|
3045
|
+
return V.make((i) => ss(s, e, i), {
|
|
3046
|
+
key: `inputs#${Ar(s.rid)}#${e}`
|
|
2960
3047
|
});
|
|
2961
|
-
const r = t.accessor(s).node(), o =
|
|
3048
|
+
const r = t.accessor(s).node(), o = Ot(s, e), n = o.uiState(t);
|
|
2962
3049
|
return {
|
|
2963
|
-
author: r.getKeyValueAsJson(
|
|
3050
|
+
author: r.getKeyValueAsJson(ht(e)),
|
|
2964
3051
|
args: JSON.parse(o.args(t)),
|
|
2965
3052
|
ui: n !== void 0 ? JSON.parse(n) : void 0
|
|
2966
3053
|
};
|
|
2967
3054
|
}
|
|
2968
|
-
function
|
|
3055
|
+
function Qn(s, e, t) {
|
|
2969
3056
|
return V.make(
|
|
2970
3057
|
(r) => {
|
|
2971
|
-
const o = r.accessor(s).node(), n =
|
|
2972
|
-
return
|
|
3058
|
+
const o = r.accessor(s).node(), n = Yr(s, e);
|
|
3059
|
+
return Ce(We(o, e), ({ cfg: i, bpId: c }) => {
|
|
2973
3060
|
const a = {};
|
|
2974
3061
|
for (const [l, u] of Object.entries(i.outputs)) {
|
|
2975
|
-
const d =
|
|
3062
|
+
const d = ke(t, n, u, i.code, c);
|
|
2976
3063
|
a[l] = V.wrapError(d);
|
|
2977
3064
|
}
|
|
2978
3065
|
return a;
|
|
2979
3066
|
});
|
|
2980
3067
|
},
|
|
2981
|
-
{ key: "outputs#" +
|
|
3068
|
+
{ key: "outputs#" + Ar(s.rid) + "#" + e }
|
|
2982
3069
|
).withStableType();
|
|
2983
3070
|
}
|
|
2984
|
-
function
|
|
3071
|
+
function ei(s, e) {
|
|
2985
3072
|
return V.make((t) => {
|
|
2986
|
-
const r = t.accessor(s).node(), o =
|
|
3073
|
+
const r = t.accessor(s).node(), o = B(r.getKeyValueAsJson(de)), n = [];
|
|
2987
3074
|
for (const { id: i, renderingMode: c } of te(o)) {
|
|
2988
|
-
const a =
|
|
3075
|
+
const a = We(r, i);
|
|
2989
3076
|
if (a === void 0) continue;
|
|
2990
|
-
const l = Object.entries(a.cfg.outputs).map(([, d]) => d).filter((d) =>
|
|
3077
|
+
const l = Object.entries(a.cfg.outputs).map(([, d]) => d).filter((d) => zn(d)).map((d) => d);
|
|
2991
3078
|
if (l.length === 0) continue;
|
|
2992
|
-
const u =
|
|
3079
|
+
const u = Yr(r.persist(), i);
|
|
2993
3080
|
for (const d of l)
|
|
2994
3081
|
n.push(
|
|
2995
|
-
V.wrapError(
|
|
3082
|
+
V.wrapError(ke(e, u, d, a.cfg.code, a.bpId))
|
|
2996
3083
|
);
|
|
2997
3084
|
}
|
|
2998
3085
|
return n;
|
|
2999
3086
|
});
|
|
3000
3087
|
}
|
|
3001
|
-
class
|
|
3088
|
+
class ti {
|
|
3002
3089
|
constructor() {
|
|
3003
3090
|
S(this, "states", /* @__PURE__ */ new Map());
|
|
3004
3091
|
}
|
|
3005
3092
|
setState(e, t) {
|
|
3006
3093
|
const r = this.states.get(e);
|
|
3007
3094
|
if (r === void 0) {
|
|
3008
|
-
this.states.set(e, { state: t, change: new
|
|
3095
|
+
this.states.set(e, { state: t, change: new Jt() });
|
|
3009
3096
|
return;
|
|
3010
3097
|
}
|
|
3011
3098
|
r.state = { ...t }, r.change.markChanged();
|
|
3012
3099
|
}
|
|
3013
3100
|
readState(e, t) {
|
|
3014
3101
|
let r = this.states.get(t);
|
|
3015
|
-
return r === void 0 && (r = { state: { ...
|
|
3102
|
+
return r === void 0 && (r = { state: { ...ws }, change: new Jt() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
|
|
3016
3103
|
}
|
|
3017
3104
|
getState(e) {
|
|
3018
3105
|
return V.make(
|
|
@@ -3025,38 +3112,38 @@ class Xn {
|
|
|
3025
3112
|
t !== void 0 && (this.states.delete(e), t.change.markChanged());
|
|
3026
3113
|
}
|
|
3027
3114
|
}
|
|
3028
|
-
class
|
|
3115
|
+
class $t {
|
|
3029
3116
|
constructor(e, t, r) {
|
|
3030
3117
|
/** Underlying pl resource id */
|
|
3031
3118
|
S(this, "rid");
|
|
3032
3119
|
/** Data for the left panel, contain basic information about block status. */
|
|
3033
3120
|
S(this, "overview");
|
|
3034
|
-
S(this, "navigationStates", new
|
|
3121
|
+
S(this, "navigationStates", new ti());
|
|
3035
3122
|
S(this, "blockComputables", /* @__PURE__ */ new Map());
|
|
3036
3123
|
S(this, "blockFrontends", /* @__PURE__ */ new Map());
|
|
3037
3124
|
S(this, "activeConfigs");
|
|
3038
3125
|
S(this, "refreshLoopResult");
|
|
3039
3126
|
S(this, "abortController", new AbortController());
|
|
3040
3127
|
S(this, "destroyed", !1);
|
|
3041
|
-
this.env = e, this.projectTree = r, this.overview =
|
|
3128
|
+
this.env = e, this.projectTree = r, this.overview = Xn(
|
|
3042
3129
|
r.entry(),
|
|
3043
3130
|
this.navigationStates,
|
|
3044
3131
|
e
|
|
3045
|
-
).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs =
|
|
3132
|
+
).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = ei(r.entry(), e);
|
|
3046
3133
|
}
|
|
3047
3134
|
async refreshLoop() {
|
|
3048
3135
|
for (; !this.destroyed; )
|
|
3049
3136
|
try {
|
|
3050
|
-
await
|
|
3137
|
+
await rt(this.env.pl, this.rid, (e) => {
|
|
3051
3138
|
e.doRefresh(this.env.ops.stagingRenderingRate);
|
|
3052
|
-
}), await this.activeConfigs.getValue(), await
|
|
3139
|
+
}), await this.activeConfigs.getValue(), await Dr(this.env.ops.projectRefreshInterval, this.abortController.signal);
|
|
3053
3140
|
} catch (e) {
|
|
3054
|
-
if (
|
|
3141
|
+
if (Ls(e)) {
|
|
3055
3142
|
console.warn(
|
|
3056
3143
|
"project refresh routine terminated, because project was externally deleted"
|
|
3057
3144
|
);
|
|
3058
3145
|
break;
|
|
3059
|
-
} else if (
|
|
3146
|
+
} else if (!Ns(e))
|
|
3060
3147
|
throw new Error("Unexpected exception", { cause: e });
|
|
3061
3148
|
}
|
|
3062
3149
|
}
|
|
@@ -3071,8 +3158,8 @@ class Et {
|
|
|
3071
3158
|
*
|
|
3072
3159
|
* @return returns newly created block id
|
|
3073
3160
|
* */
|
|
3074
|
-
async addBlock(e, t, r, o = void 0, n =
|
|
3075
|
-
const i = await this.env.bpPreparer.prepare(t), c = await this.env.bpPreparer.getBlockConfigContainer(t), a =
|
|
3161
|
+
async addBlock(e, t, r, o = void 0, n = Oe()) {
|
|
3162
|
+
const i = await this.env.bpPreparer.prepare(t), c = await this.env.bpPreparer.getBlockConfigContainer(t), a = $r(c);
|
|
3076
3163
|
return await ee(
|
|
3077
3164
|
this.env.pl,
|
|
3078
3165
|
this.rid,
|
|
@@ -3150,7 +3237,7 @@ class Et {
|
|
|
3150
3237
|
* stale state.
|
|
3151
3238
|
* */
|
|
3152
3239
|
async runBlock(e) {
|
|
3153
|
-
await
|
|
3240
|
+
await rt(this.env.pl, this.rid, (t) => t.renderProduction([e], !0)), await this.projectTree.refreshState();
|
|
3154
3241
|
}
|
|
3155
3242
|
/**
|
|
3156
3243
|
* Stops the block if it is running by destroying its production state. All
|
|
@@ -3158,7 +3245,7 @@ class Et {
|
|
|
3158
3245
|
* calculated.
|
|
3159
3246
|
* */
|
|
3160
3247
|
async stopBlock(e) {
|
|
3161
|
-
await
|
|
3248
|
+
await rt(this.env.pl, this.rid, (t) => t.stopProduction(e)), await this.projectTree.refreshState();
|
|
3162
3249
|
}
|
|
3163
3250
|
// /** Update block label. */
|
|
3164
3251
|
// public async setBlockLabel(blockId: string, label: string, author?: AuthorMarker) {
|
|
@@ -3215,12 +3302,12 @@ class Et {
|
|
|
3215
3302
|
/** Resets arguments and ui state of the block to initial state */
|
|
3216
3303
|
async resetBlockArgsAndUiState(e, t) {
|
|
3217
3304
|
await this.env.pl.withWriteTx("BlockInputsReset", async (r) => {
|
|
3218
|
-
const o =
|
|
3219
|
-
(await r.getField(
|
|
3220
|
-
), n =
|
|
3221
|
-
(await r.getField(
|
|
3305
|
+
const o = ut(
|
|
3306
|
+
(await r.getField(j(this.rid, U(e, "blockPack")))).value
|
|
3307
|
+
), n = ut(
|
|
3308
|
+
(await r.getField(j(o, T.HolderRefField))).value
|
|
3222
3309
|
), i = await r.getResourceData(n, !1), c = JSON.parse(
|
|
3223
|
-
Buffer.from(
|
|
3310
|
+
Buffer.from(B(i.data)).toString("utf-8")
|
|
3224
3311
|
);
|
|
3225
3312
|
await ee(r, this.rid, t, (a) => {
|
|
3226
3313
|
a.setArgs([{ blockId: e, args: JSON.stringify(c.config.initialArgs) }]), a.setUiState(e, void 0);
|
|
@@ -3230,10 +3317,10 @@ class Et {
|
|
|
3230
3317
|
getBlockComputables(e) {
|
|
3231
3318
|
const t = this.blockComputables.get(e);
|
|
3232
3319
|
if (t === void 0) {
|
|
3233
|
-
const r =
|
|
3320
|
+
const r = Qn(this.projectTree.entry(), e, this.env), n = {
|
|
3234
3321
|
fullState: V.make(
|
|
3235
3322
|
(i) => ({
|
|
3236
|
-
argsAndUiState:
|
|
3323
|
+
argsAndUiState: ss(this.projectTree.entry(), e, i),
|
|
3237
3324
|
outputs: r,
|
|
3238
3325
|
navigationState: this.navigationStates.getState(e)
|
|
3239
3326
|
}),
|
|
@@ -3264,7 +3351,7 @@ class Et {
|
|
|
3264
3351
|
getBlockFrontend(e) {
|
|
3265
3352
|
const t = this.blockFrontends.get(e);
|
|
3266
3353
|
if (t === void 0) {
|
|
3267
|
-
const r =
|
|
3354
|
+
const r = Zn(
|
|
3268
3355
|
this.projectTree.entry(),
|
|
3269
3356
|
e,
|
|
3270
3357
|
this.env
|
|
@@ -3284,19 +3371,19 @@ class Et {
|
|
|
3284
3371
|
await this.destroy();
|
|
3285
3372
|
}
|
|
3286
3373
|
static async init(e, t) {
|
|
3287
|
-
const r = await
|
|
3374
|
+
const r = await Lr.init(
|
|
3288
3375
|
e.pl,
|
|
3289
3376
|
t,
|
|
3290
3377
|
{
|
|
3291
3378
|
...e.ops.defaultTreeOptions,
|
|
3292
|
-
pruning:
|
|
3379
|
+
pruning: ri
|
|
3293
3380
|
},
|
|
3294
3381
|
e.logger
|
|
3295
3382
|
);
|
|
3296
|
-
return new
|
|
3383
|
+
return new $t(e, t, r);
|
|
3297
3384
|
}
|
|
3298
3385
|
}
|
|
3299
|
-
function
|
|
3386
|
+
function ri(s) {
|
|
3300
3387
|
switch (s.type.name) {
|
|
3301
3388
|
case "BlockPackCustom":
|
|
3302
3389
|
return s.fields.filter((e) => e.name !== "template");
|
|
@@ -3308,8 +3395,8 @@ function qn(s) {
|
|
|
3308
3395
|
return s.fields;
|
|
3309
3396
|
}
|
|
3310
3397
|
}
|
|
3311
|
-
const
|
|
3312
|
-
logger: new
|
|
3398
|
+
const os = {
|
|
3399
|
+
logger: new Ps(),
|
|
3313
3400
|
blobDriverOps: {
|
|
3314
3401
|
cacheSoftSizeBytes: 100 * 1024 * 1024,
|
|
3315
3402
|
// 100MB
|
|
@@ -3327,13 +3414,13 @@ const Yr = {
|
|
|
3327
3414
|
stopPollingDelay: 1e3
|
|
3328
3415
|
}
|
|
3329
3416
|
};
|
|
3330
|
-
function
|
|
3417
|
+
function ns(s) {
|
|
3331
3418
|
return {
|
|
3332
3419
|
blobDownloadPath: H.join(s, "download")
|
|
3333
3420
|
};
|
|
3334
3421
|
}
|
|
3335
|
-
const
|
|
3336
|
-
...
|
|
3422
|
+
const si = {
|
|
3423
|
+
...os,
|
|
3337
3424
|
defaultTreeOptions: {
|
|
3338
3425
|
pollingInterval: 350,
|
|
3339
3426
|
stopPollingDelay: 2500
|
|
@@ -3342,18 +3429,18 @@ const Yn = {
|
|
|
3342
3429
|
projectRefreshInterval: 700,
|
|
3343
3430
|
stagingRenderingRate: 5
|
|
3344
3431
|
};
|
|
3345
|
-
function
|
|
3432
|
+
function oi(s) {
|
|
3346
3433
|
return {
|
|
3347
|
-
...
|
|
3434
|
+
...ns(s),
|
|
3348
3435
|
frontendDownloadPath: H.join(s, "frontend")
|
|
3349
3436
|
};
|
|
3350
3437
|
}
|
|
3351
|
-
function
|
|
3438
|
+
function ni(s) {
|
|
3352
3439
|
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
3353
3440
|
}
|
|
3354
|
-
var
|
|
3355
|
-
const
|
|
3356
|
-
9007199254740991,
|
|
3441
|
+
var wt = { exports: {} };
|
|
3442
|
+
const ii = "2.0.0", is = 256, ai = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
3443
|
+
9007199254740991, ci = 16, li = is - 6, ui = [
|
|
3357
3444
|
"major",
|
|
3358
3445
|
"premajor",
|
|
3359
3446
|
"minor",
|
|
@@ -3362,25 +3449,25 @@ const ei = "2.0.0", Qr = 256, ti = Number.MAX_SAFE_INTEGER || /* istanbul ignore
|
|
|
3362
3449
|
"prepatch",
|
|
3363
3450
|
"prerelease"
|
|
3364
3451
|
];
|
|
3365
|
-
var
|
|
3366
|
-
MAX_LENGTH:
|
|
3367
|
-
MAX_SAFE_COMPONENT_LENGTH:
|
|
3368
|
-
MAX_SAFE_BUILD_LENGTH:
|
|
3369
|
-
MAX_SAFE_INTEGER:
|
|
3370
|
-
RELEASE_TYPES:
|
|
3371
|
-
SEMVER_SPEC_VERSION:
|
|
3452
|
+
var ze = {
|
|
3453
|
+
MAX_LENGTH: is,
|
|
3454
|
+
MAX_SAFE_COMPONENT_LENGTH: ci,
|
|
3455
|
+
MAX_SAFE_BUILD_LENGTH: li,
|
|
3456
|
+
MAX_SAFE_INTEGER: ai,
|
|
3457
|
+
RELEASE_TYPES: ui,
|
|
3458
|
+
SEMVER_SPEC_VERSION: ii,
|
|
3372
3459
|
FLAG_INCLUDE_PRERELEASE: 1,
|
|
3373
3460
|
FLAG_LOOSE: 2
|
|
3374
3461
|
};
|
|
3375
|
-
const
|
|
3462
|
+
const di = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...s) => console.error("SEMVER", ...s) : () => {
|
|
3376
3463
|
};
|
|
3377
|
-
var
|
|
3464
|
+
var Xe = di;
|
|
3378
3465
|
(function(s, e) {
|
|
3379
3466
|
const {
|
|
3380
3467
|
MAX_SAFE_COMPONENT_LENGTH: t,
|
|
3381
3468
|
MAX_SAFE_BUILD_LENGTH: r,
|
|
3382
3469
|
MAX_LENGTH: o
|
|
3383
|
-
} =
|
|
3470
|
+
} = ze, n = Xe;
|
|
3384
3471
|
e = s.exports = {};
|
|
3385
3472
|
const i = e.re = [], c = e.safeRe = [], a = e.src = [], l = e.t = {};
|
|
3386
3473
|
let u = 0;
|
|
@@ -3389,53 +3476,53 @@ var _e = ni;
|
|
|
3389
3476
|
["\\d", o],
|
|
3390
3477
|
[d, r]
|
|
3391
3478
|
], h = (I) => {
|
|
3392
|
-
for (const [
|
|
3393
|
-
I = I.split(`${
|
|
3479
|
+
for (const [F, D] of m)
|
|
3480
|
+
I = I.split(`${F}*`).join(`${F}{0,${D}}`).split(`${F}+`).join(`${F}{1,${D}}`);
|
|
3394
3481
|
return I;
|
|
3395
|
-
}, f = (I,
|
|
3396
|
-
const _ = h(
|
|
3397
|
-
n(I, k,
|
|
3482
|
+
}, f = (I, F, D) => {
|
|
3483
|
+
const _ = h(F), k = u++;
|
|
3484
|
+
n(I, k, F), l[I] = k, a[k] = F, i[k] = new RegExp(F, D ? "g" : void 0), c[k] = new RegExp(_, D ? "g" : void 0);
|
|
3398
3485
|
};
|
|
3399
3486
|
f("NUMERICIDENTIFIER", "0|[1-9]\\d*"), f("NUMERICIDENTIFIERLOOSE", "\\d+"), f("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${d}*`), f("MAINVERSION", `(${a[l.NUMERICIDENTIFIER]})\\.(${a[l.NUMERICIDENTIFIER]})\\.(${a[l.NUMERICIDENTIFIER]})`), f("MAINVERSIONLOOSE", `(${a[l.NUMERICIDENTIFIERLOOSE]})\\.(${a[l.NUMERICIDENTIFIERLOOSE]})\\.(${a[l.NUMERICIDENTIFIERLOOSE]})`), f("PRERELEASEIDENTIFIER", `(?:${a[l.NUMERICIDENTIFIER]}|${a[l.NONNUMERICIDENTIFIER]})`), f("PRERELEASEIDENTIFIERLOOSE", `(?:${a[l.NUMERICIDENTIFIERLOOSE]}|${a[l.NONNUMERICIDENTIFIER]})`), f("PRERELEASE", `(?:-(${a[l.PRERELEASEIDENTIFIER]}(?:\\.${a[l.PRERELEASEIDENTIFIER]})*))`), f("PRERELEASELOOSE", `(?:-?(${a[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[l.PRERELEASEIDENTIFIERLOOSE]})*))`), f("BUILDIDENTIFIER", `${d}+`), f("BUILD", `(?:\\+(${a[l.BUILDIDENTIFIER]}(?:\\.${a[l.BUILDIDENTIFIER]})*))`), f("FULLPLAIN", `v?${a[l.MAINVERSION]}${a[l.PRERELEASE]}?${a[l.BUILD]}?`), f("FULL", `^${a[l.FULLPLAIN]}$`), f("LOOSEPLAIN", `[v=\\s]*${a[l.MAINVERSIONLOOSE]}${a[l.PRERELEASELOOSE]}?${a[l.BUILD]}?`), f("LOOSE", `^${a[l.LOOSEPLAIN]}$`), f("GTLT", "((?:<|>)?=?)"), f("XRANGEIDENTIFIERLOOSE", `${a[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), f("XRANGEIDENTIFIER", `${a[l.NUMERICIDENTIFIER]}|x|X|\\*`), f("XRANGEPLAIN", `[v=\\s]*(${a[l.XRANGEIDENTIFIER]})(?:\\.(${a[l.XRANGEIDENTIFIER]})(?:\\.(${a[l.XRANGEIDENTIFIER]})(?:${a[l.PRERELEASE]})?${a[l.BUILD]}?)?)?`), f("XRANGEPLAINLOOSE", `[v=\\s]*(${a[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[l.XRANGEIDENTIFIERLOOSE]})(?:${a[l.PRERELEASELOOSE]})?${a[l.BUILD]}?)?)?`), f("XRANGE", `^${a[l.GTLT]}\\s*${a[l.XRANGEPLAIN]}$`), f("XRANGELOOSE", `^${a[l.GTLT]}\\s*${a[l.XRANGEPLAINLOOSE]}$`), f("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), f("COERCE", `${a[l.COERCEPLAIN]}(?:$|[^\\d])`), f("COERCEFULL", a[l.COERCEPLAIN] + `(?:${a[l.PRERELEASE]})?(?:${a[l.BUILD]})?(?:$|[^\\d])`), f("COERCERTL", a[l.COERCE], !0), f("COERCERTLFULL", a[l.COERCEFULL], !0), f("LONETILDE", "(?:~>?)"), f("TILDETRIM", `(\\s*)${a[l.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", f("TILDE", `^${a[l.LONETILDE]}${a[l.XRANGEPLAIN]}$`), f("TILDELOOSE", `^${a[l.LONETILDE]}${a[l.XRANGEPLAINLOOSE]}$`), f("LONECARET", "(?:\\^)"), f("CARETTRIM", `(\\s*)${a[l.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", f("CARET", `^${a[l.LONECARET]}${a[l.XRANGEPLAIN]}$`), f("CARETLOOSE", `^${a[l.LONECARET]}${a[l.XRANGEPLAINLOOSE]}$`), f("COMPARATORLOOSE", `^${a[l.GTLT]}\\s*(${a[l.LOOSEPLAIN]})$|^$`), f("COMPARATOR", `^${a[l.GTLT]}\\s*(${a[l.FULLPLAIN]})$|^$`), f("COMPARATORTRIM", `(\\s*)${a[l.GTLT]}\\s*(${a[l.LOOSEPLAIN]}|${a[l.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", f("HYPHENRANGE", `^\\s*(${a[l.XRANGEPLAIN]})\\s+-\\s+(${a[l.XRANGEPLAIN]})\\s*$`), f("HYPHENRANGELOOSE", `^\\s*(${a[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[l.XRANGEPLAINLOOSE]})\\s*$`), f("STAR", "(<|>)?=?\\s*\\*"), f("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), f("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
3400
|
-
})(
|
|
3401
|
-
var
|
|
3402
|
-
const
|
|
3403
|
-
var
|
|
3404
|
-
const
|
|
3405
|
-
const t =
|
|
3487
|
+
})(wt, wt.exports);
|
|
3488
|
+
var Ae = wt.exports;
|
|
3489
|
+
const pi = Object.freeze({ loose: !0 }), hi = Object.freeze({}), fi = (s) => s ? typeof s != "object" ? pi : s : hi;
|
|
3490
|
+
var It = fi;
|
|
3491
|
+
const rr = /^[0-9]+$/, as = (s, e) => {
|
|
3492
|
+
const t = rr.test(s), r = rr.test(e);
|
|
3406
3493
|
return t && r && (s = +s, e = +e), s === e ? 0 : t && !r ? -1 : r && !t ? 1 : s < e ? -1 : 1;
|
|
3407
|
-
},
|
|
3408
|
-
var
|
|
3409
|
-
compareIdentifiers:
|
|
3410
|
-
rcompareIdentifiers:
|
|
3494
|
+
}, gi = (s, e) => as(e, s);
|
|
3495
|
+
var cs = {
|
|
3496
|
+
compareIdentifiers: as,
|
|
3497
|
+
rcompareIdentifiers: gi
|
|
3411
3498
|
};
|
|
3412
|
-
const
|
|
3413
|
-
let
|
|
3499
|
+
const Be = Xe, { MAX_LENGTH: sr, MAX_SAFE_INTEGER: je } = ze, { safeRe: or, t: nr } = Ae, mi = It, { compareIdentifiers: fe } = cs;
|
|
3500
|
+
let vi = class Q {
|
|
3414
3501
|
constructor(e, t) {
|
|
3415
|
-
if (t =
|
|
3502
|
+
if (t = mi(t), e instanceof Q) {
|
|
3416
3503
|
if (e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease)
|
|
3417
3504
|
return e;
|
|
3418
3505
|
e = e.version;
|
|
3419
3506
|
} else if (typeof e != "string")
|
|
3420
3507
|
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
|
|
3421
|
-
if (e.length >
|
|
3508
|
+
if (e.length > sr)
|
|
3422
3509
|
throw new TypeError(
|
|
3423
|
-
`version is longer than ${
|
|
3510
|
+
`version is longer than ${sr} characters`
|
|
3424
3511
|
);
|
|
3425
|
-
|
|
3426
|
-
const r = e.trim().match(t.loose ?
|
|
3512
|
+
Be("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
|
|
3513
|
+
const r = e.trim().match(t.loose ? or[nr.LOOSE] : or[nr.FULL]);
|
|
3427
3514
|
if (!r)
|
|
3428
3515
|
throw new TypeError(`Invalid Version: ${e}`);
|
|
3429
|
-
if (this.raw = e, this.major = +r[1], this.minor = +r[2], this.patch = +r[3], this.major >
|
|
3516
|
+
if (this.raw = e, this.major = +r[1], this.minor = +r[2], this.patch = +r[3], this.major > je || this.major < 0)
|
|
3430
3517
|
throw new TypeError("Invalid major version");
|
|
3431
|
-
if (this.minor >
|
|
3518
|
+
if (this.minor > je || this.minor < 0)
|
|
3432
3519
|
throw new TypeError("Invalid minor version");
|
|
3433
|
-
if (this.patch >
|
|
3520
|
+
if (this.patch > je || this.patch < 0)
|
|
3434
3521
|
throw new TypeError("Invalid patch version");
|
|
3435
3522
|
r[4] ? this.prerelease = r[4].split(".").map((o) => {
|
|
3436
3523
|
if (/^[0-9]+$/.test(o)) {
|
|
3437
3524
|
const n = +o;
|
|
3438
|
-
if (n >= 0 && n <
|
|
3525
|
+
if (n >= 0 && n < je)
|
|
3439
3526
|
return n;
|
|
3440
3527
|
}
|
|
3441
3528
|
return o;
|
|
@@ -3448,7 +3535,7 @@ let di = class Q {
|
|
|
3448
3535
|
return this.version;
|
|
3449
3536
|
}
|
|
3450
3537
|
compare(e) {
|
|
3451
|
-
if (
|
|
3538
|
+
if (Be("SemVer.compare", this.version, this.options, e), !(e instanceof Q)) {
|
|
3452
3539
|
if (typeof e == "string" && e === this.version)
|
|
3453
3540
|
return 0;
|
|
3454
3541
|
e = new Q(e, this.options);
|
|
@@ -3456,7 +3543,7 @@ let di = class Q {
|
|
|
3456
3543
|
return e.version === this.version ? 0 : this.compareMain(e) || this.comparePre(e);
|
|
3457
3544
|
}
|
|
3458
3545
|
compareMain(e) {
|
|
3459
|
-
return e instanceof Q || (e = new Q(e, this.options)),
|
|
3546
|
+
return e instanceof Q || (e = new Q(e, this.options)), fe(this.major, e.major) || fe(this.minor, e.minor) || fe(this.patch, e.patch);
|
|
3460
3547
|
}
|
|
3461
3548
|
comparePre(e) {
|
|
3462
3549
|
if (e instanceof Q || (e = new Q(e, this.options)), this.prerelease.length && !e.prerelease.length)
|
|
@@ -3468,7 +3555,7 @@ let di = class Q {
|
|
|
3468
3555
|
let t = 0;
|
|
3469
3556
|
do {
|
|
3470
3557
|
const r = this.prerelease[t], o = e.prerelease[t];
|
|
3471
|
-
if (
|
|
3558
|
+
if (Be("prerelease compare", t, r, o), r === void 0 && o === void 0)
|
|
3472
3559
|
return 0;
|
|
3473
3560
|
if (o === void 0)
|
|
3474
3561
|
return 1;
|
|
@@ -3476,7 +3563,7 @@ let di = class Q {
|
|
|
3476
3563
|
return -1;
|
|
3477
3564
|
if (r === o)
|
|
3478
3565
|
continue;
|
|
3479
|
-
return
|
|
3566
|
+
return fe(r, o);
|
|
3480
3567
|
} while (++t);
|
|
3481
3568
|
}
|
|
3482
3569
|
compareBuild(e) {
|
|
@@ -3484,7 +3571,7 @@ let di = class Q {
|
|
|
3484
3571
|
let t = 0;
|
|
3485
3572
|
do {
|
|
3486
3573
|
const r = this.build[t], o = e.build[t];
|
|
3487
|
-
if (
|
|
3574
|
+
if (Be("build compare", t, r, o), r === void 0 && o === void 0)
|
|
3488
3575
|
return 0;
|
|
3489
3576
|
if (o === void 0)
|
|
3490
3577
|
return 1;
|
|
@@ -3492,7 +3579,7 @@ let di = class Q {
|
|
|
3492
3579
|
return -1;
|
|
3493
3580
|
if (r === o)
|
|
3494
3581
|
continue;
|
|
3495
|
-
return
|
|
3582
|
+
return fe(r, o);
|
|
3496
3583
|
} while (++t);
|
|
3497
3584
|
}
|
|
3498
3585
|
// preminor will bump the version up to the next minor release, and immediately
|
|
@@ -3538,7 +3625,7 @@ let di = class Q {
|
|
|
3538
3625
|
}
|
|
3539
3626
|
if (t) {
|
|
3540
3627
|
let n = [t, o];
|
|
3541
|
-
r === !1 && (n = [t]),
|
|
3628
|
+
r === !1 && (n = [t]), fe(this.prerelease[0], t) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = n) : this.prerelease = n;
|
|
3542
3629
|
}
|
|
3543
3630
|
break;
|
|
3544
3631
|
}
|
|
@@ -3548,43 +3635,43 @@ let di = class Q {
|
|
|
3548
3635
|
return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
|
|
3549
3636
|
}
|
|
3550
3637
|
};
|
|
3551
|
-
var M =
|
|
3552
|
-
const
|
|
3553
|
-
if (s instanceof
|
|
3638
|
+
var M = vi;
|
|
3639
|
+
const ir = M, yi = (s, e, t = !1) => {
|
|
3640
|
+
if (s instanceof ir)
|
|
3554
3641
|
return s;
|
|
3555
3642
|
try {
|
|
3556
|
-
return new
|
|
3643
|
+
return new ir(s, e);
|
|
3557
3644
|
} catch (r) {
|
|
3558
3645
|
if (!t)
|
|
3559
3646
|
return null;
|
|
3560
3647
|
throw r;
|
|
3561
3648
|
}
|
|
3562
3649
|
};
|
|
3563
|
-
var
|
|
3564
|
-
const
|
|
3565
|
-
const t =
|
|
3650
|
+
var ye = yi;
|
|
3651
|
+
const wi = ye, Si = (s, e) => {
|
|
3652
|
+
const t = wi(s, e);
|
|
3566
3653
|
return t ? t.version : null;
|
|
3567
3654
|
};
|
|
3568
|
-
var
|
|
3569
|
-
const
|
|
3570
|
-
const t =
|
|
3655
|
+
var bi = Si;
|
|
3656
|
+
const Ri = ye, Ei = (s, e) => {
|
|
3657
|
+
const t = Ri(s.trim().replace(/^[=v]+/, ""), e);
|
|
3571
3658
|
return t ? t.version : null;
|
|
3572
3659
|
};
|
|
3573
|
-
var
|
|
3574
|
-
const
|
|
3660
|
+
var Ci = Ei;
|
|
3661
|
+
const ar = M, ki = (s, e, t, r, o) => {
|
|
3575
3662
|
typeof t == "string" && (o = r, r = t, t = void 0);
|
|
3576
3663
|
try {
|
|
3577
|
-
return new
|
|
3578
|
-
s instanceof
|
|
3664
|
+
return new ar(
|
|
3665
|
+
s instanceof ar ? s.version : s,
|
|
3579
3666
|
t
|
|
3580
3667
|
).inc(e, r, o).version;
|
|
3581
3668
|
} catch {
|
|
3582
3669
|
return null;
|
|
3583
3670
|
}
|
|
3584
3671
|
};
|
|
3585
|
-
var
|
|
3586
|
-
const
|
|
3587
|
-
const t =
|
|
3672
|
+
var Pi = ki;
|
|
3673
|
+
const cr = ye, Oi = (s, e) => {
|
|
3674
|
+
const t = cr(s, null, !0), r = cr(e, null, !0), o = t.compare(r);
|
|
3588
3675
|
if (o === 0)
|
|
3589
3676
|
return null;
|
|
3590
3677
|
const n = o > 0, i = n ? t : r, c = n ? r : t, a = !!i.prerelease.length;
|
|
@@ -3593,46 +3680,46 @@ const sr = ve, bi = (s, e) => {
|
|
|
3593
3680
|
const u = a ? "pre" : "";
|
|
3594
3681
|
return t.major !== r.major ? u + "major" : t.minor !== r.minor ? u + "minor" : t.patch !== r.patch ? u + "patch" : "prerelease";
|
|
3595
3682
|
};
|
|
3596
|
-
var
|
|
3597
|
-
const
|
|
3598
|
-
var
|
|
3599
|
-
const
|
|
3600
|
-
var
|
|
3601
|
-
const
|
|
3602
|
-
var
|
|
3603
|
-
const
|
|
3604
|
-
const t =
|
|
3683
|
+
var $i = Oi;
|
|
3684
|
+
const Ii = M, Fi = (s, e) => new Ii(s, e).major;
|
|
3685
|
+
var Ti = Fi;
|
|
3686
|
+
const Ai = M, Li = (s, e) => new Ai(s, e).minor;
|
|
3687
|
+
var Ni = Li;
|
|
3688
|
+
const Di = M, Bi = (s, e) => new Di(s, e).patch;
|
|
3689
|
+
var ji = Bi;
|
|
3690
|
+
const xi = ye, Vi = (s, e) => {
|
|
3691
|
+
const t = xi(s, e);
|
|
3605
3692
|
return t && t.prerelease.length ? t.prerelease : null;
|
|
3606
3693
|
};
|
|
3607
|
-
var
|
|
3608
|
-
const
|
|
3609
|
-
var Y =
|
|
3610
|
-
const
|
|
3611
|
-
var
|
|
3612
|
-
const
|
|
3613
|
-
var
|
|
3614
|
-
const
|
|
3615
|
-
const r = new
|
|
3694
|
+
var Ui = Vi;
|
|
3695
|
+
const lr = M, Gi = (s, e, t) => new lr(s, t).compare(new lr(e, t));
|
|
3696
|
+
var Y = Gi;
|
|
3697
|
+
const Ji = Y, Mi = (s, e, t) => Ji(e, s, t);
|
|
3698
|
+
var _i = Mi;
|
|
3699
|
+
const Ki = Y, Hi = (s, e) => Ki(s, e, !0);
|
|
3700
|
+
var Wi = Hi;
|
|
3701
|
+
const ur = M, zi = (s, e, t) => {
|
|
3702
|
+
const r = new ur(s, t), o = new ur(e, t);
|
|
3616
3703
|
return r.compare(o) || r.compareBuild(o);
|
|
3617
3704
|
};
|
|
3618
|
-
var
|
|
3619
|
-
const
|
|
3620
|
-
var
|
|
3621
|
-
const
|
|
3622
|
-
var
|
|
3623
|
-
const
|
|
3624
|
-
var
|
|
3625
|
-
const
|
|
3626
|
-
var
|
|
3627
|
-
const
|
|
3628
|
-
var
|
|
3629
|
-
const
|
|
3630
|
-
var
|
|
3631
|
-
const
|
|
3632
|
-
var
|
|
3633
|
-
const
|
|
3634
|
-
var
|
|
3635
|
-
const
|
|
3705
|
+
var Ft = zi;
|
|
3706
|
+
const Xi = Ft, qi = (s, e) => s.sort((t, r) => Xi(t, r, e));
|
|
3707
|
+
var Yi = qi;
|
|
3708
|
+
const Zi = Ft, Qi = (s, e) => s.sort((t, r) => Zi(r, t, e));
|
|
3709
|
+
var ea = Qi;
|
|
3710
|
+
const ta = Y, ra = (s, e, t) => ta(s, e, t) > 0;
|
|
3711
|
+
var qe = ra;
|
|
3712
|
+
const sa = Y, oa = (s, e, t) => sa(s, e, t) < 0;
|
|
3713
|
+
var Tt = oa;
|
|
3714
|
+
const na = Y, ia = (s, e, t) => na(s, e, t) === 0;
|
|
3715
|
+
var ls = ia;
|
|
3716
|
+
const aa = Y, ca = (s, e, t) => aa(s, e, t) !== 0;
|
|
3717
|
+
var us = ca;
|
|
3718
|
+
const la = Y, ua = (s, e, t) => la(s, e, t) >= 0;
|
|
3719
|
+
var At = ua;
|
|
3720
|
+
const da = Y, pa = (s, e, t) => da(s, e, t) <= 0;
|
|
3721
|
+
var Lt = pa;
|
|
3722
|
+
const ha = ls, fa = us, ga = qe, ma = At, va = Tt, ya = Lt, wa = (s, e, t, r) => {
|
|
3636
3723
|
switch (e) {
|
|
3637
3724
|
case "===":
|
|
3638
3725
|
return typeof s == "object" && (s = s.version), typeof t == "object" && (t = t.version), s === t;
|
|
@@ -3641,33 +3728,33 @@ const aa = rs, ca = ss, la = Ke, ua = $t, da = Pt, pa = Ot, ha = (s, e, t, r) =>
|
|
|
3641
3728
|
case "":
|
|
3642
3729
|
case "=":
|
|
3643
3730
|
case "==":
|
|
3644
|
-
return
|
|
3731
|
+
return ha(s, t, r);
|
|
3645
3732
|
case "!=":
|
|
3646
|
-
return
|
|
3733
|
+
return fa(s, t, r);
|
|
3647
3734
|
case ">":
|
|
3648
|
-
return
|
|
3735
|
+
return ga(s, t, r);
|
|
3649
3736
|
case ">=":
|
|
3650
|
-
return
|
|
3737
|
+
return ma(s, t, r);
|
|
3651
3738
|
case "<":
|
|
3652
|
-
return
|
|
3739
|
+
return va(s, t, r);
|
|
3653
3740
|
case "<=":
|
|
3654
|
-
return
|
|
3741
|
+
return ya(s, t, r);
|
|
3655
3742
|
default:
|
|
3656
3743
|
throw new TypeError(`Invalid operator: ${e}`);
|
|
3657
3744
|
}
|
|
3658
3745
|
};
|
|
3659
|
-
var
|
|
3660
|
-
const
|
|
3661
|
-
if (s instanceof
|
|
3746
|
+
var ds = wa;
|
|
3747
|
+
const Sa = M, ba = ye, { safeRe: xe, t: Ve } = Ae, Ra = (s, e) => {
|
|
3748
|
+
if (s instanceof Sa)
|
|
3662
3749
|
return s;
|
|
3663
3750
|
if (typeof s == "number" && (s = String(s)), typeof s != "string")
|
|
3664
3751
|
return null;
|
|
3665
3752
|
e = e || {};
|
|
3666
3753
|
let t = null;
|
|
3667
3754
|
if (!e.rtl)
|
|
3668
|
-
t = s.match(e.includePrerelease ?
|
|
3755
|
+
t = s.match(e.includePrerelease ? xe[Ve.COERCEFULL] : xe[Ve.COERCE]);
|
|
3669
3756
|
else {
|
|
3670
|
-
const a = e.includePrerelease ?
|
|
3757
|
+
const a = e.includePrerelease ? xe[Ve.COERCERTLFULL] : xe[Ve.COERCERTL];
|
|
3671
3758
|
let l;
|
|
3672
3759
|
for (; (l = a.exec(s)) && (!t || t.index + t[0].length !== s.length); )
|
|
3673
3760
|
(!t || l.index + l[0].length !== t.index + t[0].length) && (t = l), a.lastIndex = l.index + l[1].length + l[2].length;
|
|
@@ -3676,10 +3763,10 @@ const fa = M, ga = ve, { safeRe: Le, t: Ne } = Oe, ma = (s, e) => {
|
|
|
3676
3763
|
if (t === null)
|
|
3677
3764
|
return null;
|
|
3678
3765
|
const r = t[2], o = t[3] || "0", n = t[4] || "0", i = e.includePrerelease && t[5] ? `-${t[5]}` : "", c = e.includePrerelease && t[6] ? `+${t[6]}` : "";
|
|
3679
|
-
return
|
|
3766
|
+
return ba(`${r}.${o}.${n}${i}${c}`, e);
|
|
3680
3767
|
};
|
|
3681
|
-
var
|
|
3682
|
-
class
|
|
3768
|
+
var Ea = Ra;
|
|
3769
|
+
class Ca {
|
|
3683
3770
|
constructor() {
|
|
3684
3771
|
this.max = 1e3, this.map = /* @__PURE__ */ new Map();
|
|
3685
3772
|
}
|
|
@@ -3702,10 +3789,10 @@ class ya {
|
|
|
3702
3789
|
return this;
|
|
3703
3790
|
}
|
|
3704
3791
|
}
|
|
3705
|
-
var
|
|
3792
|
+
var ka = Ca, st, dr;
|
|
3706
3793
|
function Z() {
|
|
3707
|
-
if (
|
|
3708
|
-
|
|
3794
|
+
if (dr) return st;
|
|
3795
|
+
dr = 1;
|
|
3709
3796
|
const s = /\s+/g;
|
|
3710
3797
|
class e {
|
|
3711
3798
|
constructor(p, y) {
|
|
@@ -3721,7 +3808,7 @@ function Z() {
|
|
|
3721
3808
|
this.set = [g];
|
|
3722
3809
|
else if (this.set.length > 1) {
|
|
3723
3810
|
for (const b of this.set)
|
|
3724
|
-
if (b.length === 1 &&
|
|
3811
|
+
if (b.length === 1 && F(b[0])) {
|
|
3725
3812
|
this.set = [b];
|
|
3726
3813
|
break;
|
|
3727
3814
|
}
|
|
@@ -3751,12 +3838,12 @@ function Z() {
|
|
|
3751
3838
|
const g = ((this.options.includePrerelease && h) | (this.options.loose && f)) + ":" + p, b = r.get(g);
|
|
3752
3839
|
if (b)
|
|
3753
3840
|
return b;
|
|
3754
|
-
const w = this.options.loose,
|
|
3755
|
-
p = p.replace(
|
|
3756
|
-
let P = p.split(" ").map((N) => _(N, this.options)).join(" ").split(/\s+/).map((N) =>
|
|
3841
|
+
const w = this.options.loose, R = w ? a[l.HYPHENRANGELOOSE] : a[l.HYPHENRANGE];
|
|
3842
|
+
p = p.replace(R, X(this.options.includePrerelease)), i("hyphen replace", p), p = p.replace(a[l.COMPARATORTRIM], u), i("comparator trim", p), p = p.replace(a[l.TILDETRIM], d), i("tilde trim", p), p = p.replace(a[l.CARETTRIM], m), i("caret trim", p);
|
|
3843
|
+
let P = p.split(" ").map((N) => _(N, this.options)).join(" ").split(/\s+/).map((N) => x(N, this.options));
|
|
3757
3844
|
w && (P = P.filter((N) => (i("loose invalid filter", N, this.options), !!N.match(a[l.COMPARATORLOOSE])))), i("range list", P);
|
|
3758
|
-
const E = /* @__PURE__ */ new Map(),
|
|
3759
|
-
for (const N of
|
|
3845
|
+
const E = /* @__PURE__ */ new Map(), $ = P.map((N) => new n(N, this.options));
|
|
3846
|
+
for (const N of $) {
|
|
3760
3847
|
if (I(N))
|
|
3761
3848
|
return [N];
|
|
3762
3849
|
E.set(N.value, N);
|
|
@@ -3768,7 +3855,7 @@ function Z() {
|
|
|
3768
3855
|
intersects(p, y) {
|
|
3769
3856
|
if (!(p instanceof e))
|
|
3770
3857
|
throw new TypeError("a Range is required");
|
|
3771
|
-
return this.set.some((g) =>
|
|
3858
|
+
return this.set.some((g) => D(g, y) && p.set.some((b) => D(b, y) && g.every((w) => b.every((R) => w.intersects(R, y)))));
|
|
3772
3859
|
}
|
|
3773
3860
|
// if ANY of the sets match ALL of its comparators, then pass
|
|
3774
3861
|
test(p) {
|
|
@@ -3781,49 +3868,49 @@ function Z() {
|
|
|
3781
3868
|
return !1;
|
|
3782
3869
|
}
|
|
3783
3870
|
for (let y = 0; y < this.set.length; y++)
|
|
3784
|
-
if (
|
|
3871
|
+
if (he(this.set[y], p, this.options))
|
|
3785
3872
|
return !0;
|
|
3786
3873
|
return !1;
|
|
3787
3874
|
}
|
|
3788
3875
|
}
|
|
3789
|
-
|
|
3790
|
-
const t =
|
|
3876
|
+
st = e;
|
|
3877
|
+
const t = ka, r = new t(), o = It, n = Ye(), i = Xe, c = M, {
|
|
3791
3878
|
safeRe: a,
|
|
3792
3879
|
t: l,
|
|
3793
3880
|
comparatorTrimReplace: u,
|
|
3794
3881
|
tildeTrimReplace: d,
|
|
3795
3882
|
caretTrimReplace: m
|
|
3796
|
-
} =
|
|
3883
|
+
} = Ae, { FLAG_INCLUDE_PRERELEASE: h, FLAG_LOOSE: f } = ze, I = (v) => v.value === "<0.0.0-0", F = (v) => v.value === "", D = (v, p) => {
|
|
3797
3884
|
let y = !0;
|
|
3798
3885
|
const g = v.slice();
|
|
3799
3886
|
let b = g.pop();
|
|
3800
3887
|
for (; y && g.length; )
|
|
3801
3888
|
y = g.every((w) => b.intersects(w, p)), b = g.pop();
|
|
3802
3889
|
return y;
|
|
3803
|
-
}, _ = (v, p) => (i("comp", v, p), v =
|
|
3890
|
+
}, _ = (v, p) => (i("comp", v, p), v = A(v, p), i("caret", v), v = se(v, p), i("tildes", v), v = oe(v, p), i("xrange", v), v = J(v, p), i("stars", v), v), k = (v) => !v || v.toLowerCase() === "x" || v === "*", se = (v, p) => v.trim().split(/\s+/).map((y) => pe(y, p)).join(" "), pe = (v, p) => {
|
|
3804
3891
|
const y = p.loose ? a[l.TILDELOOSE] : a[l.TILDE];
|
|
3805
|
-
return v.replace(y, (g, b, w,
|
|
3806
|
-
i("tilde", v, g, b, w,
|
|
3892
|
+
return v.replace(y, (g, b, w, R, P) => {
|
|
3893
|
+
i("tilde", v, g, b, w, R, P);
|
|
3807
3894
|
let E;
|
|
3808
|
-
return k(b) ? E = "" : k(w) ? E = `>=${b}.0.0 <${+b + 1}.0.0-0` : k(
|
|
3895
|
+
return k(b) ? E = "" : k(w) ? E = `>=${b}.0.0 <${+b + 1}.0.0-0` : k(R) ? E = `>=${b}.${w}.0 <${b}.${+w + 1}.0-0` : P ? (i("replaceTilde pr", P), E = `>=${b}.${w}.${R}-${P} <${b}.${+w + 1}.0-0`) : E = `>=${b}.${w}.${R} <${b}.${+w + 1}.0-0`, i("tilde return", E), E;
|
|
3809
3896
|
});
|
|
3810
|
-
},
|
|
3897
|
+
}, A = (v, p) => v.trim().split(/\s+/).map((y) => z(y, p)).join(" "), z = (v, p) => {
|
|
3811
3898
|
i("caret", v, p);
|
|
3812
3899
|
const y = p.loose ? a[l.CARETLOOSE] : a[l.CARET], g = p.includePrerelease ? "-0" : "";
|
|
3813
|
-
return v.replace(y, (b, w,
|
|
3814
|
-
i("caret", v, b, w,
|
|
3815
|
-
let
|
|
3816
|
-
return k(w) ?
|
|
3900
|
+
return v.replace(y, (b, w, R, P, E) => {
|
|
3901
|
+
i("caret", v, b, w, R, P, E);
|
|
3902
|
+
let $;
|
|
3903
|
+
return k(w) ? $ = "" : k(R) ? $ = `>=${w}.0.0${g} <${+w + 1}.0.0-0` : k(P) ? w === "0" ? $ = `>=${w}.${R}.0${g} <${w}.${+R + 1}.0-0` : $ = `>=${w}.${R}.0${g} <${+w + 1}.0.0-0` : E ? (i("replaceCaret pr", E), w === "0" ? R === "0" ? $ = `>=${w}.${R}.${P}-${E} <${w}.${R}.${+P + 1}-0` : $ = `>=${w}.${R}.${P}-${E} <${w}.${+R + 1}.0-0` : $ = `>=${w}.${R}.${P}-${E} <${+w + 1}.0.0-0`) : (i("no pr"), w === "0" ? R === "0" ? $ = `>=${w}.${R}.${P}${g} <${w}.${R}.${+P + 1}-0` : $ = `>=${w}.${R}.${P}${g} <${w}.${+R + 1}.0-0` : $ = `>=${w}.${R}.${P} <${+w + 1}.0.0-0`), i("caret return", $), $;
|
|
3817
3904
|
});
|
|
3818
3905
|
}, oe = (v, p) => (i("replaceXRanges", v, p), v.split(/\s+/).map((y) => K(y, p)).join(" ")), K = (v, p) => {
|
|
3819
3906
|
v = v.trim();
|
|
3820
3907
|
const y = p.loose ? a[l.XRANGELOOSE] : a[l.XRANGE];
|
|
3821
|
-
return v.replace(y, (g, b, w,
|
|
3822
|
-
i("xRange", v, g, b, w,
|
|
3823
|
-
const
|
|
3824
|
-
return b === "=" && re && (b = ""), E = p.includePrerelease ? "-0" : "",
|
|
3908
|
+
return v.replace(y, (g, b, w, R, P, E) => {
|
|
3909
|
+
i("xRange", v, g, b, w, R, P, E);
|
|
3910
|
+
const $ = k(w), L = $ || k(R), N = L || k(P), re = N;
|
|
3911
|
+
return b === "=" && re && (b = ""), E = p.includePrerelease ? "-0" : "", $ ? b === ">" || b === "<" ? g = "<0.0.0-0" : g = "*" : b && re ? (L && (R = 0), P = 0, b === ">" ? (b = ">=", L ? (w = +w + 1, R = 0, P = 0) : (R = +R + 1, P = 0)) : b === "<=" && (b = "<", L ? w = +w + 1 : R = +R + 1), b === "<" && (E = "-0"), g = `${b + w}.${R}.${P}${E}`) : L ? g = `>=${w}.0.0${E} <${+w + 1}.0.0-0` : N && (g = `>=${w}.${R}.0${E} <${w}.${+R + 1}.0-0`), i("xRange return", g), g;
|
|
3825
3912
|
});
|
|
3826
|
-
},
|
|
3913
|
+
}, J = (v, p) => (i("replaceStars", v, p), v.trim().replace(a[l.STAR], "")), x = (v, p) => (i("replaceGTE0", v, p), v.trim().replace(a[p.includePrerelease ? l.GTE0PRE : l.GTE0], "")), X = (v) => (p, y, g, b, w, R, P, E, $, L, N, re) => (k(g) ? y = "" : k(b) ? y = `>=${g}.0.0${v ? "-0" : ""}` : k(w) ? y = `>=${g}.${b}.0${v ? "-0" : ""}` : R ? y = `>=${y}` : y = `>=${y}${v ? "-0" : ""}`, k($) ? E = "" : k(L) ? E = `<${+$ + 1}.0.0-0` : k(N) ? E = `<${$}.${+L + 1}.0-0` : re ? E = `<=${$}.${L}.${N}-${re}` : v ? E = `<${$}.${L}.${+N + 1}-0` : E = `<=${E}`, `${y} ${E}`.trim()), he = (v, p, y) => {
|
|
3827
3914
|
for (let g = 0; g < v.length; g++)
|
|
3828
3915
|
if (!v[g].test(p))
|
|
3829
3916
|
return !1;
|
|
@@ -3838,12 +3925,12 @@ function Z() {
|
|
|
3838
3925
|
}
|
|
3839
3926
|
return !0;
|
|
3840
3927
|
};
|
|
3841
|
-
return
|
|
3928
|
+
return st;
|
|
3842
3929
|
}
|
|
3843
|
-
var
|
|
3844
|
-
function
|
|
3845
|
-
if (
|
|
3846
|
-
|
|
3930
|
+
var ot, pr;
|
|
3931
|
+
function Ye() {
|
|
3932
|
+
if (pr) return ot;
|
|
3933
|
+
pr = 1;
|
|
3847
3934
|
const s = Symbol("SemVer ANY");
|
|
3848
3935
|
class e {
|
|
3849
3936
|
static get ANY() {
|
|
@@ -3883,62 +3970,62 @@ function He() {
|
|
|
3883
3970
|
return this.operator === "" ? this.value === "" ? !0 : new a(u.value, d).test(this.value) : u.operator === "" ? u.value === "" ? !0 : new a(this.value, d).test(u.semver) : (d = t(d), d.includePrerelease && (this.value === "<0.0.0-0" || u.value === "<0.0.0-0") || !d.includePrerelease && (this.value.startsWith("<0.0.0") || u.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && u.operator.startsWith(">") || this.operator.startsWith("<") && u.operator.startsWith("<") || this.semver.version === u.semver.version && this.operator.includes("=") && u.operator.includes("=") || n(this.semver, "<", u.semver, d) && this.operator.startsWith(">") && u.operator.startsWith("<") || n(this.semver, ">", u.semver, d) && this.operator.startsWith("<") && u.operator.startsWith(">")));
|
|
3884
3971
|
}
|
|
3885
3972
|
}
|
|
3886
|
-
|
|
3887
|
-
const t =
|
|
3888
|
-
return
|
|
3973
|
+
ot = e;
|
|
3974
|
+
const t = It, { safeRe: r, t: o } = Ae, n = ds, i = Xe, c = M, a = Z();
|
|
3975
|
+
return ot;
|
|
3889
3976
|
}
|
|
3890
|
-
const
|
|
3977
|
+
const Pa = Z(), Oa = (s, e, t) => {
|
|
3891
3978
|
try {
|
|
3892
|
-
e = new
|
|
3979
|
+
e = new Pa(e, t);
|
|
3893
3980
|
} catch {
|
|
3894
3981
|
return !1;
|
|
3895
3982
|
}
|
|
3896
3983
|
return e.test(s);
|
|
3897
3984
|
};
|
|
3898
|
-
var
|
|
3899
|
-
const
|
|
3900
|
-
var
|
|
3901
|
-
const
|
|
3985
|
+
var Ze = Oa;
|
|
3986
|
+
const $a = Z(), Ia = (s, e) => new $a(s, e).set.map((t) => t.map((r) => r.value).join(" ").trim().split(" "));
|
|
3987
|
+
var Fa = Ia;
|
|
3988
|
+
const Ta = M, Aa = Z(), La = (s, e, t) => {
|
|
3902
3989
|
let r = null, o = null, n = null;
|
|
3903
3990
|
try {
|
|
3904
|
-
n = new
|
|
3991
|
+
n = new Aa(e, t);
|
|
3905
3992
|
} catch {
|
|
3906
3993
|
return null;
|
|
3907
3994
|
}
|
|
3908
3995
|
return s.forEach((i) => {
|
|
3909
|
-
n.test(i) && (!r || o.compare(i) === -1) && (r = i, o = new
|
|
3996
|
+
n.test(i) && (!r || o.compare(i) === -1) && (r = i, o = new Ta(r, t));
|
|
3910
3997
|
}), r;
|
|
3911
3998
|
};
|
|
3912
|
-
var
|
|
3913
|
-
const
|
|
3999
|
+
var Na = La;
|
|
4000
|
+
const Da = M, Ba = Z(), ja = (s, e, t) => {
|
|
3914
4001
|
let r = null, o = null, n = null;
|
|
3915
4002
|
try {
|
|
3916
|
-
n = new
|
|
4003
|
+
n = new Ba(e, t);
|
|
3917
4004
|
} catch {
|
|
3918
4005
|
return null;
|
|
3919
4006
|
}
|
|
3920
4007
|
return s.forEach((i) => {
|
|
3921
|
-
n.test(i) && (!r || o.compare(i) === 1) && (r = i, o = new
|
|
4008
|
+
n.test(i) && (!r || o.compare(i) === 1) && (r = i, o = new Da(r, t));
|
|
3922
4009
|
}), r;
|
|
3923
4010
|
};
|
|
3924
|
-
var
|
|
3925
|
-
const
|
|
3926
|
-
s = new
|
|
3927
|
-
let t = new
|
|
3928
|
-
if (s.test(t) || (t = new
|
|
4011
|
+
var xa = ja;
|
|
4012
|
+
const nt = M, Va = Z(), hr = qe, Ua = (s, e) => {
|
|
4013
|
+
s = new Va(s, e);
|
|
4014
|
+
let t = new nt("0.0.0");
|
|
4015
|
+
if (s.test(t) || (t = new nt("0.0.0-0"), s.test(t)))
|
|
3929
4016
|
return t;
|
|
3930
4017
|
t = null;
|
|
3931
4018
|
for (let r = 0; r < s.set.length; ++r) {
|
|
3932
4019
|
const o = s.set[r];
|
|
3933
4020
|
let n = null;
|
|
3934
4021
|
o.forEach((i) => {
|
|
3935
|
-
const c = new
|
|
4022
|
+
const c = new nt(i.semver.version);
|
|
3936
4023
|
switch (i.operator) {
|
|
3937
4024
|
case ">":
|
|
3938
4025
|
c.prerelease.length === 0 ? c.patch++ : c.prerelease.push(0), c.raw = c.format();
|
|
3939
4026
|
case "":
|
|
3940
4027
|
case ">=":
|
|
3941
|
-
(!n ||
|
|
4028
|
+
(!n || hr(c, n)) && (n = c);
|
|
3942
4029
|
break;
|
|
3943
4030
|
case "<":
|
|
3944
4031
|
case "<=":
|
|
@@ -3946,39 +4033,39 @@ const et = M, La = Z(), cr = Ke, Na = (s, e) => {
|
|
|
3946
4033
|
default:
|
|
3947
4034
|
throw new Error(`Unexpected operation: ${i.operator}`);
|
|
3948
4035
|
}
|
|
3949
|
-
}), n && (!t ||
|
|
4036
|
+
}), n && (!t || hr(t, n)) && (t = n);
|
|
3950
4037
|
}
|
|
3951
4038
|
return t && s.test(t) ? t : null;
|
|
3952
4039
|
};
|
|
3953
|
-
var
|
|
3954
|
-
const
|
|
4040
|
+
var Ga = Ua;
|
|
4041
|
+
const Ja = Z(), Ma = (s, e) => {
|
|
3955
4042
|
try {
|
|
3956
|
-
return new
|
|
4043
|
+
return new Ja(s, e).range || "*";
|
|
3957
4044
|
} catch {
|
|
3958
4045
|
return null;
|
|
3959
4046
|
}
|
|
3960
4047
|
};
|
|
3961
|
-
var
|
|
3962
|
-
const
|
|
3963
|
-
s = new
|
|
4048
|
+
var _a = Ma;
|
|
4049
|
+
const Ka = M, ps = Ye(), { ANY: Ha } = ps, Wa = Z(), za = Ze, fr = qe, gr = Tt, Xa = Lt, qa = At, Ya = (s, e, t, r) => {
|
|
4050
|
+
s = new Ka(s, r), e = new Wa(e, r);
|
|
3964
4051
|
let o, n, i, c, a;
|
|
3965
4052
|
switch (t) {
|
|
3966
4053
|
case ">":
|
|
3967
|
-
o =
|
|
4054
|
+
o = fr, n = Xa, i = gr, c = ">", a = ">=";
|
|
3968
4055
|
break;
|
|
3969
4056
|
case "<":
|
|
3970
|
-
o =
|
|
4057
|
+
o = gr, n = qa, i = fr, c = "<", a = "<=";
|
|
3971
4058
|
break;
|
|
3972
4059
|
default:
|
|
3973
4060
|
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
3974
4061
|
}
|
|
3975
|
-
if (
|
|
4062
|
+
if (za(s, e, r))
|
|
3976
4063
|
return !1;
|
|
3977
4064
|
for (let l = 0; l < e.set.length; ++l) {
|
|
3978
4065
|
const u = e.set[l];
|
|
3979
4066
|
let d = null, m = null;
|
|
3980
4067
|
if (u.forEach((h) => {
|
|
3981
|
-
h.semver ===
|
|
4068
|
+
h.semver === Ha && (h = new ps(">=0.0.0")), d = d || h, m = m || h, o(h.semver, d.semver, r) ? d = h : i(h.semver, m.semver, r) && (m = h);
|
|
3982
4069
|
}), d.operator === c || d.operator === a || (!m.operator || m.operator === c) && n(s, m.semver))
|
|
3983
4070
|
return !1;
|
|
3984
4071
|
if (m.operator === a && i(s, m.semver))
|
|
@@ -3986,20 +4073,20 @@ const Va = M, ns = He(), { ANY: Ua } = ns, Ga = Z(), Ja = We, lr = Ke, ur = Pt,
|
|
|
3986
4073
|
}
|
|
3987
4074
|
return !0;
|
|
3988
4075
|
};
|
|
3989
|
-
var
|
|
3990
|
-
const
|
|
3991
|
-
var
|
|
3992
|
-
const
|
|
3993
|
-
var
|
|
3994
|
-
const
|
|
3995
|
-
var
|
|
3996
|
-
const
|
|
3997
|
-
var
|
|
4076
|
+
var Nt = Ya;
|
|
4077
|
+
const Za = Nt, Qa = (s, e, t) => Za(s, e, ">", t);
|
|
4078
|
+
var ec = Qa;
|
|
4079
|
+
const tc = Nt, rc = (s, e, t) => tc(s, e, "<", t);
|
|
4080
|
+
var sc = rc;
|
|
4081
|
+
const mr = Z(), oc = (s, e, t) => (s = new mr(s, t), e = new mr(e, t), s.intersects(e, t));
|
|
4082
|
+
var nc = oc;
|
|
4083
|
+
const ic = Ze, ac = Y;
|
|
4084
|
+
var cc = (s, e, t) => {
|
|
3998
4085
|
const r = [];
|
|
3999
4086
|
let o = null, n = null;
|
|
4000
|
-
const i = s.sort((u, d) =>
|
|
4087
|
+
const i = s.sort((u, d) => ac(u, d, t));
|
|
4001
4088
|
for (const u of i)
|
|
4002
|
-
|
|
4089
|
+
ic(u, e, t) ? (n = u, o || (o = u)) : (n && r.push([o, n]), n = null, o = null);
|
|
4003
4090
|
o && r.push([o, null]);
|
|
4004
4091
|
const c = [];
|
|
4005
4092
|
for (const [u, d] of r)
|
|
@@ -4007,14 +4094,14 @@ var rc = (s, e, t) => {
|
|
|
4007
4094
|
const a = c.join(" || "), l = typeof e.raw == "string" ? e.raw : String(e);
|
|
4008
4095
|
return a.length < l.length ? a : e;
|
|
4009
4096
|
};
|
|
4010
|
-
const
|
|
4097
|
+
const vr = Z(), Dt = Ye(), { ANY: it } = Dt, Se = Ze, Bt = Y, lc = (s, e, t = {}) => {
|
|
4011
4098
|
if (s === e)
|
|
4012
4099
|
return !0;
|
|
4013
|
-
s = new
|
|
4100
|
+
s = new vr(s, t), e = new vr(e, t);
|
|
4014
4101
|
let r = !1;
|
|
4015
4102
|
e: for (const o of s.set) {
|
|
4016
4103
|
for (const n of e.set) {
|
|
4017
|
-
const i =
|
|
4104
|
+
const i = dc(o, n, t);
|
|
4018
4105
|
if (r = r || i !== null, i)
|
|
4019
4106
|
continue e;
|
|
4020
4107
|
}
|
|
@@ -4022,37 +4109,37 @@ const pr = Z(), At = He(), { ANY: tt } = At, ye = We, Tt = Y, sc = (s, e, t = {}
|
|
|
4022
4109
|
return !1;
|
|
4023
4110
|
}
|
|
4024
4111
|
return !0;
|
|
4025
|
-
},
|
|
4112
|
+
}, uc = [new Dt(">=0.0.0-0")], yr = [new Dt(">=0.0.0")], dc = (s, e, t) => {
|
|
4026
4113
|
if (s === e)
|
|
4027
4114
|
return !0;
|
|
4028
|
-
if (s.length === 1 && s[0].semver ===
|
|
4029
|
-
if (e.length === 1 && e[0].semver ===
|
|
4115
|
+
if (s.length === 1 && s[0].semver === it) {
|
|
4116
|
+
if (e.length === 1 && e[0].semver === it)
|
|
4030
4117
|
return !0;
|
|
4031
|
-
t.includePrerelease ? s =
|
|
4118
|
+
t.includePrerelease ? s = uc : s = yr;
|
|
4032
4119
|
}
|
|
4033
|
-
if (e.length === 1 && e[0].semver ===
|
|
4120
|
+
if (e.length === 1 && e[0].semver === it) {
|
|
4034
4121
|
if (t.includePrerelease)
|
|
4035
4122
|
return !0;
|
|
4036
|
-
e =
|
|
4123
|
+
e = yr;
|
|
4037
4124
|
}
|
|
4038
4125
|
const r = /* @__PURE__ */ new Set();
|
|
4039
4126
|
let o, n;
|
|
4040
4127
|
for (const h of s)
|
|
4041
|
-
h.operator === ">" || h.operator === ">=" ? o =
|
|
4128
|
+
h.operator === ">" || h.operator === ">=" ? o = wr(o, h, t) : h.operator === "<" || h.operator === "<=" ? n = Sr(n, h, t) : r.add(h.semver);
|
|
4042
4129
|
if (r.size > 1)
|
|
4043
4130
|
return null;
|
|
4044
4131
|
let i;
|
|
4045
4132
|
if (o && n) {
|
|
4046
|
-
if (i =
|
|
4133
|
+
if (i = Bt(o.semver, n.semver, t), i > 0)
|
|
4047
4134
|
return null;
|
|
4048
4135
|
if (i === 0 && (o.operator !== ">=" || n.operator !== "<="))
|
|
4049
4136
|
return null;
|
|
4050
4137
|
}
|
|
4051
4138
|
for (const h of r) {
|
|
4052
|
-
if (o && !
|
|
4139
|
+
if (o && !Se(h, String(o), t) || n && !Se(h, String(n), t))
|
|
4053
4140
|
return null;
|
|
4054
4141
|
for (const f of e)
|
|
4055
|
-
if (!
|
|
4142
|
+
if (!Se(h, String(f), t))
|
|
4056
4143
|
return !1;
|
|
4057
4144
|
return !0;
|
|
4058
4145
|
}
|
|
@@ -4061,88 +4148,88 @@ const pr = Z(), At = He(), { ANY: tt } = At, ye = We, Tt = Y, sc = (s, e, t = {}
|
|
|
4061
4148
|
for (const h of e) {
|
|
4062
4149
|
if (u = u || h.operator === ">" || h.operator === ">=", l = l || h.operator === "<" || h.operator === "<=", o) {
|
|
4063
4150
|
if (m && h.semver.prerelease && h.semver.prerelease.length && h.semver.major === m.major && h.semver.minor === m.minor && h.semver.patch === m.patch && (m = !1), h.operator === ">" || h.operator === ">=") {
|
|
4064
|
-
if (c =
|
|
4151
|
+
if (c = wr(o, h, t), c === h && c !== o)
|
|
4065
4152
|
return !1;
|
|
4066
|
-
} else if (o.operator === ">=" && !
|
|
4153
|
+
} else if (o.operator === ">=" && !Se(o.semver, String(h), t))
|
|
4067
4154
|
return !1;
|
|
4068
4155
|
}
|
|
4069
4156
|
if (n) {
|
|
4070
4157
|
if (d && h.semver.prerelease && h.semver.prerelease.length && h.semver.major === d.major && h.semver.minor === d.minor && h.semver.patch === d.patch && (d = !1), h.operator === "<" || h.operator === "<=") {
|
|
4071
|
-
if (a =
|
|
4158
|
+
if (a = Sr(n, h, t), a === h && a !== n)
|
|
4072
4159
|
return !1;
|
|
4073
|
-
} else if (n.operator === "<=" && !
|
|
4160
|
+
} else if (n.operator === "<=" && !Se(n.semver, String(h), t))
|
|
4074
4161
|
return !1;
|
|
4075
4162
|
}
|
|
4076
4163
|
if (!h.operator && (n || o) && i !== 0)
|
|
4077
4164
|
return !1;
|
|
4078
4165
|
}
|
|
4079
4166
|
return !(o && l && !n && i !== 0 || n && u && !o && i !== 0 || m || d);
|
|
4080
|
-
},
|
|
4167
|
+
}, wr = (s, e, t) => {
|
|
4081
4168
|
if (!s)
|
|
4082
4169
|
return e;
|
|
4083
|
-
const r =
|
|
4170
|
+
const r = Bt(s.semver, e.semver, t);
|
|
4084
4171
|
return r > 0 ? s : r < 0 || e.operator === ">" && s.operator === ">=" ? e : s;
|
|
4085
|
-
},
|
|
4172
|
+
}, Sr = (s, e, t) => {
|
|
4086
4173
|
if (!s)
|
|
4087
4174
|
return e;
|
|
4088
|
-
const r =
|
|
4175
|
+
const r = Bt(s.semver, e.semver, t);
|
|
4089
4176
|
return r < 0 ? s : r > 0 || e.operator === "<" && s.operator === "<=" ? e : s;
|
|
4090
4177
|
};
|
|
4091
|
-
var
|
|
4092
|
-
const
|
|
4093
|
-
var
|
|
4094
|
-
parse:
|
|
4095
|
-
valid:
|
|
4096
|
-
clean:
|
|
4097
|
-
inc:
|
|
4098
|
-
diff:
|
|
4099
|
-
major:
|
|
4100
|
-
minor:
|
|
4101
|
-
patch:
|
|
4102
|
-
prerelease:
|
|
4103
|
-
compare:
|
|
4104
|
-
rcompare:
|
|
4105
|
-
compareLoose:
|
|
4106
|
-
compareBuild:
|
|
4107
|
-
sort:
|
|
4108
|
-
rsort:
|
|
4109
|
-
gt:
|
|
4110
|
-
lt:
|
|
4111
|
-
eq:
|
|
4112
|
-
neq:
|
|
4113
|
-
gte:
|
|
4114
|
-
lte:
|
|
4115
|
-
cmp:
|
|
4116
|
-
coerce:
|
|
4117
|
-
Comparator:
|
|
4118
|
-
Range:
|
|
4119
|
-
satisfies:
|
|
4120
|
-
toComparators:
|
|
4121
|
-
maxSatisfying:
|
|
4122
|
-
minSatisfying:
|
|
4123
|
-
minVersion:
|
|
4124
|
-
validRange:
|
|
4125
|
-
outside:
|
|
4126
|
-
gtr:
|
|
4127
|
-
ltr:
|
|
4128
|
-
intersects:
|
|
4129
|
-
simplifyRange:
|
|
4130
|
-
subset:
|
|
4131
|
-
SemVer:
|
|
4132
|
-
re:
|
|
4133
|
-
src:
|
|
4134
|
-
tokens:
|
|
4135
|
-
SEMVER_SPEC_VERSION:
|
|
4136
|
-
RELEASE_TYPES:
|
|
4137
|
-
compareIdentifiers:
|
|
4138
|
-
rcompareIdentifiers:
|
|
4178
|
+
var pc = lc;
|
|
4179
|
+
const at = Ae, br = ze, hc = M, Rr = cs, fc = ye, gc = bi, mc = Ci, vc = Pi, yc = $i, wc = Ti, Sc = Ni, bc = ji, Rc = Ui, Ec = Y, Cc = _i, kc = Wi, Pc = Ft, Oc = Yi, $c = ea, Ic = qe, Fc = Tt, Tc = ls, Ac = us, Lc = At, Nc = Lt, Dc = ds, Bc = Ea, jc = Ye(), xc = Z(), Vc = Ze, Uc = Fa, Gc = Na, Jc = xa, Mc = Ga, _c = _a, Kc = Nt, Hc = ec, Wc = sc, zc = nc, Xc = cc, qc = pc;
|
|
4180
|
+
var Yc = {
|
|
4181
|
+
parse: fc,
|
|
4182
|
+
valid: gc,
|
|
4183
|
+
clean: mc,
|
|
4184
|
+
inc: vc,
|
|
4185
|
+
diff: yc,
|
|
4186
|
+
major: wc,
|
|
4187
|
+
minor: Sc,
|
|
4188
|
+
patch: bc,
|
|
4189
|
+
prerelease: Rc,
|
|
4190
|
+
compare: Ec,
|
|
4191
|
+
rcompare: Cc,
|
|
4192
|
+
compareLoose: kc,
|
|
4193
|
+
compareBuild: Pc,
|
|
4194
|
+
sort: Oc,
|
|
4195
|
+
rsort: $c,
|
|
4196
|
+
gt: Ic,
|
|
4197
|
+
lt: Fc,
|
|
4198
|
+
eq: Tc,
|
|
4199
|
+
neq: Ac,
|
|
4200
|
+
gte: Lc,
|
|
4201
|
+
lte: Nc,
|
|
4202
|
+
cmp: Dc,
|
|
4203
|
+
coerce: Bc,
|
|
4204
|
+
Comparator: jc,
|
|
4205
|
+
Range: xc,
|
|
4206
|
+
satisfies: Vc,
|
|
4207
|
+
toComparators: Uc,
|
|
4208
|
+
maxSatisfying: Gc,
|
|
4209
|
+
minSatisfying: Jc,
|
|
4210
|
+
minVersion: Mc,
|
|
4211
|
+
validRange: _c,
|
|
4212
|
+
outside: Kc,
|
|
4213
|
+
gtr: Hc,
|
|
4214
|
+
ltr: Wc,
|
|
4215
|
+
intersects: zc,
|
|
4216
|
+
simplifyRange: Xc,
|
|
4217
|
+
subset: qc,
|
|
4218
|
+
SemVer: hc,
|
|
4219
|
+
re: at.re,
|
|
4220
|
+
src: at.src,
|
|
4221
|
+
tokens: at.t,
|
|
4222
|
+
SEMVER_SPEC_VERSION: br.SEMVER_SPEC_VERSION,
|
|
4223
|
+
RELEASE_TYPES: br.RELEASE_TYPES,
|
|
4224
|
+
compareIdentifiers: Rr.compareIdentifiers,
|
|
4225
|
+
rcompareIdentifiers: Rr.rcompareIdentifiers
|
|
4139
4226
|
};
|
|
4140
|
-
const
|
|
4227
|
+
const Zc = /* @__PURE__ */ ni(Yc), Qc = {
|
|
4141
4228
|
minDelay: 1500
|
|
4142
|
-
},
|
|
4143
|
-
class
|
|
4229
|
+
}, el = "__no_updates__";
|
|
4230
|
+
class tl extends Vs {
|
|
4144
4231
|
constructor(t, r, o = {}) {
|
|
4145
|
-
super({ ...o, ...
|
|
4232
|
+
super({ ...o, ...Qc }, r);
|
|
4146
4233
|
S(this, "http");
|
|
4147
4234
|
S(this, "preferredUpdateChannel");
|
|
4148
4235
|
this.registryProvider = t, this.http = o.http, this.preferredUpdateChannel = o.preferredUpdateChannel;
|
|
@@ -4156,7 +4243,7 @@ class Xc extends Fs {
|
|
|
4156
4243
|
case "from-registry-v2":
|
|
4157
4244
|
return `from_registry_v2_${t.registryUrl}_${t.id.organization}_${t.id.name}_${t.id.version}`;
|
|
4158
4245
|
default:
|
|
4159
|
-
return
|
|
4246
|
+
return el;
|
|
4160
4247
|
}
|
|
4161
4248
|
}
|
|
4162
4249
|
async readValue(t) {
|
|
@@ -4164,7 +4251,7 @@ class Xc extends Fs {
|
|
|
4164
4251
|
switch (t.type) {
|
|
4165
4252
|
case "dev-v1":
|
|
4166
4253
|
try {
|
|
4167
|
-
const r = await
|
|
4254
|
+
const r = await jr(t.folder);
|
|
4168
4255
|
return r === t.mtime ? void 0 : { ...t, mtime: r };
|
|
4169
4256
|
} catch (r) {
|
|
4170
4257
|
this.logger.warn(r);
|
|
@@ -4172,9 +4259,9 @@ class Xc extends Fs {
|
|
|
4172
4259
|
}
|
|
4173
4260
|
case "dev-v2":
|
|
4174
4261
|
try {
|
|
4175
|
-
const r = await
|
|
4262
|
+
const r = await lt(t.folder, this.logger);
|
|
4176
4263
|
if (r === void 0) return;
|
|
4177
|
-
const o = await
|
|
4264
|
+
const o = await Et(r);
|
|
4178
4265
|
return o === t.mtime ? void 0 : { ...t, mtime: o };
|
|
4179
4266
|
} catch (r) {
|
|
4180
4267
|
this.logger.warn(r);
|
|
@@ -4188,9 +4275,9 @@ class Xc extends Fs {
|
|
|
4188
4275
|
const n = await r.getLatestOverview(t.id, ne);
|
|
4189
4276
|
if (n) o = n.spec;
|
|
4190
4277
|
else {
|
|
4191
|
-
const i = await r.getLatestOverview(t.id,
|
|
4278
|
+
const i = await r.getLatestOverview(t.id, Re);
|
|
4192
4279
|
if (i === void 0) {
|
|
4193
|
-
this.logger.error(`No "any" channel record for ${
|
|
4280
|
+
this.logger.error(`No "any" channel record for ${jt(t.id)}`);
|
|
4194
4281
|
return;
|
|
4195
4282
|
}
|
|
4196
4283
|
o = { ...i.spec, channel: ne };
|
|
@@ -4200,13 +4287,13 @@ class Xc extends Fs {
|
|
|
4200
4287
|
if (i) o = i.spec;
|
|
4201
4288
|
else {
|
|
4202
4289
|
this.logger.error(
|
|
4203
|
-
`Can't find update for ${
|
|
4290
|
+
`Can't find update for ${jt(t.id)} in channel "${n}"`
|
|
4204
4291
|
);
|
|
4205
4292
|
return;
|
|
4206
4293
|
}
|
|
4207
4294
|
}
|
|
4208
4295
|
if (o.type !== "from-registry-v2") throw new Error(`Unexpected spec type ${o}.`);
|
|
4209
|
-
return
|
|
4296
|
+
return Zc.compare(o.id.version, t.id.version) <= 0 ? void 0 : ((async () => {
|
|
4210
4297
|
try {
|
|
4211
4298
|
await r.getComponents(o.id);
|
|
4212
4299
|
} catch (n) {
|
|
@@ -4230,19 +4317,19 @@ class Xc extends Fs {
|
|
|
4230
4317
|
if (t === void 0 || r === void 0 || t.type !== r.type) return !1;
|
|
4231
4318
|
switch (t.type) {
|
|
4232
4319
|
case "from-registry-v1":
|
|
4233
|
-
return r.type !== "from-registry-v1" ? !1 : t.registryUrl === r.registryUrl &&
|
|
4320
|
+
return r.type !== "from-registry-v1" ? !1 : t.registryUrl === r.registryUrl && xt(t.id, r.id);
|
|
4234
4321
|
case "from-registry-v2":
|
|
4235
|
-
return r.type !== "from-registry-v2" ? !1 : t.registryUrl === r.registryUrl &&
|
|
4322
|
+
return r.type !== "from-registry-v2" ? !1 : t.registryUrl === r.registryUrl && xt(t.id, r.id);
|
|
4236
4323
|
case "dev-v1":
|
|
4237
4324
|
return r.type !== "dev-v1" ? !1 : t.folder === r.folder && t.mtime === r.mtime;
|
|
4238
4325
|
case "dev-v2":
|
|
4239
4326
|
return r.type !== "dev-v2" ? !1 : t.folder === r.folder && t.mtime === r.mtime;
|
|
4240
4327
|
default:
|
|
4241
|
-
|
|
4328
|
+
G(t);
|
|
4242
4329
|
}
|
|
4243
4330
|
}
|
|
4244
4331
|
}
|
|
4245
|
-
class
|
|
4332
|
+
class Er {
|
|
4246
4333
|
constructor() {
|
|
4247
4334
|
S(this, "resources", /* @__PURE__ */ new Map());
|
|
4248
4335
|
}
|
|
@@ -4277,11 +4364,11 @@ class yr {
|
|
|
4277
4364
|
return (t = this.resources.get(e)) == null ? void 0 : t.resource;
|
|
4278
4365
|
}
|
|
4279
4366
|
}
|
|
4280
|
-
function
|
|
4367
|
+
function Cr(s) {
|
|
4281
4368
|
return String(s.id);
|
|
4282
4369
|
}
|
|
4283
|
-
const
|
|
4284
|
-
function
|
|
4370
|
+
const rl = ["Int", "Long", "Float", "Double", "String", "Bytes"];
|
|
4371
|
+
function ct(s) {
|
|
4285
4372
|
const e = [], t = [];
|
|
4286
4373
|
for (const r of s)
|
|
4287
4374
|
r.type === "bySingleColumn" ? (e.push(r), t.push({
|
|
@@ -4294,9 +4381,9 @@ function st(s) {
|
|
|
4294
4381
|
}
|
|
4295
4382
|
return s;
|
|
4296
4383
|
}
|
|
4297
|
-
class
|
|
4384
|
+
class sl {
|
|
4298
4385
|
constructor(e, t, r) {
|
|
4299
|
-
S(this, "pFrame", new
|
|
4386
|
+
S(this, "pFrame", new to());
|
|
4300
4387
|
S(this, "blobIdToResource", /* @__PURE__ */ new Map());
|
|
4301
4388
|
S(this, "blobHandleComputables", /* @__PURE__ */ new Map());
|
|
4302
4389
|
S(this, "preloadBlob", async (e) => {
|
|
@@ -4318,8 +4405,8 @@ class Yc {
|
|
|
4318
4405
|
});
|
|
4319
4406
|
this.blobDriver = e, this.blobContentCache = t, this.columns = r, this.pFrame.setDataSource(this);
|
|
4320
4407
|
for (const o of r) {
|
|
4321
|
-
for (const i of
|
|
4322
|
-
const n =
|
|
4408
|
+
for (const i of tn(o.data)) this.blobIdToResource.set(Cr(i), i);
|
|
4409
|
+
const n = rn(o.data, Cr);
|
|
4323
4410
|
try {
|
|
4324
4411
|
this.pFrame.addColumnSpec(o.id, o.spec), this.pFrame.setColumnData(o.id, n);
|
|
4325
4412
|
} catch (i) {
|
|
@@ -4341,7 +4428,7 @@ class Yc {
|
|
|
4341
4428
|
this.pFrame.dispose();
|
|
4342
4429
|
}
|
|
4343
4430
|
}
|
|
4344
|
-
class
|
|
4431
|
+
class ol {
|
|
4345
4432
|
constructor(e) {
|
|
4346
4433
|
S(this, "pFrames");
|
|
4347
4434
|
S(this, "pTables");
|
|
@@ -4349,37 +4436,37 @@ class Zc {
|
|
|
4349
4436
|
/** Limits concurrent requests to PFrame API to prevent deadlock with Node's IO threads */
|
|
4350
4437
|
S(this, "concurrencyLimiter");
|
|
4351
4438
|
this.blobDriver = e;
|
|
4352
|
-
const t = new
|
|
4439
|
+
const t = new ro({
|
|
4353
4440
|
maxSize: 1e9,
|
|
4354
4441
|
// 1Gb
|
|
4355
|
-
fetchMethod: async (o) => await
|
|
4442
|
+
fetchMethod: async (o) => await Tr.readFile(o),
|
|
4356
4443
|
sizeCalculation: (o) => o.length
|
|
4357
|
-
}), r = new
|
|
4358
|
-
this.blobContentCache = t, this.concurrencyLimiter = r, this.pFrames = new class extends
|
|
4444
|
+
}), r = new Os(1);
|
|
4445
|
+
this.blobContentCache = t, this.concurrencyLimiter = r, this.pFrames = new class extends Er {
|
|
4359
4446
|
constructor(o) {
|
|
4360
4447
|
super(), this.blobDriver = o;
|
|
4361
4448
|
}
|
|
4362
4449
|
createNewResource(o) {
|
|
4363
|
-
return new
|
|
4450
|
+
return new sl(this.blobDriver, t, o);
|
|
4364
4451
|
}
|
|
4365
4452
|
calculateParamsKey(o) {
|
|
4366
|
-
return
|
|
4453
|
+
return il(o);
|
|
4367
4454
|
}
|
|
4368
|
-
}(this.blobDriver), this.pTables = new class extends
|
|
4455
|
+
}(this.blobDriver), this.pTables = new class extends Er {
|
|
4369
4456
|
constructor(o) {
|
|
4370
4457
|
super(), this.pFrames = o;
|
|
4371
4458
|
}
|
|
4372
4459
|
async createNewResource(o) {
|
|
4373
4460
|
const n = this.pFrames.getByKey(o.pFrameHandle), i = await r.run(
|
|
4374
4461
|
async () => await n.pFrame.createTable({
|
|
4375
|
-
src:
|
|
4376
|
-
filters:
|
|
4462
|
+
src: Pe(o.def.src),
|
|
4463
|
+
filters: ct(o.def.filters)
|
|
4377
4464
|
})
|
|
4378
4465
|
);
|
|
4379
4466
|
return o.def.sorting.length !== 0 ? i.sort(o.def.sorting) : i;
|
|
4380
4467
|
}
|
|
4381
4468
|
calculateParamsKey(o) {
|
|
4382
|
-
return
|
|
4469
|
+
return nl(o);
|
|
4383
4470
|
}
|
|
4384
4471
|
}(this.pFrames);
|
|
4385
4472
|
}
|
|
@@ -4387,14 +4474,14 @@ class Zc {
|
|
|
4387
4474
|
// Internal / Config API Methods
|
|
4388
4475
|
//
|
|
4389
4476
|
createPFrame(e, t) {
|
|
4390
|
-
const r = e.filter((n) =>
|
|
4477
|
+
const r = e.filter((n) => rl.find((i) => i === n.spec.valueType)).map((n) => le(
|
|
4391
4478
|
n,
|
|
4392
|
-
(i) =>
|
|
4479
|
+
(i) => xs(i) ? ln(i) : un(n.spec, i)
|
|
4393
4480
|
)), o = this.pFrames.acquire(r);
|
|
4394
4481
|
return t.addOnDestroy(o.unref), o.key;
|
|
4395
4482
|
}
|
|
4396
4483
|
createPTable(e, t) {
|
|
4397
|
-
const r = this.createPFrame(
|
|
4484
|
+
const r = this.createPFrame(Ss(e.src), t), o = Or(e, (i) => i.id), n = this.pTables.acquire({ def: o, pFrameHandle: r });
|
|
4398
4485
|
return t.addOnDestroy(n.unref), n.key;
|
|
4399
4486
|
}
|
|
4400
4487
|
//
|
|
@@ -4424,8 +4511,8 @@ class Zc {
|
|
|
4424
4511
|
async calculateTableData(e, t) {
|
|
4425
4512
|
let r = await this.concurrencyLimiter.run(
|
|
4426
4513
|
async () => await this.pFrames.getByKey(e).pFrame.createTable({
|
|
4427
|
-
src:
|
|
4428
|
-
filters:
|
|
4514
|
+
src: Pe(t.src),
|
|
4515
|
+
filters: ct(t.filters)
|
|
4429
4516
|
})
|
|
4430
4517
|
);
|
|
4431
4518
|
if (t.sorting.length > 0) {
|
|
@@ -4446,7 +4533,7 @@ class Zc {
|
|
|
4446
4533
|
return await this.concurrencyLimiter.run(
|
|
4447
4534
|
async () => await this.pFrames.getByKey(e).pFrame.getUniqueValues({
|
|
4448
4535
|
...t,
|
|
4449
|
-
filters:
|
|
4536
|
+
filters: ct(t.filters)
|
|
4450
4537
|
})
|
|
4451
4538
|
);
|
|
4452
4539
|
}
|
|
@@ -4466,7 +4553,7 @@ class Zc {
|
|
|
4466
4553
|
);
|
|
4467
4554
|
}
|
|
4468
4555
|
}
|
|
4469
|
-
function
|
|
4556
|
+
function Pe(s) {
|
|
4470
4557
|
switch (s.type) {
|
|
4471
4558
|
case "column":
|
|
4472
4559
|
return {
|
|
@@ -4478,24 +4565,24 @@ function Ee(s) {
|
|
|
4478
4565
|
case "full":
|
|
4479
4566
|
return {
|
|
4480
4567
|
type: s.type,
|
|
4481
|
-
entries: s.entries.map((e) =>
|
|
4568
|
+
entries: s.entries.map((e) => Pe(e))
|
|
4482
4569
|
};
|
|
4483
4570
|
case "outer":
|
|
4484
4571
|
return {
|
|
4485
4572
|
type: "outer",
|
|
4486
|
-
primary:
|
|
4487
|
-
secondary: s.secondary.map((e) =>
|
|
4573
|
+
primary: Pe(s.primary),
|
|
4574
|
+
secondary: s.secondary.map((e) => Pe(e))
|
|
4488
4575
|
};
|
|
4489
4576
|
default:
|
|
4490
|
-
|
|
4577
|
+
G(s);
|
|
4491
4578
|
}
|
|
4492
4579
|
}
|
|
4493
|
-
function
|
|
4494
|
-
const e =
|
|
4495
|
-
return e.update(
|
|
4580
|
+
function nl(s) {
|
|
4581
|
+
const e = Te("sha256");
|
|
4582
|
+
return e.update(ve(s.def)), e.digest().toString("hex");
|
|
4496
4583
|
}
|
|
4497
|
-
function
|
|
4498
|
-
const e = [...s].map((r) =>
|
|
4584
|
+
function il(s) {
|
|
4585
|
+
const e = [...s].map((r) => le(r, (o) => {
|
|
4499
4586
|
let n;
|
|
4500
4587
|
const i = o.type;
|
|
4501
4588
|
switch (i) {
|
|
@@ -4535,35 +4622,35 @@ function el(s) {
|
|
|
4535
4622
|
return n.payload.sort((c, a) => c.key.localeCompare(a.key)), n;
|
|
4536
4623
|
}));
|
|
4537
4624
|
e.sort((r, o) => r.id.localeCompare(o.id));
|
|
4538
|
-
const t =
|
|
4539
|
-
return t.update(
|
|
4625
|
+
const t = Te("sha256");
|
|
4626
|
+
return t.update(ve(e)), t.digest().toString("hex");
|
|
4540
4627
|
}
|
|
4541
|
-
async function
|
|
4628
|
+
async function al(s, e, t) {
|
|
4542
4629
|
const r = {
|
|
4543
|
-
...
|
|
4544
|
-
...
|
|
4630
|
+
...os,
|
|
4631
|
+
...ns(e),
|
|
4545
4632
|
...t
|
|
4546
|
-
}, o = new
|
|
4633
|
+
}, o = new Fr(r.localSecret), n = Ks(r.logger, s, r.localProjections), i = Hs(s, r.logger), c = Ws(s, r.logger), a = zs(s, r.logger), l = new Xs(
|
|
4547
4634
|
r.logger,
|
|
4548
4635
|
n,
|
|
4549
4636
|
i,
|
|
4550
4637
|
r.blobDownloadPath,
|
|
4551
4638
|
o,
|
|
4552
4639
|
r.blobDriverOps
|
|
4553
|
-
), u = new
|
|
4640
|
+
), u = new qs(
|
|
4554
4641
|
r.logger,
|
|
4555
4642
|
o,
|
|
4556
4643
|
c,
|
|
4557
4644
|
a,
|
|
4558
4645
|
r.uploadDriverOps
|
|
4559
|
-
), d = new
|
|
4646
|
+
), d = new Ys(r.logger, i, r.logStreamDriverOps), m = new Zs(r.logger, d, l), h = await Qs.init(
|
|
4560
4647
|
r.logger,
|
|
4561
4648
|
s,
|
|
4562
4649
|
o,
|
|
4563
4650
|
r.localProjections,
|
|
4564
4651
|
r.openFileDialogCallback,
|
|
4565
4652
|
r.virtualLocalStoragesOverride
|
|
4566
|
-
), f = new
|
|
4653
|
+
), f = new ol(l);
|
|
4567
4654
|
return {
|
|
4568
4655
|
blobDriver: l,
|
|
4569
4656
|
logDriver: m,
|
|
@@ -4573,7 +4660,7 @@ async function tl(s, e, t) {
|
|
|
4573
4660
|
pFrameDriver: f
|
|
4574
4661
|
};
|
|
4575
4662
|
}
|
|
4576
|
-
class
|
|
4663
|
+
class hs {
|
|
4577
4664
|
constructor(e, t, r, o, n, i, c, a) {
|
|
4578
4665
|
S(this, "pl");
|
|
4579
4666
|
/** Contains a reactive list of projects along with their meta information. */
|
|
@@ -4592,10 +4679,10 @@ class is {
|
|
|
4592
4679
|
// Project List Manipulation
|
|
4593
4680
|
//
|
|
4594
4681
|
/** Creates a project with initial state and adds it to project list. */
|
|
4595
|
-
async createProject(e, t =
|
|
4682
|
+
async createProject(e, t = Oe()) {
|
|
4596
4683
|
const r = await this.pl.withWriteTx("MLCreateProject", async (o) => {
|
|
4597
|
-
const n = await
|
|
4598
|
-
return o.createField(
|
|
4684
|
+
const n = await en(o, e);
|
|
4685
|
+
return o.createField(j(this.projectListResourceId, t), "Dynamic", n), await o.commit(), await Ds(n);
|
|
4599
4686
|
});
|
|
4600
4687
|
return await this.projectListTree.refreshState(), r;
|
|
4601
4688
|
}
|
|
@@ -4609,13 +4696,13 @@ class is {
|
|
|
4609
4696
|
* destruction of all attached objects, like files, analysis results etc. */
|
|
4610
4697
|
async deleteProject(e) {
|
|
4611
4698
|
await this.pl.withWriteTx("MLRemoveProject", async (t) => {
|
|
4612
|
-
t.removeField(
|
|
4699
|
+
t.removeField(j(this.projectListResourceId, e)), await t.commit();
|
|
4613
4700
|
}), await this.projectListTree.refreshState();
|
|
4614
4701
|
}
|
|
4615
4702
|
async projectIdToResourceId(e) {
|
|
4616
4703
|
return await this.pl.withReadTx("Project id to resource id", async (t) => {
|
|
4617
|
-
const r = (await t.getField(
|
|
4618
|
-
if (
|
|
4704
|
+
const r = (await t.getField(j(this.projectListResourceId, e))).value;
|
|
4705
|
+
if (Ge(r)) throw new Error("Unexpected project list structure.");
|
|
4619
4706
|
return r;
|
|
4620
4707
|
});
|
|
4621
4708
|
}
|
|
@@ -4626,7 +4713,7 @@ class is {
|
|
|
4626
4713
|
async openProject(e) {
|
|
4627
4714
|
const t = await this.ensureProjectRid(e);
|
|
4628
4715
|
if (this.openedProjectsByRid.has(t)) throw new Error(`Project ${t} already opened`);
|
|
4629
|
-
this.openedProjectsByRid.set(t, await
|
|
4716
|
+
this.openedProjectsByRid.set(t, await $t.init(this.env, t)), this.openedProjectsList.setValue([...this.openedProjectsByRid.keys()]);
|
|
4630
4717
|
}
|
|
4631
4718
|
/** Closes the project, and deallocate all corresponding resources. */
|
|
4632
4719
|
async closeProject(e) {
|
|
@@ -4654,33 +4741,33 @@ class is {
|
|
|
4654
4741
|
/** Generates sufficiently random string to be used as local secret for the
|
|
4655
4742
|
* middle layer */
|
|
4656
4743
|
static generateLocalSecret() {
|
|
4657
|
-
return
|
|
4744
|
+
return Fr.generateSecret();
|
|
4658
4745
|
}
|
|
4659
4746
|
/** Initialize middle layer */
|
|
4660
4747
|
static async init(e, t, r) {
|
|
4661
4748
|
const o = {
|
|
4662
|
-
...
|
|
4663
|
-
...
|
|
4749
|
+
...si,
|
|
4750
|
+
...oi(t),
|
|
4664
4751
|
...r
|
|
4665
4752
|
};
|
|
4666
4753
|
process.env.MI_LOG_TREE_STAT && (o.defaultTreeOptions.logStat = process.env.MI_LOG_TREE_STAT === "cumulative" ? "cumulative" : "per-request");
|
|
4667
4754
|
const n = await e.withWriteTx("MLInitialization", async (I) => {
|
|
4668
|
-
const
|
|
4669
|
-
I.createField(
|
|
4670
|
-
const
|
|
4671
|
-
if (
|
|
4672
|
-
const _ = I.createEphemeral(
|
|
4673
|
-
return I.lock(_), I.setField(
|
|
4755
|
+
const F = j(I.clientRoot, Co);
|
|
4756
|
+
I.createField(F, "Dynamic");
|
|
4757
|
+
const D = await I.getField(F);
|
|
4758
|
+
if (Ge(D.value)) {
|
|
4759
|
+
const _ = I.createEphemeral(Ur);
|
|
4760
|
+
return I.lock(_), I.setField(F, _), await I.commit(), await _.globalId;
|
|
4674
4761
|
} else
|
|
4675
|
-
return
|
|
4676
|
-
}), i = o.logger, c = await
|
|
4762
|
+
return D.value;
|
|
4763
|
+
}), i = o.logger, c = await al(e, t, o), a = new bs(e.httpDispatcher, {
|
|
4677
4764
|
minTimeout: 250,
|
|
4678
4765
|
maxRetries: 4
|
|
4679
|
-
}), l = new
|
|
4766
|
+
}), l = new po(a), u = new Wo(
|
|
4680
4767
|
l,
|
|
4681
4768
|
c.signer,
|
|
4682
4769
|
a
|
|
4683
|
-
), d = new
|
|
4770
|
+
), d = new eo(
|
|
4684
4771
|
i,
|
|
4685
4772
|
e.httpDispatcher,
|
|
4686
4773
|
o.frontendDownloadPath
|
|
@@ -4694,14 +4781,14 @@ class is {
|
|
|
4694
4781
|
bpPreparer: u,
|
|
4695
4782
|
frontendDownloadDriver: d,
|
|
4696
4783
|
driverKit: c,
|
|
4697
|
-
blockUpdateWatcher: new
|
|
4784
|
+
blockUpdateWatcher: new tl(l, i, {
|
|
4698
4785
|
minDelay: o.devBlockUpdateRecheckInterval,
|
|
4699
4786
|
http: a,
|
|
4700
4787
|
preferredUpdateChannel: o.preferredUpdateChannel
|
|
4701
4788
|
}),
|
|
4702
|
-
quickJs: await
|
|
4703
|
-
}, h = new
|
|
4704
|
-
return new
|
|
4789
|
+
quickJs: await _s()
|
|
4790
|
+
}, h = new Us([]), f = await Po(e, n, h, m);
|
|
4791
|
+
return new hs(
|
|
4705
4792
|
m,
|
|
4706
4793
|
c,
|
|
4707
4794
|
c.signer,
|
|
@@ -4713,7 +4800,7 @@ class is {
|
|
|
4713
4800
|
);
|
|
4714
4801
|
}
|
|
4715
4802
|
}
|
|
4716
|
-
const
|
|
4803
|
+
const cl = [
|
|
4717
4804
|
"undici:request:create",
|
|
4718
4805
|
// When a new request is created
|
|
4719
4806
|
"undici:request:bodySent",
|
|
@@ -4751,7 +4838,7 @@ const rl = [
|
|
|
4751
4838
|
"undici:dispatcher:retry"
|
|
4752
4839
|
// When a dispatcher retries a request
|
|
4753
4840
|
];
|
|
4754
|
-
async function
|
|
4841
|
+
async function _l(s, e = {}) {
|
|
4755
4842
|
const t = {
|
|
4756
4843
|
pingCheckDurationMs: 1e4,
|
|
4757
4844
|
pingTimeoutMs: 3e3,
|
|
@@ -4769,8 +4856,8 @@ async function Ll(s, e = {}) {
|
|
|
4769
4856
|
bodyLimit: 300,
|
|
4770
4857
|
...e
|
|
4771
4858
|
}, r = [];
|
|
4772
|
-
|
|
4773
|
-
|
|
4859
|
+
cl.forEach((a) => {
|
|
4860
|
+
so(a).subscribe((u) => {
|
|
4774
4861
|
var m;
|
|
4775
4862
|
const d = (/* @__PURE__ */ new Date()).toISOString();
|
|
4776
4863
|
(m = u == null ? void 0 : u.response) != null && m.headers && (u.response.headers = u.response.headers.map((h) => h.toString())), r.push(
|
|
@@ -4789,55 +4876,55 @@ async function Ll(s, e = {}) {
|
|
|
4789
4876
|
blockRegistryUiChecks: [],
|
|
4790
4877
|
blockGARegistryUiChecks: [],
|
|
4791
4878
|
autoUpdateCdnChecks: []
|
|
4792
|
-
}, n =
|
|
4793
|
-
o.plPings = await
|
|
4794
|
-
const l = await new
|
|
4879
|
+
}, n = Bs(s, { defaultRequestTimeout: t.pingTimeoutMs });
|
|
4880
|
+
o.plPings = await ge(t.pingCheckDurationMs, t.maxPingsPerSecond, async () => {
|
|
4881
|
+
const l = await new Gt(n).ping();
|
|
4795
4882
|
return JSON.stringify(l).slice(0, t.bodyLimit) + "...";
|
|
4796
4883
|
});
|
|
4797
|
-
const c = new
|
|
4798
|
-
return o.blockRegistryOverviewChecks = await
|
|
4884
|
+
const c = new Gt(n).ll.httpDispatcher;
|
|
4885
|
+
return o.blockRegistryOverviewChecks = await ge(
|
|
4799
4886
|
t.blockRegistryDurationMs,
|
|
4800
4887
|
t.maxRegistryChecksPerSecond,
|
|
4801
|
-
async () => await
|
|
4802
|
-
), o.blockGARegistryOverviewChecks = await
|
|
4888
|
+
async () => await be(new URL(t.blockOverviewPath, t.blockRegistryUrl), t, c)
|
|
4889
|
+
), o.blockGARegistryOverviewChecks = await ge(
|
|
4803
4890
|
t.blockRegistryDurationMs,
|
|
4804
4891
|
t.maxRegistryChecksPerSecond,
|
|
4805
|
-
async () => await
|
|
4806
|
-
), o.blockRegistryUiChecks = await
|
|
4892
|
+
async () => await be(new URL(t.blockOverviewPath, t.blockGARegistryUrl), t, c)
|
|
4893
|
+
), o.blockRegistryUiChecks = await ge(
|
|
4807
4894
|
t.blockRegistryDurationMs,
|
|
4808
4895
|
t.maxRegistryChecksPerSecond,
|
|
4809
|
-
async () => await
|
|
4810
|
-
), o.blockGARegistryUiChecks = await
|
|
4896
|
+
async () => await be(new URL(t.blockUiPath, t.blockRegistryUrl), t, c)
|
|
4897
|
+
), o.blockGARegistryUiChecks = await ge(
|
|
4811
4898
|
t.blockRegistryDurationMs,
|
|
4812
4899
|
t.maxRegistryChecksPerSecond,
|
|
4813
|
-
async () => await
|
|
4814
|
-
), o.autoUpdateCdnChecks = await
|
|
4900
|
+
async () => await be(new URL(t.blockUiPath, t.blockGARegistryUrl), t, c)
|
|
4901
|
+
), o.autoUpdateCdnChecks = await ge(
|
|
4815
4902
|
t.autoUpdateCdnDurationMs,
|
|
4816
4903
|
t.maxAutoUpdateCdnChecksPerSecond,
|
|
4817
|
-
async () => await
|
|
4818
|
-
),
|
|
4904
|
+
async () => await be(t.autoUpdateCdnUrl, t, c)
|
|
4905
|
+
), ll(o, s, t, r);
|
|
4819
4906
|
}
|
|
4820
|
-
async function
|
|
4821
|
-
const r =
|
|
4822
|
-
for (;
|
|
4823
|
-
const n =
|
|
4907
|
+
async function ge(s, e, t) {
|
|
4908
|
+
const r = St(), o = [];
|
|
4909
|
+
for (; kr(r) < s; ) {
|
|
4910
|
+
const n = St();
|
|
4824
4911
|
let i;
|
|
4825
4912
|
try {
|
|
4826
4913
|
i = { ok: !0, value: await t() };
|
|
4827
4914
|
} catch (l) {
|
|
4828
4915
|
i = { ok: !1, error: l };
|
|
4829
4916
|
}
|
|
4830
|
-
const c =
|
|
4917
|
+
const c = kr(n);
|
|
4831
4918
|
o.push({
|
|
4832
4919
|
elapsedMs: c,
|
|
4833
4920
|
response: i
|
|
4834
4921
|
});
|
|
4835
4922
|
const a = 1e3 / e - c;
|
|
4836
|
-
a > 0 && await
|
|
4923
|
+
a > 0 && await Dr(a);
|
|
4837
4924
|
}
|
|
4838
4925
|
return o;
|
|
4839
4926
|
}
|
|
4840
|
-
async function
|
|
4927
|
+
async function be(s, e, t) {
|
|
4841
4928
|
const { body: r, statusCode: o } = await ie(s, {
|
|
4842
4929
|
dispatcher: t,
|
|
4843
4930
|
headersTimeout: e.httpTimeoutMs,
|
|
@@ -4848,7 +4935,7 @@ async function we(s, e, t) {
|
|
|
4848
4935
|
beginningOfBody: n.slice(0, e.bodyLimit) + "..."
|
|
4849
4936
|
};
|
|
4850
4937
|
}
|
|
4851
|
-
function
|
|
4938
|
+
function ll(s, e, t, r) {
|
|
4852
4939
|
const o = s.plPings.filter((c) => c.response.ok), n = s.plPings.filter((c) => !c.response.ok), i = [
|
|
4853
4940
|
...new Set(o.map((c) => JSON.stringify(c.response.value)))
|
|
4854
4941
|
];
|
|
@@ -4857,17 +4944,17 @@ Network report:
|
|
|
4857
4944
|
pl endpoint: ${e};
|
|
4858
4945
|
options: ${JSON.stringify(t, null, 2)}.
|
|
4859
4946
|
|
|
4860
|
-
Platforma pings: ${
|
|
4947
|
+
Platforma pings: ${me(s.plPings)}
|
|
4861
4948
|
|
|
4862
|
-
Block registry overview responses: ${
|
|
4949
|
+
Block registry overview responses: ${me(s.blockRegistryOverviewChecks)}
|
|
4863
4950
|
|
|
4864
|
-
Block ga registry overview responses: ${
|
|
4951
|
+
Block ga registry overview responses: ${me(s.blockGARegistryOverviewChecks)}
|
|
4865
4952
|
|
|
4866
|
-
Block registry ui responses: ${
|
|
4953
|
+
Block registry ui responses: ${me(s.blockRegistryUiChecks)}
|
|
4867
4954
|
|
|
4868
|
-
Block ga registry ui responses: ${
|
|
4955
|
+
Block ga registry ui responses: ${me(s.blockGARegistryUiChecks)}
|
|
4869
4956
|
|
|
4870
|
-
Auto-update CDN responses: ${
|
|
4957
|
+
Auto-update CDN responses: ${me(s.autoUpdateCdnChecks)}
|
|
4871
4958
|
|
|
4872
4959
|
Block registry overview dumps:
|
|
4873
4960
|
${JSON.stringify(s.blockRegistryOverviewChecks, null, 2)}
|
|
@@ -4895,8 +4982,8 @@ ${r.join(`
|
|
|
4895
4982
|
`)}
|
|
4896
4983
|
`;
|
|
4897
4984
|
}
|
|
4898
|
-
function
|
|
4899
|
-
const e = s.filter((o) => o.response.ok), { mean: t, median: r } =
|
|
4985
|
+
function me(s) {
|
|
4986
|
+
const e = s.filter((o) => o.response.ok), { mean: t, median: r } = ul(s);
|
|
4900
4987
|
return `
|
|
4901
4988
|
total: ${s.length};
|
|
4902
4989
|
successes: ${e.length};
|
|
@@ -4905,7 +4992,7 @@ mean in ms: ${t};
|
|
|
4905
4992
|
median in ms: ${r};
|
|
4906
4993
|
`;
|
|
4907
4994
|
}
|
|
4908
|
-
function
|
|
4995
|
+
function ul(s) {
|
|
4909
4996
|
const e = s.map((o) => o.elapsedMs), t = e.reduce((o, n) => o + n) / e.length;
|
|
4910
4997
|
let r;
|
|
4911
4998
|
if (e.length > 0) {
|
|
@@ -4914,40 +5001,40 @@ function ol(s) {
|
|
|
4914
5001
|
}
|
|
4915
5002
|
return { mean: t, median: r };
|
|
4916
5003
|
}
|
|
4917
|
-
function
|
|
5004
|
+
function St() {
|
|
4918
5005
|
return Date.now();
|
|
4919
5006
|
}
|
|
4920
|
-
function
|
|
4921
|
-
return
|
|
5007
|
+
function kr(s) {
|
|
5008
|
+
return St() - s;
|
|
4922
5009
|
}
|
|
4923
5010
|
export {
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
5011
|
+
Bl as BlockPackRegistry,
|
|
5012
|
+
jl as CentralBlockRegistry,
|
|
5013
|
+
ns as DefaultDriverKitOpsPaths,
|
|
5014
|
+
os as DefaultDriverKitOpsSettings,
|
|
5015
|
+
oi as DefaultMiddleLayerOpsPaths,
|
|
5016
|
+
si as DefaultMiddleLayerOpsSettings,
|
|
5017
|
+
Kr as FrontendFromFolderResourceType,
|
|
5018
|
+
_r as FrontendFromUrlResourceType,
|
|
5019
|
+
hs as MiddleLayer,
|
|
5020
|
+
$t as Project,
|
|
5021
|
+
Vo as TengoTemplateGet,
|
|
5022
|
+
Uo as TengoTemplateGetRegistry,
|
|
5023
|
+
Jo as TengoTemplateGetTemplate,
|
|
5024
|
+
Go as TengoTemplateGetTemplateURI,
|
|
5025
|
+
Ul as TengoTemplatePack,
|
|
5026
|
+
Gl as TengoTemplatePackConvert,
|
|
5027
|
+
Ml as TengoTemplatePackConvertTemplate,
|
|
5028
|
+
Jl as TengoTemplatePackConvertTemplatePack,
|
|
5029
|
+
Vl as V1CentralDevSnapshotRegistry,
|
|
5030
|
+
xl as V1CentralRegistry,
|
|
5031
|
+
po as V2RegistryProvider,
|
|
5032
|
+
_l as checkNetwork,
|
|
5033
|
+
Gr as createRenderTemplate,
|
|
5034
|
+
jr as getDevV1PacketMtime,
|
|
5035
|
+
Et as getDevV2PacketMtime,
|
|
5036
|
+
al as initDriverKit,
|
|
5037
|
+
kt as loadTemplate,
|
|
5038
|
+
Mo as prepareTemplateSpec
|
|
4952
5039
|
};
|
|
4953
5040
|
//# sourceMappingURL=index.mjs.map
|