@blue-labs/language 4.0.2-rc.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import G from "big.js";
|
|
2
|
-
import { isNullable as I, isNonNullable as d, jsonPrimitiveSchema as
|
|
3
|
-
import { z as f, ZodOptional as
|
|
4
|
-
import
|
|
5
|
-
import { isObject as
|
|
6
|
-
import { OBJECT_CONTRACTS as U, OBJECT_MERGE_POLICY as
|
|
7
|
-
import { sha256 as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
2
|
+
import { isNullable as I, isNonNullable as d, jsonPrimitiveSchema as Or, isReadonlyArray as Ht, isJsonPrimitive as kt, isPreciseNumberString as Yt } from "@blue-labs/shared-utils";
|
|
3
|
+
import { z as f, ZodOptional as Wt, ZodNullable as Gt, ZodReadonly as Jt, ZodBranded as Zt, ZodEffects as We, ZodLazy as Ge, ZodString as ye, ZodNumber as ge, ZodBoolean as Ue, ZodBigInt as ze, ZodEnum as Mr, ZodNativeEnum as Dr, ZodIntersection as Lr, ZodUnion as $r, ZodObject as xr, ZodRecord as _r } from "zod";
|
|
4
|
+
import Ve from "bs58";
|
|
5
|
+
import { isObject as Xt, isArray as qt, isString as Tt, omit as Qt, pascal as Fr, map as jr } from "radash";
|
|
6
|
+
import { OBJECT_CONTRACTS as U, OBJECT_MERGE_POLICY as Bt, OBJECT_SCHEMA as er, BLUE_REPOSITORY_STATUS_STABLE as Ne, BLUE_REPOSITORY_STATUS_DEV as Pt, validateAttributesAddedPointer as Ur, parsePointer as tr } from "@blue-labs/repository-contract";
|
|
7
|
+
import { sha256 as zr } from "js-sha256";
|
|
8
|
+
import ot from "crypto";
|
|
9
|
+
import Kr from "base32.js";
|
|
10
10
|
import he from "js-yaml";
|
|
11
|
-
class
|
|
11
|
+
class x extends G {
|
|
12
12
|
constructor(e) {
|
|
13
13
|
super(e);
|
|
14
14
|
}
|
|
@@ -18,7 +18,7 @@ class A extends G {
|
|
|
18
18
|
super(e);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
const ie = "name", ne = "description", z = "type", Pe = "itemType", we = "keyType", Se = "valueType", W = "value", Y = "items", V = "blueId",
|
|
21
|
+
const ie = "name", ne = "description", z = "type", Pe = "itemType", we = "keyType", Se = "valueType", W = "value", Y = "items", V = "blueId", $e = "blue", wt = [
|
|
22
22
|
ie,
|
|
23
23
|
ne,
|
|
24
24
|
z,
|
|
@@ -28,61 +28,61 @@ const ie = "name", ne = "description", z = "type", Pe = "itemType", we = "keyTyp
|
|
|
28
28
|
W,
|
|
29
29
|
Y,
|
|
30
30
|
V,
|
|
31
|
-
|
|
32
|
-
],
|
|
33
|
-
tr,
|
|
31
|
+
$e
|
|
32
|
+
], rr = "Text", sr = "Double", ir = "Integer", nr = "Boolean", or = "List", lr = "Dictionary", Qe = [
|
|
34
33
|
rr,
|
|
35
34
|
sr,
|
|
36
|
-
ir
|
|
37
|
-
|
|
35
|
+
ir,
|
|
36
|
+
nr
|
|
37
|
+
], St = [...Qe, or, lr], Q = "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K", ee = "7pwXmXYCJtWnd348c2JQGBkm9C4renmZRwxbfaypsx5y", te = "5WNMiV9Knz63B4dVY5JtMyh3FB4FSGqv7ceScvuapdE1", re = "4EzhSubEimSQD3zrYHRtobfPPWntUuhEz8YcdxHsi12u", et = "6aehfNAxHLC1PHHoDr3tYtFH3RWNbiWdFancJ1bypXEY", bt = "G7fBT9PSod1RfHLHkpafAGBDVAJMrMhAMY51ERcyXNrj", Et = [
|
|
38
38
|
Q,
|
|
39
39
|
ee,
|
|
40
40
|
te,
|
|
41
41
|
re
|
|
42
42
|
], pe = [
|
|
43
|
-
...
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
],
|
|
47
|
-
|
|
48
|
-
),
|
|
49
|
-
pe.map((i, e) => [i,
|
|
43
|
+
...Et,
|
|
44
|
+
et,
|
|
45
|
+
bt
|
|
46
|
+
], ar = Object.fromEntries(
|
|
47
|
+
St.map((i, e) => [i, pe[e]])
|
|
48
|
+
), tt = Object.fromEntries(
|
|
49
|
+
pe.map((i, e) => [i, St[e]])
|
|
50
50
|
), nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
51
51
|
__proto__: null,
|
|
52
|
-
BASIC_TYPES:
|
|
53
|
-
BASIC_TYPE_BLUE_IDS:
|
|
54
|
-
BOOLEAN_TYPE:
|
|
52
|
+
BASIC_TYPES: Qe,
|
|
53
|
+
BASIC_TYPE_BLUE_IDS: Et,
|
|
54
|
+
BOOLEAN_TYPE: nr,
|
|
55
55
|
BOOLEAN_TYPE_BLUE_ID: re,
|
|
56
|
-
CORE_TYPES:
|
|
56
|
+
CORE_TYPES: St,
|
|
57
57
|
CORE_TYPE_BLUE_IDS: pe,
|
|
58
|
-
CORE_TYPE_BLUE_ID_TO_NAME_MAP:
|
|
59
|
-
CORE_TYPE_NAME_TO_BLUE_ID_MAP:
|
|
60
|
-
DICTIONARY_TYPE:
|
|
61
|
-
DICTIONARY_TYPE_BLUE_ID:
|
|
62
|
-
DOUBLE_TYPE:
|
|
58
|
+
CORE_TYPE_BLUE_ID_TO_NAME_MAP: tt,
|
|
59
|
+
CORE_TYPE_NAME_TO_BLUE_ID_MAP: ar,
|
|
60
|
+
DICTIONARY_TYPE: lr,
|
|
61
|
+
DICTIONARY_TYPE_BLUE_ID: bt,
|
|
62
|
+
DOUBLE_TYPE: sr,
|
|
63
63
|
DOUBLE_TYPE_BLUE_ID: ee,
|
|
64
|
-
INTEGER_TYPE:
|
|
64
|
+
INTEGER_TYPE: ir,
|
|
65
65
|
INTEGER_TYPE_BLUE_ID: te,
|
|
66
|
-
LIST_TYPE:
|
|
67
|
-
LIST_TYPE_BLUE_ID:
|
|
68
|
-
OBJECT_BLUE:
|
|
66
|
+
LIST_TYPE: or,
|
|
67
|
+
LIST_TYPE_BLUE_ID: et,
|
|
68
|
+
OBJECT_BLUE: $e,
|
|
69
69
|
OBJECT_BLUE_ID: V,
|
|
70
70
|
OBJECT_CONTRACTS: U,
|
|
71
71
|
OBJECT_DESCRIPTION: ne,
|
|
72
72
|
OBJECT_ITEMS: Y,
|
|
73
73
|
OBJECT_ITEM_TYPE: Pe,
|
|
74
74
|
OBJECT_KEY_TYPE: we,
|
|
75
|
-
OBJECT_MERGE_POLICY:
|
|
75
|
+
OBJECT_MERGE_POLICY: Bt,
|
|
76
76
|
OBJECT_NAME: ie,
|
|
77
|
-
OBJECT_SCHEMA:
|
|
78
|
-
OBJECT_SPECIFIC_KEYS:
|
|
77
|
+
OBJECT_SCHEMA: er,
|
|
78
|
+
OBJECT_SPECIFIC_KEYS: wt,
|
|
79
79
|
OBJECT_TYPE: z,
|
|
80
80
|
OBJECT_VALUE: W,
|
|
81
81
|
OBJECT_VALUE_TYPE: Se,
|
|
82
|
-
TEXT_TYPE:
|
|
82
|
+
TEXT_TYPE: rr,
|
|
83
83
|
TEXT_TYPE_BLUE_ID: Q
|
|
84
84
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
85
|
-
class
|
|
85
|
+
class Hr {
|
|
86
86
|
static get(e, t, r, s = !0) {
|
|
87
87
|
if (I(t) || !t.startsWith("/"))
|
|
88
88
|
throw new Error(`Invalid path: ${t}`);
|
|
@@ -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;
|
|
@@ -358,7 +358,7 @@ class u {
|
|
|
358
358
|
return !1;
|
|
359
359
|
}
|
|
360
360
|
get(e, t) {
|
|
361
|
-
return
|
|
361
|
+
return Hr.get(this, e, t);
|
|
362
362
|
}
|
|
363
363
|
getAsNode(e) {
|
|
364
364
|
const t = this.get(e);
|
|
@@ -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}`
|
|
@@ -399,7 +399,7 @@ class ve {
|
|
|
399
399
|
if (s < this.MIN_BLUE_ID_LENGTH || s > this.MAX_BLUE_ID_LENGTH)
|
|
400
400
|
return !1;
|
|
401
401
|
try {
|
|
402
|
-
if (
|
|
402
|
+
if (Ve.decode(r).length !== 32)
|
|
403
403
|
return !1;
|
|
404
404
|
} catch {
|
|
405
405
|
return !1;
|
|
@@ -421,7 +421,7 @@ const on = f.string().max(ve.MAX_BLUE_ID_LENGTH, {
|
|
|
421
421
|
}).refine(
|
|
422
422
|
(i) => {
|
|
423
423
|
try {
|
|
424
|
-
return
|
|
424
|
+
return Ve.decode(i), !0;
|
|
425
425
|
} catch {
|
|
426
426
|
return !1;
|
|
427
427
|
}
|
|
@@ -429,45 +429,45 @@ const on = f.string().max(ve.MAX_BLUE_ID_LENGTH, {
|
|
|
429
429
|
{
|
|
430
430
|
message: "Blue Id must be a valid Base58 string"
|
|
431
431
|
}
|
|
432
|
-
),
|
|
432
|
+
), Oe = f.lazy(
|
|
433
433
|
() => f.record(f.unknown()).and(
|
|
434
434
|
f.object({
|
|
435
435
|
blueId: f.string().optional(),
|
|
436
436
|
name: f.string().optional(),
|
|
437
437
|
description: f.string().optional(),
|
|
438
|
-
type:
|
|
438
|
+
type: Oe.optional(),
|
|
439
439
|
value: f.union([f.string(), f.number(), f.boolean()]).optional().nullable(),
|
|
440
|
-
items: f.array(
|
|
440
|
+
items: f.array(Oe).optional()
|
|
441
441
|
})
|
|
442
442
|
)
|
|
443
|
-
),
|
|
443
|
+
), rt = f.object({
|
|
444
444
|
blueId: f.string().optional(),
|
|
445
445
|
name: f.string().optional(),
|
|
446
446
|
description: f.string().optional(),
|
|
447
|
-
type:
|
|
448
|
-
}), ln =
|
|
447
|
+
type: Oe.optional()
|
|
448
|
+
}), ln = rt.extend({
|
|
449
449
|
value: f.string().optional()
|
|
450
|
-
}), an =
|
|
450
|
+
}), an = rt.extend({
|
|
451
451
|
value: f.number().optional()
|
|
452
|
-
}), cn =
|
|
452
|
+
}), cn = rt.extend({
|
|
453
453
|
value: f.boolean().optional()
|
|
454
|
-
}), un =
|
|
454
|
+
}), un = rt.extend({
|
|
455
455
|
items: f.array(f.string()).optional()
|
|
456
|
-
}), dn = (i) =>
|
|
457
|
-
() => f.record(
|
|
458
|
-
),
|
|
456
|
+
}), dn = (i) => Oe.safeParse(i).success, kr = (i) => d(i) && "blueId" in i && d(i.blueId), hn = (i) => d(i) && "name" in i && d(i.name), Yr = (i) => d(i) && "items" in i && d(i.items), Wr = (i) => d(i) && "type" in i && d(i.type), Gr = (i) => d(i) && "value" in i && d(i.value), pn = (i, e) => i.required({ type: !0 }).safeParse(e).success, C = (i) => i instanceof G, oe = (i) => C(i) && i instanceof A, ht = (i) => C(i) && i instanceof x, Jr = f.lazy(
|
|
457
|
+
() => f.record(Je)
|
|
458
|
+
), Zr = f.lazy(
|
|
459
459
|
() => f.union([
|
|
460
|
-
f.array(
|
|
461
|
-
f.array(
|
|
460
|
+
f.array(Je),
|
|
461
|
+
f.array(Je).readonly()
|
|
462
462
|
])
|
|
463
|
-
),
|
|
463
|
+
), Je = f.lazy(
|
|
464
464
|
() => f.union([
|
|
465
|
-
|
|
466
|
-
Gr,
|
|
465
|
+
Or,
|
|
467
466
|
Jr,
|
|
467
|
+
Zr,
|
|
468
468
|
f.instanceof(G)
|
|
469
469
|
])
|
|
470
|
-
),
|
|
470
|
+
), cr = (i) => Xt(i) && !qt(i) && !Ht(i) && !C(i), ur = (i) => qt(i) || Ht(i), fn = (i) => ur(i) || cr(i) || C(i) || kt(i);
|
|
471
471
|
class m {
|
|
472
472
|
static deserialize(e) {
|
|
473
473
|
return m.handleNode(e);
|
|
@@ -477,7 +477,7 @@ class m {
|
|
|
477
477
|
throw new Error(
|
|
478
478
|
"This is not a valid JSON-like value. Found 'undefined' as a value."
|
|
479
479
|
);
|
|
480
|
-
if (
|
|
480
|
+
if (cr(e)) {
|
|
481
481
|
const t = new u(), r = {};
|
|
482
482
|
return Object.entries(e).forEach(([s, n]) => {
|
|
483
483
|
switch (s) {
|
|
@@ -524,7 +524,7 @@ class m {
|
|
|
524
524
|
case Y:
|
|
525
525
|
t.setItems(m.handleArray(n));
|
|
526
526
|
break;
|
|
527
|
-
case
|
|
527
|
+
case $e:
|
|
528
528
|
t.setBlue(m.handleNode(n));
|
|
529
529
|
break;
|
|
530
530
|
default:
|
|
@@ -533,7 +533,7 @@ class m {
|
|
|
533
533
|
}
|
|
534
534
|
}), Object.keys(r).length > 0 && t.setProperties(r), t;
|
|
535
535
|
} else {
|
|
536
|
-
if (
|
|
536
|
+
if (ur(e))
|
|
537
537
|
return new u().setItems(m.handleArray(e));
|
|
538
538
|
{
|
|
539
539
|
const t = e;
|
|
@@ -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;
|
|
@@ -560,7 +560,7 @@ class m {
|
|
|
560
560
|
}
|
|
561
561
|
static handleArray(e) {
|
|
562
562
|
if (e != null) {
|
|
563
|
-
if (
|
|
563
|
+
if (Xt(e) && !Array.isArray(e))
|
|
564
564
|
return [m.handleNode(e)];
|
|
565
565
|
if (Array.isArray(e))
|
|
566
566
|
return e.map(m.handleNode);
|
|
@@ -568,12 +568,12 @@ class m {
|
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
function
|
|
571
|
+
function Xr(i) {
|
|
572
572
|
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
573
573
|
}
|
|
574
|
-
var
|
|
575
|
-
function
|
|
576
|
-
return Lt || (Lt = 1,
|
|
574
|
+
var lt, Lt;
|
|
575
|
+
function qr() {
|
|
576
|
+
return Lt || (Lt = 1, lt = function i(e) {
|
|
577
577
|
if (typeof e == "number" && isNaN(e))
|
|
578
578
|
throw new Error("NaN is not allowed");
|
|
579
579
|
if (typeof e == "number" && !isFinite(e))
|
|
@@ -584,50 +584,50 @@ function Xr() {
|
|
|
584
584
|
const n = r.length === 0 ? "" : ",";
|
|
585
585
|
return `${r}${n}${i(s)}:${i(e[s])}`;
|
|
586
586
|
}, "")}}`;
|
|
587
|
-
}),
|
|
587
|
+
}), lt;
|
|
588
588
|
}
|
|
589
|
-
var
|
|
590
|
-
const
|
|
591
|
-
class
|
|
589
|
+
var Qr = qr();
|
|
590
|
+
const es = /* @__PURE__ */ Xr(Qr);
|
|
591
|
+
class pt {
|
|
592
592
|
static canonicalize(e) {
|
|
593
|
-
return
|
|
593
|
+
return es(e);
|
|
594
594
|
}
|
|
595
595
|
}
|
|
596
|
-
const
|
|
597
|
-
class
|
|
596
|
+
const at = typeof process < "u" && process.versions != null && process.versions.node != null;
|
|
597
|
+
class Nt {
|
|
598
598
|
static instance;
|
|
599
599
|
browserCrypto;
|
|
600
600
|
constructor() {
|
|
601
601
|
this.browserCrypto = this.initBrowserCrypto();
|
|
602
602
|
}
|
|
603
603
|
static getInstance() {
|
|
604
|
-
return this.instance || (this.instance = new
|
|
604
|
+
return this.instance || (this.instance = new Nt()), this.instance;
|
|
605
605
|
}
|
|
606
606
|
initBrowserCrypto() {
|
|
607
|
-
return
|
|
607
|
+
return at ? null : "crypto" in globalThis ? globalThis.crypto : null;
|
|
608
608
|
}
|
|
609
609
|
hasNodeCrypto() {
|
|
610
|
-
return
|
|
610
|
+
return at && !!ot && typeof ot.createHash == "function";
|
|
611
611
|
}
|
|
612
612
|
getBrowserCrypto() {
|
|
613
613
|
return this.browserCrypto;
|
|
614
614
|
}
|
|
615
615
|
getNodeCrypto() {
|
|
616
|
-
return
|
|
616
|
+
return at ? ot : null;
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
|
-
class
|
|
620
|
-
cryptoEnv =
|
|
619
|
+
class ts {
|
|
620
|
+
cryptoEnv = Nt.getInstance();
|
|
621
621
|
applySync(e) {
|
|
622
622
|
const t = this.canonicalizeInput(e), r = this.cryptoEnv.hasNodeCrypto() ? this.sha256Sync(t) : this.sha256SyncBrowser(t);
|
|
623
|
-
return
|
|
623
|
+
return Ve.encode(r);
|
|
624
624
|
}
|
|
625
625
|
async apply(e) {
|
|
626
626
|
const t = this.canonicalizeInput(e), r = this.cryptoEnv.hasNodeCrypto() ? this.sha256Sync(t) : await this.sha256Async(t);
|
|
627
|
-
return
|
|
627
|
+
return Ve.encode(r);
|
|
628
628
|
}
|
|
629
629
|
canonicalizeInput(e) {
|
|
630
|
-
const t =
|
|
630
|
+
const t = pt.canonicalize(e);
|
|
631
631
|
if (typeof t != "string")
|
|
632
632
|
throw new Error("Canonized value must be a string");
|
|
633
633
|
return t;
|
|
@@ -642,7 +642,7 @@ class es {
|
|
|
642
642
|
return new Uint8Array(r);
|
|
643
643
|
}
|
|
644
644
|
sha256SyncBrowser(e) {
|
|
645
|
-
return new Uint8Array(
|
|
645
|
+
return new Uint8Array(zr.arrayBuffer(e));
|
|
646
646
|
}
|
|
647
647
|
async sha256Async(e) {
|
|
648
648
|
if (this.cryptoEnv.hasNodeCrypto())
|
|
@@ -712,7 +712,7 @@ class b {
|
|
|
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
|
/**
|
|
@@ -771,14 +771,14 @@ class b {
|
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
773
|
}
|
|
774
|
-
const me = "$previous", ce = "$pos",
|
|
774
|
+
const me = "$previous", ce = "$pos", ft = "$empty";
|
|
775
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";
|
|
779
779
|
}
|
|
780
780
|
static getMergePolicyValue(e) {
|
|
781
|
-
const t = e.getProperties()?.[
|
|
781
|
+
const t = e.getProperties()?.[Bt]?.getValue();
|
|
782
782
|
if (t === "append-only" || t === "positional")
|
|
783
783
|
return t;
|
|
784
784
|
}
|
|
@@ -814,11 +814,11 @@ class B {
|
|
|
814
814
|
static hasEmptyProperty(e) {
|
|
815
815
|
return Object.prototype.hasOwnProperty.call(
|
|
816
816
|
e.getProperties() ?? {},
|
|
817
|
-
|
|
817
|
+
ft
|
|
818
818
|
);
|
|
819
819
|
}
|
|
820
820
|
static isEmptyItem(e) {
|
|
821
|
-
const t = e.getProperties(), r = t?.[
|
|
821
|
+
const t = e.getProperties(), r = t?.[ft];
|
|
822
822
|
return t !== void 0 && Object.keys(t).length === 1 && r !== void 0 && b.hasFieldsAndMayHaveFields(
|
|
823
823
|
e,
|
|
824
824
|
/* @__PURE__ */ new Set([S.PROPERTIES])
|
|
@@ -883,12 +883,12 @@ class B {
|
|
|
883
883
|
return e !== void 0 && this.hasPositionControl(e);
|
|
884
884
|
}
|
|
885
885
|
}
|
|
886
|
-
const
|
|
886
|
+
const rs = /* @__PURE__ */ new Set([
|
|
887
887
|
ie,
|
|
888
888
|
ne,
|
|
889
889
|
W
|
|
890
|
-
]),
|
|
891
|
-
class
|
|
890
|
+
]), ss = { $list: "empty" }, is = "$listCons", ns = "prev", os = "elem";
|
|
891
|
+
class ls {
|
|
892
892
|
constructor(e) {
|
|
893
893
|
this.hashProvider = e;
|
|
894
894
|
}
|
|
@@ -910,7 +910,7 @@ class os {
|
|
|
910
910
|
calculateMap(e, t) {
|
|
911
911
|
const s = Object.entries(e).sort(([o], [l]) => o.localeCompare(l)).map(
|
|
912
912
|
([o, l]) => {
|
|
913
|
-
if (
|
|
913
|
+
if (rs.has(o))
|
|
914
914
|
return t ? [o, l] : Promise.resolve([o, l]);
|
|
915
915
|
const a = this.calculateInternal(l, t);
|
|
916
916
|
return t ? [o, { [V]: a }] : Promise.resolve(a).then((c) => [
|
|
@@ -937,7 +937,7 @@ class os {
|
|
|
937
937
|
);
|
|
938
938
|
s = t ? o : Promise.resolve(o), r = 1;
|
|
939
939
|
} else
|
|
940
|
-
s = this.applyHash(
|
|
940
|
+
s = this.applyHash(ss, t);
|
|
941
941
|
for (let o = r; o < e.length; o++) {
|
|
942
942
|
const l = e[o];
|
|
943
943
|
if (this.hasPreviousControlKey(l))
|
|
@@ -958,9 +958,9 @@ class os {
|
|
|
958
958
|
}
|
|
959
959
|
createListFoldInput(e, t) {
|
|
960
960
|
return {
|
|
961
|
-
[
|
|
962
|
-
[
|
|
963
|
-
[
|
|
961
|
+
[is]: {
|
|
962
|
+
[ns]: { [V]: e },
|
|
963
|
+
[os]: { [V]: t }
|
|
964
964
|
}
|
|
965
965
|
};
|
|
966
966
|
}
|
|
@@ -995,7 +995,7 @@ class os {
|
|
|
995
995
|
const r = e.getValue();
|
|
996
996
|
r !== void 0 && (t[W] = this.scalarToHashValue(r));
|
|
997
997
|
const s = e.getItems();
|
|
998
|
-
s !== void 0 && (t[Y] = s.map((o) => this.nodeToHashValue(o))), this.setIfPresent(t, V, e.getReferenceBlueId()), this.setIfPresent(t,
|
|
998
|
+
s !== void 0 && (t[Y] = s.map((o) => this.nodeToHashValue(o))), this.setIfPresent(t, V, e.getReferenceBlueId()), this.setIfPresent(t, $e, e.getBlue());
|
|
999
999
|
const n = e.getProperties();
|
|
1000
1000
|
if (n !== void 0)
|
|
1001
1001
|
for (const [o, l] of Object.entries(n))
|
|
@@ -1050,7 +1050,7 @@ class os {
|
|
|
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, [z, Y]) && this.isTypeReference(e[z],
|
|
1053
|
+
return this.hasOnlyKeys(e, [z, Y]) && this.isTypeReference(e[z], et) && Array.isArray(e[Y]);
|
|
1054
1054
|
}
|
|
1055
1055
|
hasOnlyKeys(e, t) {
|
|
1056
1056
|
return Object.keys(e).length === t.length && t.every(
|
|
@@ -1064,24 +1064,24 @@ class os {
|
|
|
1064
1064
|
return typeof e != "object" || e === null || Array.isArray(e) || C(e) ? !1 : this.isPureReference(e) && e[V] === t;
|
|
1065
1065
|
}
|
|
1066
1066
|
isScalar(e) {
|
|
1067
|
-
return
|
|
1067
|
+
return kt(e) && e !== null || C(e);
|
|
1068
1068
|
}
|
|
1069
1069
|
scalarToHashValue(e) {
|
|
1070
1070
|
if (e instanceof A || oe(e)) {
|
|
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 || C(e) ? e.toNumber() : e;
|
|
1075
1075
|
}
|
|
1076
1076
|
toJsonScalar(e) {
|
|
1077
1077
|
return C(e) ? this.scalarToHashValue(e) : e;
|
|
1078
1078
|
}
|
|
1079
1079
|
}
|
|
1080
1080
|
class M {
|
|
1081
|
-
static INSTANCE = new M(new
|
|
1081
|
+
static INSTANCE = new M(new ts());
|
|
1082
1082
|
hasher;
|
|
1083
1083
|
constructor(e) {
|
|
1084
|
-
this.hasher = new
|
|
1084
|
+
this.hasher = new ls(e);
|
|
1085
1085
|
}
|
|
1086
1086
|
static calculateBlueId(e) {
|
|
1087
1087
|
return M.INSTANCE.calculate(e);
|
|
@@ -1290,7 +1290,7 @@ class j {
|
|
|
1290
1290
|
return d(h) && r.setItems(h.map((p) => p.clone())), r;
|
|
1291
1291
|
}
|
|
1292
1292
|
}
|
|
1293
|
-
class
|
|
1293
|
+
class yt {
|
|
1294
1294
|
mergeReverser = new j();
|
|
1295
1295
|
hashMergeReverser = new j({
|
|
1296
1296
|
emitListControls: !1
|
|
@@ -1331,8 +1331,8 @@ const K = {
|
|
|
1331
1331
|
};
|
|
1332
1332
|
class X {
|
|
1333
1333
|
static RESERVED_PROPERTY_KEYS = /* @__PURE__ */ new Set([
|
|
1334
|
-
|
|
1335
|
-
|
|
1334
|
+
er,
|
|
1335
|
+
Bt,
|
|
1336
1336
|
U
|
|
1337
1337
|
]);
|
|
1338
1338
|
static INTERNAL_PROPERTIES_KEY = "properties";
|
|
@@ -1458,7 +1458,7 @@ class X {
|
|
|
1458
1458
|
"The document-level properties key is not part of the Blue language."
|
|
1459
1459
|
), Object.fromEntries(
|
|
1460
1460
|
Object.entries(s).filter(
|
|
1461
|
-
([n]) => !this.RESERVED_PROPERTY_KEYS.has(n) && !(r.insideItems && (n === ce || n ===
|
|
1461
|
+
([n]) => !this.RESERVED_PROPERTY_KEYS.has(n) && !(r.insideItems && (n === ce || n === ft))
|
|
1462
1462
|
)
|
|
1463
1463
|
);
|
|
1464
1464
|
}
|
|
@@ -1482,10 +1482,10 @@ class X {
|
|
|
1482
1482
|
}
|
|
1483
1483
|
class yn {
|
|
1484
1484
|
static convert(e) {
|
|
1485
|
-
const t =
|
|
1485
|
+
const t = Ve.decode(e), r = new Uint8Array(2 + t.length);
|
|
1486
1486
|
r[0] = 18, r[1] = 32, r.set(t, 2);
|
|
1487
1487
|
const s = new Uint8Array(2 + r.length);
|
|
1488
|
-
return s[0] = 1, s[1] = 85, s.set(r, 2), "b" + new
|
|
1488
|
+
return s[0] = 1, s[1] = 85, s.set(r, 2), "b" + new Kr.Encoder({ type: "rfc4648", lc: !0 }).write(s).finalize().replace(/=/g, "");
|
|
1489
1489
|
}
|
|
1490
1490
|
}
|
|
1491
1491
|
class T {
|
|
@@ -1529,7 +1529,7 @@ class T {
|
|
|
1529
1529
|
const v = e.getBlueId();
|
|
1530
1530
|
v !== void 0 && (c[V] = v);
|
|
1531
1531
|
const D = e.getBlue();
|
|
1532
|
-
D !== void 0 && (c[
|
|
1532
|
+
D !== void 0 && (c[$e] = D);
|
|
1533
1533
|
const R = e.getProperties();
|
|
1534
1534
|
return R !== void 0 && Object.entries(R).forEach(([L, _e]) => {
|
|
1535
1535
|
c[L] = T.get(_e, r);
|
|
@@ -1597,12 +1597,12 @@ class $ {
|
|
|
1597
1597
|
return r;
|
|
1598
1598
|
}
|
|
1599
1599
|
}
|
|
1600
|
-
const le = (i) => !!i && typeof i == "object" && !Array.isArray(i) && !(i instanceof u), q = (i) => i instanceof A || i instanceof
|
|
1600
|
+
const le = (i) => !!i && typeof i == "object" && !Array.isArray(i) && !(i instanceof u), q = (i) => i instanceof A || i instanceof x, as = (i) => i.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
1601
1601
|
function be(i) {
|
|
1602
1602
|
if (i === "/") return [];
|
|
1603
1603
|
if (!i.startsWith("/"))
|
|
1604
1604
|
throw new Error(`Path must start with '/': ${i}`);
|
|
1605
|
-
return i.split("/").slice(1).map(
|
|
1605
|
+
return i.split("/").slice(1).map(as);
|
|
1606
1606
|
}
|
|
1607
1607
|
function Be(i) {
|
|
1608
1608
|
if (i === "-") return -1;
|
|
@@ -1615,7 +1615,7 @@ function Be(i) {
|
|
|
1615
1615
|
);
|
|
1616
1616
|
return e;
|
|
1617
1617
|
}
|
|
1618
|
-
function
|
|
1618
|
+
function dr(i, e, t, r = !0) {
|
|
1619
1619
|
switch (e) {
|
|
1620
1620
|
case "name":
|
|
1621
1621
|
return t ? r ? i.getName() ?? null : i : i.getName();
|
|
@@ -1647,7 +1647,7 @@ function ur(i, e, t, r = !0) {
|
|
|
1647
1647
|
}
|
|
1648
1648
|
function $t(i, e, t = !0) {
|
|
1649
1649
|
if (i instanceof u) {
|
|
1650
|
-
const r =
|
|
1650
|
+
const r = dr(
|
|
1651
1651
|
i,
|
|
1652
1652
|
e,
|
|
1653
1653
|
!0,
|
|
@@ -1711,9 +1711,9 @@ function Ee(i, e) {
|
|
|
1711
1711
|
key: Array.isArray(t) ? Be(r) : r
|
|
1712
1712
|
};
|
|
1713
1713
|
}
|
|
1714
|
-
function
|
|
1714
|
+
function Ct(i, e) {
|
|
1715
1715
|
if (i instanceof u) {
|
|
1716
|
-
const t = e, r =
|
|
1716
|
+
const t = e, r = dr(i, t, !1);
|
|
1717
1717
|
if (r !== void 0 || [
|
|
1718
1718
|
"name",
|
|
1719
1719
|
"description",
|
|
@@ -1737,23 +1737,23 @@ function Nt(i, e) {
|
|
|
1737
1737
|
}
|
|
1738
1738
|
return Array.isArray(i) || le(i) ? i[e] : i;
|
|
1739
1739
|
}
|
|
1740
|
-
function
|
|
1740
|
+
function _(i) {
|
|
1741
1741
|
if (i instanceof u) return i;
|
|
1742
1742
|
if (i === null || typeof i == "string" || typeof i == "number" || typeof i == "boolean" || q(i))
|
|
1743
1743
|
return m.deserialize(i);
|
|
1744
|
-
const e =
|
|
1744
|
+
const e = gt(i);
|
|
1745
1745
|
return m.deserialize(e);
|
|
1746
1746
|
}
|
|
1747
|
-
function
|
|
1747
|
+
function gt(i) {
|
|
1748
1748
|
if (i === void 0) return null;
|
|
1749
1749
|
if (i === null || typeof i != "object") return i;
|
|
1750
|
-
if (Array.isArray(i)) return i.map(
|
|
1750
|
+
if (Array.isArray(i)) return i.map(gt);
|
|
1751
1751
|
const e = {};
|
|
1752
1752
|
for (const [t, r] of Object.entries(i))
|
|
1753
|
-
e[t] =
|
|
1753
|
+
e[t] = gt(r);
|
|
1754
1754
|
return e;
|
|
1755
1755
|
}
|
|
1756
|
-
function
|
|
1756
|
+
function Rt(i, e, t) {
|
|
1757
1757
|
if (i instanceof u) {
|
|
1758
1758
|
const r = e;
|
|
1759
1759
|
switch (r) {
|
|
@@ -1765,22 +1765,22 @@ function Ct(i, e, t) {
|
|
|
1765
1765
|
return;
|
|
1766
1766
|
case "type":
|
|
1767
1767
|
i.setType(
|
|
1768
|
-
t instanceof u || typeof t == "string" || t === void 0 ? t :
|
|
1768
|
+
t instanceof u || typeof t == "string" || t === void 0 ? t : _(t)
|
|
1769
1769
|
);
|
|
1770
1770
|
return;
|
|
1771
1771
|
case "itemType":
|
|
1772
1772
|
i.setItemType(
|
|
1773
|
-
t instanceof u || typeof t == "string" || t === void 0 ? t :
|
|
1773
|
+
t instanceof u || typeof t == "string" || t === void 0 ? t : _(t)
|
|
1774
1774
|
);
|
|
1775
1775
|
return;
|
|
1776
1776
|
case "keyType":
|
|
1777
1777
|
i.setKeyType(
|
|
1778
|
-
t instanceof u || typeof t == "string" || t === void 0 ? t :
|
|
1778
|
+
t instanceof u || typeof t == "string" || t === void 0 ? t : _(t)
|
|
1779
1779
|
);
|
|
1780
1780
|
return;
|
|
1781
1781
|
case "valueType":
|
|
1782
1782
|
i.setValueType(
|
|
1783
|
-
t instanceof u || typeof t == "string" || t === void 0 ? t :
|
|
1783
|
+
t instanceof u || typeof t == "string" || t === void 0 ? t : _(t)
|
|
1784
1784
|
);
|
|
1785
1785
|
return;
|
|
1786
1786
|
case "value": {
|
|
@@ -1793,7 +1793,7 @@ function Ct(i, e, t) {
|
|
|
1793
1793
|
return;
|
|
1794
1794
|
case "blue":
|
|
1795
1795
|
i.setBlue(
|
|
1796
|
-
t instanceof u || t === void 0 ? t :
|
|
1796
|
+
t instanceof u || t === void 0 ? t : _(t)
|
|
1797
1797
|
);
|
|
1798
1798
|
return;
|
|
1799
1799
|
case "items":
|
|
@@ -1810,14 +1810,14 @@ function Ct(i, e, t) {
|
|
|
1810
1810
|
const s = i.getProperties();
|
|
1811
1811
|
s && r in s && delete s[r];
|
|
1812
1812
|
} else
|
|
1813
|
-
i.getProperties() || i.setProperties({}), i.addProperty(r, t instanceof u ? t :
|
|
1813
|
+
i.getProperties() || i.setProperties({}), i.addProperty(r, t instanceof u ? t : _(t));
|
|
1814
1814
|
return;
|
|
1815
1815
|
}
|
|
1816
1816
|
}
|
|
1817
1817
|
}
|
|
1818
1818
|
Array.isArray(i) ? i.splice(Be(e), 1) : le(i) && (t === void 0 ? delete i[e] : i[e] = t);
|
|
1819
1819
|
}
|
|
1820
|
-
function
|
|
1820
|
+
function cs(i, e, t, r) {
|
|
1821
1821
|
let s = -1;
|
|
1822
1822
|
if (e !== "-" && (s = typeof e == "number" ? e : parseInt(e, 10), isNaN(s)))
|
|
1823
1823
|
throw new Error(
|
|
@@ -1843,7 +1843,7 @@ function as(i, e, t, r) {
|
|
|
1843
1843
|
} else
|
|
1844
1844
|
n.splice(s, 0, t);
|
|
1845
1845
|
}
|
|
1846
|
-
function
|
|
1846
|
+
function Ze(i, e, t, r) {
|
|
1847
1847
|
if (Array.isArray(i)) {
|
|
1848
1848
|
const s = e === "-" ? i.length : Be(e);
|
|
1849
1849
|
if (!r && s > i.length)
|
|
@@ -1852,7 +1852,7 @@ function Je(i, e, t, r) {
|
|
|
1852
1852
|
);
|
|
1853
1853
|
if (s < 0 && e !== "-")
|
|
1854
1854
|
throw new Error(`Invalid negative array index: ${e}`);
|
|
1855
|
-
const n =
|
|
1855
|
+
const n = _(t);
|
|
1856
1856
|
if (r) {
|
|
1857
1857
|
if (s >= 0 && s < i.length) i[s] = n;
|
|
1858
1858
|
else if (s >= i.length) {
|
|
@@ -1865,16 +1865,16 @@ function Je(i, e, t, r) {
|
|
|
1865
1865
|
return;
|
|
1866
1866
|
}
|
|
1867
1867
|
if (i instanceof u) {
|
|
1868
|
-
e === "-" || typeof e == "number" && !isNaN(e) || typeof e == "string" && /^\d+$/.test(e) ?
|
|
1868
|
+
e === "-" || typeof e == "number" && !isNaN(e) || typeof e == "string" && /^\d+$/.test(e) ? cs(i, e, _(t), r) : Rt(i, e, t);
|
|
1869
1869
|
return;
|
|
1870
1870
|
}
|
|
1871
1871
|
if (le(i)) {
|
|
1872
|
-
i[e] =
|
|
1872
|
+
i[e] = _(t);
|
|
1873
1873
|
return;
|
|
1874
1874
|
}
|
|
1875
1875
|
throw new Error(`Cannot insert into parent of type ${typeof i}`);
|
|
1876
1876
|
}
|
|
1877
|
-
function
|
|
1877
|
+
function us(i, e) {
|
|
1878
1878
|
if (Array.isArray(i)) {
|
|
1879
1879
|
const t = Be(e);
|
|
1880
1880
|
t === -1 && e === "-" ? i.length > 0 && i.pop() : t >= 0 && t < i.length && i.splice(t, 1);
|
|
@@ -1889,17 +1889,17 @@ function cs(i, e) {
|
|
|
1889
1889
|
return;
|
|
1890
1890
|
}
|
|
1891
1891
|
}
|
|
1892
|
-
|
|
1892
|
+
Rt(i, e, void 0);
|
|
1893
1893
|
} else le(i) && delete i[e];
|
|
1894
1894
|
}
|
|
1895
|
-
function
|
|
1895
|
+
function mt(i) {
|
|
1896
1896
|
if (i instanceof u) return i.clone();
|
|
1897
1897
|
if (Array.isArray(i))
|
|
1898
|
-
return i.map((t) =>
|
|
1898
|
+
return i.map((t) => mt(t));
|
|
1899
1899
|
if (le(i)) {
|
|
1900
1900
|
const e = {};
|
|
1901
1901
|
return Object.keys(i).forEach((t) => {
|
|
1902
|
-
e[t] =
|
|
1902
|
+
e[t] = mt(i[t]);
|
|
1903
1903
|
}), e;
|
|
1904
1904
|
}
|
|
1905
1905
|
return i;
|
|
@@ -1917,76 +1917,76 @@ function ue(i, e) {
|
|
|
1917
1917
|
}
|
|
1918
1918
|
return !1;
|
|
1919
1919
|
}
|
|
1920
|
-
function
|
|
1920
|
+
function hr(i, e) {
|
|
1921
1921
|
const { parent: t, key: r } = Ee(i, be(e));
|
|
1922
|
-
return
|
|
1922
|
+
return Ct(t, r);
|
|
1923
1923
|
}
|
|
1924
|
-
function
|
|
1924
|
+
function pr(i, e, t) {
|
|
1925
1925
|
const r = be(e);
|
|
1926
1926
|
if (r.length === 0 && e === "/") {
|
|
1927
|
-
const o =
|
|
1927
|
+
const o = _(t);
|
|
1928
1928
|
i.setValue(o.getValue() ?? null), o.getItems() ? i.setItems(o.getItems()) : i.setItems(void 0);
|
|
1929
1929
|
return;
|
|
1930
1930
|
}
|
|
1931
1931
|
const { parent: s, key: n } = Ee(i, r);
|
|
1932
|
-
|
|
1932
|
+
Ze(s, n, t, !0);
|
|
1933
1933
|
}
|
|
1934
|
-
function
|
|
1934
|
+
function ds(i, e, t) {
|
|
1935
1935
|
const r = be(e);
|
|
1936
1936
|
if (r.length === 0 && e === "/") {
|
|
1937
1937
|
if (i.getItems() && Array.isArray(t)) {
|
|
1938
|
-
const o =
|
|
1938
|
+
const o = _(t);
|
|
1939
1939
|
o.getItems() ? (i.setItems(o.getItems()), i.setValue(null)) : (i.setValue(o.getValue() ?? null), i.setItems(void 0));
|
|
1940
1940
|
} else {
|
|
1941
|
-
const o =
|
|
1941
|
+
const o = _(t);
|
|
1942
1942
|
i.setValue(o.getValue() ?? null), o.getItems() && i.setItems(o.getItems());
|
|
1943
1943
|
}
|
|
1944
1944
|
return !0;
|
|
1945
1945
|
}
|
|
1946
1946
|
const { parent: s, key: n } = Ee(i, r);
|
|
1947
|
-
return
|
|
1947
|
+
return Ze(s, n, t, !1), !0;
|
|
1948
1948
|
}
|
|
1949
|
-
function
|
|
1949
|
+
function hs(i, e, t) {
|
|
1950
1950
|
const r = be(e);
|
|
1951
1951
|
if (r.length === 0 && e === "/") {
|
|
1952
|
-
const l =
|
|
1952
|
+
const l = _(t);
|
|
1953
1953
|
return i.setValue(l.getValue() ?? null), l.getItems() ? i.setItems(l.getItems()) : i.setItems(void 0), !0;
|
|
1954
1954
|
}
|
|
1955
1955
|
const { parent: s, key: n, actualTarget: o } = Ee(i, r);
|
|
1956
1956
|
if (o !== void 0 && s instanceof u)
|
|
1957
|
-
|
|
1957
|
+
Rt(s, n, t);
|
|
1958
1958
|
else {
|
|
1959
|
-
const l =
|
|
1959
|
+
const l = Ct(s, n), a = Array.isArray(s) || s instanceof u && s.getItems() && (typeof n == "number" || typeof n == "string" && /^\d+$/.test(n));
|
|
1960
1960
|
if (l === void 0) {
|
|
1961
1961
|
if (a)
|
|
1962
1962
|
throw new Error(
|
|
1963
1963
|
`REPLACE failed: Target array index '${n.toString()}' is out of bounds or does not exist at path '${e}'.`
|
|
1964
1964
|
);
|
|
1965
|
-
|
|
1965
|
+
Ze(s, n, t, !0);
|
|
1966
1966
|
} else
|
|
1967
|
-
|
|
1967
|
+
Ze(s, n, t, !0);
|
|
1968
1968
|
}
|
|
1969
1969
|
return !0;
|
|
1970
1970
|
}
|
|
1971
|
-
function
|
|
1971
|
+
function fr(i, e) {
|
|
1972
1972
|
const t = be(e);
|
|
1973
1973
|
if (t.length === 0 && e === "/")
|
|
1974
1974
|
return i.setValue(null), i.setItems(void 0), i.setProperties(void 0), !0;
|
|
1975
1975
|
const { parent: r, key: s } = Ee(i, t);
|
|
1976
|
-
return
|
|
1977
|
-
}
|
|
1978
|
-
function hs(i, e, t) {
|
|
1979
|
-
const r = gt(dr(i, e));
|
|
1980
|
-
return hr(i, t, r), !0;
|
|
1976
|
+
return us(r, s), !0;
|
|
1981
1977
|
}
|
|
1982
1978
|
function ps(i, e, t) {
|
|
1983
|
-
const r =
|
|
1979
|
+
const r = mt(hr(i, e));
|
|
1980
|
+
return pr(i, t, r), !0;
|
|
1981
|
+
}
|
|
1982
|
+
function fs(i, e, t) {
|
|
1983
|
+
const r = be(e), { parent: s, key: n } = Ee(i, r), o = Ct(s, n);
|
|
1984
1984
|
if (o === void 0)
|
|
1985
1985
|
throw new Error(`MOVE failed: 'from' location '${e}' does not exist.`);
|
|
1986
|
-
return
|
|
1986
|
+
return fr(i, e) ? (pr(i, t, o), !0) : !1;
|
|
1987
1987
|
}
|
|
1988
|
-
function
|
|
1989
|
-
const r =
|
|
1988
|
+
function ys(i, e, t) {
|
|
1989
|
+
const r = hr(i, e);
|
|
1990
1990
|
let s = t;
|
|
1991
1991
|
if (r instanceof u)
|
|
1992
1992
|
if ((t === null || typeof t == "string" || typeof t == "number" || typeof t == "boolean" || q(t)) && (r.isInlineValue() || r.getValue() !== void 0)) {
|
|
@@ -1997,9 +1997,9 @@ function fs(i, e, t) {
|
|
|
1997
1997
|
)}, got ${JSON.stringify(r.getValue() ?? null)}`
|
|
1998
1998
|
);
|
|
1999
1999
|
return !0;
|
|
2000
|
-
} else typeof t == "object" && !(t instanceof u) && (s =
|
|
2000
|
+
} else typeof t == "object" && !(t instanceof u) && (s = _(t));
|
|
2001
2001
|
else if (q(r) && typeof t == "number")
|
|
2002
|
-
r instanceof A ? s = new A(t.toString()) : r instanceof
|
|
2002
|
+
r instanceof A ? s = new A(t.toString()) : r instanceof x && (s = new x(t.toString()));
|
|
2003
2003
|
else if ((r === null || typeof r == "string" || typeof r == "number" || typeof r == "boolean") && q(t)) {
|
|
2004
2004
|
const n = t;
|
|
2005
2005
|
!ue(r, n.toString()) && (typeof r == "number" && parseFloat(n.toString()));
|
|
@@ -2012,93 +2012,93 @@ function fs(i, e, t) {
|
|
|
2012
2012
|
}
|
|
2013
2013
|
return !0;
|
|
2014
2014
|
}
|
|
2015
|
-
function
|
|
2015
|
+
function gs(i, e) {
|
|
2016
2016
|
switch (e.op) {
|
|
2017
2017
|
case "add":
|
|
2018
|
-
return us(i, e.path, e.val);
|
|
2019
|
-
case "replace":
|
|
2020
2018
|
return ds(i, e.path, e.val);
|
|
2019
|
+
case "replace":
|
|
2020
|
+
return hs(i, e.path, e.val);
|
|
2021
2021
|
case "remove":
|
|
2022
|
-
return
|
|
2022
|
+
return fr(i, e.path);
|
|
2023
2023
|
case "copy":
|
|
2024
|
-
return hs(i, e.from, e.path);
|
|
2025
|
-
case "move":
|
|
2026
2024
|
return ps(i, e.from, e.path);
|
|
2025
|
+
case "move":
|
|
2026
|
+
return fs(i, e.from, e.path);
|
|
2027
2027
|
case "test":
|
|
2028
|
-
return
|
|
2028
|
+
return ys(i, e.path, e.val);
|
|
2029
2029
|
}
|
|
2030
2030
|
}
|
|
2031
2031
|
function gn(i, e, t = !1) {
|
|
2032
2032
|
const r = t ? i : i.clone();
|
|
2033
|
-
return
|
|
2033
|
+
return gs(r, e), r;
|
|
2034
2034
|
}
|
|
2035
|
-
const
|
|
2036
|
-
function
|
|
2035
|
+
const ct = Symbol.for("zod-schema-annotations");
|
|
2036
|
+
function ms() {
|
|
2037
2037
|
if (typeof globalThis < "u") return globalThis;
|
|
2038
2038
|
if (typeof global < "u") return global;
|
|
2039
2039
|
if (typeof window < "u") return window;
|
|
2040
2040
|
if (typeof self < "u") return self;
|
|
2041
2041
|
throw new Error("Unable to locate global object");
|
|
2042
2042
|
}
|
|
2043
|
-
function
|
|
2044
|
-
const i =
|
|
2045
|
-
return
|
|
2043
|
+
function yr() {
|
|
2044
|
+
const i = ms();
|
|
2045
|
+
return ct in i || (i[ct] = /* @__PURE__ */ new WeakMap()), i[ct];
|
|
2046
2046
|
}
|
|
2047
|
-
function
|
|
2048
|
-
const t =
|
|
2047
|
+
function xe(i, e) {
|
|
2048
|
+
const t = yr(), r = t.get(i) || {};
|
|
2049
2049
|
return t.set(i, { ...r, ...e }), i;
|
|
2050
2050
|
}
|
|
2051
|
-
const Z = (i) =>
|
|
2051
|
+
const Z = (i) => yr().get(i), Is = (i) => (e) => {
|
|
2052
2052
|
const t = Z(e);
|
|
2053
|
-
return
|
|
2053
|
+
return xe(e, {
|
|
2054
2054
|
...t,
|
|
2055
2055
|
blueDescription: i
|
|
2056
2056
|
});
|
|
2057
|
-
},
|
|
2057
|
+
}, vs = (i) => {
|
|
2058
2058
|
const e = Z(i);
|
|
2059
|
-
return d(e) &&
|
|
2060
|
-
}, mn = (i) =>
|
|
2059
|
+
return d(e) && Tt(e.blueDescription) ? e.blueDescription : null;
|
|
2060
|
+
}, mn = (i) => Is(i)(f.string().optional()), Ts = f.union([f.string(), f.boolean()]), Bs = (i) => (e) => {
|
|
2061
2061
|
const t = Z(e);
|
|
2062
|
-
return
|
|
2062
|
+
return xe(e, {
|
|
2063
2063
|
...t,
|
|
2064
2064
|
blueId: i
|
|
2065
2065
|
});
|
|
2066
|
-
},
|
|
2067
|
-
const e = Z(i), t =
|
|
2066
|
+
}, Ps = (i) => {
|
|
2067
|
+
const e = Z(i), t = Ts.safeParse(e?.blueId);
|
|
2068
2068
|
return t.success ? t.data : null;
|
|
2069
|
-
}, In = (i) =>
|
|
2069
|
+
}, In = (i) => Bs(i ?? !0)(f.string()), ws = (i) => (e) => {
|
|
2070
2070
|
const t = Z(e);
|
|
2071
|
-
return
|
|
2071
|
+
return xe(e, {
|
|
2072
2072
|
...t,
|
|
2073
2073
|
blueName: i
|
|
2074
2074
|
});
|
|
2075
|
-
},
|
|
2075
|
+
}, Ss = (i) => {
|
|
2076
2076
|
const e = Z(i);
|
|
2077
|
-
return d(e) &&
|
|
2077
|
+
return d(e) && Tt(e.blueName) ? e.blueName : null;
|
|
2078
2078
|
}, vn = (i) => {
|
|
2079
2079
|
const e = f.string().optional();
|
|
2080
|
-
return
|
|
2081
|
-
},
|
|
2080
|
+
return ws(i)(e);
|
|
2081
|
+
}, bs = () => (i) => {
|
|
2082
2082
|
const e = Z(i);
|
|
2083
|
-
return
|
|
2083
|
+
return xe(i, {
|
|
2084
2084
|
...e,
|
|
2085
2085
|
blueNode: !0
|
|
2086
2086
|
});
|
|
2087
|
-
},
|
|
2087
|
+
}, Es = (i) => {
|
|
2088
2088
|
const e = Z(i);
|
|
2089
2089
|
return d(e) && d(e.blueNode) && e.blueNode === !0 ? e.blueNode : null;
|
|
2090
|
-
},
|
|
2090
|
+
}, gr = (i) => !!Es(i), Tn = () => {
|
|
2091
2091
|
const i = f.instanceof(u);
|
|
2092
|
-
return
|
|
2093
|
-
},
|
|
2092
|
+
return bs()(i);
|
|
2093
|
+
}, Ns = f.object({
|
|
2094
2094
|
value: f.array(f.string()).optional(),
|
|
2095
2095
|
defaultValue: f.string().optional()
|
|
2096
|
-
}),
|
|
2097
|
-
const e = Z(i), t =
|
|
2096
|
+
}), Cs = (i) => {
|
|
2097
|
+
const e = Z(i), t = Ns.passthrough().safeParse(e?.typeBlueId);
|
|
2098
2098
|
return t.success ? t.data : null;
|
|
2099
2099
|
}, Bn = (i) => (e) => {
|
|
2100
2100
|
const t = Z(e), r = typeof i == "string" ? { value: [i] } : i;
|
|
2101
|
-
return
|
|
2101
|
+
return xe(e, {
|
|
2102
2102
|
...t,
|
|
2103
2103
|
typeBlueId: {
|
|
2104
2104
|
...t?.typeBlueId || {},
|
|
@@ -2106,16 +2106,16 @@ const Z = (i) => fr().get(i), ms = (i) => (e) => {
|
|
|
2106
2106
|
}
|
|
2107
2107
|
});
|
|
2108
2108
|
};
|
|
2109
|
-
class
|
|
2109
|
+
class Me {
|
|
2110
2110
|
static resolveBlueId(e) {
|
|
2111
|
-
const t =
|
|
2111
|
+
const t = Cs(e);
|
|
2112
2112
|
if (I(t))
|
|
2113
2113
|
return null;
|
|
2114
2114
|
const r = t.defaultValue;
|
|
2115
2115
|
if (d(r))
|
|
2116
2116
|
return r;
|
|
2117
2117
|
const s = t.value?.[0];
|
|
2118
|
-
return d(s) ? s :
|
|
2118
|
+
return d(s) ? s : Me.getRepositoryBlueId(t, e);
|
|
2119
2119
|
}
|
|
2120
2120
|
static getRepositoryBlueId(e, t) {
|
|
2121
2121
|
throw new Error("Not implemented");
|
|
@@ -2124,7 +2124,7 @@ class Oe {
|
|
|
2124
2124
|
class H {
|
|
2125
2125
|
// TODO: Enhance to support schemas associated with multiple blueIds
|
|
2126
2126
|
static isTypeOf(e, t, r) {
|
|
2127
|
-
const s =
|
|
2127
|
+
const s = Me.resolveBlueId(t), n = e.getType()?.getBlueId();
|
|
2128
2128
|
if (I(s) || I(n))
|
|
2129
2129
|
return !1;
|
|
2130
2130
|
const o = r?.blueIdMapper?.toCurrentBlueId(s) ?? s, l = r?.blueIdMapper?.toCurrentBlueId(n) ?? n;
|
|
@@ -2151,17 +2151,17 @@ class H {
|
|
|
2151
2151
|
) : !1;
|
|
2152
2152
|
}
|
|
2153
2153
|
static isWrapperType(e) {
|
|
2154
|
-
return e instanceof
|
|
2154
|
+
return e instanceof Wt || e instanceof Gt || e instanceof Jt || e instanceof Zt || e instanceof We || e instanceof Ge;
|
|
2155
2155
|
}
|
|
2156
2156
|
static unwrapSchema(e) {
|
|
2157
|
-
return
|
|
2157
|
+
return gr(e) ? e : H.isWrapperType(e) ? e instanceof We ? H.unwrapSchema(e.innerType()) : e instanceof Ge ? H.unwrapSchema(e.schema) : H.unwrapSchema(e.unwrap()) : e;
|
|
2158
2158
|
}
|
|
2159
2159
|
}
|
|
2160
|
-
const
|
|
2161
|
-
function
|
|
2162
|
-
return i[
|
|
2160
|
+
const mr = Symbol("blue.subtypeCache");
|
|
2161
|
+
function Rs(i, e) {
|
|
2162
|
+
return i[mr] = e, i;
|
|
2163
2163
|
}
|
|
2164
|
-
function
|
|
2164
|
+
function xt(i, e) {
|
|
2165
2165
|
const t = i.getType();
|
|
2166
2166
|
if (t === void 0)
|
|
2167
2167
|
return;
|
|
@@ -2170,7 +2170,7 @@ function _t(i, e) {
|
|
|
2170
2170
|
if (pe.includes(
|
|
2171
2171
|
r
|
|
2172
2172
|
)) {
|
|
2173
|
-
const n =
|
|
2173
|
+
const n = tt[r];
|
|
2174
2174
|
return new u().setBlueId(r).setName(n);
|
|
2175
2175
|
}
|
|
2176
2176
|
const s = e.fetchByBlueId(r);
|
|
@@ -2185,10 +2185,10 @@ function _t(i, e) {
|
|
|
2185
2185
|
return t;
|
|
2186
2186
|
}
|
|
2187
2187
|
function E(i, e, t) {
|
|
2188
|
-
const r =
|
|
2188
|
+
const r = Xe(i), s = Xe(e), n = t[mr], o = `${r}|${s}`, l = n?.get(o);
|
|
2189
2189
|
if (l !== void 0)
|
|
2190
2190
|
return l;
|
|
2191
|
-
const a =
|
|
2191
|
+
const a = As(
|
|
2192
2192
|
i,
|
|
2193
2193
|
e,
|
|
2194
2194
|
t,
|
|
@@ -2197,14 +2197,14 @@ function E(i, e, t) {
|
|
|
2197
2197
|
);
|
|
2198
2198
|
return n?.set(o, a), a;
|
|
2199
2199
|
}
|
|
2200
|
-
function
|
|
2200
|
+
function Xe(i) {
|
|
2201
2201
|
const e = i.getReferenceBlueId();
|
|
2202
2202
|
return e !== void 0 ? e : M.calculateBlueIdSync(
|
|
2203
2203
|
se(i)
|
|
2204
2204
|
);
|
|
2205
2205
|
}
|
|
2206
2206
|
function se(i) {
|
|
2207
|
-
if (!
|
|
2207
|
+
if (!Ir(i))
|
|
2208
2208
|
return i;
|
|
2209
2209
|
const e = i.cloneShallow();
|
|
2210
2210
|
e.getReferenceBlueId() !== void 0 && !b.hasBlueIdOnly(e) && e.setReferenceBlueId(void 0);
|
|
@@ -2232,7 +2232,7 @@ function se(i) {
|
|
|
2232
2232
|
)
|
|
2233
2233
|
), e;
|
|
2234
2234
|
}
|
|
2235
|
-
function
|
|
2235
|
+
function Ir(i) {
|
|
2236
2236
|
return i.getReferenceBlueId() !== void 0 && !b.hasBlueIdOnly(i) ? !0 : [
|
|
2237
2237
|
i.getType(),
|
|
2238
2238
|
i.getItemType(),
|
|
@@ -2242,10 +2242,10 @@ function mr(i) {
|
|
|
2242
2242
|
...i.getItems() ?? [],
|
|
2243
2243
|
...Object.values(i.getProperties() ?? {})
|
|
2244
2244
|
].some(
|
|
2245
|
-
(t) => t !== void 0 &&
|
|
2245
|
+
(t) => t !== void 0 && Ir(t)
|
|
2246
2246
|
);
|
|
2247
2247
|
}
|
|
2248
|
-
function
|
|
2248
|
+
function As(i, e, t, r, s) {
|
|
2249
2249
|
if (r === s)
|
|
2250
2250
|
return !0;
|
|
2251
2251
|
if (r && pe.includes(
|
|
@@ -2253,9 +2253,9 @@ function Rs(i, e, t, r, s) {
|
|
|
2253
2253
|
)) {
|
|
2254
2254
|
let a = e;
|
|
2255
2255
|
for (; a !== void 0; ) {
|
|
2256
|
-
if (
|
|
2256
|
+
if (Xe(a) === r)
|
|
2257
2257
|
return !0;
|
|
2258
|
-
a =
|
|
2258
|
+
a = xt(a, t);
|
|
2259
2259
|
}
|
|
2260
2260
|
return !1;
|
|
2261
2261
|
}
|
|
@@ -2267,50 +2267,50 @@ function Rs(i, e, t, r, s) {
|
|
|
2267
2267
|
}
|
|
2268
2268
|
let l = n;
|
|
2269
2269
|
for (; l !== void 0; ) {
|
|
2270
|
-
if (
|
|
2270
|
+
if (Xe(l) === s)
|
|
2271
2271
|
return !0;
|
|
2272
|
-
l =
|
|
2272
|
+
l = xt(l, t);
|
|
2273
2273
|
}
|
|
2274
2274
|
return !1;
|
|
2275
2275
|
}
|
|
2276
|
-
function
|
|
2277
|
-
return
|
|
2276
|
+
function Vs(i, e) {
|
|
2277
|
+
return Et.some((t) => {
|
|
2278
2278
|
const r = new u().setBlueId(t);
|
|
2279
2279
|
return E(i, r, e);
|
|
2280
2280
|
});
|
|
2281
2281
|
}
|
|
2282
|
-
function
|
|
2282
|
+
function Os(i, e) {
|
|
2283
2283
|
const t = new u().setBlueId(Q);
|
|
2284
2284
|
return E(i, t, e);
|
|
2285
2285
|
}
|
|
2286
|
-
function
|
|
2286
|
+
function Ms(i, e) {
|
|
2287
2287
|
const t = new u().setBlueId(te);
|
|
2288
2288
|
return E(i, t, e);
|
|
2289
2289
|
}
|
|
2290
|
-
function
|
|
2290
|
+
function Ds(i, e) {
|
|
2291
2291
|
const t = new u().setBlueId(ee);
|
|
2292
2292
|
return E(i, t, e);
|
|
2293
2293
|
}
|
|
2294
|
-
function
|
|
2294
|
+
function Ls(i, e) {
|
|
2295
2295
|
const t = new u().setBlueId(re);
|
|
2296
2296
|
return E(i, t, e);
|
|
2297
2297
|
}
|
|
2298
|
-
function
|
|
2299
|
-
const t = new u().setBlueId(
|
|
2298
|
+
function Ke(i, e) {
|
|
2299
|
+
const t = new u().setBlueId(et);
|
|
2300
2300
|
return E(i, t, e);
|
|
2301
2301
|
}
|
|
2302
|
-
function
|
|
2303
|
-
const t = new u().setBlueId(
|
|
2302
|
+
function He(i, e) {
|
|
2303
|
+
const t = new u().setBlueId(bt);
|
|
2304
2304
|
return E(i, t, e);
|
|
2305
2305
|
}
|
|
2306
|
-
function
|
|
2307
|
-
return
|
|
2306
|
+
function $s(i, e) {
|
|
2307
|
+
return Qe.some((t) => {
|
|
2308
2308
|
const r = new u().setName(t);
|
|
2309
2309
|
return E(i, r, e);
|
|
2310
2310
|
});
|
|
2311
2311
|
}
|
|
2312
|
-
function
|
|
2313
|
-
for (const t of
|
|
2312
|
+
function xs(i, e) {
|
|
2313
|
+
for (const t of Qe) {
|
|
2314
2314
|
const r = new u().setName(t);
|
|
2315
2315
|
if (E(i, r, e))
|
|
2316
2316
|
return t;
|
|
@@ -2330,7 +2330,7 @@ class _s {
|
|
|
2330
2330
|
this.registerSchema(t);
|
|
2331
2331
|
}
|
|
2332
2332
|
registerSchema(e) {
|
|
2333
|
-
const t =
|
|
2333
|
+
const t = Me.resolveBlueId(e);
|
|
2334
2334
|
if (d(t)) {
|
|
2335
2335
|
if (this.blueIdMap.has(t))
|
|
2336
2336
|
throw new Error(`Duplicate BlueId value: ${t}`);
|
|
@@ -2364,7 +2364,7 @@ class _s {
|
|
|
2364
2364
|
getBlueIdForSchema(e) {
|
|
2365
2365
|
if (I(e))
|
|
2366
2366
|
return null;
|
|
2367
|
-
const t =
|
|
2367
|
+
const t = Me.resolveBlueId(e);
|
|
2368
2368
|
if (d(t))
|
|
2369
2369
|
return t;
|
|
2370
2370
|
for (const [r, s] of this.blueIdMap)
|
|
@@ -2380,11 +2380,11 @@ class _s {
|
|
|
2380
2380
|
return new Map(this.blueIdMap);
|
|
2381
2381
|
}
|
|
2382
2382
|
}
|
|
2383
|
-
class
|
|
2383
|
+
class At {
|
|
2384
2384
|
}
|
|
2385
2385
|
class Ce {
|
|
2386
2386
|
static convert(e) {
|
|
2387
|
-
const t = new
|
|
2387
|
+
const t = new It();
|
|
2388
2388
|
return Ce.traverseNode(e, "", t), t.build();
|
|
2389
2389
|
}
|
|
2390
2390
|
static traverseNode(e, t, r) {
|
|
@@ -2407,11 +2407,11 @@ class Ce {
|
|
|
2407
2407
|
}
|
|
2408
2408
|
}
|
|
2409
2409
|
}
|
|
2410
|
-
function
|
|
2410
|
+
function _t(i, e) {
|
|
2411
2411
|
const t = i.split(e), r = [...t].reverse().findIndex((n) => n !== ""), s = r === -1 ? 0 : t.length - r;
|
|
2412
2412
|
return t.slice(0, s);
|
|
2413
2413
|
}
|
|
2414
|
-
class
|
|
2414
|
+
class st extends At {
|
|
2415
2415
|
allowedPaths;
|
|
2416
2416
|
maxDepth;
|
|
2417
2417
|
currentPath = [];
|
|
@@ -2462,7 +2462,7 @@ class rt extends Rt {
|
|
|
2462
2462
|
* @returns True if the path matches the allowed path pattern, false otherwise
|
|
2463
2463
|
*/
|
|
2464
2464
|
matchesAllowedPath(e, t) {
|
|
2465
|
-
const r =
|
|
2465
|
+
const r = _t(e, "/"), s = _t(t, "/");
|
|
2466
2466
|
if (s.length > r.length)
|
|
2467
2467
|
return !1;
|
|
2468
2468
|
for (let n = 1; n < s.length; n++)
|
|
@@ -2504,7 +2504,7 @@ class rt extends Rt {
|
|
|
2504
2504
|
* @returns The path limits
|
|
2505
2505
|
*/
|
|
2506
2506
|
static withMaxDepth(e) {
|
|
2507
|
-
const t = new
|
|
2507
|
+
const t = new It().setMaxDepth(e);
|
|
2508
2508
|
for (let r = 1; r <= e; r++) {
|
|
2509
2509
|
const s = "/" + Array(r).fill("*").join("/");
|
|
2510
2510
|
t.addPath(s);
|
|
@@ -2517,7 +2517,7 @@ class rt extends Rt {
|
|
|
2517
2517
|
* @returns The path limits
|
|
2518
2518
|
*/
|
|
2519
2519
|
static withSinglePath(e) {
|
|
2520
|
-
return new
|
|
2520
|
+
return new It().addPath(e).build();
|
|
2521
2521
|
}
|
|
2522
2522
|
/**
|
|
2523
2523
|
* Creates path limits by analyzing the structure of a node.
|
|
@@ -2527,7 +2527,7 @@ class rt extends Rt {
|
|
|
2527
2527
|
return Ce.convert(e);
|
|
2528
2528
|
}
|
|
2529
2529
|
}
|
|
2530
|
-
class
|
|
2530
|
+
class It {
|
|
2531
2531
|
allowedPaths = /* @__PURE__ */ new Set();
|
|
2532
2532
|
maxDepth = Number.MAX_SAFE_INTEGER;
|
|
2533
2533
|
/**
|
|
@@ -2551,10 +2551,10 @@ class mt {
|
|
|
2551
2551
|
* @returns The built PathLimits
|
|
2552
2552
|
*/
|
|
2553
2553
|
build() {
|
|
2554
|
-
return new
|
|
2554
|
+
return new st(this.allowedPaths, this.maxDepth);
|
|
2555
2555
|
}
|
|
2556
2556
|
}
|
|
2557
|
-
class k extends
|
|
2557
|
+
class k extends At {
|
|
2558
2558
|
/**
|
|
2559
2559
|
* Determines if a path segment should be extended - always returns true
|
|
2560
2560
|
* @returns Always true
|
|
@@ -2580,7 +2580,7 @@ class k extends Rt {
|
|
|
2580
2580
|
exitPathSegment() {
|
|
2581
2581
|
}
|
|
2582
2582
|
}
|
|
2583
|
-
class
|
|
2583
|
+
class it extends At {
|
|
2584
2584
|
limits;
|
|
2585
2585
|
/**
|
|
2586
2586
|
* Creates a composite limits with the specified limit strategies
|
|
@@ -2637,7 +2637,7 @@ class st extends Rt {
|
|
|
2637
2637
|
* @returns A new CompositeLimits instance
|
|
2638
2638
|
*/
|
|
2639
2639
|
static of(...e) {
|
|
2640
|
-
return new
|
|
2640
|
+
return new it(e);
|
|
2641
2641
|
}
|
|
2642
2642
|
}
|
|
2643
2643
|
const F = new k();
|
|
@@ -2674,7 +2674,7 @@ class J extends u {
|
|
|
2674
2674
|
"Cannot minimize a path-limited resolved node without a source semantic BlueId."
|
|
2675
2675
|
);
|
|
2676
2676
|
}
|
|
2677
|
-
return new
|
|
2677
|
+
return new yt().minimizeResolved(this);
|
|
2678
2678
|
}
|
|
2679
2679
|
/**
|
|
2680
2680
|
* @deprecated Prefer `blue.calculateBlueIdSync(resolved)` so callers use the
|
|
@@ -2688,7 +2688,7 @@ class J extends u {
|
|
|
2688
2688
|
"Cannot calculate minimal BlueId for a path-limited resolved node without a source semantic BlueId."
|
|
2689
2689
|
);
|
|
2690
2690
|
}
|
|
2691
|
-
const t = new
|
|
2691
|
+
const t = new yt().minimizeResolvedForHash(this);
|
|
2692
2692
|
return M.calculateBlueIdSync(t);
|
|
2693
2693
|
}
|
|
2694
2694
|
/**
|
|
@@ -2740,13 +2740,13 @@ class J extends u {
|
|
|
2740
2740
|
t !== void 0 && this.setValue(t);
|
|
2741
2741
|
}
|
|
2742
2742
|
}
|
|
2743
|
-
class
|
|
2743
|
+
class Fs {
|
|
2744
2744
|
blue;
|
|
2745
2745
|
constructor(e) {
|
|
2746
2746
|
this.blue = e;
|
|
2747
2747
|
}
|
|
2748
2748
|
matchesType(e, t, r = F) {
|
|
2749
|
-
const s =
|
|
2749
|
+
const s = st.fromNode(t), n = it.of(r, s);
|
|
2750
2750
|
let o, l;
|
|
2751
2751
|
try {
|
|
2752
2752
|
o = this.extendAndResolve(e, n), l = this.blue.resolve(t, n);
|
|
@@ -2890,16 +2890,16 @@ class xs {
|
|
|
2890
2890
|
const D = t.getProperties(), R = r.getProperties();
|
|
2891
2891
|
if (D !== void 0) {
|
|
2892
2892
|
const P = e.getProperties() ?? {};
|
|
2893
|
-
for (const [w,
|
|
2893
|
+
for (const [w, nt] of Object.entries(D))
|
|
2894
2894
|
if (w in P) {
|
|
2895
2895
|
if (!this.recursiveValueComparison(
|
|
2896
2896
|
P[w],
|
|
2897
|
-
|
|
2898
|
-
R?.[w] ??
|
|
2897
|
+
nt,
|
|
2898
|
+
R?.[w] ?? nt,
|
|
2899
2899
|
s
|
|
2900
2900
|
))
|
|
2901
2901
|
return !1;
|
|
2902
|
-
} else if (this.hasValueInNestedStructure(
|
|
2902
|
+
} else if (this.hasValueInNestedStructure(nt))
|
|
2903
2903
|
return !1;
|
|
2904
2904
|
}
|
|
2905
2905
|
const L = t.getValueType(), _e = r.getValueType();
|
|
@@ -3002,13 +3002,13 @@ class xs {
|
|
|
3002
3002
|
* shape of the requested core list or dictionary type.
|
|
3003
3003
|
*/
|
|
3004
3004
|
matchesImplicitStructure(e, t) {
|
|
3005
|
-
return t === void 0 || e.getType() !== void 0 ? !1 :
|
|
3005
|
+
return t === void 0 || e.getType() !== void 0 ? !1 : Ke(t, this.blue.getNodeProvider()) ? this.isImplicitListStructure(e) : He(t, this.blue.getNodeProvider()) ? this.isImplicitDictionaryStructure(e) : !1;
|
|
3006
3006
|
}
|
|
3007
3007
|
matchesImplicitCoreCollectionType(e, t) {
|
|
3008
|
-
return e.getType() !== void 0 ? !1 :
|
|
3008
|
+
return e.getType() !== void 0 ? !1 : Ke(t, this.blue.getNodeProvider()) ? this.isImplicitListStructure(e) : He(t, this.blue.getNodeProvider()) ? this.isImplicitDictionaryStructure(e) : !1;
|
|
3009
3009
|
}
|
|
3010
3010
|
isCoreCollectionType(e) {
|
|
3011
|
-
return
|
|
3011
|
+
return Ke(e, this.blue.getNodeProvider()) || He(e, this.blue.getNodeProvider());
|
|
3012
3012
|
}
|
|
3013
3013
|
isImplicitListStructure(e) {
|
|
3014
3014
|
return e.getItems() !== void 0 && e.getValue() === void 0;
|
|
@@ -3254,14 +3254,14 @@ class fe {
|
|
|
3254
3254
|
return t && t.length > 0 ? t[0] : null;
|
|
3255
3255
|
}
|
|
3256
3256
|
}
|
|
3257
|
-
function
|
|
3257
|
+
function Vt(i) {
|
|
3258
3258
|
return new class extends fe {
|
|
3259
3259
|
fetchByBlueId(e) {
|
|
3260
3260
|
return i(e);
|
|
3261
3261
|
}
|
|
3262
3262
|
}();
|
|
3263
3263
|
}
|
|
3264
|
-
class
|
|
3264
|
+
class js {
|
|
3265
3265
|
/**
|
|
3266
3266
|
* Resolves a node without limits
|
|
3267
3267
|
* Default implementation that uses NO_LIMITS
|
|
@@ -3273,7 +3273,7 @@ class Fs {
|
|
|
3273
3273
|
return this.resolve(e, F);
|
|
3274
3274
|
}
|
|
3275
3275
|
}
|
|
3276
|
-
class
|
|
3276
|
+
class vr extends fe {
|
|
3277
3277
|
nodeProviders;
|
|
3278
3278
|
constructor(e) {
|
|
3279
3279
|
super(), this.nodeProviders = e;
|
|
@@ -3300,31 +3300,31 @@ class Ir extends fe {
|
|
|
3300
3300
|
return this.nodeProviders;
|
|
3301
3301
|
}
|
|
3302
3302
|
}
|
|
3303
|
-
const
|
|
3304
|
-
...
|
|
3303
|
+
const ut = he.types.float.options, Us = {
|
|
3304
|
+
...ut,
|
|
3305
3305
|
construct: (i) => {
|
|
3306
3306
|
const e = i.replace(/_/g, "").toLowerCase();
|
|
3307
|
-
if (!
|
|
3308
|
-
return new
|
|
3309
|
-
if (
|
|
3310
|
-
return
|
|
3307
|
+
if (!Yt(e))
|
|
3308
|
+
return new x(e);
|
|
3309
|
+
if (ut.construct)
|
|
3310
|
+
return ut.construct(i);
|
|
3311
3311
|
}
|
|
3312
|
-
},
|
|
3313
|
-
...
|
|
3312
|
+
}, zs = new he.Type("tag:yaml.org,2002:float", Us), dt = he.types.int.options, Ks = {
|
|
3313
|
+
...dt,
|
|
3314
3314
|
construct: (i) => {
|
|
3315
3315
|
let e = i;
|
|
3316
|
-
if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), !
|
|
3316
|
+
if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), !Yt(e))
|
|
3317
3317
|
return new A(e);
|
|
3318
|
-
if (
|
|
3319
|
-
return
|
|
3318
|
+
if (dt.construct)
|
|
3319
|
+
return dt.construct(i);
|
|
3320
3320
|
}
|
|
3321
|
-
},
|
|
3322
|
-
implicit: [
|
|
3321
|
+
}, Hs = new he.Type("tag:yaml.org,2002:int", Ks), Tr = he.CORE_SCHEMA.extend({
|
|
3322
|
+
implicit: [zs, Hs]
|
|
3323
3323
|
}), ae = (i) => {
|
|
3324
|
-
const e = he.load(i, { schema:
|
|
3324
|
+
const e = he.load(i, { schema: Tr });
|
|
3325
3325
|
return e === void 0 ? void 0 : e;
|
|
3326
|
-
},
|
|
3327
|
-
schema:
|
|
3326
|
+
}, ks = (i) => he.dump(i, {
|
|
3327
|
+
schema: Tr,
|
|
3328
3328
|
replacer: (e, t) => {
|
|
3329
3329
|
if (C(t)) {
|
|
3330
3330
|
if (oe(t)) {
|
|
@@ -3336,7 +3336,7 @@ const ct = he.types.float.options, js = {
|
|
|
3336
3336
|
}
|
|
3337
3337
|
return t;
|
|
3338
3338
|
}
|
|
3339
|
-
}),
|
|
3339
|
+
}), Br = `- type:
|
|
3340
3340
|
blueId: 27B7fuxQCS1VAptiCPc2RMkKoutP5qxkh3uDxZ7dr6Eo
|
|
3341
3341
|
mappings:
|
|
3342
3342
|
Text: DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K
|
|
@@ -3347,20 +3347,20 @@ const ct = he.types.float.options, js = {
|
|
|
3347
3347
|
Dictionary: G7fBT9PSod1RfHLHkpafAGBDVAJMrMhAMY51ERcyXNrj
|
|
3348
3348
|
- type:
|
|
3349
3349
|
blueId: FGYuTXwaoSKfZmpTysLTLsb8WzSqf43384rKZDkXhxD4
|
|
3350
|
-
`,
|
|
3351
|
-
description: TODO`,
|
|
3350
|
+
`, Ys = `name: Transformation
|
|
3351
|
+
description: TODO`, Ws = `name: Infer Basic Types For Untyped Values
|
|
3352
3352
|
type:
|
|
3353
3353
|
blueId: Ct1SGRGw1i47qjzm1ruiUdSZofeV6WevPTGuieVvbRS4
|
|
3354
|
-
description: This transformation infers type details for Text, Integer, Number and Boolean.`,
|
|
3354
|
+
description: This transformation infers type details for Text, Integer, Number and Boolean.`, Gs = `name: Replace Inline Types with BlueIds
|
|
3355
3355
|
type:
|
|
3356
3356
|
blueId: Ct1SGRGw1i47qjzm1ruiUdSZofeV6WevPTGuieVvbRS4
|
|
3357
|
-
description: This transformation replaces`,
|
|
3358
|
-
|
|
3359
|
-
ks,
|
|
3357
|
+
description: This transformation replaces`, Js = [
|
|
3358
|
+
Br,
|
|
3360
3359
|
Ys,
|
|
3361
|
-
Ws
|
|
3360
|
+
Ws,
|
|
3361
|
+
Gs
|
|
3362
3362
|
];
|
|
3363
|
-
class
|
|
3363
|
+
class Zs extends fe {
|
|
3364
3364
|
blueIdToNodesMap = /* @__PURE__ */ new Map();
|
|
3365
3365
|
constructor() {
|
|
3366
3366
|
super(), this.load();
|
|
@@ -3369,7 +3369,7 @@ class Js extends fe {
|
|
|
3369
3369
|
return this.blueIdToNodesMap.get(e) || [];
|
|
3370
3370
|
}
|
|
3371
3371
|
load() {
|
|
3372
|
-
for (const e of
|
|
3372
|
+
for (const e of Js) {
|
|
3373
3373
|
const t = ae(e);
|
|
3374
3374
|
if (t === void 0) {
|
|
3375
3375
|
console.error(`This content file is not valid YAML: ${e}`);
|
|
@@ -3387,28 +3387,28 @@ class Js extends fe {
|
|
|
3387
3387
|
}
|
|
3388
3388
|
}
|
|
3389
3389
|
}
|
|
3390
|
-
class
|
|
3391
|
-
static INSTANCE = new
|
|
3390
|
+
class Ot extends fe {
|
|
3391
|
+
static INSTANCE = new Ot();
|
|
3392
3392
|
nodeProvider;
|
|
3393
3393
|
constructor() {
|
|
3394
|
-
super(), this.nodeProvider = new
|
|
3394
|
+
super(), this.nodeProvider = new Zs();
|
|
3395
3395
|
}
|
|
3396
3396
|
fetchByBlueId(e) {
|
|
3397
3397
|
return this.nodeProvider.fetchByBlueId(e);
|
|
3398
3398
|
}
|
|
3399
3399
|
}
|
|
3400
|
-
class
|
|
3400
|
+
class De {
|
|
3401
3401
|
/**
|
|
3402
3402
|
* Wraps a NodeProvider with a SequentialNodeProvider that includes bootstrap providers
|
|
3403
3403
|
* @param originalProvider - The original NodeProvider to wrap
|
|
3404
3404
|
* @returns A wrapped NodeProvider that includes bootstrap providers
|
|
3405
3405
|
*/
|
|
3406
3406
|
static wrap(e) {
|
|
3407
|
-
const t = [
|
|
3408
|
-
return t.push(e), new
|
|
3407
|
+
const t = [Ot.INSTANCE];
|
|
3408
|
+
return t.push(e), new vr(t);
|
|
3409
3409
|
}
|
|
3410
3410
|
}
|
|
3411
|
-
class
|
|
3411
|
+
class Mt {
|
|
3412
3412
|
nodeProvider;
|
|
3413
3413
|
strategy;
|
|
3414
3414
|
/**
|
|
@@ -3417,7 +3417,7 @@ class Ot {
|
|
|
3417
3417
|
* @param strategy - The strategy to use for missing elements (defaults to THROW_EXCEPTION)
|
|
3418
3418
|
*/
|
|
3419
3419
|
constructor(e, t) {
|
|
3420
|
-
this.nodeProvider =
|
|
3420
|
+
this.nodeProvider = De.wrap(e), this.strategy = t || "THROW_EXCEPTION";
|
|
3421
3421
|
}
|
|
3422
3422
|
/**
|
|
3423
3423
|
* Extends a node with its resolved references
|
|
@@ -3506,7 +3506,7 @@ class Ot {
|
|
|
3506
3506
|
), e.setBlue(t.getBlue()?.clone());
|
|
3507
3507
|
}
|
|
3508
3508
|
}
|
|
3509
|
-
class de extends
|
|
3509
|
+
class de extends js {
|
|
3510
3510
|
mergingProcessor;
|
|
3511
3511
|
nodeProvider;
|
|
3512
3512
|
/**
|
|
@@ -3515,7 +3515,7 @@ class de extends Fs {
|
|
|
3515
3515
|
* @param nodeProvider - The provider to use for resolving nodes
|
|
3516
3516
|
*/
|
|
3517
3517
|
constructor(e, t) {
|
|
3518
|
-
super(), this.mergingProcessor = e, this.nodeProvider =
|
|
3518
|
+
super(), this.mergingProcessor = e, this.nodeProvider = De.wrap(t);
|
|
3519
3519
|
}
|
|
3520
3520
|
/**
|
|
3521
3521
|
* Merges a source node into a target node with the given limits
|
|
@@ -3783,7 +3783,7 @@ class de extends Fs {
|
|
|
3783
3783
|
});
|
|
3784
3784
|
}
|
|
3785
3785
|
createResolutionContext(e) {
|
|
3786
|
-
const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), s =
|
|
3786
|
+
const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), s = Rs(
|
|
3787
3787
|
this.createResolutionNodeProvider(this.nodeProvider, t),
|
|
3788
3788
|
r
|
|
3789
3789
|
);
|
|
@@ -3831,9 +3831,9 @@ class de extends Fs {
|
|
|
3831
3831
|
}
|
|
3832
3832
|
resolveAndExtendTypeNode(e, t) {
|
|
3833
3833
|
const r = e.clone();
|
|
3834
|
-
return d(r.getBlueId()) && new
|
|
3834
|
+
return d(r.getBlueId()) && new Mt(t.nodeProvider).extend(
|
|
3835
3835
|
r,
|
|
3836
|
-
|
|
3836
|
+
st.withSinglePath("/")
|
|
3837
3837
|
), this.resolveWithContext(r, t);
|
|
3838
3838
|
}
|
|
3839
3839
|
getTypeOverlay(e, t, r) {
|
|
@@ -3908,7 +3908,7 @@ class de extends Fs {
|
|
|
3908
3908
|
e.pathStack.pop(), e.limits.exitPathSegment();
|
|
3909
3909
|
}
|
|
3910
3910
|
}
|
|
3911
|
-
class
|
|
3911
|
+
class Pr {
|
|
3912
3912
|
mergingProcessors;
|
|
3913
3913
|
/**
|
|
3914
3914
|
* Creates a new SequentialMergingProcessor with the given processors
|
|
@@ -3933,14 +3933,14 @@ class Br {
|
|
|
3933
3933
|
return this.mergingProcessors.reduce((s, n) => n.postProcess ? n.postProcess(s, t, r) : s, e);
|
|
3934
3934
|
}
|
|
3935
3935
|
}
|
|
3936
|
-
class
|
|
3936
|
+
class wr {
|
|
3937
3937
|
process(e, t) {
|
|
3938
3938
|
const r = t.getValue();
|
|
3939
3939
|
if (d(r)) {
|
|
3940
3940
|
const s = e.getValue();
|
|
3941
3941
|
if (I(s))
|
|
3942
3942
|
return e.cloneShallow().setValue(r);
|
|
3943
|
-
if (!
|
|
3943
|
+
if (!Xs(r, s))
|
|
3944
3944
|
throw new Error(
|
|
3945
3945
|
`Node values conflict. Source node value: ${r}, target node value: ${s}`
|
|
3946
3946
|
);
|
|
@@ -3948,8 +3948,8 @@ class Pr {
|
|
|
3948
3948
|
return e;
|
|
3949
3949
|
}
|
|
3950
3950
|
}
|
|
3951
|
-
const
|
|
3952
|
-
class
|
|
3951
|
+
const Xs = (i, e) => oe(i) && oe(e) || ht(i) && ht(e) ? i.eq(e) : i === e;
|
|
3952
|
+
class Sr {
|
|
3953
3953
|
process(e, t, r) {
|
|
3954
3954
|
const s = e.getType(), n = t.getType();
|
|
3955
3955
|
let o = e;
|
|
@@ -3975,10 +3975,10 @@ class wr {
|
|
|
3975
3975
|
return o;
|
|
3976
3976
|
}
|
|
3977
3977
|
}
|
|
3978
|
-
class
|
|
3978
|
+
class br {
|
|
3979
3979
|
process(e, t, r) {
|
|
3980
3980
|
const s = t.getItemType(), n = t.getType();
|
|
3981
|
-
if (s !== void 0 && n !== void 0 && !
|
|
3981
|
+
if (s !== void 0 && n !== void 0 && !Ke(n, r))
|
|
3982
3982
|
throw new Error("Source node with itemType must have a List type");
|
|
3983
3983
|
const o = e.getItemType();
|
|
3984
3984
|
let l = e;
|
|
@@ -4025,10 +4025,10 @@ class Sr {
|
|
|
4025
4025
|
return l;
|
|
4026
4026
|
}
|
|
4027
4027
|
}
|
|
4028
|
-
class
|
|
4028
|
+
class Er {
|
|
4029
4029
|
process(e, t, r) {
|
|
4030
4030
|
const s = t.getKeyType(), n = t.getValueType(), o = t.getType();
|
|
4031
|
-
if ((s !== void 0 || n !== void 0) && o !== void 0 && !
|
|
4031
|
+
if ((s !== void 0 || n !== void 0) && o !== void 0 && !He(o, r))
|
|
4032
4032
|
throw new Error(
|
|
4033
4033
|
"Source node with keyType or valueType must have a Dictionary type"
|
|
4034
4034
|
);
|
|
@@ -4088,20 +4088,20 @@ class br {
|
|
|
4088
4088
|
return e;
|
|
4089
4089
|
}
|
|
4090
4090
|
validateBasicKeyType(e, t) {
|
|
4091
|
-
if (!
|
|
4091
|
+
if (!Vs(e, t))
|
|
4092
4092
|
throw new Error("Dictionary key type must be a basic type");
|
|
4093
4093
|
}
|
|
4094
4094
|
validateKeyType(e, t, r) {
|
|
4095
|
-
if (!
|
|
4096
|
-
if (
|
|
4095
|
+
if (!Os(t, r))
|
|
4096
|
+
if (Ms(t, r)) {
|
|
4097
4097
|
const s = Number.parseInt(e, 10);
|
|
4098
4098
|
if (Number.isNaN(s) || s.toString() !== e)
|
|
4099
4099
|
throw new Error(`Key '${e}' is not a valid Integer.`);
|
|
4100
|
-
} else if (
|
|
4100
|
+
} else if (Ds(t, r)) {
|
|
4101
4101
|
const s = Number.parseFloat(e);
|
|
4102
4102
|
if (Number.isNaN(s))
|
|
4103
4103
|
throw new Error(`Key '${e}' is not a valid Number.`);
|
|
4104
|
-
} else if (
|
|
4104
|
+
} else if (Ls(t, r)) {
|
|
4105
4105
|
if (e.toLowerCase() !== "true" && e.toLowerCase() !== "false")
|
|
4106
4106
|
throw new Error(`Key '${e}' is not a valid Boolean.`);
|
|
4107
4107
|
} else
|
|
@@ -4123,16 +4123,16 @@ class br {
|
|
|
4123
4123
|
}
|
|
4124
4124
|
}
|
|
4125
4125
|
}
|
|
4126
|
-
class
|
|
4126
|
+
class Nr {
|
|
4127
4127
|
process(e) {
|
|
4128
4128
|
return e;
|
|
4129
4129
|
}
|
|
4130
4130
|
postProcess(e, t, r) {
|
|
4131
4131
|
const s = e.getType();
|
|
4132
|
-
if (s !== void 0 &&
|
|
4132
|
+
if (s !== void 0 && $s(s, r)) {
|
|
4133
4133
|
const n = e.getItems(), o = e.getProperties();
|
|
4134
4134
|
if (n !== void 0 && n.length > 0 || o !== void 0 && Object.keys(o).length > 0) {
|
|
4135
|
-
const l =
|
|
4135
|
+
const l = xs(
|
|
4136
4136
|
s,
|
|
4137
4137
|
r
|
|
4138
4138
|
), a = s.getName() || "unknown";
|
|
@@ -4144,7 +4144,7 @@ class Er {
|
|
|
4144
4144
|
return e;
|
|
4145
4145
|
}
|
|
4146
4146
|
}
|
|
4147
|
-
class
|
|
4147
|
+
class Cr {
|
|
4148
4148
|
process(e, t) {
|
|
4149
4149
|
let r = e;
|
|
4150
4150
|
const s = t.getName();
|
|
@@ -4155,31 +4155,31 @@ class Nr {
|
|
|
4155
4155
|
}
|
|
4156
4156
|
const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4157
4157
|
__proto__: null,
|
|
4158
|
-
BasicTypesVerifier:
|
|
4159
|
-
DictionaryProcessor:
|
|
4160
|
-
ListProcessor:
|
|
4161
|
-
MetadataPropagator:
|
|
4162
|
-
SequentialMergingProcessor:
|
|
4163
|
-
TypeAssigner:
|
|
4164
|
-
ValuePropagator:
|
|
4158
|
+
BasicTypesVerifier: Nr,
|
|
4159
|
+
DictionaryProcessor: Er,
|
|
4160
|
+
ListProcessor: br,
|
|
4161
|
+
MetadataPropagator: Cr,
|
|
4162
|
+
SequentialMergingProcessor: Pr,
|
|
4163
|
+
TypeAssigner: Sr,
|
|
4164
|
+
ValuePropagator: wr
|
|
4165
4165
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4166
|
-
function
|
|
4167
|
-
return new
|
|
4168
|
-
new Pr(),
|
|
4166
|
+
function Dt() {
|
|
4167
|
+
return new Pr([
|
|
4169
4168
|
new wr(),
|
|
4170
4169
|
new Sr(),
|
|
4171
4170
|
new br(),
|
|
4172
|
-
new
|
|
4173
|
-
new
|
|
4171
|
+
new Er(),
|
|
4172
|
+
new Cr(),
|
|
4173
|
+
new Nr()
|
|
4174
4174
|
]);
|
|
4175
4175
|
}
|
|
4176
|
-
class
|
|
4176
|
+
class ke {
|
|
4177
4177
|
nodeProvider;
|
|
4178
4178
|
mergingProcessor;
|
|
4179
|
-
minimizer = new
|
|
4179
|
+
minimizer = new yt();
|
|
4180
4180
|
cyclicSetIdentity;
|
|
4181
4181
|
constructor(e = {}) {
|
|
4182
|
-
this.nodeProvider = e.nodeProvider ??
|
|
4182
|
+
this.nodeProvider = e.nodeProvider ?? Vt(() => []), this.mergingProcessor = e.mergingProcessor ?? Dt(), this.cyclicSetIdentity = this.createCyclicSetIdentityService();
|
|
4183
4183
|
}
|
|
4184
4184
|
/** @internal */
|
|
4185
4185
|
createCyclicSetIdentityService() {
|
|
@@ -4310,12 +4310,12 @@ class He {
|
|
|
4310
4310
|
return this.minimizeAuthoring(t).getItems() ?? [];
|
|
4311
4311
|
}
|
|
4312
4312
|
}
|
|
4313
|
-
class
|
|
4313
|
+
class qs {
|
|
4314
4314
|
semanticIdentity;
|
|
4315
4315
|
cyclicSetIdentity;
|
|
4316
4316
|
constructor(e = {}) {
|
|
4317
|
-
const t = e.nodeProvider ??
|
|
4318
|
-
this.semanticIdentity = new
|
|
4317
|
+
const t = e.nodeProvider ?? Vt(() => []), r = e.mergingProcessor ?? Dt();
|
|
4318
|
+
this.semanticIdentity = new ke({
|
|
4319
4319
|
nodeProvider: t,
|
|
4320
4320
|
mergingProcessor: r
|
|
4321
4321
|
}), this.cyclicSetIdentity = this.semanticIdentity.createCyclicSetIdentityService();
|
|
@@ -4381,12 +4381,12 @@ class Xs {
|
|
|
4381
4381
|
);
|
|
4382
4382
|
}
|
|
4383
4383
|
}
|
|
4384
|
-
const
|
|
4385
|
-
class
|
|
4384
|
+
const Qs = (i) => i instanceof Wt || i instanceof Gt || i instanceof Jt || i instanceof Zt || i instanceof We || i instanceof Ge, ei = (i) => i instanceof ye || i instanceof ge || i instanceof Ue || i instanceof ze;
|
|
4385
|
+
class Rr {
|
|
4386
4386
|
static convertValue(e, t) {
|
|
4387
4387
|
const r = e.getType()?.getBlueId(), s = e.getValue();
|
|
4388
|
-
return I(s) ?
|
|
4389
|
-
new
|
|
4388
|
+
return I(s) ? ei(t) && b.isValidValueNode(e) ? this.getDefaultPrimitiveValue(t) : s : Q === r ? this.convertFromString(String(s), t) : ee === r || s instanceof x ? this.convertFromBigDecimal(
|
|
4389
|
+
new x(s?.toString()),
|
|
4390
4390
|
t
|
|
4391
4391
|
) : te === r || s instanceof A ? this.convertFromBigInteger(
|
|
4392
4392
|
new A(s?.toString()),
|
|
@@ -4394,13 +4394,13 @@ class Cr {
|
|
|
4394
4394
|
) : re === r || typeof s == "boolean" ? this.convertFromBoolean(!!s, t) : this.convertFromString(String(s), t);
|
|
4395
4395
|
}
|
|
4396
4396
|
static convertFromString(e, t) {
|
|
4397
|
-
if (!t || t instanceof ye || t instanceof
|
|
4397
|
+
if (!t || t instanceof ye || t instanceof Mr || t instanceof Dr)
|
|
4398
4398
|
return e;
|
|
4399
4399
|
if (t instanceof ge)
|
|
4400
4400
|
return Number(e);
|
|
4401
|
-
if (t instanceof je)
|
|
4402
|
-
return e.toLowerCase() === "true";
|
|
4403
4401
|
if (t instanceof Ue)
|
|
4402
|
+
return e.toLowerCase() === "true";
|
|
4403
|
+
if (t instanceof ze)
|
|
4404
4404
|
return BigInt(e);
|
|
4405
4405
|
throw new Error(`Cannot convert String to ${t._def.typeName}`);
|
|
4406
4406
|
}
|
|
@@ -4414,20 +4414,20 @@ class Cr {
|
|
|
4414
4414
|
static convertFromBigInteger(e, t) {
|
|
4415
4415
|
if (t instanceof ge)
|
|
4416
4416
|
return e.toNumber();
|
|
4417
|
-
if (t instanceof
|
|
4417
|
+
if (t instanceof ze)
|
|
4418
4418
|
return BigInt(e.toString());
|
|
4419
4419
|
if (t instanceof ye)
|
|
4420
4420
|
return e.toString();
|
|
4421
4421
|
throw new Error(`Cannot convert Number to ${t._def.typeName}`);
|
|
4422
4422
|
}
|
|
4423
4423
|
static convertFromBoolean(e, t) {
|
|
4424
|
-
if (!t || t instanceof
|
|
4424
|
+
if (!t || t instanceof Ue)
|
|
4425
4425
|
return e;
|
|
4426
4426
|
if (t instanceof ye)
|
|
4427
4427
|
return e.toString();
|
|
4428
4428
|
if (t instanceof ge)
|
|
4429
4429
|
return Number(e);
|
|
4430
|
-
if (t instanceof
|
|
4430
|
+
if (t instanceof ze)
|
|
4431
4431
|
return BigInt(e);
|
|
4432
4432
|
throw new Error(`Cannot convert Boolean to ${t._def.typeName}`);
|
|
4433
4433
|
}
|
|
@@ -4435,7 +4435,7 @@ class Cr {
|
|
|
4435
4435
|
if (!e) return null;
|
|
4436
4436
|
if (e instanceof ge)
|
|
4437
4437
|
return 0;
|
|
4438
|
-
if (e instanceof
|
|
4438
|
+
if (e instanceof Ue)
|
|
4439
4439
|
return !1;
|
|
4440
4440
|
if (e instanceof ye)
|
|
4441
4441
|
return "";
|
|
@@ -4444,12 +4444,12 @@ class Cr {
|
|
|
4444
4444
|
);
|
|
4445
4445
|
}
|
|
4446
4446
|
}
|
|
4447
|
-
class
|
|
4447
|
+
class ti {
|
|
4448
4448
|
convert(e, t) {
|
|
4449
|
-
return
|
|
4449
|
+
return Rr.convertValue(e, t);
|
|
4450
4450
|
}
|
|
4451
4451
|
}
|
|
4452
|
-
class
|
|
4452
|
+
class ri {
|
|
4453
4453
|
constructor(e, t) {
|
|
4454
4454
|
this.nodeToObjectConverter = e, this.calculateBlueId = t;
|
|
4455
4455
|
}
|
|
@@ -4457,26 +4457,26 @@ class ti {
|
|
|
4457
4457
|
return this.convertFields(e, t);
|
|
4458
4458
|
}
|
|
4459
4459
|
convertFields(e, t) {
|
|
4460
|
-
if (t instanceof
|
|
4460
|
+
if (t instanceof Lr) {
|
|
4461
4461
|
const r = t._def.left, s = t._def.right, n = this.convert(e, r), o = this.convert(e, s);
|
|
4462
4462
|
return { ...n, ...o };
|
|
4463
4463
|
}
|
|
4464
|
-
if (t instanceof Lr)
|
|
4465
|
-
throw new Error("Union not supported");
|
|
4466
4464
|
if (t instanceof $r)
|
|
4465
|
+
throw new Error("Union not supported");
|
|
4466
|
+
if (t instanceof xr)
|
|
4467
4467
|
return Object.keys(t.shape).reduce(
|
|
4468
4468
|
(s, n) => {
|
|
4469
|
-
const o = e.getProperties(), l = t.shape[n], a =
|
|
4469
|
+
const o = e.getProperties(), l = t.shape[n], a = Ps(l);
|
|
4470
4470
|
if (d(a)) {
|
|
4471
|
-
const g =
|
|
4471
|
+
const g = Tt(a) ? a : n, v = o?.[g], D = v ? this.calculateBlueId(v) : void 0;
|
|
4472
4472
|
return s[n] = D, s;
|
|
4473
4473
|
}
|
|
4474
|
-
const c =
|
|
4474
|
+
const c = Ss(l);
|
|
4475
4475
|
if (d(c)) {
|
|
4476
4476
|
const g = o?.[c];
|
|
4477
4477
|
return s[n] = g?.getName(), s;
|
|
4478
4478
|
}
|
|
4479
|
-
const h =
|
|
4479
|
+
const h = vs(l);
|
|
4480
4480
|
if (d(h)) {
|
|
4481
4481
|
const g = o?.[h];
|
|
4482
4482
|
return s[n] = g?.getDescription(), s;
|
|
@@ -4503,7 +4503,7 @@ class ti {
|
|
|
4503
4503
|
throw new Error("Unknown schema type, " + t._def.typeName);
|
|
4504
4504
|
}
|
|
4505
4505
|
}
|
|
4506
|
-
class
|
|
4506
|
+
class si {
|
|
4507
4507
|
constructor(e) {
|
|
4508
4508
|
this.nodeToObjectConverter = e;
|
|
4509
4509
|
}
|
|
@@ -4517,7 +4517,7 @@ class ri {
|
|
|
4517
4517
|
);
|
|
4518
4518
|
}
|
|
4519
4519
|
}
|
|
4520
|
-
class
|
|
4520
|
+
class ii {
|
|
4521
4521
|
constructor(e) {
|
|
4522
4522
|
this.nodeToObjectConverter = e;
|
|
4523
4523
|
}
|
|
@@ -4531,7 +4531,7 @@ class si {
|
|
|
4531
4531
|
return new Set(n);
|
|
4532
4532
|
}
|
|
4533
4533
|
}
|
|
4534
|
-
class
|
|
4534
|
+
class ni {
|
|
4535
4535
|
constructor(e) {
|
|
4536
4536
|
this.nodeToObjectConverter = e;
|
|
4537
4537
|
}
|
|
@@ -4544,22 +4544,22 @@ class ii {
|
|
|
4544
4544
|
return d(a) && Object.entries(a).forEach(([c, h]) => {
|
|
4545
4545
|
const p = new u().setValue(c);
|
|
4546
4546
|
p.setType(new u().setBlueId(Q));
|
|
4547
|
-
const y =
|
|
4547
|
+
const y = Rr.convertValue(p, r), g = this.nodeToObjectConverter.convert(h, s);
|
|
4548
4548
|
n.set(y, g);
|
|
4549
4549
|
}), t instanceof _r ? Object.fromEntries(n) : n;
|
|
4550
4550
|
}
|
|
4551
4551
|
}
|
|
4552
|
-
class
|
|
4552
|
+
class oi {
|
|
4553
4553
|
convert(e) {
|
|
4554
4554
|
return T.get(e);
|
|
4555
4555
|
}
|
|
4556
4556
|
}
|
|
4557
|
-
class
|
|
4557
|
+
class li {
|
|
4558
4558
|
convert(e) {
|
|
4559
4559
|
return T.get(e);
|
|
4560
4560
|
}
|
|
4561
4561
|
}
|
|
4562
|
-
class
|
|
4562
|
+
class ai {
|
|
4563
4563
|
constructor(e) {
|
|
4564
4564
|
this.nodeToObjectConverter = e;
|
|
4565
4565
|
}
|
|
@@ -4573,7 +4573,7 @@ class li {
|
|
|
4573
4573
|
);
|
|
4574
4574
|
}
|
|
4575
4575
|
}
|
|
4576
|
-
const
|
|
4576
|
+
const ci = f.union([
|
|
4577
4577
|
f.literal("ZodString"),
|
|
4578
4578
|
f.literal("ZodNumber"),
|
|
4579
4579
|
f.literal("ZodBoolean"),
|
|
@@ -4589,9 +4589,9 @@ const ai = f.union([
|
|
|
4589
4589
|
f.literal("ZodAny"),
|
|
4590
4590
|
f.literal("ZodTuple")
|
|
4591
4591
|
]);
|
|
4592
|
-
class
|
|
4592
|
+
class ui {
|
|
4593
4593
|
constructor(e, t) {
|
|
4594
|
-
this.nodeToObjectConverter = e, this.registerConverters(), this.complexObjectConverter = new
|
|
4594
|
+
this.nodeToObjectConverter = e, this.registerConverters(), this.complexObjectConverter = new ri(
|
|
4595
4595
|
this.nodeToObjectConverter,
|
|
4596
4596
|
t
|
|
4597
4597
|
);
|
|
@@ -4599,37 +4599,37 @@ class ci {
|
|
|
4599
4599
|
converters = /* @__PURE__ */ new Map();
|
|
4600
4600
|
complexObjectConverter;
|
|
4601
4601
|
registerConverters() {
|
|
4602
|
-
const e = new
|
|
4603
|
-
this.converters.set("ZodString", e), this.converters.set("ZodNumber", e), this.converters.set("ZodBoolean", e), this.converters.set("ZodBigInt", e), this.converters.set("ZodEnum", e), this.converters.set("ZodNativeEnum", e), this.converters.set("ZodUnknown", new
|
|
4602
|
+
const e = new ti(), t = new si(this.nodeToObjectConverter), r = new ai(this.nodeToObjectConverter), s = new ii(this.nodeToObjectConverter), n = new ni(this.nodeToObjectConverter);
|
|
4603
|
+
this.converters.set("ZodString", e), this.converters.set("ZodNumber", e), this.converters.set("ZodBoolean", e), this.converters.set("ZodBigInt", e), this.converters.set("ZodEnum", e), this.converters.set("ZodNativeEnum", e), this.converters.set("ZodUnknown", new oi()), this.converters.set("ZodAny", new li()), this.converters.set("ZodArray", t), this.converters.set("ZodTuple", r), this.converters.set("ZodSet", s), this.converters.set("ZodMap", n), this.converters.set("ZodRecord", n), this.converters.set("ZodObject", this.complexObjectConverter);
|
|
4604
4604
|
}
|
|
4605
4605
|
getConverter(e) {
|
|
4606
4606
|
const t = this.getSchemaTypeName(e);
|
|
4607
4607
|
return this.converters.get(t) ?? this.complexObjectConverter;
|
|
4608
4608
|
}
|
|
4609
4609
|
getSchemaTypeName(e) {
|
|
4610
|
-
if (
|
|
4611
|
-
return e instanceof
|
|
4610
|
+
if (Qs(e))
|
|
4611
|
+
return e instanceof We ? this.getSchemaTypeName(e.innerType()) : e instanceof Ge ? this.getSchemaTypeName(e.schema) : this.getSchemaTypeName(e.unwrap());
|
|
4612
4612
|
const t = e._def.typeName;
|
|
4613
4613
|
try {
|
|
4614
|
-
return
|
|
4614
|
+
return ci.parse(t);
|
|
4615
4615
|
} catch {
|
|
4616
4616
|
throw new Error(`Schema type name ${t} is not supported`);
|
|
4617
4617
|
}
|
|
4618
4618
|
}
|
|
4619
4619
|
}
|
|
4620
|
-
class
|
|
4620
|
+
class di {
|
|
4621
4621
|
constructor(e, t) {
|
|
4622
4622
|
if (this.typeSchemaResolver = e, !t?.calculateBlueId)
|
|
4623
4623
|
throw new Error(
|
|
4624
4624
|
"NodeToObjectConverter requires a semantic calculateBlueId option."
|
|
4625
4625
|
);
|
|
4626
|
-
this.calculateBlueId = t.calculateBlueId, this.converterFactory = new
|
|
4626
|
+
this.calculateBlueId = t.calculateBlueId, this.converterFactory = new ui(this, this.calculateBlueId);
|
|
4627
4627
|
}
|
|
4628
4628
|
converterFactory;
|
|
4629
4629
|
calculateBlueId;
|
|
4630
4630
|
convert(e, t) {
|
|
4631
4631
|
const r = this.typeSchemaResolver?.resolveSchema(e), s = H.unwrapSchema(t);
|
|
4632
|
-
if (
|
|
4632
|
+
if (gr(s))
|
|
4633
4633
|
return e;
|
|
4634
4634
|
let n = s;
|
|
4635
4635
|
return H.checkSchemaExtension(
|
|
@@ -4642,17 +4642,17 @@ class ui {
|
|
|
4642
4642
|
return this.converterFactory.getConverter(t).convert(e, t);
|
|
4643
4643
|
}
|
|
4644
4644
|
}
|
|
4645
|
-
class
|
|
4645
|
+
class hi {
|
|
4646
4646
|
static get(e, t = {}) {
|
|
4647
4647
|
const { strategy: r = "official" } = t, s = T.get(e, r);
|
|
4648
|
-
return
|
|
4648
|
+
return ks(s);
|
|
4649
4649
|
}
|
|
4650
4650
|
}
|
|
4651
4651
|
const Ft = async (i) => {
|
|
4652
|
-
if (
|
|
4652
|
+
if (kr(i))
|
|
4653
4653
|
return i;
|
|
4654
4654
|
try {
|
|
4655
|
-
const e =
|
|
4655
|
+
const e = Je.parse(i), { Blue: t } = await Promise.resolve().then(() => Wi), r = await new t().calculateBlueId(e);
|
|
4656
4656
|
return {
|
|
4657
4657
|
...i,
|
|
4658
4658
|
blueId: r
|
|
@@ -4660,13 +4660,13 @@ const Ft = async (i) => {
|
|
|
4660
4660
|
} catch (e) {
|
|
4661
4661
|
throw new Error(`Failed enriching object with Blue ID: ${e}`);
|
|
4662
4662
|
}
|
|
4663
|
-
}, wn = (i) => i?.items, Sn = (i) => i?.value, bn = (i) => I(i) ? {} :
|
|
4663
|
+
}, wn = (i) => i?.items, Sn = (i) => i?.value, bn = (i) => I(i) ? {} : Qt(
|
|
4664
4664
|
i,
|
|
4665
|
-
|
|
4666
|
-
), En = (i) =>
|
|
4665
|
+
wt
|
|
4666
|
+
), En = (i) => Wr(i) ? i.type.name ?? null : Gr(i) ? Fr(typeof i.value) : Yr(i) ? "List" : null, pi = (i) => d(i) && Object.keys(Qt(i, ["blueId"])).length > 0, Nn = (i) => {
|
|
4667
4667
|
try {
|
|
4668
4668
|
const e = m.deserialize(i), t = T.get(e);
|
|
4669
|
-
return
|
|
4669
|
+
return Oe.parse(t);
|
|
4670
4670
|
} catch (e) {
|
|
4671
4671
|
throw new Error(
|
|
4672
4672
|
`Failed transforming JSON-like value to BlueObject: ${e}`
|
|
@@ -4678,10 +4678,10 @@ const Ft = async (i) => {
|
|
|
4678
4678
|
signal: t = new AbortController().signal,
|
|
4679
4679
|
omitItems: r
|
|
4680
4680
|
} = i, s = i.count ?? i.items.length;
|
|
4681
|
-
let n = await
|
|
4681
|
+
let n = await jr(i.items, async (l) => await Ft(l));
|
|
4682
4682
|
const o = Math.max(n?.length - s, 0);
|
|
4683
4683
|
for (let l = n.length - 1; l >= o; l--)
|
|
4684
|
-
if (!
|
|
4684
|
+
if (!pi(n[l])) {
|
|
4685
4685
|
const a = await e(n[l], { signal: t });
|
|
4686
4686
|
if (Array.isArray(a))
|
|
4687
4687
|
return jt({
|
|
@@ -4706,7 +4706,7 @@ const Ft = async (i) => {
|
|
|
4706
4706
|
}
|
|
4707
4707
|
return n;
|
|
4708
4708
|
};
|
|
4709
|
-
function
|
|
4709
|
+
function Ye(i) {
|
|
4710
4710
|
try {
|
|
4711
4711
|
const e = new URL(i);
|
|
4712
4712
|
return e.protocol === "http:" || e.protocol === "https:";
|
|
@@ -4714,7 +4714,7 @@ function ke(i) {
|
|
|
4714
4714
|
return !1;
|
|
4715
4715
|
}
|
|
4716
4716
|
}
|
|
4717
|
-
class
|
|
4717
|
+
class fi {
|
|
4718
4718
|
/**
|
|
4719
4719
|
* Process a document node to infer basic types for untyped values
|
|
4720
4720
|
* @param document - The document to process
|
|
@@ -4730,10 +4730,10 @@ class pi {
|
|
|
4730
4730
|
*/
|
|
4731
4731
|
inferType(e) {
|
|
4732
4732
|
const t = e.getType(), r = e.getValue();
|
|
4733
|
-
return I(t) && d(r) && (typeof r == "string" ? e.setType(new u().setBlueId(Q)) : typeof r == "bigint" || oe(r) ? e.setType(new u().setBlueId(te)) :
|
|
4733
|
+
return I(t) && d(r) && (typeof r == "string" ? e.setType(new u().setBlueId(Q)) : typeof r == "bigint" || oe(r) ? e.setType(new u().setBlueId(te)) : ht(r) ? e.setType(new u().setBlueId(ee)) : typeof r == "boolean" && e.setType(new u().setBlueId(re))), e;
|
|
4734
4734
|
}
|
|
4735
4735
|
}
|
|
4736
|
-
class
|
|
4736
|
+
class qe {
|
|
4737
4737
|
static MAPPINGS = "mappings";
|
|
4738
4738
|
mappings = /* @__PURE__ */ new Map();
|
|
4739
4739
|
/**
|
|
@@ -4743,8 +4743,8 @@ class Xe {
|
|
|
4743
4743
|
constructor(e) {
|
|
4744
4744
|
if (e instanceof u) {
|
|
4745
4745
|
const r = e.getProperties();
|
|
4746
|
-
if (r && r[
|
|
4747
|
-
const n = r[
|
|
4746
|
+
if (r && r[qe.MAPPINGS]) {
|
|
4747
|
+
const n = r[qe.MAPPINGS].getProperties();
|
|
4748
4748
|
n && Object.entries(n).forEach(([o, l]) => {
|
|
4749
4749
|
const a = l.getValue();
|
|
4750
4750
|
typeof a == "string" && this.mappings.set(o, a);
|
|
@@ -4778,7 +4778,7 @@ class Xe {
|
|
|
4778
4778
|
}
|
|
4779
4779
|
}
|
|
4780
4780
|
}
|
|
4781
|
-
class
|
|
4781
|
+
class yi {
|
|
4782
4782
|
/**
|
|
4783
4783
|
* Process a document node to validate all inline types have been replaced
|
|
4784
4784
|
* @param document - The document to process
|
|
@@ -4800,7 +4800,7 @@ class fi {
|
|
|
4800
4800
|
}
|
|
4801
4801
|
}
|
|
4802
4802
|
}
|
|
4803
|
-
class
|
|
4803
|
+
class Ar {
|
|
4804
4804
|
blueIdsCollections = [];
|
|
4805
4805
|
/**
|
|
4806
4806
|
* Initializes the generator with default BlueIds collections
|
|
@@ -4870,7 +4870,7 @@ ${r}`;
|
|
|
4870
4870
|
return Object.keys(this.getAllBlueIds()).length;
|
|
4871
4871
|
}
|
|
4872
4872
|
}
|
|
4873
|
-
class
|
|
4873
|
+
class Le {
|
|
4874
4874
|
/**
|
|
4875
4875
|
* BlueId of the static DefaultBlue.yaml content registered by BootstrapProvider.
|
|
4876
4876
|
* Dynamic repository mappings are appended separately and intentionally do not
|
|
@@ -4889,7 +4889,7 @@ class De {
|
|
|
4889
4889
|
const { nodeProvider: t, processorProvider: r, blueIdsMappingGenerator: s } = e;
|
|
4890
4890
|
if (!t)
|
|
4891
4891
|
throw new Error("NodeProvider is required");
|
|
4892
|
-
this.nodeProvider =
|
|
4892
|
+
this.nodeProvider = De.wrap(t), this.processorProvider = r || Le.getStandardProvider(), this.blueIdsMappingGenerator = s || new Ar(), this.loadDefaultSimpleBlue();
|
|
4893
4893
|
}
|
|
4894
4894
|
/**
|
|
4895
4895
|
* Preprocesses a document node
|
|
@@ -4916,9 +4916,9 @@ class De {
|
|
|
4916
4916
|
preprocessWithOptions(e, t) {
|
|
4917
4917
|
let r = e.clone(), s = r.getBlue();
|
|
4918
4918
|
if (!s && t && (s = t.clone()), s) {
|
|
4919
|
-
new
|
|
4919
|
+
new Mt(this.nodeProvider).extend(
|
|
4920
4920
|
s,
|
|
4921
|
-
|
|
4921
|
+
st.withSinglePath("/*")
|
|
4922
4922
|
);
|
|
4923
4923
|
const n = this.flattenTransformationItems(
|
|
4924
4924
|
s.getItems()
|
|
@@ -4935,7 +4935,7 @@ class De {
|
|
|
4935
4935
|
}
|
|
4936
4936
|
r.setBlue(void 0);
|
|
4937
4937
|
}
|
|
4938
|
-
r = new
|
|
4938
|
+
r = new yi().process(
|
|
4939
4939
|
r
|
|
4940
4940
|
);
|
|
4941
4941
|
}
|
|
@@ -4954,11 +4954,11 @@ class De {
|
|
|
4954
4954
|
getProcessor(e) {
|
|
4955
4955
|
const t = "27B7fuxQCS1VAptiCPc2RMkKoutP5qxkh3uDxZ7dr6Eo", r = "FGYuTXwaoSKfZmpTysLTLsb8WzSqf43384rKZDkXhxD4", s = e.getType()?.getBlueId();
|
|
4956
4956
|
if (t === s)
|
|
4957
|
-
return new
|
|
4957
|
+
return new qe(
|
|
4958
4958
|
e
|
|
4959
4959
|
);
|
|
4960
4960
|
if (r === s)
|
|
4961
|
-
return new
|
|
4961
|
+
return new fi();
|
|
4962
4962
|
}
|
|
4963
4963
|
};
|
|
4964
4964
|
}
|
|
@@ -4981,7 +4981,7 @@ ${t}
|
|
|
4981
4981
|
*/
|
|
4982
4982
|
loadDefaultSimpleBlue() {
|
|
4983
4983
|
try {
|
|
4984
|
-
const e = this.enrichDefaultBlue(
|
|
4984
|
+
const e = this.enrichDefaultBlue(Br), t = ae(e);
|
|
4985
4985
|
if (t)
|
|
4986
4986
|
this.defaultSimpleBlue = m.deserialize(t);
|
|
4987
4987
|
else
|
|
@@ -4991,7 +4991,7 @@ ${t}
|
|
|
4991
4991
|
}
|
|
4992
4992
|
}
|
|
4993
4993
|
}
|
|
4994
|
-
class
|
|
4994
|
+
class gi {
|
|
4995
4995
|
preprocessingAliases = /* @__PURE__ */ new Map();
|
|
4996
4996
|
urlContentFetcher;
|
|
4997
4997
|
/**
|
|
@@ -5017,7 +5017,7 @@ class yi {
|
|
|
5017
5017
|
return this.handleAliasValue(r, t);
|
|
5018
5018
|
if (ve.isPotentialBlueId(t))
|
|
5019
5019
|
return this.handleBlueId(r, t);
|
|
5020
|
-
throw
|
|
5020
|
+
throw Ye(t) ? new Error(
|
|
5021
5021
|
`URL '${t}' detected. Use the async version of this method to fetch the content.`
|
|
5022
5022
|
) : new Error(`Invalid blue value: ${t}`);
|
|
5023
5023
|
}
|
|
@@ -5037,7 +5037,7 @@ class yi {
|
|
|
5037
5037
|
return this.handleAliasValue(r, t);
|
|
5038
5038
|
if (ve.isPotentialBlueId(t))
|
|
5039
5039
|
return this.handleBlueId(r, t);
|
|
5040
|
-
if (
|
|
5040
|
+
if (Ye(t) && this.urlContentFetcher)
|
|
5041
5041
|
try {
|
|
5042
5042
|
const s = await this.fetchFromUrl(t);
|
|
5043
5043
|
return s && r.setBlue(new u().setItems(s)), r;
|
|
@@ -5047,7 +5047,7 @@ class yi {
|
|
|
5047
5047
|
${s.message}`
|
|
5048
5048
|
) : s;
|
|
5049
5049
|
}
|
|
5050
|
-
else throw
|
|
5050
|
+
else throw Ye(t) ? new Error(
|
|
5051
5051
|
`UrlContentFetcher not provided for URL: ${t}`
|
|
5052
5052
|
) : new Error(`Invalid blue value: ${t}`);
|
|
5053
5053
|
}
|
|
@@ -5133,24 +5133,24 @@ ${s.message}`
|
|
|
5133
5133
|
return this.urlContentFetcher;
|
|
5134
5134
|
}
|
|
5135
5135
|
}
|
|
5136
|
-
const
|
|
5136
|
+
const mi = {
|
|
5137
5137
|
fetchUrl: async (i) => {
|
|
5138
5138
|
throw new Error(
|
|
5139
5139
|
`You must provide a custom UrlFetchStrategy to fetch content from URL: ${i}`
|
|
5140
5140
|
);
|
|
5141
5141
|
}
|
|
5142
5142
|
};
|
|
5143
|
-
class
|
|
5143
|
+
class Ii {
|
|
5144
5144
|
// Cache to avoid repeated network requests for the same URL
|
|
5145
5145
|
cache = /* @__PURE__ */ new Map();
|
|
5146
5146
|
fetchStrategy;
|
|
5147
5147
|
enabled = !1;
|
|
5148
5148
|
allowedDomains = [];
|
|
5149
5149
|
constructor(e) {
|
|
5150
|
-
this.fetchStrategy = e ||
|
|
5150
|
+
this.fetchStrategy = e || mi;
|
|
5151
5151
|
}
|
|
5152
5152
|
validateUrl(e) {
|
|
5153
|
-
if (!
|
|
5153
|
+
if (!Ye(e))
|
|
5154
5154
|
throw new Error(`Invalid URL: ${e}`);
|
|
5155
5155
|
return !0;
|
|
5156
5156
|
}
|
|
@@ -5269,7 +5269,7 @@ class mi {
|
|
|
5269
5269
|
return this.allowedDomains = [], this;
|
|
5270
5270
|
}
|
|
5271
5271
|
}
|
|
5272
|
-
class
|
|
5272
|
+
class Fe {
|
|
5273
5273
|
constructor(e, t, r, s = [], n = !1) {
|
|
5274
5274
|
this.blueId = e, this.content = t, this.isMultipleDocuments = r, this.documentBlueIds = s, this.isCyclicSet = n;
|
|
5275
5275
|
}
|
|
@@ -5297,7 +5297,7 @@ class Re {
|
|
|
5297
5297
|
);
|
|
5298
5298
|
return n = c.blueId, o = c.nodes.map(
|
|
5299
5299
|
(h) => T.get(h)
|
|
5300
|
-
), new
|
|
5300
|
+
), new Fe(
|
|
5301
5301
|
n,
|
|
5302
5302
|
o,
|
|
5303
5303
|
!0,
|
|
@@ -5308,11 +5308,11 @@ class Re {
|
|
|
5308
5308
|
const a = m.deserialize(s), c = r.prepareStorageNode(a, t);
|
|
5309
5309
|
n = c.blueId, o = T.get(c.node);
|
|
5310
5310
|
}
|
|
5311
|
-
return new
|
|
5311
|
+
return new Fe(n, o, l);
|
|
5312
5312
|
}
|
|
5313
5313
|
static parseAndCalculateBlueIdForNode(e, t, r) {
|
|
5314
5314
|
const s = r.prepareStorageNode(e, t), n = T.get(s.node);
|
|
5315
|
-
return new
|
|
5315
|
+
return new Fe(s.blueId, n, !1);
|
|
5316
5316
|
}
|
|
5317
5317
|
static parseAndCalculateBlueIdForNodeList(e, t, r) {
|
|
5318
5318
|
if (!e || e.length === 0)
|
|
@@ -5323,7 +5323,7 @@ class Re {
|
|
|
5323
5323
|
), n = s.nodes.map(
|
|
5324
5324
|
(l) => T.get(l)
|
|
5325
5325
|
), o = !0;
|
|
5326
|
-
return new
|
|
5326
|
+
return new Fe(
|
|
5327
5327
|
s.blueId,
|
|
5328
5328
|
n,
|
|
5329
5329
|
o,
|
|
@@ -5376,7 +5376,7 @@ class Re {
|
|
|
5376
5376
|
}
|
|
5377
5377
|
}
|
|
5378
5378
|
}
|
|
5379
|
-
class
|
|
5379
|
+
class vi extends fe {
|
|
5380
5380
|
fetchByBlueId(e) {
|
|
5381
5381
|
const t = e.split("#")[0], r = this.fetchContentByBlueId(t);
|
|
5382
5382
|
if (r == null)
|
|
@@ -5399,7 +5399,7 @@ class Ii extends fe {
|
|
|
5399
5399
|
return Array.isArray(n) ? n.map((o) => m.deserialize(o)) : [m.deserialize(n)];
|
|
5400
5400
|
}
|
|
5401
5401
|
}
|
|
5402
|
-
class
|
|
5402
|
+
class Vr extends vi {
|
|
5403
5403
|
nameToBlueIdsMap = /* @__PURE__ */ new Map();
|
|
5404
5404
|
/**
|
|
5405
5405
|
* Find a node by name. Throws an error if multiple nodes are found with the same name.
|
|
@@ -5443,7 +5443,7 @@ class Ar extends Ii {
|
|
|
5443
5443
|
]);
|
|
5444
5444
|
}
|
|
5445
5445
|
}
|
|
5446
|
-
function
|
|
5446
|
+
function Ut(i) {
|
|
5447
5447
|
return Array.isArray(i) ? Ti(i) : i;
|
|
5448
5448
|
}
|
|
5449
5449
|
function Ti(i) {
|
|
@@ -5453,13 +5453,13 @@ function Ti(i) {
|
|
|
5453
5453
|
function Bi(i) {
|
|
5454
5454
|
return new O().calculate(i).nodes.map((t) => T.get(t));
|
|
5455
5455
|
}
|
|
5456
|
-
class
|
|
5456
|
+
class Ae extends Vr {
|
|
5457
5457
|
blueIdToContentMap = /* @__PURE__ */ new Map();
|
|
5458
5458
|
blueIdToMultipleDocumentsMap = /* @__PURE__ */ new Map();
|
|
5459
5459
|
aliasBlueIdMap = /* @__PURE__ */ new Map();
|
|
5460
5460
|
constructor(e, t = {}) {
|
|
5461
5461
|
super();
|
|
5462
|
-
const r =
|
|
5462
|
+
const r = Ae.collectAliasMappings(e);
|
|
5463
5463
|
this.aliasBlueIdMap = new Map(Object.entries(r)), this.loadRepositories(e);
|
|
5464
5464
|
}
|
|
5465
5465
|
static collectAliasMappings(e) {
|
|
@@ -5475,17 +5475,50 @@ class Dt extends Ar {
|
|
|
5475
5475
|
return t;
|
|
5476
5476
|
}
|
|
5477
5477
|
loadRepositories(e) {
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
o,
|
|
5485
|
-
|
|
5486
|
-
|
|
5478
|
+
const t = [], r = /* @__PURE__ */ new Map();
|
|
5479
|
+
for (const s of e)
|
|
5480
|
+
Object.values(s.packages).forEach((n) => {
|
|
5481
|
+
for (const [o, l] of Object.entries(n.contents)) {
|
|
5482
|
+
const a = Ae.parseCyclicBlueId(o);
|
|
5483
|
+
if (!a) {
|
|
5484
|
+
t.push({ providedBlueId: o, content: l });
|
|
5485
|
+
continue;
|
|
5486
|
+
}
|
|
5487
|
+
const c = r.get(a.baseBlueId) ?? [];
|
|
5488
|
+
c.push({ index: a.index, content: l }), r.set(a.baseBlueId, c);
|
|
5487
5489
|
}
|
|
5488
5490
|
});
|
|
5491
|
+
t.forEach(({ content: s, providedBlueId: n }) => {
|
|
5492
|
+
const o = Ut(s);
|
|
5493
|
+
this.storeContent(
|
|
5494
|
+
n,
|
|
5495
|
+
o,
|
|
5496
|
+
Array.isArray(o)
|
|
5497
|
+
), this.addContentNames(n, o);
|
|
5498
|
+
});
|
|
5499
|
+
for (const [s, n] of r) {
|
|
5500
|
+
const o = Ae.toDenseCyclicContent(
|
|
5501
|
+
s,
|
|
5502
|
+
n
|
|
5503
|
+
), l = Ut(o);
|
|
5504
|
+
this.storeContent(s, l, !0), this.addContentNames(s, l);
|
|
5505
|
+
}
|
|
5506
|
+
}
|
|
5507
|
+
static parseCyclicBlueId(e) {
|
|
5508
|
+
const t = /^(.*)#(\d+)$/.exec(e);
|
|
5509
|
+
return !t?.[1] || t[2] === void 0 ? null : {
|
|
5510
|
+
baseBlueId: t[1],
|
|
5511
|
+
index: Number.parseInt(t[2], 10)
|
|
5512
|
+
};
|
|
5513
|
+
}
|
|
5514
|
+
static toDenseCyclicContent(e, t) {
|
|
5515
|
+
return [...t].sort((s, n) => s.index - n.index).map((s, n) => {
|
|
5516
|
+
if (s.index !== n)
|
|
5517
|
+
throw new Error(
|
|
5518
|
+
`Cyclic repository content for ${e} is missing index ${n}.`
|
|
5519
|
+
);
|
|
5520
|
+
return s.content;
|
|
5521
|
+
});
|
|
5489
5522
|
}
|
|
5490
5523
|
addContentNames(e, t) {
|
|
5491
5524
|
if (Array.isArray(t)) {
|
|
@@ -5557,7 +5590,7 @@ class Pi {
|
|
|
5557
5590
|
blueIdToInlineValue = /* @__PURE__ */ new Map();
|
|
5558
5591
|
constructor(e) {
|
|
5559
5592
|
const { nodeProvider: t, blueIdsMappingGenerator: r } = e;
|
|
5560
|
-
this.nodeProvider = t, Object.entries(
|
|
5593
|
+
this.nodeProvider = t, Object.entries(tt).forEach(([n, o]) => {
|
|
5561
5594
|
this.blueIdToInlineValue.set(n, o);
|
|
5562
5595
|
});
|
|
5563
5596
|
const s = r.getAllBlueIds();
|
|
@@ -5643,7 +5676,7 @@ class wi {
|
|
|
5643
5676
|
return this.runtimes.find((t) => t.name === e);
|
|
5644
5677
|
}
|
|
5645
5678
|
toCurrentBlueId(e) {
|
|
5646
|
-
const t = this.aliases[e] ??
|
|
5679
|
+
const t = this.aliases[e] ?? ar[e] ?? e;
|
|
5647
5680
|
for (const r of this.runtimes) {
|
|
5648
5681
|
const s = r.toCurrentBlueIdIndex[t];
|
|
5649
5682
|
if (s)
|
|
@@ -5652,7 +5685,7 @@ class wi {
|
|
|
5652
5685
|
return t;
|
|
5653
5686
|
}
|
|
5654
5687
|
getTypeAlias(e) {
|
|
5655
|
-
const t = this.toCurrentBlueId(e), r =
|
|
5688
|
+
const t = this.toCurrentBlueId(e), r = tt[t];
|
|
5656
5689
|
if (r)
|
|
5657
5690
|
return r;
|
|
5658
5691
|
for (const s of this.runtimes) {
|
|
@@ -5752,7 +5785,7 @@ function Ai(i, e) {
|
|
|
5752
5785
|
i.schemas.push(...Object.values(e.schemas));
|
|
5753
5786
|
}
|
|
5754
5787
|
function Vi(i, e, t, r) {
|
|
5755
|
-
if (i.status ===
|
|
5788
|
+
if (i.status === Pt)
|
|
5756
5789
|
return Oi(i, e, t, r), {
|
|
5757
5790
|
...i,
|
|
5758
5791
|
versions: i.versions ? [...i.versions] : i.versions
|
|
@@ -5788,7 +5821,7 @@ function Vi(i, e, t, r) {
|
|
|
5788
5821
|
};
|
|
5789
5822
|
}
|
|
5790
5823
|
function Oi(i, e, t, r) {
|
|
5791
|
-
if (i.status ===
|
|
5824
|
+
if (i.status === Pt) {
|
|
5792
5825
|
if (i.versions && i.versions.length > 1)
|
|
5793
5826
|
throw new Error(
|
|
5794
5827
|
`Dev type ${r}/${i.name} (${t}) must not declare multiple versions`
|
|
@@ -5804,7 +5837,7 @@ function Oi(i, e, t, r) {
|
|
|
5804
5837
|
}
|
|
5805
5838
|
function Mi(i, e, t, r) {
|
|
5806
5839
|
try {
|
|
5807
|
-
|
|
5840
|
+
Ur(i);
|
|
5808
5841
|
} catch (s) {
|
|
5809
5842
|
const n = s instanceof Error ? s.message : "Unknown error";
|
|
5810
5843
|
throw new Error(
|
|
@@ -5838,25 +5871,25 @@ function Li(i, e, t) {
|
|
|
5838
5871
|
function $i(i, e) {
|
|
5839
5872
|
if (i === e) return !0;
|
|
5840
5873
|
if (i === null || e === null || typeof i != "object" || typeof e != "object") return !1;
|
|
5841
|
-
const t =
|
|
5874
|
+
const t = pt.canonicalize(i), r = pt.canonicalize(e);
|
|
5842
5875
|
return t !== void 0 && t === r;
|
|
5843
5876
|
}
|
|
5844
|
-
const
|
|
5877
|
+
const xi = /* @__PURE__ */ new Set([
|
|
5845
5878
|
"__proto__",
|
|
5846
5879
|
"constructor",
|
|
5847
5880
|
"prototype"
|
|
5848
5881
|
]);
|
|
5849
|
-
function
|
|
5882
|
+
function zt(i) {
|
|
5850
5883
|
const e = i.at(0), t = i.at(-1);
|
|
5851
5884
|
return !e || !t ? i : e === "'" && t === "'" || e === '"' && t === '"' ? i.slice(1, -1) : i;
|
|
5852
5885
|
}
|
|
5853
|
-
function
|
|
5886
|
+
function _i(i, e) {
|
|
5854
5887
|
const t = i.indexOf("=");
|
|
5855
5888
|
if (t === -1)
|
|
5856
5889
|
throw Ie(e, `Missing '=' in segment '${i.trim()}'`);
|
|
5857
5890
|
if (i.indexOf("=", t + 1) !== -1)
|
|
5858
5891
|
throw Ie(e, `Unexpected '=' in segment '${i.trim()}'`);
|
|
5859
|
-
const r =
|
|
5892
|
+
const r = zt(i.slice(0, t).trim()), s = zt(i.slice(t + 1).trim());
|
|
5860
5893
|
if (!r)
|
|
5861
5894
|
throw Ie(e, "Repository name is empty");
|
|
5862
5895
|
if (!s)
|
|
@@ -5871,7 +5904,7 @@ function Fi(i) {
|
|
|
5871
5904
|
const r = t.trim();
|
|
5872
5905
|
if (!r)
|
|
5873
5906
|
throw Ie(i, "Empty repository segment");
|
|
5874
|
-
const { name: s, value: n } =
|
|
5907
|
+
const { name: s, value: n } = _i(r, i);
|
|
5875
5908
|
Ui(s, i), e[s] = n;
|
|
5876
5909
|
}
|
|
5877
5910
|
return e;
|
|
@@ -5897,23 +5930,23 @@ function Ie(i, e) {
|
|
|
5897
5930
|
);
|
|
5898
5931
|
}
|
|
5899
5932
|
function Ui(i, e) {
|
|
5900
|
-
if (
|
|
5933
|
+
if (xi.has(i))
|
|
5901
5934
|
throw Ie(e, `Forbidden repository name '${i}'`);
|
|
5902
5935
|
}
|
|
5903
5936
|
function zi(i, e) {
|
|
5904
5937
|
const t = i.filter((s) => s.repositoryVersionIndex > e).sort((s, n) => n.repositoryVersionIndex - s.repositoryVersionIndex), r = [];
|
|
5905
5938
|
for (const s of t) {
|
|
5906
5939
|
const n = [...s.attributesAdded].sort(
|
|
5907
|
-
(o, l) =>
|
|
5940
|
+
(o, l) => Kt(l) - Kt(o)
|
|
5908
5941
|
);
|
|
5909
5942
|
r.push(...n);
|
|
5910
5943
|
}
|
|
5911
5944
|
return r;
|
|
5912
5945
|
}
|
|
5913
|
-
function
|
|
5914
|
-
return
|
|
5946
|
+
function Kt(i) {
|
|
5947
|
+
return tr(i).length;
|
|
5915
5948
|
}
|
|
5916
|
-
const Ki = /* @__PURE__ */ new Set([...
|
|
5949
|
+
const Ki = /* @__PURE__ */ new Set([...wt]), N = {
|
|
5917
5950
|
core: "core",
|
|
5918
5951
|
noRuntime: "no-runtime",
|
|
5919
5952
|
noTargetContext: "no-target-context",
|
|
@@ -6007,7 +6040,7 @@ class Hi {
|
|
|
6007
6040
|
typeAlias: r
|
|
6008
6041
|
};
|
|
6009
6042
|
const o = s.typeMeta;
|
|
6010
|
-
if (o.status ===
|
|
6043
|
+
if (o.status === Pt) {
|
|
6011
6044
|
const p = s.runtime.repositoryVersions.length - 1;
|
|
6012
6045
|
if (n !== p)
|
|
6013
6046
|
return {
|
|
@@ -6089,7 +6122,7 @@ class Hi {
|
|
|
6089
6122
|
deletePropertyAtPointer(e, t, r) {
|
|
6090
6123
|
let s;
|
|
6091
6124
|
try {
|
|
6092
|
-
s =
|
|
6125
|
+
s = tr(t);
|
|
6093
6126
|
} catch {
|
|
6094
6127
|
throw this.invalidPointerError(t);
|
|
6095
6128
|
}
|
|
@@ -6200,26 +6233,26 @@ class Hi {
|
|
|
6200
6233
|
);
|
|
6201
6234
|
}
|
|
6202
6235
|
}
|
|
6203
|
-
function
|
|
6204
|
-
return e ? $.transform(i, (t) => (
|
|
6236
|
+
function vt(i, e) {
|
|
6237
|
+
return e ? $.transform(i, (t) => (je(
|
|
6205
6238
|
() => t.getType(),
|
|
6206
6239
|
(r) => t.setType(r),
|
|
6207
6240
|
e
|
|
6208
|
-
),
|
|
6241
|
+
), je(
|
|
6209
6242
|
() => t.getItemType(),
|
|
6210
6243
|
(r) => t.setItemType(r),
|
|
6211
6244
|
e
|
|
6212
|
-
),
|
|
6245
|
+
), je(
|
|
6213
6246
|
() => t.getKeyType(),
|
|
6214
6247
|
(r) => t.setKeyType(r),
|
|
6215
6248
|
e
|
|
6216
|
-
),
|
|
6249
|
+
), je(
|
|
6217
6250
|
() => t.getValueType(),
|
|
6218
6251
|
(r) => t.setValueType(r),
|
|
6219
6252
|
e
|
|
6220
6253
|
), t)) : i;
|
|
6221
6254
|
}
|
|
6222
|
-
function
|
|
6255
|
+
function je(i, e, t) {
|
|
6223
6256
|
const r = i();
|
|
6224
6257
|
if (!r || r.isInlineValue())
|
|
6225
6258
|
return;
|
|
@@ -6239,7 +6272,7 @@ class ki {
|
|
|
6239
6272
|
const r = this.computeTargetRepoVersionIndexes(t);
|
|
6240
6273
|
if (Object.keys(r).length === 0)
|
|
6241
6274
|
return e;
|
|
6242
|
-
const s =
|
|
6275
|
+
const s = vt(e, this.blueIdMapper);
|
|
6243
6276
|
return new Hi({
|
|
6244
6277
|
registry: this.registry,
|
|
6245
6278
|
targetRepoVersionIndexes: r,
|
|
@@ -6304,17 +6337,17 @@ class Yi {
|
|
|
6304
6337
|
this.repositories = n, this.repositoryRegistry = new wi(n ?? []), this.blueContextResolver = new ki({
|
|
6305
6338
|
registry: this.repositoryRegistry,
|
|
6306
6339
|
blueIdMapper: this.repositoryRegistry
|
|
6307
|
-
}), this.mergingProcessor = o ??
|
|
6308
|
-
const l =
|
|
6340
|
+
}), this.mergingProcessor = o ?? Dt();
|
|
6341
|
+
const l = Vt(() => []);
|
|
6309
6342
|
this.nodeProvider = this.wrapNodeProviderWithRepositories(
|
|
6310
6343
|
t || l,
|
|
6311
6344
|
n
|
|
6312
6345
|
), this.typeSchemaResolver = r ?? new _s([], {
|
|
6313
6346
|
nodeProvider: this.nodeProvider
|
|
6314
|
-
}), this.typeSchemaResolver?.setNodeProvider(this.nodeProvider), this.urlContentFetcher = new
|
|
6347
|
+
}), this.typeSchemaResolver?.setNodeProvider(this.nodeProvider), this.urlContentFetcher = new Ii(s), this.blueDirectivePreprocessor = new gi(
|
|
6315
6348
|
void 0,
|
|
6316
6349
|
this.urlContentFetcher
|
|
6317
|
-
), this.blueIdsMappingGenerator = new
|
|
6350
|
+
), this.blueIdsMappingGenerator = new Ar(), this.blueIdsMappingGenerator.registerBlueIds(
|
|
6318
6351
|
this.repositoryRegistry.getAliases()
|
|
6319
6352
|
);
|
|
6320
6353
|
const a = this.repositoryRegistry.getRuntimes().flatMap((c) => c.schemas);
|
|
@@ -6337,12 +6370,12 @@ class Yi {
|
|
|
6337
6370
|
*/
|
|
6338
6371
|
nodeToYaml(e, t = "official") {
|
|
6339
6372
|
const r = this.normalizeNodeToJsonOptions(t), s = r.blueContext ? this.blueContextResolver.transform(e, r.blueContext) : e;
|
|
6340
|
-
return
|
|
6373
|
+
return hi.get(s, {
|
|
6341
6374
|
strategy: r.format
|
|
6342
6375
|
});
|
|
6343
6376
|
}
|
|
6344
6377
|
nodeToSchemaOutput(e, t) {
|
|
6345
|
-
return new
|
|
6378
|
+
return new di(this.typeSchemaResolver, {
|
|
6346
6379
|
calculateBlueId: (s) => this.calculateBlueIdSync(s)
|
|
6347
6380
|
}).convert(e, t);
|
|
6348
6381
|
}
|
|
@@ -6376,7 +6409,7 @@ class Yi {
|
|
|
6376
6409
|
* Produces a minimal overlay that re-resolves to the same semantic BlueId.
|
|
6377
6410
|
*/
|
|
6378
6411
|
minimize(e) {
|
|
6379
|
-
return new
|
|
6412
|
+
return new ke({
|
|
6380
6413
|
nodeProvider: this.nodeProvider,
|
|
6381
6414
|
mergingProcessor: this.mergingProcessor
|
|
6382
6415
|
}).minimize(e);
|
|
@@ -6396,11 +6429,11 @@ class Yi {
|
|
|
6396
6429
|
}
|
|
6397
6430
|
extend(e, t) {
|
|
6398
6431
|
const r = this.combineWithGlobalLimits(t);
|
|
6399
|
-
new
|
|
6432
|
+
new Mt(this.nodeProvider).extend(e, r);
|
|
6400
6433
|
}
|
|
6401
6434
|
jsonValueToNode(e) {
|
|
6402
6435
|
const t = this.preprocess(m.deserialize(e));
|
|
6403
|
-
return
|
|
6436
|
+
return vt(
|
|
6404
6437
|
t,
|
|
6405
6438
|
this.repositoryRegistry
|
|
6406
6439
|
);
|
|
@@ -6409,7 +6442,7 @@ class Yi {
|
|
|
6409
6442
|
const t = await this.preprocessAsync(
|
|
6410
6443
|
m.deserialize(e)
|
|
6411
6444
|
);
|
|
6412
|
-
return
|
|
6445
|
+
return vt(
|
|
6413
6446
|
t,
|
|
6414
6447
|
this.repositoryRegistry
|
|
6415
6448
|
);
|
|
@@ -6431,7 +6464,7 @@ class Yi {
|
|
|
6431
6464
|
) : this.jsonValueToNodeAsync(e);
|
|
6432
6465
|
calculateBlueId = async (e) => {
|
|
6433
6466
|
const t = await this.prepareForBlueIdCalculation(e);
|
|
6434
|
-
return new
|
|
6467
|
+
return new ke({
|
|
6435
6468
|
nodeProvider: this.nodeProvider,
|
|
6436
6469
|
mergingProcessor: this.mergingProcessor
|
|
6437
6470
|
}).calculateBlueId(t);
|
|
@@ -6439,7 +6472,7 @@ class Yi {
|
|
|
6439
6472
|
prepareForBlueIdCalculationSync = (e) => e instanceof u || Array.isArray(e) && e.every((t) => t instanceof u) ? e : Array.isArray(e) ? e.map((t) => this.jsonValueToNode(t)) : this.jsonValueToNode(e);
|
|
6440
6473
|
calculateBlueIdSync(e) {
|
|
6441
6474
|
const t = this.prepareForBlueIdCalculationSync(e);
|
|
6442
|
-
return new
|
|
6475
|
+
return new ke({
|
|
6443
6476
|
nodeProvider: this.nodeProvider,
|
|
6444
6477
|
mergingProcessor: this.mergingProcessor
|
|
6445
6478
|
}).calculateBlueIdSync(t);
|
|
@@ -6464,14 +6497,14 @@ class Yi {
|
|
|
6464
6497
|
}
|
|
6465
6498
|
preprocess(e) {
|
|
6466
6499
|
const t = this.blueDirectivePreprocessor.process(e);
|
|
6467
|
-
return new
|
|
6500
|
+
return new Le({
|
|
6468
6501
|
nodeProvider: this.nodeProvider,
|
|
6469
6502
|
blueIdsMappingGenerator: this.blueIdsMappingGenerator
|
|
6470
6503
|
}).preprocessWithDefaultBlue(t);
|
|
6471
6504
|
}
|
|
6472
6505
|
async preprocessAsync(e) {
|
|
6473
6506
|
const t = await this.blueDirectivePreprocessor.processAsync(e);
|
|
6474
|
-
return new
|
|
6507
|
+
return new Le({
|
|
6475
6508
|
nodeProvider: this.nodeProvider,
|
|
6476
6509
|
blueIdsMappingGenerator: this.blueIdsMappingGenerator
|
|
6477
6510
|
}).preprocessWithDefaultBlue(t);
|
|
@@ -6644,7 +6677,7 @@ class Yi {
|
|
|
6644
6677
|
* @returns true if the node matches the type, false otherwise.
|
|
6645
6678
|
*/
|
|
6646
6679
|
isTypeOfNode(e, t) {
|
|
6647
|
-
return new
|
|
6680
|
+
return new Fs(this).matchesType(e, t, this.globalLimits);
|
|
6648
6681
|
}
|
|
6649
6682
|
/**
|
|
6650
6683
|
* Sets the global limits for this Blue instance.
|
|
@@ -6674,32 +6707,32 @@ class Yi {
|
|
|
6674
6707
|
};
|
|
6675
6708
|
}
|
|
6676
6709
|
wrapNodeProviderWithRepositories(e, t) {
|
|
6677
|
-
return t && t.length > 0 ?
|
|
6678
|
-
new
|
|
6679
|
-
new
|
|
6710
|
+
return t && t.length > 0 ? De.wrap(
|
|
6711
|
+
new vr([
|
|
6712
|
+
new Ae(t, {
|
|
6680
6713
|
mergingProcessor: this.mergingProcessor
|
|
6681
6714
|
}),
|
|
6682
6715
|
e
|
|
6683
6716
|
])
|
|
6684
|
-
) :
|
|
6717
|
+
) : De.wrap(e);
|
|
6685
6718
|
}
|
|
6686
6719
|
combineWithGlobalLimits(e) {
|
|
6687
|
-
return this.globalLimits == F ? e : e == F ? this.globalLimits :
|
|
6720
|
+
return this.globalLimits == F ? e : e == F ? this.globalLimits : it.of(this.globalLimits, e);
|
|
6688
6721
|
}
|
|
6689
6722
|
}
|
|
6690
6723
|
const Wi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6691
6724
|
__proto__: null,
|
|
6692
6725
|
Blue: Yi
|
|
6693
6726
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
6694
|
-
class Cn extends
|
|
6727
|
+
class Cn extends Vr {
|
|
6695
6728
|
blueIdToContentMap = /* @__PURE__ */ new Map();
|
|
6696
6729
|
blueIdToMultipleDocumentsMap = /* @__PURE__ */ new Map();
|
|
6697
6730
|
preprocessor;
|
|
6698
6731
|
storageService;
|
|
6699
6732
|
constructor(e = []) {
|
|
6700
6733
|
super();
|
|
6701
|
-
const t = new
|
|
6702
|
-
this.preprocessor = (r) => t.preprocessWithDefaultBlue(r), this.storageService = new
|
|
6734
|
+
const t = new Le({ nodeProvider: this });
|
|
6735
|
+
this.preprocessor = (r) => t.preprocessWithDefaultBlue(r), this.storageService = new qs({
|
|
6703
6736
|
nodeProvider: this
|
|
6704
6737
|
}), e.forEach((r) => this.processNode(r));
|
|
6705
6738
|
}
|
|
@@ -6833,25 +6866,25 @@ class Cn extends Ar {
|
|
|
6833
6866
|
}
|
|
6834
6867
|
}
|
|
6835
6868
|
export {
|
|
6836
|
-
|
|
6869
|
+
ts as Base58Sha256Provider,
|
|
6837
6870
|
Cn as BasicNodeProvider,
|
|
6838
6871
|
Yi as Blue,
|
|
6839
6872
|
M as BlueIdCalculator,
|
|
6840
6873
|
yn as BlueIdToCid,
|
|
6841
6874
|
u as BlueNode,
|
|
6842
6875
|
H as BlueNodeTypeSchema,
|
|
6843
|
-
|
|
6844
|
-
|
|
6876
|
+
pt as JsonCanonicalizer,
|
|
6877
|
+
At as Limits,
|
|
6845
6878
|
de as Merger,
|
|
6846
6879
|
Pn as MergingProcessors,
|
|
6847
|
-
|
|
6880
|
+
js as NodeResolver,
|
|
6848
6881
|
b as Nodes,
|
|
6849
6882
|
nn as Properties,
|
|
6850
6883
|
J as ResolvedBlueNode,
|
|
6851
|
-
|
|
6884
|
+
ke as SemanticIdentityService,
|
|
6852
6885
|
_s as TypeSchemaResolver,
|
|
6853
6886
|
gn as applyBlueNodePatch,
|
|
6854
|
-
|
|
6887
|
+
rt as baseBlueObjectSchema,
|
|
6855
6888
|
mn as blueDescriptionField,
|
|
6856
6889
|
In as blueIdField,
|
|
6857
6890
|
on as blueIdSchema,
|
|
@@ -6859,44 +6892,44 @@ export {
|
|
|
6859
6892
|
Tn as blueNodeField,
|
|
6860
6893
|
cn as blueObjectBooleanValueSchema,
|
|
6861
6894
|
an as blueObjectNumberValueSchema,
|
|
6862
|
-
|
|
6895
|
+
Oe as blueObjectSchema,
|
|
6863
6896
|
un as blueObjectStringListItemsSchema,
|
|
6864
6897
|
ln as blueObjectStringValueSchema,
|
|
6865
|
-
|
|
6898
|
+
Vt as createNodeProvider,
|
|
6866
6899
|
Ft as enrichWithBlueId,
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6900
|
+
vs as getBlueDescriptionAnnotation,
|
|
6901
|
+
Ps as getBlueIdAnnotation,
|
|
6902
|
+
Ss as getBlueNameAnnotation,
|
|
6903
|
+
Es as getBlueNodeAnnotation,
|
|
6871
6904
|
wn as getBlueObjectItems,
|
|
6872
6905
|
bn as getBlueObjectProperties,
|
|
6873
6906
|
En as getBlueObjectTypeLabel,
|
|
6874
6907
|
Sn as getBlueObjectValue,
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6908
|
+
Cs as getTypeBlueIdAnnotation,
|
|
6909
|
+
kr as hasBlueObjectBlueIdDefined,
|
|
6910
|
+
Yr as hasBlueObjectItemsDefined,
|
|
6878
6911
|
hn as hasBlueObjectNameDefined,
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6912
|
+
Wr as hasBlueObjectTypeDefined,
|
|
6913
|
+
Gr as hasBlueObjectValueDefined,
|
|
6914
|
+
ht as isBigDecimalNumber,
|
|
6882
6915
|
oe as isBigIntegerNumber,
|
|
6883
6916
|
C as isBigNumber,
|
|
6884
|
-
|
|
6917
|
+
gr as isBlueNodeSchema,
|
|
6885
6918
|
dn as isBlueObject,
|
|
6886
|
-
|
|
6919
|
+
pi as isBlueObjectResolved,
|
|
6887
6920
|
pn as isGivenBlueObjectTypeSchema,
|
|
6888
|
-
|
|
6889
|
-
|
|
6921
|
+
ur as isJsonBlueArray,
|
|
6922
|
+
cr as isJsonBlueObject,
|
|
6890
6923
|
fn as isJsonBlueValue,
|
|
6891
|
-
|
|
6892
|
-
|
|
6924
|
+
Ye as isUrl,
|
|
6925
|
+
Je as jsonBlueValueSchema,
|
|
6893
6926
|
Nn as normalizeToBlueObject,
|
|
6894
6927
|
jt as resolveBlueObjectItems,
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6928
|
+
Is as withBlueDescription,
|
|
6929
|
+
Bs as withBlueId,
|
|
6930
|
+
ws as withBlueName,
|
|
6931
|
+
bs as withBlueNode,
|
|
6899
6932
|
Bn as withTypeBlueId,
|
|
6900
|
-
|
|
6933
|
+
ks as yamlBlueDump,
|
|
6901
6934
|
ae as yamlBlueParse
|
|
6902
6935
|
};
|