@milaboratories/pl-middle-layer 1.23.4 → 1.23.5
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 +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +397 -388
- package/dist/index.mjs.map +1 -1
- package/dist/pool/driver.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/pool/driver.ts +56 -47
package/dist/index.mjs
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
var ys = Object.defineProperty;
|
|
2
2
|
var ws = (s, e, t) => e in s ? ys(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
3
|
var S = (s, e, t) => ws(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { mapValueInVOE as
|
|
4
|
+
import { mapValueInVOE as Fr, executePSpecPredicate as Ss, mapPObjectData as le, mapPTableDef as pt, JsRenderInternal as bs, extractConfig as Tr, isConfigLambda as Ar, DefaultNavigationState as Rs, extractAllColumns as Es } from "@platforma-sdk/model";
|
|
5
5
|
export * from "@platforma-sdk/model";
|
|
6
|
-
import { AnyChannel as
|
|
6
|
+
import { AnyChannel as ke, StableChannel as ne, blockPackIdToString as Jt, blockPackIdEquals as Gt } from "@milaboratories/pl-model-middle-layer";
|
|
7
7
|
export * from "@milaboratories/pl-model-middle-layer";
|
|
8
8
|
import { request as ie, RetryAgent as Cs } from "undici";
|
|
9
|
-
import { RegistryV1 as ue, tryLoadPackDescription as
|
|
9
|
+
import { RegistryV1 as ue, tryLoadPackDescription as ht, BlockPackMetaEmbedAbsoluteBytes as ks, RegistryV2Reader as Ps, folderReaderByUrl as Os, loadPackDescription as Mt } from "@platforma-sdk/block-tools";
|
|
10
10
|
import q from "node:fs";
|
|
11
11
|
import H from "node:path";
|
|
12
12
|
import $s from "yaml";
|
|
13
|
-
import { assertNever as
|
|
13
|
+
import { assertNever as J, notEmpty as B, ConsoleLoggerAdapter as Is, ConcurrencyLimitingExecutor as Fs, HmacSha256Signer as Lr } from "@milaboratories/ts-helpers";
|
|
14
14
|
import * as Nr from "node:fs/promises";
|
|
15
15
|
import { tryResolve as Ts } from "@milaboratories/resolve-helper";
|
|
16
|
-
import { resourceTypesEqual as ae, field as j, Pl as T, PlClient as As, isNullResourceId as _e, ensureResourceIdNotNull as
|
|
16
|
+
import { resourceTypesEqual as ae, field as j, Pl as T, PlClient as As, isNullResourceId as _e, ensureResourceIdNotNull as ft, isResource as Ls, isResourceRef as Ns, isNotNullResourceId as _t, resourceType as Le, resourceTypeToString as Ds, resourceIdToString as Dr, isNotFoundError as Bs, isTimeoutOrCancelError as js, toGlobalResourceId as xs, plAddressToConfig as Vs, UnauthenticatedPlClient as Kt } from "@milaboratories/pl-client";
|
|
17
17
|
export * from "@milaboratories/pl-client";
|
|
18
|
-
import { SynchronizedTreeState as Br, PlError as Us, isPlTreeNodeAccessor as
|
|
19
|
-
import { Computable as V, ChangeSource as
|
|
20
|
-
import { randomUUID as
|
|
21
|
-
import { parseTemplate as _s, PlTemplateV1 as ce, PlTemplateOverrideV1 as
|
|
18
|
+
import { SynchronizedTreeState as Br, PlError as Us, isPlTreeNodeAccessor as Js } from "@milaboratories/pl-tree";
|
|
19
|
+
import { Computable as V, ChangeSource as Ht, PollComputablePool as Gs, WatchableValue as Ms } from "@milaboratories/computable";
|
|
20
|
+
import { randomUUID as Fe, createHash as Ne } from "node:crypto";
|
|
21
|
+
import { parseTemplate as _s, PlTemplateV1 as ce, PlTemplateOverrideV1 as Pe, PlTemplateLibV1 as Be, PlTemplateSoftwareV1 as Se } from "@milaboratories/pl-model-backend";
|
|
22
22
|
import jr from "denque";
|
|
23
23
|
import { Templates as Ks } from "@platforma-sdk/workflow-tengo";
|
|
24
|
-
import
|
|
24
|
+
import ye from "canonicalize";
|
|
25
25
|
import Hs from "node:assert";
|
|
26
|
-
import { Scope as
|
|
26
|
+
import { Scope as gt, getQuickJS as Ws } from "quickjs-emscripten";
|
|
27
27
|
import { setTimeout as xr } from "node:timers/promises";
|
|
28
28
|
import { createDownloadClient as zs, createLogsClient as Xs, createUploadBlobClient as qs, createUploadProgressClient as Ys, DownloadDriver as Zs, UploadDriver as Qs, LogsStreamDriver as eo, LogsDriver as to, LsDriver as ro, DownloadUrlDriver as so } from "@milaboratories/pl-drivers";
|
|
29
29
|
import { PFrame as oo } from "@milaboratories/pframes-node";
|
|
30
30
|
import { LRUCache as no } from "lru-cache";
|
|
31
31
|
import { channel as io } from "node:diagnostics_channel";
|
|
32
|
-
async function
|
|
32
|
+
async function Wt(s) {
|
|
33
33
|
try {
|
|
34
34
|
return await Nr.stat(s, { bigint: !0 });
|
|
35
35
|
} catch (e) {
|
|
@@ -38,30 +38,30 @@ async function Ht(s) {
|
|
|
38
38
|
throw e;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
const ao = [ue.PlPackageYamlConfigFile], co = [ue.PlPackageJsonConfigFile],
|
|
42
|
-
Ct,
|
|
41
|
+
const ao = [ue.PlPackageYamlConfigFile], co = [ue.PlPackageJsonConfigFile], kt = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], Pt = ["config", "dist", "config.json"], Vr = ["frontend", "dist"], zt = "block-model/dist/config.json", lo = "block-ui/package.json", uo = [
|
|
43
42
|
kt,
|
|
43
|
+
Pt,
|
|
44
44
|
ao,
|
|
45
45
|
co,
|
|
46
46
|
Vr
|
|
47
47
|
];
|
|
48
48
|
async function po(s) {
|
|
49
|
-
return await
|
|
49
|
+
return await Wt(H.join(s, ...Pt)) !== void 0 || await Wt(H.join(s, ...kt)) !== void 0;
|
|
50
50
|
}
|
|
51
51
|
function rt(s, e) {
|
|
52
52
|
const t = Ts(s, e);
|
|
53
53
|
if (t === void 0) throw new Error(`Can't resolve ${e} against ${s}`);
|
|
54
54
|
return t;
|
|
55
55
|
}
|
|
56
|
-
async function
|
|
56
|
+
async function Xt(s, e) {
|
|
57
57
|
if (H.isAbsolute(s) || (s = H.resolve(s)), await po(s))
|
|
58
58
|
return {
|
|
59
|
-
workflow: H.join(s, ...
|
|
60
|
-
config: H.join(s, ...
|
|
59
|
+
workflow: H.join(s, ...kt),
|
|
60
|
+
config: H.join(s, ...Pt),
|
|
61
61
|
ui: H.join(s, ...Vr)
|
|
62
62
|
};
|
|
63
63
|
{
|
|
64
|
-
const t = rt(s,
|
|
64
|
+
const t = rt(s, zt), r = rt(s, zt), o = rt(s, lo);
|
|
65
65
|
return { workflow: t, config: r, ui: H.resolve(o, "..", "dist") };
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -91,7 +91,7 @@ async function Ur(s) {
|
|
|
91
91
|
}
|
|
92
92
|
return e.toString();
|
|
93
93
|
}
|
|
94
|
-
async function
|
|
94
|
+
async function Ot(s) {
|
|
95
95
|
const e = await q.promises.stat(s.components.workflow.main.file, {
|
|
96
96
|
bigint: !0
|
|
97
97
|
}), t = await q.promises.stat(s.components.model.file, { bigint: !0 });
|
|
@@ -134,7 +134,7 @@ class Vl {
|
|
|
134
134
|
registryId: e.id,
|
|
135
135
|
id: m,
|
|
136
136
|
latestByChannel: {
|
|
137
|
-
[
|
|
137
|
+
[ke]: h,
|
|
138
138
|
[ne]: h
|
|
139
139
|
},
|
|
140
140
|
allVersions: c.allVersions.map((f) => ({ version: f, channels: [] }))
|
|
@@ -150,7 +150,7 @@ class Vl {
|
|
|
150
150
|
...c,
|
|
151
151
|
latestByChannel: {
|
|
152
152
|
...c.latestByChannel,
|
|
153
|
-
[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[ke])
|
|
154
154
|
},
|
|
155
155
|
registryId: e.id
|
|
156
156
|
}
|
|
@@ -186,19 +186,19 @@ class Vl {
|
|
|
186
186
|
registryId: e.id,
|
|
187
187
|
id: m,
|
|
188
188
|
latestByChannel: {
|
|
189
|
-
[
|
|
189
|
+
[ke]: h,
|
|
190
190
|
[ne]: h
|
|
191
191
|
},
|
|
192
192
|
allVersions: []
|
|
193
193
|
});
|
|
194
194
|
} else {
|
|
195
|
-
let u = a, d = await
|
|
195
|
+
let u = a, d = await ht(u);
|
|
196
196
|
if (d === void 0) {
|
|
197
197
|
for (const m of ["block", "meta"])
|
|
198
|
-
if (u = H.join(a, m), d = await
|
|
198
|
+
if (u = H.join(a, m), d = await ht(u), d !== void 0) break;
|
|
199
199
|
}
|
|
200
200
|
if (d !== void 0) {
|
|
201
|
-
const m = await
|
|
201
|
+
const m = await Ot(d), h = {
|
|
202
202
|
id: d.id,
|
|
203
203
|
meta: await ks.parseAsync(d.meta),
|
|
204
204
|
spec: {
|
|
@@ -211,7 +211,7 @@ class Vl {
|
|
|
211
211
|
registryId: e.id,
|
|
212
212
|
id: d.id,
|
|
213
213
|
latestByChannel: {
|
|
214
|
-
[
|
|
214
|
+
[ke]: h,
|
|
215
215
|
[ne]: h
|
|
216
216
|
},
|
|
217
217
|
allVersions: []
|
|
@@ -221,7 +221,7 @@ class Vl {
|
|
|
221
221
|
}
|
|
222
222
|
return t;
|
|
223
223
|
default:
|
|
224
|
-
return
|
|
224
|
+
return J(r);
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
async listBlockPacks() {
|
|
@@ -256,10 +256,10 @@ class go {
|
|
|
256
256
|
const Ul = {
|
|
257
257
|
type: "remote-v2",
|
|
258
258
|
url: "https://blocks.pl-open.science/"
|
|
259
|
-
},
|
|
259
|
+
}, Jl = {
|
|
260
260
|
type: "remote-v1",
|
|
261
261
|
url: "https://block.registry.platforma.bio/releases"
|
|
262
|
-
},
|
|
262
|
+
}, Gl = {
|
|
263
263
|
type: "remote-v1",
|
|
264
264
|
url: "https://block.registry.platforma.bio/dev"
|
|
265
265
|
}, mo = {
|
|
@@ -269,22 +269,22 @@ const Ul = {
|
|
|
269
269
|
blocksInLimbo: []
|
|
270
270
|
}, yo = {
|
|
271
271
|
label: "New Project"
|
|
272
|
-
}, wo = { name: "UserProject", version: "2" },
|
|
273
|
-
function
|
|
272
|
+
}, wo = { name: "UserProject", version: "2" }, Jr = "SchemaVersion", Gr = "1", $t = "ProjectCreated", Te = "ProjectLastModified", Ae = "ProjectMeta", de = "ProjectStructure", Ke = "BlockRenderingState", So = "BlockFrontendState/", bo = /^BlockFrontendState\/(?<blockid>.*)$/;
|
|
273
|
+
function mt(s) {
|
|
274
274
|
return `${So}${s}`;
|
|
275
275
|
}
|
|
276
276
|
const Ro = "BlockArgsAuthor/";
|
|
277
|
-
function
|
|
277
|
+
function vt(s) {
|
|
278
278
|
return `${Ro}${s}`;
|
|
279
279
|
}
|
|
280
|
-
const
|
|
280
|
+
const yt = "ProjectStructureAuthor";
|
|
281
281
|
function Eo(s) {
|
|
282
282
|
const e = s.match(bo);
|
|
283
283
|
if (e !== null)
|
|
284
284
|
return e.groups.blockid;
|
|
285
285
|
}
|
|
286
286
|
const Co = "__serviceTemplate_";
|
|
287
|
-
function
|
|
287
|
+
function wt(s) {
|
|
288
288
|
return `${Co}${s}`;
|
|
289
289
|
}
|
|
290
290
|
function U(s, e) {
|
|
@@ -315,7 +315,7 @@ async function Io(s, e, t, r) {
|
|
|
315
315
|
for (const u of c.listDynamicFields()) {
|
|
316
316
|
const d = c.traverse(u);
|
|
317
317
|
if (d === void 0) continue;
|
|
318
|
-
const m = B(d.getKeyValueAsJson(
|
|
318
|
+
const m = B(d.getKeyValueAsJson(Ae)), h = B(d.getKeyValueAsJson($t)), f = B(d.getKeyValueAsJson(Te));
|
|
319
319
|
l.push({
|
|
320
320
|
id: u,
|
|
321
321
|
rid: d.id,
|
|
@@ -341,7 +341,7 @@ function _r(s, e, t, r, o) {
|
|
|
341
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/");
|
|
342
342
|
}
|
|
343
343
|
const Ao = { name: "BContextEnd", version: "1" }, Lo = { name: "BContext", version: "1" }, No = "id", Do = "parent/", Bo = ["context", "result"];
|
|
344
|
-
function
|
|
344
|
+
function qt(s, e, t) {
|
|
345
345
|
return _r(s, e, !0, t, Bo);
|
|
346
346
|
}
|
|
347
347
|
function jo(s) {
|
|
@@ -352,7 +352,7 @@ function xo(s, e) {
|
|
|
352
352
|
if (e.length === 0) return jo(s);
|
|
353
353
|
if (e.length === 1) return e[0];
|
|
354
354
|
const t = s.createEphemeral(Lo);
|
|
355
|
-
s.createField(j(t, No), "Input", T.createPlString(s,
|
|
355
|
+
s.createField(j(t, No), "Input", T.createPlString(s, Fe()));
|
|
356
356
|
for (let r = 0; r < e.length; r++)
|
|
357
357
|
s.createField(j(t, `${Do}${r}`), "Input", e[r]);
|
|
358
358
|
return s.lock(t), t;
|
|
@@ -363,26 +363,26 @@ function Vo(s, e) {
|
|
|
363
363
|
case "pl.tengo-template.v2":
|
|
364
364
|
return Hr(s, t);
|
|
365
365
|
default:
|
|
366
|
-
|
|
366
|
+
J(r);
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
const Kr = {
|
|
370
370
|
hash(s, e) {
|
|
371
|
-
e.update(
|
|
371
|
+
e.update(Be.type.name).update(Be.type.version).update(s.name).update(s.version).update(s.src);
|
|
372
372
|
},
|
|
373
373
|
render(s, e, t) {
|
|
374
374
|
return e.createValue(
|
|
375
|
-
|
|
376
|
-
JSON.stringify(
|
|
375
|
+
Be.type,
|
|
376
|
+
JSON.stringify(Be.fromV2Data(s).data)
|
|
377
377
|
);
|
|
378
378
|
}
|
|
379
379
|
}, He = {
|
|
380
380
|
hash(s, e) {
|
|
381
|
-
e.update(
|
|
381
|
+
e.update(Se.type.name).update(Se.type.version).update(s.name).update(s.version).update(s.src);
|
|
382
382
|
},
|
|
383
383
|
render(s, e, t) {
|
|
384
|
-
const r =
|
|
385
|
-
return e.setKValue(o,
|
|
384
|
+
const r = Se.fromV2Data(s), o = e.createStruct(Se.type, r.data);
|
|
385
|
+
return e.setKValue(o, Se.metaNameKey, JSON.stringify(r.name)), e.lock(o), o;
|
|
386
386
|
}
|
|
387
387
|
}, Uo = {
|
|
388
388
|
hash(s, e) {
|
|
@@ -403,21 +403,21 @@ const Kr = {
|
|
|
403
403
|
JSON.stringify(ce.fromV2Data(s).data)
|
|
404
404
|
);
|
|
405
405
|
}
|
|
406
|
-
},
|
|
406
|
+
}, Jo = {
|
|
407
407
|
hash(s, e) {
|
|
408
|
-
e.update(
|
|
408
|
+
e.update(Pe.type.name).update(Pe.type.version).update(s.hashOverride ?? "");
|
|
409
409
|
},
|
|
410
410
|
render(s, e, t) {
|
|
411
411
|
return e.createStruct(
|
|
412
|
-
|
|
413
|
-
JSON.stringify(
|
|
412
|
+
Pe.type,
|
|
413
|
+
JSON.stringify(Pe.fromV2Data(s))
|
|
414
414
|
);
|
|
415
415
|
}
|
|
416
416
|
};
|
|
417
417
|
function Hr(s, e, t) {
|
|
418
418
|
t || (t = /* @__PURE__ */ new Map());
|
|
419
419
|
const r = (c, a) => {
|
|
420
|
-
const l =
|
|
420
|
+
const l = Ne("sha256");
|
|
421
421
|
a.hash(c, l);
|
|
422
422
|
const u = l.digest("hex");
|
|
423
423
|
if (!t.has(u)) {
|
|
@@ -444,10 +444,10 @@ function Hr(s, e, t) {
|
|
|
444
444
|
}
|
|
445
445
|
if (s.lock(o), !e.hashOverride)
|
|
446
446
|
return o;
|
|
447
|
-
const n = r(e,
|
|
447
|
+
const n = r(e, Jo), i = Pe.tplField(n);
|
|
448
448
|
return s.createField(i, "Service"), s.setField(i, o), s.lock(o), n;
|
|
449
449
|
}
|
|
450
|
-
const
|
|
450
|
+
const Go = { name: "TengoTemplateGet", version: "1" }, Mo = "registry", _o = "templateURI", Ko = "template", Ml = { name: "TengoTemplatePack", version: "1" }, _l = {
|
|
451
451
|
name: "TengoTemplatePackConvert",
|
|
452
452
|
version: "1"
|
|
453
453
|
}, Kl = "templatePack", Hl = "template";
|
|
@@ -462,21 +462,21 @@ async function Ho(s) {
|
|
|
462
462
|
case "explicit":
|
|
463
463
|
return s;
|
|
464
464
|
default:
|
|
465
|
-
return
|
|
465
|
+
return J(s);
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
468
|
function Wo(s, e) {
|
|
469
|
-
const t = s.createStruct(
|
|
469
|
+
const t = s.createStruct(Go), r = j(t, Mo), o = j(t, _o), n = j(t, Ko);
|
|
470
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;
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function It(s, e) {
|
|
473
473
|
switch (e.type) {
|
|
474
474
|
case "from-registry":
|
|
475
475
|
return Wo(s, e);
|
|
476
476
|
case "explicit":
|
|
477
477
|
return Vo(s, e);
|
|
478
478
|
default:
|
|
479
|
-
return
|
|
479
|
+
return J(e);
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
482
|
const Wr = { name: "Frontend/FromUrl", version: "1" }, zr = {
|
|
@@ -499,11 +499,11 @@ function zo(s, e) {
|
|
|
499
499
|
})
|
|
500
500
|
);
|
|
501
501
|
default:
|
|
502
|
-
return
|
|
502
|
+
return J(e);
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
const Xo = { name: "BlockPackCustom", version: "1" }, Xr = "template", qr = "frontend";
|
|
506
|
-
function
|
|
506
|
+
function Yt(s) {
|
|
507
507
|
return s.endsWith("/") ? s : `${s}/`;
|
|
508
508
|
}
|
|
509
509
|
class qo {
|
|
@@ -515,17 +515,17 @@ class qo {
|
|
|
515
515
|
case "explicit":
|
|
516
516
|
return e.config;
|
|
517
517
|
case "dev-v1": {
|
|
518
|
-
const t = await
|
|
518
|
+
const t = await Xt(e.folder), r = await q.promises.readFile(t.config, { encoding: "utf-8" });
|
|
519
519
|
return JSON.parse(r);
|
|
520
520
|
}
|
|
521
521
|
case "dev-v2": {
|
|
522
|
-
const t = await
|
|
522
|
+
const t = await Mt(e.folder), r = await q.promises.readFile(t.components.model.file, {
|
|
523
523
|
encoding: "utf-8"
|
|
524
524
|
});
|
|
525
525
|
return JSON.parse(r);
|
|
526
526
|
}
|
|
527
527
|
case "from-registry-v1": {
|
|
528
|
-
const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${
|
|
528
|
+
const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${Yt(e.registryUrl)}${ue.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`;
|
|
529
529
|
return await (await ie(`${r}/config.json`, t)).body.json();
|
|
530
530
|
}
|
|
531
531
|
case "from-registry-v2": {
|
|
@@ -533,7 +533,7 @@ class qo {
|
|
|
533
533
|
return await (await ie(o.model.url, t)).body.json();
|
|
534
534
|
}
|
|
535
535
|
default:
|
|
536
|
-
return
|
|
536
|
+
return J(e);
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
async prepare(e) {
|
|
@@ -541,7 +541,7 @@ class qo {
|
|
|
541
541
|
case "explicit":
|
|
542
542
|
return e;
|
|
543
543
|
case "dev-v1": {
|
|
544
|
-
const t = await
|
|
544
|
+
const t = await Xt(e.folder), r = await q.promises.readFile(t.workflow), o = JSON.parse(
|
|
545
545
|
await q.promises.readFile(t.config, "utf-8")
|
|
546
546
|
), n = t.ui;
|
|
547
547
|
return {
|
|
@@ -560,14 +560,14 @@ class qo {
|
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
562
|
case "dev-v2": {
|
|
563
|
-
const t = await
|
|
563
|
+
const t = await Mt(e.folder), r = JSON.parse(
|
|
564
564
|
await q.promises.readFile(t.components.model.file, {
|
|
565
565
|
encoding: "utf-8"
|
|
566
566
|
})
|
|
567
567
|
), o = await q.promises.readFile(
|
|
568
568
|
t.components.workflow.main.file
|
|
569
569
|
), n = t.components.ui.folder, i = { ...e };
|
|
570
|
-
return e.mtime === void 0 && (i.mtime = await
|
|
570
|
+
return e.mtime === void 0 && (i.mtime = await Ot(t)), {
|
|
571
571
|
type: "explicit",
|
|
572
572
|
template: {
|
|
573
573
|
type: "explicit",
|
|
@@ -583,7 +583,7 @@ class qo {
|
|
|
583
583
|
};
|
|
584
584
|
}
|
|
585
585
|
case "from-registry-v1": {
|
|
586
|
-
const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${
|
|
586
|
+
const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${Yt(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);
|
|
587
587
|
if (n.statusCode !== 200)
|
|
588
588
|
throw new Error(
|
|
589
589
|
`Block not found in registry (url = ${o} ; code = ${n.statusCode}): ` + JSON.stringify(e)
|
|
@@ -620,29 +620,29 @@ class qo {
|
|
|
620
620
|
};
|
|
621
621
|
}
|
|
622
622
|
default:
|
|
623
|
-
return
|
|
623
|
+
return J(e);
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
627
|
function Yo(s, e) {
|
|
628
628
|
const t = { config: e.config, source: e.source }, r = s.createStruct(Xo, JSON.stringify(t));
|
|
629
|
-
return s.createField(j(r, Xr), "Input",
|
|
629
|
+
return s.createField(j(r, Xr), "Input", It(s, e.template)), s.createField(j(r, qr), "Input", zo(s, e.frontend)), s.lock(r), r;
|
|
630
630
|
}
|
|
631
|
-
function
|
|
631
|
+
function Zt(s, e) {
|
|
632
632
|
switch (e.type) {
|
|
633
633
|
case "explicit":
|
|
634
634
|
return Yo(s, e);
|
|
635
635
|
default:
|
|
636
|
-
return
|
|
636
|
+
return J(e.type);
|
|
637
637
|
}
|
|
638
638
|
}
|
|
639
|
-
function
|
|
639
|
+
function je(s, e) {
|
|
640
640
|
return { __isRef: !0, blockId: s, name: e };
|
|
641
641
|
}
|
|
642
642
|
function Zo(s) {
|
|
643
643
|
return typeof s == "object" && s !== null && s.__isRef === !0 && "blockId" in s && "name" in s;
|
|
644
644
|
}
|
|
645
|
-
function
|
|
645
|
+
function St(s, e, t) {
|
|
646
646
|
const r = typeof e;
|
|
647
647
|
switch (r) {
|
|
648
648
|
case "function":
|
|
@@ -658,18 +658,18 @@ function wt(s, e, t) {
|
|
|
658
658
|
if (Zo(e))
|
|
659
659
|
t === void 0 || t.has(e.blockId) ? s.upstreams.add(e.blockId) : s.missingReferences = !0;
|
|
660
660
|
else if (Array.isArray(e))
|
|
661
|
-
for (const o of e)
|
|
661
|
+
for (const o of e) St(s, o, t);
|
|
662
662
|
else
|
|
663
663
|
for (const [, o] of Object.entries(e))
|
|
664
|
-
|
|
664
|
+
St(s, o, t);
|
|
665
665
|
return;
|
|
666
666
|
default:
|
|
667
|
-
|
|
667
|
+
J(r);
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
670
|
function Qo(s, e) {
|
|
671
671
|
const t = { upstreams: /* @__PURE__ */ new Set(), missingReferences: !1 };
|
|
672
|
-
return
|
|
672
|
+
return St(t, s, e), t;
|
|
673
673
|
}
|
|
674
674
|
function te(s) {
|
|
675
675
|
return {
|
|
@@ -708,7 +708,7 @@ class Yr {
|
|
|
708
708
|
}
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
|
-
function
|
|
711
|
+
function bt(s) {
|
|
712
712
|
const e = /* @__PURE__ */ new Map();
|
|
713
713
|
let t;
|
|
714
714
|
for (const { id: r } of te(s)) {
|
|
@@ -741,18 +741,18 @@ function en(s, e) {
|
|
|
741
741
|
for (const t of s) if (!e.has(t)) return !1;
|
|
742
742
|
return !0;
|
|
743
743
|
}
|
|
744
|
-
function
|
|
745
|
-
if (s.size > e.size) return
|
|
744
|
+
function Rt(s, e) {
|
|
745
|
+
if (s.size > e.size) return Rt(e, s);
|
|
746
746
|
for (const t of s) if (e.has(t)) return !0;
|
|
747
747
|
return !1;
|
|
748
748
|
}
|
|
749
|
-
function
|
|
749
|
+
function Qt(s, e) {
|
|
750
750
|
const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
|
|
751
751
|
return s.nodes.forEach((n) => {
|
|
752
752
|
const i = e.nodes.get(n.id);
|
|
753
|
-
i === void 0 ? t.add(n.id) : (!en(n.upstream, i.upstream) ||
|
|
753
|
+
i === void 0 ? t.add(n.id) : (!en(n.upstream, i.upstream) || Rt(n.upstream, o)) && o.add(n.id);
|
|
754
754
|
}), e.nodes.forEach((n) => {
|
|
755
|
-
s.nodes.has(n.id) ?
|
|
755
|
+
s.nodes.has(n.id) ? Rt(n.upstream, o) && o.add(n.id) : r.add(n.id);
|
|
756
756
|
}), { onlyInA: t, onlyInB: r, different: o };
|
|
757
757
|
}
|
|
758
758
|
let st;
|
|
@@ -760,7 +760,7 @@ async function Zr() {
|
|
|
760
760
|
if (st === void 0) {
|
|
761
761
|
const s = await Ho(Ks["pframes.export-pframe"]);
|
|
762
762
|
if (s.type !== "explicit") throw new Error("Unexpected prepared template type.");
|
|
763
|
-
const e =
|
|
763
|
+
const e = Ne("sha256").update(s.content).digest("hex");
|
|
764
764
|
st = { spec: s, hash: e };
|
|
765
765
|
}
|
|
766
766
|
return st;
|
|
@@ -777,7 +777,7 @@ function ot(s, e) {
|
|
|
777
777
|
return r !== n && (r = n, o = e()), e();
|
|
778
778
|
};
|
|
779
779
|
}
|
|
780
|
-
class
|
|
780
|
+
class er {
|
|
781
781
|
constructor(e, t) {
|
|
782
782
|
S(this, "currentInputsC", ot(
|
|
783
783
|
() => this.fields.currentArgs.modCount,
|
|
@@ -883,7 +883,7 @@ class We {
|
|
|
883
883
|
return JSON.parse(JSON.stringify(this.struct));
|
|
884
884
|
}
|
|
885
885
|
getStagingGraph() {
|
|
886
|
-
return this.stagingGraph === void 0 && (this.stagingGraph =
|
|
886
|
+
return this.stagingGraph === void 0 && (this.stagingGraph = bt(this.struct)), this.stagingGraph;
|
|
887
887
|
}
|
|
888
888
|
getPendingProductionGraph() {
|
|
889
889
|
return this.pendingProductionGraph === void 0 && (this.pendingProductionGraph = Me(
|
|
@@ -1000,7 +1000,7 @@ class We {
|
|
|
1000
1000
|
this.resetStaging(e);
|
|
1001
1001
|
const t = this.getBlockInfo(e), r = this.createCtx(this.getStagingGraph().nodes.get(e).upstream, "stagingCtx");
|
|
1002
1002
|
if (this.getBlock(e).renderingMode !== "Heavy") throw new Error("not supported yet");
|
|
1003
|
-
const o = t.getTemplate(this.tx), n =
|
|
1003
|
+
const o = t.getTemplate(this.tx), n = qt(this.tx, o, {
|
|
1004
1004
|
args: t.fields.currentArgs.ref,
|
|
1005
1005
|
blockId: this.tx.createValue(T.JsonString, JSON.stringify(e)),
|
|
1006
1006
|
isProduction: this.tx.createValue(T.JsonBool, JSON.stringify(!1)),
|
|
@@ -1021,7 +1021,7 @@ class We {
|
|
|
1021
1021
|
);
|
|
1022
1022
|
if (this.getBlock(e).renderingMode === "Light")
|
|
1023
1023
|
throw new Error("Can't render production for light block.");
|
|
1024
|
-
const o = t.getTemplate(this.tx), n =
|
|
1024
|
+
const o = t.getTemplate(this.tx), n = qt(this.tx, o, {
|
|
1025
1025
|
args: t.fields.currentArgs.ref,
|
|
1026
1026
|
blockId: this.tx.createValue(T.JsonString, JSON.stringify(e)),
|
|
1027
1027
|
isProduction: this.tx.createValue(T.JsonBool, JSON.stringify(!0)),
|
|
@@ -1039,21 +1039,21 @@ class We {
|
|
|
1039
1039
|
//
|
|
1040
1040
|
/** Very generic method, better check for more specialized case-specific methods first. */
|
|
1041
1041
|
updateStructure(e, t = rn) {
|
|
1042
|
-
const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n =
|
|
1042
|
+
const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n = bt(e), i = Me(
|
|
1043
1043
|
e,
|
|
1044
1044
|
(l) => {
|
|
1045
1045
|
var u;
|
|
1046
1046
|
return (u = this.blockInfos.get(l)) == null ? void 0 : u.actualProductionInputs;
|
|
1047
1047
|
}
|
|
1048
|
-
), c =
|
|
1048
|
+
), c = Qt(r, n), a = Qt(o, i);
|
|
1049
1049
|
for (const l of c.onlyInA) {
|
|
1050
1050
|
const { fields: u } = this.getBlockInfo(l);
|
|
1051
1051
|
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);
|
|
1052
1052
|
}
|
|
1053
1053
|
for (const l of c.onlyInB) {
|
|
1054
|
-
const u = new
|
|
1054
|
+
const u = new er(l, {});
|
|
1055
1055
|
this.blockInfos.set(l, u);
|
|
1056
|
-
const d = t(l), m =
|
|
1056
|
+
const d = t(l), m = Zt(this.tx, d.blockPack);
|
|
1057
1057
|
this.setBlockField(l, "blockPack", T.wrapInHolder(this.tx, m), "NotReady");
|
|
1058
1058
|
const h = Buffer.from(d.args), f = this.tx.createValue(T.JsonObject, h);
|
|
1059
1059
|
this.setBlockField(l, "currentArgs", f, "Ready", h), d.uiState && (this.blockFrontendStates.set(l, d.uiState), this.changedBlockFrontendStates.add(l)), u.check();
|
|
@@ -1107,7 +1107,7 @@ class We {
|
|
|
1107
1107
|
this.setBlockField(
|
|
1108
1108
|
e,
|
|
1109
1109
|
"blockPack",
|
|
1110
|
-
T.wrapInHolder(this.tx,
|
|
1110
|
+
T.wrapInHolder(this.tx, Zt(this.tx, t)),
|
|
1111
1111
|
"NotReady"
|
|
1112
1112
|
), 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(
|
|
1113
1113
|
"downstream",
|
|
@@ -1213,28 +1213,28 @@ class We {
|
|
|
1213
1213
|
assignAuthorMarkers() {
|
|
1214
1214
|
const e = this.author ? JSON.stringify(this.author) : void 0;
|
|
1215
1215
|
for (const t of this.blocksWithChangedInputs)
|
|
1216
|
-
e === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1217
|
-
(this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1216
|
+
e === void 0 ? this.tx.deleteKValue(this.rid, vt(t)) : this.tx.setKValue(this.rid, vt(t), e);
|
|
1217
|
+
(this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid, yt) : this.tx.setKValue(this.rid, yt, e));
|
|
1218
1218
|
}
|
|
1219
1219
|
save() {
|
|
1220
1220
|
if (this.wasModified) {
|
|
1221
|
-
this.lastModifiedChanged && this.tx.setKValue(this.rid,
|
|
1221
|
+
this.lastModifiedChanged && this.tx.setKValue(this.rid, Te, JSON.stringify(this.lastModified)), this.structureChanged && this.tx.setKValue(this.rid, de, JSON.stringify(this.struct)), this.renderingStateChanged && this.tx.setKValue(
|
|
1222
1222
|
this.rid,
|
|
1223
1223
|
Ke,
|
|
1224
1224
|
JSON.stringify({
|
|
1225
1225
|
...this.renderingState,
|
|
1226
1226
|
blocksInLimbo: [...this.blocksInLimbo]
|
|
1227
1227
|
})
|
|
1228
|
-
), this.metaChanged && this.tx.setKValue(this.rid,
|
|
1228
|
+
), this.metaChanged && this.tx.setKValue(this.rid, Ae, JSON.stringify(this.meta));
|
|
1229
1229
|
for (const e of this.changedBlockFrontendStates) {
|
|
1230
1230
|
const t = this.blockFrontendStates.get(e);
|
|
1231
|
-
t === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1231
|
+
t === void 0 ? this.tx.deleteKValue(this.rid, mt(e)) : this.tx.setKValue(this.rid, mt(e), t);
|
|
1232
1232
|
}
|
|
1233
1233
|
this.assignAuthorMarkers();
|
|
1234
1234
|
}
|
|
1235
1235
|
}
|
|
1236
1236
|
static async load(e, t, r) {
|
|
1237
|
-
const o = e.getResourceData(t, !0), n = e.getKValueJson(t,
|
|
1237
|
+
const o = e.getResourceData(t, !0), n = e.getKValueJson(t, Jr), i = e.getKValueJson(t, Te), c = e.getKValueJson(t, Ae), a = e.getKValueJson(t, de), l = e.getKValueJson(t, Ke), u = e.listKeyValuesString(t), [
|
|
1238
1238
|
d,
|
|
1239
1239
|
m,
|
|
1240
1240
|
h,
|
|
@@ -1251,7 +1251,7 @@ class We {
|
|
|
1251
1251
|
l,
|
|
1252
1252
|
u
|
|
1253
1253
|
]);
|
|
1254
|
-
if (m !==
|
|
1254
|
+
if (m !== Gr)
|
|
1255
1255
|
throw new Error(
|
|
1256
1256
|
`Can't act on this project resource because it has a wrong schema version: ${m}`
|
|
1257
1257
|
);
|
|
@@ -1265,19 +1265,19 @@ class We {
|
|
|
1265
1265
|
fields: {}
|
|
1266
1266
|
}, k.set(y.blockId, g)), g.fields[y.fieldName] = _e(p.value) ? { modCount: 0 } : { modCount: 0, ref: p.value };
|
|
1267
1267
|
}
|
|
1268
|
-
const se = await Zr(), pe =
|
|
1268
|
+
const se = await Zr(), pe = wt(se.hash), A = d.fields.find(
|
|
1269
1269
|
(p) => p.name === pe
|
|
1270
1270
|
);
|
|
1271
1271
|
let z;
|
|
1272
|
-
A !== void 0 ? z =
|
|
1273
|
-
j(t,
|
|
1272
|
+
A !== void 0 ? z = ft(A.value) : (z = T.wrapInHolder(e, It(e, se.spec)), e.createField(
|
|
1273
|
+
j(t, wt(se.hash)),
|
|
1274
1274
|
"Dynamic",
|
|
1275
1275
|
z
|
|
1276
1276
|
));
|
|
1277
|
-
const oe = { stagingRefreshTimestamp: F }, K = new Set(D),
|
|
1277
|
+
const oe = { stagingRefreshTimestamp: F }, K = new Set(D), G = /* @__PURE__ */ new Map();
|
|
1278
1278
|
for (const p of _) {
|
|
1279
1279
|
const y = Eo(p.key);
|
|
1280
|
-
y !== void 0 &&
|
|
1280
|
+
y !== void 0 && G.set(y, p.value);
|
|
1281
1281
|
}
|
|
1282
1282
|
const x = [];
|
|
1283
1283
|
k.forEach(({ id: p, fields: y }) => {
|
|
@@ -1290,10 +1290,10 @@ class We {
|
|
|
1290
1290
|
});
|
|
1291
1291
|
for (const [p, y] of x) {
|
|
1292
1292
|
const g = await y;
|
|
1293
|
-
p.value = g.data,
|
|
1293
|
+
p.value = g.data, _t(g.error) ? p.status = "Error" : g.resourceReady || _t(g.originalResourceId) ? p.status = "Ready" : p.status = "NotReady";
|
|
1294
1294
|
}
|
|
1295
1295
|
const X = /* @__PURE__ */ new Map();
|
|
1296
|
-
k.forEach(({ id: p, fields: y }) => X.set(p, new
|
|
1296
|
+
k.forEach(({ id: p, fields: y }) => X.set(p, new er(p, y)));
|
|
1297
1297
|
const he = /* @__PURE__ */ new Set();
|
|
1298
1298
|
for (const p of te(I)) {
|
|
1299
1299
|
if (!X.has(p.id))
|
|
@@ -1316,7 +1316,7 @@ class We {
|
|
|
1316
1316
|
oe,
|
|
1317
1317
|
K,
|
|
1318
1318
|
X,
|
|
1319
|
-
|
|
1319
|
+
G,
|
|
1320
1320
|
z
|
|
1321
1321
|
);
|
|
1322
1322
|
return v.fixProblems(), v;
|
|
@@ -1326,12 +1326,12 @@ async function sn(s, e = yo) {
|
|
|
1326
1326
|
const t = s.createEphemeral(wo);
|
|
1327
1327
|
s.lock(t);
|
|
1328
1328
|
const r = String(Date.now());
|
|
1329
|
-
s.setKValue(t,
|
|
1329
|
+
s.setKValue(t, Jr, JSON.stringify(Gr)), s.setKValue(t, $t, r), s.setKValue(t, Te, r), s.setKValue(t, Ae, JSON.stringify(e)), s.setKValue(t, de, JSON.stringify(mo)), s.setKValue(t, Ke, JSON.stringify(vo));
|
|
1330
1330
|
const o = await Zr();
|
|
1331
1331
|
return s.createField(
|
|
1332
|
-
j(t,
|
|
1332
|
+
j(t, wt(o.hash)),
|
|
1333
1333
|
"Dynamic",
|
|
1334
|
-
T.wrapInHolder(s,
|
|
1334
|
+
T.wrapInHolder(s, It(s, o.spec))
|
|
1335
1335
|
), t;
|
|
1336
1336
|
}
|
|
1337
1337
|
async function nt(s, e, t) {
|
|
@@ -1360,10 +1360,10 @@ function* on(s) {
|
|
|
1360
1360
|
yield e, yield t;
|
|
1361
1361
|
return;
|
|
1362
1362
|
default:
|
|
1363
|
-
|
|
1363
|
+
J(s);
|
|
1364
1364
|
}
|
|
1365
1365
|
}
|
|
1366
|
-
function
|
|
1366
|
+
function tr(s, e) {
|
|
1367
1367
|
return Object.fromEntries(
|
|
1368
1368
|
Object.entries(s).map(([t, r]) => [t, e(r, t)])
|
|
1369
1369
|
);
|
|
@@ -1373,26 +1373,26 @@ function nn(s, e) {
|
|
|
1373
1373
|
case "Json":
|
|
1374
1374
|
return { ...s };
|
|
1375
1375
|
case "JsonPartitioned":
|
|
1376
|
-
return { ...s, parts:
|
|
1376
|
+
return { ...s, parts: tr(s.parts, e) };
|
|
1377
1377
|
case "BinaryPartitioned":
|
|
1378
1378
|
return {
|
|
1379
1379
|
...s,
|
|
1380
|
-
parts:
|
|
1380
|
+
parts: tr(s.parts, (t) => ({
|
|
1381
1381
|
index: e(t.index),
|
|
1382
1382
|
values: e(t.values)
|
|
1383
1383
|
}))
|
|
1384
1384
|
};
|
|
1385
1385
|
default:
|
|
1386
|
-
|
|
1386
|
+
J(s);
|
|
1387
1387
|
}
|
|
1388
1388
|
}
|
|
1389
|
-
const an =
|
|
1389
|
+
const an = Le("PColumnData/JsonPartitioned", "1"), cn = Le(
|
|
1390
1390
|
"PColumnData/Partitioned/JsonPartitioned",
|
|
1391
1391
|
"1"
|
|
1392
|
-
), ln =
|
|
1392
|
+
), ln = Le("PColumnData/BinaryPartitioned", "1"), un = Le(
|
|
1393
1393
|
"PColumnData/Partitioned/BinaryPartitioned",
|
|
1394
1394
|
"1"
|
|
1395
|
-
), dn =
|
|
1395
|
+
), dn = Le("PColumnData/Json", "1");
|
|
1396
1396
|
function pn(s) {
|
|
1397
1397
|
if (!s.getIsReadyOrError()) throw new Error("Data not ready.");
|
|
1398
1398
|
const e = s.getDataAsJson();
|
|
@@ -1494,14 +1494,14 @@ function hn(s, e) {
|
|
|
1494
1494
|
};
|
|
1495
1495
|
}
|
|
1496
1496
|
function fn(s, e) {
|
|
1497
|
-
const t =
|
|
1498
|
-
return t.update(
|
|
1497
|
+
const t = Ne("sha256");
|
|
1498
|
+
return t.update(ye(s)), t.update(String(_e(e.originalId) ? e.id : e.originalId)), t.digest().toString("hex");
|
|
1499
1499
|
}
|
|
1500
|
-
function
|
|
1501
|
-
return
|
|
1500
|
+
function rr(s, e) {
|
|
1501
|
+
return ye({ __isRef: !0, blockId: s, name: e });
|
|
1502
1502
|
}
|
|
1503
1503
|
function gn(s, e) {
|
|
1504
|
-
return
|
|
1504
|
+
return ye({ resolvePath: s, name: e });
|
|
1505
1505
|
}
|
|
1506
1506
|
function Qr(s, e = !0, t = !1, r = "") {
|
|
1507
1507
|
var c, a, l;
|
|
@@ -1562,7 +1562,7 @@ function mn(s, e = !0, t = "", r) {
|
|
|
1562
1562
|
}
|
|
1563
1563
|
return n;
|
|
1564
1564
|
}
|
|
1565
|
-
class
|
|
1565
|
+
class Ft {
|
|
1566
1566
|
constructor(e, t) {
|
|
1567
1567
|
S(this, "allSpecsAvailable");
|
|
1568
1568
|
this.ctx = e, this.blocks = t;
|
|
@@ -1596,8 +1596,8 @@ class It {
|
|
|
1596
1596
|
if (r === void 0) return;
|
|
1597
1597
|
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);
|
|
1598
1598
|
if (o !== void 0 && o.spec !== void 0 && n !== void 0)
|
|
1599
|
-
return
|
|
1600
|
-
id:
|
|
1599
|
+
return Fr(n, (l) => ({
|
|
1600
|
+
id: rr(e, t),
|
|
1601
1601
|
spec: o.spec,
|
|
1602
1602
|
data: l
|
|
1603
1603
|
}));
|
|
@@ -1634,9 +1634,9 @@ class It {
|
|
|
1634
1634
|
if (a.spec !== void 0 && a.hasData === !0 && a.data !== void 0) {
|
|
1635
1635
|
const l = a.data();
|
|
1636
1636
|
l !== void 0 ? e.push({
|
|
1637
|
-
ref:
|
|
1637
|
+
ref: je(i, c),
|
|
1638
1638
|
obj: {
|
|
1639
|
-
id: l.ok ?
|
|
1639
|
+
id: l.ok ? rr(i, c) : void 0,
|
|
1640
1640
|
spec: a.spec,
|
|
1641
1641
|
data: l
|
|
1642
1642
|
}
|
|
@@ -1670,7 +1670,7 @@ class It {
|
|
|
1670
1670
|
i.staging.locked || o(`staging_not_locked:${n}`);
|
|
1671
1671
|
for (const [a, l] of i.staging.results)
|
|
1672
1672
|
l.spec !== void 0 && (e.push({
|
|
1673
|
-
ref:
|
|
1673
|
+
ref: je(n, a),
|
|
1674
1674
|
obj: l.spec
|
|
1675
1675
|
}), c.add(a));
|
|
1676
1676
|
} else o(`staging_not_rendered:${n}`);
|
|
@@ -1678,7 +1678,7 @@ class It {
|
|
|
1678
1678
|
i.prod.locked || o(`prod_not_locked:${n}`);
|
|
1679
1679
|
for (const [a, l] of i.prod.results)
|
|
1680
1680
|
c.has(a) || l.spec !== void 0 && e.push({
|
|
1681
|
-
ref:
|
|
1681
|
+
ref: je(n, a),
|
|
1682
1682
|
obj: l.spec
|
|
1683
1683
|
});
|
|
1684
1684
|
}
|
|
@@ -1692,7 +1692,7 @@ class It {
|
|
|
1692
1692
|
for (const [c, a] of i.results)
|
|
1693
1693
|
o.has(c) || a.spec === void 0 || (o.add(c), Ss(e, a.spec) && t.push({
|
|
1694
1694
|
label: r.info.label + " / " + c,
|
|
1695
|
-
ref:
|
|
1695
|
+
ref: je(r.info.id, c),
|
|
1696
1696
|
spec: a.spec
|
|
1697
1697
|
}));
|
|
1698
1698
|
};
|
|
@@ -1701,10 +1701,10 @@ class It {
|
|
|
1701
1701
|
return t;
|
|
1702
1702
|
}
|
|
1703
1703
|
static create(e, t, r) {
|
|
1704
|
-
const o = e.accessor(t).node(), n = B(o.getKeyValueAsJson(de)), c =
|
|
1704
|
+
const o = e.accessor(t).node(), n = B(o.getKeyValueAsJson(de)), c = bt(n).traverseIds("upstream", r), a = /* @__PURE__ */ new Map();
|
|
1705
1705
|
for (const l of te(n)) {
|
|
1706
1706
|
if (!c.has(l.id)) continue;
|
|
1707
|
-
const u =
|
|
1707
|
+
const u = sr(
|
|
1708
1708
|
o.traverse({
|
|
1709
1709
|
field: U(l.id, "prodCtx"),
|
|
1710
1710
|
ignoreError: !0,
|
|
@@ -1715,7 +1715,7 @@ class It {
|
|
|
1715
1715
|
field: U(l.id, "prodUiCtx"),
|
|
1716
1716
|
stableIfNotFound: !0
|
|
1717
1717
|
})
|
|
1718
|
-
), d =
|
|
1718
|
+
), d = sr(
|
|
1719
1719
|
o.traverse({
|
|
1720
1720
|
field: U(l.id, "stagingCtx"),
|
|
1721
1721
|
ignoreError: !0,
|
|
@@ -1727,15 +1727,15 @@ class It {
|
|
|
1727
1727
|
);
|
|
1728
1728
|
a.set(l.id, { info: l, prod: u, staging: d });
|
|
1729
1729
|
}
|
|
1730
|
-
return new
|
|
1730
|
+
return new Ft(e, a);
|
|
1731
1731
|
}
|
|
1732
1732
|
}
|
|
1733
|
-
function
|
|
1733
|
+
function sr(s, e) {
|
|
1734
1734
|
if (e === void 0)
|
|
1735
1735
|
return s ? { locked: !1, results: /* @__PURE__ */ new Map() } : void 0;
|
|
1736
1736
|
if (e.ok) return Qr(e.value, !1, !0);
|
|
1737
1737
|
}
|
|
1738
|
-
function
|
|
1738
|
+
function Tt(s, e) {
|
|
1739
1739
|
return {
|
|
1740
1740
|
blockId: e,
|
|
1741
1741
|
args: (o) => B(
|
|
@@ -1744,7 +1744,7 @@ function Ft(s, e) {
|
|
|
1744
1744
|
errorIfFieldNotSet: !0
|
|
1745
1745
|
}).getDataAsString()
|
|
1746
1746
|
),
|
|
1747
|
-
uiState: (o) => o.accessor(s).node().getKeyValueAsString(
|
|
1747
|
+
uiState: (o) => o.accessor(s).node().getKeyValueAsString(mt(e)),
|
|
1748
1748
|
blockMeta: (o) => {
|
|
1749
1749
|
const n = o.accessor(s).node(), i = B(n.getKeyValueAsJson(de)), c = /* @__PURE__ */ new Map();
|
|
1750
1750
|
for (const a of te(i)) c.set(a.id, a);
|
|
@@ -1754,7 +1754,7 @@ function Ft(s, e) {
|
|
|
1754
1754
|
}
|
|
1755
1755
|
function es(s, e) {
|
|
1756
1756
|
return {
|
|
1757
|
-
...
|
|
1757
|
+
...Tt(s, e),
|
|
1758
1758
|
prod: (t) => {
|
|
1759
1759
|
var r;
|
|
1760
1760
|
return (r = t.accessor(s).node({ ignoreError: !0 }).traverse({
|
|
@@ -1771,7 +1771,7 @@ function es(s, e) {
|
|
|
1771
1771
|
})) == null ? void 0 : o.persist();
|
|
1772
1772
|
return r === void 0 && t.markUnstable("staging_not_rendered"), r;
|
|
1773
1773
|
},
|
|
1774
|
-
getResultsPool: (t) =>
|
|
1774
|
+
getResultsPool: (t) => Ft.create(t, s, e)
|
|
1775
1775
|
};
|
|
1776
1776
|
}
|
|
1777
1777
|
function* W(s, e) {
|
|
@@ -1821,7 +1821,7 @@ function* W(s, e) {
|
|
|
1821
1821
|
yield* W(s.operand1), yield* W(s.operand2);
|
|
1822
1822
|
return;
|
|
1823
1823
|
default:
|
|
1824
|
-
|
|
1824
|
+
J(s);
|
|
1825
1825
|
}
|
|
1826
1826
|
}
|
|
1827
1827
|
function vn(s, e) {
|
|
@@ -1829,7 +1829,7 @@ function vn(s, e) {
|
|
|
1829
1829
|
for (const [r, o] of Object.entries(s)) t[r] = e(o);
|
|
1830
1830
|
return t;
|
|
1831
1831
|
}
|
|
1832
|
-
function
|
|
1832
|
+
function Oe(s, e) {
|
|
1833
1833
|
return s === void 0 ? void 0 : e(s);
|
|
1834
1834
|
}
|
|
1835
1835
|
function yn(s) {
|
|
@@ -2017,13 +2017,13 @@ const Ln = (s) => C(s), Nn = (s) => {
|
|
|
2017
2017
|
type: "ScheduleComputable",
|
|
2018
2018
|
computable: r.logDriver.getLastLogs(t, s)
|
|
2019
2019
|
});
|
|
2020
|
-
},
|
|
2020
|
+
}, Jn = (s) => (e) => {
|
|
2021
2021
|
const t = e.source;
|
|
2022
2022
|
return t === void 0 ? C(void 0) : ({ drivers: r }) => ({
|
|
2023
2023
|
type: "ScheduleComputable",
|
|
2024
2024
|
computable: r.logDriver.getProgressLog(t, s)
|
|
2025
2025
|
});
|
|
2026
|
-
},
|
|
2026
|
+
}, Gn = (s) => {
|
|
2027
2027
|
const e = s.source;
|
|
2028
2028
|
return e === void 0 ? C(void 0) : ({ drivers: t }) => ({
|
|
2029
2029
|
type: "ScheduleComputable",
|
|
@@ -2205,7 +2205,7 @@ function O(s, e) {
|
|
|
2205
2205
|
case "GetProgressLog":
|
|
2206
2206
|
return () => ({
|
|
2207
2207
|
type: "ScheduleSubroutine",
|
|
2208
|
-
subroutine:
|
|
2208
|
+
subroutine: Jn(e.patternToSearch),
|
|
2209
2209
|
args: {
|
|
2210
2210
|
source: O(s, e.source)
|
|
2211
2211
|
}
|
|
@@ -2213,13 +2213,13 @@ function O(s, e) {
|
|
|
2213
2213
|
case "GetLogHandle":
|
|
2214
2214
|
return () => ({
|
|
2215
2215
|
type: "ScheduleSubroutine",
|
|
2216
|
-
subroutine:
|
|
2216
|
+
subroutine: Gn,
|
|
2217
2217
|
args: {
|
|
2218
2218
|
source: O(s, e.source)
|
|
2219
2219
|
}
|
|
2220
2220
|
});
|
|
2221
2221
|
default:
|
|
2222
|
-
return
|
|
2222
|
+
return J(e);
|
|
2223
2223
|
}
|
|
2224
2224
|
}
|
|
2225
2225
|
const Mn = ["$prod", "$staging"];
|
|
@@ -2242,7 +2242,7 @@ function Hn(s) {
|
|
|
2242
2242
|
function Wn() {
|
|
2243
2243
|
return { pendingSubroutines: /* @__PURE__ */ new Map() };
|
|
2244
2244
|
}
|
|
2245
|
-
function
|
|
2245
|
+
function or(s, e, t, r) {
|
|
2246
2246
|
const o = new jr(t), n = (c, a) => {
|
|
2247
2247
|
if (Hn(c))
|
|
2248
2248
|
return e.result = a, !1;
|
|
@@ -2289,7 +2289,7 @@ function sr(s, e, t, r) {
|
|
|
2289
2289
|
});
|
|
2290
2290
|
break;
|
|
2291
2291
|
default:
|
|
2292
|
-
|
|
2292
|
+
J(a);
|
|
2293
2293
|
}
|
|
2294
2294
|
}
|
|
2295
2295
|
return i;
|
|
@@ -2298,7 +2298,7 @@ function zn(s, e, t, r = {}) {
|
|
|
2298
2298
|
return ns(s, _n(e), t, r);
|
|
2299
2299
|
}
|
|
2300
2300
|
function ns(s, e, t, r = {}) {
|
|
2301
|
-
const o = `${e.blockId}#` +
|
|
2301
|
+
const o = `${e.blockId}#` + ye({
|
|
2302
2302
|
ctx: Object.fromEntries(
|
|
2303
2303
|
Object.entries(e).filter(([n]) => Mn.indexOf(n) === -1)
|
|
2304
2304
|
),
|
|
@@ -2308,7 +2308,7 @@ function ns(s, e, t, r = {}) {
|
|
|
2308
2308
|
(n) => {
|
|
2309
2309
|
const i = { drivers: s, cCtx: n }, c = Wn();
|
|
2310
2310
|
return {
|
|
2311
|
-
ir:
|
|
2311
|
+
ir: or(
|
|
2312
2312
|
i,
|
|
2313
2313
|
c,
|
|
2314
2314
|
[
|
|
@@ -2335,7 +2335,7 @@ function ns(s, e, t, r = {}) {
|
|
|
2335
2335
|
result: c.result,
|
|
2336
2336
|
pendingSubroutines: m
|
|
2337
2337
|
};
|
|
2338
|
-
if (
|
|
2338
|
+
if (or(d, h, u, !1), !("result" in h))
|
|
2339
2339
|
throw new Error("illegal cfg rendering stack state, no result");
|
|
2340
2340
|
return h.result;
|
|
2341
2341
|
}
|
|
@@ -2347,7 +2347,7 @@ function ns(s, e, t, r = {}) {
|
|
|
2347
2347
|
function Xn(s) {
|
|
2348
2348
|
return s instanceof ArrayBuffer || ArrayBuffer.isView(s);
|
|
2349
2349
|
}
|
|
2350
|
-
function
|
|
2350
|
+
function nr(s) {
|
|
2351
2351
|
return s !== void 0 ? Buffer.from(s).toString("base64") : void 0;
|
|
2352
2352
|
}
|
|
2353
2353
|
class ze {
|
|
@@ -2387,7 +2387,7 @@ class ze {
|
|
|
2387
2387
|
}
|
|
2388
2388
|
runCallback(e, ...t) {
|
|
2389
2389
|
try {
|
|
2390
|
-
return
|
|
2390
|
+
return gt.withScope((r) => {
|
|
2391
2391
|
const o = r.manage(this.vm.getProp(this.callbackRegistry, e));
|
|
2392
2392
|
if (this.vm.typeof(o) !== "function")
|
|
2393
2393
|
throw new Error(`No such callback: ${e}`);
|
|
@@ -2457,13 +2457,13 @@ class ze {
|
|
|
2457
2457
|
return this.getAccessor(e).listDynamicFields();
|
|
2458
2458
|
}
|
|
2459
2459
|
getKeyValueBase64(e, t) {
|
|
2460
|
-
return
|
|
2460
|
+
return nr(this.getAccessor(e).getKeyValue(t));
|
|
2461
2461
|
}
|
|
2462
2462
|
getKeyValueAsString(e, t) {
|
|
2463
2463
|
return this.getAccessor(e).getKeyValueAsString(t);
|
|
2464
2464
|
}
|
|
2465
2465
|
getDataBase64(e) {
|
|
2466
|
-
return
|
|
2466
|
+
return nr(this.getAccessor(e).getData());
|
|
2467
2467
|
}
|
|
2468
2468
|
getDataAsString(e) {
|
|
2469
2469
|
return this.getAccessor(e).getDataAsString();
|
|
@@ -2483,7 +2483,7 @@ class ze {
|
|
|
2483
2483
|
// Blobs
|
|
2484
2484
|
//
|
|
2485
2485
|
registerComputable(e, t) {
|
|
2486
|
-
const r = `${e}_${
|
|
2486
|
+
const r = `${e}_${Fe()}`;
|
|
2487
2487
|
return this.computablesToResolve[r] = t, r;
|
|
2488
2488
|
}
|
|
2489
2489
|
getBlobContentAsString(e) {
|
|
@@ -2605,7 +2605,7 @@ class ze {
|
|
|
2605
2605
|
obj: {
|
|
2606
2606
|
id: t.obj.id,
|
|
2607
2607
|
spec: t.obj.spec,
|
|
2608
|
-
data:
|
|
2608
|
+
data: Fr(t.obj.data, (r) => this.wrapAccessor(r))
|
|
2609
2609
|
}
|
|
2610
2610
|
}))
|
|
2611
2611
|
};
|
|
@@ -2645,7 +2645,7 @@ class ze {
|
|
|
2645
2645
|
"can't instantiate PTable from this context (most porbably called from the future mapper)"
|
|
2646
2646
|
);
|
|
2647
2647
|
return this.env.driverKit.pFrameDriver.createPTable(
|
|
2648
|
-
|
|
2648
|
+
pt(e, (t) => le(
|
|
2649
2649
|
t,
|
|
2650
2650
|
(r) => typeof r == "string" ? this.getAccessor(r) : r
|
|
2651
2651
|
)),
|
|
@@ -2669,7 +2669,7 @@ class ze {
|
|
|
2669
2669
|
}
|
|
2670
2670
|
wrapAccessor(e) {
|
|
2671
2671
|
if (e !== void 0) {
|
|
2672
|
-
const t =
|
|
2672
|
+
const t = Fe();
|
|
2673
2673
|
return this.accessors.set(t, e), t;
|
|
2674
2674
|
}
|
|
2675
2675
|
}
|
|
@@ -2737,7 +2737,7 @@ class ze {
|
|
|
2737
2737
|
return JSON.parse(t);
|
|
2738
2738
|
}
|
|
2739
2739
|
injectCtx() {
|
|
2740
|
-
|
|
2740
|
+
gt.withScope((e) => {
|
|
2741
2741
|
const t = e.manage(this.vm.newObject()), r = this.blockCtx.args(this.computableCtx), o = this.blockCtx.uiState(this.computableCtx);
|
|
2742
2742
|
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(
|
|
2743
2743
|
t,
|
|
@@ -2821,7 +2821,7 @@ class ze {
|
|
|
2821
2821
|
}
|
|
2822
2822
|
}
|
|
2823
2823
|
function qe(s, e) {
|
|
2824
|
-
return
|
|
2824
|
+
return Oe(
|
|
2825
2825
|
s.traverse(
|
|
2826
2826
|
{
|
|
2827
2827
|
field: U(e, "blockPack"),
|
|
@@ -2836,11 +2836,11 @@ function qe(s, e) {
|
|
|
2836
2836
|
}
|
|
2837
2837
|
);
|
|
2838
2838
|
}
|
|
2839
|
-
const
|
|
2839
|
+
const xe = process.env.MI_LOG_OUTPUT_STATUS;
|
|
2840
2840
|
function qn(s, e, t, r, o, n = {}) {
|
|
2841
2841
|
const i = `${e.blockId}#lambda#${o}#${t.handle}`;
|
|
2842
2842
|
return n = { ...n, key: i }, n.mode === void 0 && t.retentive === !0 && (n.mode = "StableOnlyRetentive"), V.makeRaw((c) => {
|
|
2843
|
-
const a = new
|
|
2843
|
+
const a = new gt();
|
|
2844
2844
|
c.addOnDestroy(() => a.dispose());
|
|
2845
2845
|
const l = a.manage(s.quickJs.newRuntime());
|
|
2846
2846
|
l.setMemoryLimit(1024 * 640), l.setMaxStackSize(1024 * 320);
|
|
@@ -2849,12 +2849,12 @@ function qn(s, e, t, r, o, n = {}) {
|
|
|
2849
2849
|
const m = d.runCallback(t.handle);
|
|
2850
2850
|
d.resetComputableCtx();
|
|
2851
2851
|
let h = 0;
|
|
2852
|
-
return
|
|
2852
|
+
return xe && xe !== "unstable-only" && console.log(`Output ${t.handle} scaffold calculated.`), {
|
|
2853
2853
|
ir: d.computablesToResolve,
|
|
2854
2854
|
postprocessValue: async (f, { unstableMarker: I, stable: F }) => {
|
|
2855
2855
|
for (const [_, k] of Object.entries(f)) d.runCallback(_, k);
|
|
2856
2856
|
const D = d.importObjectUniversal(m);
|
|
2857
|
-
return h++,
|
|
2857
|
+
return h++, xe && (xe !== "unstable-only" || !F) && console.log(
|
|
2858
2858
|
F ? `Stable output ${t.handle} calculated ${D !== void 0 ? "defined" : "undefined"}; (#${h})` : `Unstable output ${t.handle}; marker = ${I}; ${D !== void 0 ? "defined" : "undefined"} (#${h})`
|
|
2859
2859
|
), D;
|
|
2860
2860
|
}
|
|
@@ -2864,7 +2864,7 @@ function qn(s, e, t, r, o, n = {}) {
|
|
|
2864
2864
|
function Yn(s) {
|
|
2865
2865
|
return Ar(s) ? s.isActive === !0 : wn(s);
|
|
2866
2866
|
}
|
|
2867
|
-
function
|
|
2867
|
+
function $e(s, e, t, r, o, n = {}) {
|
|
2868
2868
|
if (Ar(t)) {
|
|
2869
2869
|
if (r === void 0) throw new Error("No code bundle.");
|
|
2870
2870
|
return qn(s, e, t, r, o, n);
|
|
@@ -2874,7 +2874,7 @@ function Zn(s, e, t) {
|
|
|
2874
2874
|
return V.make(
|
|
2875
2875
|
(r) => {
|
|
2876
2876
|
var f, I, F, D, _, k, se, pe;
|
|
2877
|
-
const o = r.accessor(s).node(), n = B(o.getKeyValueAsJson(
|
|
2877
|
+
const o = r.accessor(s).node(), n = B(o.getKeyValueAsJson($t)), i = B(o.getKeyValueAsJson(Te)), c = B(o.getKeyValueAsJson(Ae)), a = B(o.getKeyValueAsJson(de)), l = B(
|
|
2878
2878
|
o.getKeyValueAsJson(Ke)
|
|
2879
2879
|
), u = /* @__PURE__ */ new Map();
|
|
2880
2880
|
for (const { id: A } of te(a)) {
|
|
@@ -2890,7 +2890,7 @@ function Zn(s, e, t) {
|
|
|
2890
2890
|
stableIfNotFound: !0
|
|
2891
2891
|
});
|
|
2892
2892
|
if (K !== void 0) {
|
|
2893
|
-
const
|
|
2893
|
+
const G = o.getField({
|
|
2894
2894
|
field: U(A, "prodOutput"),
|
|
2895
2895
|
assertFieldType: "Dynamic",
|
|
2896
2896
|
errorIfFieldNotFound: !0
|
|
@@ -2902,32 +2902,32 @@ function Zn(s, e, t) {
|
|
|
2902
2902
|
oe = {
|
|
2903
2903
|
arguments: K.getDataAsJson(),
|
|
2904
2904
|
stale: z.id !== K.id,
|
|
2905
|
-
outputError:
|
|
2906
|
-
outputsError: ((F =
|
|
2905
|
+
outputError: G.error !== void 0 || x.error !== void 0 || ((f = G.value) == null ? void 0 : f.getError()) !== void 0 || ((I = x.value) == null ? void 0 : I.getError()) !== void 0,
|
|
2906
|
+
outputsError: ((F = G.error) == null ? void 0 : F.getDataAsString()) ?? ((_ = (D = G.value) == null ? void 0 : D.getError()) == null ? void 0 : _.getDataAsString()),
|
|
2907
2907
|
exportsError: ((k = x.error) == null ? void 0 : k.getDataAsString()) ?? ((pe = (se = x.value) == null ? void 0 : se.getError()) == null ? void 0 : pe.getDataAsString()),
|
|
2908
|
-
finished: (
|
|
2908
|
+
finished: (G.value !== void 0 && G.value.getIsReadyOrError() || G.error !== void 0 && G.error.getIsReadyOrError()) && (x.value !== void 0 && x.value.getIsReadyOrError() || x.error !== void 0 && x.error.getIsReadyOrError())
|
|
2909
2909
|
};
|
|
2910
2910
|
}
|
|
2911
2911
|
u.set(A, { currentArguments: z.getDataAsJson(), prod: oe });
|
|
2912
2912
|
}
|
|
2913
2913
|
const d = Me(a, (A) => u.get(A).currentArguments), m = new Set(l.blocksInLimbo), h = [...te(a)].map(({ id: A, label: z, renderingMode: oe }) => {
|
|
2914
2914
|
var b, w, R, P, E;
|
|
2915
|
-
const K = B(u.get(A)),
|
|
2915
|
+
const K = B(u.get(A)), G = B(d.nodes.get(A));
|
|
2916
2916
|
let x = "NotCalculated";
|
|
2917
2917
|
K.prod !== void 0 && (m.has(A) ? x = "Limbo" : x = K.prod.finished ? "Done" : "Running");
|
|
2918
|
-
const X = qe(o, A), { sections: he, title: v, inputsValid: p, sdkVersion: y } =
|
|
2919
|
-
const re =
|
|
2918
|
+
const X = qe(o, A), { sections: he, title: v, inputsValid: p, sdkVersion: y } = Oe(X, ({ bpId: $, cfg: L, info: N }) => {
|
|
2919
|
+
const re = Tt(s, A);
|
|
2920
2920
|
return {
|
|
2921
|
-
sections:
|
|
2921
|
+
sections: $e(
|
|
2922
2922
|
t,
|
|
2923
2923
|
re,
|
|
2924
2924
|
L.sections,
|
|
2925
2925
|
L.code,
|
|
2926
2926
|
$
|
|
2927
2927
|
),
|
|
2928
|
-
title:
|
|
2928
|
+
title: Oe(
|
|
2929
2929
|
L.title,
|
|
2930
|
-
(vs) =>
|
|
2930
|
+
(vs) => $e(
|
|
2931
2931
|
t,
|
|
2932
2932
|
re,
|
|
2933
2933
|
vs,
|
|
@@ -2935,7 +2935,7 @@ function Zn(s, e, t) {
|
|
|
2935
2935
|
$
|
|
2936
2936
|
)
|
|
2937
2937
|
),
|
|
2938
|
-
inputsValid:
|
|
2938
|
+
inputsValid: $e(
|
|
2939
2939
|
t,
|
|
2940
2940
|
re,
|
|
2941
2941
|
L.inputsValid,
|
|
@@ -2944,7 +2944,7 @@ function Zn(s, e, t) {
|
|
|
2944
2944
|
),
|
|
2945
2945
|
sdkVersion: L.sdkVersion
|
|
2946
2946
|
};
|
|
2947
|
-
}) || {}, g =
|
|
2947
|
+
}) || {}, g = Oe(
|
|
2948
2948
|
X,
|
|
2949
2949
|
({ info: $ }) => t.blockUpdateWatcher.get($.source)
|
|
2950
2950
|
);
|
|
@@ -2954,7 +2954,7 @@ function Zn(s, e, t) {
|
|
|
2954
2954
|
title: v ?? z,
|
|
2955
2955
|
renderingMode: oe,
|
|
2956
2956
|
stale: ((b = K.prod) == null ? void 0 : b.stale) !== !1 || x === "Limbo",
|
|
2957
|
-
missingReference:
|
|
2957
|
+
missingReference: G.missingReferences,
|
|
2958
2958
|
upstreams: [...d.traverseIdsExcludingRoots("upstream", A)],
|
|
2959
2959
|
downstreams: [...d.traverseIdsExcludingRoots("downstream", A)],
|
|
2960
2960
|
calculationStatus: x,
|
|
@@ -2973,7 +2973,7 @@ function Zn(s, e, t) {
|
|
|
2973
2973
|
meta: c,
|
|
2974
2974
|
created: new Date(n),
|
|
2975
2975
|
lastModified: new Date(i),
|
|
2976
|
-
authorMarker: o.getKeyValueAsJson(
|
|
2976
|
+
authorMarker: o.getKeyValueAsJson(yt),
|
|
2977
2977
|
blocks: h
|
|
2978
2978
|
};
|
|
2979
2979
|
},
|
|
@@ -3049,9 +3049,9 @@ function is(s, e, t) {
|
|
|
3049
3049
|
return V.make((i) => is(s, e, i), {
|
|
3050
3050
|
key: `inputs#${Dr(s.rid)}#${e}`
|
|
3051
3051
|
});
|
|
3052
|
-
const r = t.accessor(s).node(), o =
|
|
3052
|
+
const r = t.accessor(s).node(), o = Tt(s, e), n = o.uiState(t);
|
|
3053
3053
|
return {
|
|
3054
|
-
author: r.getKeyValueAsJson(
|
|
3054
|
+
author: r.getKeyValueAsJson(vt(e)),
|
|
3055
3055
|
args: JSON.parse(o.args(t)),
|
|
3056
3056
|
ui: n !== void 0 ? JSON.parse(n) : void 0
|
|
3057
3057
|
};
|
|
@@ -3060,10 +3060,10 @@ function ri(s, e, t) {
|
|
|
3060
3060
|
return V.make(
|
|
3061
3061
|
(r) => {
|
|
3062
3062
|
const o = r.accessor(s).node(), n = es(s, e);
|
|
3063
|
-
return
|
|
3063
|
+
return Oe(qe(o, e), ({ cfg: i, bpId: c }) => {
|
|
3064
3064
|
const a = {};
|
|
3065
3065
|
for (const [l, u] of Object.entries(i.outputs)) {
|
|
3066
|
-
const d =
|
|
3066
|
+
const d = $e(t, n, u, i.code, c);
|
|
3067
3067
|
a[l] = V.wrapError(d);
|
|
3068
3068
|
}
|
|
3069
3069
|
return a;
|
|
@@ -3083,7 +3083,7 @@ function si(s, e) {
|
|
|
3083
3083
|
const u = es(r.persist(), i);
|
|
3084
3084
|
for (const d of l)
|
|
3085
3085
|
n.push(
|
|
3086
|
-
V.wrapError(
|
|
3086
|
+
V.wrapError($e(e, u, d, a.cfg.code, a.bpId))
|
|
3087
3087
|
);
|
|
3088
3088
|
}
|
|
3089
3089
|
return n;
|
|
@@ -3096,14 +3096,14 @@ class oi {
|
|
|
3096
3096
|
setState(e, t) {
|
|
3097
3097
|
const r = this.states.get(e);
|
|
3098
3098
|
if (r === void 0) {
|
|
3099
|
-
this.states.set(e, { state: t, change: new
|
|
3099
|
+
this.states.set(e, { state: t, change: new Ht() });
|
|
3100
3100
|
return;
|
|
3101
3101
|
}
|
|
3102
3102
|
r.state = { ...t }, r.change.markChanged();
|
|
3103
3103
|
}
|
|
3104
3104
|
readState(e, t) {
|
|
3105
3105
|
let r = this.states.get(t);
|
|
3106
|
-
return r === void 0 && (r = { state: { ...Rs }, change: new
|
|
3106
|
+
return r === void 0 && (r = { state: { ...Rs }, change: new Ht() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
|
|
3107
3107
|
}
|
|
3108
3108
|
getState(e) {
|
|
3109
3109
|
return V.make(
|
|
@@ -3116,7 +3116,7 @@ class oi {
|
|
|
3116
3116
|
t !== void 0 && (this.states.delete(e), t.change.markChanged());
|
|
3117
3117
|
}
|
|
3118
3118
|
}
|
|
3119
|
-
class
|
|
3119
|
+
class At {
|
|
3120
3120
|
constructor(e, t, r) {
|
|
3121
3121
|
/** Underlying pl resource id */
|
|
3122
3122
|
S(this, "rid");
|
|
@@ -3162,7 +3162,7 @@ class Tt {
|
|
|
3162
3162
|
*
|
|
3163
3163
|
* @return returns newly created block id
|
|
3164
3164
|
* */
|
|
3165
|
-
async addBlock(e, t, r, o = void 0, n =
|
|
3165
|
+
async addBlock(e, t, r, o = void 0, n = Fe()) {
|
|
3166
3166
|
const i = await this.env.bpPreparer.prepare(t), c = await this.env.bpPreparer.getBlockConfigContainer(t), a = Tr(c);
|
|
3167
3167
|
return await ee(
|
|
3168
3168
|
this.env.pl,
|
|
@@ -3306,9 +3306,9 @@ class Tt {
|
|
|
3306
3306
|
/** Resets arguments and ui state of the block to initial state */
|
|
3307
3307
|
async resetBlockArgsAndUiState(e, t) {
|
|
3308
3308
|
await this.env.pl.withWriteTx("BlockInputsReset", async (r) => {
|
|
3309
|
-
const o =
|
|
3309
|
+
const o = ft(
|
|
3310
3310
|
(await r.getField(j(this.rid, U(e, "blockPack")))).value
|
|
3311
|
-
), n =
|
|
3311
|
+
), n = ft(
|
|
3312
3312
|
(await r.getField(j(o, T.HolderRefField))).value
|
|
3313
3313
|
), i = await r.getResourceData(n, !1), c = JSON.parse(
|
|
3314
3314
|
Buffer.from(B(i.data)).toString("utf-8")
|
|
@@ -3384,7 +3384,7 @@ class Tt {
|
|
|
3384
3384
|
},
|
|
3385
3385
|
e.logger
|
|
3386
3386
|
);
|
|
3387
|
-
return new
|
|
3387
|
+
return new At(e, t, r);
|
|
3388
3388
|
}
|
|
3389
3389
|
}
|
|
3390
3390
|
function ni(s) {
|
|
@@ -3442,7 +3442,7 @@ function ai(s) {
|
|
|
3442
3442
|
function ci(s) {
|
|
3443
3443
|
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
3444
3444
|
}
|
|
3445
|
-
var
|
|
3445
|
+
var Et = { exports: {} };
|
|
3446
3446
|
const li = "2.0.0", ls = 256, ui = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
3447
3447
|
9007199254740991, di = 16, pi = ls - 6, hi = [
|
|
3448
3448
|
"major",
|
|
@@ -3488,19 +3488,19 @@ var Ze = fi;
|
|
|
3488
3488
|
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);
|
|
3489
3489
|
};
|
|
3490
3490
|
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*$");
|
|
3491
|
-
})(
|
|
3492
|
-
var
|
|
3491
|
+
})(Et, Et.exports);
|
|
3492
|
+
var De = Et.exports;
|
|
3493
3493
|
const gi = Object.freeze({ loose: !0 }), mi = Object.freeze({}), vi = (s) => s ? typeof s != "object" ? gi : s : mi;
|
|
3494
|
-
var
|
|
3495
|
-
const
|
|
3496
|
-
const t =
|
|
3494
|
+
var Lt = vi;
|
|
3495
|
+
const ir = /^[0-9]+$/, us = (s, e) => {
|
|
3496
|
+
const t = ir.test(s), r = ir.test(e);
|
|
3497
3497
|
return t && r && (s = +s, e = +e), s === e ? 0 : t && !r ? -1 : r && !t ? 1 : s < e ? -1 : 1;
|
|
3498
3498
|
}, yi = (s, e) => us(e, s);
|
|
3499
3499
|
var ds = {
|
|
3500
3500
|
compareIdentifiers: us,
|
|
3501
3501
|
rcompareIdentifiers: yi
|
|
3502
3502
|
};
|
|
3503
|
-
const
|
|
3503
|
+
const Ve = Ze, { MAX_LENGTH: ar, MAX_SAFE_INTEGER: Ue } = Ye, { safeRe: cr, t: lr } = De, wi = Lt, { compareIdentifiers: fe } = ds;
|
|
3504
3504
|
let Si = class Q {
|
|
3505
3505
|
constructor(e, t) {
|
|
3506
3506
|
if (t = wi(t), e instanceof Q) {
|
|
@@ -3509,24 +3509,24 @@ let Si = class Q {
|
|
|
3509
3509
|
e = e.version;
|
|
3510
3510
|
} else if (typeof e != "string")
|
|
3511
3511
|
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
|
|
3512
|
-
if (e.length >
|
|
3512
|
+
if (e.length > ar)
|
|
3513
3513
|
throw new TypeError(
|
|
3514
|
-
`version is longer than ${
|
|
3514
|
+
`version is longer than ${ar} characters`
|
|
3515
3515
|
);
|
|
3516
|
-
|
|
3517
|
-
const r = e.trim().match(t.loose ?
|
|
3516
|
+
Ve("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
|
|
3517
|
+
const r = e.trim().match(t.loose ? cr[lr.LOOSE] : cr[lr.FULL]);
|
|
3518
3518
|
if (!r)
|
|
3519
3519
|
throw new TypeError(`Invalid Version: ${e}`);
|
|
3520
|
-
if (this.raw = e, this.major = +r[1], this.minor = +r[2], this.patch = +r[3], this.major >
|
|
3520
|
+
if (this.raw = e, this.major = +r[1], this.minor = +r[2], this.patch = +r[3], this.major > Ue || this.major < 0)
|
|
3521
3521
|
throw new TypeError("Invalid major version");
|
|
3522
|
-
if (this.minor >
|
|
3522
|
+
if (this.minor > Ue || this.minor < 0)
|
|
3523
3523
|
throw new TypeError("Invalid minor version");
|
|
3524
|
-
if (this.patch >
|
|
3524
|
+
if (this.patch > Ue || this.patch < 0)
|
|
3525
3525
|
throw new TypeError("Invalid patch version");
|
|
3526
3526
|
r[4] ? this.prerelease = r[4].split(".").map((o) => {
|
|
3527
3527
|
if (/^[0-9]+$/.test(o)) {
|
|
3528
3528
|
const n = +o;
|
|
3529
|
-
if (n >= 0 && n <
|
|
3529
|
+
if (n >= 0 && n < Ue)
|
|
3530
3530
|
return n;
|
|
3531
3531
|
}
|
|
3532
3532
|
return o;
|
|
@@ -3539,7 +3539,7 @@ let Si = class Q {
|
|
|
3539
3539
|
return this.version;
|
|
3540
3540
|
}
|
|
3541
3541
|
compare(e) {
|
|
3542
|
-
if (
|
|
3542
|
+
if (Ve("SemVer.compare", this.version, this.options, e), !(e instanceof Q)) {
|
|
3543
3543
|
if (typeof e == "string" && e === this.version)
|
|
3544
3544
|
return 0;
|
|
3545
3545
|
e = new Q(e, this.options);
|
|
@@ -3559,7 +3559,7 @@ let Si = class Q {
|
|
|
3559
3559
|
let t = 0;
|
|
3560
3560
|
do {
|
|
3561
3561
|
const r = this.prerelease[t], o = e.prerelease[t];
|
|
3562
|
-
if (
|
|
3562
|
+
if (Ve("prerelease compare", t, r, o), r === void 0 && o === void 0)
|
|
3563
3563
|
return 0;
|
|
3564
3564
|
if (o === void 0)
|
|
3565
3565
|
return 1;
|
|
@@ -3575,7 +3575,7 @@ let Si = class Q {
|
|
|
3575
3575
|
let t = 0;
|
|
3576
3576
|
do {
|
|
3577
3577
|
const r = this.build[t], o = e.build[t];
|
|
3578
|
-
if (
|
|
3578
|
+
if (Ve("build compare", t, r, o), r === void 0 && o === void 0)
|
|
3579
3579
|
return 0;
|
|
3580
3580
|
if (o === void 0)
|
|
3581
3581
|
return 1;
|
|
@@ -3640,33 +3640,33 @@ let Si = class Q {
|
|
|
3640
3640
|
}
|
|
3641
3641
|
};
|
|
3642
3642
|
var M = Si;
|
|
3643
|
-
const
|
|
3644
|
-
if (s instanceof
|
|
3643
|
+
const ur = M, bi = (s, e, t = !1) => {
|
|
3644
|
+
if (s instanceof ur)
|
|
3645
3645
|
return s;
|
|
3646
3646
|
try {
|
|
3647
|
-
return new
|
|
3647
|
+
return new ur(s, e);
|
|
3648
3648
|
} catch (r) {
|
|
3649
3649
|
if (!t)
|
|
3650
3650
|
return null;
|
|
3651
3651
|
throw r;
|
|
3652
3652
|
}
|
|
3653
3653
|
};
|
|
3654
|
-
var
|
|
3655
|
-
const Ri =
|
|
3654
|
+
var we = bi;
|
|
3655
|
+
const Ri = we, Ei = (s, e) => {
|
|
3656
3656
|
const t = Ri(s, e);
|
|
3657
3657
|
return t ? t.version : null;
|
|
3658
3658
|
};
|
|
3659
3659
|
var Ci = Ei;
|
|
3660
|
-
const ki =
|
|
3660
|
+
const ki = we, Pi = (s, e) => {
|
|
3661
3661
|
const t = ki(s.trim().replace(/^[=v]+/, ""), e);
|
|
3662
3662
|
return t ? t.version : null;
|
|
3663
3663
|
};
|
|
3664
3664
|
var Oi = Pi;
|
|
3665
|
-
const
|
|
3665
|
+
const dr = M, $i = (s, e, t, r, o) => {
|
|
3666
3666
|
typeof t == "string" && (o = r, r = t, t = void 0);
|
|
3667
3667
|
try {
|
|
3668
|
-
return new
|
|
3669
|
-
s instanceof
|
|
3668
|
+
return new dr(
|
|
3669
|
+
s instanceof dr ? s.version : s,
|
|
3670
3670
|
t
|
|
3671
3671
|
).inc(e, r, o).version;
|
|
3672
3672
|
} catch {
|
|
@@ -3674,8 +3674,8 @@ const ur = M, $i = (s, e, t, r, o) => {
|
|
|
3674
3674
|
}
|
|
3675
3675
|
};
|
|
3676
3676
|
var Ii = $i;
|
|
3677
|
-
const
|
|
3678
|
-
const t =
|
|
3677
|
+
const pr = we, Fi = (s, e) => {
|
|
3678
|
+
const t = pr(s, null, !0), r = pr(e, null, !0), o = t.compare(r);
|
|
3679
3679
|
if (o === 0)
|
|
3680
3680
|
return null;
|
|
3681
3681
|
const n = o > 0, i = n ? t : r, c = n ? r : t, a = !!i.prerelease.length;
|
|
@@ -3691,39 +3691,39 @@ const Di = M, Bi = (s, e) => new Di(s, e).minor;
|
|
|
3691
3691
|
var ji = Bi;
|
|
3692
3692
|
const xi = M, Vi = (s, e) => new xi(s, e).patch;
|
|
3693
3693
|
var Ui = Vi;
|
|
3694
|
-
const
|
|
3695
|
-
const t =
|
|
3694
|
+
const Ji = we, Gi = (s, e) => {
|
|
3695
|
+
const t = Ji(s, e);
|
|
3696
3696
|
return t && t.prerelease.length ? t.prerelease : null;
|
|
3697
3697
|
};
|
|
3698
|
-
var Mi =
|
|
3699
|
-
const
|
|
3698
|
+
var Mi = Gi;
|
|
3699
|
+
const hr = M, _i = (s, e, t) => new hr(s, t).compare(new hr(e, t));
|
|
3700
3700
|
var Y = _i;
|
|
3701
3701
|
const Ki = Y, Hi = (s, e, t) => Ki(e, s, t);
|
|
3702
3702
|
var Wi = Hi;
|
|
3703
3703
|
const zi = Y, Xi = (s, e) => zi(s, e, !0);
|
|
3704
3704
|
var qi = Xi;
|
|
3705
|
-
const
|
|
3706
|
-
const r = new
|
|
3705
|
+
const fr = M, Yi = (s, e, t) => {
|
|
3706
|
+
const r = new fr(s, t), o = new fr(e, t);
|
|
3707
3707
|
return r.compare(o) || r.compareBuild(o);
|
|
3708
3708
|
};
|
|
3709
|
-
var
|
|
3710
|
-
const Zi =
|
|
3709
|
+
var Nt = Yi;
|
|
3710
|
+
const Zi = Nt, Qi = (s, e) => s.sort((t, r) => Zi(t, r, e));
|
|
3711
3711
|
var ea = Qi;
|
|
3712
|
-
const ta =
|
|
3712
|
+
const ta = Nt, ra = (s, e) => s.sort((t, r) => ta(r, t, e));
|
|
3713
3713
|
var sa = ra;
|
|
3714
3714
|
const oa = Y, na = (s, e, t) => oa(s, e, t) > 0;
|
|
3715
3715
|
var Qe = na;
|
|
3716
3716
|
const ia = Y, aa = (s, e, t) => ia(s, e, t) < 0;
|
|
3717
|
-
var
|
|
3717
|
+
var Dt = aa;
|
|
3718
3718
|
const ca = Y, la = (s, e, t) => ca(s, e, t) === 0;
|
|
3719
3719
|
var ps = la;
|
|
3720
3720
|
const ua = Y, da = (s, e, t) => ua(s, e, t) !== 0;
|
|
3721
3721
|
var hs = da;
|
|
3722
3722
|
const pa = Y, ha = (s, e, t) => pa(s, e, t) >= 0;
|
|
3723
|
-
var
|
|
3723
|
+
var Bt = ha;
|
|
3724
3724
|
const fa = Y, ga = (s, e, t) => fa(s, e, t) <= 0;
|
|
3725
|
-
var
|
|
3726
|
-
const ma = ps, va = hs, ya = Qe, wa =
|
|
3725
|
+
var jt = ga;
|
|
3726
|
+
const ma = ps, va = hs, ya = Qe, wa = Bt, Sa = Dt, ba = jt, Ra = (s, e, t, r) => {
|
|
3727
3727
|
switch (e) {
|
|
3728
3728
|
case "===":
|
|
3729
3729
|
return typeof s == "object" && (s = s.version), typeof t == "object" && (t = t.version), s === t;
|
|
@@ -3748,7 +3748,7 @@ const ma = ps, va = hs, ya = Qe, wa = Dt, Sa = Nt, ba = Bt, Ra = (s, e, t, r) =>
|
|
|
3748
3748
|
}
|
|
3749
3749
|
};
|
|
3750
3750
|
var fs = Ra;
|
|
3751
|
-
const Ea = M, Ca =
|
|
3751
|
+
const Ea = M, Ca = we, { safeRe: Je, t: Ge } = De, ka = (s, e) => {
|
|
3752
3752
|
if (s instanceof Ea)
|
|
3753
3753
|
return s;
|
|
3754
3754
|
if (typeof s == "number" && (s = String(s)), typeof s != "string")
|
|
@@ -3756,9 +3756,9 @@ const Ea = M, Ca = ye, { safeRe: Ue, t: Ge } = Ne, ka = (s, e) => {
|
|
|
3756
3756
|
e = e || {};
|
|
3757
3757
|
let t = null;
|
|
3758
3758
|
if (!e.rtl)
|
|
3759
|
-
t = s.match(e.includePrerelease ?
|
|
3759
|
+
t = s.match(e.includePrerelease ? Je[Ge.COERCEFULL] : Je[Ge.COERCE]);
|
|
3760
3760
|
else {
|
|
3761
|
-
const a = e.includePrerelease ?
|
|
3761
|
+
const a = e.includePrerelease ? Je[Ge.COERCERTLFULL] : Je[Ge.COERCERTL];
|
|
3762
3762
|
let l;
|
|
3763
3763
|
for (; (l = a.exec(s)) && (!t || t.index + t[0].length !== s.length); )
|
|
3764
3764
|
(!t || l.index + l[0].length !== t.index + t[0].length) && (t = l), a.lastIndex = l.index + l[1].length + l[2].length;
|
|
@@ -3793,10 +3793,10 @@ class Oa {
|
|
|
3793
3793
|
return this;
|
|
3794
3794
|
}
|
|
3795
3795
|
}
|
|
3796
|
-
var $a = Oa, it,
|
|
3796
|
+
var $a = Oa, it, gr;
|
|
3797
3797
|
function Z() {
|
|
3798
|
-
if (
|
|
3799
|
-
|
|
3798
|
+
if (gr) return it;
|
|
3799
|
+
gr = 1;
|
|
3800
3800
|
const s = /\s+/g;
|
|
3801
3801
|
class e {
|
|
3802
3802
|
constructor(p, y) {
|
|
@@ -3878,20 +3878,20 @@ function Z() {
|
|
|
3878
3878
|
}
|
|
3879
3879
|
}
|
|
3880
3880
|
it = e;
|
|
3881
|
-
const t = $a, r = new t(), o =
|
|
3881
|
+
const t = $a, r = new t(), o = Lt, n = et(), i = Ze, c = M, {
|
|
3882
3882
|
safeRe: a,
|
|
3883
3883
|
t: l,
|
|
3884
3884
|
comparatorTrimReplace: u,
|
|
3885
3885
|
tildeTrimReplace: d,
|
|
3886
3886
|
caretTrimReplace: m
|
|
3887
|
-
} =
|
|
3887
|
+
} = De, { FLAG_INCLUDE_PRERELEASE: h, FLAG_LOOSE: f } = Ye, I = (v) => v.value === "<0.0.0-0", F = (v) => v.value === "", D = (v, p) => {
|
|
3888
3888
|
let y = !0;
|
|
3889
3889
|
const g = v.slice();
|
|
3890
3890
|
let b = g.pop();
|
|
3891
3891
|
for (; y && g.length; )
|
|
3892
3892
|
y = g.every((w) => b.intersects(w, p)), b = g.pop();
|
|
3893
3893
|
return y;
|
|
3894
|
-
}, _ = (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 =
|
|
3894
|
+
}, _ = (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 = G(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) => {
|
|
3895
3895
|
const y = p.loose ? a[l.TILDELOOSE] : a[l.TILDE];
|
|
3896
3896
|
return v.replace(y, (g, b, w, R, P) => {
|
|
3897
3897
|
i("tilde", v, g, b, w, R, P);
|
|
@@ -3914,7 +3914,7 @@ function Z() {
|
|
|
3914
3914
|
const $ = k(w), L = $ || k(R), N = L || k(P), re = N;
|
|
3915
3915
|
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;
|
|
3916
3916
|
});
|
|
3917
|
-
},
|
|
3917
|
+
}, G = (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) => {
|
|
3918
3918
|
for (let g = 0; g < v.length; g++)
|
|
3919
3919
|
if (!v[g].test(p))
|
|
3920
3920
|
return !1;
|
|
@@ -3931,10 +3931,10 @@ function Z() {
|
|
|
3931
3931
|
};
|
|
3932
3932
|
return it;
|
|
3933
3933
|
}
|
|
3934
|
-
var at,
|
|
3934
|
+
var at, mr;
|
|
3935
3935
|
function et() {
|
|
3936
|
-
if (
|
|
3937
|
-
|
|
3936
|
+
if (mr) return at;
|
|
3937
|
+
mr = 1;
|
|
3938
3938
|
const s = Symbol("SemVer ANY");
|
|
3939
3939
|
class e {
|
|
3940
3940
|
static get ANY() {
|
|
@@ -3975,7 +3975,7 @@ function et() {
|
|
|
3975
3975
|
}
|
|
3976
3976
|
}
|
|
3977
3977
|
at = e;
|
|
3978
|
-
const t =
|
|
3978
|
+
const t = Lt, { safeRe: r, t: o } = De, n = fs, i = Ze, c = M, a = Z();
|
|
3979
3979
|
return at;
|
|
3980
3980
|
}
|
|
3981
3981
|
const Ia = Z(), Fa = (s, e, t) => {
|
|
@@ -4012,9 +4012,9 @@ const xa = M, Va = Z(), Ua = (s, e, t) => {
|
|
|
4012
4012
|
n.test(i) && (!r || o.compare(i) === 1) && (r = i, o = new xa(r, t));
|
|
4013
4013
|
}), r;
|
|
4014
4014
|
};
|
|
4015
|
-
var
|
|
4016
|
-
const ct = M,
|
|
4017
|
-
s = new
|
|
4015
|
+
var Ja = Ua;
|
|
4016
|
+
const ct = M, Ga = Z(), vr = Qe, Ma = (s, e) => {
|
|
4017
|
+
s = new Ga(s, e);
|
|
4018
4018
|
let t = new ct("0.0.0");
|
|
4019
4019
|
if (s.test(t) || (t = new ct("0.0.0-0"), s.test(t)))
|
|
4020
4020
|
return t;
|
|
@@ -4029,7 +4029,7 @@ const ct = M, Ja = Z(), mr = Qe, Ma = (s, e) => {
|
|
|
4029
4029
|
c.prerelease.length === 0 ? c.patch++ : c.prerelease.push(0), c.raw = c.format();
|
|
4030
4030
|
case "":
|
|
4031
4031
|
case ">=":
|
|
4032
|
-
(!n ||
|
|
4032
|
+
(!n || vr(c, n)) && (n = c);
|
|
4033
4033
|
break;
|
|
4034
4034
|
case "<":
|
|
4035
4035
|
case "<=":
|
|
@@ -4037,7 +4037,7 @@ const ct = M, Ja = Z(), mr = Qe, Ma = (s, e) => {
|
|
|
4037
4037
|
default:
|
|
4038
4038
|
throw new Error(`Unexpected operation: ${i.operator}`);
|
|
4039
4039
|
}
|
|
4040
|
-
}), n && (!t ||
|
|
4040
|
+
}), n && (!t || vr(t, n)) && (t = n);
|
|
4041
4041
|
}
|
|
4042
4042
|
return t && s.test(t) ? t : null;
|
|
4043
4043
|
};
|
|
@@ -4050,15 +4050,15 @@ const Ka = Z(), Ha = (s, e) => {
|
|
|
4050
4050
|
}
|
|
4051
4051
|
};
|
|
4052
4052
|
var Wa = Ha;
|
|
4053
|
-
const za = M, gs = et(), { ANY: Xa } = gs, qa = Z(), Ya = tt,
|
|
4053
|
+
const za = M, gs = et(), { ANY: Xa } = gs, qa = Z(), Ya = tt, yr = Qe, wr = Dt, Za = jt, Qa = Bt, ec = (s, e, t, r) => {
|
|
4054
4054
|
s = new za(s, r), e = new qa(e, r);
|
|
4055
4055
|
let o, n, i, c, a;
|
|
4056
4056
|
switch (t) {
|
|
4057
4057
|
case ">":
|
|
4058
|
-
o =
|
|
4058
|
+
o = yr, n = Za, i = wr, c = ">", a = ">=";
|
|
4059
4059
|
break;
|
|
4060
4060
|
case "<":
|
|
4061
|
-
o =
|
|
4061
|
+
o = wr, n = Qa, i = yr, c = "<", a = "<=";
|
|
4062
4062
|
break;
|
|
4063
4063
|
default:
|
|
4064
4064
|
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
@@ -4077,12 +4077,12 @@ const za = M, gs = et(), { ANY: Xa } = gs, qa = Z(), Ya = tt, vr = Qe, yr = Nt,
|
|
|
4077
4077
|
}
|
|
4078
4078
|
return !0;
|
|
4079
4079
|
};
|
|
4080
|
-
var
|
|
4081
|
-
const tc =
|
|
4080
|
+
var xt = ec;
|
|
4081
|
+
const tc = xt, rc = (s, e, t) => tc(s, e, ">", t);
|
|
4082
4082
|
var sc = rc;
|
|
4083
|
-
const oc =
|
|
4083
|
+
const oc = xt, nc = (s, e, t) => oc(s, e, "<", t);
|
|
4084
4084
|
var ic = nc;
|
|
4085
|
-
const
|
|
4085
|
+
const Sr = Z(), ac = (s, e, t) => (s = new Sr(s, t), e = new Sr(e, t), s.intersects(e, t));
|
|
4086
4086
|
var cc = ac;
|
|
4087
4087
|
const lc = tt, uc = Y;
|
|
4088
4088
|
var dc = (s, e, t) => {
|
|
@@ -4098,10 +4098,10 @@ var dc = (s, e, t) => {
|
|
|
4098
4098
|
const a = c.join(" || "), l = typeof e.raw == "string" ? e.raw : String(e);
|
|
4099
4099
|
return a.length < l.length ? a : e;
|
|
4100
4100
|
};
|
|
4101
|
-
const
|
|
4101
|
+
const br = Z(), Vt = et(), { ANY: lt } = Vt, be = tt, Ut = Y, pc = (s, e, t = {}) => {
|
|
4102
4102
|
if (s === e)
|
|
4103
4103
|
return !0;
|
|
4104
|
-
s = new
|
|
4104
|
+
s = new br(s, t), e = new br(e, t);
|
|
4105
4105
|
let r = !1;
|
|
4106
4106
|
e: for (const o of s.set) {
|
|
4107
4107
|
for (const n of e.set) {
|
|
@@ -4113,37 +4113,37 @@ const Sr = Z(), xt = et(), { ANY: lt } = xt, Se = tt, Vt = Y, pc = (s, e, t = {}
|
|
|
4113
4113
|
return !1;
|
|
4114
4114
|
}
|
|
4115
4115
|
return !0;
|
|
4116
|
-
}, hc = [new
|
|
4116
|
+
}, hc = [new Vt(">=0.0.0-0")], Rr = [new Vt(">=0.0.0")], fc = (s, e, t) => {
|
|
4117
4117
|
if (s === e)
|
|
4118
4118
|
return !0;
|
|
4119
4119
|
if (s.length === 1 && s[0].semver === lt) {
|
|
4120
4120
|
if (e.length === 1 && e[0].semver === lt)
|
|
4121
4121
|
return !0;
|
|
4122
|
-
t.includePrerelease ? s = hc : s =
|
|
4122
|
+
t.includePrerelease ? s = hc : s = Rr;
|
|
4123
4123
|
}
|
|
4124
4124
|
if (e.length === 1 && e[0].semver === lt) {
|
|
4125
4125
|
if (t.includePrerelease)
|
|
4126
4126
|
return !0;
|
|
4127
|
-
e =
|
|
4127
|
+
e = Rr;
|
|
4128
4128
|
}
|
|
4129
4129
|
const r = /* @__PURE__ */ new Set();
|
|
4130
4130
|
let o, n;
|
|
4131
4131
|
for (const h of s)
|
|
4132
|
-
h.operator === ">" || h.operator === ">=" ? o =
|
|
4132
|
+
h.operator === ">" || h.operator === ">=" ? o = Er(o, h, t) : h.operator === "<" || h.operator === "<=" ? n = Cr(n, h, t) : r.add(h.semver);
|
|
4133
4133
|
if (r.size > 1)
|
|
4134
4134
|
return null;
|
|
4135
4135
|
let i;
|
|
4136
4136
|
if (o && n) {
|
|
4137
|
-
if (i =
|
|
4137
|
+
if (i = Ut(o.semver, n.semver, t), i > 0)
|
|
4138
4138
|
return null;
|
|
4139
4139
|
if (i === 0 && (o.operator !== ">=" || n.operator !== "<="))
|
|
4140
4140
|
return null;
|
|
4141
4141
|
}
|
|
4142
4142
|
for (const h of r) {
|
|
4143
|
-
if (o && !
|
|
4143
|
+
if (o && !be(h, String(o), t) || n && !be(h, String(n), t))
|
|
4144
4144
|
return null;
|
|
4145
4145
|
for (const f of e)
|
|
4146
|
-
if (!
|
|
4146
|
+
if (!be(h, String(f), t))
|
|
4147
4147
|
return !1;
|
|
4148
4148
|
return !0;
|
|
4149
4149
|
}
|
|
@@ -4152,35 +4152,35 @@ const Sr = Z(), xt = et(), { ANY: lt } = xt, Se = tt, Vt = Y, pc = (s, e, t = {}
|
|
|
4152
4152
|
for (const h of e) {
|
|
4153
4153
|
if (u = u || h.operator === ">" || h.operator === ">=", l = l || h.operator === "<" || h.operator === "<=", o) {
|
|
4154
4154
|
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 === ">=") {
|
|
4155
|
-
if (c =
|
|
4155
|
+
if (c = Er(o, h, t), c === h && c !== o)
|
|
4156
4156
|
return !1;
|
|
4157
|
-
} else if (o.operator === ">=" && !
|
|
4157
|
+
} else if (o.operator === ">=" && !be(o.semver, String(h), t))
|
|
4158
4158
|
return !1;
|
|
4159
4159
|
}
|
|
4160
4160
|
if (n) {
|
|
4161
4161
|
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 === "<=") {
|
|
4162
|
-
if (a =
|
|
4162
|
+
if (a = Cr(n, h, t), a === h && a !== n)
|
|
4163
4163
|
return !1;
|
|
4164
|
-
} else if (n.operator === "<=" && !
|
|
4164
|
+
} else if (n.operator === "<=" && !be(n.semver, String(h), t))
|
|
4165
4165
|
return !1;
|
|
4166
4166
|
}
|
|
4167
4167
|
if (!h.operator && (n || o) && i !== 0)
|
|
4168
4168
|
return !1;
|
|
4169
4169
|
}
|
|
4170
4170
|
return !(o && l && !n && i !== 0 || n && u && !o && i !== 0 || m || d);
|
|
4171
|
-
},
|
|
4171
|
+
}, Er = (s, e, t) => {
|
|
4172
4172
|
if (!s)
|
|
4173
4173
|
return e;
|
|
4174
|
-
const r =
|
|
4174
|
+
const r = Ut(s.semver, e.semver, t);
|
|
4175
4175
|
return r > 0 ? s : r < 0 || e.operator === ">" && s.operator === ">=" ? e : s;
|
|
4176
|
-
},
|
|
4176
|
+
}, Cr = (s, e, t) => {
|
|
4177
4177
|
if (!s)
|
|
4178
4178
|
return e;
|
|
4179
|
-
const r =
|
|
4179
|
+
const r = Ut(s.semver, e.semver, t);
|
|
4180
4180
|
return r < 0 ? s : r > 0 || e.operator === "<" && s.operator === "<=" ? e : s;
|
|
4181
4181
|
};
|
|
4182
4182
|
var gc = pc;
|
|
4183
|
-
const ut =
|
|
4183
|
+
const ut = De, kr = Ye, mc = M, Pr = ds, vc = we, yc = Ci, wc = Oi, Sc = Ii, bc = Ti, Rc = Ni, Ec = ji, Cc = Ui, kc = Mi, Pc = Y, Oc = Wi, $c = qi, Ic = Nt, Fc = ea, Tc = sa, Ac = Qe, Lc = Dt, Nc = ps, Dc = hs, Bc = Bt, jc = jt, xc = fs, Vc = Pa, Uc = et(), Jc = Z(), Gc = tt, Mc = La, _c = ja, Kc = Ja, Hc = _a, Wc = Wa, zc = xt, Xc = sc, qc = ic, Yc = cc, Zc = dc, Qc = gc;
|
|
4184
4184
|
var el = {
|
|
4185
4185
|
parse: vc,
|
|
4186
4186
|
valid: yc,
|
|
@@ -4206,8 +4206,8 @@ var el = {
|
|
|
4206
4206
|
cmp: xc,
|
|
4207
4207
|
coerce: Vc,
|
|
4208
4208
|
Comparator: Uc,
|
|
4209
|
-
Range:
|
|
4210
|
-
satisfies:
|
|
4209
|
+
Range: Jc,
|
|
4210
|
+
satisfies: Gc,
|
|
4211
4211
|
toComparators: Mc,
|
|
4212
4212
|
maxSatisfying: _c,
|
|
4213
4213
|
minSatisfying: Kc,
|
|
@@ -4223,15 +4223,15 @@ var el = {
|
|
|
4223
4223
|
re: ut.re,
|
|
4224
4224
|
src: ut.src,
|
|
4225
4225
|
tokens: ut.t,
|
|
4226
|
-
SEMVER_SPEC_VERSION:
|
|
4227
|
-
RELEASE_TYPES:
|
|
4228
|
-
compareIdentifiers:
|
|
4229
|
-
rcompareIdentifiers:
|
|
4226
|
+
SEMVER_SPEC_VERSION: kr.SEMVER_SPEC_VERSION,
|
|
4227
|
+
RELEASE_TYPES: kr.RELEASE_TYPES,
|
|
4228
|
+
compareIdentifiers: Pr.compareIdentifiers,
|
|
4229
|
+
rcompareIdentifiers: Pr.rcompareIdentifiers
|
|
4230
4230
|
};
|
|
4231
4231
|
const tl = /* @__PURE__ */ ci(el), rl = {
|
|
4232
4232
|
minDelay: 1500
|
|
4233
4233
|
}, sl = "__no_updates__";
|
|
4234
|
-
class ol extends
|
|
4234
|
+
class ol extends Gs {
|
|
4235
4235
|
constructor(t, r, o = {}) {
|
|
4236
4236
|
super({ ...o, ...rl }, r);
|
|
4237
4237
|
S(this, "http");
|
|
@@ -4263,9 +4263,9 @@ class ol extends Js {
|
|
|
4263
4263
|
}
|
|
4264
4264
|
case "dev-v2":
|
|
4265
4265
|
try {
|
|
4266
|
-
const r = await
|
|
4266
|
+
const r = await ht(t.folder, this.logger);
|
|
4267
4267
|
if (r === void 0) return;
|
|
4268
|
-
const o = await
|
|
4268
|
+
const o = await Ot(r);
|
|
4269
4269
|
return o === t.mtime ? void 0 : { ...t, mtime: o };
|
|
4270
4270
|
} catch (r) {
|
|
4271
4271
|
this.logger.warn(r);
|
|
@@ -4279,9 +4279,9 @@ class ol extends Js {
|
|
|
4279
4279
|
const n = await r.getLatestOverview(t.id, ne);
|
|
4280
4280
|
if (n) o = n.spec;
|
|
4281
4281
|
else {
|
|
4282
|
-
const i = await r.getLatestOverview(t.id,
|
|
4282
|
+
const i = await r.getLatestOverview(t.id, ke);
|
|
4283
4283
|
if (i === void 0) {
|
|
4284
|
-
this.logger.error(`No "any" channel record for ${
|
|
4284
|
+
this.logger.error(`No "any" channel record for ${Jt(t.id)}`);
|
|
4285
4285
|
return;
|
|
4286
4286
|
}
|
|
4287
4287
|
o = { ...i.spec, channel: ne };
|
|
@@ -4291,7 +4291,7 @@ class ol extends Js {
|
|
|
4291
4291
|
if (i) o = i.spec;
|
|
4292
4292
|
else {
|
|
4293
4293
|
this.logger.error(
|
|
4294
|
-
`Can't find update for ${
|
|
4294
|
+
`Can't find update for ${Jt(t.id)} in channel "${n}"`
|
|
4295
4295
|
);
|
|
4296
4296
|
return;
|
|
4297
4297
|
}
|
|
@@ -4329,11 +4329,11 @@ class ol extends Js {
|
|
|
4329
4329
|
case "dev-v2":
|
|
4330
4330
|
return r.type !== "dev-v2" ? !1 : t.folder === r.folder && t.mtime === r.mtime;
|
|
4331
4331
|
default:
|
|
4332
|
-
|
|
4332
|
+
J(t);
|
|
4333
4333
|
}
|
|
4334
4334
|
}
|
|
4335
4335
|
}
|
|
4336
|
-
class
|
|
4336
|
+
class Or {
|
|
4337
4337
|
constructor() {
|
|
4338
4338
|
S(this, "resources", /* @__PURE__ */ new Map());
|
|
4339
4339
|
}
|
|
@@ -4368,13 +4368,13 @@ class Pr {
|
|
|
4368
4368
|
return (t = this.resources.get(e)) == null ? void 0 : t.resource;
|
|
4369
4369
|
}
|
|
4370
4370
|
}
|
|
4371
|
-
let
|
|
4372
|
-
function
|
|
4373
|
-
return
|
|
4371
|
+
let Re;
|
|
4372
|
+
function ve() {
|
|
4373
|
+
return Re || (Re = {
|
|
4374
4374
|
logPFrameRequests: process.env.MI_LOG_PFRAMES !== void 0
|
|
4375
|
-
}, process.env.MI_LOG_TREE_STAT && (
|
|
4375
|
+
}, process.env.MI_LOG_TREE_STAT && (Re.logTreeStats = process.env.MI_LOG_TREE_STAT === "cumulative" ? "cumulative" : "per-request"), Re);
|
|
4376
4376
|
}
|
|
4377
|
-
function
|
|
4377
|
+
function $r(s) {
|
|
4378
4378
|
return String(s.id);
|
|
4379
4379
|
}
|
|
4380
4380
|
const nl = ["Int", "Long", "Float", "Double", "String", "Bytes"];
|
|
@@ -4393,7 +4393,7 @@ function dt(s) {
|
|
|
4393
4393
|
}
|
|
4394
4394
|
return s;
|
|
4395
4395
|
}
|
|
4396
|
-
const
|
|
4396
|
+
const Ee = (s, e) => typeof e == "bigint" ? e.toString() : e;
|
|
4397
4397
|
class il {
|
|
4398
4398
|
constructor(e, t, r) {
|
|
4399
4399
|
S(this, "pFrame", new oo());
|
|
@@ -4418,8 +4418,8 @@ class il {
|
|
|
4418
4418
|
});
|
|
4419
4419
|
this.blobDriver = e, this.blobContentCache = t, this.columns = r, this.pFrame.setDataSource(this);
|
|
4420
4420
|
for (const o of r) {
|
|
4421
|
-
for (const i of on(o.data)) this.blobIdToResource.set(
|
|
4422
|
-
const n = nn(o.data,
|
|
4421
|
+
for (const i of on(o.data)) this.blobIdToResource.set($r(i), i);
|
|
4422
|
+
const n = nn(o.data, $r);
|
|
4423
4423
|
try {
|
|
4424
4424
|
this.pFrame.addColumnSpec(o.id, o.spec), this.pFrame.setColumnData(o.id, n);
|
|
4425
4425
|
} catch (i) {
|
|
@@ -4455,27 +4455,27 @@ class al {
|
|
|
4455
4455
|
fetchMethod: async (n) => await Nr.readFile(n),
|
|
4456
4456
|
sizeCalculation: (n) => n.length
|
|
4457
4457
|
}), o = new Fs(1);
|
|
4458
|
-
this.blobContentCache = r, this.concurrencyLimiter = o, this.pFrames = new class extends
|
|
4458
|
+
this.blobContentCache = r, this.concurrencyLimiter = o, this.pFrames = new class extends Or {
|
|
4459
4459
|
constructor(n) {
|
|
4460
4460
|
super(), this.blobDriver = n;
|
|
4461
4461
|
}
|
|
4462
4462
|
createNewResource(n) {
|
|
4463
|
-
return
|
|
4464
|
-
`Create PFrame (${this.calculateParamsKey(n)}): ${JSON.stringify(n,
|
|
4463
|
+
return ve().logPFrameRequests && t.info(
|
|
4464
|
+
`Create PFrame (${this.calculateParamsKey(n)}): ${JSON.stringify(n, Ee)}`
|
|
4465
4465
|
), new il(this.blobDriver, r, n);
|
|
4466
4466
|
}
|
|
4467
4467
|
calculateParamsKey(n) {
|
|
4468
4468
|
return ll(n);
|
|
4469
4469
|
}
|
|
4470
|
-
}(this.blobDriver), this.pTables = new class extends
|
|
4470
|
+
}(this.blobDriver), this.pTables = new class extends Or {
|
|
4471
4471
|
constructor(n) {
|
|
4472
4472
|
super(), this.pFrames = n;
|
|
4473
4473
|
}
|
|
4474
4474
|
async createNewResource(n) {
|
|
4475
|
-
const i = this.pFrames.getByKey(n.pFrameHandle), c = await o.run(async () => (
|
|
4476
|
-
`Create PTable (${this.calculateParamsKey(n)}): ${JSON.stringify(n,
|
|
4475
|
+
const i = this.pFrames.getByKey(n.pFrameHandle), c = await o.run(async () => (ve().logPFrameRequests && t.info(
|
|
4476
|
+
`Create PTable (${this.calculateParamsKey(n)}): ${JSON.stringify(n, Ee)}`
|
|
4477
4477
|
), await i.pFrame.createTable({
|
|
4478
|
-
src:
|
|
4478
|
+
src: Ie(n.def.src),
|
|
4479
4479
|
filters: dt(n.def.filters)
|
|
4480
4480
|
})));
|
|
4481
4481
|
return n.def.sorting.length !== 0 ? c.sort(n.def.sorting) : c;
|
|
@@ -4492,13 +4492,20 @@ class al {
|
|
|
4492
4492
|
const r = e.filter((n) => nl.find((i) => i === n.spec.valueType)).map(
|
|
4493
4493
|
(n) => le(
|
|
4494
4494
|
n,
|
|
4495
|
-
(i) =>
|
|
4495
|
+
(i) => Js(i) ? pn(i) : hn(n.spec, i)
|
|
4496
4496
|
)
|
|
4497
4497
|
), o = this.pFrames.acquire(r);
|
|
4498
4498
|
return t.addOnDestroy(o.unref), o.key;
|
|
4499
4499
|
}
|
|
4500
4500
|
createPTable(e, t) {
|
|
4501
|
-
const r = this.createPFrame(Es(e.src), t)
|
|
4501
|
+
const r = this.createPFrame(Es(e.src), t);
|
|
4502
|
+
ve().logPFrameRequests && this.logger.info(
|
|
4503
|
+
`Create PTable call (${r}): ${JSON.stringify(
|
|
4504
|
+
pt(e, (i) => i.spec),
|
|
4505
|
+
Ee
|
|
4506
|
+
)}`
|
|
4507
|
+
);
|
|
4508
|
+
const o = pt(e, (i) => i.id), n = this.pTables.acquire({ def: o, pFrameHandle: r });
|
|
4502
4509
|
return t.addOnDestroy(n.unref), n.key;
|
|
4503
4510
|
}
|
|
4504
4511
|
//
|
|
@@ -4526,10 +4533,10 @@ class al {
|
|
|
4526
4533
|
);
|
|
4527
4534
|
}
|
|
4528
4535
|
async calculateTableData(e, t) {
|
|
4529
|
-
let r = await this.concurrencyLimiter.run(async () => (
|
|
4530
|
-
`calculateTableData, handle = ${e}, request = ${JSON.stringify(t,
|
|
4536
|
+
let r = await this.concurrencyLimiter.run(async () => (ve().logPFrameRequests && this.logger.info(
|
|
4537
|
+
`calculateTableData, handle = ${e}, request = ${JSON.stringify(t, Ee)}`
|
|
4531
4538
|
), await this.pFrames.getByKey(e).pFrame.createTable({
|
|
4532
|
-
src:
|
|
4539
|
+
src: Ie(t.src),
|
|
4533
4540
|
filters: dt(t.filters)
|
|
4534
4541
|
})));
|
|
4535
4542
|
if (t.sorting.length > 0) {
|
|
@@ -4547,8 +4554,8 @@ class al {
|
|
|
4547
4554
|
}));
|
|
4548
4555
|
}
|
|
4549
4556
|
async getUniqueValues(e, t) {
|
|
4550
|
-
return await this.concurrencyLimiter.run(async () => (
|
|
4551
|
-
`getUniqueValues, handle = ${e}, request = ${JSON.stringify(t,
|
|
4557
|
+
return await this.concurrencyLimiter.run(async () => (ve().logPFrameRequests && this.logger.info(
|
|
4558
|
+
`getUniqueValues, handle = ${e}, request = ${JSON.stringify(t, Ee)}`
|
|
4552
4559
|
), await this.pFrames.getByKey(e).pFrame.getUniqueValues({
|
|
4553
4560
|
...t,
|
|
4554
4561
|
filters: dt(t.filters)
|
|
@@ -4570,7 +4577,7 @@ class al {
|
|
|
4570
4577
|
);
|
|
4571
4578
|
}
|
|
4572
4579
|
}
|
|
4573
|
-
function
|
|
4580
|
+
function Ie(s) {
|
|
4574
4581
|
switch (s.type) {
|
|
4575
4582
|
case "column":
|
|
4576
4583
|
return {
|
|
@@ -4582,65 +4589,67 @@ function $e(s) {
|
|
|
4582
4589
|
case "full":
|
|
4583
4590
|
return {
|
|
4584
4591
|
type: s.type,
|
|
4585
|
-
entries: s.entries.map((e) =>
|
|
4592
|
+
entries: s.entries.map((e) => Ie(e))
|
|
4586
4593
|
};
|
|
4587
4594
|
case "outer":
|
|
4588
4595
|
return {
|
|
4589
4596
|
type: "outer",
|
|
4590
|
-
primary:
|
|
4591
|
-
secondary: s.secondary.map((e) =>
|
|
4597
|
+
primary: Ie(s.primary),
|
|
4598
|
+
secondary: s.secondary.map((e) => Ie(e))
|
|
4592
4599
|
};
|
|
4593
4600
|
default:
|
|
4594
|
-
|
|
4601
|
+
J(s);
|
|
4595
4602
|
}
|
|
4596
4603
|
}
|
|
4597
4604
|
function cl(s) {
|
|
4598
|
-
const e =
|
|
4599
|
-
return e.update(
|
|
4605
|
+
const e = Ne("sha256");
|
|
4606
|
+
return e.update(ye(s.def)), e.digest().toString("hex");
|
|
4600
4607
|
}
|
|
4601
4608
|
function ll(s) {
|
|
4602
|
-
const e = [...s].map(
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4609
|
+
const e = [...s].map(
|
|
4610
|
+
(r) => le(r, (o) => {
|
|
4611
|
+
let n;
|
|
4612
|
+
const i = o.type;
|
|
4613
|
+
switch (i) {
|
|
4614
|
+
case "Json":
|
|
4615
|
+
n = {
|
|
4616
|
+
type: o.type,
|
|
4617
|
+
keyLength: o.keyLength,
|
|
4618
|
+
payload: Object.entries(o.data).map(([c, a]) => ({
|
|
4619
|
+
key: c,
|
|
4620
|
+
value: a
|
|
4621
|
+
}))
|
|
4622
|
+
};
|
|
4623
|
+
break;
|
|
4624
|
+
case "JsonPartitioned":
|
|
4625
|
+
n = {
|
|
4626
|
+
type: o.type,
|
|
4627
|
+
keyLength: o.partitionKeyLength,
|
|
4628
|
+
payload: Object.entries(o.parts).map(([c, a]) => ({
|
|
4629
|
+
key: c,
|
|
4630
|
+
value: a.id.toString()
|
|
4631
|
+
}))
|
|
4632
|
+
};
|
|
4633
|
+
break;
|
|
4634
|
+
case "BinaryPartitioned":
|
|
4635
|
+
n = {
|
|
4636
|
+
type: o.type,
|
|
4637
|
+
keyLength: o.partitionKeyLength,
|
|
4638
|
+
payload: Object.entries(o.parts).map(([c, a]) => ({
|
|
4639
|
+
key: c,
|
|
4640
|
+
value: [a.index.id.toString(), a.values.id.toString()]
|
|
4641
|
+
}))
|
|
4642
|
+
};
|
|
4643
|
+
break;
|
|
4644
|
+
default:
|
|
4645
|
+
throw Error(`unsupported resource type: ${i}`);
|
|
4646
|
+
}
|
|
4647
|
+
return n.payload.sort((c, a) => c.key.localeCompare(a.key)), n;
|
|
4648
|
+
})
|
|
4649
|
+
);
|
|
4641
4650
|
e.sort((r, o) => r.id.localeCompare(o.id));
|
|
4642
|
-
const t =
|
|
4643
|
-
return t.update(
|
|
4651
|
+
const t = Ne("sha256");
|
|
4652
|
+
return t.update(ye(e)), t.digest().toString("hex");
|
|
4644
4653
|
}
|
|
4645
4654
|
async function ul(s, e, t) {
|
|
4646
4655
|
const r = {
|
|
@@ -4696,7 +4705,7 @@ class ms {
|
|
|
4696
4705
|
// Project List Manipulation
|
|
4697
4706
|
//
|
|
4698
4707
|
/** Creates a project with initial state and adds it to project list. */
|
|
4699
|
-
async createProject(e, t =
|
|
4708
|
+
async createProject(e, t = Fe()) {
|
|
4700
4709
|
const r = await this.pl.withWriteTx("MLCreateProject", async (o) => {
|
|
4701
4710
|
const n = await sn(o, e);
|
|
4702
4711
|
return o.createField(j(this.projectListResourceId, t), "Dynamic", n), await o.commit(), await xs(n);
|
|
@@ -4730,7 +4739,7 @@ class ms {
|
|
|
4730
4739
|
async openProject(e) {
|
|
4731
4740
|
const t = await this.ensureProjectRid(e);
|
|
4732
4741
|
if (this.openedProjectsByRid.has(t)) throw new Error(`Project ${t} already opened`);
|
|
4733
|
-
this.openedProjectsByRid.set(t, await
|
|
4742
|
+
this.openedProjectsByRid.set(t, await At.init(this.env, t)), this.openedProjectsList.setValue([...this.openedProjectsByRid.keys()]);
|
|
4734
4743
|
}
|
|
4735
4744
|
/** Closes the project, and deallocate all corresponding resources. */
|
|
4736
4745
|
async closeProject(e) {
|
|
@@ -4767,7 +4776,7 @@ class ms {
|
|
|
4767
4776
|
...ai(t),
|
|
4768
4777
|
...r
|
|
4769
4778
|
};
|
|
4770
|
-
o.defaultTreeOptions.logStat =
|
|
4779
|
+
o.defaultTreeOptions.logStat = ve().logTreeStats;
|
|
4771
4780
|
const n = await e.withWriteTx("MLInitialization", async (I) => {
|
|
4772
4781
|
const F = j(I.clientRoot, Oo);
|
|
4773
4782
|
I.createField(F, "Dynamic");
|
|
@@ -4895,43 +4904,43 @@ async function Wl(s, e = {}) {
|
|
|
4895
4904
|
autoUpdateCdnChecks: []
|
|
4896
4905
|
}, n = Vs(s, { defaultRequestTimeout: t.pingTimeoutMs });
|
|
4897
4906
|
o.plPings = await ge(t.pingCheckDurationMs, t.maxPingsPerSecond, async () => {
|
|
4898
|
-
const l = await new
|
|
4907
|
+
const l = await new Kt(n).ping();
|
|
4899
4908
|
return JSON.stringify(l).slice(0, t.bodyLimit) + "...";
|
|
4900
4909
|
});
|
|
4901
|
-
const c = new
|
|
4910
|
+
const c = new Kt(n).ll.httpDispatcher;
|
|
4902
4911
|
return o.blockRegistryOverviewChecks = await ge(
|
|
4903
4912
|
t.blockRegistryDurationMs,
|
|
4904
4913
|
t.maxRegistryChecksPerSecond,
|
|
4905
|
-
async () => await
|
|
4914
|
+
async () => await Ce(new URL(t.blockOverviewPath, t.blockRegistryUrl), t, c)
|
|
4906
4915
|
), o.blockGARegistryOverviewChecks = await ge(
|
|
4907
4916
|
t.blockRegistryDurationMs,
|
|
4908
4917
|
t.maxRegistryChecksPerSecond,
|
|
4909
|
-
async () => await
|
|
4918
|
+
async () => await Ce(new URL(t.blockOverviewPath, t.blockGARegistryUrl), t, c)
|
|
4910
4919
|
), o.blockRegistryUiChecks = await ge(
|
|
4911
4920
|
t.blockRegistryDurationMs,
|
|
4912
4921
|
t.maxRegistryChecksPerSecond,
|
|
4913
|
-
async () => await
|
|
4922
|
+
async () => await Ce(new URL(t.blockUiPath, t.blockRegistryUrl), t, c)
|
|
4914
4923
|
), o.blockGARegistryUiChecks = await ge(
|
|
4915
4924
|
t.blockRegistryDurationMs,
|
|
4916
4925
|
t.maxRegistryChecksPerSecond,
|
|
4917
|
-
async () => await
|
|
4926
|
+
async () => await Ce(new URL(t.blockUiPath, t.blockGARegistryUrl), t, c)
|
|
4918
4927
|
), o.autoUpdateCdnChecks = await ge(
|
|
4919
4928
|
t.autoUpdateCdnDurationMs,
|
|
4920
4929
|
t.maxAutoUpdateCdnChecksPerSecond,
|
|
4921
|
-
async () => await
|
|
4930
|
+
async () => await Ce(t.autoUpdateCdnUrl, t, c)
|
|
4922
4931
|
), pl(o, s, t, r);
|
|
4923
4932
|
}
|
|
4924
4933
|
async function ge(s, e, t) {
|
|
4925
|
-
const r =
|
|
4926
|
-
for (;
|
|
4927
|
-
const n =
|
|
4934
|
+
const r = Ct(), o = [];
|
|
4935
|
+
for (; Ir(r) < s; ) {
|
|
4936
|
+
const n = Ct();
|
|
4928
4937
|
let i;
|
|
4929
4938
|
try {
|
|
4930
4939
|
i = { ok: !0, value: await t() };
|
|
4931
4940
|
} catch (l) {
|
|
4932
4941
|
i = { ok: !1, error: l };
|
|
4933
4942
|
}
|
|
4934
|
-
const c =
|
|
4943
|
+
const c = Ir(n);
|
|
4935
4944
|
o.push({
|
|
4936
4945
|
elapsedMs: c,
|
|
4937
4946
|
response: i
|
|
@@ -4941,7 +4950,7 @@ async function ge(s, e, t) {
|
|
|
4941
4950
|
}
|
|
4942
4951
|
return o;
|
|
4943
4952
|
}
|
|
4944
|
-
async function
|
|
4953
|
+
async function Ce(s, e, t) {
|
|
4945
4954
|
const { body: r, statusCode: o } = await ie(s, {
|
|
4946
4955
|
dispatcher: t,
|
|
4947
4956
|
headersTimeout: e.httpTimeoutMs,
|
|
@@ -5018,11 +5027,11 @@ function hl(s) {
|
|
|
5018
5027
|
}
|
|
5019
5028
|
return { mean: t, median: r };
|
|
5020
5029
|
}
|
|
5021
|
-
function
|
|
5030
|
+
function Ct() {
|
|
5022
5031
|
return Date.now();
|
|
5023
5032
|
}
|
|
5024
|
-
function
|
|
5025
|
-
return
|
|
5033
|
+
function Ir(s) {
|
|
5034
|
+
return Ct() - s;
|
|
5026
5035
|
}
|
|
5027
5036
|
export {
|
|
5028
5037
|
Vl as BlockPackRegistry,
|
|
@@ -5034,8 +5043,8 @@ export {
|
|
|
5034
5043
|
zr as FrontendFromFolderResourceType,
|
|
5035
5044
|
Wr as FrontendFromUrlResourceType,
|
|
5036
5045
|
ms as MiddleLayer,
|
|
5037
|
-
|
|
5038
|
-
|
|
5046
|
+
At as Project,
|
|
5047
|
+
Go as TengoTemplateGet,
|
|
5039
5048
|
Mo as TengoTemplateGetRegistry,
|
|
5040
5049
|
Ko as TengoTemplateGetTemplate,
|
|
5041
5050
|
_o as TengoTemplateGetTemplateURI,
|
|
@@ -5043,15 +5052,15 @@ export {
|
|
|
5043
5052
|
_l as TengoTemplatePackConvert,
|
|
5044
5053
|
Hl as TengoTemplatePackConvertTemplate,
|
|
5045
5054
|
Kl as TengoTemplatePackConvertTemplatePack,
|
|
5046
|
-
|
|
5047
|
-
|
|
5055
|
+
Gl as V1CentralDevSnapshotRegistry,
|
|
5056
|
+
Jl as V1CentralRegistry,
|
|
5048
5057
|
go as V2RegistryProvider,
|
|
5049
5058
|
Wl as checkNetwork,
|
|
5050
5059
|
_r as createRenderTemplate,
|
|
5051
5060
|
Ur as getDevV1PacketMtime,
|
|
5052
|
-
|
|
5061
|
+
Ot as getDevV2PacketMtime,
|
|
5053
5062
|
ul as initDriverKit,
|
|
5054
|
-
|
|
5063
|
+
It as loadTemplate,
|
|
5055
5064
|
Ho as prepareTemplateSpec
|
|
5056
5065
|
};
|
|
5057
5066
|
//# sourceMappingURL=index.mjs.map
|