@arcforges/api-client 1.0.0-ci.19.1 → 1.0.0-ci.201.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +57 -5
- package/README.md +9 -2
- package/build-identity.json +192 -0
- package/contracts.binpb +0 -0
- package/dist/gen/http.d.ts +10 -0
- package/dist/gen/http.js +13 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.js +20 -2
- package/dist/shapes/gen/AndroidUpdate.d.ts +41 -0
- package/dist/shapes/gen/AndroidUpdate.js +620 -0
- package/dist/shapes/gen/CatalogIndex.d.ts +49 -0
- package/dist/shapes/gen/CatalogIndex.js +703 -0
- package/dist/shapes/gen/CatalogRevocations.d.ts +46 -0
- package/dist/shapes/gen/CatalogRevocations.js +647 -0
- package/dist/shapes/gen/DeclarativePanel.d.ts +154 -0
- package/dist/shapes/gen/DeclarativePanel.js +2988 -0
- package/dist/shapes/gen/ExtensionManifest.d.ts +278 -0
- package/dist/shapes/gen/ExtensionManifest.js +3974 -0
- package/dist/shapes/gen/ExtensionWorkflow.d.ts +151 -0
- package/dist/shapes/gen/ExtensionWorkflow.js +2251 -0
- package/dist/shapes/gen/PackageInventory.d.ts +24 -0
- package/dist/shapes/gen/PackageInventory.js +327 -0
- package/dist/shapes/gen/PartReceipt.d.ts +21 -0
- package/dist/shapes/gen/PartReceipt.js +290 -0
- package/dist/shapes/gen/PolicyBody.d.ts +269 -0
- package/dist/shapes/gen/PolicyBody.js +4188 -0
- package/dist/shapes/gen/RealmDescriptor.d.ts +39 -0
- package/dist/shapes/gen/RealmDescriptor.js +627 -0
- package/package.json +15 -7
- package/sbom.cdx.json +17 -17
- package/schemas/public/http/v1/inventory.schema.json +49 -0
- package/schemas/public/http/v1/manifest.schema.json +1459 -0
- package/schemas/public/http/v1/panel.schema.json +963 -0
- package/schemas/public/http/v1/policy-body.schema.json +1376 -0
- package/schemas/public/http/v1/schema.json +30 -0
- package/schemas/public/http/v1/signed-formats.schema.json +748 -0
- package/schemas/public/http/v1/workflow.schema.json +715 -0
- package/schemas/public/proto/arcforges/events/v1/events.proto +14 -0
- package/schemas/public/proto/arcforges/foundation/v1/foundation.proto +373 -0
- package/schemas/public/proto/arcforges/hello/v1/hello.proto +23 -0
- package/schemas/public/proto/arcforges/publicapi/v1/content.proto +767 -0
- package/schemas/public/proto/arcforges/publicapi/v1/descriptors.proto +27 -0
- package/source.json +35 -10
|
@@ -0,0 +1,2251 @@
|
|
|
1
|
+
export function isExtensionWorkflow(value) { return check0(value); }
|
|
2
|
+
/** The schema's declared UTF-8 document bound in bytes. */
|
|
3
|
+
export const extensionWorkflowJsonMaxBytes = 4194304;
|
|
4
|
+
/** Parses one strict ExtensionWorkflow document; refusal kinds match the C# codec. */
|
|
5
|
+
export function tryParseExtensionWorkflowJson(input) {
|
|
6
|
+
const parsed = strictJson(input, 4194304);
|
|
7
|
+
if (!parsed.ok)
|
|
8
|
+
return parsed;
|
|
9
|
+
return isExtensionWorkflow(parsed.value) ? { ok: true, value: parsed.value } : { ok: false, failure: "invalid" };
|
|
10
|
+
}
|
|
11
|
+
/** Parses one strict ExtensionWorkflow document or throws an error carrying the refusal kind. */
|
|
12
|
+
export function parseExtensionWorkflowJson(input) {
|
|
13
|
+
const result = tryParseExtensionWorkflowJson(input);
|
|
14
|
+
if (!result.ok)
|
|
15
|
+
throw Object.assign(new Error(`ExtensionWorkflow JSON refused: ${result.failure}.`), { failure: result.failure });
|
|
16
|
+
return result.value;
|
|
17
|
+
}
|
|
18
|
+
/** Writes compact UTF-8 in schema property order and refuses output the schema rejects. */
|
|
19
|
+
export function serializeExtensionWorkflowJson(value) {
|
|
20
|
+
if (!isExtensionWorkflow(value))
|
|
21
|
+
throw Object.assign(new Error('Invalid recursive shape'), { failure: 'invalid' });
|
|
22
|
+
const bytes = new TextEncoder().encode(JSON.stringify(orderExtensionWorkflow(value)));
|
|
23
|
+
const result = tryParseExtensionWorkflowJson(bytes);
|
|
24
|
+
if (!result.ok)
|
|
25
|
+
throw Object.assign(new Error(`ExtensionWorkflow JSON refused: ${result.failure}.`), { failure: result.failure });
|
|
26
|
+
return bytes;
|
|
27
|
+
}
|
|
28
|
+
function orderExtensionWorkflow(value) {
|
|
29
|
+
const out = {};
|
|
30
|
+
out["schemaVersion"] = value["schemaVersion"];
|
|
31
|
+
out["inputs"] = value["inputs"].map(item => orderWorkflowInput(item));
|
|
32
|
+
out["nodes"] = value["nodes"].map(item => orderWorkflowNode(item));
|
|
33
|
+
out["outputs"] = value["outputs"].map(item => orderWorkflowOutput(item));
|
|
34
|
+
out["limits"] = orderWorkflowLimits(value["limits"]);
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
function orderWorkflowAll(value) {
|
|
38
|
+
const out = {};
|
|
39
|
+
out["operator"] = value["operator"];
|
|
40
|
+
out["predicates"] = value["predicates"].map(item => orderWorkflowPredicate(item));
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
43
|
+
function orderWorkflowAny(value) {
|
|
44
|
+
const out = {};
|
|
45
|
+
out["operator"] = value["operator"];
|
|
46
|
+
out["predicates"] = value["predicates"].map(item => orderWorkflowPredicate(item));
|
|
47
|
+
return out;
|
|
48
|
+
}
|
|
49
|
+
function orderWorkflowArgument(value) {
|
|
50
|
+
const out = {};
|
|
51
|
+
out["name"] = value["name"];
|
|
52
|
+
out["value"] = orderWorkflowOperand(value["value"]);
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
55
|
+
function orderWorkflowBoolValue(value) {
|
|
56
|
+
const out = {};
|
|
57
|
+
out["kind"] = value["kind"];
|
|
58
|
+
out["value"] = value["value"];
|
|
59
|
+
return out;
|
|
60
|
+
}
|
|
61
|
+
function orderWorkflowCapabilityNode(value) {
|
|
62
|
+
const out = {};
|
|
63
|
+
out["id"] = value["id"];
|
|
64
|
+
out["kind"] = value["kind"];
|
|
65
|
+
out["operationId"] = value["operationId"];
|
|
66
|
+
out["typedArguments"] = value["typedArguments"].map(item => orderWorkflowArgument(item));
|
|
67
|
+
out["dependencies"] = value["dependencies"];
|
|
68
|
+
return out;
|
|
69
|
+
}
|
|
70
|
+
function orderWorkflowComparison(value) {
|
|
71
|
+
const out = {};
|
|
72
|
+
out["operator"] = value["operator"];
|
|
73
|
+
out["left"] = orderWorkflowOperand(value["left"]);
|
|
74
|
+
out["right"] = orderWorkflowOperand(value["right"]);
|
|
75
|
+
return out;
|
|
76
|
+
}
|
|
77
|
+
function orderWorkflowConditionNode(value) {
|
|
78
|
+
const out = {};
|
|
79
|
+
out["id"] = value["id"];
|
|
80
|
+
out["kind"] = value["kind"];
|
|
81
|
+
out["predicate"] = orderWorkflowPredicate(value["predicate"]);
|
|
82
|
+
out["thenNodes"] = value["thenNodes"];
|
|
83
|
+
out["elseNodes"] = value["elseNodes"];
|
|
84
|
+
return out;
|
|
85
|
+
}
|
|
86
|
+
function orderWorkflowConstantNode(value) {
|
|
87
|
+
const out = {};
|
|
88
|
+
out["id"] = value["id"];
|
|
89
|
+
out["kind"] = value["kind"];
|
|
90
|
+
out["typedValue"] = orderWorkflowTypedValue(value["typedValue"]);
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
function orderWorkflowDecimalValue(value) {
|
|
94
|
+
const out = {};
|
|
95
|
+
out["kind"] = value["kind"];
|
|
96
|
+
out["value"] = value["value"];
|
|
97
|
+
return out;
|
|
98
|
+
}
|
|
99
|
+
function orderWorkflowEnumValue(value) {
|
|
100
|
+
const out = {};
|
|
101
|
+
out["kind"] = value["kind"];
|
|
102
|
+
out["value"] = value["value"];
|
|
103
|
+
return out;
|
|
104
|
+
}
|
|
105
|
+
function orderWorkflowExists(value) {
|
|
106
|
+
const out = {};
|
|
107
|
+
out["operator"] = value["operator"];
|
|
108
|
+
out["valueRef"] = orderWorkflowValueRef(value["valueRef"]);
|
|
109
|
+
return out;
|
|
110
|
+
}
|
|
111
|
+
function orderWorkflowForeachNode(value) {
|
|
112
|
+
const out = {};
|
|
113
|
+
out["id"] = value["id"];
|
|
114
|
+
out["kind"] = value["kind"];
|
|
115
|
+
out["inputArray"] = orderWorkflowValueRef(value["inputArray"]);
|
|
116
|
+
out["maxItems"] = value["maxItems"];
|
|
117
|
+
out["body"] = value["body"].map(item => orderWorkflowNode(item));
|
|
118
|
+
return out;
|
|
119
|
+
}
|
|
120
|
+
function orderWorkflowInput(value) {
|
|
121
|
+
const out = {};
|
|
122
|
+
out["name"] = value["name"];
|
|
123
|
+
out["schemaId"] = value["schemaId"];
|
|
124
|
+
out["required"] = value["required"];
|
|
125
|
+
return out;
|
|
126
|
+
}
|
|
127
|
+
function orderWorkflowInputNode(value) {
|
|
128
|
+
const out = {};
|
|
129
|
+
out["id"] = value["id"];
|
|
130
|
+
out["kind"] = value["kind"];
|
|
131
|
+
out["name"] = value["name"];
|
|
132
|
+
return out;
|
|
133
|
+
}
|
|
134
|
+
function orderWorkflowInt64Value(value) {
|
|
135
|
+
const out = {};
|
|
136
|
+
out["kind"] = value["kind"];
|
|
137
|
+
out["value"] = value["value"];
|
|
138
|
+
return out;
|
|
139
|
+
}
|
|
140
|
+
function orderWorkflowLimits(value) {
|
|
141
|
+
const out = {};
|
|
142
|
+
out["maxExpandedSteps"] = value["maxExpandedSteps"];
|
|
143
|
+
out["maxForEachNesting"] = value["maxForEachNesting"];
|
|
144
|
+
out["maxPredicateDepth"] = value["maxPredicateDepth"];
|
|
145
|
+
out["maxPredicateNodes"] = value["maxPredicateNodes"];
|
|
146
|
+
return out;
|
|
147
|
+
}
|
|
148
|
+
function orderWorkflowLiteralOperand(value) {
|
|
149
|
+
const out = {};
|
|
150
|
+
out["kind"] = value["kind"];
|
|
151
|
+
out["value"] = orderWorkflowTypedValue(value["value"]);
|
|
152
|
+
return out;
|
|
153
|
+
}
|
|
154
|
+
function orderWorkflowNode(value) {
|
|
155
|
+
if (check9(value))
|
|
156
|
+
return orderWorkflowConstantNode(value);
|
|
157
|
+
if (check39(value))
|
|
158
|
+
return orderWorkflowInputNode(value);
|
|
159
|
+
if (check43(value))
|
|
160
|
+
return orderWorkflowSelectNode(value);
|
|
161
|
+
if (check50(value))
|
|
162
|
+
return orderWorkflowCapabilityNode(value);
|
|
163
|
+
if (check64(value))
|
|
164
|
+
return orderWorkflowConditionNode(value);
|
|
165
|
+
if (check82(value))
|
|
166
|
+
return orderWorkflowForeachNode(value);
|
|
167
|
+
if (check87(value))
|
|
168
|
+
return orderWorkflowOutputNode(value);
|
|
169
|
+
throw new TypeError('Invalid closed union');
|
|
170
|
+
}
|
|
171
|
+
function orderWorkflowOperand(value) {
|
|
172
|
+
if (check58(value))
|
|
173
|
+
return orderWorkflowLiteralOperand(value);
|
|
174
|
+
if (check60(value))
|
|
175
|
+
return orderWorkflowReferenceOperand(value);
|
|
176
|
+
throw new TypeError('Invalid closed union');
|
|
177
|
+
}
|
|
178
|
+
function orderWorkflowOutput(value) {
|
|
179
|
+
const out = {};
|
|
180
|
+
out["name"] = value["name"];
|
|
181
|
+
out["schemaId"] = value["schemaId"];
|
|
182
|
+
out["valueRef"] = orderWorkflowValueRef(value["valueRef"]);
|
|
183
|
+
return out;
|
|
184
|
+
}
|
|
185
|
+
function orderWorkflowOutputNode(value) {
|
|
186
|
+
const out = {};
|
|
187
|
+
out["id"] = value["id"];
|
|
188
|
+
out["kind"] = value["kind"];
|
|
189
|
+
out["valueRef"] = orderWorkflowValueRef(value["valueRef"]);
|
|
190
|
+
return out;
|
|
191
|
+
}
|
|
192
|
+
function orderWorkflowPredicate(value) {
|
|
193
|
+
if (check68(value))
|
|
194
|
+
return orderWorkflowComparison(value);
|
|
195
|
+
if (check70(value))
|
|
196
|
+
return orderWorkflowExists(value);
|
|
197
|
+
if (check72(value))
|
|
198
|
+
return orderWorkflowAll(value);
|
|
199
|
+
if (check75(value))
|
|
200
|
+
return orderWorkflowAny(value);
|
|
201
|
+
throw new TypeError('Invalid closed union');
|
|
202
|
+
}
|
|
203
|
+
function orderWorkflowReferenceOperand(value) {
|
|
204
|
+
const out = {};
|
|
205
|
+
out["kind"] = value["kind"];
|
|
206
|
+
out["valueRef"] = orderWorkflowValueRef(value["valueRef"]);
|
|
207
|
+
return out;
|
|
208
|
+
}
|
|
209
|
+
function orderWorkflowResourceRef(value) {
|
|
210
|
+
const out = {};
|
|
211
|
+
out["realmId"] = value["realmId"];
|
|
212
|
+
if (value["workspaceId"] !== undefined)
|
|
213
|
+
out["workspaceId"] = value["workspaceId"];
|
|
214
|
+
out["ownerAppId"] = value["ownerAppId"];
|
|
215
|
+
out["resourceKind"] = value["resourceKind"];
|
|
216
|
+
out["resourceId"] = value["resourceId"];
|
|
217
|
+
if (value["displayHint"] !== undefined)
|
|
218
|
+
out["displayHint"] = value["displayHint"];
|
|
219
|
+
out["availability"] = value["availability"];
|
|
220
|
+
if (value["holdingDeviceId"] !== undefined)
|
|
221
|
+
out["holdingDeviceId"] = value["holdingDeviceId"];
|
|
222
|
+
return out;
|
|
223
|
+
}
|
|
224
|
+
function orderWorkflowResourceRefValue(value) {
|
|
225
|
+
const out = {};
|
|
226
|
+
out["kind"] = value["kind"];
|
|
227
|
+
out["value"] = orderWorkflowResourceRef(value["value"]);
|
|
228
|
+
return out;
|
|
229
|
+
}
|
|
230
|
+
function orderWorkflowSelectNode(value) {
|
|
231
|
+
const out = {};
|
|
232
|
+
out["id"] = value["id"];
|
|
233
|
+
out["kind"] = value["kind"];
|
|
234
|
+
out["source"] = orderWorkflowValueRef(value["source"]);
|
|
235
|
+
out["recordField"] = value["recordField"];
|
|
236
|
+
return out;
|
|
237
|
+
}
|
|
238
|
+
function orderWorkflowTextValue(value) {
|
|
239
|
+
const out = {};
|
|
240
|
+
out["kind"] = value["kind"];
|
|
241
|
+
out["value"] = value["value"];
|
|
242
|
+
return out;
|
|
243
|
+
}
|
|
244
|
+
function orderWorkflowTypedValue(value) {
|
|
245
|
+
if (check13(value))
|
|
246
|
+
return orderWorkflowTextValue(value);
|
|
247
|
+
if (check16(value))
|
|
248
|
+
return orderWorkflowBoolValue(value);
|
|
249
|
+
if (check19(value))
|
|
250
|
+
return orderWorkflowInt64Value(value);
|
|
251
|
+
if (check22(value))
|
|
252
|
+
return orderWorkflowDecimalValue(value);
|
|
253
|
+
if (check25(value))
|
|
254
|
+
return orderWorkflowEnumValue(value);
|
|
255
|
+
if (check28(value))
|
|
256
|
+
return orderWorkflowResourceRefValue(value);
|
|
257
|
+
throw new TypeError('Invalid closed union');
|
|
258
|
+
}
|
|
259
|
+
function orderWorkflowValueRef(value) {
|
|
260
|
+
const out = {};
|
|
261
|
+
out["nodeId"] = value["nodeId"];
|
|
262
|
+
out["field"] = value["field"];
|
|
263
|
+
return out;
|
|
264
|
+
}
|
|
265
|
+
function check0(value, depth = 0) {
|
|
266
|
+
if (depth >= 128)
|
|
267
|
+
return false;
|
|
268
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
269
|
+
return false;
|
|
270
|
+
const object = value;
|
|
271
|
+
for (const key of Object.keys(object)) {
|
|
272
|
+
switch (key) {
|
|
273
|
+
case "schemaVersion":
|
|
274
|
+
if (!check1(object[key], depth + 1))
|
|
275
|
+
return false;
|
|
276
|
+
break;
|
|
277
|
+
case "inputs":
|
|
278
|
+
if (!check2(object[key], depth + 1))
|
|
279
|
+
return false;
|
|
280
|
+
break;
|
|
281
|
+
case "nodes":
|
|
282
|
+
if (!check7(object[key], depth + 1))
|
|
283
|
+
return false;
|
|
284
|
+
break;
|
|
285
|
+
case "outputs":
|
|
286
|
+
if (!check90(object[key], depth + 1))
|
|
287
|
+
return false;
|
|
288
|
+
break;
|
|
289
|
+
case "limits":
|
|
290
|
+
if (!check94(object[key], depth + 1))
|
|
291
|
+
return false;
|
|
292
|
+
break;
|
|
293
|
+
default: return false;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (!Object.prototype.hasOwnProperty.call(object, "schemaVersion"))
|
|
297
|
+
return false;
|
|
298
|
+
if (!Object.prototype.hasOwnProperty.call(object, "inputs"))
|
|
299
|
+
return false;
|
|
300
|
+
if (!Object.prototype.hasOwnProperty.call(object, "nodes"))
|
|
301
|
+
return false;
|
|
302
|
+
if (!Object.prototype.hasOwnProperty.call(object, "outputs"))
|
|
303
|
+
return false;
|
|
304
|
+
if (!Object.prototype.hasOwnProperty.call(object, "limits"))
|
|
305
|
+
return false;
|
|
306
|
+
if (!workflowGraph(value))
|
|
307
|
+
return false;
|
|
308
|
+
return true;
|
|
309
|
+
}
|
|
310
|
+
function check1(value, depth = 0) {
|
|
311
|
+
if (depth >= 128)
|
|
312
|
+
return false;
|
|
313
|
+
if (typeof value !== 'string' || !validText(value))
|
|
314
|
+
return false;
|
|
315
|
+
if (value !== "workflow.v1")
|
|
316
|
+
return false;
|
|
317
|
+
return true;
|
|
318
|
+
}
|
|
319
|
+
function check2(value, depth = 0) {
|
|
320
|
+
if (depth >= 128)
|
|
321
|
+
return false;
|
|
322
|
+
if (!Array.isArray(value))
|
|
323
|
+
return false;
|
|
324
|
+
if (value.length < 0)
|
|
325
|
+
return false;
|
|
326
|
+
if (value.length > 64)
|
|
327
|
+
return false;
|
|
328
|
+
if (!value.every(item => check3(item, depth + 1)))
|
|
329
|
+
return false;
|
|
330
|
+
return true;
|
|
331
|
+
}
|
|
332
|
+
function check3(value, depth = 0) {
|
|
333
|
+
if (depth >= 128)
|
|
334
|
+
return false;
|
|
335
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
336
|
+
return false;
|
|
337
|
+
const object = value;
|
|
338
|
+
for (const key of Object.keys(object)) {
|
|
339
|
+
switch (key) {
|
|
340
|
+
case "name":
|
|
341
|
+
if (!check4(object[key], depth + 1))
|
|
342
|
+
return false;
|
|
343
|
+
break;
|
|
344
|
+
case "schemaId":
|
|
345
|
+
if (!check5(object[key], depth + 1))
|
|
346
|
+
return false;
|
|
347
|
+
break;
|
|
348
|
+
case "required":
|
|
349
|
+
if (!check6(object[key], depth + 1))
|
|
350
|
+
return false;
|
|
351
|
+
break;
|
|
352
|
+
default: return false;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
if (!Object.prototype.hasOwnProperty.call(object, "name"))
|
|
356
|
+
return false;
|
|
357
|
+
if (!Object.prototype.hasOwnProperty.call(object, "schemaId"))
|
|
358
|
+
return false;
|
|
359
|
+
if (!Object.prototype.hasOwnProperty.call(object, "required"))
|
|
360
|
+
return false;
|
|
361
|
+
return true;
|
|
362
|
+
}
|
|
363
|
+
function check4(value, depth = 0) {
|
|
364
|
+
if (depth >= 128)
|
|
365
|
+
return false;
|
|
366
|
+
if (typeof value !== 'string' || !validText(value))
|
|
367
|
+
return false;
|
|
368
|
+
if ([...value].length < 1)
|
|
369
|
+
return false;
|
|
370
|
+
if ([...value].length > 128)
|
|
371
|
+
return false;
|
|
372
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
373
|
+
return false;
|
|
374
|
+
return true;
|
|
375
|
+
}
|
|
376
|
+
function check5(value, depth = 0) {
|
|
377
|
+
if (depth >= 128)
|
|
378
|
+
return false;
|
|
379
|
+
if (typeof value !== 'string' || !validText(value))
|
|
380
|
+
return false;
|
|
381
|
+
if ([...value].length < 1)
|
|
382
|
+
return false;
|
|
383
|
+
if ([...value].length > 128)
|
|
384
|
+
return false;
|
|
385
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
386
|
+
return false;
|
|
387
|
+
return true;
|
|
388
|
+
}
|
|
389
|
+
function check6(value, depth = 0) {
|
|
390
|
+
if (depth >= 128)
|
|
391
|
+
return false;
|
|
392
|
+
if (typeof value !== 'boolean')
|
|
393
|
+
return false;
|
|
394
|
+
return true;
|
|
395
|
+
}
|
|
396
|
+
function check7(value, depth = 0) {
|
|
397
|
+
if (depth >= 128)
|
|
398
|
+
return false;
|
|
399
|
+
if (!Array.isArray(value))
|
|
400
|
+
return false;
|
|
401
|
+
if (value.length < 0)
|
|
402
|
+
return false;
|
|
403
|
+
if (value.length > 256)
|
|
404
|
+
return false;
|
|
405
|
+
if (!value.every(item => check8(item, depth + 1)))
|
|
406
|
+
return false;
|
|
407
|
+
return true;
|
|
408
|
+
}
|
|
409
|
+
function check8(value, depth = 0) {
|
|
410
|
+
if (depth >= 128)
|
|
411
|
+
return false;
|
|
412
|
+
if ((check9(value, depth + 1) ? 1 : 0) + (check39(value, depth + 1) ? 1 : 0) + (check43(value, depth + 1) ? 1 : 0) + (check50(value, depth + 1) ? 1 : 0) + (check64(value, depth + 1) ? 1 : 0) + (check82(value, depth + 1) ? 1 : 0) + (check87(value, depth + 1) ? 1 : 0) !== 1)
|
|
413
|
+
return false;
|
|
414
|
+
return true;
|
|
415
|
+
}
|
|
416
|
+
function check9(value, depth = 0) {
|
|
417
|
+
if (depth >= 128)
|
|
418
|
+
return false;
|
|
419
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
420
|
+
return false;
|
|
421
|
+
const object = value;
|
|
422
|
+
for (const key of Object.keys(object)) {
|
|
423
|
+
switch (key) {
|
|
424
|
+
case "id":
|
|
425
|
+
if (!check10(object[key], depth + 1))
|
|
426
|
+
return false;
|
|
427
|
+
break;
|
|
428
|
+
case "kind":
|
|
429
|
+
if (!check11(object[key], depth + 1))
|
|
430
|
+
return false;
|
|
431
|
+
break;
|
|
432
|
+
case "typedValue":
|
|
433
|
+
if (!check12(object[key], depth + 1))
|
|
434
|
+
return false;
|
|
435
|
+
break;
|
|
436
|
+
default: return false;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
if (!Object.prototype.hasOwnProperty.call(object, "id"))
|
|
440
|
+
return false;
|
|
441
|
+
if (!Object.prototype.hasOwnProperty.call(object, "kind"))
|
|
442
|
+
return false;
|
|
443
|
+
if (!Object.prototype.hasOwnProperty.call(object, "typedValue"))
|
|
444
|
+
return false;
|
|
445
|
+
return true;
|
|
446
|
+
}
|
|
447
|
+
function check10(value, depth = 0) {
|
|
448
|
+
if (depth >= 128)
|
|
449
|
+
return false;
|
|
450
|
+
if (typeof value !== 'string' || !validText(value))
|
|
451
|
+
return false;
|
|
452
|
+
if ([...value].length < 1)
|
|
453
|
+
return false;
|
|
454
|
+
if ([...value].length > 128)
|
|
455
|
+
return false;
|
|
456
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
457
|
+
return false;
|
|
458
|
+
return true;
|
|
459
|
+
}
|
|
460
|
+
function check11(value, depth = 0) {
|
|
461
|
+
if (depth >= 128)
|
|
462
|
+
return false;
|
|
463
|
+
if (typeof value !== 'string' || !validText(value))
|
|
464
|
+
return false;
|
|
465
|
+
if (value !== "constant")
|
|
466
|
+
return false;
|
|
467
|
+
return true;
|
|
468
|
+
}
|
|
469
|
+
function check12(value, depth = 0) {
|
|
470
|
+
if (depth >= 128)
|
|
471
|
+
return false;
|
|
472
|
+
if ((check13(value, depth + 1) ? 1 : 0) + (check16(value, depth + 1) ? 1 : 0) + (check19(value, depth + 1) ? 1 : 0) + (check22(value, depth + 1) ? 1 : 0) + (check25(value, depth + 1) ? 1 : 0) + (check28(value, depth + 1) ? 1 : 0) !== 1)
|
|
473
|
+
return false;
|
|
474
|
+
return true;
|
|
475
|
+
}
|
|
476
|
+
function check13(value, depth = 0) {
|
|
477
|
+
if (depth >= 128)
|
|
478
|
+
return false;
|
|
479
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
480
|
+
return false;
|
|
481
|
+
const object = value;
|
|
482
|
+
for (const key of Object.keys(object)) {
|
|
483
|
+
switch (key) {
|
|
484
|
+
case "kind":
|
|
485
|
+
if (!check14(object[key], depth + 1))
|
|
486
|
+
return false;
|
|
487
|
+
break;
|
|
488
|
+
case "value":
|
|
489
|
+
if (!check15(object[key], depth + 1))
|
|
490
|
+
return false;
|
|
491
|
+
break;
|
|
492
|
+
default: return false;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
if (!Object.prototype.hasOwnProperty.call(object, "kind"))
|
|
496
|
+
return false;
|
|
497
|
+
if (!Object.prototype.hasOwnProperty.call(object, "value"))
|
|
498
|
+
return false;
|
|
499
|
+
return true;
|
|
500
|
+
}
|
|
501
|
+
function check14(value, depth = 0) {
|
|
502
|
+
if (depth >= 128)
|
|
503
|
+
return false;
|
|
504
|
+
if (typeof value !== 'string' || !validText(value))
|
|
505
|
+
return false;
|
|
506
|
+
if (value !== "text")
|
|
507
|
+
return false;
|
|
508
|
+
return true;
|
|
509
|
+
}
|
|
510
|
+
function check15(value, depth = 0) {
|
|
511
|
+
if (depth >= 128)
|
|
512
|
+
return false;
|
|
513
|
+
if (typeof value !== 'string' || !validText(value))
|
|
514
|
+
return false;
|
|
515
|
+
if ([...value].length < 1)
|
|
516
|
+
return false;
|
|
517
|
+
if ([...value].length > 4096)
|
|
518
|
+
return false;
|
|
519
|
+
return true;
|
|
520
|
+
}
|
|
521
|
+
function check16(value, depth = 0) {
|
|
522
|
+
if (depth >= 128)
|
|
523
|
+
return false;
|
|
524
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
525
|
+
return false;
|
|
526
|
+
const object = value;
|
|
527
|
+
for (const key of Object.keys(object)) {
|
|
528
|
+
switch (key) {
|
|
529
|
+
case "kind":
|
|
530
|
+
if (!check17(object[key], depth + 1))
|
|
531
|
+
return false;
|
|
532
|
+
break;
|
|
533
|
+
case "value":
|
|
534
|
+
if (!check18(object[key], depth + 1))
|
|
535
|
+
return false;
|
|
536
|
+
break;
|
|
537
|
+
default: return false;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
if (!Object.prototype.hasOwnProperty.call(object, "kind"))
|
|
541
|
+
return false;
|
|
542
|
+
if (!Object.prototype.hasOwnProperty.call(object, "value"))
|
|
543
|
+
return false;
|
|
544
|
+
return true;
|
|
545
|
+
}
|
|
546
|
+
function check17(value, depth = 0) {
|
|
547
|
+
if (depth >= 128)
|
|
548
|
+
return false;
|
|
549
|
+
if (typeof value !== 'string' || !validText(value))
|
|
550
|
+
return false;
|
|
551
|
+
if (value !== "bool")
|
|
552
|
+
return false;
|
|
553
|
+
return true;
|
|
554
|
+
}
|
|
555
|
+
function check18(value, depth = 0) {
|
|
556
|
+
if (depth >= 128)
|
|
557
|
+
return false;
|
|
558
|
+
if (typeof value !== 'boolean')
|
|
559
|
+
return false;
|
|
560
|
+
return true;
|
|
561
|
+
}
|
|
562
|
+
function check19(value, depth = 0) {
|
|
563
|
+
if (depth >= 128)
|
|
564
|
+
return false;
|
|
565
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
566
|
+
return false;
|
|
567
|
+
const object = value;
|
|
568
|
+
for (const key of Object.keys(object)) {
|
|
569
|
+
switch (key) {
|
|
570
|
+
case "kind":
|
|
571
|
+
if (!check20(object[key], depth + 1))
|
|
572
|
+
return false;
|
|
573
|
+
break;
|
|
574
|
+
case "value":
|
|
575
|
+
if (!check21(object[key], depth + 1))
|
|
576
|
+
return false;
|
|
577
|
+
break;
|
|
578
|
+
default: return false;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
if (!Object.prototype.hasOwnProperty.call(object, "kind"))
|
|
582
|
+
return false;
|
|
583
|
+
if (!Object.prototype.hasOwnProperty.call(object, "value"))
|
|
584
|
+
return false;
|
|
585
|
+
return true;
|
|
586
|
+
}
|
|
587
|
+
function check20(value, depth = 0) {
|
|
588
|
+
if (depth >= 128)
|
|
589
|
+
return false;
|
|
590
|
+
if (typeof value !== 'string' || !validText(value))
|
|
591
|
+
return false;
|
|
592
|
+
if (value !== "int64")
|
|
593
|
+
return false;
|
|
594
|
+
return true;
|
|
595
|
+
}
|
|
596
|
+
function check21(value, depth = 0) {
|
|
597
|
+
if (depth >= 128)
|
|
598
|
+
return false;
|
|
599
|
+
if (typeof value !== 'string' || !validText(value))
|
|
600
|
+
return false;
|
|
601
|
+
if ([...value].length < 1)
|
|
602
|
+
return false;
|
|
603
|
+
if ([...value].length > 20)
|
|
604
|
+
return false;
|
|
605
|
+
if ((new RegExp("^(0|-[1-9][0-9]*|[1-9][0-9]*)$", 'u')).exec(value)?.[0] !== value)
|
|
606
|
+
return false;
|
|
607
|
+
if (BigInt(value) < -9223372036854775808n || BigInt(value) > 9223372036854775807n)
|
|
608
|
+
return false;
|
|
609
|
+
return true;
|
|
610
|
+
}
|
|
611
|
+
function check22(value, depth = 0) {
|
|
612
|
+
if (depth >= 128)
|
|
613
|
+
return false;
|
|
614
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
615
|
+
return false;
|
|
616
|
+
const object = value;
|
|
617
|
+
for (const key of Object.keys(object)) {
|
|
618
|
+
switch (key) {
|
|
619
|
+
case "kind":
|
|
620
|
+
if (!check23(object[key], depth + 1))
|
|
621
|
+
return false;
|
|
622
|
+
break;
|
|
623
|
+
case "value":
|
|
624
|
+
if (!check24(object[key], depth + 1))
|
|
625
|
+
return false;
|
|
626
|
+
break;
|
|
627
|
+
default: return false;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
if (!Object.prototype.hasOwnProperty.call(object, "kind"))
|
|
631
|
+
return false;
|
|
632
|
+
if (!Object.prototype.hasOwnProperty.call(object, "value"))
|
|
633
|
+
return false;
|
|
634
|
+
return true;
|
|
635
|
+
}
|
|
636
|
+
function check23(value, depth = 0) {
|
|
637
|
+
if (depth >= 128)
|
|
638
|
+
return false;
|
|
639
|
+
if (typeof value !== 'string' || !validText(value))
|
|
640
|
+
return false;
|
|
641
|
+
if (value !== "decimal")
|
|
642
|
+
return false;
|
|
643
|
+
return true;
|
|
644
|
+
}
|
|
645
|
+
function check24(value, depth = 0) {
|
|
646
|
+
if (depth >= 128)
|
|
647
|
+
return false;
|
|
648
|
+
if (typeof value !== 'string' || !validText(value))
|
|
649
|
+
return false;
|
|
650
|
+
if ([...value].length < 1)
|
|
651
|
+
return false;
|
|
652
|
+
if ([...value].length > 39)
|
|
653
|
+
return false;
|
|
654
|
+
if ((new RegExp("^(0|-?[1-9][0-9]*|-?(0|[1-9][0-9]*)\\.[0-9]{0,8}[1-9])$", 'u')).exec(value)?.[0] !== value)
|
|
655
|
+
return false;
|
|
656
|
+
if (!canonicalDecimal(value))
|
|
657
|
+
return false;
|
|
658
|
+
return true;
|
|
659
|
+
}
|
|
660
|
+
function check25(value, depth = 0) {
|
|
661
|
+
if (depth >= 128)
|
|
662
|
+
return false;
|
|
663
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
664
|
+
return false;
|
|
665
|
+
const object = value;
|
|
666
|
+
for (const key of Object.keys(object)) {
|
|
667
|
+
switch (key) {
|
|
668
|
+
case "kind":
|
|
669
|
+
if (!check26(object[key], depth + 1))
|
|
670
|
+
return false;
|
|
671
|
+
break;
|
|
672
|
+
case "value":
|
|
673
|
+
if (!check27(object[key], depth + 1))
|
|
674
|
+
return false;
|
|
675
|
+
break;
|
|
676
|
+
default: return false;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
if (!Object.prototype.hasOwnProperty.call(object, "kind"))
|
|
680
|
+
return false;
|
|
681
|
+
if (!Object.prototype.hasOwnProperty.call(object, "value"))
|
|
682
|
+
return false;
|
|
683
|
+
return true;
|
|
684
|
+
}
|
|
685
|
+
function check26(value, depth = 0) {
|
|
686
|
+
if (depth >= 128)
|
|
687
|
+
return false;
|
|
688
|
+
if (typeof value !== 'string' || !validText(value))
|
|
689
|
+
return false;
|
|
690
|
+
if (value !== "enum")
|
|
691
|
+
return false;
|
|
692
|
+
return true;
|
|
693
|
+
}
|
|
694
|
+
function check27(value, depth = 0) {
|
|
695
|
+
if (depth >= 128)
|
|
696
|
+
return false;
|
|
697
|
+
if (typeof value !== 'string' || !validText(value))
|
|
698
|
+
return false;
|
|
699
|
+
if ([...value].length < 1)
|
|
700
|
+
return false;
|
|
701
|
+
if ([...value].length > 128)
|
|
702
|
+
return false;
|
|
703
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
704
|
+
return false;
|
|
705
|
+
return true;
|
|
706
|
+
}
|
|
707
|
+
function check28(value, depth = 0) {
|
|
708
|
+
if (depth >= 128)
|
|
709
|
+
return false;
|
|
710
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
711
|
+
return false;
|
|
712
|
+
const object = value;
|
|
713
|
+
for (const key of Object.keys(object)) {
|
|
714
|
+
switch (key) {
|
|
715
|
+
case "kind":
|
|
716
|
+
if (!check29(object[key], depth + 1))
|
|
717
|
+
return false;
|
|
718
|
+
break;
|
|
719
|
+
case "value":
|
|
720
|
+
if (!check30(object[key], depth + 1))
|
|
721
|
+
return false;
|
|
722
|
+
break;
|
|
723
|
+
default: return false;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
if (!Object.prototype.hasOwnProperty.call(object, "kind"))
|
|
727
|
+
return false;
|
|
728
|
+
if (!Object.prototype.hasOwnProperty.call(object, "value"))
|
|
729
|
+
return false;
|
|
730
|
+
return true;
|
|
731
|
+
}
|
|
732
|
+
function check29(value, depth = 0) {
|
|
733
|
+
if (depth >= 128)
|
|
734
|
+
return false;
|
|
735
|
+
if (typeof value !== 'string' || !validText(value))
|
|
736
|
+
return false;
|
|
737
|
+
if (value !== "resourceRef")
|
|
738
|
+
return false;
|
|
739
|
+
return true;
|
|
740
|
+
}
|
|
741
|
+
function check30(value, depth = 0) {
|
|
742
|
+
if (depth >= 128)
|
|
743
|
+
return false;
|
|
744
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
745
|
+
return false;
|
|
746
|
+
const object = value;
|
|
747
|
+
for (const key of Object.keys(object)) {
|
|
748
|
+
switch (key) {
|
|
749
|
+
case "realmId":
|
|
750
|
+
if (!check31(object[key], depth + 1))
|
|
751
|
+
return false;
|
|
752
|
+
break;
|
|
753
|
+
case "workspaceId":
|
|
754
|
+
if (!check32(object[key], depth + 1))
|
|
755
|
+
return false;
|
|
756
|
+
break;
|
|
757
|
+
case "ownerAppId":
|
|
758
|
+
if (!check33(object[key], depth + 1))
|
|
759
|
+
return false;
|
|
760
|
+
break;
|
|
761
|
+
case "resourceKind":
|
|
762
|
+
if (!check34(object[key], depth + 1))
|
|
763
|
+
return false;
|
|
764
|
+
break;
|
|
765
|
+
case "resourceId":
|
|
766
|
+
if (!check35(object[key], depth + 1))
|
|
767
|
+
return false;
|
|
768
|
+
break;
|
|
769
|
+
case "displayHint":
|
|
770
|
+
if (!check36(object[key], depth + 1))
|
|
771
|
+
return false;
|
|
772
|
+
break;
|
|
773
|
+
case "availability":
|
|
774
|
+
if (!check37(object[key], depth + 1))
|
|
775
|
+
return false;
|
|
776
|
+
break;
|
|
777
|
+
case "holdingDeviceId":
|
|
778
|
+
if (!check38(object[key], depth + 1))
|
|
779
|
+
return false;
|
|
780
|
+
break;
|
|
781
|
+
default: return false;
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
if (!Object.prototype.hasOwnProperty.call(object, "realmId"))
|
|
785
|
+
return false;
|
|
786
|
+
if (!Object.prototype.hasOwnProperty.call(object, "ownerAppId"))
|
|
787
|
+
return false;
|
|
788
|
+
if (!Object.prototype.hasOwnProperty.call(object, "resourceKind"))
|
|
789
|
+
return false;
|
|
790
|
+
if (!Object.prototype.hasOwnProperty.call(object, "resourceId"))
|
|
791
|
+
return false;
|
|
792
|
+
if (!Object.prototype.hasOwnProperty.call(object, "availability"))
|
|
793
|
+
return false;
|
|
794
|
+
return true;
|
|
795
|
+
}
|
|
796
|
+
function check31(value, depth = 0) {
|
|
797
|
+
if (depth >= 128)
|
|
798
|
+
return false;
|
|
799
|
+
if (typeof value !== 'string' || !validText(value))
|
|
800
|
+
return false;
|
|
801
|
+
if ([...value].length < 1)
|
|
802
|
+
return false;
|
|
803
|
+
if ([...value].length > 36)
|
|
804
|
+
return false;
|
|
805
|
+
if ((new RegExp("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", 'u')).exec(value)?.[0] !== value)
|
|
806
|
+
return false;
|
|
807
|
+
if (value === '00000000-0000-0000-0000-000000000000')
|
|
808
|
+
return false;
|
|
809
|
+
return true;
|
|
810
|
+
}
|
|
811
|
+
function check32(value, depth = 0) {
|
|
812
|
+
if (depth >= 128)
|
|
813
|
+
return false;
|
|
814
|
+
if (typeof value !== 'string' || !validText(value))
|
|
815
|
+
return false;
|
|
816
|
+
if ([...value].length < 1)
|
|
817
|
+
return false;
|
|
818
|
+
if ([...value].length > 36)
|
|
819
|
+
return false;
|
|
820
|
+
if ((new RegExp("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", 'u')).exec(value)?.[0] !== value)
|
|
821
|
+
return false;
|
|
822
|
+
if (value === '00000000-0000-0000-0000-000000000000')
|
|
823
|
+
return false;
|
|
824
|
+
return true;
|
|
825
|
+
}
|
|
826
|
+
function check33(value, depth = 0) {
|
|
827
|
+
if (depth >= 128)
|
|
828
|
+
return false;
|
|
829
|
+
if (typeof value !== 'string' || !validText(value))
|
|
830
|
+
return false;
|
|
831
|
+
if ([...value].length < 1)
|
|
832
|
+
return false;
|
|
833
|
+
if ([...value].length > 128)
|
|
834
|
+
return false;
|
|
835
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
836
|
+
return false;
|
|
837
|
+
return true;
|
|
838
|
+
}
|
|
839
|
+
function check34(value, depth = 0) {
|
|
840
|
+
if (depth >= 128)
|
|
841
|
+
return false;
|
|
842
|
+
if (typeof value !== 'string' || !validText(value))
|
|
843
|
+
return false;
|
|
844
|
+
if ([...value].length < 1)
|
|
845
|
+
return false;
|
|
846
|
+
if ([...value].length > 128)
|
|
847
|
+
return false;
|
|
848
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
849
|
+
return false;
|
|
850
|
+
return true;
|
|
851
|
+
}
|
|
852
|
+
function check35(value, depth = 0) {
|
|
853
|
+
if (depth >= 128)
|
|
854
|
+
return false;
|
|
855
|
+
if (typeof value !== 'string' || !validText(value))
|
|
856
|
+
return false;
|
|
857
|
+
if ([...value].length < 1)
|
|
858
|
+
return false;
|
|
859
|
+
if ([...value].length > 36)
|
|
860
|
+
return false;
|
|
861
|
+
if ((new RegExp("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", 'u')).exec(value)?.[0] !== value)
|
|
862
|
+
return false;
|
|
863
|
+
if (value === '00000000-0000-0000-0000-000000000000')
|
|
864
|
+
return false;
|
|
865
|
+
return true;
|
|
866
|
+
}
|
|
867
|
+
function check36(value, depth = 0) {
|
|
868
|
+
if (depth >= 128)
|
|
869
|
+
return false;
|
|
870
|
+
if (typeof value !== 'string' || !validText(value))
|
|
871
|
+
return false;
|
|
872
|
+
if ([...value].length < 1)
|
|
873
|
+
return false;
|
|
874
|
+
if ([...value].length > 256)
|
|
875
|
+
return false;
|
|
876
|
+
return true;
|
|
877
|
+
}
|
|
878
|
+
function check37(value, depth = 0) {
|
|
879
|
+
if (depth >= 128)
|
|
880
|
+
return false;
|
|
881
|
+
if (typeof value !== 'string' || !validText(value))
|
|
882
|
+
return false;
|
|
883
|
+
if (value !== "AlwaysKeep" && value !== "AvailableOffline" && value !== "OnDemand" && value !== "CloudOnly" && value !== "MissingExternal")
|
|
884
|
+
return false;
|
|
885
|
+
return true;
|
|
886
|
+
}
|
|
887
|
+
function check38(value, depth = 0) {
|
|
888
|
+
if (depth >= 128)
|
|
889
|
+
return false;
|
|
890
|
+
if (typeof value !== 'string' || !validText(value))
|
|
891
|
+
return false;
|
|
892
|
+
if ([...value].length < 1)
|
|
893
|
+
return false;
|
|
894
|
+
if ([...value].length > 36)
|
|
895
|
+
return false;
|
|
896
|
+
if ((new RegExp("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", 'u')).exec(value)?.[0] !== value)
|
|
897
|
+
return false;
|
|
898
|
+
if (value === '00000000-0000-0000-0000-000000000000')
|
|
899
|
+
return false;
|
|
900
|
+
return true;
|
|
901
|
+
}
|
|
902
|
+
function check39(value, depth = 0) {
|
|
903
|
+
if (depth >= 128)
|
|
904
|
+
return false;
|
|
905
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
906
|
+
return false;
|
|
907
|
+
const object = value;
|
|
908
|
+
for (const key of Object.keys(object)) {
|
|
909
|
+
switch (key) {
|
|
910
|
+
case "id":
|
|
911
|
+
if (!check40(object[key], depth + 1))
|
|
912
|
+
return false;
|
|
913
|
+
break;
|
|
914
|
+
case "kind":
|
|
915
|
+
if (!check41(object[key], depth + 1))
|
|
916
|
+
return false;
|
|
917
|
+
break;
|
|
918
|
+
case "name":
|
|
919
|
+
if (!check42(object[key], depth + 1))
|
|
920
|
+
return false;
|
|
921
|
+
break;
|
|
922
|
+
default: return false;
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
if (!Object.prototype.hasOwnProperty.call(object, "id"))
|
|
926
|
+
return false;
|
|
927
|
+
if (!Object.prototype.hasOwnProperty.call(object, "kind"))
|
|
928
|
+
return false;
|
|
929
|
+
if (!Object.prototype.hasOwnProperty.call(object, "name"))
|
|
930
|
+
return false;
|
|
931
|
+
return true;
|
|
932
|
+
}
|
|
933
|
+
function check40(value, depth = 0) {
|
|
934
|
+
if (depth >= 128)
|
|
935
|
+
return false;
|
|
936
|
+
if (typeof value !== 'string' || !validText(value))
|
|
937
|
+
return false;
|
|
938
|
+
if ([...value].length < 1)
|
|
939
|
+
return false;
|
|
940
|
+
if ([...value].length > 128)
|
|
941
|
+
return false;
|
|
942
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
943
|
+
return false;
|
|
944
|
+
return true;
|
|
945
|
+
}
|
|
946
|
+
function check41(value, depth = 0) {
|
|
947
|
+
if (depth >= 128)
|
|
948
|
+
return false;
|
|
949
|
+
if (typeof value !== 'string' || !validText(value))
|
|
950
|
+
return false;
|
|
951
|
+
if (value !== "input")
|
|
952
|
+
return false;
|
|
953
|
+
return true;
|
|
954
|
+
}
|
|
955
|
+
function check42(value, depth = 0) {
|
|
956
|
+
if (depth >= 128)
|
|
957
|
+
return false;
|
|
958
|
+
if (typeof value !== 'string' || !validText(value))
|
|
959
|
+
return false;
|
|
960
|
+
if ([...value].length < 1)
|
|
961
|
+
return false;
|
|
962
|
+
if ([...value].length > 128)
|
|
963
|
+
return false;
|
|
964
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
965
|
+
return false;
|
|
966
|
+
return true;
|
|
967
|
+
}
|
|
968
|
+
function check43(value, depth = 0) {
|
|
969
|
+
if (depth >= 128)
|
|
970
|
+
return false;
|
|
971
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
972
|
+
return false;
|
|
973
|
+
const object = value;
|
|
974
|
+
for (const key of Object.keys(object)) {
|
|
975
|
+
switch (key) {
|
|
976
|
+
case "id":
|
|
977
|
+
if (!check44(object[key], depth + 1))
|
|
978
|
+
return false;
|
|
979
|
+
break;
|
|
980
|
+
case "kind":
|
|
981
|
+
if (!check45(object[key], depth + 1))
|
|
982
|
+
return false;
|
|
983
|
+
break;
|
|
984
|
+
case "source":
|
|
985
|
+
if (!check46(object[key], depth + 1))
|
|
986
|
+
return false;
|
|
987
|
+
break;
|
|
988
|
+
case "recordField":
|
|
989
|
+
if (!check49(object[key], depth + 1))
|
|
990
|
+
return false;
|
|
991
|
+
break;
|
|
992
|
+
default: return false;
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
if (!Object.prototype.hasOwnProperty.call(object, "id"))
|
|
996
|
+
return false;
|
|
997
|
+
if (!Object.prototype.hasOwnProperty.call(object, "kind"))
|
|
998
|
+
return false;
|
|
999
|
+
if (!Object.prototype.hasOwnProperty.call(object, "source"))
|
|
1000
|
+
return false;
|
|
1001
|
+
if (!Object.prototype.hasOwnProperty.call(object, "recordField"))
|
|
1002
|
+
return false;
|
|
1003
|
+
return true;
|
|
1004
|
+
}
|
|
1005
|
+
function check44(value, depth = 0) {
|
|
1006
|
+
if (depth >= 128)
|
|
1007
|
+
return false;
|
|
1008
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1009
|
+
return false;
|
|
1010
|
+
if ([...value].length < 1)
|
|
1011
|
+
return false;
|
|
1012
|
+
if ([...value].length > 128)
|
|
1013
|
+
return false;
|
|
1014
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
1015
|
+
return false;
|
|
1016
|
+
return true;
|
|
1017
|
+
}
|
|
1018
|
+
function check45(value, depth = 0) {
|
|
1019
|
+
if (depth >= 128)
|
|
1020
|
+
return false;
|
|
1021
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1022
|
+
return false;
|
|
1023
|
+
if (value !== "select")
|
|
1024
|
+
return false;
|
|
1025
|
+
return true;
|
|
1026
|
+
}
|
|
1027
|
+
function check46(value, depth = 0) {
|
|
1028
|
+
if (depth >= 128)
|
|
1029
|
+
return false;
|
|
1030
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
1031
|
+
return false;
|
|
1032
|
+
const object = value;
|
|
1033
|
+
for (const key of Object.keys(object)) {
|
|
1034
|
+
switch (key) {
|
|
1035
|
+
case "nodeId":
|
|
1036
|
+
if (!check47(object[key], depth + 1))
|
|
1037
|
+
return false;
|
|
1038
|
+
break;
|
|
1039
|
+
case "field":
|
|
1040
|
+
if (!check48(object[key], depth + 1))
|
|
1041
|
+
return false;
|
|
1042
|
+
break;
|
|
1043
|
+
default: return false;
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
if (!Object.prototype.hasOwnProperty.call(object, "nodeId"))
|
|
1047
|
+
return false;
|
|
1048
|
+
if (!Object.prototype.hasOwnProperty.call(object, "field"))
|
|
1049
|
+
return false;
|
|
1050
|
+
return true;
|
|
1051
|
+
}
|
|
1052
|
+
function check47(value, depth = 0) {
|
|
1053
|
+
if (depth >= 128)
|
|
1054
|
+
return false;
|
|
1055
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1056
|
+
return false;
|
|
1057
|
+
if ([...value].length < 1)
|
|
1058
|
+
return false;
|
|
1059
|
+
if ([...value].length > 128)
|
|
1060
|
+
return false;
|
|
1061
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
1062
|
+
return false;
|
|
1063
|
+
return true;
|
|
1064
|
+
}
|
|
1065
|
+
function check48(value, depth = 0) {
|
|
1066
|
+
if (depth >= 128)
|
|
1067
|
+
return false;
|
|
1068
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1069
|
+
return false;
|
|
1070
|
+
if ([...value].length < 1)
|
|
1071
|
+
return false;
|
|
1072
|
+
if ([...value].length > 128)
|
|
1073
|
+
return false;
|
|
1074
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
1075
|
+
return false;
|
|
1076
|
+
return true;
|
|
1077
|
+
}
|
|
1078
|
+
function check49(value, depth = 0) {
|
|
1079
|
+
if (depth >= 128)
|
|
1080
|
+
return false;
|
|
1081
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1082
|
+
return false;
|
|
1083
|
+
if ([...value].length < 1)
|
|
1084
|
+
return false;
|
|
1085
|
+
if ([...value].length > 128)
|
|
1086
|
+
return false;
|
|
1087
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
1088
|
+
return false;
|
|
1089
|
+
return true;
|
|
1090
|
+
}
|
|
1091
|
+
function check50(value, depth = 0) {
|
|
1092
|
+
if (depth >= 128)
|
|
1093
|
+
return false;
|
|
1094
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
1095
|
+
return false;
|
|
1096
|
+
const object = value;
|
|
1097
|
+
for (const key of Object.keys(object)) {
|
|
1098
|
+
switch (key) {
|
|
1099
|
+
case "id":
|
|
1100
|
+
if (!check51(object[key], depth + 1))
|
|
1101
|
+
return false;
|
|
1102
|
+
break;
|
|
1103
|
+
case "kind":
|
|
1104
|
+
if (!check52(object[key], depth + 1))
|
|
1105
|
+
return false;
|
|
1106
|
+
break;
|
|
1107
|
+
case "operationId":
|
|
1108
|
+
if (!check53(object[key], depth + 1))
|
|
1109
|
+
return false;
|
|
1110
|
+
break;
|
|
1111
|
+
case "typedArguments":
|
|
1112
|
+
if (!check54(object[key], depth + 1))
|
|
1113
|
+
return false;
|
|
1114
|
+
break;
|
|
1115
|
+
case "dependencies":
|
|
1116
|
+
if (!check62(object[key], depth + 1))
|
|
1117
|
+
return false;
|
|
1118
|
+
break;
|
|
1119
|
+
default: return false;
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
if (!Object.prototype.hasOwnProperty.call(object, "id"))
|
|
1123
|
+
return false;
|
|
1124
|
+
if (!Object.prototype.hasOwnProperty.call(object, "kind"))
|
|
1125
|
+
return false;
|
|
1126
|
+
if (!Object.prototype.hasOwnProperty.call(object, "operationId"))
|
|
1127
|
+
return false;
|
|
1128
|
+
if (!Object.prototype.hasOwnProperty.call(object, "typedArguments"))
|
|
1129
|
+
return false;
|
|
1130
|
+
if (!Object.prototype.hasOwnProperty.call(object, "dependencies"))
|
|
1131
|
+
return false;
|
|
1132
|
+
return true;
|
|
1133
|
+
}
|
|
1134
|
+
function check51(value, depth = 0) {
|
|
1135
|
+
if (depth >= 128)
|
|
1136
|
+
return false;
|
|
1137
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1138
|
+
return false;
|
|
1139
|
+
if ([...value].length < 1)
|
|
1140
|
+
return false;
|
|
1141
|
+
if ([...value].length > 128)
|
|
1142
|
+
return false;
|
|
1143
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
1144
|
+
return false;
|
|
1145
|
+
return true;
|
|
1146
|
+
}
|
|
1147
|
+
function check52(value, depth = 0) {
|
|
1148
|
+
if (depth >= 128)
|
|
1149
|
+
return false;
|
|
1150
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1151
|
+
return false;
|
|
1152
|
+
if (value !== "capability")
|
|
1153
|
+
return false;
|
|
1154
|
+
return true;
|
|
1155
|
+
}
|
|
1156
|
+
function check53(value, depth = 0) {
|
|
1157
|
+
if (depth >= 128)
|
|
1158
|
+
return false;
|
|
1159
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1160
|
+
return false;
|
|
1161
|
+
if ([...value].length < 1)
|
|
1162
|
+
return false;
|
|
1163
|
+
if ([...value].length > 128)
|
|
1164
|
+
return false;
|
|
1165
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
1166
|
+
return false;
|
|
1167
|
+
return true;
|
|
1168
|
+
}
|
|
1169
|
+
function check54(value, depth = 0) {
|
|
1170
|
+
if (depth >= 128)
|
|
1171
|
+
return false;
|
|
1172
|
+
if (!Array.isArray(value))
|
|
1173
|
+
return false;
|
|
1174
|
+
if (value.length < 0)
|
|
1175
|
+
return false;
|
|
1176
|
+
if (value.length > 64)
|
|
1177
|
+
return false;
|
|
1178
|
+
if (!value.every(item => check55(item, depth + 1)))
|
|
1179
|
+
return false;
|
|
1180
|
+
return true;
|
|
1181
|
+
}
|
|
1182
|
+
function check55(value, depth = 0) {
|
|
1183
|
+
if (depth >= 128)
|
|
1184
|
+
return false;
|
|
1185
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
1186
|
+
return false;
|
|
1187
|
+
const object = value;
|
|
1188
|
+
for (const key of Object.keys(object)) {
|
|
1189
|
+
switch (key) {
|
|
1190
|
+
case "name":
|
|
1191
|
+
if (!check56(object[key], depth + 1))
|
|
1192
|
+
return false;
|
|
1193
|
+
break;
|
|
1194
|
+
case "value":
|
|
1195
|
+
if (!check57(object[key], depth + 1))
|
|
1196
|
+
return false;
|
|
1197
|
+
break;
|
|
1198
|
+
default: return false;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
if (!Object.prototype.hasOwnProperty.call(object, "name"))
|
|
1202
|
+
return false;
|
|
1203
|
+
if (!Object.prototype.hasOwnProperty.call(object, "value"))
|
|
1204
|
+
return false;
|
|
1205
|
+
return true;
|
|
1206
|
+
}
|
|
1207
|
+
function check56(value, depth = 0) {
|
|
1208
|
+
if (depth >= 128)
|
|
1209
|
+
return false;
|
|
1210
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1211
|
+
return false;
|
|
1212
|
+
if ([...value].length < 1)
|
|
1213
|
+
return false;
|
|
1214
|
+
if ([...value].length > 128)
|
|
1215
|
+
return false;
|
|
1216
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
1217
|
+
return false;
|
|
1218
|
+
return true;
|
|
1219
|
+
}
|
|
1220
|
+
function check57(value, depth = 0) {
|
|
1221
|
+
if (depth >= 128)
|
|
1222
|
+
return false;
|
|
1223
|
+
if ((check58(value, depth + 1) ? 1 : 0) + (check60(value, depth + 1) ? 1 : 0) !== 1)
|
|
1224
|
+
return false;
|
|
1225
|
+
return true;
|
|
1226
|
+
}
|
|
1227
|
+
function check58(value, depth = 0) {
|
|
1228
|
+
if (depth >= 128)
|
|
1229
|
+
return false;
|
|
1230
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
1231
|
+
return false;
|
|
1232
|
+
const object = value;
|
|
1233
|
+
for (const key of Object.keys(object)) {
|
|
1234
|
+
switch (key) {
|
|
1235
|
+
case "kind":
|
|
1236
|
+
if (!check59(object[key], depth + 1))
|
|
1237
|
+
return false;
|
|
1238
|
+
break;
|
|
1239
|
+
case "value":
|
|
1240
|
+
if (!check12(object[key], depth + 1))
|
|
1241
|
+
return false;
|
|
1242
|
+
break;
|
|
1243
|
+
default: return false;
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
if (!Object.prototype.hasOwnProperty.call(object, "kind"))
|
|
1247
|
+
return false;
|
|
1248
|
+
if (!Object.prototype.hasOwnProperty.call(object, "value"))
|
|
1249
|
+
return false;
|
|
1250
|
+
return true;
|
|
1251
|
+
}
|
|
1252
|
+
function check59(value, depth = 0) {
|
|
1253
|
+
if (depth >= 128)
|
|
1254
|
+
return false;
|
|
1255
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1256
|
+
return false;
|
|
1257
|
+
if (value !== "literal")
|
|
1258
|
+
return false;
|
|
1259
|
+
return true;
|
|
1260
|
+
}
|
|
1261
|
+
function check60(value, depth = 0) {
|
|
1262
|
+
if (depth >= 128)
|
|
1263
|
+
return false;
|
|
1264
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
1265
|
+
return false;
|
|
1266
|
+
const object = value;
|
|
1267
|
+
for (const key of Object.keys(object)) {
|
|
1268
|
+
switch (key) {
|
|
1269
|
+
case "kind":
|
|
1270
|
+
if (!check61(object[key], depth + 1))
|
|
1271
|
+
return false;
|
|
1272
|
+
break;
|
|
1273
|
+
case "valueRef":
|
|
1274
|
+
if (!check46(object[key], depth + 1))
|
|
1275
|
+
return false;
|
|
1276
|
+
break;
|
|
1277
|
+
default: return false;
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
if (!Object.prototype.hasOwnProperty.call(object, "kind"))
|
|
1281
|
+
return false;
|
|
1282
|
+
if (!Object.prototype.hasOwnProperty.call(object, "valueRef"))
|
|
1283
|
+
return false;
|
|
1284
|
+
return true;
|
|
1285
|
+
}
|
|
1286
|
+
function check61(value, depth = 0) {
|
|
1287
|
+
if (depth >= 128)
|
|
1288
|
+
return false;
|
|
1289
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1290
|
+
return false;
|
|
1291
|
+
if (value !== "reference")
|
|
1292
|
+
return false;
|
|
1293
|
+
return true;
|
|
1294
|
+
}
|
|
1295
|
+
function check62(value, depth = 0) {
|
|
1296
|
+
if (depth >= 128)
|
|
1297
|
+
return false;
|
|
1298
|
+
if (!Array.isArray(value))
|
|
1299
|
+
return false;
|
|
1300
|
+
if (value.length < 0)
|
|
1301
|
+
return false;
|
|
1302
|
+
if (value.length > 256)
|
|
1303
|
+
return false;
|
|
1304
|
+
if (!value.every(item => check63(item, depth + 1)))
|
|
1305
|
+
return false;
|
|
1306
|
+
return true;
|
|
1307
|
+
}
|
|
1308
|
+
function check63(value, depth = 0) {
|
|
1309
|
+
if (depth >= 128)
|
|
1310
|
+
return false;
|
|
1311
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1312
|
+
return false;
|
|
1313
|
+
if ([...value].length < 1)
|
|
1314
|
+
return false;
|
|
1315
|
+
if ([...value].length > 128)
|
|
1316
|
+
return false;
|
|
1317
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
1318
|
+
return false;
|
|
1319
|
+
return true;
|
|
1320
|
+
}
|
|
1321
|
+
function check64(value, depth = 0) {
|
|
1322
|
+
if (depth >= 128)
|
|
1323
|
+
return false;
|
|
1324
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
1325
|
+
return false;
|
|
1326
|
+
const object = value;
|
|
1327
|
+
for (const key of Object.keys(object)) {
|
|
1328
|
+
switch (key) {
|
|
1329
|
+
case "id":
|
|
1330
|
+
if (!check65(object[key], depth + 1))
|
|
1331
|
+
return false;
|
|
1332
|
+
break;
|
|
1333
|
+
case "kind":
|
|
1334
|
+
if (!check66(object[key], depth + 1))
|
|
1335
|
+
return false;
|
|
1336
|
+
break;
|
|
1337
|
+
case "predicate":
|
|
1338
|
+
if (!check67(object[key], depth + 1))
|
|
1339
|
+
return false;
|
|
1340
|
+
break;
|
|
1341
|
+
case "thenNodes":
|
|
1342
|
+
if (!check78(object[key], depth + 1))
|
|
1343
|
+
return false;
|
|
1344
|
+
break;
|
|
1345
|
+
case "elseNodes":
|
|
1346
|
+
if (!check80(object[key], depth + 1))
|
|
1347
|
+
return false;
|
|
1348
|
+
break;
|
|
1349
|
+
default: return false;
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
if (!Object.prototype.hasOwnProperty.call(object, "id"))
|
|
1353
|
+
return false;
|
|
1354
|
+
if (!Object.prototype.hasOwnProperty.call(object, "kind"))
|
|
1355
|
+
return false;
|
|
1356
|
+
if (!Object.prototype.hasOwnProperty.call(object, "predicate"))
|
|
1357
|
+
return false;
|
|
1358
|
+
if (!Object.prototype.hasOwnProperty.call(object, "thenNodes"))
|
|
1359
|
+
return false;
|
|
1360
|
+
if (!Object.prototype.hasOwnProperty.call(object, "elseNodes"))
|
|
1361
|
+
return false;
|
|
1362
|
+
return true;
|
|
1363
|
+
}
|
|
1364
|
+
function check65(value, depth = 0) {
|
|
1365
|
+
if (depth >= 128)
|
|
1366
|
+
return false;
|
|
1367
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1368
|
+
return false;
|
|
1369
|
+
if ([...value].length < 1)
|
|
1370
|
+
return false;
|
|
1371
|
+
if ([...value].length > 128)
|
|
1372
|
+
return false;
|
|
1373
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
1374
|
+
return false;
|
|
1375
|
+
return true;
|
|
1376
|
+
}
|
|
1377
|
+
function check66(value, depth = 0) {
|
|
1378
|
+
if (depth >= 128)
|
|
1379
|
+
return false;
|
|
1380
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1381
|
+
return false;
|
|
1382
|
+
if (value !== "condition")
|
|
1383
|
+
return false;
|
|
1384
|
+
return true;
|
|
1385
|
+
}
|
|
1386
|
+
function check67(value, depth = 0) {
|
|
1387
|
+
if (depth >= 128)
|
|
1388
|
+
return false;
|
|
1389
|
+
if ((check68(value, depth + 1) ? 1 : 0) + (check70(value, depth + 1) ? 1 : 0) + (check72(value, depth + 1) ? 1 : 0) + (check75(value, depth + 1) ? 1 : 0) !== 1)
|
|
1390
|
+
return false;
|
|
1391
|
+
return true;
|
|
1392
|
+
}
|
|
1393
|
+
function check68(value, depth = 0) {
|
|
1394
|
+
if (depth >= 128)
|
|
1395
|
+
return false;
|
|
1396
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
1397
|
+
return false;
|
|
1398
|
+
const object = value;
|
|
1399
|
+
for (const key of Object.keys(object)) {
|
|
1400
|
+
switch (key) {
|
|
1401
|
+
case "operator":
|
|
1402
|
+
if (!check69(object[key], depth + 1))
|
|
1403
|
+
return false;
|
|
1404
|
+
break;
|
|
1405
|
+
case "left":
|
|
1406
|
+
if (!check57(object[key], depth + 1))
|
|
1407
|
+
return false;
|
|
1408
|
+
break;
|
|
1409
|
+
case "right":
|
|
1410
|
+
if (!check57(object[key], depth + 1))
|
|
1411
|
+
return false;
|
|
1412
|
+
break;
|
|
1413
|
+
default: return false;
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
if (!Object.prototype.hasOwnProperty.call(object, "operator"))
|
|
1417
|
+
return false;
|
|
1418
|
+
if (!Object.prototype.hasOwnProperty.call(object, "left"))
|
|
1419
|
+
return false;
|
|
1420
|
+
if (!Object.prototype.hasOwnProperty.call(object, "right"))
|
|
1421
|
+
return false;
|
|
1422
|
+
return true;
|
|
1423
|
+
}
|
|
1424
|
+
function check69(value, depth = 0) {
|
|
1425
|
+
if (depth >= 128)
|
|
1426
|
+
return false;
|
|
1427
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1428
|
+
return false;
|
|
1429
|
+
if (value !== "eq" && value !== "ne" && value !== "lt" && value !== "le" && value !== "gt" && value !== "ge")
|
|
1430
|
+
return false;
|
|
1431
|
+
return true;
|
|
1432
|
+
}
|
|
1433
|
+
function check70(value, depth = 0) {
|
|
1434
|
+
if (depth >= 128)
|
|
1435
|
+
return false;
|
|
1436
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
1437
|
+
return false;
|
|
1438
|
+
const object = value;
|
|
1439
|
+
for (const key of Object.keys(object)) {
|
|
1440
|
+
switch (key) {
|
|
1441
|
+
case "operator":
|
|
1442
|
+
if (!check71(object[key], depth + 1))
|
|
1443
|
+
return false;
|
|
1444
|
+
break;
|
|
1445
|
+
case "valueRef":
|
|
1446
|
+
if (!check46(object[key], depth + 1))
|
|
1447
|
+
return false;
|
|
1448
|
+
break;
|
|
1449
|
+
default: return false;
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
if (!Object.prototype.hasOwnProperty.call(object, "operator"))
|
|
1453
|
+
return false;
|
|
1454
|
+
if (!Object.prototype.hasOwnProperty.call(object, "valueRef"))
|
|
1455
|
+
return false;
|
|
1456
|
+
return true;
|
|
1457
|
+
}
|
|
1458
|
+
function check71(value, depth = 0) {
|
|
1459
|
+
if (depth >= 128)
|
|
1460
|
+
return false;
|
|
1461
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1462
|
+
return false;
|
|
1463
|
+
if (value !== "exists")
|
|
1464
|
+
return false;
|
|
1465
|
+
return true;
|
|
1466
|
+
}
|
|
1467
|
+
function check72(value, depth = 0) {
|
|
1468
|
+
if (depth >= 128)
|
|
1469
|
+
return false;
|
|
1470
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
1471
|
+
return false;
|
|
1472
|
+
const object = value;
|
|
1473
|
+
for (const key of Object.keys(object)) {
|
|
1474
|
+
switch (key) {
|
|
1475
|
+
case "operator":
|
|
1476
|
+
if (!check73(object[key], depth + 1))
|
|
1477
|
+
return false;
|
|
1478
|
+
break;
|
|
1479
|
+
case "predicates":
|
|
1480
|
+
if (!check74(object[key], depth + 1))
|
|
1481
|
+
return false;
|
|
1482
|
+
break;
|
|
1483
|
+
default: return false;
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
if (!Object.prototype.hasOwnProperty.call(object, "operator"))
|
|
1487
|
+
return false;
|
|
1488
|
+
if (!Object.prototype.hasOwnProperty.call(object, "predicates"))
|
|
1489
|
+
return false;
|
|
1490
|
+
return true;
|
|
1491
|
+
}
|
|
1492
|
+
function check73(value, depth = 0) {
|
|
1493
|
+
if (depth >= 128)
|
|
1494
|
+
return false;
|
|
1495
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1496
|
+
return false;
|
|
1497
|
+
if (value !== "all")
|
|
1498
|
+
return false;
|
|
1499
|
+
return true;
|
|
1500
|
+
}
|
|
1501
|
+
function check74(value, depth = 0) {
|
|
1502
|
+
if (depth >= 128)
|
|
1503
|
+
return false;
|
|
1504
|
+
if (!Array.isArray(value))
|
|
1505
|
+
return false;
|
|
1506
|
+
if (value.length < 1)
|
|
1507
|
+
return false;
|
|
1508
|
+
if (value.length > 128)
|
|
1509
|
+
return false;
|
|
1510
|
+
if (!value.every(item => check67(item, depth + 1)))
|
|
1511
|
+
return false;
|
|
1512
|
+
return true;
|
|
1513
|
+
}
|
|
1514
|
+
function check75(value, depth = 0) {
|
|
1515
|
+
if (depth >= 128)
|
|
1516
|
+
return false;
|
|
1517
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
1518
|
+
return false;
|
|
1519
|
+
const object = value;
|
|
1520
|
+
for (const key of Object.keys(object)) {
|
|
1521
|
+
switch (key) {
|
|
1522
|
+
case "operator":
|
|
1523
|
+
if (!check76(object[key], depth + 1))
|
|
1524
|
+
return false;
|
|
1525
|
+
break;
|
|
1526
|
+
case "predicates":
|
|
1527
|
+
if (!check77(object[key], depth + 1))
|
|
1528
|
+
return false;
|
|
1529
|
+
break;
|
|
1530
|
+
default: return false;
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
if (!Object.prototype.hasOwnProperty.call(object, "operator"))
|
|
1534
|
+
return false;
|
|
1535
|
+
if (!Object.prototype.hasOwnProperty.call(object, "predicates"))
|
|
1536
|
+
return false;
|
|
1537
|
+
return true;
|
|
1538
|
+
}
|
|
1539
|
+
function check76(value, depth = 0) {
|
|
1540
|
+
if (depth >= 128)
|
|
1541
|
+
return false;
|
|
1542
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1543
|
+
return false;
|
|
1544
|
+
if (value !== "any")
|
|
1545
|
+
return false;
|
|
1546
|
+
return true;
|
|
1547
|
+
}
|
|
1548
|
+
function check77(value, depth = 0) {
|
|
1549
|
+
if (depth >= 128)
|
|
1550
|
+
return false;
|
|
1551
|
+
if (!Array.isArray(value))
|
|
1552
|
+
return false;
|
|
1553
|
+
if (value.length < 1)
|
|
1554
|
+
return false;
|
|
1555
|
+
if (value.length > 128)
|
|
1556
|
+
return false;
|
|
1557
|
+
if (!value.every(item => check67(item, depth + 1)))
|
|
1558
|
+
return false;
|
|
1559
|
+
return true;
|
|
1560
|
+
}
|
|
1561
|
+
function check78(value, depth = 0) {
|
|
1562
|
+
if (depth >= 128)
|
|
1563
|
+
return false;
|
|
1564
|
+
if (!Array.isArray(value))
|
|
1565
|
+
return false;
|
|
1566
|
+
if (value.length < 0)
|
|
1567
|
+
return false;
|
|
1568
|
+
if (value.length > 256)
|
|
1569
|
+
return false;
|
|
1570
|
+
if (!value.every(item => check79(item, depth + 1)))
|
|
1571
|
+
return false;
|
|
1572
|
+
return true;
|
|
1573
|
+
}
|
|
1574
|
+
function check79(value, depth = 0) {
|
|
1575
|
+
if (depth >= 128)
|
|
1576
|
+
return false;
|
|
1577
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1578
|
+
return false;
|
|
1579
|
+
if ([...value].length < 1)
|
|
1580
|
+
return false;
|
|
1581
|
+
if ([...value].length > 128)
|
|
1582
|
+
return false;
|
|
1583
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
1584
|
+
return false;
|
|
1585
|
+
return true;
|
|
1586
|
+
}
|
|
1587
|
+
function check80(value, depth = 0) {
|
|
1588
|
+
if (depth >= 128)
|
|
1589
|
+
return false;
|
|
1590
|
+
if (!Array.isArray(value))
|
|
1591
|
+
return false;
|
|
1592
|
+
if (value.length < 0)
|
|
1593
|
+
return false;
|
|
1594
|
+
if (value.length > 256)
|
|
1595
|
+
return false;
|
|
1596
|
+
if (!value.every(item => check81(item, depth + 1)))
|
|
1597
|
+
return false;
|
|
1598
|
+
return true;
|
|
1599
|
+
}
|
|
1600
|
+
function check81(value, depth = 0) {
|
|
1601
|
+
if (depth >= 128)
|
|
1602
|
+
return false;
|
|
1603
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1604
|
+
return false;
|
|
1605
|
+
if ([...value].length < 1)
|
|
1606
|
+
return false;
|
|
1607
|
+
if ([...value].length > 128)
|
|
1608
|
+
return false;
|
|
1609
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
1610
|
+
return false;
|
|
1611
|
+
return true;
|
|
1612
|
+
}
|
|
1613
|
+
function check82(value, depth = 0) {
|
|
1614
|
+
if (depth >= 128)
|
|
1615
|
+
return false;
|
|
1616
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
1617
|
+
return false;
|
|
1618
|
+
const object = value;
|
|
1619
|
+
for (const key of Object.keys(object)) {
|
|
1620
|
+
switch (key) {
|
|
1621
|
+
case "id":
|
|
1622
|
+
if (!check83(object[key], depth + 1))
|
|
1623
|
+
return false;
|
|
1624
|
+
break;
|
|
1625
|
+
case "kind":
|
|
1626
|
+
if (!check84(object[key], depth + 1))
|
|
1627
|
+
return false;
|
|
1628
|
+
break;
|
|
1629
|
+
case "inputArray":
|
|
1630
|
+
if (!check46(object[key], depth + 1))
|
|
1631
|
+
return false;
|
|
1632
|
+
break;
|
|
1633
|
+
case "maxItems":
|
|
1634
|
+
if (!check85(object[key], depth + 1))
|
|
1635
|
+
return false;
|
|
1636
|
+
break;
|
|
1637
|
+
case "body":
|
|
1638
|
+
if (!check86(object[key], depth + 1))
|
|
1639
|
+
return false;
|
|
1640
|
+
break;
|
|
1641
|
+
default: return false;
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
if (!Object.prototype.hasOwnProperty.call(object, "id"))
|
|
1645
|
+
return false;
|
|
1646
|
+
if (!Object.prototype.hasOwnProperty.call(object, "kind"))
|
|
1647
|
+
return false;
|
|
1648
|
+
if (!Object.prototype.hasOwnProperty.call(object, "inputArray"))
|
|
1649
|
+
return false;
|
|
1650
|
+
if (!Object.prototype.hasOwnProperty.call(object, "maxItems"))
|
|
1651
|
+
return false;
|
|
1652
|
+
if (!Object.prototype.hasOwnProperty.call(object, "body"))
|
|
1653
|
+
return false;
|
|
1654
|
+
return true;
|
|
1655
|
+
}
|
|
1656
|
+
function check83(value, depth = 0) {
|
|
1657
|
+
if (depth >= 128)
|
|
1658
|
+
return false;
|
|
1659
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1660
|
+
return false;
|
|
1661
|
+
if ([...value].length < 1)
|
|
1662
|
+
return false;
|
|
1663
|
+
if ([...value].length > 128)
|
|
1664
|
+
return false;
|
|
1665
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
1666
|
+
return false;
|
|
1667
|
+
return true;
|
|
1668
|
+
}
|
|
1669
|
+
function check84(value, depth = 0) {
|
|
1670
|
+
if (depth >= 128)
|
|
1671
|
+
return false;
|
|
1672
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1673
|
+
return false;
|
|
1674
|
+
if (value !== "foreach")
|
|
1675
|
+
return false;
|
|
1676
|
+
return true;
|
|
1677
|
+
}
|
|
1678
|
+
function check85(value, depth = 0) {
|
|
1679
|
+
if (depth >= 128)
|
|
1680
|
+
return false;
|
|
1681
|
+
if (typeof value !== 'number' || !Number.isSafeInteger(value))
|
|
1682
|
+
return false;
|
|
1683
|
+
if (value < 1)
|
|
1684
|
+
return false;
|
|
1685
|
+
if (value > 100)
|
|
1686
|
+
return false;
|
|
1687
|
+
return true;
|
|
1688
|
+
}
|
|
1689
|
+
function check86(value, depth = 0) {
|
|
1690
|
+
if (depth >= 128)
|
|
1691
|
+
return false;
|
|
1692
|
+
if (!Array.isArray(value))
|
|
1693
|
+
return false;
|
|
1694
|
+
if (value.length < 0)
|
|
1695
|
+
return false;
|
|
1696
|
+
if (value.length > 256)
|
|
1697
|
+
return false;
|
|
1698
|
+
if (!value.every(item => check8(item, depth + 1)))
|
|
1699
|
+
return false;
|
|
1700
|
+
return true;
|
|
1701
|
+
}
|
|
1702
|
+
function check87(value, depth = 0) {
|
|
1703
|
+
if (depth >= 128)
|
|
1704
|
+
return false;
|
|
1705
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
1706
|
+
return false;
|
|
1707
|
+
const object = value;
|
|
1708
|
+
for (const key of Object.keys(object)) {
|
|
1709
|
+
switch (key) {
|
|
1710
|
+
case "id":
|
|
1711
|
+
if (!check88(object[key], depth + 1))
|
|
1712
|
+
return false;
|
|
1713
|
+
break;
|
|
1714
|
+
case "kind":
|
|
1715
|
+
if (!check89(object[key], depth + 1))
|
|
1716
|
+
return false;
|
|
1717
|
+
break;
|
|
1718
|
+
case "valueRef":
|
|
1719
|
+
if (!check46(object[key], depth + 1))
|
|
1720
|
+
return false;
|
|
1721
|
+
break;
|
|
1722
|
+
default: return false;
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
if (!Object.prototype.hasOwnProperty.call(object, "id"))
|
|
1726
|
+
return false;
|
|
1727
|
+
if (!Object.prototype.hasOwnProperty.call(object, "kind"))
|
|
1728
|
+
return false;
|
|
1729
|
+
if (!Object.prototype.hasOwnProperty.call(object, "valueRef"))
|
|
1730
|
+
return false;
|
|
1731
|
+
return true;
|
|
1732
|
+
}
|
|
1733
|
+
function check88(value, depth = 0) {
|
|
1734
|
+
if (depth >= 128)
|
|
1735
|
+
return false;
|
|
1736
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1737
|
+
return false;
|
|
1738
|
+
if ([...value].length < 1)
|
|
1739
|
+
return false;
|
|
1740
|
+
if ([...value].length > 128)
|
|
1741
|
+
return false;
|
|
1742
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
1743
|
+
return false;
|
|
1744
|
+
return true;
|
|
1745
|
+
}
|
|
1746
|
+
function check89(value, depth = 0) {
|
|
1747
|
+
if (depth >= 128)
|
|
1748
|
+
return false;
|
|
1749
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1750
|
+
return false;
|
|
1751
|
+
if (value !== "output")
|
|
1752
|
+
return false;
|
|
1753
|
+
return true;
|
|
1754
|
+
}
|
|
1755
|
+
function check90(value, depth = 0) {
|
|
1756
|
+
if (depth >= 128)
|
|
1757
|
+
return false;
|
|
1758
|
+
if (!Array.isArray(value))
|
|
1759
|
+
return false;
|
|
1760
|
+
if (value.length < 0)
|
|
1761
|
+
return false;
|
|
1762
|
+
if (value.length > 64)
|
|
1763
|
+
return false;
|
|
1764
|
+
if (!value.every(item => check91(item, depth + 1)))
|
|
1765
|
+
return false;
|
|
1766
|
+
return true;
|
|
1767
|
+
}
|
|
1768
|
+
function check91(value, depth = 0) {
|
|
1769
|
+
if (depth >= 128)
|
|
1770
|
+
return false;
|
|
1771
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
1772
|
+
return false;
|
|
1773
|
+
const object = value;
|
|
1774
|
+
for (const key of Object.keys(object)) {
|
|
1775
|
+
switch (key) {
|
|
1776
|
+
case "name":
|
|
1777
|
+
if (!check92(object[key], depth + 1))
|
|
1778
|
+
return false;
|
|
1779
|
+
break;
|
|
1780
|
+
case "schemaId":
|
|
1781
|
+
if (!check93(object[key], depth + 1))
|
|
1782
|
+
return false;
|
|
1783
|
+
break;
|
|
1784
|
+
case "valueRef":
|
|
1785
|
+
if (!check46(object[key], depth + 1))
|
|
1786
|
+
return false;
|
|
1787
|
+
break;
|
|
1788
|
+
default: return false;
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
if (!Object.prototype.hasOwnProperty.call(object, "name"))
|
|
1792
|
+
return false;
|
|
1793
|
+
if (!Object.prototype.hasOwnProperty.call(object, "schemaId"))
|
|
1794
|
+
return false;
|
|
1795
|
+
if (!Object.prototype.hasOwnProperty.call(object, "valueRef"))
|
|
1796
|
+
return false;
|
|
1797
|
+
return true;
|
|
1798
|
+
}
|
|
1799
|
+
function check92(value, depth = 0) {
|
|
1800
|
+
if (depth >= 128)
|
|
1801
|
+
return false;
|
|
1802
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1803
|
+
return false;
|
|
1804
|
+
if ([...value].length < 1)
|
|
1805
|
+
return false;
|
|
1806
|
+
if ([...value].length > 128)
|
|
1807
|
+
return false;
|
|
1808
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
1809
|
+
return false;
|
|
1810
|
+
return true;
|
|
1811
|
+
}
|
|
1812
|
+
function check93(value, depth = 0) {
|
|
1813
|
+
if (depth >= 128)
|
|
1814
|
+
return false;
|
|
1815
|
+
if (typeof value !== 'string' || !validText(value))
|
|
1816
|
+
return false;
|
|
1817
|
+
if ([...value].length < 1)
|
|
1818
|
+
return false;
|
|
1819
|
+
if ([...value].length > 128)
|
|
1820
|
+
return false;
|
|
1821
|
+
if ((new RegExp("^[A-Za-z][A-Za-z0-9._-]*$", 'u')).exec(value)?.[0] !== value)
|
|
1822
|
+
return false;
|
|
1823
|
+
return true;
|
|
1824
|
+
}
|
|
1825
|
+
function check94(value, depth = 0) {
|
|
1826
|
+
if (depth >= 128)
|
|
1827
|
+
return false;
|
|
1828
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
1829
|
+
return false;
|
|
1830
|
+
const object = value;
|
|
1831
|
+
for (const key of Object.keys(object)) {
|
|
1832
|
+
switch (key) {
|
|
1833
|
+
case "maxExpandedSteps":
|
|
1834
|
+
if (!check95(object[key], depth + 1))
|
|
1835
|
+
return false;
|
|
1836
|
+
break;
|
|
1837
|
+
case "maxForEachNesting":
|
|
1838
|
+
if (!check96(object[key], depth + 1))
|
|
1839
|
+
return false;
|
|
1840
|
+
break;
|
|
1841
|
+
case "maxPredicateDepth":
|
|
1842
|
+
if (!check97(object[key], depth + 1))
|
|
1843
|
+
return false;
|
|
1844
|
+
break;
|
|
1845
|
+
case "maxPredicateNodes":
|
|
1846
|
+
if (!check98(object[key], depth + 1))
|
|
1847
|
+
return false;
|
|
1848
|
+
break;
|
|
1849
|
+
default: return false;
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
if (!Object.prototype.hasOwnProperty.call(object, "maxExpandedSteps"))
|
|
1853
|
+
return false;
|
|
1854
|
+
if (!Object.prototype.hasOwnProperty.call(object, "maxForEachNesting"))
|
|
1855
|
+
return false;
|
|
1856
|
+
if (!Object.prototype.hasOwnProperty.call(object, "maxPredicateDepth"))
|
|
1857
|
+
return false;
|
|
1858
|
+
if (!Object.prototype.hasOwnProperty.call(object, "maxPredicateNodes"))
|
|
1859
|
+
return false;
|
|
1860
|
+
return true;
|
|
1861
|
+
}
|
|
1862
|
+
function check95(value, depth = 0) {
|
|
1863
|
+
if (depth >= 128)
|
|
1864
|
+
return false;
|
|
1865
|
+
if (typeof value !== 'number' || !Number.isSafeInteger(value))
|
|
1866
|
+
return false;
|
|
1867
|
+
if (value < 1)
|
|
1868
|
+
return false;
|
|
1869
|
+
if (value > 256)
|
|
1870
|
+
return false;
|
|
1871
|
+
return true;
|
|
1872
|
+
}
|
|
1873
|
+
function check96(value, depth = 0) {
|
|
1874
|
+
if (depth >= 128)
|
|
1875
|
+
return false;
|
|
1876
|
+
if (typeof value !== 'number' || !Number.isSafeInteger(value))
|
|
1877
|
+
return false;
|
|
1878
|
+
if (value < 0)
|
|
1879
|
+
return false;
|
|
1880
|
+
if (value > 2)
|
|
1881
|
+
return false;
|
|
1882
|
+
return true;
|
|
1883
|
+
}
|
|
1884
|
+
function check97(value, depth = 0) {
|
|
1885
|
+
if (depth >= 128)
|
|
1886
|
+
return false;
|
|
1887
|
+
if (typeof value !== 'number' || !Number.isSafeInteger(value))
|
|
1888
|
+
return false;
|
|
1889
|
+
if (value < 1)
|
|
1890
|
+
return false;
|
|
1891
|
+
if (value > 8)
|
|
1892
|
+
return false;
|
|
1893
|
+
return true;
|
|
1894
|
+
}
|
|
1895
|
+
function check98(value, depth = 0) {
|
|
1896
|
+
if (depth >= 128)
|
|
1897
|
+
return false;
|
|
1898
|
+
if (typeof value !== 'number' || !Number.isSafeInteger(value))
|
|
1899
|
+
return false;
|
|
1900
|
+
if (value < 1)
|
|
1901
|
+
return false;
|
|
1902
|
+
if (value > 128)
|
|
1903
|
+
return false;
|
|
1904
|
+
return true;
|
|
1905
|
+
}
|
|
1906
|
+
/** Strict UTF-8 JSON: no BOM, comments, trailing commas or duplicate properties; depth <= 32; integer lexemes only. */
|
|
1907
|
+
function strictJson(input, maxBytes) {
|
|
1908
|
+
let text;
|
|
1909
|
+
if (typeof input === "string") {
|
|
1910
|
+
if (!validText(input))
|
|
1911
|
+
return { ok: false, failure: "malformed" };
|
|
1912
|
+
if (new TextEncoder().encode(input).byteLength > maxBytes)
|
|
1913
|
+
return { ok: false, failure: "tooLarge" };
|
|
1914
|
+
text = input;
|
|
1915
|
+
}
|
|
1916
|
+
else {
|
|
1917
|
+
if (input.byteLength > maxBytes)
|
|
1918
|
+
return { ok: false, failure: "tooLarge" };
|
|
1919
|
+
try {
|
|
1920
|
+
text = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(input);
|
|
1921
|
+
}
|
|
1922
|
+
catch {
|
|
1923
|
+
return { ok: false, failure: "malformed" };
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1926
|
+
try {
|
|
1927
|
+
return { ok: true, value: new StrictJsonReader(text).document() };
|
|
1928
|
+
}
|
|
1929
|
+
catch {
|
|
1930
|
+
return { ok: false, failure: "malformed" };
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
class StrictJsonReader {
|
|
1934
|
+
text;
|
|
1935
|
+
index = 0;
|
|
1936
|
+
constructor(text) {
|
|
1937
|
+
this.text = text;
|
|
1938
|
+
}
|
|
1939
|
+
document() {
|
|
1940
|
+
this.space();
|
|
1941
|
+
const value = this.value(0);
|
|
1942
|
+
this.space();
|
|
1943
|
+
if (this.index !== this.text.length)
|
|
1944
|
+
throw new SyntaxError("Trailing JSON content");
|
|
1945
|
+
return value;
|
|
1946
|
+
}
|
|
1947
|
+
value(depth) {
|
|
1948
|
+
switch (this.text[this.index]) {
|
|
1949
|
+
case "{": return this.object(depth + 1);
|
|
1950
|
+
case "[": return this.array(depth + 1);
|
|
1951
|
+
case '"': return this.string();
|
|
1952
|
+
case "t": return this.literal("true", true);
|
|
1953
|
+
case "f": return this.literal("false", false);
|
|
1954
|
+
case "n": return this.literal("null", null);
|
|
1955
|
+
default: return this.number();
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
object(depth) {
|
|
1959
|
+
if (depth > 32)
|
|
1960
|
+
throw new SyntaxError("JSON depth exceeded");
|
|
1961
|
+
this.index++;
|
|
1962
|
+
const out = {};
|
|
1963
|
+
const keys = new Set();
|
|
1964
|
+
this.space();
|
|
1965
|
+
if (this.text[this.index] === "}") {
|
|
1966
|
+
this.index++;
|
|
1967
|
+
return out;
|
|
1968
|
+
}
|
|
1969
|
+
for (;;) {
|
|
1970
|
+
this.space();
|
|
1971
|
+
if (this.text[this.index] !== '"')
|
|
1972
|
+
throw new SyntaxError("Expected property name");
|
|
1973
|
+
const key = this.string();
|
|
1974
|
+
if (keys.has(key))
|
|
1975
|
+
throw new SyntaxError("Duplicate JSON property");
|
|
1976
|
+
keys.add(key);
|
|
1977
|
+
this.space();
|
|
1978
|
+
if (this.text[this.index++] !== ":")
|
|
1979
|
+
throw new SyntaxError("Expected colon");
|
|
1980
|
+
this.space();
|
|
1981
|
+
// defineProperty keeps names such as __proto__ as ordinary own properties.
|
|
1982
|
+
Object.defineProperty(out, key, { value: this.value(depth), enumerable: true, writable: true, configurable: true });
|
|
1983
|
+
this.space();
|
|
1984
|
+
const next = this.text[this.index++];
|
|
1985
|
+
if (next === "}")
|
|
1986
|
+
return out;
|
|
1987
|
+
if (next !== ",")
|
|
1988
|
+
throw new SyntaxError("Expected comma");
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
array(depth) {
|
|
1992
|
+
if (depth > 32)
|
|
1993
|
+
throw new SyntaxError("JSON depth exceeded");
|
|
1994
|
+
this.index++;
|
|
1995
|
+
const out = [];
|
|
1996
|
+
this.space();
|
|
1997
|
+
if (this.text[this.index] === "]") {
|
|
1998
|
+
this.index++;
|
|
1999
|
+
return out;
|
|
2000
|
+
}
|
|
2001
|
+
for (;;) {
|
|
2002
|
+
this.space();
|
|
2003
|
+
out.push(this.value(depth));
|
|
2004
|
+
this.space();
|
|
2005
|
+
const next = this.text[this.index++];
|
|
2006
|
+
if (next === "]")
|
|
2007
|
+
return out;
|
|
2008
|
+
if (next !== ",")
|
|
2009
|
+
throw new SyntaxError("Expected comma");
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
string() {
|
|
2013
|
+
this.index++;
|
|
2014
|
+
let out = "";
|
|
2015
|
+
for (;;) {
|
|
2016
|
+
const c = this.text[this.index++];
|
|
2017
|
+
if (c === undefined)
|
|
2018
|
+
throw new SyntaxError("Unterminated string");
|
|
2019
|
+
if (c === '"')
|
|
2020
|
+
break;
|
|
2021
|
+
if (c < " ")
|
|
2022
|
+
throw new SyntaxError("Unescaped control character");
|
|
2023
|
+
if (c !== "\\") {
|
|
2024
|
+
out += c;
|
|
2025
|
+
continue;
|
|
2026
|
+
}
|
|
2027
|
+
const e = this.text[this.index++];
|
|
2028
|
+
const simple = { '"': '"', "\\": "\\", "/": "/", b: "\b", f: "\f", n: "\n", r: "\r", t: "\t" };
|
|
2029
|
+
if (e !== undefined && e in simple) {
|
|
2030
|
+
out += simple[e];
|
|
2031
|
+
continue;
|
|
2032
|
+
}
|
|
2033
|
+
if (e !== "u" || !/^[0-9a-fA-F]{4}$/.test(this.text.slice(this.index, this.index + 4)))
|
|
2034
|
+
throw new SyntaxError("Invalid escape");
|
|
2035
|
+
out += String.fromCharCode(parseInt(this.text.slice(this.index, this.index + 4), 16));
|
|
2036
|
+
this.index += 4;
|
|
2037
|
+
}
|
|
2038
|
+
if (!validText(out))
|
|
2039
|
+
throw new SyntaxError("Lone surrogate escape");
|
|
2040
|
+
return out;
|
|
2041
|
+
}
|
|
2042
|
+
number() {
|
|
2043
|
+
const match = /-?(?:0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/y;
|
|
2044
|
+
match.lastIndex = this.index;
|
|
2045
|
+
const found = match.exec(this.text);
|
|
2046
|
+
if (found === null)
|
|
2047
|
+
throw new SyntaxError("Invalid JSON value");
|
|
2048
|
+
this.index = match.lastIndex;
|
|
2049
|
+
// Selected schemas have no fractional numbers; fraction/exponent lexemes never satisfy an integer.
|
|
2050
|
+
return found[1] !== undefined || found[2] !== undefined ? Number.NaN : Number(found[0]);
|
|
2051
|
+
}
|
|
2052
|
+
literal(word, value) {
|
|
2053
|
+
if (this.text.slice(this.index, this.index + word.length) !== word)
|
|
2054
|
+
throw new SyntaxError("Invalid JSON literal");
|
|
2055
|
+
this.index += word.length;
|
|
2056
|
+
return value;
|
|
2057
|
+
}
|
|
2058
|
+
space() {
|
|
2059
|
+
while (this.text[this.index] === " " || this.text[this.index] === "\t" || this.text[this.index] === "\n" || this.text[this.index] === "\r")
|
|
2060
|
+
this.index++;
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
function validText(value) {
|
|
2064
|
+
for (const scalar of value) {
|
|
2065
|
+
const point = scalar.codePointAt(0);
|
|
2066
|
+
if (point >= 0xd800 && point <= 0xdfff)
|
|
2067
|
+
return false;
|
|
2068
|
+
}
|
|
2069
|
+
return true;
|
|
2070
|
+
}
|
|
2071
|
+
function inventoryRules(value) {
|
|
2072
|
+
const files = value.files;
|
|
2073
|
+
const seen = new Set();
|
|
2074
|
+
let previous;
|
|
2075
|
+
let total = 0n;
|
|
2076
|
+
for (const file of files) {
|
|
2077
|
+
const path = file.path;
|
|
2078
|
+
const folded = path.toUpperCase();
|
|
2079
|
+
if (path.length === 0 || folded === 'INVENTORY.JSON' || folded === 'SIGNATURE.JSON' || seen.has(folded) || (previous !== undefined && previous >= path))
|
|
2080
|
+
return false;
|
|
2081
|
+
for (const segment of path.split('/')) {
|
|
2082
|
+
if (!/^[A-Za-z0-9_.-]+$/.test(segment) || segment === '.' || segment === '..' || segment.endsWith('.') || /^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(?:\.|$)/i.test(segment))
|
|
2083
|
+
return false;
|
|
2084
|
+
}
|
|
2085
|
+
const size = BigInt(file.size);
|
|
2086
|
+
if (size > 134217728n)
|
|
2087
|
+
return false;
|
|
2088
|
+
total += size;
|
|
2089
|
+
if (total > 1073741824n)
|
|
2090
|
+
return false;
|
|
2091
|
+
seen.add(folded);
|
|
2092
|
+
previous = path;
|
|
2093
|
+
}
|
|
2094
|
+
return files.some(file => file.path === 'manifest.json');
|
|
2095
|
+
}
|
|
2096
|
+
function canonicalDecimal(value) {
|
|
2097
|
+
if (/^-?(0|[1-9][0-9]*)(\.[0-9]{1,9})?$/u.exec(value)?.[0] !== value || value === '-0' || (value.includes('.') && value.endsWith('0')))
|
|
2098
|
+
return false;
|
|
2099
|
+
return value.replace('-', '').replace('.', '').replace(/^0+/u, '').length <= 28;
|
|
2100
|
+
}
|
|
2101
|
+
function workflowGraph(value) {
|
|
2102
|
+
const root = value;
|
|
2103
|
+
const obj = (x) => x;
|
|
2104
|
+
const list = (x) => x;
|
|
2105
|
+
const names = (xs, key) => xs.map(x => obj(x)[key]);
|
|
2106
|
+
const unique = (xs) => new Set(xs).size === xs.length;
|
|
2107
|
+
const inputs = names(list(root.inputs), 'name');
|
|
2108
|
+
if (!unique(inputs) || !unique(names(list(root.outputs), 'name')))
|
|
2109
|
+
return false;
|
|
2110
|
+
const nodes = new Map();
|
|
2111
|
+
const scopes = new Map();
|
|
2112
|
+
const edges = new Map();
|
|
2113
|
+
const limits = obj(root.limits);
|
|
2114
|
+
let expanded = 0;
|
|
2115
|
+
function collect(items, ancestors, depth, weight) {
|
|
2116
|
+
const local = names(items, 'id');
|
|
2117
|
+
const scope = new Set([...ancestors, ...local]);
|
|
2118
|
+
for (const raw of items) {
|
|
2119
|
+
const n = obj(raw), id = n.id;
|
|
2120
|
+
if (nodes.has(id))
|
|
2121
|
+
return false;
|
|
2122
|
+
nodes.set(id, n);
|
|
2123
|
+
scopes.set(id, scope);
|
|
2124
|
+
edges.set(id, new Set());
|
|
2125
|
+
expanded += weight;
|
|
2126
|
+
if (expanded > limits.maxExpandedSteps)
|
|
2127
|
+
return false;
|
|
2128
|
+
if (n.kind === 'foreach') {
|
|
2129
|
+
if (depth + 1 > limits.maxForEachNesting)
|
|
2130
|
+
return false;
|
|
2131
|
+
const childAncestors = new Set(scope);
|
|
2132
|
+
childAncestors.delete(id);
|
|
2133
|
+
if (!collect(list(n.body), childAncestors, depth + 1, weight * n.maxItems))
|
|
2134
|
+
return false;
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
return true;
|
|
2138
|
+
}
|
|
2139
|
+
if (!collect(list(root.nodes), new Set(), 0, 1))
|
|
2140
|
+
return false;
|
|
2141
|
+
function reference(raw, consumer, scope) {
|
|
2142
|
+
const r = obj(raw), id = r.nodeId, target = nodes.get(id);
|
|
2143
|
+
if (!target || id === consumer || !scope.has(id))
|
|
2144
|
+
return false;
|
|
2145
|
+
// Constant/output nodes expose one known field. Installed-schema fields are bound by the owner.
|
|
2146
|
+
if ((target.kind === 'constant' || target.kind === 'output') && r.field !== 'value')
|
|
2147
|
+
return false;
|
|
2148
|
+
if (target.kind === 'condition' || target.kind === 'foreach')
|
|
2149
|
+
return false;
|
|
2150
|
+
if (consumer)
|
|
2151
|
+
edges.get(consumer).add(id);
|
|
2152
|
+
return true;
|
|
2153
|
+
}
|
|
2154
|
+
function operand(raw, id) {
|
|
2155
|
+
const o = obj(raw);
|
|
2156
|
+
return o.kind !== 'reference' || reference(o.valueRef, id, scopes.get(id));
|
|
2157
|
+
}
|
|
2158
|
+
function knownKind(raw) {
|
|
2159
|
+
const o = obj(raw);
|
|
2160
|
+
if (o.kind === 'literal')
|
|
2161
|
+
return obj(o.value).kind;
|
|
2162
|
+
const target = nodes.get(obj(o.valueRef).nodeId);
|
|
2163
|
+
return target?.kind === 'constant' ? obj(target.typedValue).kind : undefined;
|
|
2164
|
+
}
|
|
2165
|
+
function predicate(raw, id, depth, count) {
|
|
2166
|
+
const p = obj(raw), op = p.operator;
|
|
2167
|
+
if (depth > limits.maxPredicateDepth || ++count.value > limits.maxPredicateNodes)
|
|
2168
|
+
return false;
|
|
2169
|
+
if (op === 'all' || op === 'any')
|
|
2170
|
+
return list(p.predicates).every(x => predicate(x, id, depth + 1, count));
|
|
2171
|
+
if (op === 'exists')
|
|
2172
|
+
return reference(p.valueRef, id, scopes.get(id));
|
|
2173
|
+
if (!operand(p.left, id) || !operand(p.right, id))
|
|
2174
|
+
return false;
|
|
2175
|
+
const left = knownKind(p.left), right = knownKind(p.right);
|
|
2176
|
+
if (left !== undefined && right !== undefined && left !== right)
|
|
2177
|
+
return false;
|
|
2178
|
+
if (op !== 'eq' && op !== 'ne' && [left, right].some(x => x === 'bool' || x === 'resourceRef'))
|
|
2179
|
+
return false;
|
|
2180
|
+
return true;
|
|
2181
|
+
}
|
|
2182
|
+
function validateBlock(items) {
|
|
2183
|
+
const siblingIds = new Set(names(items, 'id'));
|
|
2184
|
+
for (const raw of items) {
|
|
2185
|
+
const n = obj(raw), id = n.id, scope = scopes.get(id);
|
|
2186
|
+
if (n.kind === 'input' && !inputs.includes(n.name))
|
|
2187
|
+
return false;
|
|
2188
|
+
if (n.kind === 'select' && (!reference(n.source, id, scope) || nodes.get(obj(n.source).nodeId).kind === 'constant'))
|
|
2189
|
+
return false;
|
|
2190
|
+
if (n.kind === 'output' && !reference(n.valueRef, id, scope))
|
|
2191
|
+
return false;
|
|
2192
|
+
if (n.kind === 'capability') {
|
|
2193
|
+
if (!unique(names(list(n.typedArguments), 'name')) || !unique(n.dependencies))
|
|
2194
|
+
return false;
|
|
2195
|
+
for (const dep of n.dependencies) {
|
|
2196
|
+
if (dep === id || !scope.has(dep))
|
|
2197
|
+
return false;
|
|
2198
|
+
edges.get(id).add(dep);
|
|
2199
|
+
}
|
|
2200
|
+
if (!list(n.typedArguments).every(x => operand(obj(x).value, id)))
|
|
2201
|
+
return false;
|
|
2202
|
+
}
|
|
2203
|
+
if (n.kind === 'condition') {
|
|
2204
|
+
if (!predicate(n.predicate, id, 1, { value: 0 }))
|
|
2205
|
+
return false;
|
|
2206
|
+
const branches = [...n.thenNodes, ...n.elseNodes];
|
|
2207
|
+
if (!unique(branches))
|
|
2208
|
+
return false;
|
|
2209
|
+
for (const child of branches) {
|
|
2210
|
+
if (child === id || !siblingIds.has(child))
|
|
2211
|
+
return false;
|
|
2212
|
+
// Branches execute after their condition. Cycles reject future-output predicates
|
|
2213
|
+
// and branches already required by the condition, independent of array order.
|
|
2214
|
+
edges.get(child).add(id);
|
|
2215
|
+
}
|
|
2216
|
+
}
|
|
2217
|
+
if (n.kind === 'foreach') {
|
|
2218
|
+
if (!reference(n.inputArray, id, scope))
|
|
2219
|
+
return false;
|
|
2220
|
+
const source = nodes.get(obj(n.inputArray).nodeId);
|
|
2221
|
+
if (source.kind === 'constant')
|
|
2222
|
+
return false; // All declared constant kinds are scalar.
|
|
2223
|
+
if (!validateBlock(list(n.body)))
|
|
2224
|
+
return false;
|
|
2225
|
+
for (const child of list(n.body))
|
|
2226
|
+
edges.get(id).add(obj(child).id);
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
return true;
|
|
2230
|
+
}
|
|
2231
|
+
if (!validateBlock(list(root.nodes)))
|
|
2232
|
+
return false;
|
|
2233
|
+
const top = new Set(names(list(root.nodes), 'id'));
|
|
2234
|
+
if (!list(root.outputs).every(x => reference(obj(x).valueRef, '', top)))
|
|
2235
|
+
return false;
|
|
2236
|
+
const visiting = new Set(), done = new Set();
|
|
2237
|
+
function acyclic(id) {
|
|
2238
|
+
if (done.has(id))
|
|
2239
|
+
return true;
|
|
2240
|
+
if (visiting.has(id))
|
|
2241
|
+
return false;
|
|
2242
|
+
visiting.add(id);
|
|
2243
|
+
for (const dependency of edges.get(id))
|
|
2244
|
+
if (!acyclic(dependency))
|
|
2245
|
+
return false;
|
|
2246
|
+
visiting.delete(id);
|
|
2247
|
+
done.add(id);
|
|
2248
|
+
return true;
|
|
2249
|
+
}
|
|
2250
|
+
return [...nodes.keys()].every(acyclic);
|
|
2251
|
+
}
|