@blue-labs/language 1.21.1 → 1.22.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,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var Ct = (
|
|
3
|
-
var u = (
|
|
4
|
-
import { isNullable as N, isNonNullable as f, jsonPrimitiveSchema as
|
|
5
|
-
import { z as d, ZodString as Z, ZodEnum as
|
|
1
|
+
var St = Object.defineProperty;
|
|
2
|
+
var Ct = (n, e, t) => e in n ? St(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var u = (n, e, t) => Ct(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { isNullable as N, isNonNullable as f, jsonPrimitiveSchema as Ft, isReadonlyArray as K, isJsonPrimitive as Me, isPreciseNumberString as rt } from "@blue-labs/shared-utils";
|
|
5
|
+
import { z as d, ZodString as Z, ZodEnum as Vt, ZodNativeEnum as Dt, ZodNumber as _, ZodBoolean as oe, ZodBigInt as le, ZodAny as st, ZodObject as Fe, ZodRecord as Ve, ZodMap as it, ZodUnknown as ot, ZodIntersection as Ot, ZodUnion as jt, ZodOptional as lt, ZodNullable as ct, ZodReadonly as at, ZodBranded as ut, ZodEffects as ae, ZodLazy as ue } from "zod";
|
|
6
6
|
import X from "bs58";
|
|
7
7
|
import R from "big.js";
|
|
8
|
-
import { isObject as
|
|
9
|
-
import { sha256 as
|
|
8
|
+
import { isObject as De, isArray as be, isString as Le, omit as dt, pascal as Rt, map as xt } from "radash";
|
|
9
|
+
import { sha256 as Ut } from "js-sha256";
|
|
10
10
|
import We from "crypto";
|
|
11
|
-
import
|
|
11
|
+
import $t from "base32.js";
|
|
12
12
|
import L from "js-yaml";
|
|
13
|
-
class
|
|
14
|
-
static get(e, t,
|
|
13
|
+
class Mt {
|
|
14
|
+
static get(e, t, r, s = !0) {
|
|
15
15
|
if (N(t) || !t.startsWith("/"))
|
|
16
16
|
throw new Error(`Invalid path: ${t}`);
|
|
17
17
|
if (t === "/") {
|
|
@@ -23,23 +23,23 @@ class $t {
|
|
|
23
23
|
e,
|
|
24
24
|
i,
|
|
25
25
|
0,
|
|
26
|
-
|
|
26
|
+
r,
|
|
27
27
|
s
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
|
-
static getRecursive(e, t,
|
|
31
|
-
if (
|
|
30
|
+
static getRecursive(e, t, r, s, i) {
|
|
31
|
+
if (r === t.length - 1 && !i)
|
|
32
32
|
return this.getNodeForSegment(
|
|
33
33
|
e,
|
|
34
|
-
t[
|
|
34
|
+
t[r],
|
|
35
35
|
s,
|
|
36
36
|
!1
|
|
37
37
|
);
|
|
38
|
-
if (
|
|
39
|
-
const
|
|
40
|
-
return i &&
|
|
38
|
+
if (r === t.length) {
|
|
39
|
+
const a = e.getValue();
|
|
40
|
+
return i && a !== void 0 ? a : e;
|
|
41
41
|
}
|
|
42
|
-
const o = t[
|
|
42
|
+
const o = t[r], l = this.getNodeForSegment(
|
|
43
43
|
e,
|
|
44
44
|
o,
|
|
45
45
|
s,
|
|
@@ -49,12 +49,12 @@ class $t {
|
|
|
49
49
|
return this.getRecursive(
|
|
50
50
|
l,
|
|
51
51
|
t,
|
|
52
|
-
|
|
52
|
+
r + 1,
|
|
53
53
|
s,
|
|
54
54
|
i
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
|
-
static getNodeForSegment(e, t,
|
|
57
|
+
static getNodeForSegment(e, t, r, s) {
|
|
58
58
|
let i;
|
|
59
59
|
const o = e.getProperties();
|
|
60
60
|
if (o && t in o)
|
|
@@ -63,34 +63,34 @@ class $t {
|
|
|
63
63
|
switch (t) {
|
|
64
64
|
case "name": {
|
|
65
65
|
const l = e.getName();
|
|
66
|
-
i = f(l) ? new
|
|
66
|
+
i = f(l) ? new c().setValue(l) : new c();
|
|
67
67
|
break;
|
|
68
68
|
}
|
|
69
69
|
case "description": {
|
|
70
70
|
const l = e.getDescription();
|
|
71
|
-
i = f(l) ? new
|
|
71
|
+
i = f(l) ? new c().setValue(l) : new c();
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
74
|
case "type":
|
|
75
|
-
i = e.getType() ?? new
|
|
75
|
+
i = e.getType() ?? new c();
|
|
76
76
|
break;
|
|
77
77
|
case "itemType":
|
|
78
|
-
i = e.getItemType() ?? new
|
|
78
|
+
i = e.getItemType() ?? new c();
|
|
79
79
|
break;
|
|
80
80
|
case "keyType":
|
|
81
|
-
i = e.getKeyType() ?? new
|
|
81
|
+
i = e.getKeyType() ?? new c();
|
|
82
82
|
break;
|
|
83
83
|
case "valueType":
|
|
84
|
-
i = e.getValueType() ?? new
|
|
84
|
+
i = e.getValueType() ?? new c();
|
|
85
85
|
break;
|
|
86
86
|
case "value": {
|
|
87
87
|
const l = e.getValue();
|
|
88
|
-
i = new
|
|
88
|
+
i = new c().setValue(l ?? null);
|
|
89
89
|
break;
|
|
90
90
|
}
|
|
91
91
|
case "blueId": {
|
|
92
92
|
const l = e.getBlueId();
|
|
93
|
-
i = f(l) ? new
|
|
93
|
+
i = f(l) ? new c().setValue(l) : new c();
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
96
96
|
case "blue":
|
|
@@ -98,34 +98,34 @@ class $t {
|
|
|
98
98
|
break;
|
|
99
99
|
case "items": {
|
|
100
100
|
const l = e.getItems();
|
|
101
|
-
i = new
|
|
101
|
+
i = new c().setItems(l);
|
|
102
102
|
break;
|
|
103
103
|
}
|
|
104
104
|
case "properties": {
|
|
105
105
|
const l = e.getProperties();
|
|
106
|
-
i = new
|
|
106
|
+
i = new c().setProperties(l);
|
|
107
107
|
break;
|
|
108
108
|
}
|
|
109
109
|
case "contracts": {
|
|
110
110
|
const l = e.getContracts();
|
|
111
|
-
i = new
|
|
111
|
+
i = new c().setContracts(l);
|
|
112
112
|
break;
|
|
113
113
|
}
|
|
114
114
|
default: {
|
|
115
115
|
if (/^\d+$/.test(t)) {
|
|
116
|
-
const l = parseInt(t, 10),
|
|
117
|
-
|
|
116
|
+
const l = parseInt(t, 10), a = e.getItems();
|
|
117
|
+
a && l >= 0 && l < a.length ? i = a[l] : i = void 0;
|
|
118
118
|
} else
|
|
119
119
|
i = void 0;
|
|
120
120
|
break;
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
if (i)
|
|
124
|
-
return s &&
|
|
124
|
+
return s && r ? this.link(i, r) : i;
|
|
125
125
|
}
|
|
126
126
|
static link(e, t) {
|
|
127
|
-
const
|
|
128
|
-
return f(
|
|
127
|
+
const r = t(e);
|
|
128
|
+
return f(r) ? r : e;
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
class v extends R {
|
|
@@ -138,7 +138,7 @@ class P extends R {
|
|
|
138
138
|
super(e);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
const k = "name", Y = "description", de = "type", Ze = "itemType", _e = "keyType", ke = "valueType", Te = "value", Ye = "items", M = "blueId", Ge = "blue", we = "contracts",
|
|
141
|
+
const k = "name", Y = "description", de = "type", Ze = "itemType", _e = "keyType", ke = "valueType", Te = "value", Ye = "items", M = "blueId", Ge = "blue", we = "contracts", Lt = [
|
|
142
142
|
k,
|
|
143
143
|
Y,
|
|
144
144
|
de,
|
|
@@ -150,26 +150,26 @@ const k = "name", Y = "description", de = "type", Ze = "itemType", _e = "keyType
|
|
|
150
150
|
M,
|
|
151
151
|
Ge,
|
|
152
152
|
we
|
|
153
|
-
],
|
|
154
|
-
Lt,
|
|
153
|
+
], Zt = "Text", _t = "Double", kt = "Integer", Yt = "Boolean", Gt = "List", zt = "Dictionary", Jt = [
|
|
155
154
|
Zt,
|
|
156
155
|
_t,
|
|
157
|
-
kt
|
|
158
|
-
|
|
156
|
+
kt,
|
|
157
|
+
Yt
|
|
158
|
+
], ft = [...Jt, Gt, zt], te = "F92yo19rCcbBoBSpUA5LRxpfDejJDAaP1PRxxbWAraVP", ne = "68ryJtnmui4j5rCZWUnkZ3DChtmEb7Z9F8atn1mBSM3L", re = "DHmxTkFbXePZHCHCYmQr2dSzcNLcryFVjXVHkdQrrZr8", se = "EL6AjrbJsxTWRTPzY8WR8Y2zAMXRbydQj83PcZwuAHbo", Ht = "G8wmfjEqugPEEXByMYWJXiEdbLToPRWNQEekNxrxfQWB", Wt = "294NBTj2mFRL3RB4kDRUSckwGg7Kzj6T8CTAFeR1kcSA", Kt = [
|
|
159
159
|
te,
|
|
160
|
-
re,
|
|
161
160
|
ne,
|
|
161
|
+
re,
|
|
162
162
|
se
|
|
163
163
|
], ze = [
|
|
164
|
-
...
|
|
165
|
-
|
|
166
|
-
|
|
164
|
+
...Kt,
|
|
165
|
+
Ht,
|
|
166
|
+
Wt
|
|
167
167
|
];
|
|
168
168
|
Object.fromEntries(
|
|
169
|
-
ft.map((
|
|
169
|
+
ft.map((n, e) => [n, ze[e]])
|
|
170
170
|
);
|
|
171
171
|
Object.fromEntries(
|
|
172
|
-
ze.map((
|
|
172
|
+
ze.map((n, e) => [n, ft[e]])
|
|
173
173
|
);
|
|
174
174
|
const D = class D {
|
|
175
175
|
constructor(e) {
|
|
@@ -228,10 +228,10 @@ const D = class D {
|
|
|
228
228
|
var t;
|
|
229
229
|
const e = (t = this.type) == null ? void 0 : t.getBlueId();
|
|
230
230
|
if (f(e) && f(this.value)) {
|
|
231
|
-
if (e ===
|
|
231
|
+
if (e === re && typeof this.value == "string")
|
|
232
232
|
return new v(this.value);
|
|
233
|
-
if (e ===
|
|
234
|
-
const
|
|
233
|
+
if (e === ne && typeof this.value == "string") {
|
|
234
|
+
const r = new P(this.value), s = parseFloat(r.toString());
|
|
235
235
|
return new P(s.toString());
|
|
236
236
|
} else if (e === se && typeof this.value == "string")
|
|
237
237
|
return this.value.toLowerCase() === "true";
|
|
@@ -287,15 +287,15 @@ const D = class D {
|
|
|
287
287
|
return this.inlineValue = e, this;
|
|
288
288
|
}
|
|
289
289
|
get(e, t) {
|
|
290
|
-
return
|
|
290
|
+
return Mt.get(this, e, t);
|
|
291
291
|
}
|
|
292
292
|
clone() {
|
|
293
|
-
var t,
|
|
293
|
+
var t, r, s, i, o, l;
|
|
294
294
|
const e = new D(this.name);
|
|
295
|
-
return e.description = this.description, e.type = (t = this.type) == null ? void 0 : t.clone(), e.itemType = (
|
|
296
|
-
Object.entries(this.properties).map(([
|
|
295
|
+
return e.description = this.description, e.type = (t = this.type) == null ? void 0 : t.clone(), e.itemType = (r = this.itemType) == null ? void 0 : r.clone(), e.keyType = (s = this.keyType) == null ? void 0 : s.clone(), e.valueType = (i = this.valueType) == null ? void 0 : i.clone(), e.value = this.value, e.items = (o = this.items) == null ? void 0 : o.map((a) => a.clone()), this.properties && (e.properties = Object.fromEntries(
|
|
296
|
+
Object.entries(this.properties).map(([a, g]) => [a, g.clone()])
|
|
297
297
|
)), this.contracts && (e.contracts = Object.fromEntries(
|
|
298
|
-
Object.entries(this.contracts).map(([
|
|
298
|
+
Object.entries(this.contracts).map(([a, g]) => [a, g.clone()])
|
|
299
299
|
)), e.blueId = this.blueId, e.blue = (l = this.blue) == null ? void 0 : l.clone(), e.inlineValue = this.inlineValue, e;
|
|
300
300
|
}
|
|
301
301
|
toString() {
|
|
@@ -303,16 +303,16 @@ const D = class D {
|
|
|
303
303
|
}
|
|
304
304
|
};
|
|
305
305
|
u(D, "INTEGER", new D("Integer"));
|
|
306
|
-
let
|
|
306
|
+
let c = D;
|
|
307
307
|
class $ {
|
|
308
308
|
static isPotentialBlueId(e) {
|
|
309
309
|
if (!e || e.length === 0 || !this.BLUE_ID_PATTERN.test(e))
|
|
310
310
|
return !1;
|
|
311
|
-
const t = e.split("#"),
|
|
311
|
+
const t = e.split("#"), r = t[0], s = r.length;
|
|
312
312
|
if (s < this.MIN_BLUE_ID_LENGTH || s > this.MAX_BLUE_ID_LENGTH)
|
|
313
313
|
return !1;
|
|
314
314
|
try {
|
|
315
|
-
if (X.decode(
|
|
315
|
+
if (X.decode(r).length !== 32)
|
|
316
316
|
return !1;
|
|
317
317
|
} catch {
|
|
318
318
|
return !1;
|
|
@@ -328,14 +328,14 @@ class $ {
|
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
u($, "MIN_BLUE_ID_LENGTH", 41), u($, "MAX_BLUE_ID_LENGTH", 45), u($, "BLUE_ID_PATTERN", /^[1-9A-HJ-NP-Za-km-z]{41,45}(?:#\d+)?$/);
|
|
331
|
-
const
|
|
331
|
+
const Er = d.string().max($.MAX_BLUE_ID_LENGTH, {
|
|
332
332
|
message: "Blue Id has a maximum length of 45 characters"
|
|
333
333
|
}).min($.MIN_BLUE_ID_LENGTH, {
|
|
334
334
|
message: "Blue Id has a minimum length of 41 characters"
|
|
335
335
|
}).refine(
|
|
336
|
-
(
|
|
336
|
+
(n) => {
|
|
337
337
|
try {
|
|
338
|
-
return X.decode(
|
|
338
|
+
return X.decode(n), !0;
|
|
339
339
|
} catch {
|
|
340
340
|
return !1;
|
|
341
341
|
}
|
|
@@ -359,32 +359,32 @@ const Bn = d.string().max($.MAX_BLUE_ID_LENGTH, {
|
|
|
359
359
|
name: d.string().optional(),
|
|
360
360
|
description: d.string().optional(),
|
|
361
361
|
type: q.optional()
|
|
362
|
-
}),
|
|
362
|
+
}), Pr = Be.extend({
|
|
363
363
|
value: d.string().optional()
|
|
364
|
-
}),
|
|
364
|
+
}), Ar = Be.extend({
|
|
365
365
|
value: d.number().optional()
|
|
366
|
-
}),
|
|
366
|
+
}), Nr = Be.extend({
|
|
367
367
|
value: d.boolean().optional()
|
|
368
|
-
}),
|
|
368
|
+
}), Sr = Be.extend({
|
|
369
369
|
items: d.array(d.string()).optional()
|
|
370
|
-
}),
|
|
370
|
+
}), Cr = (n) => q.safeParse(n).success, Xt = (n) => f(n) && "blueId" in n && f(n.blueId), Fr = (n) => f(n) && "name" in n && f(n.name), qt = (n) => f(n) && "items" in n && f(n.items), Qt = (n) => f(n) && "type" in n && f(n.type), en = (n) => f(n) && "value" in n && f(n.value), Vr = (n, e) => n.required({ type: !0 }).safeParse(e).success, S = (n) => n instanceof R, Q = (n) => S(n) && n instanceof v, tn = (n) => S(n) && n instanceof P, nn = d.lazy(
|
|
371
371
|
() => d.record(fe)
|
|
372
|
-
),
|
|
372
|
+
), rn = d.lazy(
|
|
373
373
|
() => d.union([
|
|
374
374
|
d.array(fe),
|
|
375
375
|
d.array(fe).readonly()
|
|
376
376
|
])
|
|
377
377
|
), fe = d.lazy(
|
|
378
378
|
() => d.union([
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
379
|
+
Ft,
|
|
380
|
+
nn,
|
|
381
|
+
rn,
|
|
382
382
|
d.instanceof(R)
|
|
383
383
|
])
|
|
384
|
-
), ht = (
|
|
385
|
-
class
|
|
384
|
+
), ht = (n) => De(n) && !be(n) && !K(n) && !S(n), pt = (n) => be(n) || K(n), Dr = (n) => pt(n) || ht(n) || S(n) || Me(n);
|
|
385
|
+
class p {
|
|
386
386
|
static deserialize(e) {
|
|
387
|
-
return
|
|
387
|
+
return p.handleNode(e);
|
|
388
388
|
}
|
|
389
389
|
static handleNode(e) {
|
|
390
390
|
if (e === void 0)
|
|
@@ -392,7 +392,7 @@ class g {
|
|
|
392
392
|
"This is not a valid JSON-like value. Found 'undefined' as a value."
|
|
393
393
|
);
|
|
394
394
|
if (ht(e)) {
|
|
395
|
-
const t = new
|
|
395
|
+
const t = new c(), r = {}, s = {};
|
|
396
396
|
return Object.entries(e).forEach(([i, o]) => {
|
|
397
397
|
switch (i) {
|
|
398
398
|
case k:
|
|
@@ -416,19 +416,19 @@ class g {
|
|
|
416
416
|
}
|
|
417
417
|
break;
|
|
418
418
|
case de:
|
|
419
|
-
t.setType(
|
|
419
|
+
t.setType(p.handleNode(o));
|
|
420
420
|
break;
|
|
421
421
|
case Ze:
|
|
422
|
-
t.setItemType(
|
|
422
|
+
t.setItemType(p.handleNode(o));
|
|
423
423
|
break;
|
|
424
424
|
case _e:
|
|
425
|
-
t.setKeyType(
|
|
425
|
+
t.setKeyType(p.handleNode(o));
|
|
426
426
|
break;
|
|
427
427
|
case ke:
|
|
428
|
-
t.setValueType(
|
|
428
|
+
t.setValueType(p.handleNode(o));
|
|
429
429
|
break;
|
|
430
430
|
case Te:
|
|
431
|
-
t.setValue(
|
|
431
|
+
t.setValue(p.handleValue(o));
|
|
432
432
|
break;
|
|
433
433
|
case M:
|
|
434
434
|
if (typeof o != "string")
|
|
@@ -436,27 +436,27 @@ class g {
|
|
|
436
436
|
t.setBlueId(o);
|
|
437
437
|
break;
|
|
438
438
|
case Ye:
|
|
439
|
-
t.setItems(
|
|
439
|
+
t.setItems(p.handleArray(o));
|
|
440
440
|
break;
|
|
441
441
|
case Ge:
|
|
442
|
-
t.setBlue(
|
|
442
|
+
t.setBlue(p.handleNode(o));
|
|
443
443
|
break;
|
|
444
444
|
case we:
|
|
445
|
-
|
|
446
|
-
s[l] =
|
|
445
|
+
De(o) && !be(o) && !K(o) && Object.entries(o).forEach(([l, a]) => {
|
|
446
|
+
s[l] = p.handleNode(a);
|
|
447
447
|
});
|
|
448
448
|
break;
|
|
449
449
|
default:
|
|
450
|
-
|
|
450
|
+
r[i] = p.handleNode(o);
|
|
451
451
|
break;
|
|
452
452
|
}
|
|
453
|
-
}), Object.keys(
|
|
453
|
+
}), Object.keys(r).length > 0 && t.setProperties(r), Object.keys(s).length > 0 && t.setContracts(s), t;
|
|
454
454
|
} else {
|
|
455
455
|
if (pt(e))
|
|
456
|
-
return new
|
|
456
|
+
return new c().setItems(p.handleArray(e));
|
|
457
457
|
{
|
|
458
458
|
const t = e;
|
|
459
|
-
return new
|
|
459
|
+
return new c().setValue(p.handleValue(t)).setInlineValue(!0);
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
462
|
}
|
|
@@ -465,10 +465,10 @@ class g {
|
|
|
465
465
|
return null;
|
|
466
466
|
if (typeof e == "string")
|
|
467
467
|
return e;
|
|
468
|
-
if (typeof e == "number" ||
|
|
468
|
+
if (typeof e == "number" || S(e))
|
|
469
469
|
if (Q(e) || Number.isSafeInteger(e)) {
|
|
470
|
-
const t = new v(e.toString()),
|
|
471
|
-
return t.lt(
|
|
470
|
+
const t = new v(e.toString()), r = Number.MIN_SAFE_INTEGER, s = Number.MAX_SAFE_INTEGER;
|
|
471
|
+
return t.lt(r) ? new v(r.toString()) : t.gt(s) ? new v(s.toString()) : t;
|
|
472
472
|
} else {
|
|
473
473
|
const t = parseFloat(e.toString());
|
|
474
474
|
return new P(t.toString());
|
|
@@ -479,40 +479,40 @@ class g {
|
|
|
479
479
|
}
|
|
480
480
|
static handleArray(e) {
|
|
481
481
|
if (e != null) {
|
|
482
|
-
if (
|
|
483
|
-
return [
|
|
482
|
+
if (De(e) && !Array.isArray(e))
|
|
483
|
+
return [p.handleNode(e)];
|
|
484
484
|
if (Array.isArray(e))
|
|
485
|
-
return e.map(
|
|
485
|
+
return e.map(p.handleNode);
|
|
486
486
|
throw new Error("Expected an array node");
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
|
-
function
|
|
491
|
-
return
|
|
490
|
+
function sn(n) {
|
|
491
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
492
492
|
}
|
|
493
493
|
var Ae, Ke;
|
|
494
|
-
function
|
|
495
|
-
return Ke || (Ke = 1, Ae = function
|
|
494
|
+
function on() {
|
|
495
|
+
return Ke || (Ke = 1, Ae = function n(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))
|
|
499
499
|
throw new Error("Infinity is not allowed");
|
|
500
|
-
return e === null || typeof e != "object" ? JSON.stringify(e) : e.toJSON instanceof Function ?
|
|
500
|
+
return e === null || typeof e != "object" ? JSON.stringify(e) : e.toJSON instanceof Function ? n(e.toJSON()) : Array.isArray(e) ? `[${e.reduce((s, i, o) => `${s}${o === 0 ? "" : ","}${n(i === void 0 || typeof i == "symbol" ? null : i)}`, "")}]` : `{${Object.keys(e).sort().reduce((r, s) => {
|
|
501
501
|
if (e[s] === void 0 || typeof e[s] == "symbol")
|
|
502
|
-
return
|
|
503
|
-
const i =
|
|
504
|
-
return `${
|
|
502
|
+
return r;
|
|
503
|
+
const i = r.length === 0 ? "" : ",";
|
|
504
|
+
return `${r}${i}${n(s)}:${n(e[s])}`;
|
|
505
505
|
}, "")}}`;
|
|
506
506
|
}), Ae;
|
|
507
507
|
}
|
|
508
|
-
var
|
|
509
|
-
const
|
|
510
|
-
class
|
|
508
|
+
var ln = on();
|
|
509
|
+
const cn = /* @__PURE__ */ sn(ln);
|
|
510
|
+
class an {
|
|
511
511
|
static canonicalize(e) {
|
|
512
|
-
return
|
|
512
|
+
return cn(e);
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
const
|
|
515
|
+
const un = typeof process < "u" && process.versions != null && process.versions.node != null, ye = class ye {
|
|
516
516
|
constructor() {
|
|
517
517
|
u(this, "browserCrypto");
|
|
518
518
|
this.browserCrypto = this.initBrowserCrypto();
|
|
@@ -521,7 +521,7 @@ const cr = typeof process < "u" && process.versions != null && process.versions.
|
|
|
521
521
|
return this.instance || (this.instance = new ye()), this.instance;
|
|
522
522
|
}
|
|
523
523
|
initBrowserCrypto() {
|
|
524
|
-
return
|
|
524
|
+
return un ? null : "crypto" in globalThis ? globalThis.crypto : null;
|
|
525
525
|
}
|
|
526
526
|
hasNodeCrypto() {
|
|
527
527
|
return !!We.createHash;
|
|
@@ -534,21 +534,21 @@ const cr = typeof process < "u" && process.versions != null && process.versions.
|
|
|
534
534
|
}
|
|
535
535
|
};
|
|
536
536
|
u(ye, "instance");
|
|
537
|
-
let
|
|
538
|
-
class
|
|
537
|
+
let Oe = ye;
|
|
538
|
+
class dn {
|
|
539
539
|
constructor() {
|
|
540
|
-
u(this, "cryptoEnv",
|
|
540
|
+
u(this, "cryptoEnv", Oe.getInstance());
|
|
541
541
|
}
|
|
542
542
|
applySync(e) {
|
|
543
|
-
const t = this.canonicalizeInput(e),
|
|
544
|
-
return X.encode(new Uint8Array(
|
|
543
|
+
const t = this.canonicalizeInput(e), r = this.cryptoEnv.hasNodeCrypto() ? this.sha256Sync(t) : this.sha256SyncBrowser(t);
|
|
544
|
+
return X.encode(new Uint8Array(r));
|
|
545
545
|
}
|
|
546
546
|
async apply(e) {
|
|
547
|
-
const t = this.canonicalizeInput(e),
|
|
548
|
-
return X.encode(new Uint8Array(
|
|
547
|
+
const t = this.canonicalizeInput(e), r = this.cryptoEnv.hasNodeCrypto() ? this.sha256Sync(t) : await this.sha256Async(t);
|
|
548
|
+
return X.encode(new Uint8Array(r));
|
|
549
549
|
}
|
|
550
550
|
canonicalizeInput(e) {
|
|
551
|
-
const t =
|
|
551
|
+
const t = an.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 ar {
|
|
|
562
562
|
return t.createHash("sha256").update(e).digest();
|
|
563
563
|
}
|
|
564
564
|
sha256SyncBrowser(e) {
|
|
565
|
-
return
|
|
565
|
+
return Ut.arrayBuffer(e);
|
|
566
566
|
}
|
|
567
567
|
async sha256Async(e) {
|
|
568
568
|
if (this.cryptoEnv.hasNodeCrypto())
|
|
@@ -587,7 +587,7 @@ class T {
|
|
|
587
587
|
*/
|
|
588
588
|
static get(e, t = "official") {
|
|
589
589
|
var ie;
|
|
590
|
-
const
|
|
590
|
+
const r = e.getValue(), s = this.handleValue(r);
|
|
591
591
|
if (s !== void 0 && t === "simple")
|
|
592
592
|
return s;
|
|
593
593
|
const i = (ie = e.getItems()) == null ? void 0 : ie.map((V) => T.get(V, t));
|
|
@@ -600,40 +600,40 @@ class T {
|
|
|
600
600
|
if (i !== void 0)
|
|
601
601
|
return i;
|
|
602
602
|
}
|
|
603
|
-
const
|
|
604
|
-
o !== void 0 && (
|
|
605
|
-
const
|
|
606
|
-
if (t === "official" &&
|
|
607
|
-
const V = this.inferTypeBlueId(
|
|
608
|
-
V !== null && (
|
|
609
|
-
} else
|
|
603
|
+
const a = {};
|
|
604
|
+
o !== void 0 && (a[k] = o), l !== void 0 && (a[Y] = l);
|
|
605
|
+
const g = e.getType();
|
|
606
|
+
if (t === "official" && r !== void 0 && g === void 0) {
|
|
607
|
+
const V = this.inferTypeBlueId(r);
|
|
608
|
+
V !== null && (a[de] = { [M]: V });
|
|
609
|
+
} else g !== void 0 && (a[de] = T.get(g, t));
|
|
610
610
|
const b = e.getItemType();
|
|
611
|
-
b !== void 0 && (
|
|
611
|
+
b !== void 0 && (a[Ze] = T.get(b, t));
|
|
612
612
|
const I = e.getKeyType();
|
|
613
|
-
I !== void 0 && (
|
|
613
|
+
I !== void 0 && (a[_e] = T.get(I, t));
|
|
614
614
|
const m = e.getValueType();
|
|
615
|
-
m !== void 0 && (
|
|
615
|
+
m !== void 0 && (a[ke] = T.get(m, t)), s !== void 0 && (a[Te] = s), i !== void 0 && (a[Ye] = i);
|
|
616
616
|
const y = e.getBlueId();
|
|
617
|
-
y !== void 0 && (
|
|
618
|
-
const
|
|
619
|
-
|
|
617
|
+
y !== void 0 && (a[M] = y);
|
|
618
|
+
const h = e.getBlue();
|
|
619
|
+
h !== void 0 && (a[Ge] = h);
|
|
620
620
|
const w = e.getContracts();
|
|
621
621
|
if (w !== void 0) {
|
|
622
622
|
const V = {};
|
|
623
|
-
Object.entries(w).forEach(([Pe,
|
|
624
|
-
V[Pe] = T.get(
|
|
625
|
-
}),
|
|
623
|
+
Object.entries(w).forEach(([Pe, Nt]) => {
|
|
624
|
+
V[Pe] = T.get(Nt, t);
|
|
625
|
+
}), a[we] = V;
|
|
626
626
|
}
|
|
627
627
|
const F = e.getProperties();
|
|
628
628
|
return F !== void 0 && Object.entries(F).forEach(([V, Pe]) => {
|
|
629
|
-
|
|
630
|
-
}),
|
|
629
|
+
a[V] = T.get(Pe, t);
|
|
630
|
+
}), a;
|
|
631
631
|
}
|
|
632
632
|
static handleValue(e) {
|
|
633
|
-
if (
|
|
633
|
+
if (S(e)) {
|
|
634
634
|
if (Q(e)) {
|
|
635
|
-
const t = new R(Number.MIN_SAFE_INTEGER.toString()),
|
|
636
|
-
if (e.lt(t) || e.gt(
|
|
635
|
+
const t = new R(Number.MIN_SAFE_INTEGER.toString()), r = new R(Number.MAX_SAFE_INTEGER.toString());
|
|
636
|
+
if (e.lt(t) || e.gt(r))
|
|
637
637
|
return e.toString();
|
|
638
638
|
}
|
|
639
639
|
return e.toNumber();
|
|
@@ -641,26 +641,26 @@ class T {
|
|
|
641
641
|
return e;
|
|
642
642
|
}
|
|
643
643
|
static inferTypeBlueId(e) {
|
|
644
|
-
return typeof e == "string" ? te :
|
|
644
|
+
return typeof e == "string" ? te : S(e) ? Q(e) ? re : ne : typeof e == "boolean" ? se : null;
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
|
-
const
|
|
647
|
+
const fn = (n) => Me(n) && f(n), j = class j {
|
|
648
648
|
constructor(e) {
|
|
649
649
|
u(this, "hashProvider");
|
|
650
650
|
this.hashProvider = e;
|
|
651
651
|
}
|
|
652
652
|
static calculateBlueId(e) {
|
|
653
653
|
if (Array.isArray(e)) {
|
|
654
|
-
const
|
|
655
|
-
return j.INSTANCE.calculate(
|
|
654
|
+
const r = e.map((s) => T.get(s));
|
|
655
|
+
return j.INSTANCE.calculate(r);
|
|
656
656
|
}
|
|
657
657
|
const t = T.get(e);
|
|
658
658
|
return j.INSTANCE.calculate(t);
|
|
659
659
|
}
|
|
660
660
|
static calculateBlueIdSync(e) {
|
|
661
661
|
if (Array.isArray(e)) {
|
|
662
|
-
const
|
|
663
|
-
return j.INSTANCE.calculateSync(
|
|
662
|
+
const r = e.map((s) => T.get(s));
|
|
663
|
+
return j.INSTANCE.calculateSync(r);
|
|
664
664
|
}
|
|
665
665
|
const t = T.get(e);
|
|
666
666
|
return j.INSTANCE.calculateSync(t);
|
|
@@ -687,7 +687,7 @@ const ur = (r) => Me(r) && f(r), j = class j {
|
|
|
687
687
|
}
|
|
688
688
|
// Internal method to calculate BlueId recursively
|
|
689
689
|
internalCalculate(e, t) {
|
|
690
|
-
return
|
|
690
|
+
return fn(e) || S(e) ? this.applyHash(e.toString(), t) : Array.isArray(e) || K(e) ? this.calculateList(e, t) : this.calculateMap(e, t);
|
|
691
691
|
}
|
|
692
692
|
calculateMap(e, t) {
|
|
693
693
|
if (e[M] !== void 0)
|
|
@@ -697,16 +697,16 @@ const ur = (r) => Me(r) && f(r), j = class j {
|
|
|
697
697
|
if ([k, Te, Y].includes(o))
|
|
698
698
|
return t ? [o, l] : Promise.resolve([o, l]);
|
|
699
699
|
{
|
|
700
|
-
const
|
|
701
|
-
return t ? [o, { blueId:
|
|
700
|
+
const a = this.internalCalculate(l, t);
|
|
701
|
+
return t ? [o, { blueId: a }] : Promise.resolve(a).then((g) => [
|
|
702
702
|
o,
|
|
703
|
-
{ blueId:
|
|
703
|
+
{ blueId: g }
|
|
704
704
|
]);
|
|
705
705
|
}
|
|
706
706
|
}), i = (o) => {
|
|
707
707
|
const l = {};
|
|
708
|
-
for (const [
|
|
709
|
-
l[
|
|
708
|
+
for (const [a, g] of o)
|
|
709
|
+
l[a] = g;
|
|
710
710
|
return this.applyHash(l, t);
|
|
711
711
|
};
|
|
712
712
|
return t ? i(s) : Promise.all(s).then(i);
|
|
@@ -714,7 +714,7 @@ const ur = (r) => Me(r) && f(r), j = class j {
|
|
|
714
714
|
calculateList(e, t) {
|
|
715
715
|
if (e.length === 0)
|
|
716
716
|
throw new Error("Cannot calculate BlueId for an empty list.");
|
|
717
|
-
let
|
|
717
|
+
let r = this.internalCalculate(
|
|
718
718
|
e[0],
|
|
719
719
|
t
|
|
720
720
|
);
|
|
@@ -722,13 +722,13 @@ const ur = (r) => Me(r) && f(r), j = class j {
|
|
|
722
722
|
[{ blueId: i }, { blueId: o }],
|
|
723
723
|
!0
|
|
724
724
|
) : Promise.all([i, o]).then(
|
|
725
|
-
([l,
|
|
725
|
+
([l, a]) => this.applyHash([{ blueId: l }, { blueId: a }], !1)
|
|
726
726
|
);
|
|
727
727
|
for (let i = 1; i < e.length; i++) {
|
|
728
728
|
const o = this.internalCalculate(e[i], t);
|
|
729
|
-
|
|
729
|
+
r = s(r, o);
|
|
730
730
|
}
|
|
731
|
-
return
|
|
731
|
+
return r;
|
|
732
732
|
}
|
|
733
733
|
// Method to apply the hash provider to a value
|
|
734
734
|
applyHash(e, t) {
|
|
@@ -737,16 +737,16 @@ const ur = (r) => Me(r) && f(r), j = class j {
|
|
|
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 (Me(e) ||
|
|
740
|
+
if (Me(e) || S(e))
|
|
741
741
|
return e;
|
|
742
742
|
if (Array.isArray(e) || K(e)) {
|
|
743
|
-
const t = e.map((
|
|
743
|
+
const t = e.map((r) => this.cleanStructure(r)).filter(f);
|
|
744
744
|
return t.length > 0 ? t : void 0;
|
|
745
745
|
} else if (typeof e == "object") {
|
|
746
746
|
const t = {};
|
|
747
|
-
for (const
|
|
748
|
-
const s = this.cleanStructure(e[
|
|
749
|
-
s != null && (t[
|
|
747
|
+
for (const r in e) {
|
|
748
|
+
const s = this.cleanStructure(e[r]);
|
|
749
|
+
s != null && (t[r] = s);
|
|
750
750
|
}
|
|
751
751
|
return Object.keys(t).length > 0 ? t : void 0;
|
|
752
752
|
} else
|
|
@@ -754,14 +754,14 @@ const ur = (r) => Me(r) && f(r), j = class j {
|
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
756
|
};
|
|
757
|
-
u(j, "INSTANCE", new j(new
|
|
758
|
-
let
|
|
759
|
-
class
|
|
757
|
+
u(j, "INSTANCE", new j(new dn()));
|
|
758
|
+
let C = j;
|
|
759
|
+
class Or {
|
|
760
760
|
static convert(e) {
|
|
761
|
-
const t = X.decode(e),
|
|
762
|
-
|
|
763
|
-
const s = new Uint8Array(2 +
|
|
764
|
-
return s[0] = 1, s[1] = 85, s.set(
|
|
761
|
+
const t = X.decode(e), r = new Uint8Array(2 + t.length);
|
|
762
|
+
r[0] = 18, r[1] = 32, r.set(t, 2);
|
|
763
|
+
const s = new Uint8Array(2 + r.length);
|
|
764
|
+
return s[0] = 1, s[1] = 85, s.set(r, 2), "b" + new $t.Encoder({ type: "rfc4648", lc: !0 }).write(s).finalize().replace(/=/g, "");
|
|
765
765
|
}
|
|
766
766
|
}
|
|
767
767
|
class A {
|
|
@@ -772,100 +772,100 @@ class A {
|
|
|
772
772
|
* @returns The transformed node
|
|
773
773
|
*/
|
|
774
774
|
static transform(e, t) {
|
|
775
|
-
const
|
|
776
|
-
s !== void 0 &&
|
|
777
|
-
const i =
|
|
778
|
-
i !== void 0 &&
|
|
775
|
+
const r = t(e.clone()), s = r.getType();
|
|
776
|
+
s !== void 0 && r.setType(A.transform(s, t));
|
|
777
|
+
const i = r.getItemType();
|
|
778
|
+
i !== void 0 && r.setItemType(
|
|
779
779
|
A.transform(i, t)
|
|
780
780
|
);
|
|
781
|
-
const o =
|
|
782
|
-
o !== void 0 &&
|
|
781
|
+
const o = r.getKeyType();
|
|
782
|
+
o !== void 0 && r.setKeyType(
|
|
783
783
|
A.transform(o, t)
|
|
784
784
|
);
|
|
785
|
-
const l =
|
|
786
|
-
l !== void 0 &&
|
|
785
|
+
const l = r.getValueType();
|
|
786
|
+
l !== void 0 && r.setValueType(
|
|
787
787
|
A.transform(l, t)
|
|
788
788
|
);
|
|
789
|
-
const
|
|
790
|
-
if (
|
|
791
|
-
const I =
|
|
789
|
+
const a = r.getItems();
|
|
790
|
+
if (a !== void 0) {
|
|
791
|
+
const I = a.map(
|
|
792
792
|
(m) => A.transform(m, t)
|
|
793
793
|
);
|
|
794
|
-
|
|
794
|
+
r.setItems(I);
|
|
795
795
|
}
|
|
796
|
-
const
|
|
797
|
-
if (
|
|
798
|
-
const I = Object.keys(
|
|
799
|
-
(m, y) => (m[y] = A.transform(
|
|
796
|
+
const g = r.getProperties();
|
|
797
|
+
if (g !== void 0) {
|
|
798
|
+
const I = Object.keys(g).reduce(
|
|
799
|
+
(m, y) => (m[y] = A.transform(g[y], t), m),
|
|
800
800
|
{}
|
|
801
801
|
);
|
|
802
|
-
|
|
802
|
+
r.setProperties(I);
|
|
803
803
|
}
|
|
804
|
-
const b =
|
|
804
|
+
const b = r.getContracts();
|
|
805
805
|
if (b !== void 0) {
|
|
806
806
|
const I = Object.keys(b).reduce((m, y) => (m[y] = A.transform(b[y], t), m), {});
|
|
807
|
-
|
|
807
|
+
r.setContracts(I);
|
|
808
808
|
}
|
|
809
|
-
return
|
|
809
|
+
return r;
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
|
-
const x = (
|
|
813
|
-
function z(
|
|
814
|
-
if (
|
|
815
|
-
if (!
|
|
816
|
-
throw new Error(`Path must start with '/': ${
|
|
817
|
-
return
|
|
812
|
+
const x = (n) => !!n && typeof n == "object" && !Array.isArray(n) && !(n instanceof c), O = (n) => n instanceof v || n instanceof P, hn = (n) => n.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
813
|
+
function z(n) {
|
|
814
|
+
if (n === "/") return [];
|
|
815
|
+
if (!n.startsWith("/"))
|
|
816
|
+
throw new Error(`Path must start with '/': ${n}`);
|
|
817
|
+
return n.split("/").slice(1).map(hn);
|
|
818
818
|
}
|
|
819
|
-
function G(
|
|
820
|
-
if (
|
|
821
|
-
const e = typeof
|
|
819
|
+
function G(n) {
|
|
820
|
+
if (n === "-") return -1;
|
|
821
|
+
const e = typeof n == "number" ? n : parseInt(n, 10);
|
|
822
822
|
if (isNaN(e))
|
|
823
|
-
throw new Error(`Invalid array index (NaN) from '${
|
|
823
|
+
throw new Error(`Invalid array index (NaN) from '${n}'`);
|
|
824
824
|
if (!Number.isFinite(e))
|
|
825
825
|
throw new Error(
|
|
826
|
-
`Invalid array index '${
|
|
826
|
+
`Invalid array index '${n}' results in non-finite number ${e}`
|
|
827
827
|
);
|
|
828
828
|
return e;
|
|
829
829
|
}
|
|
830
|
-
function gt(
|
|
830
|
+
function gt(n, e, t, r = !0) {
|
|
831
831
|
switch (e) {
|
|
832
832
|
case "name":
|
|
833
|
-
return t ?
|
|
833
|
+
return t ? r ? n.getName() ?? null : n : n.getName();
|
|
834
834
|
case "description":
|
|
835
|
-
return t ?
|
|
835
|
+
return t ? r ? n.getDescription() : n : n.getDescription();
|
|
836
836
|
case "type":
|
|
837
|
-
return
|
|
837
|
+
return n.getType();
|
|
838
838
|
case "itemType":
|
|
839
|
-
return
|
|
839
|
+
return n.getItemType();
|
|
840
840
|
case "keyType":
|
|
841
|
-
return
|
|
841
|
+
return n.getKeyType();
|
|
842
842
|
case "valueType":
|
|
843
|
-
return
|
|
843
|
+
return n.getValueType();
|
|
844
844
|
case "value":
|
|
845
|
-
return t ?
|
|
845
|
+
return t ? r ? n.getValue() ?? null : n : n.getValue();
|
|
846
846
|
case "blueId":
|
|
847
|
-
return t ?
|
|
847
|
+
return t ? r ? n.getBlueId() ?? null : n : n.getBlueId();
|
|
848
848
|
case "blue":
|
|
849
|
-
return
|
|
849
|
+
return n.getBlue();
|
|
850
850
|
case "items":
|
|
851
|
-
return
|
|
851
|
+
return n.getItems();
|
|
852
852
|
case "properties":
|
|
853
|
-
return
|
|
853
|
+
return n.getProperties();
|
|
854
854
|
case "contracts":
|
|
855
|
-
return
|
|
855
|
+
return n.getContracts();
|
|
856
856
|
default:
|
|
857
857
|
return;
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
|
-
function Xe(
|
|
861
|
-
if (
|
|
862
|
-
const
|
|
863
|
-
|
|
860
|
+
function Xe(n, e, t = !0) {
|
|
861
|
+
if (n instanceof c) {
|
|
862
|
+
const r = gt(
|
|
863
|
+
n,
|
|
864
864
|
e,
|
|
865
865
|
!0,
|
|
866
866
|
t
|
|
867
867
|
);
|
|
868
|
-
if (
|
|
868
|
+
if (r !== void 0 || [
|
|
869
869
|
"name",
|
|
870
870
|
"description",
|
|
871
871
|
"type",
|
|
@@ -879,54 +879,54 @@ function Xe(r, e, t = !0) {
|
|
|
879
879
|
"properties",
|
|
880
880
|
"contracts"
|
|
881
881
|
].includes(e))
|
|
882
|
-
return
|
|
882
|
+
return r;
|
|
883
883
|
if (/^-?\d+$/.test(e) && e !== "-") {
|
|
884
|
-
const i =
|
|
884
|
+
const i = n.getItems(), o = parseInt(e, 10);
|
|
885
885
|
return i && o >= 0 && o < i.length ? i[o] : void 0;
|
|
886
886
|
}
|
|
887
|
-
const s =
|
|
887
|
+
const s = n.getProperties();
|
|
888
888
|
return s && e in s ? s[e] : void 0;
|
|
889
889
|
}
|
|
890
|
-
if (Array.isArray(
|
|
890
|
+
if (Array.isArray(n)) {
|
|
891
891
|
if (e === "-") return;
|
|
892
|
-
const
|
|
893
|
-
return
|
|
892
|
+
const r = G(e);
|
|
893
|
+
return r >= 0 && r < n.length ? n[r] : void 0;
|
|
894
894
|
}
|
|
895
|
-
if (x(
|
|
895
|
+
if (x(n)) return n[e];
|
|
896
896
|
}
|
|
897
|
-
function J(
|
|
897
|
+
function J(n, e) {
|
|
898
898
|
if (e.length === 0)
|
|
899
899
|
return {
|
|
900
|
-
parent:
|
|
900
|
+
parent: n,
|
|
901
901
|
key: "value",
|
|
902
|
-
actualTarget:
|
|
902
|
+
actualTarget: n.getValue() ?? n
|
|
903
903
|
};
|
|
904
|
-
let t =
|
|
904
|
+
let t = n;
|
|
905
905
|
for (let s = 0; s < e.length - 1; ++s) {
|
|
906
906
|
const i = e[s], o = Xe(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
|
-
const
|
|
912
|
-
if (t instanceof
|
|
913
|
-
const s = Xe(t,
|
|
914
|
-
if ((typeof s != "object" || s === null || O(s)) && !(s instanceof
|
|
911
|
+
const r = e[e.length - 1];
|
|
912
|
+
if (t instanceof c) {
|
|
913
|
+
const s = Xe(t, r, !1);
|
|
914
|
+
if ((typeof s != "object" || s === null || O(s)) && !(s instanceof c) && !Array.isArray(s) && ["name", "description", "value", "blueId"].includes(r))
|
|
915
915
|
return {
|
|
916
916
|
parent: t,
|
|
917
|
-
key:
|
|
917
|
+
key: r,
|
|
918
918
|
actualTarget: s
|
|
919
919
|
};
|
|
920
920
|
}
|
|
921
|
-
return Array.isArray(t) &&
|
|
921
|
+
return Array.isArray(t) && r === "-" ? { parent: t, key: "-" } : t instanceof c && t.getItems() && r === "-" ? { parent: t, key: "-" } : {
|
|
922
922
|
parent: t,
|
|
923
|
-
key: Array.isArray(t) ? G(
|
|
923
|
+
key: Array.isArray(t) ? G(r) : r
|
|
924
924
|
};
|
|
925
925
|
}
|
|
926
|
-
function Je(
|
|
926
|
+
function Je(n, e) {
|
|
927
927
|
var t;
|
|
928
|
-
if (
|
|
929
|
-
const
|
|
928
|
+
if (n instanceof c) {
|
|
929
|
+
const r = e, s = gt(n, r, !1);
|
|
930
930
|
if (s !== void 0 || [
|
|
931
931
|
"name",
|
|
932
932
|
"description",
|
|
@@ -940,97 +940,97 @@ function Je(r, e) {
|
|
|
940
940
|
"items",
|
|
941
941
|
"properties",
|
|
942
942
|
"contracts"
|
|
943
|
-
].includes(
|
|
943
|
+
].includes(r))
|
|
944
944
|
return s;
|
|
945
945
|
if (typeof e == "number" || typeof e == "string" && /^\d+$/.test(e)) {
|
|
946
|
-
const i =
|
|
946
|
+
const i = n.getItems(), o = typeof e == "number" ? e : parseInt(e, 10);
|
|
947
947
|
if (i && o >= 0 && o < i.length) return i[o];
|
|
948
948
|
}
|
|
949
|
-
return (t =
|
|
949
|
+
return (t = n.getProperties()) == null ? void 0 : t[r];
|
|
950
950
|
}
|
|
951
|
-
return Array.isArray(
|
|
951
|
+
return Array.isArray(n) || x(n) ? n[e] : n;
|
|
952
952
|
}
|
|
953
|
-
function B(
|
|
954
|
-
if (
|
|
955
|
-
if (
|
|
956
|
-
return
|
|
957
|
-
const e =
|
|
958
|
-
return
|
|
953
|
+
function B(n) {
|
|
954
|
+
if (n instanceof c) return n;
|
|
955
|
+
if (n === null || typeof n == "string" || typeof n == "number" || typeof n == "boolean" || O(n))
|
|
956
|
+
return p.deserialize(n);
|
|
957
|
+
const e = je(n);
|
|
958
|
+
return p.deserialize(e);
|
|
959
959
|
}
|
|
960
|
-
function
|
|
961
|
-
if (
|
|
962
|
-
if (
|
|
963
|
-
if (Array.isArray(
|
|
960
|
+
function je(n) {
|
|
961
|
+
if (n === void 0) return null;
|
|
962
|
+
if (n === null || typeof n != "object") return n;
|
|
963
|
+
if (Array.isArray(n)) return n.map(je);
|
|
964
964
|
const e = {};
|
|
965
|
-
for (const [t,
|
|
966
|
-
e[t] =
|
|
965
|
+
for (const [t, r] of Object.entries(n))
|
|
966
|
+
e[t] = je(r);
|
|
967
967
|
return e;
|
|
968
968
|
}
|
|
969
|
-
function He(
|
|
970
|
-
if (
|
|
971
|
-
const
|
|
972
|
-
switch (
|
|
969
|
+
function He(n, e, t) {
|
|
970
|
+
if (n instanceof c) {
|
|
971
|
+
const r = e;
|
|
972
|
+
switch (r) {
|
|
973
973
|
case "name":
|
|
974
|
-
|
|
974
|
+
n.setName(t);
|
|
975
975
|
return;
|
|
976
976
|
case "description":
|
|
977
|
-
|
|
977
|
+
n.setDescription(t);
|
|
978
978
|
return;
|
|
979
979
|
case "type":
|
|
980
|
-
|
|
981
|
-
t instanceof
|
|
980
|
+
n.setType(
|
|
981
|
+
t instanceof c || typeof t == "string" || t === void 0 ? t : B(t)
|
|
982
982
|
);
|
|
983
983
|
return;
|
|
984
984
|
case "itemType":
|
|
985
|
-
|
|
986
|
-
t instanceof
|
|
985
|
+
n.setItemType(
|
|
986
|
+
t instanceof c || typeof t == "string" || t === void 0 ? t : B(t)
|
|
987
987
|
);
|
|
988
988
|
return;
|
|
989
989
|
case "keyType":
|
|
990
|
-
|
|
991
|
-
t instanceof
|
|
990
|
+
n.setKeyType(
|
|
991
|
+
t instanceof c || typeof t == "string" || t === void 0 ? t : B(t)
|
|
992
992
|
);
|
|
993
993
|
return;
|
|
994
994
|
case "valueType":
|
|
995
|
-
|
|
996
|
-
t instanceof
|
|
995
|
+
n.setValueType(
|
|
996
|
+
t instanceof c || typeof t == "string" || t === void 0 ? t : B(t)
|
|
997
997
|
);
|
|
998
998
|
return;
|
|
999
999
|
case "value": {
|
|
1000
1000
|
const s = t;
|
|
1001
|
-
|
|
1001
|
+
n.setValue(s === void 0 ? null : s);
|
|
1002
1002
|
return;
|
|
1003
1003
|
}
|
|
1004
1004
|
case "blueId":
|
|
1005
|
-
|
|
1005
|
+
n.setBlueId(t);
|
|
1006
1006
|
return;
|
|
1007
1007
|
case "blue":
|
|
1008
|
-
|
|
1009
|
-
t instanceof
|
|
1008
|
+
n.setBlue(
|
|
1009
|
+
t instanceof c || t === void 0 ? t : B(t)
|
|
1010
1010
|
);
|
|
1011
1011
|
return;
|
|
1012
1012
|
case "items":
|
|
1013
|
-
|
|
1013
|
+
n.setItems(t);
|
|
1014
1014
|
return;
|
|
1015
1015
|
case "properties":
|
|
1016
|
-
|
|
1016
|
+
n.setProperties(t);
|
|
1017
1017
|
return;
|
|
1018
1018
|
case "contracts":
|
|
1019
|
-
|
|
1019
|
+
n.setContracts(t);
|
|
1020
1020
|
return;
|
|
1021
1021
|
default: {
|
|
1022
1022
|
if (t === void 0) {
|
|
1023
|
-
const s =
|
|
1024
|
-
s &&
|
|
1023
|
+
const s = n.getProperties();
|
|
1024
|
+
s && r in s && delete s[r];
|
|
1025
1025
|
} else
|
|
1026
|
-
|
|
1026
|
+
n.getProperties() || n.setProperties({}), n.addProperty(r, t instanceof c ? t : B(t));
|
|
1027
1027
|
return;
|
|
1028
1028
|
}
|
|
1029
1029
|
}
|
|
1030
1030
|
}
|
|
1031
|
-
Array.isArray(
|
|
1031
|
+
Array.isArray(n) ? n.splice(G(e), 1) : x(n) && (t === void 0 ? delete n[e] : n[e] = t);
|
|
1032
1032
|
}
|
|
1033
|
-
function
|
|
1033
|
+
function pn(n, e, t, r) {
|
|
1034
1034
|
let s = -1;
|
|
1035
1035
|
if (e !== "-" && (s = typeof e == "number" ? e : parseInt(e, 10), isNaN(s)))
|
|
1036
1036
|
throw new Error(
|
|
@@ -1038,140 +1038,140 @@ function fr(r, e, t, n) {
|
|
|
1038
1038
|
);
|
|
1039
1039
|
if (s < -1)
|
|
1040
1040
|
throw new Error(`Invalid array index for BlueNode items: ${s}`);
|
|
1041
|
-
let i =
|
|
1042
|
-
if (i || (i = [],
|
|
1041
|
+
let i = n.getItems();
|
|
1042
|
+
if (i || (i = [], n.setItems(i)), !r && s !== -1 && s > i.length)
|
|
1043
1043
|
throw new Error(
|
|
1044
1044
|
`ADD operation failed: Target array index '${s}' is greater than array length ${i.length}.`
|
|
1045
1045
|
);
|
|
1046
1046
|
if (e === "-")
|
|
1047
1047
|
i.push(t);
|
|
1048
|
-
else if (
|
|
1048
|
+
else if (r) {
|
|
1049
1049
|
if (s >= 0)
|
|
1050
1050
|
if (s < i.length) i[s] = t;
|
|
1051
1051
|
else {
|
|
1052
1052
|
for (let o = i.length; o < s; o++)
|
|
1053
|
-
i.push(
|
|
1053
|
+
i.push(p.deserialize(null));
|
|
1054
1054
|
i.push(t);
|
|
1055
1055
|
}
|
|
1056
1056
|
} else
|
|
1057
1057
|
i.splice(s, 0, t);
|
|
1058
1058
|
}
|
|
1059
|
-
function he(
|
|
1060
|
-
if (Array.isArray(
|
|
1061
|
-
const s = e === "-" ?
|
|
1062
|
-
if (!
|
|
1059
|
+
function he(n, e, t, r) {
|
|
1060
|
+
if (Array.isArray(n)) {
|
|
1061
|
+
const s = e === "-" ? n.length : G(e);
|
|
1062
|
+
if (!r && s > n.length)
|
|
1063
1063
|
throw new Error(
|
|
1064
|
-
`ADD operation failed: Target array index '${s}' is greater than array length ${
|
|
1064
|
+
`ADD operation failed: Target array index '${s}' is greater than array length ${n.length}. Path involving key '${e}'.`
|
|
1065
1065
|
);
|
|
1066
1066
|
if (s < 0 && e !== "-")
|
|
1067
1067
|
throw new Error(`Invalid negative array index: ${e}`);
|
|
1068
1068
|
const i = B(t);
|
|
1069
|
-
if (
|
|
1070
|
-
if (s >= 0 && s <
|
|
1071
|
-
else if (s >=
|
|
1072
|
-
for (let o =
|
|
1073
|
-
|
|
1074
|
-
|
|
1069
|
+
if (r) {
|
|
1070
|
+
if (s >= 0 && s < n.length) n[s] = i;
|
|
1071
|
+
else if (s >= n.length) {
|
|
1072
|
+
for (let o = n.length; o < s; o++)
|
|
1073
|
+
n.push(p.deserialize(null));
|
|
1074
|
+
n.push(i);
|
|
1075
1075
|
}
|
|
1076
1076
|
} else
|
|
1077
|
-
|
|
1077
|
+
n.splice(s, 0, i);
|
|
1078
1078
|
return;
|
|
1079
1079
|
}
|
|
1080
|
-
if (
|
|
1081
|
-
e === "-" || typeof e == "number" && !isNaN(e) || typeof e == "string" && /^\d+$/.test(e) ?
|
|
1080
|
+
if (n instanceof c) {
|
|
1081
|
+
e === "-" || typeof e == "number" && !isNaN(e) || typeof e == "string" && /^\d+$/.test(e) ? pn(n, e, B(t), r) : He(n, e, t);
|
|
1082
1082
|
return;
|
|
1083
1083
|
}
|
|
1084
|
-
if (x(
|
|
1085
|
-
|
|
1084
|
+
if (x(n)) {
|
|
1085
|
+
n[e] = B(t);
|
|
1086
1086
|
return;
|
|
1087
1087
|
}
|
|
1088
|
-
throw new Error(`Cannot insert into parent of type ${typeof
|
|
1088
|
+
throw new Error(`Cannot insert into parent of type ${typeof n}`);
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1091
|
-
if (Array.isArray(
|
|
1090
|
+
function gn(n, e) {
|
|
1091
|
+
if (Array.isArray(n)) {
|
|
1092
1092
|
const t = G(e);
|
|
1093
|
-
t === -1 && e === "-" ?
|
|
1093
|
+
t === -1 && e === "-" ? n.length > 0 && n.pop() : t >= 0 && t < n.length && n.splice(t, 1);
|
|
1094
1094
|
return;
|
|
1095
1095
|
}
|
|
1096
|
-
if (
|
|
1096
|
+
if (n instanceof c) {
|
|
1097
1097
|
if (typeof e == "number" || typeof e == "string" && /^-?\d+$/.test(e)) {
|
|
1098
|
-
const t =
|
|
1098
|
+
const t = n.getItems();
|
|
1099
1099
|
if (t) {
|
|
1100
|
-
const
|
|
1101
|
-
|
|
1100
|
+
const r = G(e);
|
|
1101
|
+
r === -1 && e === "-" ? t.length > 0 && t.pop() : r >= 0 && r < t.length && t.splice(r, 1), t.length === 0 && n.setItems(void 0);
|
|
1102
1102
|
return;
|
|
1103
1103
|
}
|
|
1104
1104
|
}
|
|
1105
|
-
He(
|
|
1106
|
-
} else x(
|
|
1107
|
-
}
|
|
1108
|
-
function
|
|
1109
|
-
if (
|
|
1110
|
-
if (Array.isArray(
|
|
1111
|
-
return
|
|
1112
|
-
if (x(
|
|
1105
|
+
He(n, e, void 0);
|
|
1106
|
+
} else x(n) && delete n[e];
|
|
1107
|
+
}
|
|
1108
|
+
function Re(n) {
|
|
1109
|
+
if (n instanceof c) return n.clone();
|
|
1110
|
+
if (Array.isArray(n))
|
|
1111
|
+
return n.map((t) => Re(t));
|
|
1112
|
+
if (x(n)) {
|
|
1113
1113
|
const e = {};
|
|
1114
|
-
return Object.keys(
|
|
1115
|
-
e[t] =
|
|
1114
|
+
return Object.keys(n).forEach((t) => {
|
|
1115
|
+
e[t] = Re(n[t]);
|
|
1116
1116
|
}), e;
|
|
1117
1117
|
}
|
|
1118
|
-
return
|
|
1118
|
+
return n;
|
|
1119
1119
|
}
|
|
1120
|
-
function U(
|
|
1121
|
-
if (
|
|
1120
|
+
function U(n, e) {
|
|
1121
|
+
if (n === e || n instanceof c && (n.isInlineValue() || n.getValue() !== void 0) && U(n.getValue() ?? null, e) || e instanceof c && (e.isInlineValue() || e.getValue() !== void 0) && U(n, e.getValue() ?? null))
|
|
1122
1122
|
return !0;
|
|
1123
|
-
if (
|
|
1124
|
-
return
|
|
1125
|
-
if (Array.isArray(
|
|
1126
|
-
return
|
|
1127
|
-
if (x(
|
|
1128
|
-
const t = Object.keys(
|
|
1129
|
-
return t.length ===
|
|
1123
|
+
if (n instanceof c && e instanceof c || O(n) && O(e) || O(n) && typeof e == "number" || typeof n == "number" && O(e))
|
|
1124
|
+
return n.toString() === e.toString();
|
|
1125
|
+
if (Array.isArray(n) && Array.isArray(e))
|
|
1126
|
+
return n.length === e.length && n.every((t, r) => U(t, e[r]));
|
|
1127
|
+
if (x(n) && x(e)) {
|
|
1128
|
+
const t = Object.keys(n), r = Object.keys(e);
|
|
1129
|
+
return t.length === r.length && t.every((s) => U(n[s], e[s]));
|
|
1130
1130
|
}
|
|
1131
1131
|
return !1;
|
|
1132
1132
|
}
|
|
1133
|
-
function yt(
|
|
1134
|
-
const { parent: t, key:
|
|
1135
|
-
return Je(t,
|
|
1133
|
+
function yt(n, e) {
|
|
1134
|
+
const { parent: t, key: r } = J(n, z(e));
|
|
1135
|
+
return Je(t, r);
|
|
1136
1136
|
}
|
|
1137
|
-
function mt(
|
|
1138
|
-
const
|
|
1139
|
-
if (
|
|
1137
|
+
function mt(n, e, t) {
|
|
1138
|
+
const r = z(e);
|
|
1139
|
+
if (r.length === 0 && e === "/") {
|
|
1140
1140
|
const o = B(t);
|
|
1141
|
-
|
|
1141
|
+
n.setValue(o.getValue() ?? null), o.getItems() ? n.setItems(o.getItems()) : n.setItems(void 0);
|
|
1142
1142
|
return;
|
|
1143
1143
|
}
|
|
1144
|
-
const { parent: s, key: i } = J(
|
|
1144
|
+
const { parent: s, key: i } = J(n, r);
|
|
1145
1145
|
he(s, i, t, !0);
|
|
1146
1146
|
}
|
|
1147
|
-
function
|
|
1148
|
-
const
|
|
1149
|
-
if (
|
|
1150
|
-
if (
|
|
1147
|
+
function yn(n, e, t) {
|
|
1148
|
+
const r = z(e);
|
|
1149
|
+
if (r.length === 0 && e === "/") {
|
|
1150
|
+
if (n.getItems() && Array.isArray(t)) {
|
|
1151
1151
|
const o = B(t);
|
|
1152
|
-
o.getItems() ? (
|
|
1152
|
+
o.getItems() ? (n.setItems(o.getItems()), n.setValue(null)) : (n.setValue(o.getValue() ?? null), n.setItems(void 0));
|
|
1153
1153
|
} else {
|
|
1154
1154
|
const o = B(t);
|
|
1155
|
-
|
|
1155
|
+
n.setValue(o.getValue() ?? null), o.getItems() && n.setItems(o.getItems());
|
|
1156
1156
|
}
|
|
1157
1157
|
return !0;
|
|
1158
1158
|
}
|
|
1159
|
-
const { parent: s, key: i } = J(
|
|
1159
|
+
const { parent: s, key: i } = J(n, r);
|
|
1160
1160
|
return he(s, i, t, !1), !0;
|
|
1161
1161
|
}
|
|
1162
|
-
function
|
|
1163
|
-
const
|
|
1164
|
-
if (
|
|
1162
|
+
function mn(n, e, t) {
|
|
1163
|
+
const r = z(e);
|
|
1164
|
+
if (r.length === 0 && e === "/") {
|
|
1165
1165
|
const l = B(t);
|
|
1166
|
-
return
|
|
1166
|
+
return n.setValue(l.getValue() ?? null), l.getItems() ? n.setItems(l.getItems()) : n.setItems(void 0), !0;
|
|
1167
1167
|
}
|
|
1168
|
-
const { parent: s, key: i, actualTarget: o } = J(
|
|
1169
|
-
if (o !== void 0 && s instanceof
|
|
1168
|
+
const { parent: s, key: i, actualTarget: o } = J(n, r);
|
|
1169
|
+
if (o !== void 0 && s instanceof c)
|
|
1170
1170
|
He(s, i, t);
|
|
1171
1171
|
else {
|
|
1172
|
-
const l = Je(s, i),
|
|
1172
|
+
const l = Je(s, i), a = Array.isArray(s) || s instanceof c && s.getItems() && (typeof i == "number" || typeof i == "string" && /^\d+$/.test(i));
|
|
1173
1173
|
if (l === void 0) {
|
|
1174
|
-
if (
|
|
1174
|
+
if (a)
|
|
1175
1175
|
throw new Error(
|
|
1176
1176
|
`REPLACE failed: Target array index '${i.toString()}' is out of bounds or does not exist at path '${e}'.`
|
|
1177
1177
|
);
|
|
@@ -1181,167 +1181,178 @@ function gr(r, e, t) {
|
|
|
1181
1181
|
}
|
|
1182
1182
|
return !0;
|
|
1183
1183
|
}
|
|
1184
|
-
function It(
|
|
1184
|
+
function It(n, e) {
|
|
1185
1185
|
const t = z(e);
|
|
1186
1186
|
if (t.length === 0 && e === "/")
|
|
1187
|
-
return
|
|
1188
|
-
const { parent:
|
|
1189
|
-
return
|
|
1187
|
+
return n.setValue(null), n.setItems(void 0), n.setProperties(void 0), !0;
|
|
1188
|
+
const { parent: r, key: s } = J(n, t);
|
|
1189
|
+
return gn(r, s), !0;
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1192
|
-
const
|
|
1193
|
-
return mt(
|
|
1191
|
+
function In(n, e, t) {
|
|
1192
|
+
const r = Re(yt(n, e));
|
|
1193
|
+
return mt(n, t, r), !0;
|
|
1194
1194
|
}
|
|
1195
|
-
function
|
|
1196
|
-
const
|
|
1195
|
+
function bn(n, e, t) {
|
|
1196
|
+
const r = z(e), { parent: s, key: i } = J(n, r), o = Je(s, i);
|
|
1197
1197
|
if (o === void 0)
|
|
1198
1198
|
throw new Error(`MOVE failed: 'from' location '${e}' does not exist.`);
|
|
1199
|
-
return It(
|
|
1199
|
+
return It(n, e) ? (mt(n, t, o), !0) : !1;
|
|
1200
1200
|
}
|
|
1201
|
-
function
|
|
1202
|
-
const
|
|
1201
|
+
function Tn(n, e, t) {
|
|
1202
|
+
const r = yt(n, e);
|
|
1203
1203
|
let s = t;
|
|
1204
|
-
if (
|
|
1205
|
-
if ((t === null || typeof t == "string" || typeof t == "number" || typeof t == "boolean" || O(t)) && (
|
|
1206
|
-
if (!U(
|
|
1204
|
+
if (r instanceof c)
|
|
1205
|
+
if ((t === null || typeof t == "string" || typeof t == "number" || typeof t == "boolean" || O(t)) && (r.isInlineValue() || r.getValue() !== void 0)) {
|
|
1206
|
+
if (!U(r.getValue() ?? null, t))
|
|
1207
1207
|
throw new Error(
|
|
1208
1208
|
`TEST failed at '${e}': Expected ${JSON.stringify(
|
|
1209
1209
|
t
|
|
1210
|
-
)}, got ${JSON.stringify(
|
|
1210
|
+
)}, got ${JSON.stringify(r.getValue() ?? null)}`
|
|
1211
1211
|
);
|
|
1212
1212
|
return !0;
|
|
1213
|
-
} else typeof t == "object" && !(t instanceof
|
|
1214
|
-
else if (O(
|
|
1215
|
-
|
|
1216
|
-
else if ((
|
|
1213
|
+
} else typeof t == "object" && !(t instanceof c) && (s = B(t));
|
|
1214
|
+
else if (O(r) && typeof t == "number")
|
|
1215
|
+
r instanceof v ? s = new v(t.toString()) : r instanceof P && (s = new P(t.toString()));
|
|
1216
|
+
else if ((r === null || typeof r == "string" || typeof r == "number" || typeof r == "boolean") && O(t)) {
|
|
1217
1217
|
const i = t;
|
|
1218
|
-
!U(
|
|
1218
|
+
!U(r, i.toString()) && (typeof r == "number" && parseFloat(i.toString()));
|
|
1219
1219
|
}
|
|
1220
|
-
if (!U(
|
|
1221
|
-
const i =
|
|
1220
|
+
if (!U(r, s)) {
|
|
1221
|
+
const i = r instanceof c ? r.toString() : JSON.stringify(r), o = s instanceof c ? s.toString() : JSON.stringify(s);
|
|
1222
1222
|
throw new Error(
|
|
1223
1223
|
`TEST failed at '${e}': Expected ${o}, got ${i}`
|
|
1224
1224
|
);
|
|
1225
1225
|
}
|
|
1226
1226
|
return !0;
|
|
1227
1227
|
}
|
|
1228
|
-
function
|
|
1228
|
+
function wn(n, e) {
|
|
1229
1229
|
switch (e.op) {
|
|
1230
1230
|
case "add":
|
|
1231
|
-
return
|
|
1231
|
+
return yn(n, e.path, e.val);
|
|
1232
1232
|
case "replace":
|
|
1233
|
-
return
|
|
1233
|
+
return mn(n, e.path, e.val);
|
|
1234
1234
|
case "remove":
|
|
1235
|
-
return It(
|
|
1235
|
+
return It(n, e.path);
|
|
1236
1236
|
case "copy":
|
|
1237
|
-
return
|
|
1237
|
+
return In(n, e.from, e.path);
|
|
1238
1238
|
case "move":
|
|
1239
|
-
return
|
|
1239
|
+
return bn(n, e.from, e.path);
|
|
1240
1240
|
case "test":
|
|
1241
|
-
return
|
|
1241
|
+
return Tn(n, e.path, e.val);
|
|
1242
1242
|
}
|
|
1243
1243
|
}
|
|
1244
|
-
function
|
|
1245
|
-
const
|
|
1246
|
-
return
|
|
1244
|
+
function jr(n, e, t = !1) {
|
|
1245
|
+
const r = t ? n : n.clone();
|
|
1246
|
+
return wn(r, e), r;
|
|
1247
|
+
}
|
|
1248
|
+
const Ne = Symbol.for("zod-schema-annotations");
|
|
1249
|
+
function Bn() {
|
|
1250
|
+
if (typeof globalThis < "u") return globalThis;
|
|
1251
|
+
if (typeof global < "u") return global;
|
|
1252
|
+
if (typeof window < "u") return window;
|
|
1253
|
+
if (typeof self < "u") return self;
|
|
1254
|
+
throw new Error("Unable to locate global object");
|
|
1247
1255
|
}
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
return Re.set(r, { ...t, ...e }), r;
|
|
1256
|
+
function bt() {
|
|
1257
|
+
const n = Bn();
|
|
1258
|
+
return Ne in n || (n[Ne] = /* @__PURE__ */ new WeakMap()), n[Ne];
|
|
1252
1259
|
}
|
|
1253
|
-
|
|
1260
|
+
function H(n, e) {
|
|
1261
|
+
const t = bt(), r = t.get(n) || {};
|
|
1262
|
+
return t.set(n, { ...r, ...e }), n;
|
|
1263
|
+
}
|
|
1264
|
+
const E = (n) => bt().get(n), vn = (n) => (e) => {
|
|
1254
1265
|
const t = E(e);
|
|
1255
1266
|
return H(e, {
|
|
1256
1267
|
...t,
|
|
1257
|
-
blueDescription:
|
|
1268
|
+
blueDescription: n
|
|
1258
1269
|
});
|
|
1259
|
-
},
|
|
1260
|
-
const e = E(
|
|
1270
|
+
}, En = (n) => {
|
|
1271
|
+
const e = E(n);
|
|
1261
1272
|
return f(e) && Le(e.blueDescription) ? e.blueDescription : null;
|
|
1262
|
-
},
|
|
1273
|
+
}, Rr = (n) => vn(n)(d.string().optional()), Pn = d.union([d.string(), d.boolean()]), An = (n) => (e) => {
|
|
1263
1274
|
const t = E(e);
|
|
1264
1275
|
return H(e, {
|
|
1265
1276
|
...t,
|
|
1266
|
-
blueId:
|
|
1277
|
+
blueId: n
|
|
1267
1278
|
});
|
|
1268
|
-
},
|
|
1269
|
-
const e = E(
|
|
1279
|
+
}, Nn = (n) => {
|
|
1280
|
+
const e = E(n), t = Pn.safeParse(e == null ? void 0 : e.blueId);
|
|
1270
1281
|
return t.success ? t.data : null;
|
|
1271
|
-
},
|
|
1282
|
+
}, xr = (n) => An(n ?? !0)(d.string()), Sn = (n) => (e) => {
|
|
1272
1283
|
const t = E(e);
|
|
1273
1284
|
return H(e, {
|
|
1274
1285
|
...t,
|
|
1275
|
-
blueName:
|
|
1286
|
+
blueName: n
|
|
1276
1287
|
});
|
|
1277
|
-
},
|
|
1278
|
-
const e = E(
|
|
1288
|
+
}, Cn = (n) => {
|
|
1289
|
+
const e = E(n);
|
|
1279
1290
|
return f(e) && Le(e.blueName) ? e.blueName : null;
|
|
1280
|
-
},
|
|
1291
|
+
}, Ur = (n) => {
|
|
1281
1292
|
const e = d.string().optional();
|
|
1282
|
-
return
|
|
1283
|
-
},
|
|
1284
|
-
const e = E(
|
|
1285
|
-
return H(
|
|
1293
|
+
return Sn(n)(e);
|
|
1294
|
+
}, Fn = () => (n) => {
|
|
1295
|
+
const e = E(n);
|
|
1296
|
+
return H(n, {
|
|
1286
1297
|
...e,
|
|
1287
1298
|
blueNode: !0
|
|
1288
1299
|
});
|
|
1289
|
-
},
|
|
1290
|
-
const e = E(
|
|
1300
|
+
}, Vn = (n) => {
|
|
1301
|
+
const e = E(n);
|
|
1291
1302
|
return f(e) && f(e.blueNode) && e.blueNode === !0 ? e.blueNode : null;
|
|
1292
|
-
}, qe = (
|
|
1293
|
-
const
|
|
1294
|
-
return
|
|
1295
|
-
}, xe = "extendedFrom",
|
|
1296
|
-
schema:
|
|
1303
|
+
}, qe = (n) => !!Vn(n), $r = () => {
|
|
1304
|
+
const n = d.instanceof(c);
|
|
1305
|
+
return Fn()(n);
|
|
1306
|
+
}, xe = "extendedFrom", Dn = ({
|
|
1307
|
+
schema: n,
|
|
1297
1308
|
baseSchema: e
|
|
1298
1309
|
}) => {
|
|
1299
|
-
const t = E(
|
|
1300
|
-
return H(
|
|
1310
|
+
const t = E(n) || {};
|
|
1311
|
+
return H(n, {
|
|
1301
1312
|
...t,
|
|
1302
1313
|
[xe]: e
|
|
1303
1314
|
});
|
|
1304
|
-
},
|
|
1305
|
-
const e = E(
|
|
1315
|
+
}, On = (n) => {
|
|
1316
|
+
const e = E(n);
|
|
1306
1317
|
return f(e) && e[xe] ? e[xe] : null;
|
|
1307
|
-
},
|
|
1308
|
-
const t =
|
|
1309
|
-
return N(t) ? !1 : (t == null ? void 0 : t._def) === (e == null ? void 0 : e._def) ? !0 :
|
|
1310
|
-
},
|
|
1311
|
-
get(e, t,
|
|
1318
|
+
}, Tt = (n, e) => {
|
|
1319
|
+
const t = On(n);
|
|
1320
|
+
return N(t) ? !1 : (t == null ? void 0 : t._def) === (e == null ? void 0 : e._def) ? !0 : Tt(t, e);
|
|
1321
|
+
}, jn = (n) => new Proxy(n, {
|
|
1322
|
+
get(e, t, r) {
|
|
1312
1323
|
return t === "extend" ? function(...s) {
|
|
1313
1324
|
const i = e.extend(...s);
|
|
1314
|
-
return
|
|
1325
|
+
return Dn({
|
|
1315
1326
|
schema: i,
|
|
1316
1327
|
baseSchema: e
|
|
1317
1328
|
});
|
|
1318
|
-
} : Reflect.get(e, t,
|
|
1329
|
+
} : Reflect.get(e, t, r);
|
|
1319
1330
|
}
|
|
1320
|
-
}),
|
|
1331
|
+
}), Rn = d.object({
|
|
1321
1332
|
value: d.array(d.string()).optional(),
|
|
1322
1333
|
defaultValue: d.string().optional()
|
|
1323
|
-
}),
|
|
1324
|
-
const e = E(
|
|
1334
|
+
}), xn = (n) => {
|
|
1335
|
+
const e = E(n), t = Rn.passthrough().safeParse(e == null ? void 0 : e.typeBlueId);
|
|
1325
1336
|
return t.success ? t.data : null;
|
|
1326
|
-
},
|
|
1327
|
-
const t = E(e),
|
|
1337
|
+
}, Mr = (n) => (e) => {
|
|
1338
|
+
const t = E(e), r = typeof n == "string" ? { value: [n] } : n, s = jn(e);
|
|
1328
1339
|
return H(s, {
|
|
1329
1340
|
...t,
|
|
1330
1341
|
typeBlueId: {
|
|
1331
1342
|
...(t == null ? void 0 : t.typeBlueId) || {},
|
|
1332
|
-
...
|
|
1343
|
+
...r
|
|
1333
1344
|
}
|
|
1334
1345
|
});
|
|
1335
1346
|
};
|
|
1336
1347
|
class ve {
|
|
1337
1348
|
static resolveBlueId(e) {
|
|
1338
1349
|
var i;
|
|
1339
|
-
const t =
|
|
1350
|
+
const t = xn(e);
|
|
1340
1351
|
if (N(t))
|
|
1341
1352
|
return null;
|
|
1342
|
-
const
|
|
1343
|
-
if (f(
|
|
1344
|
-
return
|
|
1353
|
+
const r = t.defaultValue;
|
|
1354
|
+
if (f(r))
|
|
1355
|
+
return r;
|
|
1345
1356
|
const s = (i = t.value) == null ? void 0 : i[0];
|
|
1346
1357
|
return f(s) ? s : ve.getRepositoryBlueId(t, e);
|
|
1347
1358
|
}
|
|
@@ -1349,16 +1360,19 @@ class ve {
|
|
|
1349
1360
|
throw new Error("Not implemented");
|
|
1350
1361
|
}
|
|
1351
1362
|
}
|
|
1352
|
-
class
|
|
1363
|
+
class Lr {
|
|
1353
1364
|
static isTypeOf(e, t) {
|
|
1354
1365
|
var i;
|
|
1355
|
-
const
|
|
1356
|
-
return N(
|
|
1366
|
+
const r = ve.resolveBlueId(t), s = (i = e.getType()) == null ? void 0 : i.getBlueId();
|
|
1367
|
+
return N(r) || N(s) ? !1 : r === s;
|
|
1357
1368
|
}
|
|
1358
1369
|
}
|
|
1359
|
-
class
|
|
1370
|
+
class Un {
|
|
1360
1371
|
constructor(e) {
|
|
1361
1372
|
u(this, "blueIdMap", /* @__PURE__ */ new Map());
|
|
1373
|
+
this.registerSchemas(e);
|
|
1374
|
+
}
|
|
1375
|
+
registerSchemas(e) {
|
|
1362
1376
|
for (const t of e)
|
|
1363
1377
|
this.registerSchema(t);
|
|
1364
1378
|
}
|
|
@@ -1376,26 +1390,26 @@ class jr {
|
|
|
1376
1390
|
}
|
|
1377
1391
|
getEffectiveBlueId(e) {
|
|
1378
1392
|
const t = e.getType();
|
|
1379
|
-
return f(t) && f(t.getBlueId()) ? t.getBlueId() : f(t) ?
|
|
1393
|
+
return f(t) && f(t.getBlueId()) ? t.getBlueId() : f(t) ? C.calculateBlueIdSync(t) : null;
|
|
1380
1394
|
}
|
|
1381
1395
|
getBlueIdMap() {
|
|
1382
1396
|
return new Map(this.blueIdMap);
|
|
1383
1397
|
}
|
|
1384
1398
|
}
|
|
1385
|
-
class
|
|
1399
|
+
class wt {
|
|
1386
1400
|
static convertValue(e, t) {
|
|
1387
1401
|
var i;
|
|
1388
|
-
const
|
|
1389
|
-
return N(s) ? this.isPrimitive(t) ? this.getDefaultPrimitiveValue(t) : s : te ===
|
|
1402
|
+
const r = (i = e.getType()) == null ? void 0 : i.getBlueId(), s = e.getValue();
|
|
1403
|
+
return N(s) ? this.isPrimitive(t) ? this.getDefaultPrimitiveValue(t) : s : te === r ? this.convertFromString(String(s), t) : ne === r || s instanceof P ? this.convertFromBigDecimal(
|
|
1390
1404
|
new P(s == null ? void 0 : s.toString()),
|
|
1391
1405
|
t
|
|
1392
|
-
) :
|
|
1406
|
+
) : re === r || s instanceof v ? this.convertFromBigInteger(
|
|
1393
1407
|
new v(s == null ? void 0 : s.toString()),
|
|
1394
1408
|
t
|
|
1395
|
-
) : se ===
|
|
1409
|
+
) : se === r || typeof s == "boolean" ? this.convertFromBoolean(!!s, t) : this.convertFromString(String(s), t);
|
|
1396
1410
|
}
|
|
1397
1411
|
static convertFromString(e, t) {
|
|
1398
|
-
if (!t || t instanceof Z || t instanceof
|
|
1412
|
+
if (!t || t instanceof Z || t instanceof Vt || t instanceof Dt)
|
|
1399
1413
|
return e;
|
|
1400
1414
|
if (t instanceof _)
|
|
1401
1415
|
return Number(e);
|
|
@@ -1456,12 +1470,12 @@ class Tt {
|
|
|
1456
1470
|
);
|
|
1457
1471
|
}
|
|
1458
1472
|
}
|
|
1459
|
-
class
|
|
1473
|
+
class $n {
|
|
1460
1474
|
convert(e, t) {
|
|
1461
|
-
return
|
|
1475
|
+
return wt.convertValue(e, t);
|
|
1462
1476
|
}
|
|
1463
1477
|
}
|
|
1464
|
-
class
|
|
1478
|
+
class Mn {
|
|
1465
1479
|
constructor(e) {
|
|
1466
1480
|
this.nodeToObjectConverter = e;
|
|
1467
1481
|
}
|
|
@@ -1469,51 +1483,51 @@ class xr {
|
|
|
1469
1483
|
* Check if the valueSchema can handle structured data (contracts should be processed specially)
|
|
1470
1484
|
*/
|
|
1471
1485
|
canHandleStructuredData(e) {
|
|
1472
|
-
return e instanceof st || e instanceof
|
|
1486
|
+
return e instanceof st || e instanceof Fe || e instanceof Ve || e instanceof it || e instanceof ot;
|
|
1473
1487
|
}
|
|
1474
1488
|
convert(e, t) {
|
|
1475
1489
|
return this.convertFields(e, t);
|
|
1476
1490
|
}
|
|
1477
1491
|
convertFields(e, t) {
|
|
1478
|
-
if (t instanceof
|
|
1479
|
-
const
|
|
1492
|
+
if (t instanceof Ot) {
|
|
1493
|
+
const r = t._def.left, s = t._def.right, i = this.convert(e, r), o = this.convert(e, s);
|
|
1480
1494
|
return { ...i, ...o };
|
|
1481
1495
|
}
|
|
1482
|
-
if (t instanceof
|
|
1496
|
+
if (t instanceof jt)
|
|
1483
1497
|
throw new Error("Union not supported");
|
|
1484
|
-
if (t instanceof
|
|
1498
|
+
if (t instanceof Fe)
|
|
1485
1499
|
return Object.keys(t.shape).reduce((s, i) => {
|
|
1486
|
-
const o = e.getProperties(), l = t.shape[i],
|
|
1487
|
-
if (f(
|
|
1488
|
-
const
|
|
1500
|
+
const o = e.getProperties(), l = t.shape[i], a = Nn(l);
|
|
1501
|
+
if (f(a)) {
|
|
1502
|
+
const h = Le(a) ? a : i, w = o == null ? void 0 : o[h], F = w ? C.calculateBlueIdSync(w) : void 0;
|
|
1489
1503
|
return s[i] = F, s;
|
|
1490
1504
|
}
|
|
1491
|
-
const
|
|
1492
|
-
if (f(
|
|
1493
|
-
const
|
|
1494
|
-
return s[i] =
|
|
1505
|
+
const g = Cn(l);
|
|
1506
|
+
if (f(g)) {
|
|
1507
|
+
const h = o == null ? void 0 : o[g];
|
|
1508
|
+
return s[i] = h == null ? void 0 : h.getName(), s;
|
|
1495
1509
|
}
|
|
1496
|
-
const b =
|
|
1510
|
+
const b = En(l);
|
|
1497
1511
|
if (f(b)) {
|
|
1498
|
-
const
|
|
1499
|
-
return s[i] =
|
|
1512
|
+
const h = o == null ? void 0 : o[b];
|
|
1513
|
+
return s[i] = h == null ? void 0 : h.getDescription(), s;
|
|
1500
1514
|
}
|
|
1501
1515
|
if (i === "name") {
|
|
1502
|
-
const
|
|
1503
|
-
return s[i] =
|
|
1516
|
+
const h = e.getName();
|
|
1517
|
+
return s[i] = h, s;
|
|
1504
1518
|
}
|
|
1505
1519
|
if (i === "description") {
|
|
1506
|
-
const
|
|
1507
|
-
return s[i] =
|
|
1520
|
+
const h = e.getDescription();
|
|
1521
|
+
return s[i] = h, s;
|
|
1508
1522
|
}
|
|
1509
1523
|
const I = e.getContracts();
|
|
1510
1524
|
if (i === "contracts" && f(I) && this.canHandleStructuredData(l)) {
|
|
1511
|
-
const
|
|
1525
|
+
const h = Object.fromEntries(
|
|
1512
1526
|
Object.entries(I).map(([F, ie]) => [
|
|
1513
1527
|
F,
|
|
1514
1528
|
T.get(ie)
|
|
1515
1529
|
])
|
|
1516
|
-
), w =
|
|
1530
|
+
), w = p.deserialize(h);
|
|
1517
1531
|
s[i] = this.nodeToObjectConverter.convert(
|
|
1518
1532
|
w,
|
|
1519
1533
|
l
|
|
@@ -1531,35 +1545,35 @@ class xr {
|
|
|
1531
1545
|
throw new Error("Unknown schema type, " + t.constructor.name);
|
|
1532
1546
|
}
|
|
1533
1547
|
}
|
|
1534
|
-
class
|
|
1548
|
+
class Ln {
|
|
1535
1549
|
constructor(e) {
|
|
1536
1550
|
this.nodeToObjectConverter = e;
|
|
1537
1551
|
}
|
|
1538
1552
|
convert(e, t) {
|
|
1539
|
-
const
|
|
1540
|
-
if (!
|
|
1553
|
+
const r = e.getItems();
|
|
1554
|
+
if (!r)
|
|
1541
1555
|
return;
|
|
1542
1556
|
const s = t.element;
|
|
1543
|
-
return
|
|
1557
|
+
return r.map(
|
|
1544
1558
|
(o) => this.nodeToObjectConverter.convert(o, s)
|
|
1545
1559
|
);
|
|
1546
1560
|
}
|
|
1547
1561
|
}
|
|
1548
|
-
class
|
|
1562
|
+
class Zn {
|
|
1549
1563
|
constructor(e) {
|
|
1550
1564
|
this.nodeToObjectConverter = e;
|
|
1551
1565
|
}
|
|
1552
1566
|
convert(e, t) {
|
|
1553
|
-
const
|
|
1554
|
-
if (!
|
|
1567
|
+
const r = e.getItems();
|
|
1568
|
+
if (!r)
|
|
1555
1569
|
return;
|
|
1556
|
-
const s = t._def.valueType, i =
|
|
1570
|
+
const s = t._def.valueType, i = r.map(
|
|
1557
1571
|
(o) => this.nodeToObjectConverter.convert(o, s)
|
|
1558
1572
|
);
|
|
1559
1573
|
return new Set(i);
|
|
1560
1574
|
}
|
|
1561
1575
|
}
|
|
1562
|
-
class
|
|
1576
|
+
class _n {
|
|
1563
1577
|
constructor(e) {
|
|
1564
1578
|
this.nodeToObjectConverter = e;
|
|
1565
1579
|
}
|
|
@@ -1567,21 +1581,21 @@ class Mr {
|
|
|
1567
1581
|
* Check if the valueSchema can handle structured data (contracts should be processed specially)
|
|
1568
1582
|
*/
|
|
1569
1583
|
canHandleStructuredData(e) {
|
|
1570
|
-
return e instanceof st || e instanceof
|
|
1584
|
+
return e instanceof st || e instanceof Fe || e instanceof Ve || e instanceof it || e instanceof ot;
|
|
1571
1585
|
}
|
|
1572
1586
|
convert(e, t) {
|
|
1573
|
-
const
|
|
1587
|
+
const r = t.keySchema, s = t.valueSchema, i = /* @__PURE__ */ new Map(), o = e.getName();
|
|
1574
1588
|
f(o) && i.set(k, o);
|
|
1575
1589
|
const l = e.getDescription();
|
|
1576
1590
|
f(l) && i.set(Y, l);
|
|
1577
|
-
const
|
|
1578
|
-
if (f(
|
|
1591
|
+
const a = e.getContracts();
|
|
1592
|
+
if (f(a) && this.canHandleStructuredData(s)) {
|
|
1579
1593
|
let b = !1;
|
|
1580
|
-
const I = Object.entries(
|
|
1581
|
-
(m, [y,
|
|
1594
|
+
const I = Object.entries(a).reduce(
|
|
1595
|
+
(m, [y, h]) => {
|
|
1582
1596
|
try {
|
|
1583
1597
|
const w = this.nodeToObjectConverter.convert(
|
|
1584
|
-
|
|
1598
|
+
h,
|
|
1585
1599
|
s
|
|
1586
1600
|
);
|
|
1587
1601
|
w != null && !Number.isNaN(w) && (m[y] = w, b = !0);
|
|
@@ -1593,40 +1607,40 @@ class Mr {
|
|
|
1593
1607
|
);
|
|
1594
1608
|
b && i.set(we, I);
|
|
1595
1609
|
}
|
|
1596
|
-
const
|
|
1597
|
-
return f(
|
|
1598
|
-
const m = new
|
|
1599
|
-
m.setType(new
|
|
1600
|
-
const y =
|
|
1601
|
-
i.set(y,
|
|
1602
|
-
}), t instanceof
|
|
1610
|
+
const g = e.getProperties();
|
|
1611
|
+
return f(g) && Object.entries(g).forEach(([b, I]) => {
|
|
1612
|
+
const m = new c().setValue(b);
|
|
1613
|
+
m.setType(new c().setBlueId(te));
|
|
1614
|
+
const y = wt.convertValue(m, r), h = this.nodeToObjectConverter.convert(I, s);
|
|
1615
|
+
i.set(y, h);
|
|
1616
|
+
}), t instanceof Ve ? Object.fromEntries(i) : i;
|
|
1603
1617
|
}
|
|
1604
1618
|
}
|
|
1605
|
-
class
|
|
1619
|
+
class kn {
|
|
1606
1620
|
convert(e) {
|
|
1607
1621
|
return T.get(e);
|
|
1608
1622
|
}
|
|
1609
1623
|
}
|
|
1610
|
-
class
|
|
1624
|
+
class Yn {
|
|
1611
1625
|
convert(e) {
|
|
1612
1626
|
return T.get(e);
|
|
1613
1627
|
}
|
|
1614
1628
|
}
|
|
1615
|
-
class
|
|
1629
|
+
class Gn {
|
|
1616
1630
|
constructor(e) {
|
|
1617
1631
|
this.nodeToObjectConverter = e;
|
|
1618
1632
|
}
|
|
1619
1633
|
convert(e, t) {
|
|
1620
|
-
const
|
|
1621
|
-
if (!
|
|
1634
|
+
const r = e.getItems();
|
|
1635
|
+
if (!r)
|
|
1622
1636
|
return;
|
|
1623
1637
|
const s = t.items;
|
|
1624
|
-
return
|
|
1638
|
+
return r.map(
|
|
1625
1639
|
(o, l) => this.nodeToObjectConverter.convert(o, s[l])
|
|
1626
1640
|
);
|
|
1627
1641
|
}
|
|
1628
1642
|
}
|
|
1629
|
-
const
|
|
1643
|
+
const zn = d.union([
|
|
1630
1644
|
d.literal("ZodString"),
|
|
1631
1645
|
d.literal("ZodNumber"),
|
|
1632
1646
|
d.literal("ZodBoolean"),
|
|
@@ -1642,17 +1656,17 @@ const kr = d.union([
|
|
|
1642
1656
|
d.literal("ZodAny"),
|
|
1643
1657
|
d.literal("ZodTuple")
|
|
1644
1658
|
]);
|
|
1645
|
-
class
|
|
1659
|
+
class Jn {
|
|
1646
1660
|
constructor(e) {
|
|
1647
1661
|
u(this, "converters", /* @__PURE__ */ new Map());
|
|
1648
1662
|
u(this, "complexObjectConverter");
|
|
1649
|
-
this.nodeToObjectConverter = e, this.registerConverters(), this.complexObjectConverter = new
|
|
1663
|
+
this.nodeToObjectConverter = e, this.registerConverters(), this.complexObjectConverter = new Mn(
|
|
1650
1664
|
this.nodeToObjectConverter
|
|
1651
1665
|
);
|
|
1652
1666
|
}
|
|
1653
1667
|
registerConverters() {
|
|
1654
|
-
const e = new
|
|
1655
|
-
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
|
|
1668
|
+
const e = new $n(), t = new Ln(this.nodeToObjectConverter), r = new Gn(this.nodeToObjectConverter), s = new Zn(this.nodeToObjectConverter), i = new _n(this.nodeToObjectConverter);
|
|
1669
|
+
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 kn()), this.converters.set("ZodAny", new Yn()), this.converters.set("ZodArray", t), this.converters.set("ZodTuple", r), this.converters.set("ZodSet", s), this.converters.set("ZodMap", i), this.converters.set("ZodRecord", i), this.converters.set("ZodObject", this.complexObjectConverter);
|
|
1656
1670
|
}
|
|
1657
1671
|
getConverter(e) {
|
|
1658
1672
|
const t = this.getSchemaTypeName(e);
|
|
@@ -1666,24 +1680,24 @@ class Yr {
|
|
|
1666
1680
|
return e instanceof ae ? this.getSchemaTypeName(e.innerType()) : e instanceof ue ? this.getSchemaTypeName(e.schema) : this.getSchemaTypeName(e.unwrap());
|
|
1667
1681
|
const t = e.constructor.name;
|
|
1668
1682
|
try {
|
|
1669
|
-
return
|
|
1683
|
+
return zn.parse(t);
|
|
1670
1684
|
} catch {
|
|
1671
1685
|
throw new Error(`Schema type name ${t} is not supported`);
|
|
1672
1686
|
}
|
|
1673
1687
|
}
|
|
1674
1688
|
}
|
|
1675
|
-
class
|
|
1689
|
+
class Hn {
|
|
1676
1690
|
constructor(e) {
|
|
1677
1691
|
u(this, "converterFactory");
|
|
1678
|
-
this.typeSchemaResolver = e, this.converterFactory = new
|
|
1692
|
+
this.typeSchemaResolver = e, this.converterFactory = new Jn(this);
|
|
1679
1693
|
}
|
|
1680
1694
|
convert(e, t) {
|
|
1681
1695
|
var o;
|
|
1682
|
-
const
|
|
1696
|
+
const r = (o = this.typeSchemaResolver) == null ? void 0 : o.resolveSchema(e), s = this.unwrapSchema(t);
|
|
1683
1697
|
if (qe(s))
|
|
1684
1698
|
return e;
|
|
1685
1699
|
let i = s;
|
|
1686
|
-
return f(
|
|
1700
|
+
return f(r) && Tt(r, s) && (i = r), this.convertWithType(e, i);
|
|
1687
1701
|
}
|
|
1688
1702
|
convertWithType(e, t) {
|
|
1689
1703
|
return this.converterFactory.getConverter(t).convert(e, t);
|
|
@@ -1708,22 +1722,22 @@ class Ee {
|
|
|
1708
1722
|
return t && t.length > 0 ? t[0] : null;
|
|
1709
1723
|
}
|
|
1710
1724
|
}
|
|
1711
|
-
function
|
|
1725
|
+
function Wn(n) {
|
|
1712
1726
|
return new class extends Ee {
|
|
1713
1727
|
fetchByBlueId(e) {
|
|
1714
|
-
return
|
|
1728
|
+
return n(e);
|
|
1715
1729
|
}
|
|
1716
1730
|
}();
|
|
1717
1731
|
}
|
|
1718
|
-
class
|
|
1732
|
+
class Kn extends Ee {
|
|
1719
1733
|
constructor(t) {
|
|
1720
1734
|
super();
|
|
1721
1735
|
u(this, "nodeProviders");
|
|
1722
1736
|
this.nodeProviders = t;
|
|
1723
1737
|
}
|
|
1724
1738
|
fetchByBlueId(t) {
|
|
1725
|
-
for (const
|
|
1726
|
-
const s =
|
|
1739
|
+
for (const r of this.nodeProviders) {
|
|
1740
|
+
const s = r.fetchByBlueId(t);
|
|
1727
1741
|
if (s && s.length > 0)
|
|
1728
1742
|
return s;
|
|
1729
1743
|
}
|
|
@@ -1732,8 +1746,8 @@ class Jr extends Ee {
|
|
|
1732
1746
|
// Override fetchFirstByBlueId for more efficient implementation
|
|
1733
1747
|
// In Java, this would call the default implementation, but we optimize here
|
|
1734
1748
|
fetchFirstByBlueId(t) {
|
|
1735
|
-
for (const
|
|
1736
|
-
const s =
|
|
1749
|
+
for (const r of this.nodeProviders) {
|
|
1750
|
+
const s = r.fetchFirstByBlueId(t);
|
|
1737
1751
|
if (s)
|
|
1738
1752
|
return s;
|
|
1739
1753
|
}
|
|
@@ -1743,43 +1757,43 @@ class Jr extends Ee {
|
|
|
1743
1757
|
return this.nodeProviders;
|
|
1744
1758
|
}
|
|
1745
1759
|
}
|
|
1746
|
-
const
|
|
1747
|
-
...
|
|
1748
|
-
construct: (
|
|
1749
|
-
const e =
|
|
1750
|
-
if (!
|
|
1760
|
+
const Se = L.types.float.options, Xn = {
|
|
1761
|
+
...Se,
|
|
1762
|
+
construct: (n) => {
|
|
1763
|
+
const e = n.replace(/_/g, "").toLowerCase();
|
|
1764
|
+
if (!rt(e))
|
|
1751
1765
|
return new P(e);
|
|
1752
|
-
if (
|
|
1753
|
-
return
|
|
1766
|
+
if (Se.construct)
|
|
1767
|
+
return Se.construct(n);
|
|
1754
1768
|
}
|
|
1755
|
-
},
|
|
1769
|
+
}, qn = new L.Type("tag:yaml.org,2002:float", Xn), Ce = L.types.int.options, Qn = {
|
|
1756
1770
|
...Ce,
|
|
1757
|
-
construct: (
|
|
1758
|
-
let e =
|
|
1759
|
-
if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), !
|
|
1771
|
+
construct: (n) => {
|
|
1772
|
+
let e = n;
|
|
1773
|
+
if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), !rt(e))
|
|
1760
1774
|
return new v(e);
|
|
1761
1775
|
if (Ce.construct)
|
|
1762
|
-
return Ce.construct(
|
|
1776
|
+
return Ce.construct(n);
|
|
1763
1777
|
}
|
|
1764
|
-
},
|
|
1765
|
-
implicit: [
|
|
1766
|
-
}), ee = (
|
|
1767
|
-
const e = L.load(
|
|
1778
|
+
}, er = new L.Type("tag:yaml.org,2002:int", Qn), Bt = L.CORE_SCHEMA.extend({
|
|
1779
|
+
implicit: [qn, er]
|
|
1780
|
+
}), ee = (n) => {
|
|
1781
|
+
const e = L.load(n, { schema: Bt });
|
|
1768
1782
|
return e === void 0 ? void 0 : e;
|
|
1769
|
-
},
|
|
1770
|
-
schema:
|
|
1783
|
+
}, Zr = (n) => L.dump(n, {
|
|
1784
|
+
schema: Bt,
|
|
1771
1785
|
replacer: (e, t) => {
|
|
1772
|
-
if (
|
|
1786
|
+
if (S(t)) {
|
|
1773
1787
|
if (Q(t)) {
|
|
1774
|
-
const
|
|
1775
|
-
if (t.lt(
|
|
1788
|
+
const r = new R(Number.MIN_SAFE_INTEGER.toString()), s = new R(Number.MAX_SAFE_INTEGER.toString());
|
|
1789
|
+
if (t.lt(r) || t.gt(s))
|
|
1776
1790
|
return t.toString();
|
|
1777
1791
|
}
|
|
1778
1792
|
return t.toNumber();
|
|
1779
1793
|
}
|
|
1780
1794
|
return t;
|
|
1781
1795
|
}
|
|
1782
|
-
}),
|
|
1796
|
+
}), vt = `- type:
|
|
1783
1797
|
blueId: 27B7fuxQCS1VAptiCPc2RMkKoutP5qxkh3uDxZ7dr6Eo
|
|
1784
1798
|
mappings:
|
|
1785
1799
|
Text: F92yo19rCcbBoBSpUA5LRxpfDejJDAaP1PRxxbWAraVP
|
|
@@ -1790,20 +1804,20 @@ const Ne = L.types.float.options, Hr = {
|
|
|
1790
1804
|
Dictionary: 294NBTj2mFRL3RB4kDRUSckwGg7Kzj6T8CTAFeR1kcSA
|
|
1791
1805
|
- type:
|
|
1792
1806
|
blueId: FGYuTXwaoSKfZmpTysLTLsb8WzSqf43384rKZDkXhxD4
|
|
1793
|
-
`,
|
|
1794
|
-
description: TODO`,
|
|
1807
|
+
`, tr = `name: Transformation
|
|
1808
|
+
description: TODO`, nr = `name: Infer Basic Types For Untyped Values
|
|
1795
1809
|
type:
|
|
1796
1810
|
blueId: Ct1SGRGw1i47qjzm1ruiUdSZofeV6WevPTGuieVvbRS4
|
|
1797
|
-
description: This transformation infers type details for Text, Integer, Number and Boolean.`,
|
|
1811
|
+
description: This transformation infers type details for Text, Integer, Number and Boolean.`, rr = `name: Replace Inline Types with BlueIds
|
|
1798
1812
|
type:
|
|
1799
1813
|
blueId: Ct1SGRGw1i47qjzm1ruiUdSZofeV6WevPTGuieVvbRS4
|
|
1800
|
-
description: This transformation replaces`,
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1814
|
+
description: This transformation replaces`, sr = [
|
|
1815
|
+
vt,
|
|
1816
|
+
tr,
|
|
1817
|
+
nr,
|
|
1818
|
+
rr
|
|
1805
1819
|
];
|
|
1806
|
-
class
|
|
1820
|
+
class ir extends Ee {
|
|
1807
1821
|
constructor() {
|
|
1808
1822
|
super();
|
|
1809
1823
|
u(this, "blueIdToNodesMap", /* @__PURE__ */ new Map());
|
|
@@ -1813,19 +1827,19 @@ class rn extends Ee {
|
|
|
1813
1827
|
return this.blueIdToNodesMap.get(t) || [];
|
|
1814
1828
|
}
|
|
1815
1829
|
load() {
|
|
1816
|
-
for (const t of
|
|
1817
|
-
const
|
|
1818
|
-
if (
|
|
1830
|
+
for (const t of sr) {
|
|
1831
|
+
const r = ee(t);
|
|
1832
|
+
if (r === void 0) {
|
|
1819
1833
|
console.error(`This content file is not valid YAML: ${t}`);
|
|
1820
1834
|
continue;
|
|
1821
1835
|
}
|
|
1822
|
-
if (Array.isArray(
|
|
1823
|
-
const s =
|
|
1824
|
-
(o) =>
|
|
1825
|
-
), i =
|
|
1836
|
+
if (Array.isArray(r)) {
|
|
1837
|
+
const s = r.map(
|
|
1838
|
+
(o) => p.deserialize(o)
|
|
1839
|
+
), i = C.calculateBlueIdSync(s);
|
|
1826
1840
|
this.blueIdToNodesMap.set(i, s);
|
|
1827
1841
|
} else {
|
|
1828
|
-
const s =
|
|
1842
|
+
const s = p.deserialize(r), i = C.calculateBlueIdSync(s);
|
|
1829
1843
|
this.blueIdToNodesMap.set(i, [s]);
|
|
1830
1844
|
}
|
|
1831
1845
|
}
|
|
@@ -1835,7 +1849,7 @@ const me = class me extends Ee {
|
|
|
1835
1849
|
constructor() {
|
|
1836
1850
|
super();
|
|
1837
1851
|
u(this, "nodeProvider");
|
|
1838
|
-
this.nodeProvider = new
|
|
1852
|
+
this.nodeProvider = new ir();
|
|
1839
1853
|
}
|
|
1840
1854
|
fetchByBlueId(t) {
|
|
1841
1855
|
return this.nodeProvider.fetchByBlueId(t);
|
|
@@ -1850,85 +1864,85 @@ class pe {
|
|
|
1850
1864
|
* @returns A wrapped NodeProvider that includes bootstrap providers
|
|
1851
1865
|
*/
|
|
1852
1866
|
static wrap(e) {
|
|
1853
|
-
return new
|
|
1867
|
+
return new Kn([
|
|
1854
1868
|
Ue.INSTANCE,
|
|
1855
1869
|
e
|
|
1856
1870
|
]);
|
|
1857
1871
|
}
|
|
1858
1872
|
}
|
|
1859
|
-
const
|
|
1860
|
-
const e =
|
|
1861
|
-
return
|
|
1862
|
-
},
|
|
1863
|
-
const e =
|
|
1864
|
-
return
|
|
1865
|
-
}, Qe = async (
|
|
1866
|
-
if (
|
|
1867
|
-
return
|
|
1873
|
+
const Et = (n) => n instanceof c || Array.isArray(n) && n.every((e) => e instanceof c) ? n : be(n) ? n.map((e) => p.deserialize(e)) : p.deserialize(n), or = async (n) => {
|
|
1874
|
+
const e = Et(n);
|
|
1875
|
+
return C.calculateBlueId(e);
|
|
1876
|
+
}, _r = (n) => {
|
|
1877
|
+
const e = Et(n);
|
|
1878
|
+
return C.calculateBlueIdSync(e);
|
|
1879
|
+
}, Qe = async (n) => {
|
|
1880
|
+
if (Xt(n))
|
|
1881
|
+
return n;
|
|
1868
1882
|
try {
|
|
1869
|
-
const e = fe.parse(
|
|
1883
|
+
const e = fe.parse(n), t = await or(e);
|
|
1870
1884
|
return {
|
|
1871
|
-
...
|
|
1885
|
+
...n,
|
|
1872
1886
|
blueId: t
|
|
1873
1887
|
};
|
|
1874
1888
|
} catch (e) {
|
|
1875
1889
|
throw new Error(`Failed enriching object with Blue ID: ${e}`);
|
|
1876
1890
|
}
|
|
1877
|
-
},
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
),
|
|
1891
|
+
}, kr = (n) => n == null ? void 0 : n.items, Yr = (n) => n == null ? void 0 : n.value, Gr = (n) => N(n) ? {} : dt(
|
|
1892
|
+
n,
|
|
1893
|
+
Lt
|
|
1894
|
+
), zr = (n) => Qt(n) ? n.type.name ?? null : en(n) ? Rt(typeof n.value) : qt(n) ? "List" : null, lr = (n) => f(n) && Object.keys(dt(n, ["blueId"])).length > 0, Jr = (n) => {
|
|
1881
1895
|
try {
|
|
1882
|
-
const e =
|
|
1896
|
+
const e = p.deserialize(n), t = T.get(e);
|
|
1883
1897
|
return q.parse(t);
|
|
1884
1898
|
} catch (e) {
|
|
1885
1899
|
throw new Error(
|
|
1886
1900
|
`Failed transforming JSON-like value to BlueObject: ${e}`
|
|
1887
1901
|
);
|
|
1888
1902
|
}
|
|
1889
|
-
}, et = async (
|
|
1903
|
+
}, et = async (n) => {
|
|
1890
1904
|
const {
|
|
1891
1905
|
resolveFunction: e,
|
|
1892
1906
|
signal: t = new AbortController().signal,
|
|
1893
|
-
omitItems:
|
|
1894
|
-
} =
|
|
1895
|
-
let i = await
|
|
1907
|
+
omitItems: r
|
|
1908
|
+
} = n, s = n.count ?? n.items.length;
|
|
1909
|
+
let i = await xt(n.items, async (l) => await Qe(l));
|
|
1896
1910
|
const o = Math.max((i == null ? void 0 : i.length) - s, 0);
|
|
1897
1911
|
for (let l = i.length - 1; l >= o; l--)
|
|
1898
|
-
if (!
|
|
1899
|
-
const
|
|
1900
|
-
if (Array.isArray(
|
|
1912
|
+
if (!lr(i[l])) {
|
|
1913
|
+
const a = await e(i[l], { signal: t });
|
|
1914
|
+
if (Array.isArray(a))
|
|
1901
1915
|
return et({
|
|
1902
|
-
...
|
|
1916
|
+
...n,
|
|
1903
1917
|
items: [
|
|
1904
1918
|
...i.slice(0, l),
|
|
1905
|
-
...
|
|
1919
|
+
...a,
|
|
1906
1920
|
...i.slice(l + 1)
|
|
1907
1921
|
]
|
|
1908
1922
|
});
|
|
1909
|
-
const
|
|
1910
|
-
if (
|
|
1923
|
+
const g = await Qe(a);
|
|
1924
|
+
if (r != null && r.includes(g.blueId))
|
|
1911
1925
|
return et({
|
|
1912
|
-
...
|
|
1926
|
+
...n,
|
|
1913
1927
|
items: [...i.slice(0, l), ...i.slice(l + 1)]
|
|
1914
1928
|
});
|
|
1915
1929
|
i = [
|
|
1916
1930
|
...i.slice(0, l),
|
|
1917
|
-
|
|
1931
|
+
g,
|
|
1918
1932
|
...i.slice(l + 1)
|
|
1919
1933
|
];
|
|
1920
1934
|
}
|
|
1921
1935
|
return i;
|
|
1922
1936
|
};
|
|
1923
|
-
function ce(
|
|
1937
|
+
function ce(n) {
|
|
1924
1938
|
try {
|
|
1925
|
-
const e = new URL(
|
|
1939
|
+
const e = new URL(n);
|
|
1926
1940
|
return e.protocol === "http:" || e.protocol === "https:";
|
|
1927
1941
|
} catch {
|
|
1928
1942
|
return !1;
|
|
1929
1943
|
}
|
|
1930
1944
|
}
|
|
1931
|
-
class
|
|
1945
|
+
class cr {
|
|
1932
1946
|
/**
|
|
1933
1947
|
* Process a document node to infer basic types for untyped values
|
|
1934
1948
|
* @param document - The document to process
|
|
@@ -1943,8 +1957,8 @@ class on {
|
|
|
1943
1957
|
* @returns The node with the inferred type
|
|
1944
1958
|
*/
|
|
1945
1959
|
inferType(e) {
|
|
1946
|
-
const t = e.getType(),
|
|
1947
|
-
return N(t) && f(
|
|
1960
|
+
const t = e.getType(), r = e.getValue();
|
|
1961
|
+
return N(t) && f(r) && (typeof r == "string" ? e.setType(new c().setBlueId(te)) : typeof r == "bigint" || Q(r) ? e.setType(new c().setBlueId(re)) : tn(r) ? e.setType(new c().setBlueId(ne)) : typeof r == "boolean" && e.setType(new c().setBlueId(se))), e;
|
|
1948
1962
|
}
|
|
1949
1963
|
}
|
|
1950
1964
|
const W = class W {
|
|
@@ -1954,13 +1968,13 @@ const W = class W {
|
|
|
1954
1968
|
*/
|
|
1955
1969
|
constructor(e) {
|
|
1956
1970
|
u(this, "mappings", /* @__PURE__ */ new Map());
|
|
1957
|
-
if (e instanceof
|
|
1958
|
-
const
|
|
1959
|
-
if (
|
|
1960
|
-
const i =
|
|
1971
|
+
if (e instanceof c) {
|
|
1972
|
+
const r = e.getProperties();
|
|
1973
|
+
if (r && r[W.MAPPINGS]) {
|
|
1974
|
+
const i = r[W.MAPPINGS].getProperties();
|
|
1961
1975
|
i && Object.entries(i).forEach(([o, l]) => {
|
|
1962
|
-
const
|
|
1963
|
-
typeof
|
|
1976
|
+
const a = l.getValue();
|
|
1977
|
+
typeof a == "string" && this.mappings.set(o, a);
|
|
1964
1978
|
});
|
|
1965
1979
|
}
|
|
1966
1980
|
} else
|
|
@@ -1980,11 +1994,11 @@ const W = class W {
|
|
|
1980
1994
|
}
|
|
1981
1995
|
transformTypeField(e, t) {
|
|
1982
1996
|
if (t && t.isInlineValue() && t.getValue() !== void 0) {
|
|
1983
|
-
const
|
|
1984
|
-
if (this.mappings.has(
|
|
1985
|
-
const s = this.mappings.get(
|
|
1997
|
+
const r = String(t.getValue());
|
|
1998
|
+
if (this.mappings.has(r)) {
|
|
1999
|
+
const s = this.mappings.get(r);
|
|
1986
2000
|
if (s) {
|
|
1987
|
-
const i = new
|
|
2001
|
+
const i = new c().setBlueId(s);
|
|
1988
2002
|
t === e.getType() ? e.setType(i) : t === e.getItemType() ? e.setItemType(i) : t === e.getKeyType() ? e.setKeyType(i) : t === e.getValueType() && e.setValueType(i);
|
|
1989
2003
|
}
|
|
1990
2004
|
}
|
|
@@ -1993,7 +2007,7 @@ const W = class W {
|
|
|
1993
2007
|
};
|
|
1994
2008
|
u(W, "MAPPINGS", "mappings");
|
|
1995
2009
|
let $e = W;
|
|
1996
|
-
class
|
|
2010
|
+
class ar {
|
|
1997
2011
|
/**
|
|
1998
2012
|
* Creates a new NodeExtender with the specified NodeProvider and optional strategy
|
|
1999
2013
|
* @param nodeProvider - The NodeProvider to use for resolving nodes
|
|
@@ -2012,11 +2026,11 @@ class ln {
|
|
|
2012
2026
|
extend(e, t) {
|
|
2013
2027
|
this.extendNode(e, t, "");
|
|
2014
2028
|
}
|
|
2015
|
-
extendNode(e, t,
|
|
2029
|
+
extendNode(e, t, r, s = !1) {
|
|
2016
2030
|
if (!s) {
|
|
2017
|
-
if (!t.shouldExtendPathSegment(
|
|
2031
|
+
if (!t.shouldExtendPathSegment(r, e))
|
|
2018
2032
|
return;
|
|
2019
|
-
t.enterPathSegment(
|
|
2033
|
+
t.enterPathSegment(r, e);
|
|
2020
2034
|
}
|
|
2021
2035
|
try {
|
|
2022
2036
|
const i = e.getBlueId();
|
|
@@ -2024,10 +2038,10 @@ class ln {
|
|
|
2024
2038
|
const y = this.fetchNode(e);
|
|
2025
2039
|
if (y && y.length > 0)
|
|
2026
2040
|
if (y.length === 1) {
|
|
2027
|
-
const
|
|
2028
|
-
this.mergeNodes(e,
|
|
2041
|
+
const h = y[0];
|
|
2042
|
+
this.mergeNodes(e, h);
|
|
2029
2043
|
} else {
|
|
2030
|
-
const
|
|
2044
|
+
const h = y.map((F) => F.clone()), w = new c().setItems(h);
|
|
2031
2045
|
this.mergeNodes(e, w);
|
|
2032
2046
|
}
|
|
2033
2047
|
}
|
|
@@ -2035,17 +2049,17 @@ class ln {
|
|
|
2035
2049
|
o && this.extendNode(o, t, "type", !0);
|
|
2036
2050
|
const l = e.getItemType();
|
|
2037
2051
|
l && this.extendNode(l, t, "itemType", !0);
|
|
2038
|
-
const
|
|
2039
|
-
|
|
2040
|
-
const
|
|
2041
|
-
|
|
2052
|
+
const a = e.getKeyType();
|
|
2053
|
+
a && this.extendNode(a, t, "keyType", !0);
|
|
2054
|
+
const g = e.getValueType();
|
|
2055
|
+
g && this.extendNode(g, t, "valueType", !0);
|
|
2042
2056
|
const b = e.getProperties();
|
|
2043
|
-
b && Object.entries(b).forEach(([y,
|
|
2044
|
-
this.extendNode(
|
|
2057
|
+
b && Object.entries(b).forEach(([y, h]) => {
|
|
2058
|
+
this.extendNode(h, t, y, !1);
|
|
2045
2059
|
});
|
|
2046
2060
|
const I = e.getContracts();
|
|
2047
|
-
I && Object.entries(I).forEach(([y,
|
|
2048
|
-
this.extendNode(
|
|
2061
|
+
I && Object.entries(I).forEach(([y, h]) => {
|
|
2062
|
+
this.extendNode(h, t, y, !1);
|
|
2049
2063
|
});
|
|
2050
2064
|
const m = e.getItems();
|
|
2051
2065
|
if (m && m.length > 0) {
|
|
@@ -2059,10 +2073,10 @@ class ln {
|
|
|
2059
2073
|
}
|
|
2060
2074
|
reconstructList(e) {
|
|
2061
2075
|
for (; e.length > 0; ) {
|
|
2062
|
-
const t = e[0],
|
|
2063
|
-
if (!
|
|
2076
|
+
const t = e[0], r = t == null ? void 0 : t.getBlueId();
|
|
2077
|
+
if (!r)
|
|
2064
2078
|
break;
|
|
2065
|
-
const s = this.nodeProvider.fetchByBlueId(
|
|
2079
|
+
const s = this.nodeProvider.fetchByBlueId(r);
|
|
2066
2080
|
if (!s || s.length === 1)
|
|
2067
2081
|
break;
|
|
2068
2082
|
e.shift(), e.unshift(...s);
|
|
@@ -2075,36 +2089,36 @@ class ln {
|
|
|
2075
2089
|
return null;
|
|
2076
2090
|
throw new Error(`No blueId found for node: ${e.getName()}`);
|
|
2077
2091
|
}
|
|
2078
|
-
const
|
|
2079
|
-
if (!
|
|
2092
|
+
const r = this.nodeProvider.fetchByBlueId(t);
|
|
2093
|
+
if (!r || r.length === 0) {
|
|
2080
2094
|
if (this.strategy === "RETURN_EMPTY")
|
|
2081
2095
|
return null;
|
|
2082
2096
|
throw new Error(`No content found for blueId: ${e.getBlueId()}`);
|
|
2083
2097
|
}
|
|
2084
|
-
return
|
|
2098
|
+
return r;
|
|
2085
2099
|
}
|
|
2086
2100
|
mergeNodes(e, t) {
|
|
2087
2101
|
e.setName(t.getName()), e.setDescription(t.getDescription()), e.setType(t.getType()), e.setItemType(t.getItemType()), e.setKeyType(t.getKeyType()), e.setValueType(t.getValueType()), e.setValue(t.getValue() ?? null), e.setItems(t.getItems()), e.setProperties(t.getProperties()), e.setContracts(t.getContracts());
|
|
2088
2102
|
}
|
|
2089
2103
|
}
|
|
2090
|
-
class
|
|
2104
|
+
class ur {
|
|
2091
2105
|
}
|
|
2092
|
-
function tt(
|
|
2093
|
-
const t =
|
|
2106
|
+
function tt(n, e) {
|
|
2107
|
+
const t = n.split(e), r = [...t].reverse().findIndex((i) => i !== ""), s = r === -1 ? 0 : t.length - r;
|
|
2094
2108
|
return t.slice(0, s);
|
|
2095
2109
|
}
|
|
2096
|
-
class
|
|
2110
|
+
class Pt extends ur {
|
|
2097
2111
|
/**
|
|
2098
2112
|
* Creates path limits with the specified paths and max depth
|
|
2099
2113
|
* @param allowedPaths - The paths to limit extension to
|
|
2100
2114
|
* @param maxDepth - The maximum depth of paths to allow
|
|
2101
2115
|
*/
|
|
2102
|
-
constructor(t,
|
|
2116
|
+
constructor(t, r) {
|
|
2103
2117
|
super();
|
|
2104
2118
|
u(this, "allowedPaths");
|
|
2105
2119
|
u(this, "maxDepth");
|
|
2106
2120
|
u(this, "currentPath", []);
|
|
2107
|
-
this.allowedPaths = t, this.maxDepth =
|
|
2121
|
+
this.allowedPaths = t, this.maxDepth = r;
|
|
2108
2122
|
}
|
|
2109
2123
|
/**
|
|
2110
2124
|
* Determines if a path segment should be extended
|
|
@@ -2114,10 +2128,10 @@ class Et extends cn {
|
|
|
2114
2128
|
shouldExtendPathSegment(t) {
|
|
2115
2129
|
if (this.currentPath.length >= this.maxDepth)
|
|
2116
2130
|
return !1;
|
|
2117
|
-
const
|
|
2131
|
+
const r = this.normalizePath(
|
|
2118
2132
|
this.getCurrentFullPath() + "/" + t
|
|
2119
2133
|
);
|
|
2120
|
-
return this.isAllowedPath(
|
|
2134
|
+
return this.isAllowedPath(r);
|
|
2121
2135
|
}
|
|
2122
2136
|
/**
|
|
2123
2137
|
* Determines if a path segment should be merged
|
|
@@ -2133,8 +2147,8 @@ class Et extends cn {
|
|
|
2133
2147
|
* @returns True if the path is allowed, false otherwise
|
|
2134
2148
|
*/
|
|
2135
2149
|
isAllowedPath(t) {
|
|
2136
|
-
for (const
|
|
2137
|
-
if (this.matchesAllowedPath(
|
|
2150
|
+
for (const r of this.allowedPaths)
|
|
2151
|
+
if (this.matchesAllowedPath(r, t))
|
|
2138
2152
|
return !0;
|
|
2139
2153
|
return !1;
|
|
2140
2154
|
}
|
|
@@ -2144,8 +2158,8 @@ class Et extends cn {
|
|
|
2144
2158
|
* @param path - The path to check
|
|
2145
2159
|
* @returns True if the path matches the allowed path pattern, false otherwise
|
|
2146
2160
|
*/
|
|
2147
|
-
matchesAllowedPath(t,
|
|
2148
|
-
const s = tt(t, "/"), i = tt(
|
|
2161
|
+
matchesAllowedPath(t, r) {
|
|
2162
|
+
const s = tt(t, "/"), i = tt(r, "/");
|
|
2149
2163
|
if (i.length > s.length)
|
|
2150
2164
|
return !1;
|
|
2151
2165
|
for (let o = 1; o < i.length; o++)
|
|
@@ -2179,7 +2193,7 @@ class Et extends cn {
|
|
|
2179
2193
|
* @returns The normalized path
|
|
2180
2194
|
*/
|
|
2181
2195
|
normalizePath(t) {
|
|
2182
|
-
return "/" + t.split("/").filter((
|
|
2196
|
+
return "/" + t.split("/").filter((r) => r !== "").join("/");
|
|
2183
2197
|
}
|
|
2184
2198
|
/**
|
|
2185
2199
|
* Creates path limits with a maximum depth
|
|
@@ -2187,7 +2201,7 @@ class Et extends cn {
|
|
|
2187
2201
|
* @returns The path limits
|
|
2188
2202
|
*/
|
|
2189
2203
|
static withMaxDepth(t) {
|
|
2190
|
-
return new
|
|
2204
|
+
return new nt().setMaxDepth(t).addPath("*").build();
|
|
2191
2205
|
}
|
|
2192
2206
|
/**
|
|
2193
2207
|
* Creates path limits with a single path
|
|
@@ -2195,10 +2209,10 @@ class Et extends cn {
|
|
|
2195
2209
|
* @returns The path limits
|
|
2196
2210
|
*/
|
|
2197
2211
|
static withSinglePath(t) {
|
|
2198
|
-
return new
|
|
2212
|
+
return new nt().addPath(t).build();
|
|
2199
2213
|
}
|
|
2200
2214
|
}
|
|
2201
|
-
class
|
|
2215
|
+
class nt {
|
|
2202
2216
|
constructor() {
|
|
2203
2217
|
u(this, "allowedPaths", /* @__PURE__ */ new Set());
|
|
2204
2218
|
u(this, "maxDepth", Number.MAX_SAFE_INTEGER);
|
|
@@ -2224,10 +2238,10 @@ class rt {
|
|
|
2224
2238
|
* @returns The built PathLimits
|
|
2225
2239
|
*/
|
|
2226
2240
|
build() {
|
|
2227
|
-
return new
|
|
2241
|
+
return new Pt(this.allowedPaths, this.maxDepth);
|
|
2228
2242
|
}
|
|
2229
2243
|
}
|
|
2230
|
-
class
|
|
2244
|
+
class At {
|
|
2231
2245
|
constructor() {
|
|
2232
2246
|
u(this, "blueIdsCollections", []);
|
|
2233
2247
|
}
|
|
@@ -2254,12 +2268,12 @@ class Pt {
|
|
|
2254
2268
|
const t = {};
|
|
2255
2269
|
for (const s of this.blueIdsCollections)
|
|
2256
2270
|
Object.assign(t, s);
|
|
2257
|
-
const
|
|
2271
|
+
const r = Object.entries(t).map(([s, i]) => ` ${s}: ${i}`).join(`
|
|
2258
2272
|
`);
|
|
2259
2273
|
return `- type:
|
|
2260
2274
|
blueId: ${e}
|
|
2261
2275
|
mappings:
|
|
2262
|
-
${
|
|
2276
|
+
${r}`;
|
|
2263
2277
|
}
|
|
2264
2278
|
/**
|
|
2265
2279
|
* Gets all currently registered BlueIds as a merged object
|
|
@@ -2309,10 +2323,10 @@ const Ie = class Ie {
|
|
|
2309
2323
|
u(this, "nodeProvider");
|
|
2310
2324
|
u(this, "defaultSimpleBlue", null);
|
|
2311
2325
|
u(this, "blueIdsMappingGenerator");
|
|
2312
|
-
const { nodeProvider: t, processorProvider:
|
|
2326
|
+
const { nodeProvider: t, processorProvider: r, blueIdsMappingGenerator: s } = e;
|
|
2313
2327
|
if (!t)
|
|
2314
2328
|
throw new Error("NodeProvider is required");
|
|
2315
|
-
this.nodeProvider = pe.wrap(t), this.processorProvider =
|
|
2329
|
+
this.nodeProvider = pe.wrap(t), this.processorProvider = r || Ie.getStandardProvider(), this.blueIdsMappingGenerator = s || new At(), this.loadDefaultSimpleBlue();
|
|
2316
2330
|
}
|
|
2317
2331
|
/**
|
|
2318
2332
|
* Preprocesses a document node
|
|
@@ -2337,27 +2351,27 @@ const Ie = class Ie {
|
|
|
2337
2351
|
* @returns The preprocessed document
|
|
2338
2352
|
*/
|
|
2339
2353
|
preprocessWithOptions(e, t) {
|
|
2340
|
-
let
|
|
2354
|
+
let r = e.clone(), s = r.getBlue();
|
|
2341
2355
|
if (!s && t && (s = t.clone()), s) {
|
|
2342
|
-
new
|
|
2356
|
+
new ar(this.nodeProvider).extend(
|
|
2343
2357
|
s,
|
|
2344
|
-
|
|
2358
|
+
Pt.withSinglePath("/*")
|
|
2345
2359
|
);
|
|
2346
2360
|
const i = s.getItems();
|
|
2347
2361
|
if (i && i.length > 0) {
|
|
2348
2362
|
for (const o of i) {
|
|
2349
2363
|
const l = this.processorProvider.getProcessor(o);
|
|
2350
2364
|
if (l)
|
|
2351
|
-
|
|
2365
|
+
r = l.process(r);
|
|
2352
2366
|
else
|
|
2353
2367
|
throw new Error(
|
|
2354
2368
|
`No processor found for transformation: ${o}`
|
|
2355
2369
|
);
|
|
2356
2370
|
}
|
|
2357
|
-
|
|
2371
|
+
r.setBlue(void 0);
|
|
2358
2372
|
}
|
|
2359
2373
|
}
|
|
2360
|
-
return
|
|
2374
|
+
return r;
|
|
2361
2375
|
}
|
|
2362
2376
|
/**
|
|
2363
2377
|
* Gets the standard transformation processor provider
|
|
@@ -2367,13 +2381,13 @@ const Ie = class Ie {
|
|
|
2367
2381
|
return {
|
|
2368
2382
|
getProcessor(e) {
|
|
2369
2383
|
var i;
|
|
2370
|
-
const t = "27B7fuxQCS1VAptiCPc2RMkKoutP5qxkh3uDxZ7dr6Eo",
|
|
2384
|
+
const t = "27B7fuxQCS1VAptiCPc2RMkKoutP5qxkh3uDxZ7dr6Eo", r = "FGYuTXwaoSKfZmpTysLTLsb8WzSqf43384rKZDkXhxD4", s = (i = e.getType()) == null ? void 0 : i.getBlueId();
|
|
2371
2385
|
if (t === s)
|
|
2372
2386
|
return new $e(
|
|
2373
2387
|
e
|
|
2374
2388
|
);
|
|
2375
|
-
if (
|
|
2376
|
-
return new
|
|
2389
|
+
if (r === s)
|
|
2390
|
+
return new cr();
|
|
2377
2391
|
}
|
|
2378
2392
|
};
|
|
2379
2393
|
}
|
|
@@ -2393,11 +2407,11 @@ ${t}
|
|
|
2393
2407
|
* Loads the default simple Blue node
|
|
2394
2408
|
*/
|
|
2395
2409
|
loadDefaultSimpleBlue() {
|
|
2396
|
-
const e = this.enrichDefaultBlue(
|
|
2410
|
+
const e = this.enrichDefaultBlue(vt);
|
|
2397
2411
|
try {
|
|
2398
2412
|
const t = ee(e);
|
|
2399
2413
|
if (t)
|
|
2400
|
-
this.defaultSimpleBlue =
|
|
2414
|
+
this.defaultSimpleBlue = p.deserialize(t);
|
|
2401
2415
|
else
|
|
2402
2416
|
throw new Error("Failed to parse default Blue content");
|
|
2403
2417
|
} catch (t) {
|
|
@@ -2407,7 +2421,7 @@ ${t}
|
|
|
2407
2421
|
};
|
|
2408
2422
|
u(Ie, "DEFAULT_BLUE_BLUE_ID", "FREHAAGDZSzpnoTUoCQ86bBmxbVCULMjvx9JZM6fyqT1");
|
|
2409
2423
|
let ge = Ie;
|
|
2410
|
-
class
|
|
2424
|
+
class dr {
|
|
2411
2425
|
/**
|
|
2412
2426
|
* Creates a new BlueDirectivePreprocessor
|
|
2413
2427
|
*
|
|
@@ -2428,11 +2442,11 @@ class an {
|
|
|
2428
2442
|
process(e) {
|
|
2429
2443
|
const t = this.getBlueNodeValue(e);
|
|
2430
2444
|
if (t) {
|
|
2431
|
-
const
|
|
2445
|
+
const r = e.clone();
|
|
2432
2446
|
if (this.preprocessingAliases.has(t))
|
|
2433
|
-
return this.handleAliasValue(
|
|
2447
|
+
return this.handleAliasValue(r, t);
|
|
2434
2448
|
if ($.isPotentialBlueId(t))
|
|
2435
|
-
return this.handleBlueId(
|
|
2449
|
+
return this.handleBlueId(r, t);
|
|
2436
2450
|
throw ce(t) ? new Error(
|
|
2437
2451
|
`URL '${t}' detected. Use the async version of this method to fetch the content.`
|
|
2438
2452
|
) : new Error(`Invalid blue value: ${t}`);
|
|
@@ -2448,15 +2462,15 @@ class an {
|
|
|
2448
2462
|
async processAsync(e) {
|
|
2449
2463
|
const t = this.getBlueNodeValue(e);
|
|
2450
2464
|
if (t) {
|
|
2451
|
-
const
|
|
2465
|
+
const r = e.clone();
|
|
2452
2466
|
if (this.preprocessingAliases.has(t))
|
|
2453
|
-
return this.handleAliasValue(
|
|
2467
|
+
return this.handleAliasValue(r, t);
|
|
2454
2468
|
if ($.isPotentialBlueId(t))
|
|
2455
|
-
return this.handleBlueId(
|
|
2469
|
+
return this.handleBlueId(r, t);
|
|
2456
2470
|
if (ce(t) && this.urlContentFetcher)
|
|
2457
2471
|
try {
|
|
2458
2472
|
const s = await this.fetchFromUrl(t);
|
|
2459
|
-
return s &&
|
|
2473
|
+
return s && r.setBlue(new c().setItems(s)), r;
|
|
2460
2474
|
} catch (s) {
|
|
2461
2475
|
throw s instanceof Error ? new Error(
|
|
2462
2476
|
`Failed to fetch from URL '${t}'.
|
|
@@ -2475,8 +2489,8 @@ ${s.message}`
|
|
|
2475
2489
|
* @returns The blue node value or null if it doesn't exist or isn't a string
|
|
2476
2490
|
*/
|
|
2477
2491
|
getBlueNodeValue(e) {
|
|
2478
|
-
const t = e.getBlue(),
|
|
2479
|
-
return
|
|
2492
|
+
const t = e.getBlue(), r = t == null ? void 0 : t.getValue();
|
|
2493
|
+
return r && typeof r == "string" ? r : null;
|
|
2480
2494
|
}
|
|
2481
2495
|
/**
|
|
2482
2496
|
* Handles a blue value that is an alias
|
|
@@ -2486,7 +2500,7 @@ ${s.message}`
|
|
|
2486
2500
|
*/
|
|
2487
2501
|
handleAliasValue(e, t) {
|
|
2488
2502
|
return e.setBlue(
|
|
2489
|
-
new
|
|
2503
|
+
new c().setBlueId(this.preprocessingAliases.get(t))
|
|
2490
2504
|
), e;
|
|
2491
2505
|
}
|
|
2492
2506
|
/**
|
|
@@ -2496,7 +2510,7 @@ ${s.message}`
|
|
|
2496
2510
|
* @returns The modified node
|
|
2497
2511
|
*/
|
|
2498
2512
|
handleBlueId(e, t) {
|
|
2499
|
-
return e.setBlue(new
|
|
2513
|
+
return e.setBlue(new c().setBlueId(t)), e;
|
|
2500
2514
|
}
|
|
2501
2515
|
/**
|
|
2502
2516
|
* Fetches content from a URL
|
|
@@ -2529,8 +2543,8 @@ ${s.message}`
|
|
|
2529
2543
|
* @returns this instance for chaining
|
|
2530
2544
|
*/
|
|
2531
2545
|
addPreprocessingAliases(e) {
|
|
2532
|
-
return e.forEach((t,
|
|
2533
|
-
this.preprocessingAliases.set(
|
|
2546
|
+
return e.forEach((t, r) => {
|
|
2547
|
+
this.preprocessingAliases.set(r, t);
|
|
2534
2548
|
}), this;
|
|
2535
2549
|
}
|
|
2536
2550
|
/**
|
|
@@ -2549,21 +2563,21 @@ ${s.message}`
|
|
|
2549
2563
|
return this.urlContentFetcher;
|
|
2550
2564
|
}
|
|
2551
2565
|
}
|
|
2552
|
-
const
|
|
2553
|
-
fetchUrl: async (
|
|
2566
|
+
const fr = {
|
|
2567
|
+
fetchUrl: async (n) => {
|
|
2554
2568
|
throw new Error(
|
|
2555
|
-
`You must provide a custom UrlFetchStrategy to fetch content from URL: ${
|
|
2569
|
+
`You must provide a custom UrlFetchStrategy to fetch content from URL: ${n}`
|
|
2556
2570
|
);
|
|
2557
2571
|
}
|
|
2558
2572
|
};
|
|
2559
|
-
class
|
|
2573
|
+
class hr {
|
|
2560
2574
|
constructor(e) {
|
|
2561
2575
|
// Cache to avoid repeated network requests for the same URL
|
|
2562
2576
|
u(this, "cache", /* @__PURE__ */ new Map());
|
|
2563
2577
|
u(this, "fetchStrategy");
|
|
2564
2578
|
u(this, "enabled", !1);
|
|
2565
2579
|
u(this, "allowedDomains", []);
|
|
2566
|
-
this.fetchStrategy = e ||
|
|
2580
|
+
this.fetchStrategy = e || fr;
|
|
2567
2581
|
}
|
|
2568
2582
|
validateUrl(e) {
|
|
2569
2583
|
if (!ce(e))
|
|
@@ -2576,7 +2590,7 @@ class dn {
|
|
|
2576
2590
|
try {
|
|
2577
2591
|
const t = new URL(e);
|
|
2578
2592
|
return this.allowedDomains.some(
|
|
2579
|
-
(
|
|
2593
|
+
(r) => t.hostname === r || t.hostname.endsWith(`.${r}`)
|
|
2580
2594
|
);
|
|
2581
2595
|
} catch {
|
|
2582
2596
|
return !1;
|
|
@@ -2602,16 +2616,16 @@ class dn {
|
|
|
2602
2616
|
} catch (l) {
|
|
2603
2617
|
throw new Error(`Error fetching from URL: ${e}`, { cause: l });
|
|
2604
2618
|
}
|
|
2605
|
-
const { data:
|
|
2619
|
+
const { data: r, contentType: s } = t;
|
|
2606
2620
|
let i;
|
|
2607
2621
|
if (s.includes("application/json") || s.includes("text/yaml") || s.includes("application/yaml") || s.includes("text/plain"))
|
|
2608
|
-
i = ee(
|
|
2622
|
+
i = ee(r);
|
|
2609
2623
|
else
|
|
2610
2624
|
throw new Error(`Unsupported content type from URL: ${s}`);
|
|
2611
2625
|
if (i === void 0)
|
|
2612
2626
|
throw new Error(`Failed to parse content from URL: ${e}`);
|
|
2613
2627
|
let o;
|
|
2614
|
-
return Array.isArray(i) ? o = i.map((l) =>
|
|
2628
|
+
return Array.isArray(i) ? o = i.map((l) => p.deserialize(l)) : o = [p.deserialize(i)], this.cache.set(e, o), o;
|
|
2615
2629
|
}
|
|
2616
2630
|
prefetchUrl(e, t) {
|
|
2617
2631
|
try {
|
|
@@ -2685,44 +2699,36 @@ class dn {
|
|
|
2685
2699
|
return this.allowedDomains = [], this;
|
|
2686
2700
|
}
|
|
2687
2701
|
}
|
|
2688
|
-
class
|
|
2702
|
+
class Hr {
|
|
2689
2703
|
constructor(e = {}) {
|
|
2690
2704
|
u(this, "nodeProvider");
|
|
2691
2705
|
u(this, "typeSchemaResolver");
|
|
2692
2706
|
u(this, "blueDirectivePreprocessor");
|
|
2693
2707
|
u(this, "urlContentFetcher");
|
|
2694
2708
|
u(this, "blueIdsMappingGenerator");
|
|
2695
|
-
u(this, "prepareForBlueIdCalculation", async (e) => e instanceof
|
|
2696
|
-
e.map((
|
|
2709
|
+
u(this, "prepareForBlueIdCalculation", async (e) => e instanceof c || Array.isArray(e) && e.every((t) => t instanceof c) ? e : Array.isArray(e) ? await Promise.all(
|
|
2710
|
+
e.map((r) => this.jsonValueToNodeAsync(r))
|
|
2697
2711
|
) : this.jsonValueToNodeAsync(e));
|
|
2698
2712
|
u(this, "calculateBlueId", async (e) => {
|
|
2699
2713
|
const t = await this.prepareForBlueIdCalculation(e);
|
|
2700
|
-
return
|
|
2714
|
+
return C.calculateBlueId(t);
|
|
2701
2715
|
});
|
|
2702
|
-
u(this, "prepareForBlueIdCalculationSync", (e) => e instanceof
|
|
2716
|
+
u(this, "prepareForBlueIdCalculationSync", (e) => e instanceof c || Array.isArray(e) && e.every((t) => t instanceof c) ? e : Array.isArray(e) ? e.map((t) => this.jsonValueToNode(t)) : this.jsonValueToNode(e));
|
|
2717
|
+
var l;
|
|
2703
2718
|
const {
|
|
2704
2719
|
nodeProvider: t,
|
|
2705
|
-
typeSchemaResolver:
|
|
2720
|
+
typeSchemaResolver: r = null,
|
|
2706
2721
|
urlFetchStrategy: s,
|
|
2707
2722
|
repositories: i
|
|
2708
|
-
} = e, o =
|
|
2723
|
+
} = e, o = Wn(() => []);
|
|
2709
2724
|
if (this.nodeProvider = pe.wrap(
|
|
2710
2725
|
t || o
|
|
2711
|
-
), this.typeSchemaResolver =
|
|
2726
|
+
), this.typeSchemaResolver = r ?? new Un([]), this.urlContentFetcher = new hr(s), this.blueDirectivePreprocessor = new dr(
|
|
2712
2727
|
void 0,
|
|
2713
2728
|
this.urlContentFetcher
|
|
2714
|
-
), this.blueIdsMappingGenerator = new
|
|
2715
|
-
const
|
|
2716
|
-
(
|
|
2717
|
-
{
|
|
2718
|
-
blueIds: {},
|
|
2719
|
-
schemas: []
|
|
2720
|
-
}
|
|
2721
|
-
);
|
|
2722
|
-
this.blueIdsMappingGenerator.initialize(l.blueIds), this.typeSchemaResolver || (this.typeSchemaResolver = new jr(
|
|
2723
|
-
l.schemas
|
|
2724
|
-
));
|
|
2725
|
-
}
|
|
2729
|
+
), this.blueIdsMappingGenerator = new At(), i)
|
|
2730
|
+
for (const { schemas: a, blueIds: g } of i)
|
|
2731
|
+
(l = this.typeSchemaResolver) == null || l.registerSchemas(a), this.blueIdsMappingGenerator.registerBlueIds(g);
|
|
2726
2732
|
}
|
|
2727
2733
|
/**
|
|
2728
2734
|
* Converts a BlueNode to a JSON representation based on the specified strategy.
|
|
@@ -2735,13 +2741,13 @@ class zn {
|
|
|
2735
2741
|
return T.get(e, t);
|
|
2736
2742
|
}
|
|
2737
2743
|
nodeToSchemaOutput(e, t) {
|
|
2738
|
-
return new
|
|
2744
|
+
return new Hn(this.typeSchemaResolver).convert(e, t);
|
|
2739
2745
|
}
|
|
2740
2746
|
jsonValueToNode(e) {
|
|
2741
|
-
return this.preprocess(
|
|
2747
|
+
return this.preprocess(p.deserialize(e));
|
|
2742
2748
|
}
|
|
2743
2749
|
async jsonValueToNodeAsync(e) {
|
|
2744
|
-
return this.preprocessAsync(
|
|
2750
|
+
return this.preprocessAsync(p.deserialize(e));
|
|
2745
2751
|
}
|
|
2746
2752
|
yamlToNode(e) {
|
|
2747
2753
|
const t = ee(e);
|
|
@@ -2757,7 +2763,7 @@ class zn {
|
|
|
2757
2763
|
}
|
|
2758
2764
|
calculateBlueIdSync(e) {
|
|
2759
2765
|
const t = this.prepareForBlueIdCalculationSync(e);
|
|
2760
|
-
return
|
|
2766
|
+
return C.calculateBlueIdSync(t);
|
|
2761
2767
|
}
|
|
2762
2768
|
addPreprocessingAliases(e) {
|
|
2763
2769
|
this.blueDirectivePreprocessor.addPreprocessingAliases(e);
|
|
@@ -2896,65 +2902,65 @@ class zn {
|
|
|
2896
2902
|
}
|
|
2897
2903
|
}
|
|
2898
2904
|
export {
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2905
|
+
dn as Base58Sha256Provider,
|
|
2906
|
+
Hr as Blue,
|
|
2907
|
+
C as BlueIdCalculator,
|
|
2908
|
+
Or as BlueIdToCid,
|
|
2909
|
+
c as BlueNode,
|
|
2910
|
+
Lr as BlueNodeTypeSchema,
|
|
2911
|
+
an as JsonCanonicalizer,
|
|
2912
|
+
Un as TypeSchemaResolver,
|
|
2913
|
+
jr as applyBlueNodePatch,
|
|
2908
2914
|
Be as baseBlueObjectSchema,
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2915
|
+
Rr as blueDescriptionField,
|
|
2916
|
+
xr as blueIdField,
|
|
2917
|
+
Er as blueIdSchema,
|
|
2918
|
+
Ur as blueNameField,
|
|
2919
|
+
$r as blueNodeField,
|
|
2920
|
+
Nr as blueObjectBooleanValueSchema,
|
|
2921
|
+
Ar as blueObjectNumberValueSchema,
|
|
2916
2922
|
q as blueObjectSchema,
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2923
|
+
Sr as blueObjectStringListItemsSchema,
|
|
2924
|
+
Pr as blueObjectStringValueSchema,
|
|
2925
|
+
or as calculateBlueId,
|
|
2926
|
+
_r as calculateBlueIdSync,
|
|
2921
2927
|
Qe as enrichWithBlueId,
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2928
|
+
En as getBlueDescriptionAnnotation,
|
|
2929
|
+
Nn as getBlueIdAnnotation,
|
|
2930
|
+
Cn as getBlueNameAnnotation,
|
|
2931
|
+
Vn as getBlueNodeAnnotation,
|
|
2932
|
+
kr as getBlueObjectItems,
|
|
2933
|
+
Gr as getBlueObjectProperties,
|
|
2934
|
+
zr as getBlueObjectTypeLabel,
|
|
2935
|
+
Yr as getBlueObjectValue,
|
|
2936
|
+
On as getExtendedFromSchemaAnnotation,
|
|
2937
|
+
xn as getTypeBlueIdAnnotation,
|
|
2938
|
+
Xt as hasBlueObjectBlueIdDefined,
|
|
2939
|
+
qt as hasBlueObjectItemsDefined,
|
|
2940
|
+
Fr as hasBlueObjectNameDefined,
|
|
2941
|
+
Qt as hasBlueObjectTypeDefined,
|
|
2942
|
+
en as hasBlueObjectValueDefined,
|
|
2943
|
+
tn as isBigDecimalNumber,
|
|
2938
2944
|
Q as isBigIntegerNumber,
|
|
2939
|
-
|
|
2945
|
+
S as isBigNumber,
|
|
2940
2946
|
qe as isBlueNodeSchema,
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2947
|
+
Cr as isBlueObject,
|
|
2948
|
+
lr as isBlueObjectResolved,
|
|
2949
|
+
Vr as isGivenBlueObjectTypeSchema,
|
|
2944
2950
|
pt as isJsonBlueArray,
|
|
2945
2951
|
ht as isJsonBlueObject,
|
|
2946
|
-
|
|
2947
|
-
|
|
2952
|
+
Dr as isJsonBlueValue,
|
|
2953
|
+
Tt as isSchemaExtendedFrom,
|
|
2948
2954
|
ce as isUrl,
|
|
2949
2955
|
fe as jsonBlueValueSchema,
|
|
2950
|
-
|
|
2956
|
+
Jr as normalizeToBlueObject,
|
|
2951
2957
|
et as resolveBlueObjectItems,
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2958
|
+
vn as withBlueDescription,
|
|
2959
|
+
An as withBlueId,
|
|
2960
|
+
Sn as withBlueName,
|
|
2961
|
+
Fn as withBlueNode,
|
|
2962
|
+
Dn as withExtendedFromSchema,
|
|
2963
|
+
Mr as withTypeBlueId,
|
|
2964
|
+
Zr as yamlBlueDump,
|
|
2959
2965
|
ee as yamlBlueParse
|
|
2960
2966
|
};
|