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