@blue-labs/language 4.0.0-rc.2 → 4.0.0-rc.3
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 +3 -3
- package/dist/index.mjs +306 -290
- package/dist/lib/provider/RepositoryBasedNodeProvider.d.ts.map +1 -1
- package/dist/lib/repository/RepositoryContentCanonicalizer.d.ts +4 -0
- package/dist/lib/repository/RepositoryContentCanonicalizer.d.ts.map +1 -0
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import G from "big.js";
|
|
2
2
|
import { isNullable as v, isNonNullable as p, jsonPrimitiveSchema as _r, isReadonlyArray as Wt, isJsonPrimitive as Gt, isPreciseNumberString as Jt } from "@blue-labs/shared-utils";
|
|
3
|
-
import { z as y, ZodOptional as Zt, ZodNullable as Xt, ZodReadonly as qt, ZodBranded as Qt, ZodEffects as We, ZodLazy as Ge, ZodString as ge, ZodNumber as me, ZodBoolean as Ue, ZodBigInt as
|
|
3
|
+
import { z as y, ZodOptional as Zt, ZodNullable as Xt, ZodReadonly as qt, ZodBranded as Qt, ZodEffects as We, ZodLazy as Ge, ZodString as ge, ZodNumber as me, ZodBoolean as Ue, ZodBigInt as ze, ZodEnum as jr, ZodNativeEnum as Fr, ZodIntersection as Ur, ZodUnion as zr, ZodObject as Kr, ZodRecord as kr } from "zod";
|
|
4
4
|
import Ae from "bs58";
|
|
5
5
|
import { isObject as er, isArray as tr, isString as wt, omit as rr, pascal as Hr, map as Yr } from "radash";
|
|
6
|
-
import { OBJECT_CONTRACTS as
|
|
6
|
+
import { OBJECT_CONTRACTS as z, OBJECT_MERGE_POLICY as St, OBJECT_SCHEMA as sr, BLUE_REPOSITORY_STATUS_STABLE as Ce, BLUE_REPOSITORY_STATUS_DEV as bt, validateAttributesAddedPointer as Wr, parsePointer as ir } from "@blue-labs/repository-contract";
|
|
7
7
|
import { sha256 as Gr } from "js-sha256";
|
|
8
8
|
import lt from "crypto";
|
|
9
9
|
import Jr from "base32.js";
|
|
10
10
|
import pe from "js-yaml";
|
|
11
|
-
class
|
|
11
|
+
class x extends G {
|
|
12
12
|
constructor(e) {
|
|
13
13
|
super(e);
|
|
14
14
|
}
|
|
@@ -18,10 +18,10 @@ class A extends G {
|
|
|
18
18
|
super(e);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
const ie = "name", ne = "description",
|
|
21
|
+
const ie = "name", ne = "description", K = "type", we = "itemType", Se = "keyType", be = "valueType", W = "value", Y = "items", V = "blueId", Le = "blue", Et = [
|
|
22
22
|
ie,
|
|
23
23
|
ne,
|
|
24
|
-
|
|
24
|
+
K,
|
|
25
25
|
we,
|
|
26
26
|
Se,
|
|
27
27
|
be,
|
|
@@ -47,7 +47,7 @@ const ie = "name", ne = "description", z = "type", we = "itemType", Se = "keyTyp
|
|
|
47
47
|
Nt.map((i, e) => [i, fe[e]])
|
|
48
48
|
), rt = Object.fromEntries(
|
|
49
49
|
fe.map((i, e) => [i, Nt[e]])
|
|
50
|
-
),
|
|
50
|
+
), Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
51
51
|
__proto__: null,
|
|
52
52
|
BASIC_TYPES: et,
|
|
53
53
|
BASIC_TYPE_BLUE_IDS: Rt,
|
|
@@ -67,7 +67,7 @@ const ie = "name", ne = "description", z = "type", we = "itemType", Se = "keyTyp
|
|
|
67
67
|
LIST_TYPE_BLUE_ID: tt,
|
|
68
68
|
OBJECT_BLUE: Le,
|
|
69
69
|
OBJECT_BLUE_ID: V,
|
|
70
|
-
OBJECT_CONTRACTS:
|
|
70
|
+
OBJECT_CONTRACTS: z,
|
|
71
71
|
OBJECT_DESCRIPTION: ne,
|
|
72
72
|
OBJECT_ITEMS: Y,
|
|
73
73
|
OBJECT_ITEM_TYPE: we,
|
|
@@ -76,7 +76,7 @@ const ie = "name", ne = "description", z = "type", we = "itemType", Se = "keyTyp
|
|
|
76
76
|
OBJECT_NAME: ie,
|
|
77
77
|
OBJECT_SCHEMA: sr,
|
|
78
78
|
OBJECT_SPECIFIC_KEYS: Et,
|
|
79
|
-
OBJECT_TYPE:
|
|
79
|
+
OBJECT_TYPE: K,
|
|
80
80
|
OBJECT_VALUE: W,
|
|
81
81
|
OBJECT_VALUE_TYPE: be,
|
|
82
82
|
TEXT_TYPE: nr,
|
|
@@ -178,7 +178,7 @@ class Zr {
|
|
|
178
178
|
n = new u().setProperties(l);
|
|
179
179
|
break;
|
|
180
180
|
}
|
|
181
|
-
case
|
|
181
|
+
case z: {
|
|
182
182
|
const l = e.getContracts();
|
|
183
183
|
n = new u().setContracts(l);
|
|
184
184
|
break;
|
|
@@ -259,15 +259,15 @@ class u {
|
|
|
259
259
|
if (e === te && typeof this.value == "string")
|
|
260
260
|
return new A(this.value);
|
|
261
261
|
if (e === ee && typeof this.value == "string") {
|
|
262
|
-
const t = new
|
|
263
|
-
return new
|
|
262
|
+
const t = new x(this.value), r = parseFloat(t.toString());
|
|
263
|
+
return new x(r.toString());
|
|
264
264
|
} else if (e === re && typeof this.value == "string")
|
|
265
265
|
return this.value.toLowerCase() === "true";
|
|
266
266
|
}
|
|
267
267
|
return this.value;
|
|
268
268
|
}
|
|
269
269
|
setValue(e) {
|
|
270
|
-
return typeof e == "number" ? e % 1 === 0 ? this.value = new A(e.toString()) : this.value = new
|
|
270
|
+
return typeof e == "number" ? e % 1 === 0 ? this.value = new A(e.toString()) : this.value = new x(e.toString()) : this.value = e, this;
|
|
271
271
|
}
|
|
272
272
|
getItems() {
|
|
273
273
|
return this.items;
|
|
@@ -291,21 +291,21 @@ class u {
|
|
|
291
291
|
return this.properties && delete this.properties[e], this;
|
|
292
292
|
}
|
|
293
293
|
getContractsProperty() {
|
|
294
|
-
return this.properties?.[
|
|
294
|
+
return this.properties?.[z];
|
|
295
295
|
}
|
|
296
296
|
getContracts() {
|
|
297
297
|
return this.getContractsProperty()?.getProperties();
|
|
298
298
|
}
|
|
299
299
|
setContracts(e) {
|
|
300
|
-
return v(e) ? this.removeProperty(
|
|
301
|
-
|
|
300
|
+
return v(e) ? this.removeProperty(z) : this.addProperty(
|
|
301
|
+
z,
|
|
302
302
|
new u().setProperties(e)
|
|
303
303
|
), this;
|
|
304
304
|
}
|
|
305
305
|
addContract(e, t) {
|
|
306
306
|
const r = this.getContractsProperty();
|
|
307
307
|
return v(r) ? this.addProperty(
|
|
308
|
-
|
|
308
|
+
z,
|
|
309
309
|
new u().addProperty(e, t)
|
|
310
310
|
) : r.addProperty(e, t), this;
|
|
311
311
|
}
|
|
@@ -314,7 +314,7 @@ class u {
|
|
|
314
314
|
if (t) {
|
|
315
315
|
t.removeProperty(e);
|
|
316
316
|
const r = t.getProperties();
|
|
317
|
-
r && Object.keys(r).length === 0 && this.removeProperty(
|
|
317
|
+
r && Object.keys(r).length === 0 && this.removeProperty(z);
|
|
318
318
|
}
|
|
319
319
|
return this;
|
|
320
320
|
}
|
|
@@ -368,7 +368,7 @@ class u {
|
|
|
368
368
|
}
|
|
369
369
|
getAsInteger(e) {
|
|
370
370
|
const t = this.get(e);
|
|
371
|
-
if (t instanceof A || t instanceof
|
|
371
|
+
if (t instanceof A || t instanceof x)
|
|
372
372
|
return t.toNumber();
|
|
373
373
|
throw new Error(
|
|
374
374
|
`Value at path ${e} is not a BigInteger or BigDecimal: ${t}`
|
|
@@ -414,7 +414,7 @@ class Be {
|
|
|
414
414
|
return !0;
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
const
|
|
417
|
+
const Pn = y.string().max(Be.MAX_BLUE_ID_LENGTH, {
|
|
418
418
|
message: "Blue Id has a maximum length of 45 characters"
|
|
419
419
|
}).min(Be.MIN_BLUE_ID_LENGTH, {
|
|
420
420
|
message: "Blue Id has a minimum length of 41 characters"
|
|
@@ -445,15 +445,15 @@ const vn = y.string().max(Be.MAX_BLUE_ID_LENGTH, {
|
|
|
445
445
|
name: y.string().optional(),
|
|
446
446
|
description: y.string().optional(),
|
|
447
447
|
type: Ve.optional()
|
|
448
|
-
}),
|
|
448
|
+
}), wn = st.extend({
|
|
449
449
|
value: y.string().optional()
|
|
450
|
-
}),
|
|
450
|
+
}), Sn = st.extend({
|
|
451
451
|
value: y.number().optional()
|
|
452
|
-
}),
|
|
452
|
+
}), bn = st.extend({
|
|
453
453
|
value: y.boolean().optional()
|
|
454
|
-
}),
|
|
454
|
+
}), En = st.extend({
|
|
455
455
|
items: y.array(y.string()).optional()
|
|
456
|
-
}),
|
|
456
|
+
}), Nn = (i) => Ve.safeParse(i).success, Xr = (i) => p(i) && "blueId" in i && p(i.blueId), Cn = (i) => p(i) && "name" in i && p(i.name), qr = (i) => p(i) && "items" in i && p(i.items), Qr = (i) => p(i) && "type" in i && p(i.type), es = (i) => p(i) && "value" in i && p(i.value), Rn = (i, e) => i.required({ type: !0 }).safeParse(e).success, R = (i) => i instanceof G, oe = (i) => R(i) && i instanceof A, ft = (i) => R(i) && i instanceof x, ts = y.lazy(
|
|
457
457
|
() => y.record(Je)
|
|
458
458
|
), rs = y.lazy(
|
|
459
459
|
() => y.union([
|
|
@@ -467,7 +467,7 @@ const vn = y.string().max(Be.MAX_BLUE_ID_LENGTH, {
|
|
|
467
467
|
rs,
|
|
468
468
|
y.instanceof(G)
|
|
469
469
|
])
|
|
470
|
-
), hr = (i) => er(i) && !tr(i) && !Wt(i) && !R(i), pr = (i) => tr(i) || Wt(i),
|
|
470
|
+
), hr = (i) => er(i) && !tr(i) && !Wt(i) && !R(i), pr = (i) => tr(i) || Wt(i), An = (i) => pr(i) || hr(i) || R(i) || Gt(i);
|
|
471
471
|
class m {
|
|
472
472
|
static deserialize(e) {
|
|
473
473
|
return m.handleNode(e);
|
|
@@ -501,7 +501,7 @@ class m {
|
|
|
501
501
|
t.setDescription(n);
|
|
502
502
|
}
|
|
503
503
|
break;
|
|
504
|
-
case
|
|
504
|
+
case K:
|
|
505
505
|
t.setType(m.handleNode(n));
|
|
506
506
|
break;
|
|
507
507
|
case we:
|
|
@@ -552,7 +552,7 @@ class m {
|
|
|
552
552
|
return t.lt(r) ? new A(r.toString()) : t.gt(s) ? new A(s.toString()) : t;
|
|
553
553
|
} else {
|
|
554
554
|
const t = parseFloat(e.toString());
|
|
555
|
-
return new
|
|
555
|
+
return new x(t.toString());
|
|
556
556
|
}
|
|
557
557
|
else if (typeof e == "boolean")
|
|
558
558
|
return e;
|
|
@@ -712,7 +712,7 @@ class E {
|
|
|
712
712
|
* Create a double node
|
|
713
713
|
*/
|
|
714
714
|
static doubleNode(e) {
|
|
715
|
-
const t = e instanceof
|
|
715
|
+
const t = e instanceof x ? e : new x(e.toString());
|
|
716
716
|
return new u().setType(new u().setBlueId(ee)).setValue(t);
|
|
717
717
|
}
|
|
718
718
|
/**
|
|
@@ -772,7 +772,7 @@ class E {
|
|
|
772
772
|
}
|
|
773
773
|
}
|
|
774
774
|
const Ie = "$previous", ce = "$pos", gt = "$empty";
|
|
775
|
-
class
|
|
775
|
+
class B {
|
|
776
776
|
static getMergePolicy(e, t) {
|
|
777
777
|
const r = this.getMergePolicyValue(e);
|
|
778
778
|
return r !== void 0 ? r : (t === void 0 ? void 0 : this.getMergePolicyValue(t)) ?? "positional";
|
|
@@ -991,7 +991,7 @@ class ps {
|
|
|
991
991
|
}
|
|
992
992
|
nodeToHashValue(e) {
|
|
993
993
|
const t = {};
|
|
994
|
-
this.setIfPresent(t, ie, e.getName()), this.setIfPresent(t, ne, e.getDescription()), this.setIfPresent(t,
|
|
994
|
+
this.setIfPresent(t, ie, e.getName()), this.setIfPresent(t, ne, e.getDescription()), this.setIfPresent(t, K, e.getType()), this.setIfPresent(t, we, e.getItemType()), this.setIfPresent(t, Se, e.getKeyType()), this.setIfPresent(t, be, e.getValueType());
|
|
995
995
|
const r = e.getValue();
|
|
996
996
|
r !== void 0 && (t[W] = this.scalarToHashValue(r));
|
|
997
997
|
const s = e.getItems();
|
|
@@ -1043,14 +1043,14 @@ class ps {
|
|
|
1043
1043
|
return t.length === 1 && t[0]?.[0] === W;
|
|
1044
1044
|
}
|
|
1045
1045
|
isBasicTypedScalarWrapper(e) {
|
|
1046
|
-
return this.hasOnlyKeys(e, [
|
|
1046
|
+
return this.hasOnlyKeys(e, [K, W]) && this.isBasicScalarTypeReference(e[K]);
|
|
1047
1047
|
}
|
|
1048
1048
|
isListWrapper(e) {
|
|
1049
1049
|
const t = Object.entries(e);
|
|
1050
1050
|
return t.length === 1 && t[0]?.[0] === Y && Array.isArray(t[0]?.[1]);
|
|
1051
1051
|
}
|
|
1052
1052
|
isBasicTypedListWrapper(e) {
|
|
1053
|
-
return this.hasOnlyKeys(e, [
|
|
1053
|
+
return this.hasOnlyKeys(e, [K, Y]) && this.isTypeReference(e[K], tt) && Array.isArray(e[Y]);
|
|
1054
1054
|
}
|
|
1055
1055
|
hasOnlyKeys(e, t) {
|
|
1056
1056
|
return Object.keys(e).length === t.length && t.every(
|
|
@@ -1071,23 +1071,23 @@ class ps {
|
|
|
1071
1071
|
const t = new G(Number.MIN_SAFE_INTEGER.toString()), r = new G(Number.MAX_SAFE_INTEGER.toString());
|
|
1072
1072
|
return e.lt(t) || e.gt(r) ? e.toString() : e.toNumber();
|
|
1073
1073
|
}
|
|
1074
|
-
return e instanceof
|
|
1074
|
+
return e instanceof x || R(e) ? e.toNumber() : e;
|
|
1075
1075
|
}
|
|
1076
1076
|
toJsonScalar(e) {
|
|
1077
1077
|
return R(e) ? this.scalarToHashValue(e) : e;
|
|
1078
1078
|
}
|
|
1079
1079
|
}
|
|
1080
|
-
class
|
|
1081
|
-
static INSTANCE = new
|
|
1080
|
+
class M {
|
|
1081
|
+
static INSTANCE = new M(new ls());
|
|
1082
1082
|
hasher;
|
|
1083
1083
|
constructor(e) {
|
|
1084
1084
|
this.hasher = new ps(e);
|
|
1085
1085
|
}
|
|
1086
1086
|
static calculateBlueId(e) {
|
|
1087
|
-
return
|
|
1087
|
+
return M.INSTANCE.calculate(e);
|
|
1088
1088
|
}
|
|
1089
1089
|
static calculateBlueIdSync(e) {
|
|
1090
|
-
return
|
|
1090
|
+
return M.INSTANCE.calculateSync(e);
|
|
1091
1091
|
}
|
|
1092
1092
|
calculate(e) {
|
|
1093
1093
|
return this.hasher.calculate(e);
|
|
@@ -1107,10 +1107,10 @@ class U {
|
|
|
1107
1107
|
return this.reverseNode(t, e, void 0, !0), t;
|
|
1108
1108
|
}
|
|
1109
1109
|
static calculateHashMinimalBlueId(e) {
|
|
1110
|
-
return
|
|
1110
|
+
return M.calculateBlueIdSync(this.toHashMinimalNode(e));
|
|
1111
1111
|
}
|
|
1112
1112
|
static calculateHashMinimalListBlueId(e) {
|
|
1113
|
-
return
|
|
1113
|
+
return M.calculateBlueIdSync(
|
|
1114
1114
|
e.map((t) => this.toHashMinimalNode(t))
|
|
1115
1115
|
);
|
|
1116
1116
|
}
|
|
@@ -1194,14 +1194,14 @@ class U {
|
|
|
1194
1194
|
throw new Error(
|
|
1195
1195
|
`Resolved list has fewer items (${r.length}) than inherited list (${s.length}).`
|
|
1196
1196
|
);
|
|
1197
|
-
const n =
|
|
1197
|
+
const n = B.getMergePolicy(e, t), o = [];
|
|
1198
1198
|
for (let c = 0; c < s.length; c++)
|
|
1199
1199
|
U.calculateHashMinimalBlueId(r[c]) !== U.calculateHashMinimalBlueId(s[c]) && o.push(c);
|
|
1200
1200
|
if (o.length > 0 && n === "append-only")
|
|
1201
1201
|
throw new Error(
|
|
1202
1202
|
"append-only list cannot be minimized as a non-prefix mutation."
|
|
1203
1203
|
);
|
|
1204
|
-
const l = U.calculateHashMinimalListBlueId(s), a = [
|
|
1204
|
+
const l = U.calculateHashMinimalListBlueId(s), a = [B.createPreviousItem(l)];
|
|
1205
1205
|
for (const c of o) {
|
|
1206
1206
|
const d = new u();
|
|
1207
1207
|
this.reverseNode(
|
|
@@ -1211,7 +1211,7 @@ class U {
|
|
|
1211
1211
|
!1
|
|
1212
1212
|
);
|
|
1213
1213
|
const h = E.isEmptyNode(d) ? r[c].clone() : d;
|
|
1214
|
-
a.push(
|
|
1214
|
+
a.push(B.createPositionedItem(c, h));
|
|
1215
1215
|
}
|
|
1216
1216
|
for (let c = s.length; c < r.length; c++) {
|
|
1217
1217
|
const d = new u();
|
|
@@ -1334,7 +1334,7 @@ class X {
|
|
|
1334
1334
|
static RESERVED_PROPERTY_KEYS = /* @__PURE__ */ new Set([
|
|
1335
1335
|
sr,
|
|
1336
1336
|
St,
|
|
1337
|
-
|
|
1337
|
+
z
|
|
1338
1338
|
]);
|
|
1339
1339
|
static INTERNAL_PROPERTIES_KEY = "properties";
|
|
1340
1340
|
static validateStorageShape(e) {
|
|
@@ -1370,8 +1370,8 @@ class X {
|
|
|
1370
1370
|
r.insideItems && this.validateListControlItem(e, t, r.itemIndex ?? 0);
|
|
1371
1371
|
const s = e.getReferenceBlueId();
|
|
1372
1372
|
if (s !== void 0 && !E.hasBlueIdOnly(e))
|
|
1373
|
-
if (r.insideItems &&
|
|
1374
|
-
|
|
1373
|
+
if (r.insideItems && B.hasPositionProperty(e) && E.hasBlueIdOnly(B.withoutPosition(e)))
|
|
1374
|
+
B.readPosition(e);
|
|
1375
1375
|
else {
|
|
1376
1376
|
const h = this.toPointer(t);
|
|
1377
1377
|
throw new he(
|
|
@@ -1409,35 +1409,35 @@ class X {
|
|
|
1409
1409
|
this.validateNode(h, [...t, d], { insideItems: !1 });
|
|
1410
1410
|
}
|
|
1411
1411
|
static validateListControlItem(e, t, r) {
|
|
1412
|
-
if (
|
|
1412
|
+
if (B.hasEmptyProperty(e) && (B.hasPreviousProperty(e) && this.throwInvalidStorageShape(
|
|
1413
1413
|
t,
|
|
1414
1414
|
"$empty cannot be combined with $previous."
|
|
1415
|
-
),
|
|
1415
|
+
), B.hasPositionProperty(e) && this.throwInvalidStorageShape(
|
|
1416
1416
|
t,
|
|
1417
1417
|
"$empty cannot be combined with $pos."
|
|
1418
|
-
),
|
|
1418
|
+
), B.isEmptyItem(e) || this.throwInvalidStorageShape(
|
|
1419
1419
|
t,
|
|
1420
1420
|
"$empty list content must be exactly { $empty: true }."
|
|
1421
|
-
)),
|
|
1421
|
+
)), B.hasPreviousProperty(e) && (r !== 0 && this.throwInvalidStorageShape(
|
|
1422
1422
|
t,
|
|
1423
1423
|
"$previous list control is allowed only as the first item."
|
|
1424
|
-
),
|
|
1424
|
+
), B.isPreviousItem(e) || this.throwInvalidStorageShape(
|
|
1425
1425
|
t,
|
|
1426
1426
|
"$previous list control must be exactly { $previous: { blueId: <id> } }."
|
|
1427
|
-
)),
|
|
1428
|
-
|
|
1427
|
+
)), B.hasPositionProperty(e)) {
|
|
1428
|
+
B.hasPreviousProperty(e) && this.throwInvalidStorageShape(
|
|
1429
1429
|
t,
|
|
1430
1430
|
"$pos cannot be combined with $previous."
|
|
1431
1431
|
);
|
|
1432
1432
|
try {
|
|
1433
|
-
|
|
1433
|
+
B.readPosition(e);
|
|
1434
1434
|
} catch (s) {
|
|
1435
1435
|
this.throwInvalidStorageShape(
|
|
1436
1436
|
[...t, ce],
|
|
1437
1437
|
s instanceof Error ? s.message : "$pos must be a non-negative integer value."
|
|
1438
1438
|
);
|
|
1439
1439
|
}
|
|
1440
|
-
|
|
1440
|
+
B.hasPayloadAfterRemovingPosition(e) || this.throwInvalidStorageShape(
|
|
1441
1441
|
t,
|
|
1442
1442
|
"$pos list control must include an item payload."
|
|
1443
1443
|
);
|
|
@@ -1481,7 +1481,7 @@ class X {
|
|
|
1481
1481
|
return e.length === 0 ? "/" : `/${e.map((t) => t.replace(/~/g, "~0").replace(/\//g, "~1")).join("/")}`;
|
|
1482
1482
|
}
|
|
1483
1483
|
}
|
|
1484
|
-
class
|
|
1484
|
+
class Vn {
|
|
1485
1485
|
static convert(e) {
|
|
1486
1486
|
const t = Ae.decode(e), r = new Uint8Array(2 + t.length);
|
|
1487
1487
|
r[0] = 18, r[1] = 32, r.set(t, 2);
|
|
@@ -1489,7 +1489,7 @@ class Cn {
|
|
|
1489
1489
|
return s[0] = 1, s[1] = 85, s.set(r, 2), "b" + new Jr.Encoder({ type: "rfc4648", lc: !0 }).write(s).finalize().replace(/=/g, "");
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
|
-
class
|
|
1492
|
+
class T {
|
|
1493
1493
|
/**
|
|
1494
1494
|
* Converts a BlueNode to a JSON representation based on the specified strategy.
|
|
1495
1495
|
*
|
|
@@ -1504,7 +1504,7 @@ class B {
|
|
|
1504
1504
|
const { strategy: r } = this.normalizeOptions(t), s = e.getValue(), n = this.handleValue(s);
|
|
1505
1505
|
if (n !== void 0 && r === "simple")
|
|
1506
1506
|
return n;
|
|
1507
|
-
const o = e.getItems()?.map((F) =>
|
|
1507
|
+
const o = e.getItems()?.map((F) => T.get(F, r));
|
|
1508
1508
|
if (o !== void 0 && r === "simple")
|
|
1509
1509
|
return o;
|
|
1510
1510
|
const l = e.getName(), a = e.getDescription();
|
|
@@ -1519,21 +1519,21 @@ class B {
|
|
|
1519
1519
|
const d = e.getType();
|
|
1520
1520
|
if (r === "official" && s !== void 0 && d === void 0) {
|
|
1521
1521
|
const F = this.inferTypeBlueId(s);
|
|
1522
|
-
F !== null && (c[
|
|
1523
|
-
} else d !== void 0 && (c[
|
|
1522
|
+
F !== null && (c[K] = { [V]: F });
|
|
1523
|
+
} else d !== void 0 && (c[K] = T.get(d, r));
|
|
1524
1524
|
const h = e.getItemType();
|
|
1525
|
-
h !== void 0 && (c[we] =
|
|
1525
|
+
h !== void 0 && (c[we] = T.get(h, r));
|
|
1526
1526
|
const f = e.getKeyType();
|
|
1527
|
-
f !== void 0 && (c[Se] =
|
|
1527
|
+
f !== void 0 && (c[Se] = T.get(f, r));
|
|
1528
1528
|
const g = e.getValueType();
|
|
1529
|
-
g !== void 0 && (c[be] =
|
|
1529
|
+
g !== void 0 && (c[be] = T.get(g, r)), n !== void 0 && (c[W] = n), o !== void 0 && (c[Y] = o);
|
|
1530
1530
|
const I = e.getBlueId();
|
|
1531
1531
|
I !== void 0 && (c[V] = I);
|
|
1532
|
-
const
|
|
1533
|
-
|
|
1532
|
+
const L = e.getBlue();
|
|
1533
|
+
L !== void 0 && (c[Le] = L);
|
|
1534
1534
|
const w = e.getProperties();
|
|
1535
1535
|
return w !== void 0 && Object.entries(w).forEach(([F, P]) => {
|
|
1536
|
-
c[F] =
|
|
1536
|
+
c[F] = T.get(P, r);
|
|
1537
1537
|
}), c;
|
|
1538
1538
|
}
|
|
1539
1539
|
static handleValue(e) {
|
|
@@ -1558,7 +1558,7 @@ class B {
|
|
|
1558
1558
|
};
|
|
1559
1559
|
}
|
|
1560
1560
|
}
|
|
1561
|
-
class
|
|
1561
|
+
class D {
|
|
1562
1562
|
/**
|
|
1563
1563
|
* Transforms a node and all its child nodes using the provided transformer function
|
|
1564
1564
|
* @param node - The node to transform
|
|
@@ -1567,30 +1567,30 @@ class M {
|
|
|
1567
1567
|
*/
|
|
1568
1568
|
static transform(e, t) {
|
|
1569
1569
|
const r = t(e.clone()), s = r.getType();
|
|
1570
|
-
s !== void 0 && r.setType(
|
|
1570
|
+
s !== void 0 && r.setType(D.transform(s, t));
|
|
1571
1571
|
const n = r.getItemType();
|
|
1572
1572
|
n !== void 0 && r.setItemType(
|
|
1573
|
-
|
|
1573
|
+
D.transform(n, t)
|
|
1574
1574
|
);
|
|
1575
1575
|
const o = r.getKeyType();
|
|
1576
1576
|
o !== void 0 && r.setKeyType(
|
|
1577
|
-
|
|
1577
|
+
D.transform(o, t)
|
|
1578
1578
|
);
|
|
1579
1579
|
const l = r.getValueType();
|
|
1580
1580
|
l !== void 0 && r.setValueType(
|
|
1581
|
-
|
|
1581
|
+
D.transform(l, t)
|
|
1582
1582
|
);
|
|
1583
1583
|
const a = r.getItems();
|
|
1584
1584
|
if (a !== void 0) {
|
|
1585
1585
|
const d = a.map(
|
|
1586
|
-
(h) =>
|
|
1586
|
+
(h) => D.transform(h, t)
|
|
1587
1587
|
);
|
|
1588
1588
|
r.setItems(d);
|
|
1589
1589
|
}
|
|
1590
1590
|
const c = r.getProperties();
|
|
1591
1591
|
if (c !== void 0) {
|
|
1592
1592
|
const d = Object.keys(c).reduce(
|
|
1593
|
-
(h, f) => (h[f] =
|
|
1593
|
+
(h, f) => (h[f] = D.transform(c[f], t), h),
|
|
1594
1594
|
{}
|
|
1595
1595
|
);
|
|
1596
1596
|
r.setProperties(d);
|
|
@@ -1598,7 +1598,7 @@ class M {
|
|
|
1598
1598
|
return r;
|
|
1599
1599
|
}
|
|
1600
1600
|
}
|
|
1601
|
-
const le = (i) => !!i && typeof i == "object" && !Array.isArray(i) && !(i instanceof u), q = (i) => i instanceof A || i instanceof
|
|
1601
|
+
const le = (i) => !!i && typeof i == "object" && !Array.isArray(i) && !(i instanceof u), q = (i) => i instanceof A || i instanceof x, fs = (i) => i.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
1602
1602
|
function Ee(i) {
|
|
1603
1603
|
if (i === "/") return [];
|
|
1604
1604
|
if (!i.startsWith("/"))
|
|
@@ -1640,7 +1640,7 @@ function fr(i, e, t, r = !0) {
|
|
|
1640
1640
|
return i.getItems();
|
|
1641
1641
|
case "properties":
|
|
1642
1642
|
return i.getProperties();
|
|
1643
|
-
case
|
|
1643
|
+
case z:
|
|
1644
1644
|
return i.getContracts();
|
|
1645
1645
|
default:
|
|
1646
1646
|
return;
|
|
@@ -1666,7 +1666,7 @@ function Ft(i, e, t = !0) {
|
|
|
1666
1666
|
"blue",
|
|
1667
1667
|
"items",
|
|
1668
1668
|
"properties",
|
|
1669
|
-
|
|
1669
|
+
z
|
|
1670
1670
|
].includes(e))
|
|
1671
1671
|
return r;
|
|
1672
1672
|
if (/^-?\d+$/.test(e) && e !== "-") {
|
|
@@ -1727,7 +1727,7 @@ function Vt(i, e) {
|
|
|
1727
1727
|
"blue",
|
|
1728
1728
|
"items",
|
|
1729
1729
|
"properties",
|
|
1730
|
-
|
|
1730
|
+
z
|
|
1731
1731
|
].includes(t))
|
|
1732
1732
|
return r;
|
|
1733
1733
|
if (typeof e == "number" || typeof e == "string" && /^\d+$/.test(e)) {
|
|
@@ -1738,7 +1738,7 @@ function Vt(i, e) {
|
|
|
1738
1738
|
}
|
|
1739
1739
|
return Array.isArray(i) || le(i) ? i[e] : i;
|
|
1740
1740
|
}
|
|
1741
|
-
function
|
|
1741
|
+
function $(i) {
|
|
1742
1742
|
if (i instanceof u) return i;
|
|
1743
1743
|
if (i === null || typeof i == "string" || typeof i == "number" || typeof i == "boolean" || q(i))
|
|
1744
1744
|
return m.deserialize(i);
|
|
@@ -1766,22 +1766,22 @@ function Ot(i, e, t) {
|
|
|
1766
1766
|
return;
|
|
1767
1767
|
case "type":
|
|
1768
1768
|
i.setType(
|
|
1769
|
-
t instanceof u || typeof t == "string" || t === void 0 ? t :
|
|
1769
|
+
t instanceof u || typeof t == "string" || t === void 0 ? t : $(t)
|
|
1770
1770
|
);
|
|
1771
1771
|
return;
|
|
1772
1772
|
case "itemType":
|
|
1773
1773
|
i.setItemType(
|
|
1774
|
-
t instanceof u || typeof t == "string" || t === void 0 ? t :
|
|
1774
|
+
t instanceof u || typeof t == "string" || t === void 0 ? t : $(t)
|
|
1775
1775
|
);
|
|
1776
1776
|
return;
|
|
1777
1777
|
case "keyType":
|
|
1778
1778
|
i.setKeyType(
|
|
1779
|
-
t instanceof u || typeof t == "string" || t === void 0 ? t :
|
|
1779
|
+
t instanceof u || typeof t == "string" || t === void 0 ? t : $(t)
|
|
1780
1780
|
);
|
|
1781
1781
|
return;
|
|
1782
1782
|
case "valueType":
|
|
1783
1783
|
i.setValueType(
|
|
1784
|
-
t instanceof u || typeof t == "string" || t === void 0 ? t :
|
|
1784
|
+
t instanceof u || typeof t == "string" || t === void 0 ? t : $(t)
|
|
1785
1785
|
);
|
|
1786
1786
|
return;
|
|
1787
1787
|
case "value": {
|
|
@@ -1794,7 +1794,7 @@ function Ot(i, e, t) {
|
|
|
1794
1794
|
return;
|
|
1795
1795
|
case "blue":
|
|
1796
1796
|
i.setBlue(
|
|
1797
|
-
t instanceof u || t === void 0 ? t :
|
|
1797
|
+
t instanceof u || t === void 0 ? t : $(t)
|
|
1798
1798
|
);
|
|
1799
1799
|
return;
|
|
1800
1800
|
case "items":
|
|
@@ -1803,7 +1803,7 @@ function Ot(i, e, t) {
|
|
|
1803
1803
|
case "properties":
|
|
1804
1804
|
i.setProperties(t);
|
|
1805
1805
|
return;
|
|
1806
|
-
case
|
|
1806
|
+
case z:
|
|
1807
1807
|
i.setContracts(t);
|
|
1808
1808
|
return;
|
|
1809
1809
|
default: {
|
|
@@ -1811,7 +1811,7 @@ function Ot(i, e, t) {
|
|
|
1811
1811
|
const s = i.getProperties();
|
|
1812
1812
|
s && r in s && delete s[r];
|
|
1813
1813
|
} else
|
|
1814
|
-
i.getProperties() || i.setProperties({}), i.addProperty(r, t instanceof u ? t :
|
|
1814
|
+
i.getProperties() || i.setProperties({}), i.addProperty(r, t instanceof u ? t : $(t));
|
|
1815
1815
|
return;
|
|
1816
1816
|
}
|
|
1817
1817
|
}
|
|
@@ -1853,7 +1853,7 @@ function Ze(i, e, t, r) {
|
|
|
1853
1853
|
);
|
|
1854
1854
|
if (s < 0 && e !== "-")
|
|
1855
1855
|
throw new Error(`Invalid negative array index: ${e}`);
|
|
1856
|
-
const n =
|
|
1856
|
+
const n = $(t);
|
|
1857
1857
|
if (r) {
|
|
1858
1858
|
if (s >= 0 && s < i.length) i[s] = n;
|
|
1859
1859
|
else if (s >= i.length) {
|
|
@@ -1866,11 +1866,11 @@ function Ze(i, e, t, r) {
|
|
|
1866
1866
|
return;
|
|
1867
1867
|
}
|
|
1868
1868
|
if (i instanceof u) {
|
|
1869
|
-
e === "-" || typeof e == "number" && !isNaN(e) || typeof e == "string" && /^\d+$/.test(e) ? ys(i, e,
|
|
1869
|
+
e === "-" || typeof e == "number" && !isNaN(e) || typeof e == "string" && /^\d+$/.test(e) ? ys(i, e, $(t), r) : Ot(i, e, t);
|
|
1870
1870
|
return;
|
|
1871
1871
|
}
|
|
1872
1872
|
if (le(i)) {
|
|
1873
|
-
i[e] =
|
|
1873
|
+
i[e] = $(t);
|
|
1874
1874
|
return;
|
|
1875
1875
|
}
|
|
1876
1876
|
throw new Error(`Cannot insert into parent of type ${typeof i}`);
|
|
@@ -1925,7 +1925,7 @@ function yr(i, e) {
|
|
|
1925
1925
|
function gr(i, e, t) {
|
|
1926
1926
|
const r = Ee(e);
|
|
1927
1927
|
if (r.length === 0 && e === "/") {
|
|
1928
|
-
const o =
|
|
1928
|
+
const o = $(t);
|
|
1929
1929
|
i.setValue(o.getValue() ?? null), o.getItems() ? i.setItems(o.getItems()) : i.setItems(void 0);
|
|
1930
1930
|
return;
|
|
1931
1931
|
}
|
|
@@ -1936,10 +1936,10 @@ function ms(i, e, t) {
|
|
|
1936
1936
|
const r = Ee(e);
|
|
1937
1937
|
if (r.length === 0 && e === "/") {
|
|
1938
1938
|
if (i.getItems() && Array.isArray(t)) {
|
|
1939
|
-
const o =
|
|
1939
|
+
const o = $(t);
|
|
1940
1940
|
o.getItems() ? (i.setItems(o.getItems()), i.setValue(null)) : (i.setValue(o.getValue() ?? null), i.setItems(void 0));
|
|
1941
1941
|
} else {
|
|
1942
|
-
const o =
|
|
1942
|
+
const o = $(t);
|
|
1943
1943
|
i.setValue(o.getValue() ?? null), o.getItems() && i.setItems(o.getItems());
|
|
1944
1944
|
}
|
|
1945
1945
|
return !0;
|
|
@@ -1950,7 +1950,7 @@ function ms(i, e, t) {
|
|
|
1950
1950
|
function Is(i, e, t) {
|
|
1951
1951
|
const r = Ee(e);
|
|
1952
1952
|
if (r.length === 0 && e === "/") {
|
|
1953
|
-
const l =
|
|
1953
|
+
const l = $(t);
|
|
1954
1954
|
return i.setValue(l.getValue() ?? null), l.getItems() ? i.setItems(l.getItems()) : i.setItems(void 0), !0;
|
|
1955
1955
|
}
|
|
1956
1956
|
const { parent: s, key: n, actualTarget: o } = Ne(i, r);
|
|
@@ -1998,9 +1998,9 @@ function Bs(i, e, t) {
|
|
|
1998
1998
|
)}, got ${JSON.stringify(r.getValue() ?? null)}`
|
|
1999
1999
|
);
|
|
2000
2000
|
return !0;
|
|
2001
|
-
} else typeof t == "object" && !(t instanceof u) && (s =
|
|
2001
|
+
} else typeof t == "object" && !(t instanceof u) && (s = $(t));
|
|
2002
2002
|
else if (q(r) && typeof t == "number")
|
|
2003
|
-
r instanceof A ? s = new A(t.toString()) : r instanceof
|
|
2003
|
+
r instanceof A ? s = new A(t.toString()) : r instanceof x && (s = new x(t.toString()));
|
|
2004
2004
|
else if ((r === null || typeof r == "string" || typeof r == "number" || typeof r == "boolean") && q(t)) {
|
|
2005
2005
|
const n = t;
|
|
2006
2006
|
!ue(r, n.toString()) && (typeof r == "number" && parseFloat(n.toString()));
|
|
@@ -2029,7 +2029,7 @@ function Ps(i, e) {
|
|
|
2029
2029
|
return Bs(i, e.path, e.val);
|
|
2030
2030
|
}
|
|
2031
2031
|
}
|
|
2032
|
-
function
|
|
2032
|
+
function On(i, e, t = !1) {
|
|
2033
2033
|
const r = t ? i : i.clone();
|
|
2034
2034
|
return Ps(r, e), r;
|
|
2035
2035
|
}
|
|
@@ -2058,7 +2058,7 @@ const Z = (i) => Ir().get(i), Ss = (i) => (e) => {
|
|
|
2058
2058
|
}, bs = (i) => {
|
|
2059
2059
|
const e = Z(i);
|
|
2060
2060
|
return p(e) && wt(e.blueDescription) ? e.blueDescription : null;
|
|
2061
|
-
},
|
|
2061
|
+
}, Mn = (i) => Ss(i)(y.string().optional()), Es = y.union([y.string(), y.boolean()]), Ns = (i) => (e) => {
|
|
2062
2062
|
const t = Z(e);
|
|
2063
2063
|
return $e(e, {
|
|
2064
2064
|
...t,
|
|
@@ -2067,7 +2067,7 @@ const Z = (i) => Ir().get(i), Ss = (i) => (e) => {
|
|
|
2067
2067
|
}, Cs = (i) => {
|
|
2068
2068
|
const e = Z(i), t = Es.safeParse(e?.blueId);
|
|
2069
2069
|
return t.success ? t.data : null;
|
|
2070
|
-
},
|
|
2070
|
+
}, Dn = (i) => Ns(i ?? !0)(y.string()), Rs = (i) => (e) => {
|
|
2071
2071
|
const t = Z(e);
|
|
2072
2072
|
return $e(e, {
|
|
2073
2073
|
...t,
|
|
@@ -2076,7 +2076,7 @@ const Z = (i) => Ir().get(i), Ss = (i) => (e) => {
|
|
|
2076
2076
|
}, As = (i) => {
|
|
2077
2077
|
const e = Z(i);
|
|
2078
2078
|
return p(e) && wt(e.blueName) ? e.blueName : null;
|
|
2079
|
-
},
|
|
2079
|
+
}, xn = (i) => {
|
|
2080
2080
|
const e = y.string().optional();
|
|
2081
2081
|
return Rs(i)(e);
|
|
2082
2082
|
}, Vs = () => (i) => {
|
|
@@ -2088,7 +2088,7 @@ const Z = (i) => Ir().get(i), Ss = (i) => (e) => {
|
|
|
2088
2088
|
}, Os = (i) => {
|
|
2089
2089
|
const e = Z(i);
|
|
2090
2090
|
return p(e) && p(e.blueNode) && e.blueNode === !0 ? e.blueNode : null;
|
|
2091
|
-
}, vr = (i) => !!Os(i),
|
|
2091
|
+
}, vr = (i) => !!Os(i), Ln = () => {
|
|
2092
2092
|
const i = y.instanceof(u);
|
|
2093
2093
|
return Vs()(i);
|
|
2094
2094
|
}, Ms = y.object({
|
|
@@ -2200,7 +2200,7 @@ function N(i, e, t) {
|
|
|
2200
2200
|
}
|
|
2201
2201
|
function Xe(i) {
|
|
2202
2202
|
const e = i.getReferenceBlueId();
|
|
2203
|
-
return e !== void 0 ? e :
|
|
2203
|
+
return e !== void 0 ? e : M.calculateBlueIdSync(
|
|
2204
2204
|
se(i)
|
|
2205
2205
|
);
|
|
2206
2206
|
}
|
|
@@ -2292,11 +2292,11 @@ function Us(i, e) {
|
|
|
2292
2292
|
const t = new u().setBlueId(ee);
|
|
2293
2293
|
return N(i, t, e);
|
|
2294
2294
|
}
|
|
2295
|
-
function
|
|
2295
|
+
function zs(i, e) {
|
|
2296
2296
|
const t = new u().setBlueId(re);
|
|
2297
2297
|
return N(i, t, e);
|
|
2298
2298
|
}
|
|
2299
|
-
function
|
|
2299
|
+
function Ke(i, e) {
|
|
2300
2300
|
const t = new u().setBlueId(tt);
|
|
2301
2301
|
return N(i, t, e);
|
|
2302
2302
|
}
|
|
@@ -2304,7 +2304,7 @@ function ke(i, e) {
|
|
|
2304
2304
|
const t = new u().setBlueId(Ct);
|
|
2305
2305
|
return N(i, t, e);
|
|
2306
2306
|
}
|
|
2307
|
-
function
|
|
2307
|
+
function Ks(i, e) {
|
|
2308
2308
|
return et.some((t) => {
|
|
2309
2309
|
const r = new u().setName(t);
|
|
2310
2310
|
return N(i, r, e);
|
|
@@ -2375,7 +2375,7 @@ class Hs {
|
|
|
2375
2375
|
}
|
|
2376
2376
|
getEffectiveBlueId(e) {
|
|
2377
2377
|
const t = e.getType();
|
|
2378
|
-
return p(t) && p(t.getBlueId()) ? t.getBlueId() : p(t) ?
|
|
2378
|
+
return p(t) && p(t.getBlueId()) ? t.getBlueId() : p(t) ? M.calculateBlueIdSync(t) : null;
|
|
2379
2379
|
}
|
|
2380
2380
|
getBlueIdMap() {
|
|
2381
2381
|
return new Map(this.blueIdMap);
|
|
@@ -2408,7 +2408,7 @@ class Re {
|
|
|
2408
2408
|
}
|
|
2409
2409
|
}
|
|
2410
2410
|
}
|
|
2411
|
-
function
|
|
2411
|
+
function zt(i, e) {
|
|
2412
2412
|
const t = i.split(e), r = [...t].reverse().findIndex((n) => n !== ""), s = r === -1 ? 0 : t.length - r;
|
|
2413
2413
|
return t.slice(0, s);
|
|
2414
2414
|
}
|
|
@@ -2463,7 +2463,7 @@ class it extends Mt {
|
|
|
2463
2463
|
* @returns True if the path matches the allowed path pattern, false otherwise
|
|
2464
2464
|
*/
|
|
2465
2465
|
matchesAllowedPath(e, t) {
|
|
2466
|
-
const r =
|
|
2466
|
+
const r = zt(e, "/"), s = zt(t, "/");
|
|
2467
2467
|
if (s.length > r.length)
|
|
2468
2468
|
return !1;
|
|
2469
2469
|
for (let n = 1; n < s.length; n++)
|
|
@@ -2690,7 +2690,7 @@ class J extends u {
|
|
|
2690
2690
|
);
|
|
2691
2691
|
}
|
|
2692
2692
|
const t = new mt().minimizeResolvedForHash(this);
|
|
2693
|
-
return
|
|
2693
|
+
return M.calculateBlueIdSync(t);
|
|
2694
2694
|
}
|
|
2695
2695
|
/**
|
|
2696
2696
|
* Creates a clone of this ResolvedBlueNode
|
|
@@ -2876,7 +2876,7 @@ class Ys {
|
|
|
2876
2876
|
))
|
|
2877
2877
|
return !1;
|
|
2878
2878
|
}
|
|
2879
|
-
const I = t.getProperties(),
|
|
2879
|
+
const I = t.getProperties(), L = r.getProperties();
|
|
2880
2880
|
if (I !== void 0) {
|
|
2881
2881
|
const P = e.getProperties() ?? {};
|
|
2882
2882
|
for (const [S, ot] of Object.entries(I))
|
|
@@ -2884,7 +2884,7 @@ class Ys {
|
|
|
2884
2884
|
if (!this.recursiveValueComparison(
|
|
2885
2885
|
P[S],
|
|
2886
2886
|
ot,
|
|
2887
|
-
|
|
2887
|
+
L?.[S] ?? ot,
|
|
2888
2888
|
s
|
|
2889
2889
|
))
|
|
2890
2890
|
return !1;
|
|
@@ -2978,13 +2978,13 @@ class Ys {
|
|
|
2978
2978
|
* shape of the requested core list or dictionary type.
|
|
2979
2979
|
*/
|
|
2980
2980
|
matchesImplicitStructure(e, t) {
|
|
2981
|
-
return t === void 0 || e.getType() !== void 0 ? !1 :
|
|
2981
|
+
return t === void 0 || e.getType() !== void 0 ? !1 : Ke(t, this.blue.getNodeProvider()) ? this.isImplicitListStructure(e) : ke(t, this.blue.getNodeProvider()) ? this.isImplicitDictionaryStructure(e) : !1;
|
|
2982
2982
|
}
|
|
2983
2983
|
matchesImplicitCoreCollectionType(e, t) {
|
|
2984
|
-
return e.getType() !== void 0 ? !1 :
|
|
2984
|
+
return e.getType() !== void 0 ? !1 : Ke(t, this.blue.getNodeProvider()) ? this.isImplicitListStructure(e) : ke(t, this.blue.getNodeProvider()) ? this.isImplicitDictionaryStructure(e) : !1;
|
|
2985
2985
|
}
|
|
2986
2986
|
isCoreCollectionType(e) {
|
|
2987
|
-
return
|
|
2987
|
+
return Ke(e, this.blue.getNodeProvider()) || ke(e, this.blue.getNodeProvider());
|
|
2988
2988
|
}
|
|
2989
2989
|
isImplicitListStructure(e) {
|
|
2990
2990
|
return e.getItems() !== void 0 && e.getValue() === void 0;
|
|
@@ -3062,13 +3062,13 @@ class Ys {
|
|
|
3062
3062
|
return r.add(t), r;
|
|
3063
3063
|
}
|
|
3064
3064
|
}
|
|
3065
|
-
class
|
|
3065
|
+
class O {
|
|
3066
3066
|
static ZERO_BLUE_ID = "0".repeat(44);
|
|
3067
3067
|
static THIS_INDEX_REFERENCE_PATTERN = /^this#(\d+)$/;
|
|
3068
3068
|
prepareDocument;
|
|
3069
3069
|
calculateBlueId;
|
|
3070
3070
|
constructor(e = {}) {
|
|
3071
|
-
this.prepareDocument = e.prepareDocument ?? ((t) => t), this.calculateBlueId = e.calculateBlueId ??
|
|
3071
|
+
this.prepareDocument = e.prepareDocument ?? ((t) => t), this.calculateBlueId = e.calculateBlueId ?? M.calculateBlueIdSync;
|
|
3072
3072
|
}
|
|
3073
3073
|
static hasThisReference(e) {
|
|
3074
3074
|
return e.some((t) => this.nodeHasThisReference(t));
|
|
@@ -3085,7 +3085,7 @@ class $ {
|
|
|
3085
3085
|
const c = this.prepareDocument(
|
|
3086
3086
|
this.replaceIndexedThisReferences(
|
|
3087
3087
|
l,
|
|
3088
|
-
() =>
|
|
3088
|
+
() => O.ZERO_BLUE_ID
|
|
3089
3089
|
)
|
|
3090
3090
|
);
|
|
3091
3091
|
return {
|
|
@@ -3143,7 +3143,7 @@ class $ {
|
|
|
3143
3143
|
throw new Error(
|
|
3144
3144
|
"Direct cyclic document sets must use indexed references such as 'this#0'; unindexed 'this' is not supported."
|
|
3145
3145
|
);
|
|
3146
|
-
if (r.startsWith("this#") &&
|
|
3146
|
+
if (r.startsWith("this#") && !O.THIS_INDEX_REFERENCE_PATTERN.test(
|
|
3147
3147
|
r
|
|
3148
3148
|
))
|
|
3149
3149
|
throw new Error(
|
|
@@ -3179,14 +3179,14 @@ class $ {
|
|
|
3179
3179
|
static nodeHasIndexedThisReference(e) {
|
|
3180
3180
|
let t = !1;
|
|
3181
3181
|
return this.visitNodeReferences(e, (r, s) => {
|
|
3182
|
-
|
|
3182
|
+
O.THIS_INDEX_REFERENCE_PATTERN.test(
|
|
3183
3183
|
s
|
|
3184
3184
|
) && (t = !0);
|
|
3185
3185
|
}), t;
|
|
3186
3186
|
}
|
|
3187
3187
|
visitReferences(e, t) {
|
|
3188
3188
|
e.forEach(
|
|
3189
|
-
(r) =>
|
|
3189
|
+
(r) => O.visitNodeReferences(r, t)
|
|
3190
3190
|
);
|
|
3191
3191
|
}
|
|
3192
3192
|
static visitNodeReferences(e, t) {
|
|
@@ -3197,13 +3197,13 @@ class $ {
|
|
|
3197
3197
|
}
|
|
3198
3198
|
readIndexedThisReference(e) {
|
|
3199
3199
|
const t = e.match(
|
|
3200
|
-
|
|
3200
|
+
O.THIS_INDEX_REFERENCE_PATTERN
|
|
3201
3201
|
);
|
|
3202
3202
|
if (t !== null)
|
|
3203
3203
|
return Number(t[1]);
|
|
3204
3204
|
}
|
|
3205
3205
|
childrenOf(e) {
|
|
3206
|
-
return
|
|
3206
|
+
return O.childrenOf(e);
|
|
3207
3207
|
}
|
|
3208
3208
|
static childrenOf(e) {
|
|
3209
3209
|
return [
|
|
@@ -3281,7 +3281,7 @@ const dt = pe.types.float.options, Gs = {
|
|
|
3281
3281
|
construct: (i) => {
|
|
3282
3282
|
const e = i.replace(/_/g, "").toLowerCase();
|
|
3283
3283
|
if (!Jt(e))
|
|
3284
|
-
return new
|
|
3284
|
+
return new x(e);
|
|
3285
3285
|
if (dt.construct)
|
|
3286
3286
|
return dt.construct(i);
|
|
3287
3287
|
}
|
|
@@ -3354,10 +3354,10 @@ class si extends ye {
|
|
|
3354
3354
|
if (Array.isArray(t)) {
|
|
3355
3355
|
const r = t.map(
|
|
3356
3356
|
(n) => m.deserialize(n)
|
|
3357
|
-
), s =
|
|
3357
|
+
), s = M.calculateBlueIdSync(r);
|
|
3358
3358
|
this.blueIdToNodesMap.set(s, r);
|
|
3359
3359
|
} else {
|
|
3360
|
-
const r = m.deserialize(t), s =
|
|
3360
|
+
const r = m.deserialize(t), s = M.calculateBlueIdSync(r);
|
|
3361
3361
|
this.blueIdToNodesMap.set(s, [r]);
|
|
3362
3362
|
}
|
|
3363
3363
|
}
|
|
@@ -3424,8 +3424,8 @@ class Lt {
|
|
|
3424
3424
|
const I = f[0];
|
|
3425
3425
|
this.mergeNodes(e, I, g);
|
|
3426
3426
|
} else {
|
|
3427
|
-
const I = f.map((w) => w.clone()),
|
|
3428
|
-
this.mergeNodes(e,
|
|
3427
|
+
const I = f.map((w) => w.clone()), L = new u().setItems(I);
|
|
3428
|
+
this.mergeNodes(e, L, g);
|
|
3429
3429
|
}
|
|
3430
3430
|
}
|
|
3431
3431
|
}
|
|
@@ -3554,7 +3554,7 @@ class de extends Ws {
|
|
|
3554
3554
|
*/
|
|
3555
3555
|
mergeChildren(e, t, r) {
|
|
3556
3556
|
const s = t.getItems() ?? [];
|
|
3557
|
-
return
|
|
3557
|
+
return B.hasListControlItems(s) ? this.mergeChildrenWithListControls(e, t, r) : this.mergeChildrenWithoutListControls(
|
|
3558
3558
|
e,
|
|
3559
3559
|
s,
|
|
3560
3560
|
r
|
|
@@ -3616,11 +3616,11 @@ class de extends Ws {
|
|
|
3616
3616
|
return e.cloneShallow().setItems(n);
|
|
3617
3617
|
}
|
|
3618
3618
|
mergeChildrenWithListControls(e, t, r) {
|
|
3619
|
-
const s = t.getItems() ?? [], n = e.getItems() ?? [], o =
|
|
3619
|
+
const s = t.getItems() ?? [], n = e.getItems() ?? [], o = B.getMergePolicy(t, e), l = [...n];
|
|
3620
3620
|
let a = 0, c = !1;
|
|
3621
3621
|
const d = s[0];
|
|
3622
|
-
if (d !== void 0 &&
|
|
3623
|
-
if (
|
|
3622
|
+
if (d !== void 0 && B.hasPreviousProperty(d)) {
|
|
3623
|
+
if (B.getPreviousBlueId(d) === void 0)
|
|
3624
3624
|
throw new Error(
|
|
3625
3625
|
"$previous list control must be exactly { $previous: { blueId: <id> } }."
|
|
3626
3626
|
);
|
|
@@ -3629,11 +3629,11 @@ class de extends Ws {
|
|
|
3629
3629
|
const h = c && n.length === 0 && !(r.limits instanceof H), f = /* @__PURE__ */ new Set();
|
|
3630
3630
|
for (; a < s.length; a++) {
|
|
3631
3631
|
const g = s[a];
|
|
3632
|
-
if (
|
|
3632
|
+
if (B.hasPreviousProperty(g))
|
|
3633
3633
|
throw new Error(
|
|
3634
3634
|
"$previous list control is allowed only as the first item."
|
|
3635
3635
|
);
|
|
3636
|
-
const I =
|
|
3636
|
+
const I = B.readPosition(g);
|
|
3637
3637
|
if (I !== void 0) {
|
|
3638
3638
|
if (o === "append-only")
|
|
3639
3639
|
throw new Error("$pos is not allowed in append-only lists.");
|
|
@@ -3644,29 +3644,29 @@ class de extends Ws {
|
|
|
3644
3644
|
if (f.has(I))
|
|
3645
3645
|
throw new Error(`Duplicate $pos list overlay for index ${I}.`);
|
|
3646
3646
|
f.add(I);
|
|
3647
|
-
const w =
|
|
3648
|
-
if (!
|
|
3647
|
+
const w = B.withoutPosition(g);
|
|
3648
|
+
if (!B.hasPayloadAfterRemovingPosition(g))
|
|
3649
3649
|
throw new Error("$pos list control must include an item payload.");
|
|
3650
3650
|
if (!r.limits.shouldMergePathSegment(String(I), w))
|
|
3651
3651
|
continue;
|
|
3652
3652
|
this.enterPathSegment(r, String(I), w);
|
|
3653
3653
|
try {
|
|
3654
3654
|
const F = l[I];
|
|
3655
|
-
l[I] = F === void 0 ||
|
|
3655
|
+
l[I] = F === void 0 || B.isReplacementPayload(w) ? this.materializeForCurrentContext(w, r) : this.mergeWithContext(F, w, r);
|
|
3656
3656
|
} finally {
|
|
3657
3657
|
this.exitPathSegment(r);
|
|
3658
3658
|
}
|
|
3659
3659
|
continue;
|
|
3660
3660
|
}
|
|
3661
|
-
const
|
|
3662
|
-
if (!(!h && !r.limits.shouldMergePathSegment(String(
|
|
3661
|
+
const L = l.length;
|
|
3662
|
+
if (!(!h && !r.limits.shouldMergePathSegment(String(L), g))) {
|
|
3663
3663
|
if (h) {
|
|
3664
3664
|
l.push(
|
|
3665
3665
|
this.materializeWithoutLimits(g, r)
|
|
3666
3666
|
);
|
|
3667
3667
|
continue;
|
|
3668
3668
|
}
|
|
3669
|
-
this.enterPathSegment(r, String(
|
|
3669
|
+
this.enterPathSegment(r, String(L), g);
|
|
3670
3670
|
try {
|
|
3671
3671
|
const w = this.materializeForCurrentContext(
|
|
3672
3672
|
g,
|
|
@@ -3721,8 +3721,8 @@ class de extends Ws {
|
|
|
3721
3721
|
w,
|
|
3722
3722
|
s
|
|
3723
3723
|
);
|
|
3724
|
-
})(),
|
|
3725
|
-
|
|
3724
|
+
})(), L = h === void 0 ? I : this.projectListNodeToCurrentLimits(I, s);
|
|
3725
|
+
L !== d && (l || (o = { ...n }, l = !0), o[a] = L);
|
|
3726
3726
|
} finally {
|
|
3727
3727
|
this.exitPathSegment(s);
|
|
3728
3728
|
}
|
|
@@ -3736,7 +3736,7 @@ class de extends Ws {
|
|
|
3736
3736
|
* through mergeWithContext so source type overlays are resolved.
|
|
3737
3737
|
*/
|
|
3738
3738
|
shouldMergePropertyWithoutPreResolve(e, t, r) {
|
|
3739
|
-
return v(e) || r.limits instanceof H ? p(e) &&
|
|
3739
|
+
return v(e) || r.limits instanceof H ? p(e) && B.hasListControlItems(t.getItems()) : p(t.getItems()) || p(e.getItems());
|
|
3740
3740
|
}
|
|
3741
3741
|
mergeExistingProperty(e, t, r) {
|
|
3742
3742
|
if (e === void 0)
|
|
@@ -3842,7 +3842,7 @@ class de extends Ws {
|
|
|
3842
3842
|
return t.nodeHashCache.set(e, s), s;
|
|
3843
3843
|
}
|
|
3844
3844
|
getPathLimitedListControlTarget(e, t, r, s, n) {
|
|
3845
|
-
if (!(e === void 0 || n.limits instanceof H || !
|
|
3845
|
+
if (!(e === void 0 || n.limits instanceof H || !B.hasListControlItems(s.getItems())))
|
|
3846
3846
|
return this.resolveFullInheritedProperty(t, r, n);
|
|
3847
3847
|
}
|
|
3848
3848
|
resolveFullInheritedProperty(e, t, r) {
|
|
@@ -3937,7 +3937,7 @@ class Nr {
|
|
|
3937
3937
|
s,
|
|
3938
3938
|
r
|
|
3939
3939
|
)) {
|
|
3940
|
-
const a =
|
|
3940
|
+
const a = T.get(n), c = T.get(s);
|
|
3941
3941
|
throw new Error(
|
|
3942
3942
|
`The source type '${JSON.stringify(
|
|
3943
3943
|
a
|
|
@@ -3954,7 +3954,7 @@ class Nr {
|
|
|
3954
3954
|
class Cr {
|
|
3955
3955
|
process(e, t, r) {
|
|
3956
3956
|
const s = t.getItemType(), n = t.getType();
|
|
3957
|
-
if (s !== void 0 && n !== void 0 && !
|
|
3957
|
+
if (s !== void 0 && n !== void 0 && !Ke(n, r))
|
|
3958
3958
|
throw new Error("Source node with itemType must have a List type");
|
|
3959
3959
|
const o = e.getItemType();
|
|
3960
3960
|
let l = e;
|
|
@@ -3966,7 +3966,7 @@ class Cr {
|
|
|
3966
3966
|
o,
|
|
3967
3967
|
r
|
|
3968
3968
|
)) {
|
|
3969
|
-
const h =
|
|
3969
|
+
const h = T.get(s), f = T.get(o);
|
|
3970
3970
|
throw new Error(
|
|
3971
3971
|
`The source item type '${JSON.stringify(
|
|
3972
3972
|
h
|
|
@@ -3986,7 +3986,7 @@ class Cr {
|
|
|
3986
3986
|
a,
|
|
3987
3987
|
r
|
|
3988
3988
|
)) {
|
|
3989
|
-
const f =
|
|
3989
|
+
const f = T.get(h), g = T.get(
|
|
3990
3990
|
a
|
|
3991
3991
|
);
|
|
3992
3992
|
throw new Error(
|
|
@@ -4026,7 +4026,7 @@ class Rr {
|
|
|
4026
4026
|
s,
|
|
4027
4027
|
r
|
|
4028
4028
|
)) {
|
|
4029
|
-
const l =
|
|
4029
|
+
const l = T.get(n), a = T.get(s);
|
|
4030
4030
|
throw new Error(
|
|
4031
4031
|
`The source key type '${JSON.stringify(
|
|
4032
4032
|
l
|
|
@@ -4050,7 +4050,7 @@ class Rr {
|
|
|
4050
4050
|
s,
|
|
4051
4051
|
r
|
|
4052
4052
|
)) {
|
|
4053
|
-
const l =
|
|
4053
|
+
const l = T.get(n), a = T.get(s);
|
|
4054
4054
|
throw new Error(
|
|
4055
4055
|
`The source value type '${JSON.stringify(
|
|
4056
4056
|
l
|
|
@@ -4077,7 +4077,7 @@ class Rr {
|
|
|
4077
4077
|
const s = Number.parseFloat(e);
|
|
4078
4078
|
if (Number.isNaN(s))
|
|
4079
4079
|
throw new Error(`Key '${e}' is not a valid Number.`);
|
|
4080
|
-
} else if (
|
|
4080
|
+
} else if (zs(t, r)) {
|
|
4081
4081
|
if (e.toLowerCase() !== "true" && e.toLowerCase() !== "false")
|
|
4082
4082
|
throw new Error(`Key '${e}' is not a valid Boolean.`);
|
|
4083
4083
|
} else
|
|
@@ -4088,7 +4088,7 @@ class Rr {
|
|
|
4088
4088
|
validateValueType(e, t, r) {
|
|
4089
4089
|
const s = e.getType();
|
|
4090
4090
|
if (s !== void 0 && !N(s, t, r)) {
|
|
4091
|
-
const n =
|
|
4091
|
+
const n = T.get(s), o = T.get(t);
|
|
4092
4092
|
throw new Error(
|
|
4093
4093
|
`Value of type '${JSON.stringify(
|
|
4094
4094
|
n
|
|
@@ -4105,7 +4105,7 @@ class Ar {
|
|
|
4105
4105
|
}
|
|
4106
4106
|
postProcess(e, t, r) {
|
|
4107
4107
|
const s = e.getType();
|
|
4108
|
-
if (s !== void 0 &&
|
|
4108
|
+
if (s !== void 0 && Ks(s, r)) {
|
|
4109
4109
|
const n = e.getItems(), o = e.getProperties();
|
|
4110
4110
|
if (n !== void 0 && n.length > 0 || o !== void 0 && Object.keys(o).length > 0) {
|
|
4111
4111
|
const l = ks(
|
|
@@ -4129,7 +4129,7 @@ class Vr {
|
|
|
4129
4129
|
return n !== void 0 && n !== r.getDescription() && (r = r.cloneShallow().setDescription(n)), r;
|
|
4130
4130
|
}
|
|
4131
4131
|
}
|
|
4132
|
-
const
|
|
4132
|
+
const $n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4133
4133
|
__proto__: null,
|
|
4134
4134
|
BasicTypesVerifier: Ar,
|
|
4135
4135
|
DictionaryProcessor: Rr,
|
|
@@ -4159,7 +4159,7 @@ class He {
|
|
|
4159
4159
|
}
|
|
4160
4160
|
/** @internal */
|
|
4161
4161
|
createCyclicSetIdentityService() {
|
|
4162
|
-
return new
|
|
4162
|
+
return new O({
|
|
4163
4163
|
prepareDocument: (e) => this.prepareCyclicDocument(e),
|
|
4164
4164
|
calculateBlueId: (e) => this.hashCyclicPrepared(e)
|
|
4165
4165
|
});
|
|
@@ -4211,17 +4211,17 @@ class He {
|
|
|
4211
4211
|
return this.hashMinimalTrustedWithProvider(e, this.nodeProvider);
|
|
4212
4212
|
}
|
|
4213
4213
|
hashMinimalTrustedWithProvider(e, t) {
|
|
4214
|
-
return Array.isArray(e) ? (X.validateStorageListShape(e),
|
|
4214
|
+
return Array.isArray(e) ? (X.validateStorageListShape(e), M.calculateBlueIdSync(
|
|
4215
4215
|
this.toHashableMinimalTrusted(e, t)
|
|
4216
|
-
)) : (X.validateStorageShape(e),
|
|
4216
|
+
)) : (X.validateStorageShape(e), M.calculateBlueIdSync(
|
|
4217
4217
|
this.toHashableMinimalTrusted(e, t)
|
|
4218
4218
|
));
|
|
4219
4219
|
}
|
|
4220
4220
|
/** @internal */
|
|
4221
4221
|
hashMinimalTrustedAsync(e) {
|
|
4222
|
-
return Array.isArray(e) ? (X.validateStorageListShape(e),
|
|
4222
|
+
return Array.isArray(e) ? (X.validateStorageListShape(e), M.calculateBlueId(
|
|
4223
4223
|
this.toHashableMinimalTrusted(e)
|
|
4224
|
-
)) : (X.validateStorageShape(e),
|
|
4224
|
+
)) : (X.validateStorageShape(e), M.calculateBlueId(
|
|
4225
4225
|
this.toHashableMinimalTrusted(e)
|
|
4226
4226
|
));
|
|
4227
4227
|
}
|
|
@@ -4231,7 +4231,7 @@ class He {
|
|
|
4231
4231
|
) : this.toHashableMinimalTrustedNode(e, t);
|
|
4232
4232
|
}
|
|
4233
4233
|
toHashableMinimalTrustedNode(e, t = this.nodeProvider) {
|
|
4234
|
-
if (!
|
|
4234
|
+
if (!B.hasPositionControl(e))
|
|
4235
4235
|
return e;
|
|
4236
4236
|
const r = new de(this.mergingProcessor, t).resolve(
|
|
4237
4237
|
e,
|
|
@@ -4255,7 +4255,7 @@ class He {
|
|
|
4255
4255
|
const e = this.nodeProvider;
|
|
4256
4256
|
return new class extends ye {
|
|
4257
4257
|
fetchByBlueId(t) {
|
|
4258
|
-
return t ===
|
|
4258
|
+
return t === O.ZERO_BLUE_ID || O.isIndexedThisReference(t) ? [new u().setReferenceBlueId(t)] : e.fetchByBlueId(t);
|
|
4259
4259
|
}
|
|
4260
4260
|
}();
|
|
4261
4261
|
}
|
|
@@ -4265,13 +4265,13 @@ class He {
|
|
|
4265
4265
|
tryCalculateCyclicSetBlueId(e) {
|
|
4266
4266
|
const t = this.getTopLevelSetItems(e);
|
|
4267
4267
|
if (t === void 0) {
|
|
4268
|
-
if (!Array.isArray(e) &&
|
|
4268
|
+
if (!Array.isArray(e) && O.hasThisReference([e]))
|
|
4269
4269
|
throw new Error(
|
|
4270
4270
|
"Direct cyclic references using 'this#k' are supported only in a top-level document set."
|
|
4271
4271
|
);
|
|
4272
4272
|
return;
|
|
4273
4273
|
}
|
|
4274
|
-
if (
|
|
4274
|
+
if (O.hasThisReference(t))
|
|
4275
4275
|
return this.cyclicSetIdentity.calculate(t).blueId;
|
|
4276
4276
|
}
|
|
4277
4277
|
getTopLevelSetItems(e) {
|
|
@@ -4310,7 +4310,7 @@ class ni {
|
|
|
4310
4310
|
const r = e.map(
|
|
4311
4311
|
(o) => this.preprocessForStorage(o, t)
|
|
4312
4312
|
);
|
|
4313
|
-
if (
|
|
4313
|
+
if (O.hasThisReference(r)) {
|
|
4314
4314
|
const o = this.cyclicSetIdentity.calculate(r);
|
|
4315
4315
|
return o.nodes.forEach(
|
|
4316
4316
|
(l) => X.validateStorageShape(l)
|
|
@@ -4357,12 +4357,12 @@ class ni {
|
|
|
4357
4357
|
);
|
|
4358
4358
|
}
|
|
4359
4359
|
}
|
|
4360
|
-
const oi = (i) => i instanceof Zt || i instanceof Xt || i instanceof qt || i instanceof Qt || i instanceof We || i instanceof Ge, li = (i) => i instanceof ge || i instanceof me || i instanceof Ue || i instanceof
|
|
4360
|
+
const oi = (i) => i instanceof Zt || i instanceof Xt || i instanceof qt || i instanceof Qt || i instanceof We || i instanceof Ge, li = (i) => i instanceof ge || i instanceof me || i instanceof Ue || i instanceof ze;
|
|
4361
4361
|
class Or {
|
|
4362
4362
|
static convertValue(e, t) {
|
|
4363
4363
|
const r = e.getType()?.getBlueId(), s = e.getValue();
|
|
4364
|
-
return v(s) ? li(t) && E.isValidValueNode(e) ? this.getDefaultPrimitiveValue(t) : s : Q === r ? this.convertFromString(String(s), t) : ee === r || s instanceof
|
|
4365
|
-
new
|
|
4364
|
+
return v(s) ? li(t) && E.isValidValueNode(e) ? this.getDefaultPrimitiveValue(t) : s : Q === r ? this.convertFromString(String(s), t) : ee === r || s instanceof x ? this.convertFromBigDecimal(
|
|
4365
|
+
new x(s?.toString()),
|
|
4366
4366
|
t
|
|
4367
4367
|
) : te === r || s instanceof A ? this.convertFromBigInteger(
|
|
4368
4368
|
new A(s?.toString()),
|
|
@@ -4376,7 +4376,7 @@ class Or {
|
|
|
4376
4376
|
return Number(e);
|
|
4377
4377
|
if (t instanceof Ue)
|
|
4378
4378
|
return e.toLowerCase() === "true";
|
|
4379
|
-
if (t instanceof
|
|
4379
|
+
if (t instanceof ze)
|
|
4380
4380
|
return BigInt(e);
|
|
4381
4381
|
throw new Error(`Cannot convert String to ${t._def.typeName}`);
|
|
4382
4382
|
}
|
|
@@ -4390,7 +4390,7 @@ class Or {
|
|
|
4390
4390
|
static convertFromBigInteger(e, t) {
|
|
4391
4391
|
if (t instanceof me)
|
|
4392
4392
|
return e.toNumber();
|
|
4393
|
-
if (t instanceof
|
|
4393
|
+
if (t instanceof ze)
|
|
4394
4394
|
return BigInt(e.toString());
|
|
4395
4395
|
if (t instanceof ge)
|
|
4396
4396
|
return e.toString();
|
|
@@ -4403,7 +4403,7 @@ class Or {
|
|
|
4403
4403
|
return e.toString();
|
|
4404
4404
|
if (t instanceof me)
|
|
4405
4405
|
return Number(e);
|
|
4406
|
-
if (t instanceof
|
|
4406
|
+
if (t instanceof ze)
|
|
4407
4407
|
return BigInt(e);
|
|
4408
4408
|
throw new Error(`Cannot convert Boolean to ${t._def.typeName}`);
|
|
4409
4409
|
}
|
|
@@ -4437,15 +4437,15 @@ class ci {
|
|
|
4437
4437
|
const r = t._def.left, s = t._def.right, n = this.convert(e, r), o = this.convert(e, s);
|
|
4438
4438
|
return { ...n, ...o };
|
|
4439
4439
|
}
|
|
4440
|
-
if (t instanceof Kr)
|
|
4441
|
-
throw new Error("Union not supported");
|
|
4442
4440
|
if (t instanceof zr)
|
|
4441
|
+
throw new Error("Union not supported");
|
|
4442
|
+
if (t instanceof Kr)
|
|
4443
4443
|
return Object.keys(t.shape).reduce(
|
|
4444
4444
|
(s, n) => {
|
|
4445
4445
|
const o = e.getProperties(), l = t.shape[n], a = Cs(l);
|
|
4446
4446
|
if (p(a)) {
|
|
4447
|
-
const g = wt(a) ? a : n, I = o?.[g],
|
|
4448
|
-
return s[n] =
|
|
4447
|
+
const g = wt(a) ? a : n, I = o?.[g], L = I ? this.calculateBlueId(I) : void 0;
|
|
4448
|
+
return s[n] = L, s;
|
|
4449
4449
|
}
|
|
4450
4450
|
const c = As(l);
|
|
4451
4451
|
if (p(c)) {
|
|
@@ -4527,12 +4527,12 @@ class hi {
|
|
|
4527
4527
|
}
|
|
4528
4528
|
class pi {
|
|
4529
4529
|
convert(e) {
|
|
4530
|
-
return
|
|
4530
|
+
return T.get(e);
|
|
4531
4531
|
}
|
|
4532
4532
|
}
|
|
4533
4533
|
class fi {
|
|
4534
4534
|
convert(e) {
|
|
4535
|
-
return
|
|
4535
|
+
return T.get(e);
|
|
4536
4536
|
}
|
|
4537
4537
|
}
|
|
4538
4538
|
class yi {
|
|
@@ -4620,15 +4620,15 @@ class Ii {
|
|
|
4620
4620
|
}
|
|
4621
4621
|
class vi {
|
|
4622
4622
|
static get(e, t = {}) {
|
|
4623
|
-
const { strategy: r = "official" } = t, s =
|
|
4623
|
+
const { strategy: r = "official" } = t, s = T.get(e, r);
|
|
4624
4624
|
return qs(s);
|
|
4625
4625
|
}
|
|
4626
4626
|
}
|
|
4627
|
-
const
|
|
4627
|
+
const Kt = async (i) => {
|
|
4628
4628
|
if (Xr(i))
|
|
4629
4629
|
return i;
|
|
4630
4630
|
try {
|
|
4631
|
-
const e = Je.parse(i), { Blue: t } = await Promise.resolve().then(() =>
|
|
4631
|
+
const e = Je.parse(i), { Blue: t } = await Promise.resolve().then(() => en), r = await new t().calculateBlueId(e);
|
|
4632
4632
|
return {
|
|
4633
4633
|
...i,
|
|
4634
4634
|
blueId: r
|
|
@@ -4636,12 +4636,12 @@ const zt = async (i) => {
|
|
|
4636
4636
|
} catch (e) {
|
|
4637
4637
|
throw new Error(`Failed enriching object with Blue ID: ${e}`);
|
|
4638
4638
|
}
|
|
4639
|
-
},
|
|
4639
|
+
}, _n = (i) => i?.items, jn = (i) => i?.value, Fn = (i) => v(i) ? {} : rr(
|
|
4640
4640
|
i,
|
|
4641
4641
|
Et
|
|
4642
|
-
),
|
|
4642
|
+
), Un = (i) => Qr(i) ? i.type.name ?? null : es(i) ? Hr(typeof i.value) : qr(i) ? "List" : null, Ti = (i) => p(i) && Object.keys(rr(i, ["blueId"])).length > 0, zn = (i) => {
|
|
4643
4643
|
try {
|
|
4644
|
-
const e = m.deserialize(i), t =
|
|
4644
|
+
const e = m.deserialize(i), t = T.get(e);
|
|
4645
4645
|
return Ve.parse(t);
|
|
4646
4646
|
} catch (e) {
|
|
4647
4647
|
throw new Error(
|
|
@@ -4654,7 +4654,7 @@ const zt = async (i) => {
|
|
|
4654
4654
|
signal: t = new AbortController().signal,
|
|
4655
4655
|
omitItems: r
|
|
4656
4656
|
} = i, s = i.count ?? i.items.length;
|
|
4657
|
-
let n = await Yr(i.items, async (l) => await
|
|
4657
|
+
let n = await Yr(i.items, async (l) => await Kt(l));
|
|
4658
4658
|
const o = Math.max(n?.length - s, 0);
|
|
4659
4659
|
for (let l = n.length - 1; l >= o; l--)
|
|
4660
4660
|
if (!Ti(n[l])) {
|
|
@@ -4668,7 +4668,7 @@ const zt = async (i) => {
|
|
|
4668
4668
|
...n.slice(l + 1)
|
|
4669
4669
|
]
|
|
4670
4670
|
});
|
|
4671
|
-
const c = await
|
|
4671
|
+
const c = await Kt(a);
|
|
4672
4672
|
if (r?.includes(c.blueId))
|
|
4673
4673
|
return kt({
|
|
4674
4674
|
...i,
|
|
@@ -4697,7 +4697,7 @@ class Bi {
|
|
|
4697
4697
|
* @returns The processed document
|
|
4698
4698
|
*/
|
|
4699
4699
|
process(e) {
|
|
4700
|
-
return
|
|
4700
|
+
return D.transform(e, this.inferType.bind(this));
|
|
4701
4701
|
}
|
|
4702
4702
|
/**
|
|
4703
4703
|
* Infer a basic type for a node
|
|
@@ -4735,7 +4735,7 @@ class qe {
|
|
|
4735
4735
|
* @returns The processed document
|
|
4736
4736
|
*/
|
|
4737
4737
|
process(e) {
|
|
4738
|
-
return
|
|
4738
|
+
return D.transform(e, this.transformNode.bind(this));
|
|
4739
4739
|
}
|
|
4740
4740
|
transformNode(e) {
|
|
4741
4741
|
const t = e.clone();
|
|
@@ -4762,7 +4762,7 @@ class Pi {
|
|
|
4762
4762
|
* @throws Error if any inline type values remain without BlueId mappings
|
|
4763
4763
|
*/
|
|
4764
4764
|
process(e) {
|
|
4765
|
-
return
|
|
4765
|
+
return D.transform(e, this.validateNode.bind(this)), e;
|
|
4766
4766
|
}
|
|
4767
4767
|
validateNode(e) {
|
|
4768
4768
|
return this.validateTypeField(e, e.getType(), "type"), this.validateTypeField(e, e.getItemType(), "itemType"), this.validateTypeField(e, e.getKeyType(), "keyType"), this.validateTypeField(e, e.getValueType(), "valueType"), e;
|
|
@@ -5272,7 +5272,7 @@ class Te {
|
|
|
5272
5272
|
t
|
|
5273
5273
|
);
|
|
5274
5274
|
return n = c.blueId, o = c.nodes.map(
|
|
5275
|
-
(d) =>
|
|
5275
|
+
(d) => T.get(d)
|
|
5276
5276
|
), new je(
|
|
5277
5277
|
n,
|
|
5278
5278
|
o,
|
|
@@ -5282,12 +5282,12 @@ class Te {
|
|
|
5282
5282
|
);
|
|
5283
5283
|
} else {
|
|
5284
5284
|
const a = m.deserialize(s), c = r.prepareStorageNode(a, t);
|
|
5285
|
-
n = c.blueId, o =
|
|
5285
|
+
n = c.blueId, o = T.get(c.node);
|
|
5286
5286
|
}
|
|
5287
5287
|
return new je(n, o, l);
|
|
5288
5288
|
}
|
|
5289
5289
|
static parseAndCalculateBlueIdForNode(e, t, r) {
|
|
5290
|
-
const s = r.prepareStorageNode(e, t), n =
|
|
5290
|
+
const s = r.prepareStorageNode(e, t), n = T.get(s.node);
|
|
5291
5291
|
return new je(s.blueId, n, !1);
|
|
5292
5292
|
}
|
|
5293
5293
|
static parseAndCalculateBlueIdForNodeList(e, t, r) {
|
|
@@ -5297,7 +5297,7 @@ class Te {
|
|
|
5297
5297
|
e,
|
|
5298
5298
|
t
|
|
5299
5299
|
), n = s.nodes.map(
|
|
5300
|
-
(l) =>
|
|
5300
|
+
(l) => T.get(l)
|
|
5301
5301
|
), o = !0;
|
|
5302
5302
|
return new je(
|
|
5303
5303
|
s.blueId,
|
|
@@ -5419,6 +5419,16 @@ class Dr extends Ei {
|
|
|
5419
5419
|
]);
|
|
5420
5420
|
}
|
|
5421
5421
|
}
|
|
5422
|
+
function Ni(i) {
|
|
5423
|
+
return Array.isArray(i) ? Ci(i) : i;
|
|
5424
|
+
}
|
|
5425
|
+
function Ci(i) {
|
|
5426
|
+
const e = i.map((t) => m.deserialize(t));
|
|
5427
|
+
return O.hasIndexedThisReference(e) ? Ri(e) : i;
|
|
5428
|
+
}
|
|
5429
|
+
function Ri(i) {
|
|
5430
|
+
return new O().calculate(i).nodes.map((t) => T.get(t));
|
|
5431
|
+
}
|
|
5422
5432
|
class $t extends Dr {
|
|
5423
5433
|
blueIdToContentMap = /* @__PURE__ */ new Map();
|
|
5424
5434
|
blueIdToMultipleDocumentsMap = /* @__PURE__ */ new Map();
|
|
@@ -5443,8 +5453,14 @@ class $t extends Dr {
|
|
|
5443
5453
|
loadRepositories(e) {
|
|
5444
5454
|
for (const t of e)
|
|
5445
5455
|
Object.values(t.packages).forEach((r) => {
|
|
5446
|
-
for (const [s, n] of Object.entries(r.contents))
|
|
5447
|
-
|
|
5456
|
+
for (const [s, n] of Object.entries(r.contents)) {
|
|
5457
|
+
const o = Ni(n);
|
|
5458
|
+
this.storeContent(
|
|
5459
|
+
s,
|
|
5460
|
+
o,
|
|
5461
|
+
Array.isArray(o)
|
|
5462
|
+
), this.addContentNames(s, o);
|
|
5463
|
+
}
|
|
5448
5464
|
});
|
|
5449
5465
|
}
|
|
5450
5466
|
addContentNames(e, t) {
|
|
@@ -5512,7 +5528,7 @@ class $t extends Dr {
|
|
|
5512
5528
|
};
|
|
5513
5529
|
}
|
|
5514
5530
|
}
|
|
5515
|
-
class
|
|
5531
|
+
class Ai {
|
|
5516
5532
|
nodeProvider;
|
|
5517
5533
|
blueIdToInlineValue = /* @__PURE__ */ new Map();
|
|
5518
5534
|
constructor(e) {
|
|
@@ -5529,7 +5545,7 @@ class Ni {
|
|
|
5529
5545
|
* Returns a new BlueNode where all type references are restored to inline values when possible.
|
|
5530
5546
|
*/
|
|
5531
5547
|
restore(e) {
|
|
5532
|
-
return
|
|
5548
|
+
return D.transform(
|
|
5533
5549
|
e,
|
|
5534
5550
|
(t) => this.restoreNode(t)
|
|
5535
5551
|
);
|
|
@@ -5578,17 +5594,17 @@ class Ni {
|
|
|
5578
5594
|
return this.blueIdToInlineValue.set(e, o), o;
|
|
5579
5595
|
}
|
|
5580
5596
|
}
|
|
5581
|
-
class
|
|
5597
|
+
class Vi {
|
|
5582
5598
|
runtimes;
|
|
5583
5599
|
contents;
|
|
5584
5600
|
aliases;
|
|
5585
5601
|
constructor(e) {
|
|
5586
5602
|
const t = [];
|
|
5587
5603
|
for (const r of e)
|
|
5588
|
-
t.push(
|
|
5604
|
+
t.push(Oi(r));
|
|
5589
5605
|
this.runtimes = t, this.contents = {}, this.aliases = {};
|
|
5590
5606
|
for (const r of this.runtimes)
|
|
5591
|
-
|
|
5607
|
+
Ki(this.contents, r.contents, r.name), zi(this.aliases, r.aliases, r.name);
|
|
5592
5608
|
}
|
|
5593
5609
|
getRuntimes() {
|
|
5594
5610
|
return this.runtimes;
|
|
@@ -5635,10 +5651,10 @@ class Ci {
|
|
|
5635
5651
|
}
|
|
5636
5652
|
}
|
|
5637
5653
|
}
|
|
5638
|
-
function
|
|
5639
|
-
const e =
|
|
5654
|
+
function Oi(i) {
|
|
5655
|
+
const e = Mi(i);
|
|
5640
5656
|
return Object.values(i.packages).forEach((t) => {
|
|
5641
|
-
|
|
5657
|
+
Di(e, i, t);
|
|
5642
5658
|
}), {
|
|
5643
5659
|
name: i.name,
|
|
5644
5660
|
repositoryVersions: i.repositoryVersions,
|
|
@@ -5653,7 +5669,7 @@ function Ri(i) {
|
|
|
5653
5669
|
typePackageByCurrentBlueId: e.typePackageByCurrentBlueId
|
|
5654
5670
|
};
|
|
5655
5671
|
}
|
|
5656
|
-
function
|
|
5672
|
+
function Mi(i) {
|
|
5657
5673
|
const e = Object.fromEntries(
|
|
5658
5674
|
i.repositoryVersions.map((r, s) => [r, s])
|
|
5659
5675
|
), t = i.repositoryVersions[i.repositoryVersions.length - 1];
|
|
@@ -5670,23 +5686,23 @@ function Ai(i) {
|
|
|
5670
5686
|
currentRepoBlueId: t
|
|
5671
5687
|
};
|
|
5672
5688
|
}
|
|
5673
|
-
function
|
|
5689
|
+
function Di(i, e, t) {
|
|
5674
5690
|
if (i.packageNames.has(t.name))
|
|
5675
5691
|
throw new Error(`Duplicate package name detected: ${t.name}`);
|
|
5676
|
-
i.packageNames.add(t.name),
|
|
5692
|
+
i.packageNames.add(t.name), xi(i, t), Li(i, e, t), $i(i, t), _i(i, t);
|
|
5677
5693
|
}
|
|
5678
|
-
function
|
|
5694
|
+
function xi(i, e) {
|
|
5679
5695
|
Object.entries(e.aliases).forEach(([t, r]) => {
|
|
5680
5696
|
if (i.aliases[t] && i.aliases[t] !== r)
|
|
5681
5697
|
throw new Error(`Conflicting alias mapping for ${t}`);
|
|
5682
5698
|
i.aliases[t] = r;
|
|
5683
5699
|
});
|
|
5684
5700
|
}
|
|
5685
|
-
function
|
|
5701
|
+
function Li(i, e, t) {
|
|
5686
5702
|
Object.entries(t.typesMeta).forEach(([r, s]) => {
|
|
5687
5703
|
if (i.types[r])
|
|
5688
5704
|
throw new Error(`Duplicate type mapping for BlueId ${r}`);
|
|
5689
|
-
const n =
|
|
5705
|
+
const n = ji(
|
|
5690
5706
|
s,
|
|
5691
5707
|
e,
|
|
5692
5708
|
r,
|
|
@@ -5703,17 +5719,17 @@ function Mi(i, e, t) {
|
|
|
5703
5719
|
}
|
|
5704
5720
|
});
|
|
5705
5721
|
}
|
|
5706
|
-
function
|
|
5722
|
+
function $i(i, e) {
|
|
5707
5723
|
Object.entries(e.contents).forEach(([t, r]) => {
|
|
5708
5724
|
i.contents[t] = r;
|
|
5709
5725
|
});
|
|
5710
5726
|
}
|
|
5711
|
-
function
|
|
5727
|
+
function _i(i, e) {
|
|
5712
5728
|
i.schemas.push(...Object.values(e.schemas));
|
|
5713
5729
|
}
|
|
5714
|
-
function
|
|
5730
|
+
function ji(i, e, t, r) {
|
|
5715
5731
|
if (i.status === bt)
|
|
5716
|
-
return
|
|
5732
|
+
return Fi(i, e, t, r), {
|
|
5717
5733
|
...i,
|
|
5718
5734
|
versions: i.versions ? [...i.versions] : i.versions
|
|
5719
5735
|
};
|
|
@@ -5736,7 +5752,7 @@ function Li(i, e, t, r) {
|
|
|
5736
5752
|
);
|
|
5737
5753
|
n.add(o.repositoryVersionIndex);
|
|
5738
5754
|
for (const l of o.attributesAdded ?? [])
|
|
5739
|
-
|
|
5755
|
+
Ui(
|
|
5740
5756
|
l,
|
|
5741
5757
|
e.name,
|
|
5742
5758
|
t,
|
|
@@ -5747,7 +5763,7 @@ function Li(i, e, t, r) {
|
|
|
5747
5763
|
versions: s
|
|
5748
5764
|
};
|
|
5749
5765
|
}
|
|
5750
|
-
function
|
|
5766
|
+
function Fi(i, e, t, r) {
|
|
5751
5767
|
if (i.status === bt) {
|
|
5752
5768
|
if (i.versions && i.versions.length > 1)
|
|
5753
5769
|
throw new Error(
|
|
@@ -5762,7 +5778,7 @@ function $i(i, e, t, r) {
|
|
|
5762
5778
|
}
|
|
5763
5779
|
}
|
|
5764
5780
|
}
|
|
5765
|
-
function
|
|
5781
|
+
function Ui(i, e, t, r) {
|
|
5766
5782
|
try {
|
|
5767
5783
|
Wr(i);
|
|
5768
5784
|
} catch (s) {
|
|
@@ -5772,7 +5788,7 @@ function _i(i, e, t, r) {
|
|
|
5772
5788
|
);
|
|
5773
5789
|
}
|
|
5774
5790
|
}
|
|
5775
|
-
function
|
|
5791
|
+
function zi(i, e, t) {
|
|
5776
5792
|
for (const [r, s] of Object.entries(e)) {
|
|
5777
5793
|
const n = i[r];
|
|
5778
5794
|
if (n && n !== s)
|
|
@@ -5782,11 +5798,11 @@ function ji(i, e, t) {
|
|
|
5782
5798
|
i[r] = s;
|
|
5783
5799
|
}
|
|
5784
5800
|
}
|
|
5785
|
-
function
|
|
5801
|
+
function Ki(i, e, t) {
|
|
5786
5802
|
for (const [r, s] of Object.entries(e)) {
|
|
5787
5803
|
if (r in i) {
|
|
5788
5804
|
const n = i[r];
|
|
5789
|
-
if (!
|
|
5805
|
+
if (!ki(n, s))
|
|
5790
5806
|
throw new Error(
|
|
5791
5807
|
`Conflicting content for BlueId '${r}' across repositories (from ${t})`
|
|
5792
5808
|
);
|
|
@@ -5795,13 +5811,13 @@ function Fi(i, e, t) {
|
|
|
5795
5811
|
i[r] = s;
|
|
5796
5812
|
}
|
|
5797
5813
|
}
|
|
5798
|
-
function
|
|
5814
|
+
function ki(i, e) {
|
|
5799
5815
|
if (i === e) return !0;
|
|
5800
5816
|
if (i === null || e === null || typeof i != "object" || typeof e != "object") return !1;
|
|
5801
5817
|
const t = yt.canonicalize(i), r = yt.canonicalize(e);
|
|
5802
5818
|
return t !== void 0 && t === r;
|
|
5803
5819
|
}
|
|
5804
|
-
const
|
|
5820
|
+
const Hi = /* @__PURE__ */ new Set([
|
|
5805
5821
|
"__proto__",
|
|
5806
5822
|
"constructor",
|
|
5807
5823
|
"prototype"
|
|
@@ -5810,7 +5826,7 @@ function Ht(i) {
|
|
|
5810
5826
|
const e = i.at(0), t = i.at(-1);
|
|
5811
5827
|
return !e || !t ? i : e === "'" && t === "'" || e === '"' && t === '"' ? i.slice(1, -1) : i;
|
|
5812
5828
|
}
|
|
5813
|
-
function
|
|
5829
|
+
function Yi(i, e) {
|
|
5814
5830
|
const t = i.indexOf("=");
|
|
5815
5831
|
if (t === -1)
|
|
5816
5832
|
throw ve(e, `Missing '=' in segment '${i.trim()}'`);
|
|
@@ -5823,7 +5839,7 @@ function zi(i, e) {
|
|
|
5823
5839
|
throw ve(e, `Repository BlueId is empty for '${r}'`);
|
|
5824
5840
|
return { name: r, value: s };
|
|
5825
5841
|
}
|
|
5826
|
-
function
|
|
5842
|
+
function Wi(i) {
|
|
5827
5843
|
if (i.trim().length === 0)
|
|
5828
5844
|
return /* @__PURE__ */ Object.create(null);
|
|
5829
5845
|
const e = /* @__PURE__ */ Object.create(null);
|
|
@@ -5831,13 +5847,13 @@ function ki(i) {
|
|
|
5831
5847
|
const r = t.trim();
|
|
5832
5848
|
if (!r)
|
|
5833
5849
|
throw ve(i, "Empty repository segment");
|
|
5834
|
-
const { name: s, value: n } =
|
|
5835
|
-
|
|
5850
|
+
const { name: s, value: n } = Yi(r, i);
|
|
5851
|
+
Ji(s, i), e[s] = n;
|
|
5836
5852
|
}
|
|
5837
5853
|
return e;
|
|
5838
5854
|
}
|
|
5839
|
-
function
|
|
5840
|
-
return typeof i == "string" ?
|
|
5855
|
+
function Gi(i) {
|
|
5856
|
+
return typeof i == "string" ? Wi(i) : i;
|
|
5841
5857
|
}
|
|
5842
5858
|
function ve(i, e) {
|
|
5843
5859
|
return new he(
|
|
@@ -5856,11 +5872,11 @@ function ve(i, e) {
|
|
|
5856
5872
|
]
|
|
5857
5873
|
);
|
|
5858
5874
|
}
|
|
5859
|
-
function
|
|
5860
|
-
if (
|
|
5875
|
+
function Ji(i, e) {
|
|
5876
|
+
if (Hi.has(i))
|
|
5861
5877
|
throw ve(e, `Forbidden repository name '${i}'`);
|
|
5862
5878
|
}
|
|
5863
|
-
function
|
|
5879
|
+
function Zi(i, e) {
|
|
5864
5880
|
const t = i.filter((s) => s.repositoryVersionIndex > e).sort((s, n) => n.repositoryVersionIndex - s.repositoryVersionIndex), r = [];
|
|
5865
5881
|
for (const s of t) {
|
|
5866
5882
|
const n = [...s.attributesAdded].sort(
|
|
@@ -5873,14 +5889,14 @@ function Wi(i, e) {
|
|
|
5873
5889
|
function Yt(i) {
|
|
5874
5890
|
return ir(i).length;
|
|
5875
5891
|
}
|
|
5876
|
-
const
|
|
5892
|
+
const Xi = /* @__PURE__ */ new Set([...Et]), C = {
|
|
5877
5893
|
core: "core",
|
|
5878
5894
|
noRuntime: "no-runtime",
|
|
5879
5895
|
noTargetContext: "no-target-context",
|
|
5880
5896
|
representable: "representable",
|
|
5881
5897
|
unrepresentable: "unrepresentable"
|
|
5882
5898
|
};
|
|
5883
|
-
class
|
|
5899
|
+
class qi {
|
|
5884
5900
|
registry;
|
|
5885
5901
|
targetRepoVersionIndexes;
|
|
5886
5902
|
fallbackToCurrentInlineDefinitions;
|
|
@@ -5889,7 +5905,7 @@ class Ji {
|
|
|
5889
5905
|
this.registry = e.registry, this.targetRepoVersionIndexes = e.targetRepoVersionIndexes, this.fallbackToCurrentInlineDefinitions = e.fallbackToCurrentInlineDefinitions;
|
|
5890
5906
|
}
|
|
5891
5907
|
transform(e) {
|
|
5892
|
-
return
|
|
5908
|
+
return D.transform(
|
|
5893
5909
|
e,
|
|
5894
5910
|
(t) => this.transformNode(t)
|
|
5895
5911
|
);
|
|
@@ -6030,7 +6046,7 @@ class Ji {
|
|
|
6030
6046
|
};
|
|
6031
6047
|
}
|
|
6032
6048
|
getDropPointers(e, t) {
|
|
6033
|
-
return e.status !== Ce ? [] :
|
|
6049
|
+
return e.status !== Ce ? [] : Zi(e.versions, t);
|
|
6034
6050
|
}
|
|
6035
6051
|
applyDropPointers(e, t, r = {}) {
|
|
6036
6052
|
if (e.length === 0 || t.length === 0)
|
|
@@ -6043,7 +6059,7 @@ class Ji {
|
|
|
6043
6059
|
getDictionaryValueTargets(e) {
|
|
6044
6060
|
const t = e.getProperties();
|
|
6045
6061
|
return t ? Object.entries(t).filter(
|
|
6046
|
-
([r, s]) => s instanceof u && !
|
|
6062
|
+
([r, s]) => s instanceof u && !Xi.has(r)
|
|
6047
6063
|
).map(([, r]) => r) : [];
|
|
6048
6064
|
}
|
|
6049
6065
|
deletePropertyAtPointer(e, t, r) {
|
|
@@ -6059,7 +6075,7 @@ class Ji {
|
|
|
6059
6075
|
if (t.length === 0)
|
|
6060
6076
|
return;
|
|
6061
6077
|
const [s, ...n] = t;
|
|
6062
|
-
if (s ===
|
|
6078
|
+
if (s === K) {
|
|
6063
6079
|
const a = e.getType();
|
|
6064
6080
|
a && this.applyPointerSegments(a, n, !0);
|
|
6065
6081
|
return;
|
|
@@ -6116,7 +6132,7 @@ class Ji {
|
|
|
6116
6132
|
try {
|
|
6117
6133
|
const o = m.deserialize(n);
|
|
6118
6134
|
o.setBlueId(void 0);
|
|
6119
|
-
const l =
|
|
6135
|
+
const l = D.transform(
|
|
6120
6136
|
o,
|
|
6121
6137
|
(a) => this.transformNode(a)
|
|
6122
6138
|
);
|
|
@@ -6150,7 +6166,7 @@ class Ji {
|
|
|
6150
6166
|
const c = {
|
|
6151
6167
|
code: _.REPO_UNREPRESENTABLE_IN_TARGET_VERSION,
|
|
6152
6168
|
message: t,
|
|
6153
|
-
locationPath: [
|
|
6169
|
+
locationPath: [K],
|
|
6154
6170
|
context: a
|
|
6155
6171
|
};
|
|
6156
6172
|
return new he(
|
|
@@ -6161,7 +6177,7 @@ class Ji {
|
|
|
6161
6177
|
}
|
|
6162
6178
|
}
|
|
6163
6179
|
function Bt(i, e) {
|
|
6164
|
-
return e ?
|
|
6180
|
+
return e ? D.transform(i, (t) => (Fe(
|
|
6165
6181
|
() => t.getType(),
|
|
6166
6182
|
(r) => t.setType(r),
|
|
6167
6183
|
e
|
|
@@ -6189,7 +6205,7 @@ function Fe(i, e, t) {
|
|
|
6189
6205
|
const n = t.toCurrentBlueId(s);
|
|
6190
6206
|
n !== s && e(r.clone().setBlueId(n));
|
|
6191
6207
|
}
|
|
6192
|
-
class
|
|
6208
|
+
class Qi {
|
|
6193
6209
|
registry;
|
|
6194
6210
|
blueIdMapper;
|
|
6195
6211
|
constructor(e) {
|
|
@@ -6200,7 +6216,7 @@ class Zi {
|
|
|
6200
6216
|
if (Object.keys(r).length === 0)
|
|
6201
6217
|
return e;
|
|
6202
6218
|
const s = Bt(e, this.blueIdMapper);
|
|
6203
|
-
return new
|
|
6219
|
+
return new qi({
|
|
6204
6220
|
registry: this.registry,
|
|
6205
6221
|
targetRepoVersionIndexes: r,
|
|
6206
6222
|
fallbackToCurrentInlineDefinitions: t.fallbackToCurrentInlineDefinitions !== !1
|
|
@@ -6210,7 +6226,7 @@ class Zi {
|
|
|
6210
6226
|
const t = {};
|
|
6211
6227
|
if (!e?.repositories)
|
|
6212
6228
|
return t;
|
|
6213
|
-
const r = typeof e.repositories == "string" ?
|
|
6229
|
+
const r = typeof e.repositories == "string" ? Gi(e.repositories) : e.repositories;
|
|
6214
6230
|
for (const [s, n] of Object.entries(r)) {
|
|
6215
6231
|
const o = this.registry.findRuntimeByName(s);
|
|
6216
6232
|
if (!o)
|
|
@@ -6261,7 +6277,7 @@ class xe {
|
|
|
6261
6277
|
repositories: n,
|
|
6262
6278
|
mergingProcessor: o
|
|
6263
6279
|
} = e;
|
|
6264
|
-
this.repositories = n, this.repositoryRegistry = new
|
|
6280
|
+
this.repositories = n, this.repositoryRegistry = new Vi(n ?? []), this.blueContextResolver = new Qi({
|
|
6265
6281
|
registry: this.repositoryRegistry,
|
|
6266
6282
|
blueIdMapper: this.repositoryRegistry
|
|
6267
6283
|
}), this.mergingProcessor = o ?? _e();
|
|
@@ -6289,7 +6305,7 @@ class xe {
|
|
|
6289
6305
|
*/
|
|
6290
6306
|
nodeToJson(e, t = "official") {
|
|
6291
6307
|
const r = this.normalizeNodeToJsonOptions(t), s = r.blueContext ? this.blueContextResolver.transform(e, r.blueContext) : e;
|
|
6292
|
-
return
|
|
6308
|
+
return T.get(s, r.format);
|
|
6293
6309
|
}
|
|
6294
6310
|
/**
|
|
6295
6311
|
* Converts a BlueNode to a deterministic YAML string. Uses nodeToJson under the hood
|
|
@@ -6349,7 +6365,7 @@ class xe {
|
|
|
6349
6365
|
* repository-backed definitions currently known to this {@link Blue} instance.
|
|
6350
6366
|
*/
|
|
6351
6367
|
restoreInlineTypes(e) {
|
|
6352
|
-
return new
|
|
6368
|
+
return new Ai({
|
|
6353
6369
|
nodeProvider: this.nodeProvider,
|
|
6354
6370
|
blueIdsMappingGenerator: this.blueIdsMappingGenerator
|
|
6355
6371
|
}).restore(e);
|
|
@@ -6437,7 +6453,7 @@ class xe {
|
|
|
6437
6453
|
}).preprocessWithDefaultBlue(t);
|
|
6438
6454
|
}
|
|
6439
6455
|
transform(e, t) {
|
|
6440
|
-
return
|
|
6456
|
+
return D.transform(e, t);
|
|
6441
6457
|
}
|
|
6442
6458
|
getNodeProvider() {
|
|
6443
6459
|
return this.nodeProvider;
|
|
@@ -6647,11 +6663,11 @@ class xe {
|
|
|
6647
6663
|
return this.globalLimits == j ? e : e == j ? this.globalLimits : nt.of(this.globalLimits, e);
|
|
6648
6664
|
}
|
|
6649
6665
|
}
|
|
6650
|
-
const
|
|
6666
|
+
const en = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6651
6667
|
__proto__: null,
|
|
6652
6668
|
Blue: xe
|
|
6653
|
-
}, Symbol.toStringTag, { value: "Module" })), pt = /* @__PURE__ */ new WeakMap(),
|
|
6654
|
-
function
|
|
6669
|
+
}, Symbol.toStringTag, { value: "Module" })), pt = /* @__PURE__ */ new WeakMap(), tn = 10;
|
|
6670
|
+
function Kn(i, e = {}) {
|
|
6655
6671
|
const t = e.mergingProcessor === void 0;
|
|
6656
6672
|
if (t) {
|
|
6657
6673
|
const a = pt.get(i);
|
|
@@ -6665,16 +6681,16 @@ function Fn(i, e = {}) {
|
|
|
6665
6681
|
let o = Object.fromEntries(
|
|
6666
6682
|
r.map(({ oldBlueId: a }) => [a, a])
|
|
6667
6683
|
);
|
|
6668
|
-
const l =
|
|
6684
|
+
const l = rn(r.length);
|
|
6669
6685
|
for (let a = 0; a < l; a++) {
|
|
6670
|
-
const c =
|
|
6686
|
+
const c = on(
|
|
6671
6687
|
r,
|
|
6672
6688
|
s,
|
|
6673
6689
|
o,
|
|
6674
6690
|
n
|
|
6675
6691
|
);
|
|
6676
|
-
if (
|
|
6677
|
-
const d =
|
|
6692
|
+
if (un(o, c)) {
|
|
6693
|
+
const d = ln(i, o);
|
|
6678
6694
|
return t && pt.set(i, d), d;
|
|
6679
6695
|
}
|
|
6680
6696
|
o = c;
|
|
@@ -6683,12 +6699,12 @@ function Fn(i, e = {}) {
|
|
|
6683
6699
|
`Repository semantic reindexing did not converge after ${l} passes for ${r.length} entries.`
|
|
6684
6700
|
);
|
|
6685
6701
|
}
|
|
6686
|
-
function
|
|
6702
|
+
function kn(i, e = {}) {
|
|
6687
6703
|
const t = xr(i);
|
|
6688
6704
|
if (t.length === 0)
|
|
6689
6705
|
return;
|
|
6690
6706
|
const r = Lr(i), s = e.mergingProcessor ?? _e(), n = new xe({
|
|
6691
|
-
nodeProvider:
|
|
6707
|
+
nodeProvider: sn(t, r),
|
|
6692
6708
|
mergingProcessor: s
|
|
6693
6709
|
});
|
|
6694
6710
|
n.registerBlueIds(r);
|
|
@@ -6708,8 +6724,8 @@ function Un(i, e = {}) {
|
|
|
6708
6724
|
);
|
|
6709
6725
|
}
|
|
6710
6726
|
}
|
|
6711
|
-
function
|
|
6712
|
-
return Math.max(
|
|
6727
|
+
function rn(i) {
|
|
6728
|
+
return Math.max(tn, i + 1);
|
|
6713
6729
|
}
|
|
6714
6730
|
function xr(i) {
|
|
6715
6731
|
const e = [];
|
|
@@ -6725,13 +6741,13 @@ function Lr(i) {
|
|
|
6725
6741
|
e[r] = s;
|
|
6726
6742
|
return e;
|
|
6727
6743
|
}
|
|
6728
|
-
function
|
|
6744
|
+
function sn(i, e) {
|
|
6729
6745
|
const t = new Map(
|
|
6730
6746
|
i.map(({ oldBlueId: n, content: o }) => [n, o])
|
|
6731
6747
|
), r = new Map(Object.entries(e)), s = new xe();
|
|
6732
6748
|
return {
|
|
6733
6749
|
fetchByBlueId(n) {
|
|
6734
|
-
const o =
|
|
6750
|
+
const o = nn(n, r);
|
|
6735
6751
|
if (o === void 0)
|
|
6736
6752
|
return [];
|
|
6737
6753
|
const { baseBlueId: l, suffix: a } = Pt(o), c = t.get(l);
|
|
@@ -6757,7 +6773,7 @@ function en(i, e) {
|
|
|
6757
6773
|
}
|
|
6758
6774
|
};
|
|
6759
6775
|
}
|
|
6760
|
-
function
|
|
6776
|
+
function nn(i, e) {
|
|
6761
6777
|
const t = e.get(i);
|
|
6762
6778
|
if (t !== void 0)
|
|
6763
6779
|
return t;
|
|
@@ -6777,7 +6793,7 @@ function Pt(i) {
|
|
|
6777
6793
|
suffix: i.slice(e)
|
|
6778
6794
|
};
|
|
6779
6795
|
}
|
|
6780
|
-
function
|
|
6796
|
+
function on(i, e, t, r) {
|
|
6781
6797
|
const s = new Map(
|
|
6782
6798
|
i.map(({ oldBlueId: c, content: d }) => [
|
|
6783
6799
|
c,
|
|
@@ -6827,26 +6843,26 @@ function rn(i, e, t, r) {
|
|
|
6827
6843
|
})
|
|
6828
6844
|
);
|
|
6829
6845
|
}
|
|
6830
|
-
function
|
|
6846
|
+
function ln(i, e) {
|
|
6831
6847
|
return {
|
|
6832
6848
|
name: i.name,
|
|
6833
6849
|
repositoryVersions: i.repositoryVersions,
|
|
6834
6850
|
packages: Object.fromEntries(
|
|
6835
6851
|
Object.entries(i.packages).map(([t, r]) => [
|
|
6836
6852
|
t,
|
|
6837
|
-
|
|
6853
|
+
an(r, e)
|
|
6838
6854
|
])
|
|
6839
6855
|
)
|
|
6840
6856
|
};
|
|
6841
6857
|
}
|
|
6842
|
-
function
|
|
6858
|
+
function an(i, e) {
|
|
6843
6859
|
return {
|
|
6844
6860
|
name: i.name,
|
|
6845
6861
|
aliases: $r(i.aliases, e),
|
|
6846
6862
|
typesMeta: Object.fromEntries(
|
|
6847
6863
|
Object.entries(i.typesMeta).map(([t, r]) => [
|
|
6848
6864
|
e[t] ?? t,
|
|
6849
|
-
|
|
6865
|
+
cn(r, e)
|
|
6850
6866
|
])
|
|
6851
6867
|
),
|
|
6852
6868
|
contents: Object.fromEntries(
|
|
@@ -6866,7 +6882,7 @@ function nn(i, e) {
|
|
|
6866
6882
|
)
|
|
6867
6883
|
};
|
|
6868
6884
|
}
|
|
6869
|
-
function
|
|
6885
|
+
function cn(i, e) {
|
|
6870
6886
|
return {
|
|
6871
6887
|
...i,
|
|
6872
6888
|
versions: i.versions.map((t) => ({
|
|
@@ -6875,7 +6891,7 @@ function on(i, e) {
|
|
|
6875
6891
|
}))
|
|
6876
6892
|
};
|
|
6877
6893
|
}
|
|
6878
|
-
function
|
|
6894
|
+
function un(i, e) {
|
|
6879
6895
|
const t = Object.keys(i);
|
|
6880
6896
|
return t.length !== Object.keys(e).length ? !1 : t.every((r) => i[r] === e[r]);
|
|
6881
6897
|
}
|
|
@@ -6905,7 +6921,7 @@ function _t(i, e) {
|
|
|
6905
6921
|
const [, s, n] = r;
|
|
6906
6922
|
return `${e[s] ?? s}${n}`;
|
|
6907
6923
|
}
|
|
6908
|
-
class
|
|
6924
|
+
class Hn extends Dr {
|
|
6909
6925
|
blueIdToContentMap = /* @__PURE__ */ new Map();
|
|
6910
6926
|
blueIdToMultipleDocumentsMap = /* @__PURE__ */ new Map();
|
|
6911
6927
|
preprocessor;
|
|
@@ -7008,7 +7024,7 @@ class Kn extends Dr {
|
|
|
7008
7024
|
*/
|
|
7009
7025
|
addListAndItsItemsFromNodes(e) {
|
|
7010
7026
|
const t = this.storeNodeList(e);
|
|
7011
|
-
if (
|
|
7027
|
+
if (O.hasThisReference(e)) {
|
|
7012
7028
|
this.addListItemNames(t.blueId, t.content);
|
|
7013
7029
|
return;
|
|
7014
7030
|
}
|
|
@@ -7048,66 +7064,66 @@ class Kn extends Dr {
|
|
|
7048
7064
|
}
|
|
7049
7065
|
export {
|
|
7050
7066
|
ls as Base58Sha256Provider,
|
|
7051
|
-
|
|
7067
|
+
Hn as BasicNodeProvider,
|
|
7052
7068
|
xe as Blue,
|
|
7053
|
-
|
|
7054
|
-
|
|
7069
|
+
M as BlueIdCalculator,
|
|
7070
|
+
Vn as BlueIdToCid,
|
|
7055
7071
|
u as BlueNode,
|
|
7056
7072
|
k as BlueNodeTypeSchema,
|
|
7057
7073
|
yt as JsonCanonicalizer,
|
|
7058
7074
|
Mt as Limits,
|
|
7059
7075
|
de as Merger,
|
|
7060
|
-
|
|
7076
|
+
$n as MergingProcessors,
|
|
7061
7077
|
Ws as NodeResolver,
|
|
7062
7078
|
E as Nodes,
|
|
7063
|
-
|
|
7079
|
+
Bn as Properties,
|
|
7064
7080
|
J as ResolvedBlueNode,
|
|
7065
7081
|
He as SemanticIdentityService,
|
|
7066
7082
|
Hs as TypeSchemaResolver,
|
|
7067
|
-
|
|
7083
|
+
On as applyBlueNodePatch,
|
|
7068
7084
|
st as baseBlueObjectSchema,
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7085
|
+
Mn as blueDescriptionField,
|
|
7086
|
+
Dn as blueIdField,
|
|
7087
|
+
Pn as blueIdSchema,
|
|
7088
|
+
xn as blueNameField,
|
|
7089
|
+
Ln as blueNodeField,
|
|
7090
|
+
bn as blueObjectBooleanValueSchema,
|
|
7091
|
+
Sn as blueObjectNumberValueSchema,
|
|
7076
7092
|
Ve as blueObjectSchema,
|
|
7077
|
-
|
|
7078
|
-
|
|
7093
|
+
En as blueObjectStringListItemsSchema,
|
|
7094
|
+
wn as blueObjectStringValueSchema,
|
|
7079
7095
|
Dt as createNodeProvider,
|
|
7080
|
-
|
|
7096
|
+
Kt as enrichWithBlueId,
|
|
7081
7097
|
bs as getBlueDescriptionAnnotation,
|
|
7082
7098
|
Cs as getBlueIdAnnotation,
|
|
7083
7099
|
As as getBlueNameAnnotation,
|
|
7084
7100
|
Os as getBlueNodeAnnotation,
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7101
|
+
_n as getBlueObjectItems,
|
|
7102
|
+
Fn as getBlueObjectProperties,
|
|
7103
|
+
Un as getBlueObjectTypeLabel,
|
|
7104
|
+
jn as getBlueObjectValue,
|
|
7089
7105
|
Ds as getTypeBlueIdAnnotation,
|
|
7090
7106
|
Xr as hasBlueObjectBlueIdDefined,
|
|
7091
7107
|
qr as hasBlueObjectItemsDefined,
|
|
7092
|
-
|
|
7108
|
+
Cn as hasBlueObjectNameDefined,
|
|
7093
7109
|
Qr as hasBlueObjectTypeDefined,
|
|
7094
7110
|
es as hasBlueObjectValueDefined,
|
|
7095
7111
|
ft as isBigDecimalNumber,
|
|
7096
7112
|
oe as isBigIntegerNumber,
|
|
7097
7113
|
R as isBigNumber,
|
|
7098
7114
|
vr as isBlueNodeSchema,
|
|
7099
|
-
|
|
7115
|
+
Nn as isBlueObject,
|
|
7100
7116
|
Ti as isBlueObjectResolved,
|
|
7101
|
-
|
|
7117
|
+
Rn as isGivenBlueObjectTypeSchema,
|
|
7102
7118
|
pr as isJsonBlueArray,
|
|
7103
7119
|
hr as isJsonBlueObject,
|
|
7104
|
-
|
|
7120
|
+
An as isJsonBlueValue,
|
|
7105
7121
|
Ye as isUrl,
|
|
7106
7122
|
Je as jsonBlueValueSchema,
|
|
7107
|
-
|
|
7108
|
-
|
|
7123
|
+
zn as normalizeToBlueObject,
|
|
7124
|
+
Kn as reindexRepositoryForSemanticStorage,
|
|
7109
7125
|
kt as resolveBlueObjectItems,
|
|
7110
|
-
|
|
7126
|
+
kn as validateRepositorySemanticStorage,
|
|
7111
7127
|
Ss as withBlueDescription,
|
|
7112
7128
|
Ns as withBlueId,
|
|
7113
7129
|
Rs as withBlueName,
|