@blue-labs/language 1.24.0 → 1.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -5
- package/dist/index.mjs +182 -182
- package/dist/lib/utils/CryptoEnvironment.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var u = (r, e, t) =>
|
|
4
|
-
import { isNullable as N, isNonNullable as d, jsonPrimitiveSchema as
|
|
5
|
-
import { z as f, ZodOptional as
|
|
1
|
+
var Ft = Object.defineProperty;
|
|
2
|
+
var Vt = (r, e, t) => e in r ? Ft(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var u = (r, e, t) => Vt(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { isNullable as N, isNonNullable as d, jsonPrimitiveSchema as Dt, isReadonlyArray as X, isJsonPrimitive as ke, isPreciseNumberString as st } from "@blue-labs/shared-utils";
|
|
5
|
+
import { z as f, ZodOptional as it, ZodNullable as ot, ZodReadonly as ct, ZodBranded as lt, ZodEffects as ue, ZodLazy as fe, ZodString as k, ZodEnum as Ot, ZodNativeEnum as jt, ZodNumber as _, ZodBoolean as ce, ZodBigInt as le, ZodAny as at, ZodObject as Oe, ZodRecord as je, ZodMap as ut, ZodUnknown as ft, ZodIntersection as Rt, ZodUnion as xt } from "zod";
|
|
6
6
|
import q from "bs58";
|
|
7
7
|
import x from "big.js";
|
|
8
|
-
import { isObject as
|
|
9
|
-
import { sha256 as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
8
|
+
import { isObject as Re, isArray as Te, isString as _e, omit as dt, pascal as Ut, map as $t } from "radash";
|
|
9
|
+
import { sha256 as Mt } from "js-sha256";
|
|
10
|
+
import Se from "crypto";
|
|
11
|
+
import Lt from "base32.js";
|
|
12
12
|
import Z from "js-yaml";
|
|
13
|
-
class
|
|
13
|
+
class Zt {
|
|
14
14
|
static get(e, t, n, s = !0) {
|
|
15
15
|
if (N(t) || !t.startsWith("/"))
|
|
16
16
|
throw new Error(`Invalid path: ${t}`);
|
|
@@ -138,38 +138,38 @@ class A extends x {
|
|
|
138
138
|
super(e);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
const Y = "name", G = "description", de = "type",
|
|
141
|
+
const Y = "name", G = "description", de = "type", Ye = "itemType", Ge = "keyType", ze = "valueType", we = "value", Je = "items", L = "blueId", He = "blue", ve = "contracts", kt = [
|
|
142
142
|
Y,
|
|
143
143
|
G,
|
|
144
144
|
de,
|
|
145
|
-
ke,
|
|
146
|
-
_e,
|
|
147
145
|
Ye,
|
|
148
|
-
we,
|
|
149
146
|
Ge,
|
|
150
|
-
L,
|
|
151
147
|
ze,
|
|
148
|
+
we,
|
|
149
|
+
Je,
|
|
150
|
+
L,
|
|
151
|
+
He,
|
|
152
152
|
ve
|
|
153
|
-
],
|
|
154
|
-
kt,
|
|
153
|
+
], _t = "Text", Yt = "Double", Gt = "Integer", zt = "Boolean", Jt = "List", Ht = "Dictionary", Wt = [
|
|
155
154
|
_t,
|
|
156
155
|
Yt,
|
|
157
|
-
Gt
|
|
158
|
-
|
|
156
|
+
Gt,
|
|
157
|
+
zt
|
|
158
|
+
], ht = [...Wt, Jt, Ht], re = "F92yo19rCcbBoBSpUA5LRxpfDejJDAaP1PRxxbWAraVP", ne = "68ryJtnmui4j5rCZWUnkZ3DChtmEb7Z9F8atn1mBSM3L", se = "DHmxTkFbXePZHCHCYmQr2dSzcNLcryFVjXVHkdQrrZr8", ie = "EL6AjrbJsxTWRTPzY8WR8Y2zAMXRbydQj83PcZwuAHbo", Kt = "G8wmfjEqugPEEXByMYWJXiEdbLToPRWNQEekNxrxfQWB", Xt = "294NBTj2mFRL3RB4kDRUSckwGg7Kzj6T8CTAFeR1kcSA", qt = [
|
|
159
159
|
re,
|
|
160
160
|
ne,
|
|
161
161
|
se,
|
|
162
162
|
ie
|
|
163
|
-
],
|
|
164
|
-
...
|
|
165
|
-
|
|
166
|
-
|
|
163
|
+
], We = [
|
|
164
|
+
...qt,
|
|
165
|
+
Kt,
|
|
166
|
+
Xt
|
|
167
167
|
];
|
|
168
168
|
Object.fromEntries(
|
|
169
|
-
|
|
169
|
+
ht.map((r, e) => [r, We[e]])
|
|
170
170
|
);
|
|
171
171
|
Object.fromEntries(
|
|
172
|
-
|
|
172
|
+
We.map((r, e) => [r, ht[e]])
|
|
173
173
|
);
|
|
174
174
|
const O = class O {
|
|
175
175
|
constructor(e) {
|
|
@@ -287,7 +287,7 @@ const O = class O {
|
|
|
287
287
|
return this.inlineValue = e, this;
|
|
288
288
|
}
|
|
289
289
|
get(e, t) {
|
|
290
|
-
return
|
|
290
|
+
return Zt.get(this, e, t);
|
|
291
291
|
}
|
|
292
292
|
clone() {
|
|
293
293
|
var t, n, s, i, o, c;
|
|
@@ -367,21 +367,21 @@ const Pn = f.string().max(M.MAX_BLUE_ID_LENGTH, {
|
|
|
367
367
|
value: f.boolean().optional()
|
|
368
368
|
}), Cn = Be.extend({
|
|
369
369
|
items: f.array(f.string()).optional()
|
|
370
|
-
}), Fn = (r) => Q.safeParse(r).success,
|
|
370
|
+
}), Fn = (r) => Q.safeParse(r).success, Qt = (r) => d(r) && "blueId" in r && d(r.blueId), Vn = (r) => d(r) && "name" in r && d(r.name), er = (r) => d(r) && "items" in r && d(r.items), tr = (r) => d(r) && "type" in r && d(r.type), rr = (r) => d(r) && "value" in r && d(r.value), Dn = (r, e) => r.required({ type: !0 }).safeParse(e).success, C = (r) => r instanceof x, ee = (r) => C(r) && r instanceof B, nr = (r) => C(r) && r instanceof A, sr = f.lazy(
|
|
371
371
|
() => f.record(he)
|
|
372
|
-
),
|
|
372
|
+
), ir = f.lazy(
|
|
373
373
|
() => f.union([
|
|
374
374
|
f.array(he),
|
|
375
375
|
f.array(he).readonly()
|
|
376
376
|
])
|
|
377
377
|
), he = f.lazy(
|
|
378
378
|
() => f.union([
|
|
379
|
-
|
|
380
|
-
nr,
|
|
379
|
+
Dt,
|
|
381
380
|
sr,
|
|
381
|
+
ir,
|
|
382
382
|
f.instanceof(x)
|
|
383
383
|
])
|
|
384
|
-
),
|
|
384
|
+
), pt = (r) => Re(r) && !Te(r) && !X(r) && !C(r), gt = (r) => Te(r) || X(r), On = (r) => gt(r) || pt(r) || C(r) || ke(r);
|
|
385
385
|
class p {
|
|
386
386
|
static deserialize(e) {
|
|
387
387
|
return p.handleNode(e);
|
|
@@ -391,7 +391,7 @@ class p {
|
|
|
391
391
|
throw new Error(
|
|
392
392
|
"This is not a valid JSON-like value. Found 'undefined' as a value."
|
|
393
393
|
);
|
|
394
|
-
if (
|
|
394
|
+
if (pt(e)) {
|
|
395
395
|
const t = new l(), n = {}, s = {};
|
|
396
396
|
return Object.entries(e).forEach(([i, o]) => {
|
|
397
397
|
switch (i) {
|
|
@@ -418,13 +418,13 @@ class p {
|
|
|
418
418
|
case de:
|
|
419
419
|
t.setType(p.handleNode(o));
|
|
420
420
|
break;
|
|
421
|
-
case
|
|
421
|
+
case Ye:
|
|
422
422
|
t.setItemType(p.handleNode(o));
|
|
423
423
|
break;
|
|
424
|
-
case
|
|
424
|
+
case Ge:
|
|
425
425
|
t.setKeyType(p.handleNode(o));
|
|
426
426
|
break;
|
|
427
|
-
case
|
|
427
|
+
case ze:
|
|
428
428
|
t.setValueType(p.handleNode(o));
|
|
429
429
|
break;
|
|
430
430
|
case we:
|
|
@@ -435,14 +435,14 @@ class p {
|
|
|
435
435
|
throw new Error(`The ${L} field must be a string.`);
|
|
436
436
|
t.setBlueId(o);
|
|
437
437
|
break;
|
|
438
|
-
case
|
|
438
|
+
case Je:
|
|
439
439
|
t.setItems(p.handleArray(o));
|
|
440
440
|
break;
|
|
441
|
-
case
|
|
441
|
+
case He:
|
|
442
442
|
t.setBlue(p.handleNode(o));
|
|
443
443
|
break;
|
|
444
444
|
case ve:
|
|
445
|
-
|
|
445
|
+
Re(o) && !Te(o) && !X(o) && Object.entries(o).forEach(([c, a]) => {
|
|
446
446
|
s[c] = p.handleNode(a);
|
|
447
447
|
});
|
|
448
448
|
break;
|
|
@@ -452,7 +452,7 @@ class p {
|
|
|
452
452
|
}
|
|
453
453
|
}), Object.keys(n).length > 0 && t.setProperties(n), Object.keys(s).length > 0 && t.setContracts(s), t;
|
|
454
454
|
} else {
|
|
455
|
-
if (
|
|
455
|
+
if (gt(e))
|
|
456
456
|
return new l().setItems(p.handleArray(e));
|
|
457
457
|
{
|
|
458
458
|
const t = e;
|
|
@@ -479,7 +479,7 @@ class p {
|
|
|
479
479
|
}
|
|
480
480
|
static handleArray(e) {
|
|
481
481
|
if (e != null) {
|
|
482
|
-
if (
|
|
482
|
+
if (Re(e) && !Array.isArray(e))
|
|
483
483
|
return [p.handleNode(e)];
|
|
484
484
|
if (Array.isArray(e))
|
|
485
485
|
return e.map(p.handleNode);
|
|
@@ -487,12 +487,12 @@ class p {
|
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
|
-
function
|
|
490
|
+
function or(r) {
|
|
491
491
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
492
492
|
}
|
|
493
|
-
var
|
|
494
|
-
function
|
|
495
|
-
return
|
|
493
|
+
var Ne, qe;
|
|
494
|
+
function cr() {
|
|
495
|
+
return qe || (qe = 1, Ne = function r(e) {
|
|
496
496
|
if (typeof e == "number" && isNaN(e))
|
|
497
497
|
throw new Error("NaN is not allowed");
|
|
498
498
|
if (typeof e == "number" && !isFinite(e))
|
|
@@ -503,16 +503,16 @@ function or() {
|
|
|
503
503
|
const i = n.length === 0 ? "" : ",";
|
|
504
504
|
return `${n}${i}${r(s)}:${r(e[s])}`;
|
|
505
505
|
}, "")}}`;
|
|
506
|
-
}),
|
|
506
|
+
}), Ne;
|
|
507
507
|
}
|
|
508
|
-
var
|
|
509
|
-
const
|
|
510
|
-
class
|
|
508
|
+
var lr = cr();
|
|
509
|
+
const ar = /* @__PURE__ */ or(lr);
|
|
510
|
+
class ur {
|
|
511
511
|
static canonicalize(e) {
|
|
512
|
-
return
|
|
512
|
+
return ar(e);
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
const
|
|
515
|
+
const Ce = typeof process < "u" && process.versions != null && process.versions.node != null, me = class me {
|
|
516
516
|
constructor() {
|
|
517
517
|
u(this, "browserCrypto");
|
|
518
518
|
this.browserCrypto = this.initBrowserCrypto();
|
|
@@ -521,23 +521,23 @@ const ur = typeof process < "u" && process.versions != null && process.versions.
|
|
|
521
521
|
return this.instance || (this.instance = new me()), this.instance;
|
|
522
522
|
}
|
|
523
523
|
initBrowserCrypto() {
|
|
524
|
-
return
|
|
524
|
+
return Ce ? null : "crypto" in globalThis ? globalThis.crypto : null;
|
|
525
525
|
}
|
|
526
526
|
hasNodeCrypto() {
|
|
527
|
-
return !!
|
|
527
|
+
return Ce && !!Se && typeof Se.createHash == "function";
|
|
528
528
|
}
|
|
529
529
|
getBrowserCrypto() {
|
|
530
530
|
return this.browserCrypto;
|
|
531
531
|
}
|
|
532
532
|
getNodeCrypto() {
|
|
533
|
-
return
|
|
533
|
+
return Ce ? Se : null;
|
|
534
534
|
}
|
|
535
535
|
};
|
|
536
536
|
u(me, "instance");
|
|
537
|
-
let
|
|
537
|
+
let xe = me;
|
|
538
538
|
class fr {
|
|
539
539
|
constructor() {
|
|
540
|
-
u(this, "cryptoEnv",
|
|
540
|
+
u(this, "cryptoEnv", xe.getInstance());
|
|
541
541
|
}
|
|
542
542
|
applySync(e) {
|
|
543
543
|
const t = this.canonicalizeInput(e), n = this.cryptoEnv.hasNodeCrypto() ? this.sha256Sync(t) : this.sha256SyncBrowser(t);
|
|
@@ -548,7 +548,7 @@ class fr {
|
|
|
548
548
|
return q.encode(new Uint8Array(n));
|
|
549
549
|
}
|
|
550
550
|
canonicalizeInput(e) {
|
|
551
|
-
const t =
|
|
551
|
+
const t = ur.canonicalize(e);
|
|
552
552
|
if (typeof t != "string")
|
|
553
553
|
throw new Error("Canonized value must be a string");
|
|
554
554
|
return t;
|
|
@@ -562,7 +562,7 @@ class fr {
|
|
|
562
562
|
return t.createHash("sha256").update(e).digest();
|
|
563
563
|
}
|
|
564
564
|
sha256SyncBrowser(e) {
|
|
565
|
-
return
|
|
565
|
+
return Mt.arrayBuffer(e);
|
|
566
566
|
}
|
|
567
567
|
async sha256Async(e) {
|
|
568
568
|
if (this.cryptoEnv.hasNodeCrypto())
|
|
@@ -608,20 +608,20 @@ class T {
|
|
|
608
608
|
D !== null && (a[de] = { [L]: D });
|
|
609
609
|
} else g !== void 0 && (a[de] = T.get(g, t));
|
|
610
610
|
const b = e.getItemType();
|
|
611
|
-
b !== void 0 && (a[
|
|
611
|
+
b !== void 0 && (a[Ye] = T.get(b, t));
|
|
612
612
|
const I = e.getKeyType();
|
|
613
|
-
I !== void 0 && (a[
|
|
613
|
+
I !== void 0 && (a[Ge] = T.get(I, t));
|
|
614
614
|
const m = e.getValueType();
|
|
615
|
-
m !== void 0 && (a[
|
|
615
|
+
m !== void 0 && (a[ze] = T.get(m, t)), s !== void 0 && (a[we] = s), i !== void 0 && (a[Je] = i);
|
|
616
616
|
const y = e.getBlueId();
|
|
617
617
|
y !== void 0 && (a[L] = y);
|
|
618
618
|
const h = e.getBlue();
|
|
619
|
-
h !== void 0 && (a[
|
|
619
|
+
h !== void 0 && (a[He] = h);
|
|
620
620
|
const w = e.getContracts();
|
|
621
621
|
if (w !== void 0) {
|
|
622
622
|
const D = {};
|
|
623
|
-
Object.entries(w).forEach(([Ae,
|
|
624
|
-
D[Ae] = T.get(
|
|
623
|
+
Object.entries(w).forEach(([Ae, Ct]) => {
|
|
624
|
+
D[Ae] = T.get(Ct, t);
|
|
625
625
|
}), a[ve] = D;
|
|
626
626
|
}
|
|
627
627
|
const V = e.getProperties();
|
|
@@ -644,7 +644,7 @@ class T {
|
|
|
644
644
|
return typeof e == "string" ? re : C(e) ? ee(e) ? se : ne : typeof e == "boolean" ? ie : null;
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
|
-
const dr = (r) =>
|
|
647
|
+
const dr = (r) => ke(r) && d(r), R = class R {
|
|
648
648
|
constructor(e) {
|
|
649
649
|
u(this, "hashProvider");
|
|
650
650
|
this.hashProvider = e;
|
|
@@ -737,7 +737,7 @@ const dr = (r) => Le(r) && d(r), R = class R {
|
|
|
737
737
|
// Method to clean the input structure by removing null or undefined values
|
|
738
738
|
cleanStructure(e) {
|
|
739
739
|
if (e != null) {
|
|
740
|
-
if (
|
|
740
|
+
if (ke(e) || C(e))
|
|
741
741
|
return e;
|
|
742
742
|
if (Array.isArray(e) || X(e)) {
|
|
743
743
|
const t = e.map((n) => this.cleanStructure(n)).filter(d);
|
|
@@ -761,7 +761,7 @@ class jn {
|
|
|
761
761
|
const t = q.decode(e), n = new Uint8Array(2 + t.length);
|
|
762
762
|
n[0] = 18, n[1] = 32, n.set(t, 2);
|
|
763
763
|
const s = new Uint8Array(2 + n.length);
|
|
764
|
-
return s[0] = 1, s[1] = 85, s.set(n, 2), "b" + new
|
|
764
|
+
return s[0] = 1, s[1] = 85, s.set(n, 2), "b" + new Lt.Encoder({ type: "rfc4648", lc: !0 }).write(s).finalize().replace(/=/g, "");
|
|
765
765
|
}
|
|
766
766
|
}
|
|
767
767
|
class S {
|
|
@@ -827,7 +827,7 @@ function z(r) {
|
|
|
827
827
|
);
|
|
828
828
|
return e;
|
|
829
829
|
}
|
|
830
|
-
function
|
|
830
|
+
function yt(r, e, t, n = !0) {
|
|
831
831
|
switch (e) {
|
|
832
832
|
case "name":
|
|
833
833
|
return t ? n ? r.getName() ?? null : r : r.getName();
|
|
@@ -857,9 +857,9 @@ function gt(r, e, t, n = !0) {
|
|
|
857
857
|
return;
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
|
-
function
|
|
860
|
+
function Qe(r, e, t = !0) {
|
|
861
861
|
if (r instanceof l) {
|
|
862
|
-
const n =
|
|
862
|
+
const n = yt(
|
|
863
863
|
r,
|
|
864
864
|
e,
|
|
865
865
|
!0,
|
|
@@ -903,14 +903,14 @@ function H(r, e) {
|
|
|
903
903
|
};
|
|
904
904
|
let t = r;
|
|
905
905
|
for (let s = 0; s < e.length - 1; ++s) {
|
|
906
|
-
const i = e[s], o =
|
|
906
|
+
const i = e[s], o = Qe(t, i);
|
|
907
907
|
if (o === void 0)
|
|
908
908
|
throw new Error(`Cannot resolve '/${e.slice(0, s + 1).join("/")}'`);
|
|
909
909
|
t = o;
|
|
910
910
|
}
|
|
911
911
|
const n = e[e.length - 1];
|
|
912
912
|
if (t instanceof l) {
|
|
913
|
-
const s =
|
|
913
|
+
const s = Qe(t, n, !1);
|
|
914
914
|
if ((typeof s != "object" || s === null || j(s)) && !(s instanceof l) && !Array.isArray(s) && ["name", "description", "value", "blueId"].includes(n))
|
|
915
915
|
return {
|
|
916
916
|
parent: t,
|
|
@@ -923,10 +923,10 @@ function H(r, e) {
|
|
|
923
923
|
key: Array.isArray(t) ? z(n) : n
|
|
924
924
|
};
|
|
925
925
|
}
|
|
926
|
-
function
|
|
926
|
+
function Ke(r, e) {
|
|
927
927
|
var t;
|
|
928
928
|
if (r instanceof l) {
|
|
929
|
-
const n = e, s =
|
|
929
|
+
const n = e, s = yt(r, n, !1);
|
|
930
930
|
if (s !== void 0 || [
|
|
931
931
|
"name",
|
|
932
932
|
"description",
|
|
@@ -954,19 +954,19 @@ function v(r) {
|
|
|
954
954
|
if (r instanceof l) return r;
|
|
955
955
|
if (r === null || typeof r == "string" || typeof r == "number" || typeof r == "boolean" || j(r))
|
|
956
956
|
return p.deserialize(r);
|
|
957
|
-
const e =
|
|
957
|
+
const e = Ue(r);
|
|
958
958
|
return p.deserialize(e);
|
|
959
959
|
}
|
|
960
|
-
function
|
|
960
|
+
function Ue(r) {
|
|
961
961
|
if (r === void 0) return null;
|
|
962
962
|
if (r === null || typeof r != "object") return r;
|
|
963
|
-
if (Array.isArray(r)) return r.map(
|
|
963
|
+
if (Array.isArray(r)) return r.map(Ue);
|
|
964
964
|
const e = {};
|
|
965
965
|
for (const [t, n] of Object.entries(r))
|
|
966
|
-
e[t] =
|
|
966
|
+
e[t] = Ue(n);
|
|
967
967
|
return e;
|
|
968
968
|
}
|
|
969
|
-
function
|
|
969
|
+
function Xe(r, e, t) {
|
|
970
970
|
if (r instanceof l) {
|
|
971
971
|
const n = e;
|
|
972
972
|
switch (n) {
|
|
@@ -1078,7 +1078,7 @@ function pe(r, e, t, n) {
|
|
|
1078
1078
|
return;
|
|
1079
1079
|
}
|
|
1080
1080
|
if (r instanceof l) {
|
|
1081
|
-
e === "-" || typeof e == "number" && !isNaN(e) || typeof e == "string" && /^\d+$/.test(e) ? pr(r, e, v(t), n) :
|
|
1081
|
+
e === "-" || typeof e == "number" && !isNaN(e) || typeof e == "string" && /^\d+$/.test(e) ? pr(r, e, v(t), n) : Xe(r, e, t);
|
|
1082
1082
|
return;
|
|
1083
1083
|
}
|
|
1084
1084
|
if (U(r)) {
|
|
@@ -1102,17 +1102,17 @@ function gr(r, e) {
|
|
|
1102
1102
|
return;
|
|
1103
1103
|
}
|
|
1104
1104
|
}
|
|
1105
|
-
|
|
1105
|
+
Xe(r, e, void 0);
|
|
1106
1106
|
} else U(r) && delete r[e];
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1108
|
+
function $e(r) {
|
|
1109
1109
|
if (r instanceof l) return r.clone();
|
|
1110
1110
|
if (Array.isArray(r))
|
|
1111
|
-
return r.map((t) =>
|
|
1111
|
+
return r.map((t) => $e(t));
|
|
1112
1112
|
if (U(r)) {
|
|
1113
1113
|
const e = {};
|
|
1114
1114
|
return Object.keys(r).forEach((t) => {
|
|
1115
|
-
e[t] =
|
|
1115
|
+
e[t] = $e(r[t]);
|
|
1116
1116
|
}), e;
|
|
1117
1117
|
}
|
|
1118
1118
|
return r;
|
|
@@ -1130,11 +1130,11 @@ function $(r, e) {
|
|
|
1130
1130
|
}
|
|
1131
1131
|
return !1;
|
|
1132
1132
|
}
|
|
1133
|
-
function
|
|
1133
|
+
function mt(r, e) {
|
|
1134
1134
|
const { parent: t, key: n } = H(r, J(e));
|
|
1135
|
-
return
|
|
1135
|
+
return Ke(t, n);
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1137
|
+
function It(r, e, t) {
|
|
1138
1138
|
const n = J(e);
|
|
1139
1139
|
if (n.length === 0 && e === "/") {
|
|
1140
1140
|
const o = v(t);
|
|
@@ -1167,9 +1167,9 @@ function mr(r, e, t) {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
const { parent: s, key: i, actualTarget: o } = H(r, n);
|
|
1169
1169
|
if (o !== void 0 && s instanceof l)
|
|
1170
|
-
|
|
1170
|
+
Xe(s, i, t);
|
|
1171
1171
|
else {
|
|
1172
|
-
const c =
|
|
1172
|
+
const c = Ke(s, i), a = Array.isArray(s) || s instanceof l && s.getItems() && (typeof i == "number" || typeof i == "string" && /^\d+$/.test(i));
|
|
1173
1173
|
if (c === void 0) {
|
|
1174
1174
|
if (a)
|
|
1175
1175
|
throw new Error(
|
|
@@ -1181,7 +1181,7 @@ function mr(r, e, t) {
|
|
|
1181
1181
|
}
|
|
1182
1182
|
return !0;
|
|
1183
1183
|
}
|
|
1184
|
-
function
|
|
1184
|
+
function bt(r, e) {
|
|
1185
1185
|
const t = J(e);
|
|
1186
1186
|
if (t.length === 0 && e === "/")
|
|
1187
1187
|
return r.setValue(null), r.setItems(void 0), r.setProperties(void 0), !0;
|
|
@@ -1189,17 +1189,17 @@ function It(r, e) {
|
|
|
1189
1189
|
return gr(n, s), !0;
|
|
1190
1190
|
}
|
|
1191
1191
|
function Ir(r, e, t) {
|
|
1192
|
-
const n =
|
|
1193
|
-
return
|
|
1192
|
+
const n = $e(mt(r, e));
|
|
1193
|
+
return It(r, t, n), !0;
|
|
1194
1194
|
}
|
|
1195
1195
|
function br(r, e, t) {
|
|
1196
|
-
const n = J(e), { parent: s, key: i } = H(r, n), o =
|
|
1196
|
+
const n = J(e), { parent: s, key: i } = H(r, n), o = Ke(s, i);
|
|
1197
1197
|
if (o === void 0)
|
|
1198
1198
|
throw new Error(`MOVE failed: 'from' location '${e}' does not exist.`);
|
|
1199
|
-
return
|
|
1199
|
+
return bt(r, e) ? (It(r, t, o), !0) : !1;
|
|
1200
1200
|
}
|
|
1201
1201
|
function Tr(r, e, t) {
|
|
1202
|
-
const n =
|
|
1202
|
+
const n = mt(r, e);
|
|
1203
1203
|
let s = t;
|
|
1204
1204
|
if (n instanceof l)
|
|
1205
1205
|
if ((t === null || typeof t == "string" || typeof t == "number" || typeof t == "boolean" || j(t)) && (n.isInlineValue() || n.getValue() !== void 0)) {
|
|
@@ -1232,7 +1232,7 @@ function wr(r, e) {
|
|
|
1232
1232
|
case "replace":
|
|
1233
1233
|
return mr(r, e.path, e.val);
|
|
1234
1234
|
case "remove":
|
|
1235
|
-
return
|
|
1235
|
+
return bt(r, e.path);
|
|
1236
1236
|
case "copy":
|
|
1237
1237
|
return Ir(r, e.from, e.path);
|
|
1238
1238
|
case "move":
|
|
@@ -1245,7 +1245,7 @@ function Rn(r, e, t = !1) {
|
|
|
1245
1245
|
const n = t ? r : r.clone();
|
|
1246
1246
|
return wr(n, e), n;
|
|
1247
1247
|
}
|
|
1248
|
-
const
|
|
1248
|
+
const Fe = Symbol.for("zod-schema-annotations");
|
|
1249
1249
|
function vr() {
|
|
1250
1250
|
if (typeof globalThis < "u") return globalThis;
|
|
1251
1251
|
if (typeof global < "u") return global;
|
|
@@ -1253,15 +1253,15 @@ function vr() {
|
|
|
1253
1253
|
if (typeof self < "u") return self;
|
|
1254
1254
|
throw new Error("Unable to locate global object");
|
|
1255
1255
|
}
|
|
1256
|
-
function
|
|
1256
|
+
function Tt() {
|
|
1257
1257
|
const r = vr();
|
|
1258
|
-
return
|
|
1258
|
+
return Fe in r || (r[Fe] = /* @__PURE__ */ new WeakMap()), r[Fe];
|
|
1259
1259
|
}
|
|
1260
1260
|
function W(r, e) {
|
|
1261
|
-
const t =
|
|
1261
|
+
const t = Tt(), n = t.get(r) || {};
|
|
1262
1262
|
return t.set(r, { ...n, ...e }), r;
|
|
1263
1263
|
}
|
|
1264
|
-
const E = (r) =>
|
|
1264
|
+
const E = (r) => Tt().get(r), Br = (r) => (e) => {
|
|
1265
1265
|
const t = E(e);
|
|
1266
1266
|
return W(e, {
|
|
1267
1267
|
...t,
|
|
@@ -1269,7 +1269,7 @@ const E = (r) => bt().get(r), Br = (r) => (e) => {
|
|
|
1269
1269
|
});
|
|
1270
1270
|
}, Er = (r) => {
|
|
1271
1271
|
const e = E(r);
|
|
1272
|
-
return d(e) &&
|
|
1272
|
+
return d(e) && _e(e.blueDescription) ? e.blueDescription : null;
|
|
1273
1273
|
}, xn = (r) => Br(r)(f.string().optional()), Pr = f.union([f.string(), f.boolean()]), Ar = (r) => (e) => {
|
|
1274
1274
|
const t = E(e);
|
|
1275
1275
|
return W(e, {
|
|
@@ -1287,7 +1287,7 @@ const E = (r) => bt().get(r), Br = (r) => (e) => {
|
|
|
1287
1287
|
});
|
|
1288
1288
|
}, Cr = (r) => {
|
|
1289
1289
|
const e = E(r);
|
|
1290
|
-
return d(e) &&
|
|
1290
|
+
return d(e) && _e(e.blueName) ? e.blueName : null;
|
|
1291
1291
|
}, $n = (r) => {
|
|
1292
1292
|
const e = f.string().optional();
|
|
1293
1293
|
return Nr(r)(e);
|
|
@@ -1300,24 +1300,24 @@ const E = (r) => bt().get(r), Br = (r) => (e) => {
|
|
|
1300
1300
|
}, Vr = (r) => {
|
|
1301
1301
|
const e = E(r);
|
|
1302
1302
|
return d(e) && d(e.blueNode) && e.blueNode === !0 ? e.blueNode : null;
|
|
1303
|
-
},
|
|
1303
|
+
}, wt = (r) => !!Vr(r), Mn = () => {
|
|
1304
1304
|
const r = f.instanceof(l);
|
|
1305
1305
|
return Fr()(r);
|
|
1306
|
-
},
|
|
1306
|
+
}, Me = "extendedFrom", Dr = ({
|
|
1307
1307
|
schema: r,
|
|
1308
1308
|
baseSchema: e
|
|
1309
1309
|
}) => {
|
|
1310
1310
|
const t = E(r) || {};
|
|
1311
1311
|
return W(r, {
|
|
1312
1312
|
...t,
|
|
1313
|
-
[
|
|
1313
|
+
[Me]: e
|
|
1314
1314
|
});
|
|
1315
1315
|
}, Or = (r) => {
|
|
1316
1316
|
const e = E(r);
|
|
1317
|
-
return d(e) && e[
|
|
1318
|
-
},
|
|
1317
|
+
return d(e) && e[Me] ? e[Me] : null;
|
|
1318
|
+
}, vt = (r, e) => {
|
|
1319
1319
|
const t = Or(r);
|
|
1320
|
-
return N(t) ? !1 : (t == null ? void 0 : t._def) === (e == null ? void 0 : e._def) ? !0 :
|
|
1320
|
+
return N(t) ? !1 : (t == null ? void 0 : t._def) === (e == null ? void 0 : e._def) ? !0 : vt(t, e);
|
|
1321
1321
|
}, jr = (r) => new Proxy(r, {
|
|
1322
1322
|
get(e, t, n) {
|
|
1323
1323
|
return t === "extend" ? function(...s) {
|
|
@@ -1382,13 +1382,13 @@ class P {
|
|
|
1382
1382
|
if (!d(e))
|
|
1383
1383
|
return !1;
|
|
1384
1384
|
const n = P.unwrapSchema(e), s = P.unwrapSchema(t);
|
|
1385
|
-
return
|
|
1385
|
+
return vt(n, s);
|
|
1386
1386
|
}
|
|
1387
1387
|
static isWrapperType(e) {
|
|
1388
|
-
return e instanceof
|
|
1388
|
+
return e instanceof it || e instanceof ot || e instanceof ct || e instanceof lt || e instanceof ue || e instanceof fe;
|
|
1389
1389
|
}
|
|
1390
1390
|
static unwrapSchema(e) {
|
|
1391
|
-
return
|
|
1391
|
+
return wt(e) ? e : P.isWrapperType(e) ? e instanceof ue ? P.unwrapSchema(e.innerType()) : e instanceof fe ? P.unwrapSchema(e.schema) : P.unwrapSchema(e.unwrap()) : e;
|
|
1392
1392
|
}
|
|
1393
1393
|
}
|
|
1394
1394
|
class Ur {
|
|
@@ -1420,7 +1420,7 @@ class Ur {
|
|
|
1420
1420
|
return new Map(this.blueIdMap);
|
|
1421
1421
|
}
|
|
1422
1422
|
}
|
|
1423
|
-
class
|
|
1423
|
+
class Bt {
|
|
1424
1424
|
static convertValue(e, t) {
|
|
1425
1425
|
var i;
|
|
1426
1426
|
const n = (i = e.getType()) == null ? void 0 : i.getBlueId(), s = e.getValue();
|
|
@@ -1433,7 +1433,7 @@ class vt {
|
|
|
1433
1433
|
) : ie === n || typeof s == "boolean" ? this.convertFromBoolean(!!s, t) : this.convertFromString(String(s), t);
|
|
1434
1434
|
}
|
|
1435
1435
|
static convertFromString(e, t) {
|
|
1436
|
-
if (!t || t instanceof k || t instanceof
|
|
1436
|
+
if (!t || t instanceof k || t instanceof Ot || t instanceof jt)
|
|
1437
1437
|
return e;
|
|
1438
1438
|
if (t instanceof _)
|
|
1439
1439
|
return Number(e);
|
|
@@ -1496,7 +1496,7 @@ class vt {
|
|
|
1496
1496
|
}
|
|
1497
1497
|
class $r {
|
|
1498
1498
|
convert(e, t) {
|
|
1499
|
-
return
|
|
1499
|
+
return Bt.convertValue(e, t);
|
|
1500
1500
|
}
|
|
1501
1501
|
}
|
|
1502
1502
|
class Mr {
|
|
@@ -1507,23 +1507,23 @@ class Mr {
|
|
|
1507
1507
|
* Check if the valueSchema can handle structured data (contracts should be processed specially)
|
|
1508
1508
|
*/
|
|
1509
1509
|
canHandleStructuredData(e) {
|
|
1510
|
-
return e instanceof
|
|
1510
|
+
return e instanceof at || e instanceof Oe || e instanceof je || e instanceof ut || e instanceof ft;
|
|
1511
1511
|
}
|
|
1512
1512
|
convert(e, t) {
|
|
1513
1513
|
return this.convertFields(e, t);
|
|
1514
1514
|
}
|
|
1515
1515
|
convertFields(e, t) {
|
|
1516
|
-
if (t instanceof
|
|
1516
|
+
if (t instanceof Rt) {
|
|
1517
1517
|
const n = t._def.left, s = t._def.right, i = this.convert(e, n), o = this.convert(e, s);
|
|
1518
1518
|
return { ...i, ...o };
|
|
1519
1519
|
}
|
|
1520
|
-
if (t instanceof
|
|
1520
|
+
if (t instanceof xt)
|
|
1521
1521
|
throw new Error("Union not supported");
|
|
1522
|
-
if (t instanceof
|
|
1522
|
+
if (t instanceof Oe)
|
|
1523
1523
|
return Object.keys(t.shape).reduce((s, i) => {
|
|
1524
1524
|
const o = e.getProperties(), c = t.shape[i], a = Sr(c);
|
|
1525
1525
|
if (d(a)) {
|
|
1526
|
-
const h =
|
|
1526
|
+
const h = _e(a) ? a : i, w = o == null ? void 0 : o[h], V = w ? F.calculateBlueIdSync(w) : void 0;
|
|
1527
1527
|
return s[i] = V, s;
|
|
1528
1528
|
}
|
|
1529
1529
|
const g = Cr(c);
|
|
@@ -1605,7 +1605,7 @@ class kr {
|
|
|
1605
1605
|
* Check if the valueSchema can handle structured data (contracts should be processed specially)
|
|
1606
1606
|
*/
|
|
1607
1607
|
canHandleStructuredData(e) {
|
|
1608
|
-
return e instanceof
|
|
1608
|
+
return e instanceof at || e instanceof Oe || e instanceof je || e instanceof ut || e instanceof ft;
|
|
1609
1609
|
}
|
|
1610
1610
|
convert(e, t) {
|
|
1611
1611
|
const n = t.keySchema, s = t.valueSchema, i = /* @__PURE__ */ new Map(), o = e.getName();
|
|
@@ -1635,9 +1635,9 @@ class kr {
|
|
|
1635
1635
|
return d(g) && Object.entries(g).forEach(([b, I]) => {
|
|
1636
1636
|
const m = new l().setValue(b);
|
|
1637
1637
|
m.setType(new l().setBlueId(re));
|
|
1638
|
-
const y =
|
|
1638
|
+
const y = Bt.convertValue(m, n), h = this.nodeToObjectConverter.convert(I, s);
|
|
1639
1639
|
i.set(y, h);
|
|
1640
|
-
}), t instanceof
|
|
1640
|
+
}), t instanceof je ? Object.fromEntries(i) : i;
|
|
1641
1641
|
}
|
|
1642
1642
|
}
|
|
1643
1643
|
class _r {
|
|
@@ -1697,7 +1697,7 @@ class Jr {
|
|
|
1697
1697
|
return this.converters.get(t) ?? this.complexObjectConverter;
|
|
1698
1698
|
}
|
|
1699
1699
|
isWrapperType(e) {
|
|
1700
|
-
return e instanceof
|
|
1700
|
+
return e instanceof it || e instanceof ot || e instanceof ct || e instanceof lt || e instanceof ue || e instanceof fe;
|
|
1701
1701
|
}
|
|
1702
1702
|
getSchemaTypeName(e) {
|
|
1703
1703
|
if (this.isWrapperType(e))
|
|
@@ -1718,7 +1718,7 @@ class Hr {
|
|
|
1718
1718
|
convert(e, t) {
|
|
1719
1719
|
var o;
|
|
1720
1720
|
const n = (o = this.typeSchemaResolver) == null ? void 0 : o.resolveSchema(e), s = P.unwrapSchema(t);
|
|
1721
|
-
if (
|
|
1721
|
+
if (wt(s))
|
|
1722
1722
|
return e;
|
|
1723
1723
|
let i = s;
|
|
1724
1724
|
return P.checkSchemaExtension(
|
|
@@ -1778,31 +1778,31 @@ class Kr extends Pe {
|
|
|
1778
1778
|
return this.nodeProviders;
|
|
1779
1779
|
}
|
|
1780
1780
|
}
|
|
1781
|
-
const
|
|
1782
|
-
...
|
|
1781
|
+
const Ve = Z.types.float.options, Xr = {
|
|
1782
|
+
...Ve,
|
|
1783
1783
|
construct: (r) => {
|
|
1784
1784
|
const e = r.replace(/_/g, "").toLowerCase();
|
|
1785
|
-
if (!
|
|
1785
|
+
if (!st(e))
|
|
1786
1786
|
return new A(e);
|
|
1787
|
-
if (
|
|
1788
|
-
return
|
|
1787
|
+
if (Ve.construct)
|
|
1788
|
+
return Ve.construct(r);
|
|
1789
1789
|
}
|
|
1790
|
-
}, qr = new Z.Type("tag:yaml.org,2002:float", Xr),
|
|
1791
|
-
...
|
|
1790
|
+
}, qr = new Z.Type("tag:yaml.org,2002:float", Xr), De = Z.types.int.options, Qr = {
|
|
1791
|
+
...De,
|
|
1792
1792
|
construct: (r) => {
|
|
1793
1793
|
let e = r;
|
|
1794
|
-
if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), !
|
|
1794
|
+
if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), !st(e))
|
|
1795
1795
|
return new B(e);
|
|
1796
|
-
if (
|
|
1797
|
-
return
|
|
1796
|
+
if (De.construct)
|
|
1797
|
+
return De.construct(r);
|
|
1798
1798
|
}
|
|
1799
|
-
}, en = new Z.Type("tag:yaml.org,2002:int", Qr),
|
|
1799
|
+
}, en = new Z.Type("tag:yaml.org,2002:int", Qr), Et = Z.CORE_SCHEMA.extend({
|
|
1800
1800
|
implicit: [qr, en]
|
|
1801
1801
|
}), te = (r) => {
|
|
1802
|
-
const e = Z.load(r, { schema:
|
|
1802
|
+
const e = Z.load(r, { schema: Et });
|
|
1803
1803
|
return e === void 0 ? void 0 : e;
|
|
1804
1804
|
}, Zn = (r) => Z.dump(r, {
|
|
1805
|
-
schema:
|
|
1805
|
+
schema: Et,
|
|
1806
1806
|
replacer: (e, t) => {
|
|
1807
1807
|
if (C(t)) {
|
|
1808
1808
|
if (ee(t)) {
|
|
@@ -1814,7 +1814,7 @@ const Ce = Z.types.float.options, Xr = {
|
|
|
1814
1814
|
}
|
|
1815
1815
|
return t;
|
|
1816
1816
|
}
|
|
1817
|
-
}),
|
|
1817
|
+
}), Pt = `- type:
|
|
1818
1818
|
blueId: 27B7fuxQCS1VAptiCPc2RMkKoutP5qxkh3uDxZ7dr6Eo
|
|
1819
1819
|
mappings:
|
|
1820
1820
|
Text: F92yo19rCcbBoBSpUA5LRxpfDejJDAaP1PRxxbWAraVP
|
|
@@ -1833,7 +1833,7 @@ description: This transformation infers type details for Text, Integer, Number a
|
|
|
1833
1833
|
type:
|
|
1834
1834
|
blueId: Ct1SGRGw1i47qjzm1ruiUdSZofeV6WevPTGuieVvbRS4
|
|
1835
1835
|
description: This transformation replaces`, sn = [
|
|
1836
|
-
|
|
1836
|
+
Pt,
|
|
1837
1837
|
tn,
|
|
1838
1838
|
rn,
|
|
1839
1839
|
nn
|
|
@@ -1877,7 +1877,7 @@ const Ie = class Ie extends Pe {
|
|
|
1877
1877
|
}
|
|
1878
1878
|
};
|
|
1879
1879
|
u(Ie, "INSTANCE", new Ie());
|
|
1880
|
-
let
|
|
1880
|
+
let Le = Ie;
|
|
1881
1881
|
class ge {
|
|
1882
1882
|
/**
|
|
1883
1883
|
* Wraps a NodeProvider with a SequentialNodeProvider that includes bootstrap providers
|
|
@@ -1886,19 +1886,19 @@ class ge {
|
|
|
1886
1886
|
*/
|
|
1887
1887
|
static wrap(e) {
|
|
1888
1888
|
return new Kr([
|
|
1889
|
-
|
|
1889
|
+
Le.INSTANCE,
|
|
1890
1890
|
e
|
|
1891
1891
|
]);
|
|
1892
1892
|
}
|
|
1893
1893
|
}
|
|
1894
|
-
const
|
|
1895
|
-
const e =
|
|
1894
|
+
const At = (r) => r instanceof l || Array.isArray(r) && r.every((e) => e instanceof l) ? r : Te(r) ? r.map((e) => p.deserialize(e)) : p.deserialize(r), cn = async (r) => {
|
|
1895
|
+
const e = At(r);
|
|
1896
1896
|
return F.calculateBlueId(e);
|
|
1897
1897
|
}, kn = (r) => {
|
|
1898
|
-
const e =
|
|
1898
|
+
const e = At(r);
|
|
1899
1899
|
return F.calculateBlueIdSync(e);
|
|
1900
|
-
},
|
|
1901
|
-
if (
|
|
1900
|
+
}, et = async (r) => {
|
|
1901
|
+
if (Qt(r))
|
|
1902
1902
|
return r;
|
|
1903
1903
|
try {
|
|
1904
1904
|
const e = he.parse(r), t = await cn(e);
|
|
@@ -1909,10 +1909,10 @@ const Pt = (r) => r instanceof l || Array.isArray(r) && r.every((e) => e instanc
|
|
|
1909
1909
|
} catch (e) {
|
|
1910
1910
|
throw new Error(`Failed enriching object with Blue ID: ${e}`);
|
|
1911
1911
|
}
|
|
1912
|
-
}, _n = (r) => r == null ? void 0 : r.items, Yn = (r) => r == null ? void 0 : r.value, Gn = (r) => N(r) ? {} :
|
|
1912
|
+
}, _n = (r) => r == null ? void 0 : r.items, Yn = (r) => r == null ? void 0 : r.value, Gn = (r) => N(r) ? {} : dt(
|
|
1913
1913
|
r,
|
|
1914
|
-
|
|
1915
|
-
), zn = (r) =>
|
|
1914
|
+
kt
|
|
1915
|
+
), zn = (r) => tr(r) ? r.type.name ?? null : rr(r) ? Ut(typeof r.value) : er(r) ? "List" : null, ln = (r) => d(r) && Object.keys(dt(r, ["blueId"])).length > 0, Jn = (r) => {
|
|
1916
1916
|
try {
|
|
1917
1917
|
const e = p.deserialize(r), t = T.get(e);
|
|
1918
1918
|
return Q.parse(t);
|
|
@@ -1921,19 +1921,19 @@ const Pt = (r) => r instanceof l || Array.isArray(r) && r.every((e) => e instanc
|
|
|
1921
1921
|
`Failed transforming JSON-like value to BlueObject: ${e}`
|
|
1922
1922
|
);
|
|
1923
1923
|
}
|
|
1924
|
-
},
|
|
1924
|
+
}, tt = async (r) => {
|
|
1925
1925
|
const {
|
|
1926
1926
|
resolveFunction: e,
|
|
1927
1927
|
signal: t = new AbortController().signal,
|
|
1928
1928
|
omitItems: n
|
|
1929
1929
|
} = r, s = r.count ?? r.items.length;
|
|
1930
|
-
let i = await
|
|
1930
|
+
let i = await $t(r.items, async (c) => await et(c));
|
|
1931
1931
|
const o = Math.max((i == null ? void 0 : i.length) - s, 0);
|
|
1932
1932
|
for (let c = i.length - 1; c >= o; c--)
|
|
1933
1933
|
if (!ln(i[c])) {
|
|
1934
1934
|
const a = await e(i[c], { signal: t });
|
|
1935
1935
|
if (Array.isArray(a))
|
|
1936
|
-
return
|
|
1936
|
+
return tt({
|
|
1937
1937
|
...r,
|
|
1938
1938
|
items: [
|
|
1939
1939
|
...i.slice(0, c),
|
|
@@ -1941,9 +1941,9 @@ const Pt = (r) => r instanceof l || Array.isArray(r) && r.every((e) => e instanc
|
|
|
1941
1941
|
...i.slice(c + 1)
|
|
1942
1942
|
]
|
|
1943
1943
|
});
|
|
1944
|
-
const g = await
|
|
1944
|
+
const g = await et(a);
|
|
1945
1945
|
if (n != null && n.includes(g.blueId))
|
|
1946
|
-
return
|
|
1946
|
+
return tt({
|
|
1947
1947
|
...r,
|
|
1948
1948
|
items: [...i.slice(0, c), ...i.slice(c + 1)]
|
|
1949
1949
|
});
|
|
@@ -1979,7 +1979,7 @@ class an {
|
|
|
1979
1979
|
*/
|
|
1980
1980
|
inferType(e) {
|
|
1981
1981
|
const t = e.getType(), n = e.getValue();
|
|
1982
|
-
return N(t) && d(n) && (typeof n == "string" ? e.setType(new l().setBlueId(re)) : typeof n == "bigint" || ee(n) ? e.setType(new l().setBlueId(se)) :
|
|
1982
|
+
return N(t) && d(n) && (typeof n == "string" ? e.setType(new l().setBlueId(re)) : typeof n == "bigint" || ee(n) ? e.setType(new l().setBlueId(se)) : nr(n) ? e.setType(new l().setBlueId(ne)) : typeof n == "boolean" && e.setType(new l().setBlueId(ie))), e;
|
|
1983
1983
|
}
|
|
1984
1984
|
}
|
|
1985
1985
|
const K = class K {
|
|
@@ -2027,7 +2027,7 @@ const K = class K {
|
|
|
2027
2027
|
}
|
|
2028
2028
|
};
|
|
2029
2029
|
u(K, "MAPPINGS", "mappings");
|
|
2030
|
-
let
|
|
2030
|
+
let Ze = K;
|
|
2031
2031
|
class un {
|
|
2032
2032
|
/**
|
|
2033
2033
|
* Creates a new NodeExtender with the specified NodeProvider and optional strategy
|
|
@@ -2055,7 +2055,7 @@ class un {
|
|
|
2055
2055
|
}
|
|
2056
2056
|
try {
|
|
2057
2057
|
const i = e.getBlueId();
|
|
2058
|
-
if (i && !(i in
|
|
2058
|
+
if (i && !(i in We)) {
|
|
2059
2059
|
const y = this.fetchNode(e);
|
|
2060
2060
|
if (y && y.length > 0)
|
|
2061
2061
|
if (y.length === 1) {
|
|
@@ -2124,11 +2124,11 @@ class un {
|
|
|
2124
2124
|
}
|
|
2125
2125
|
class fn {
|
|
2126
2126
|
}
|
|
2127
|
-
function
|
|
2127
|
+
function rt(r, e) {
|
|
2128
2128
|
const t = r.split(e), n = [...t].reverse().findIndex((i) => i !== ""), s = n === -1 ? 0 : t.length - n;
|
|
2129
2129
|
return t.slice(0, s);
|
|
2130
2130
|
}
|
|
2131
|
-
class
|
|
2131
|
+
class St extends fn {
|
|
2132
2132
|
/**
|
|
2133
2133
|
* Creates path limits with the specified paths and max depth
|
|
2134
2134
|
* @param allowedPaths - The paths to limit extension to
|
|
@@ -2180,7 +2180,7 @@ class At extends fn {
|
|
|
2180
2180
|
* @returns True if the path matches the allowed path pattern, false otherwise
|
|
2181
2181
|
*/
|
|
2182
2182
|
matchesAllowedPath(t, n) {
|
|
2183
|
-
const s =
|
|
2183
|
+
const s = rt(t, "/"), i = rt(n, "/");
|
|
2184
2184
|
if (i.length > s.length)
|
|
2185
2185
|
return !1;
|
|
2186
2186
|
for (let o = 1; o < i.length; o++)
|
|
@@ -2222,7 +2222,7 @@ class At extends fn {
|
|
|
2222
2222
|
* @returns The path limits
|
|
2223
2223
|
*/
|
|
2224
2224
|
static withMaxDepth(t) {
|
|
2225
|
-
return new
|
|
2225
|
+
return new nt().setMaxDepth(t).addPath("*").build();
|
|
2226
2226
|
}
|
|
2227
2227
|
/**
|
|
2228
2228
|
* Creates path limits with a single path
|
|
@@ -2230,10 +2230,10 @@ class At extends fn {
|
|
|
2230
2230
|
* @returns The path limits
|
|
2231
2231
|
*/
|
|
2232
2232
|
static withSinglePath(t) {
|
|
2233
|
-
return new
|
|
2233
|
+
return new nt().addPath(t).build();
|
|
2234
2234
|
}
|
|
2235
2235
|
}
|
|
2236
|
-
class
|
|
2236
|
+
class nt {
|
|
2237
2237
|
constructor() {
|
|
2238
2238
|
u(this, "allowedPaths", /* @__PURE__ */ new Set());
|
|
2239
2239
|
u(this, "maxDepth", Number.MAX_SAFE_INTEGER);
|
|
@@ -2259,10 +2259,10 @@ class rt {
|
|
|
2259
2259
|
* @returns The built PathLimits
|
|
2260
2260
|
*/
|
|
2261
2261
|
build() {
|
|
2262
|
-
return new
|
|
2262
|
+
return new St(this.allowedPaths, this.maxDepth);
|
|
2263
2263
|
}
|
|
2264
2264
|
}
|
|
2265
|
-
class
|
|
2265
|
+
class Nt {
|
|
2266
2266
|
constructor() {
|
|
2267
2267
|
u(this, "blueIdsCollections", []);
|
|
2268
2268
|
}
|
|
@@ -2347,7 +2347,7 @@ const be = class be {
|
|
|
2347
2347
|
const { nodeProvider: t, processorProvider: n, blueIdsMappingGenerator: s } = e;
|
|
2348
2348
|
if (!t)
|
|
2349
2349
|
throw new Error("NodeProvider is required");
|
|
2350
|
-
this.nodeProvider = ge.wrap(t), this.processorProvider = n || be.getStandardProvider(), this.blueIdsMappingGenerator = s || new
|
|
2350
|
+
this.nodeProvider = ge.wrap(t), this.processorProvider = n || be.getStandardProvider(), this.blueIdsMappingGenerator = s || new Nt(), this.loadDefaultSimpleBlue();
|
|
2351
2351
|
}
|
|
2352
2352
|
/**
|
|
2353
2353
|
* Preprocesses a document node
|
|
@@ -2376,7 +2376,7 @@ const be = class be {
|
|
|
2376
2376
|
if (!s && t && (s = t.clone()), s) {
|
|
2377
2377
|
new un(this.nodeProvider).extend(
|
|
2378
2378
|
s,
|
|
2379
|
-
|
|
2379
|
+
St.withSinglePath("/*")
|
|
2380
2380
|
);
|
|
2381
2381
|
const i = s.getItems();
|
|
2382
2382
|
if (i && i.length > 0) {
|
|
@@ -2404,7 +2404,7 @@ const be = class be {
|
|
|
2404
2404
|
var i;
|
|
2405
2405
|
const t = "27B7fuxQCS1VAptiCPc2RMkKoutP5qxkh3uDxZ7dr6Eo", n = "FGYuTXwaoSKfZmpTysLTLsb8WzSqf43384rKZDkXhxD4", s = (i = e.getType()) == null ? void 0 : i.getBlueId();
|
|
2406
2406
|
if (t === s)
|
|
2407
|
-
return new
|
|
2407
|
+
return new Ze(
|
|
2408
2408
|
e
|
|
2409
2409
|
);
|
|
2410
2410
|
if (n === s)
|
|
@@ -2428,7 +2428,7 @@ ${t}
|
|
|
2428
2428
|
* Loads the default simple Blue node
|
|
2429
2429
|
*/
|
|
2430
2430
|
loadDefaultSimpleBlue() {
|
|
2431
|
-
const e = this.enrichDefaultBlue(
|
|
2431
|
+
const e = this.enrichDefaultBlue(Pt);
|
|
2432
2432
|
try {
|
|
2433
2433
|
const t = te(e);
|
|
2434
2434
|
if (t)
|
|
@@ -2747,7 +2747,7 @@ class Hn {
|
|
|
2747
2747
|
), this.typeSchemaResolver = n ?? new Ur([]), this.urlContentFetcher = new pn(s), this.blueDirectivePreprocessor = new dn(
|
|
2748
2748
|
void 0,
|
|
2749
2749
|
this.urlContentFetcher
|
|
2750
|
-
), this.blueIdsMappingGenerator = new
|
|
2750
|
+
), this.blueIdsMappingGenerator = new Nt(), i)
|
|
2751
2751
|
for (const { schemas: a, blueIds: g } of i)
|
|
2752
2752
|
(c = this.typeSchemaResolver) == null || c.registerSchemas(a), this.blueIdsMappingGenerator.registerBlueIds(g);
|
|
2753
2753
|
}
|
|
@@ -2943,7 +2943,7 @@ export {
|
|
|
2943
2943
|
jn as BlueIdToCid,
|
|
2944
2944
|
l as BlueNode,
|
|
2945
2945
|
P as BlueNodeTypeSchema,
|
|
2946
|
-
|
|
2946
|
+
ur as JsonCanonicalizer,
|
|
2947
2947
|
Ur as TypeSchemaResolver,
|
|
2948
2948
|
Rn as applyBlueNodePatch,
|
|
2949
2949
|
Be as baseBlueObjectSchema,
|
|
@@ -2959,7 +2959,7 @@ export {
|
|
|
2959
2959
|
An as blueObjectStringValueSchema,
|
|
2960
2960
|
cn as calculateBlueId,
|
|
2961
2961
|
kn as calculateBlueIdSync,
|
|
2962
|
-
|
|
2962
|
+
et as enrichWithBlueId,
|
|
2963
2963
|
Er as getBlueDescriptionAnnotation,
|
|
2964
2964
|
Sr as getBlueIdAnnotation,
|
|
2965
2965
|
Cr as getBlueNameAnnotation,
|
|
@@ -2970,26 +2970,26 @@ export {
|
|
|
2970
2970
|
Yn as getBlueObjectValue,
|
|
2971
2971
|
Or as getExtendedFromSchemaAnnotation,
|
|
2972
2972
|
xr as getTypeBlueIdAnnotation,
|
|
2973
|
-
|
|
2974
|
-
|
|
2973
|
+
Qt as hasBlueObjectBlueIdDefined,
|
|
2974
|
+
er as hasBlueObjectItemsDefined,
|
|
2975
2975
|
Vn as hasBlueObjectNameDefined,
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2976
|
+
tr as hasBlueObjectTypeDefined,
|
|
2977
|
+
rr as hasBlueObjectValueDefined,
|
|
2978
|
+
nr as isBigDecimalNumber,
|
|
2979
2979
|
ee as isBigIntegerNumber,
|
|
2980
2980
|
C as isBigNumber,
|
|
2981
|
-
|
|
2981
|
+
wt as isBlueNodeSchema,
|
|
2982
2982
|
Fn as isBlueObject,
|
|
2983
2983
|
ln as isBlueObjectResolved,
|
|
2984
2984
|
Dn as isGivenBlueObjectTypeSchema,
|
|
2985
|
-
|
|
2986
|
-
|
|
2985
|
+
gt as isJsonBlueArray,
|
|
2986
|
+
pt as isJsonBlueObject,
|
|
2987
2987
|
On as isJsonBlueValue,
|
|
2988
|
-
|
|
2988
|
+
vt as isSchemaExtendedFrom,
|
|
2989
2989
|
ae as isUrl,
|
|
2990
2990
|
he as jsonBlueValueSchema,
|
|
2991
2991
|
Jn as normalizeToBlueObject,
|
|
2992
|
-
|
|
2992
|
+
tt as resolveBlueObjectItems,
|
|
2993
2993
|
Br as withBlueDescription,
|
|
2994
2994
|
Ar as withBlueId,
|
|
2995
2995
|
Nr as withBlueName,
|