moeralib 0.15.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.
Files changed (80) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +8 -0
  3. package/lib/naming/index.js +14 -0
  4. package/lib/naming/naming.js +203 -0
  5. package/lib/naming/schemas.mjs +184 -0
  6. package/lib/naming/types.js +2 -0
  7. package/lib/naming/validate.js +9 -0
  8. package/lib/naming/validators.js +2065 -0
  9. package/lib/node/caller.js +267 -0
  10. package/lib/node/cartes.js +55 -0
  11. package/lib/node/index.js +13 -0
  12. package/lib/node/node.js +1405 -0
  13. package/lib/node/schemas.mjs +4582 -0
  14. package/lib/node/types.js +3 -0
  15. package/lib/node/validate.js +9 -0
  16. package/lib/node/validators.js +60225 -0
  17. package/lib/schema.js +20 -0
  18. package/lib/schemas-compile.mjs +42 -0
  19. package/lib/universal-location.js +164 -0
  20. package/lib/util.js +42 -0
  21. package/nodejs-moera-api/nodejs-moera-api +4 -0
  22. package/nodejs-moera-api/nodejsmoeraapi.py +578 -0
  23. package/package.json +65 -0
  24. package/src/naming/index.ts +12 -0
  25. package/src/naming/naming.ts +234 -0
  26. package/src/naming/schemas.mjs +194 -0
  27. package/src/naming/types.ts +39 -0
  28. package/src/naming/validate.ts +6 -0
  29. package/src/naming/validators.d.ts +3 -0
  30. package/src/naming/validators.js +2084 -0
  31. package/src/node/caller.ts +311 -0
  32. package/src/node/cartes.ts +51 -0
  33. package/src/node/index.ts +3 -0
  34. package/src/node/node.ts +1285 -0
  35. package/src/node/schemas.mjs +4715 -0
  36. package/src/node/types.ts +1544 -0
  37. package/src/node/validate.ts +6 -0
  38. package/src/node/validators.d.ts +3 -0
  39. package/src/node/validators.js +60484 -0
  40. package/src/schema.ts +30 -0
  41. package/src/schemas-compile.mjs +51 -0
  42. package/src/universal-location.ts +212 -0
  43. package/src/util.ts +42 -0
  44. package/tsconfig.json +112 -0
  45. package/typings/naming/index.d.ts +2 -0
  46. package/typings/naming/index.d.ts.map +1 -0
  47. package/typings/naming/naming.d.ts +31 -0
  48. package/typings/naming/naming.d.ts.map +1 -0
  49. package/typings/naming/schemas.d.mts +271 -0
  50. package/typings/naming/schemas.d.mts.map +1 -0
  51. package/typings/naming/types.d.ts +35 -0
  52. package/typings/naming/types.d.ts.map +1 -0
  53. package/typings/naming/validate.d.ts +3 -0
  54. package/typings/naming/validate.d.ts.map +1 -0
  55. package/typings/naming/validators.d.ts +73 -0
  56. package/typings/naming/validators.d.ts.map +1 -0
  57. package/typings/node/caller.d.ts +52 -0
  58. package/typings/node/caller.d.ts.map +1 -0
  59. package/typings/node/cartes.d.ts +13 -0
  60. package/typings/node/cartes.d.ts.map +1 -0
  61. package/typings/node/index.d.ts +4 -0
  62. package/typings/node/index.d.ts.map +1 -0
  63. package/typings/node/node.d.ts +176 -0
  64. package/typings/node/node.d.ts.map +1 -0
  65. package/typings/node/schemas.d.mts +6205 -0
  66. package/typings/node/schemas.d.mts.map +1 -0
  67. package/typings/node/types.d.ts +1340 -0
  68. package/typings/node/types.d.ts.map +1 -0
  69. package/typings/node/validate.d.ts +3 -0
  70. package/typings/node/validate.d.ts.map +1 -0
  71. package/typings/node/validators.d.ts +920 -0
  72. package/typings/node/validators.d.ts.map +1 -0
  73. package/typings/schema.d.ts +18 -0
  74. package/typings/schema.d.ts.map +1 -0
  75. package/typings/schemas-compile.d.mts +2 -0
  76. package/typings/schemas-compile.d.mts.map +1 -0
  77. package/typings/universal-location.d.ts +25 -0
  78. package/typings/universal-location.d.ts.map +1 -0
  79. package/typings/util.d.ts +6 -0
  80. package/typings/util.d.ts.map +1 -0
@@ -0,0 +1,2065 @@
1
+ // This file is generated
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.NAMING_API_VALIDATORS = exports.SigningKeyInfoArray = exports.SigningKeyInfo = exports.RegisteredNameInfoArray = exports.RegisteredNameInfo = exports.OperationStatusInfo = exports.OperationStatus = exports.ErrorResult = exports.StringResult = exports.BooleanResult = exports.ObjectResult = void 0;
5
+ exports.ObjectResult = validate11;
6
+ const schema12 = { "type": "object", "properties": { "jsonrpc": { "type": "string" }, "result": { "type": "object", "nullable": true }, "id": { "type": "integer" } }, "additionalProperties": false, "required": ["jsonrpc", "id"] };
7
+ function validate11(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
8
+ let vErrors = null;
9
+ let errors = 0;
10
+ if (errors === 0) {
11
+ if (data && typeof data == "object" && !Array.isArray(data)) {
12
+ let missing0;
13
+ if (((data.jsonrpc === undefined) && (missing0 = "jsonrpc")) || ((data.id === undefined) && (missing0 = "id"))) {
14
+ validate11.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
15
+ return false;
16
+ }
17
+ else {
18
+ const _errs1 = errors;
19
+ for (const key0 in data) {
20
+ if (!(((key0 === "jsonrpc") || (key0 === "result")) || (key0 === "id"))) {
21
+ delete data[key0];
22
+ }
23
+ }
24
+ if (_errs1 === errors) {
25
+ if (data.jsonrpc !== undefined) {
26
+ let data0 = data.jsonrpc;
27
+ const _errs2 = errors;
28
+ if (typeof data0 !== "string") {
29
+ let dataType0 = typeof data0;
30
+ let coerced0 = undefined;
31
+ if (dataType0 == 'object' && Array.isArray(data0) && data0.length == 1) {
32
+ data0 = data0[0];
33
+ dataType0 = typeof data0;
34
+ if (typeof data0 === "string") {
35
+ coerced0 = data0;
36
+ }
37
+ }
38
+ if (!(coerced0 !== undefined)) {
39
+ if (dataType0 == "number" || dataType0 == "boolean") {
40
+ coerced0 = "" + data0;
41
+ }
42
+ else if (data0 === null) {
43
+ coerced0 = "";
44
+ }
45
+ else {
46
+ validate11.errors = [{ instancePath: instancePath + "/jsonrpc", schemaPath: "#/properties/jsonrpc/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
47
+ return false;
48
+ }
49
+ }
50
+ if (coerced0 !== undefined) {
51
+ data0 = coerced0;
52
+ if (data !== undefined) {
53
+ data["jsonrpc"] = coerced0;
54
+ }
55
+ }
56
+ }
57
+ var valid0 = _errs2 === errors;
58
+ }
59
+ else {
60
+ var valid0 = true;
61
+ }
62
+ if (valid0) {
63
+ if (data.result !== undefined) {
64
+ let data1 = data.result;
65
+ const _errs4 = errors;
66
+ if ((!(data1 && typeof data1 == "object" && !Array.isArray(data1))) && (data1 !== null)) {
67
+ let dataType1 = typeof data1;
68
+ let coerced1 = undefined;
69
+ if (dataType1 == 'object' && Array.isArray(data1) && data1.length == 1) {
70
+ data1 = data1[0];
71
+ dataType1 = typeof data1;
72
+ if ((data1 && typeof data1 == "object" && !Array.isArray(data1)) && (data1 === null)) {
73
+ coerced1 = data1;
74
+ }
75
+ }
76
+ if (!(coerced1 !== undefined)) {
77
+ if (data1 === "" || data1 === 0 || data1 === false) {
78
+ coerced1 = null;
79
+ }
80
+ else {
81
+ validate11.errors = [{ instancePath: instancePath + "/result", schemaPath: "#/properties/result/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
82
+ return false;
83
+ }
84
+ }
85
+ if (coerced1 !== undefined) {
86
+ data1 = coerced1;
87
+ if (data !== undefined) {
88
+ data["result"] = coerced1;
89
+ }
90
+ }
91
+ }
92
+ var valid0 = _errs4 === errors;
93
+ }
94
+ else {
95
+ var valid0 = true;
96
+ }
97
+ if (valid0) {
98
+ if (data.id !== undefined) {
99
+ let data2 = data.id;
100
+ const _errs7 = errors;
101
+ if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) {
102
+ let dataType2 = typeof data2;
103
+ let coerced2 = undefined;
104
+ if (dataType2 == 'object' && Array.isArray(data2) && data2.length == 1) {
105
+ data2 = data2[0];
106
+ dataType2 = typeof data2;
107
+ if (((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2))) {
108
+ coerced2 = data2;
109
+ }
110
+ }
111
+ if (!(coerced2 !== undefined)) {
112
+ if (dataType2 === "boolean" || data2 === null
113
+ || (dataType2 === "string" && data2 && data2 == +data2 && !(data2 % 1))) {
114
+ coerced2 = +data2;
115
+ }
116
+ else {
117
+ validate11.errors = [{ instancePath: instancePath + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
118
+ return false;
119
+ }
120
+ }
121
+ if (coerced2 !== undefined) {
122
+ data2 = coerced2;
123
+ if (data !== undefined) {
124
+ data["id"] = coerced2;
125
+ }
126
+ }
127
+ }
128
+ var valid0 = _errs7 === errors;
129
+ }
130
+ else {
131
+ var valid0 = true;
132
+ }
133
+ }
134
+ }
135
+ }
136
+ }
137
+ }
138
+ else {
139
+ validate11.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
140
+ return false;
141
+ }
142
+ }
143
+ validate11.errors = vErrors;
144
+ return errors === 0;
145
+ }
146
+ exports.BooleanResult = validate12;
147
+ const schema13 = { "type": "object", "properties": { "jsonrpc": { "type": "string" }, "result": { "type": "boolean", "nullable": true }, "id": { "type": "integer" } }, "additionalProperties": false, "required": ["jsonrpc", "id"] };
148
+ function validate12(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
149
+ let vErrors = null;
150
+ let errors = 0;
151
+ if (errors === 0) {
152
+ if (data && typeof data == "object" && !Array.isArray(data)) {
153
+ let missing0;
154
+ if (((data.jsonrpc === undefined) && (missing0 = "jsonrpc")) || ((data.id === undefined) && (missing0 = "id"))) {
155
+ validate12.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
156
+ return false;
157
+ }
158
+ else {
159
+ const _errs1 = errors;
160
+ for (const key0 in data) {
161
+ if (!(((key0 === "jsonrpc") || (key0 === "result")) || (key0 === "id"))) {
162
+ delete data[key0];
163
+ }
164
+ }
165
+ if (_errs1 === errors) {
166
+ if (data.jsonrpc !== undefined) {
167
+ let data0 = data.jsonrpc;
168
+ const _errs2 = errors;
169
+ if (typeof data0 !== "string") {
170
+ let dataType0 = typeof data0;
171
+ let coerced0 = undefined;
172
+ if (dataType0 == 'object' && Array.isArray(data0) && data0.length == 1) {
173
+ data0 = data0[0];
174
+ dataType0 = typeof data0;
175
+ if (typeof data0 === "string") {
176
+ coerced0 = data0;
177
+ }
178
+ }
179
+ if (!(coerced0 !== undefined)) {
180
+ if (dataType0 == "number" || dataType0 == "boolean") {
181
+ coerced0 = "" + data0;
182
+ }
183
+ else if (data0 === null) {
184
+ coerced0 = "";
185
+ }
186
+ else {
187
+ validate12.errors = [{ instancePath: instancePath + "/jsonrpc", schemaPath: "#/properties/jsonrpc/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
188
+ return false;
189
+ }
190
+ }
191
+ if (coerced0 !== undefined) {
192
+ data0 = coerced0;
193
+ if (data !== undefined) {
194
+ data["jsonrpc"] = coerced0;
195
+ }
196
+ }
197
+ }
198
+ var valid0 = _errs2 === errors;
199
+ }
200
+ else {
201
+ var valid0 = true;
202
+ }
203
+ if (valid0) {
204
+ if (data.result !== undefined) {
205
+ let data1 = data.result;
206
+ const _errs4 = errors;
207
+ if ((typeof data1 !== "boolean") && (data1 !== null)) {
208
+ let dataType1 = typeof data1;
209
+ let coerced1 = undefined;
210
+ if (dataType1 == 'object' && Array.isArray(data1) && data1.length == 1) {
211
+ data1 = data1[0];
212
+ dataType1 = typeof data1;
213
+ if ((typeof data1 === "boolean") && (data1 === null)) {
214
+ coerced1 = data1;
215
+ }
216
+ }
217
+ if (!(coerced1 !== undefined)) {
218
+ if (data1 === "false" || data1 === 0 || data1 === null) {
219
+ coerced1 = false;
220
+ }
221
+ else if (data1 === "true" || data1 === 1) {
222
+ coerced1 = true;
223
+ }
224
+ else if (data1 === "" || data1 === 0 || data1 === false) {
225
+ coerced1 = null;
226
+ }
227
+ else {
228
+ validate12.errors = [{ instancePath: instancePath + "/result", schemaPath: "#/properties/result/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }];
229
+ return false;
230
+ }
231
+ }
232
+ if (coerced1 !== undefined) {
233
+ data1 = coerced1;
234
+ if (data !== undefined) {
235
+ data["result"] = coerced1;
236
+ }
237
+ }
238
+ }
239
+ var valid0 = _errs4 === errors;
240
+ }
241
+ else {
242
+ var valid0 = true;
243
+ }
244
+ if (valid0) {
245
+ if (data.id !== undefined) {
246
+ let data2 = data.id;
247
+ const _errs7 = errors;
248
+ if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) {
249
+ let dataType2 = typeof data2;
250
+ let coerced2 = undefined;
251
+ if (dataType2 == 'object' && Array.isArray(data2) && data2.length == 1) {
252
+ data2 = data2[0];
253
+ dataType2 = typeof data2;
254
+ if (((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2))) {
255
+ coerced2 = data2;
256
+ }
257
+ }
258
+ if (!(coerced2 !== undefined)) {
259
+ if (dataType2 === "boolean" || data2 === null
260
+ || (dataType2 === "string" && data2 && data2 == +data2 && !(data2 % 1))) {
261
+ coerced2 = +data2;
262
+ }
263
+ else {
264
+ validate12.errors = [{ instancePath: instancePath + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
265
+ return false;
266
+ }
267
+ }
268
+ if (coerced2 !== undefined) {
269
+ data2 = coerced2;
270
+ if (data !== undefined) {
271
+ data["id"] = coerced2;
272
+ }
273
+ }
274
+ }
275
+ var valid0 = _errs7 === errors;
276
+ }
277
+ else {
278
+ var valid0 = true;
279
+ }
280
+ }
281
+ }
282
+ }
283
+ }
284
+ }
285
+ else {
286
+ validate12.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
287
+ return false;
288
+ }
289
+ }
290
+ validate12.errors = vErrors;
291
+ return errors === 0;
292
+ }
293
+ exports.StringResult = validate13;
294
+ const schema14 = { "type": "object", "properties": { "jsonrpc": { "type": "string" }, "result": { "type": "string", "nullable": true }, "id": { "type": "integer" } }, "additionalProperties": false, "required": ["jsonrpc", "id"] };
295
+ function validate13(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
296
+ let vErrors = null;
297
+ let errors = 0;
298
+ if (errors === 0) {
299
+ if (data && typeof data == "object" && !Array.isArray(data)) {
300
+ let missing0;
301
+ if (((data.jsonrpc === undefined) && (missing0 = "jsonrpc")) || ((data.id === undefined) && (missing0 = "id"))) {
302
+ validate13.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
303
+ return false;
304
+ }
305
+ else {
306
+ const _errs1 = errors;
307
+ for (const key0 in data) {
308
+ if (!(((key0 === "jsonrpc") || (key0 === "result")) || (key0 === "id"))) {
309
+ delete data[key0];
310
+ }
311
+ }
312
+ if (_errs1 === errors) {
313
+ if (data.jsonrpc !== undefined) {
314
+ let data0 = data.jsonrpc;
315
+ const _errs2 = errors;
316
+ if (typeof data0 !== "string") {
317
+ let dataType0 = typeof data0;
318
+ let coerced0 = undefined;
319
+ if (dataType0 == 'object' && Array.isArray(data0) && data0.length == 1) {
320
+ data0 = data0[0];
321
+ dataType0 = typeof data0;
322
+ if (typeof data0 === "string") {
323
+ coerced0 = data0;
324
+ }
325
+ }
326
+ if (!(coerced0 !== undefined)) {
327
+ if (dataType0 == "number" || dataType0 == "boolean") {
328
+ coerced0 = "" + data0;
329
+ }
330
+ else if (data0 === null) {
331
+ coerced0 = "";
332
+ }
333
+ else {
334
+ validate13.errors = [{ instancePath: instancePath + "/jsonrpc", schemaPath: "#/properties/jsonrpc/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
335
+ return false;
336
+ }
337
+ }
338
+ if (coerced0 !== undefined) {
339
+ data0 = coerced0;
340
+ if (data !== undefined) {
341
+ data["jsonrpc"] = coerced0;
342
+ }
343
+ }
344
+ }
345
+ var valid0 = _errs2 === errors;
346
+ }
347
+ else {
348
+ var valid0 = true;
349
+ }
350
+ if (valid0) {
351
+ if (data.result !== undefined) {
352
+ let data1 = data.result;
353
+ const _errs4 = errors;
354
+ if ((typeof data1 !== "string") && (data1 !== null)) {
355
+ let dataType1 = typeof data1;
356
+ let coerced1 = undefined;
357
+ if (dataType1 == 'object' && Array.isArray(data1) && data1.length == 1) {
358
+ data1 = data1[0];
359
+ dataType1 = typeof data1;
360
+ if ((typeof data1 === "string") && (data1 === null)) {
361
+ coerced1 = data1;
362
+ }
363
+ }
364
+ if (!(coerced1 !== undefined)) {
365
+ if (dataType1 == "number" || dataType1 == "boolean") {
366
+ coerced1 = "" + data1;
367
+ }
368
+ else if (data1 === null) {
369
+ coerced1 = "";
370
+ }
371
+ else if (data1 === "" || data1 === 0 || data1 === false) {
372
+ coerced1 = null;
373
+ }
374
+ else {
375
+ validate13.errors = [{ instancePath: instancePath + "/result", schemaPath: "#/properties/result/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
376
+ return false;
377
+ }
378
+ }
379
+ if (coerced1 !== undefined) {
380
+ data1 = coerced1;
381
+ if (data !== undefined) {
382
+ data["result"] = coerced1;
383
+ }
384
+ }
385
+ }
386
+ var valid0 = _errs4 === errors;
387
+ }
388
+ else {
389
+ var valid0 = true;
390
+ }
391
+ if (valid0) {
392
+ if (data.id !== undefined) {
393
+ let data2 = data.id;
394
+ const _errs7 = errors;
395
+ if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) {
396
+ let dataType2 = typeof data2;
397
+ let coerced2 = undefined;
398
+ if (dataType2 == 'object' && Array.isArray(data2) && data2.length == 1) {
399
+ data2 = data2[0];
400
+ dataType2 = typeof data2;
401
+ if (((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2))) {
402
+ coerced2 = data2;
403
+ }
404
+ }
405
+ if (!(coerced2 !== undefined)) {
406
+ if (dataType2 === "boolean" || data2 === null
407
+ || (dataType2 === "string" && data2 && data2 == +data2 && !(data2 % 1))) {
408
+ coerced2 = +data2;
409
+ }
410
+ else {
411
+ validate13.errors = [{ instancePath: instancePath + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
412
+ return false;
413
+ }
414
+ }
415
+ if (coerced2 !== undefined) {
416
+ data2 = coerced2;
417
+ if (data !== undefined) {
418
+ data["id"] = coerced2;
419
+ }
420
+ }
421
+ }
422
+ var valid0 = _errs7 === errors;
423
+ }
424
+ else {
425
+ var valid0 = true;
426
+ }
427
+ }
428
+ }
429
+ }
430
+ }
431
+ }
432
+ else {
433
+ validate13.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
434
+ return false;
435
+ }
436
+ }
437
+ validate13.errors = vErrors;
438
+ return errors === 0;
439
+ }
440
+ exports.ErrorResult = validate14;
441
+ const schema15 = { "type": "object", "properties": { "jsonrpc": { "type": "string" }, "error": { "type": "object", "properties": { "code": { "type": "integer" }, "message": { "type": "string" } }, "additionalProperties": false, "required": ["code", "message"] }, "id": { "type": "integer" } }, "additionalProperties": false, "required": ["jsonrpc", "error", "id"] };
442
+ function validate14(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
443
+ let vErrors = null;
444
+ let errors = 0;
445
+ if (errors === 0) {
446
+ if (data && typeof data == "object" && !Array.isArray(data)) {
447
+ let missing0;
448
+ if ((((data.jsonrpc === undefined) && (missing0 = "jsonrpc")) || ((data.error === undefined) && (missing0 = "error"))) || ((data.id === undefined) && (missing0 = "id"))) {
449
+ validate14.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
450
+ return false;
451
+ }
452
+ else {
453
+ const _errs1 = errors;
454
+ for (const key0 in data) {
455
+ if (!(((key0 === "jsonrpc") || (key0 === "error")) || (key0 === "id"))) {
456
+ delete data[key0];
457
+ }
458
+ }
459
+ if (_errs1 === errors) {
460
+ if (data.jsonrpc !== undefined) {
461
+ let data0 = data.jsonrpc;
462
+ const _errs2 = errors;
463
+ if (typeof data0 !== "string") {
464
+ let dataType0 = typeof data0;
465
+ let coerced0 = undefined;
466
+ if (dataType0 == 'object' && Array.isArray(data0) && data0.length == 1) {
467
+ data0 = data0[0];
468
+ dataType0 = typeof data0;
469
+ if (typeof data0 === "string") {
470
+ coerced0 = data0;
471
+ }
472
+ }
473
+ if (!(coerced0 !== undefined)) {
474
+ if (dataType0 == "number" || dataType0 == "boolean") {
475
+ coerced0 = "" + data0;
476
+ }
477
+ else if (data0 === null) {
478
+ coerced0 = "";
479
+ }
480
+ else {
481
+ validate14.errors = [{ instancePath: instancePath + "/jsonrpc", schemaPath: "#/properties/jsonrpc/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
482
+ return false;
483
+ }
484
+ }
485
+ if (coerced0 !== undefined) {
486
+ data0 = coerced0;
487
+ if (data !== undefined) {
488
+ data["jsonrpc"] = coerced0;
489
+ }
490
+ }
491
+ }
492
+ var valid0 = _errs2 === errors;
493
+ }
494
+ else {
495
+ var valid0 = true;
496
+ }
497
+ if (valid0) {
498
+ if (data.error !== undefined) {
499
+ let data1 = data.error;
500
+ const _errs4 = errors;
501
+ if (errors === _errs4) {
502
+ if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
503
+ let missing1;
504
+ if (((data1.code === undefined) && (missing1 = "code")) || ((data1.message === undefined) && (missing1 = "message"))) {
505
+ validate14.errors = [{ instancePath: instancePath + "/error", schemaPath: "#/properties/error/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" }];
506
+ return false;
507
+ }
508
+ else {
509
+ const _errs6 = errors;
510
+ for (const key1 in data1) {
511
+ if (!((key1 === "code") || (key1 === "message"))) {
512
+ delete data1[key1];
513
+ }
514
+ }
515
+ if (_errs6 === errors) {
516
+ if (data1.code !== undefined) {
517
+ let data2 = data1.code;
518
+ const _errs7 = errors;
519
+ if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) {
520
+ let dataType1 = typeof data2;
521
+ let coerced1 = undefined;
522
+ if (dataType1 == 'object' && Array.isArray(data2) && data2.length == 1) {
523
+ data2 = data2[0];
524
+ dataType1 = typeof data2;
525
+ if (((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2))) {
526
+ coerced1 = data2;
527
+ }
528
+ }
529
+ if (!(coerced1 !== undefined)) {
530
+ if (dataType1 === "boolean" || data2 === null
531
+ || (dataType1 === "string" && data2 && data2 == +data2 && !(data2 % 1))) {
532
+ coerced1 = +data2;
533
+ }
534
+ else {
535
+ validate14.errors = [{ instancePath: instancePath + "/error/code", schemaPath: "#/properties/error/properties/code/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
536
+ return false;
537
+ }
538
+ }
539
+ if (coerced1 !== undefined) {
540
+ data2 = coerced1;
541
+ if (data1 !== undefined) {
542
+ data1["code"] = coerced1;
543
+ }
544
+ }
545
+ }
546
+ var valid1 = _errs7 === errors;
547
+ }
548
+ else {
549
+ var valid1 = true;
550
+ }
551
+ if (valid1) {
552
+ if (data1.message !== undefined) {
553
+ let data3 = data1.message;
554
+ const _errs9 = errors;
555
+ if (typeof data3 !== "string") {
556
+ let dataType2 = typeof data3;
557
+ let coerced2 = undefined;
558
+ if (dataType2 == 'object' && Array.isArray(data3) && data3.length == 1) {
559
+ data3 = data3[0];
560
+ dataType2 = typeof data3;
561
+ if (typeof data3 === "string") {
562
+ coerced2 = data3;
563
+ }
564
+ }
565
+ if (!(coerced2 !== undefined)) {
566
+ if (dataType2 == "number" || dataType2 == "boolean") {
567
+ coerced2 = "" + data3;
568
+ }
569
+ else if (data3 === null) {
570
+ coerced2 = "";
571
+ }
572
+ else {
573
+ validate14.errors = [{ instancePath: instancePath + "/error/message", schemaPath: "#/properties/error/properties/message/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
574
+ return false;
575
+ }
576
+ }
577
+ if (coerced2 !== undefined) {
578
+ data3 = coerced2;
579
+ if (data1 !== undefined) {
580
+ data1["message"] = coerced2;
581
+ }
582
+ }
583
+ }
584
+ var valid1 = _errs9 === errors;
585
+ }
586
+ else {
587
+ var valid1 = true;
588
+ }
589
+ }
590
+ }
591
+ }
592
+ }
593
+ else {
594
+ validate14.errors = [{ instancePath: instancePath + "/error", schemaPath: "#/properties/error/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
595
+ return false;
596
+ }
597
+ }
598
+ var valid0 = _errs4 === errors;
599
+ }
600
+ else {
601
+ var valid0 = true;
602
+ }
603
+ if (valid0) {
604
+ if (data.id !== undefined) {
605
+ let data4 = data.id;
606
+ const _errs11 = errors;
607
+ if (!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))) {
608
+ let dataType3 = typeof data4;
609
+ let coerced3 = undefined;
610
+ if (dataType3 == 'object' && Array.isArray(data4) && data4.length == 1) {
611
+ data4 = data4[0];
612
+ dataType3 = typeof data4;
613
+ if (((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4))) {
614
+ coerced3 = data4;
615
+ }
616
+ }
617
+ if (!(coerced3 !== undefined)) {
618
+ if (dataType3 === "boolean" || data4 === null
619
+ || (dataType3 === "string" && data4 && data4 == +data4 && !(data4 % 1))) {
620
+ coerced3 = +data4;
621
+ }
622
+ else {
623
+ validate14.errors = [{ instancePath: instancePath + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
624
+ return false;
625
+ }
626
+ }
627
+ if (coerced3 !== undefined) {
628
+ data4 = coerced3;
629
+ if (data !== undefined) {
630
+ data["id"] = coerced3;
631
+ }
632
+ }
633
+ }
634
+ var valid0 = _errs11 === errors;
635
+ }
636
+ else {
637
+ var valid0 = true;
638
+ }
639
+ }
640
+ }
641
+ }
642
+ }
643
+ }
644
+ else {
645
+ validate14.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
646
+ return false;
647
+ }
648
+ }
649
+ validate14.errors = vErrors;
650
+ return errors === 0;
651
+ }
652
+ exports.OperationStatus = validate15;
653
+ const schema16 = { "type": "string", "enum": ["WAITING", "ADDED", "STARTED", "SUCCEEDED", "FAILED", "UNKNOWN"] };
654
+ function validate15(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
655
+ let vErrors = null;
656
+ let errors = 0;
657
+ if (typeof data !== "string") {
658
+ let dataType0 = typeof data;
659
+ let coerced0 = undefined;
660
+ if (dataType0 == 'object' && Array.isArray(data) && data.length == 1) {
661
+ data = data[0];
662
+ dataType0 = typeof data;
663
+ if (typeof data === "string") {
664
+ coerced0 = data;
665
+ }
666
+ }
667
+ if (!(coerced0 !== undefined)) {
668
+ if (dataType0 == "number" || dataType0 == "boolean") {
669
+ coerced0 = "" + data;
670
+ }
671
+ else if (data === null) {
672
+ coerced0 = "";
673
+ }
674
+ else {
675
+ validate15.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
676
+ return false;
677
+ }
678
+ }
679
+ if (coerced0 !== undefined) {
680
+ data = coerced0;
681
+ if (parentData !== undefined) {
682
+ parentData[parentDataProperty] = coerced0;
683
+ }
684
+ }
685
+ }
686
+ if (!((((((data === "WAITING") || (data === "ADDED")) || (data === "STARTED")) || (data === "SUCCEEDED")) || (data === "FAILED")) || (data === "UNKNOWN"))) {
687
+ validate15.errors = [{ instancePath, schemaPath: "#/enum", keyword: "enum", params: { allowedValues: schema16.enum }, message: "must be equal to one of the allowed values" }];
688
+ return false;
689
+ }
690
+ validate15.errors = vErrors;
691
+ return errors === 0;
692
+ }
693
+ exports.OperationStatusInfo = validate16;
694
+ const schema17 = { "type": "object", "properties": { "operationId": { "type": "string" }, "name": { "type": "string" }, "generation": { "type": "number" }, "status": { "$ref": "naming#/definitions/OperationStatus" }, "added": { "type": "integer", "nullable": true }, "completed": { "type": "integer", "nullable": true }, "errorCode": { "type": "string", "nullable": true }, "errorMessage": { "type": "string", "nullable": true } }, "additionalProperties": false, "required": ["operationId", "name", "generation", "status"] };
695
+ function validate16(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
696
+ let vErrors = null;
697
+ let errors = 0;
698
+ if (errors === 0) {
699
+ if (data && typeof data == "object" && !Array.isArray(data)) {
700
+ let missing0;
701
+ if (((((data.operationId === undefined) && (missing0 = "operationId")) || ((data.name === undefined) && (missing0 = "name"))) || ((data.generation === undefined) && (missing0 = "generation"))) || ((data.status === undefined) && (missing0 = "status"))) {
702
+ validate16.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
703
+ return false;
704
+ }
705
+ else {
706
+ const _errs1 = errors;
707
+ for (const key0 in data) {
708
+ if (!((((((((key0 === "operationId") || (key0 === "name")) || (key0 === "generation")) || (key0 === "status")) || (key0 === "added")) || (key0 === "completed")) || (key0 === "errorCode")) || (key0 === "errorMessage"))) {
709
+ delete data[key0];
710
+ }
711
+ }
712
+ if (_errs1 === errors) {
713
+ if (data.operationId !== undefined) {
714
+ let data0 = data.operationId;
715
+ const _errs2 = errors;
716
+ if (typeof data0 !== "string") {
717
+ let dataType0 = typeof data0;
718
+ let coerced0 = undefined;
719
+ if (dataType0 == 'object' && Array.isArray(data0) && data0.length == 1) {
720
+ data0 = data0[0];
721
+ dataType0 = typeof data0;
722
+ if (typeof data0 === "string") {
723
+ coerced0 = data0;
724
+ }
725
+ }
726
+ if (!(coerced0 !== undefined)) {
727
+ if (dataType0 == "number" || dataType0 == "boolean") {
728
+ coerced0 = "" + data0;
729
+ }
730
+ else if (data0 === null) {
731
+ coerced0 = "";
732
+ }
733
+ else {
734
+ validate16.errors = [{ instancePath: instancePath + "/operationId", schemaPath: "#/properties/operationId/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
735
+ return false;
736
+ }
737
+ }
738
+ if (coerced0 !== undefined) {
739
+ data0 = coerced0;
740
+ if (data !== undefined) {
741
+ data["operationId"] = coerced0;
742
+ }
743
+ }
744
+ }
745
+ var valid0 = _errs2 === errors;
746
+ }
747
+ else {
748
+ var valid0 = true;
749
+ }
750
+ if (valid0) {
751
+ if (data.name !== undefined) {
752
+ let data1 = data.name;
753
+ const _errs4 = errors;
754
+ if (typeof data1 !== "string") {
755
+ let dataType1 = typeof data1;
756
+ let coerced1 = undefined;
757
+ if (dataType1 == 'object' && Array.isArray(data1) && data1.length == 1) {
758
+ data1 = data1[0];
759
+ dataType1 = typeof data1;
760
+ if (typeof data1 === "string") {
761
+ coerced1 = data1;
762
+ }
763
+ }
764
+ if (!(coerced1 !== undefined)) {
765
+ if (dataType1 == "number" || dataType1 == "boolean") {
766
+ coerced1 = "" + data1;
767
+ }
768
+ else if (data1 === null) {
769
+ coerced1 = "";
770
+ }
771
+ else {
772
+ validate16.errors = [{ instancePath: instancePath + "/name", schemaPath: "#/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
773
+ return false;
774
+ }
775
+ }
776
+ if (coerced1 !== undefined) {
777
+ data1 = coerced1;
778
+ if (data !== undefined) {
779
+ data["name"] = coerced1;
780
+ }
781
+ }
782
+ }
783
+ var valid0 = _errs4 === errors;
784
+ }
785
+ else {
786
+ var valid0 = true;
787
+ }
788
+ if (valid0) {
789
+ if (data.generation !== undefined) {
790
+ let data2 = data.generation;
791
+ const _errs6 = errors;
792
+ if (!((typeof data2 == "number") && (isFinite(data2)))) {
793
+ let dataType2 = typeof data2;
794
+ let coerced2 = undefined;
795
+ if (dataType2 == 'object' && Array.isArray(data2) && data2.length == 1) {
796
+ data2 = data2[0];
797
+ dataType2 = typeof data2;
798
+ if ((typeof data2 == "number") && (isFinite(data2))) {
799
+ coerced2 = data2;
800
+ }
801
+ }
802
+ if (!(coerced2 !== undefined)) {
803
+ if (dataType2 == "boolean" || data2 === null
804
+ || (dataType2 == "string" && data2 && data2 == +data2)) {
805
+ coerced2 = +data2;
806
+ }
807
+ else {
808
+ validate16.errors = [{ instancePath: instancePath + "/generation", schemaPath: "#/properties/generation/type", keyword: "type", params: { type: "number" }, message: "must be number" }];
809
+ return false;
810
+ }
811
+ }
812
+ if (coerced2 !== undefined) {
813
+ data2 = coerced2;
814
+ if (data !== undefined) {
815
+ data["generation"] = coerced2;
816
+ }
817
+ }
818
+ }
819
+ var valid0 = _errs6 === errors;
820
+ }
821
+ else {
822
+ var valid0 = true;
823
+ }
824
+ if (valid0) {
825
+ if (data.status !== undefined) {
826
+ let data3 = data.status;
827
+ const _errs8 = errors;
828
+ if (typeof data3 !== "string") {
829
+ let dataType3 = typeof data3;
830
+ let coerced3 = undefined;
831
+ if (dataType3 == 'object' && Array.isArray(data3) && data3.length == 1) {
832
+ data3 = data3[0];
833
+ dataType3 = typeof data3;
834
+ if (typeof data3 === "string") {
835
+ coerced3 = data3;
836
+ }
837
+ }
838
+ if (!(coerced3 !== undefined)) {
839
+ if (dataType3 == "number" || dataType3 == "boolean") {
840
+ coerced3 = "" + data3;
841
+ }
842
+ else if (data3 === null) {
843
+ coerced3 = "";
844
+ }
845
+ else {
846
+ validate16.errors = [{ instancePath: instancePath + "/status", schemaPath: "naming#/definitions/OperationStatus/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
847
+ return false;
848
+ }
849
+ }
850
+ if (coerced3 !== undefined) {
851
+ data3 = coerced3;
852
+ if (data !== undefined) {
853
+ data["status"] = coerced3;
854
+ }
855
+ }
856
+ }
857
+ if (!((((((data3 === "WAITING") || (data3 === "ADDED")) || (data3 === "STARTED")) || (data3 === "SUCCEEDED")) || (data3 === "FAILED")) || (data3 === "UNKNOWN"))) {
858
+ validate16.errors = [{ instancePath: instancePath + "/status", schemaPath: "naming#/definitions/OperationStatus/enum", keyword: "enum", params: { allowedValues: schema16.enum }, message: "must be equal to one of the allowed values" }];
859
+ return false;
860
+ }
861
+ var valid0 = _errs8 === errors;
862
+ }
863
+ else {
864
+ var valid0 = true;
865
+ }
866
+ if (valid0) {
867
+ if (data.added !== undefined) {
868
+ let data4 = data.added;
869
+ const _errs11 = errors;
870
+ if ((!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))) && (data4 !== null)) {
871
+ let dataType4 = typeof data4;
872
+ let coerced4 = undefined;
873
+ if (dataType4 == 'object' && Array.isArray(data4) && data4.length == 1) {
874
+ data4 = data4[0];
875
+ dataType4 = typeof data4;
876
+ if ((((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4))) && (data4 === null)) {
877
+ coerced4 = data4;
878
+ }
879
+ }
880
+ if (!(coerced4 !== undefined)) {
881
+ if (dataType4 === "boolean" || data4 === null
882
+ || (dataType4 === "string" && data4 && data4 == +data4 && !(data4 % 1))) {
883
+ coerced4 = +data4;
884
+ }
885
+ else if (data4 === "" || data4 === 0 || data4 === false) {
886
+ coerced4 = null;
887
+ }
888
+ else {
889
+ validate16.errors = [{ instancePath: instancePath + "/added", schemaPath: "#/properties/added/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
890
+ return false;
891
+ }
892
+ }
893
+ if (coerced4 !== undefined) {
894
+ data4 = coerced4;
895
+ if (data !== undefined) {
896
+ data["added"] = coerced4;
897
+ }
898
+ }
899
+ }
900
+ var valid0 = _errs11 === errors;
901
+ }
902
+ else {
903
+ var valid0 = true;
904
+ }
905
+ if (valid0) {
906
+ if (data.completed !== undefined) {
907
+ let data5 = data.completed;
908
+ const _errs14 = errors;
909
+ if ((!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) && (data5 !== null)) {
910
+ let dataType5 = typeof data5;
911
+ let coerced5 = undefined;
912
+ if (dataType5 == 'object' && Array.isArray(data5) && data5.length == 1) {
913
+ data5 = data5[0];
914
+ dataType5 = typeof data5;
915
+ if ((((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5))) && (data5 === null)) {
916
+ coerced5 = data5;
917
+ }
918
+ }
919
+ if (!(coerced5 !== undefined)) {
920
+ if (dataType5 === "boolean" || data5 === null
921
+ || (dataType5 === "string" && data5 && data5 == +data5 && !(data5 % 1))) {
922
+ coerced5 = +data5;
923
+ }
924
+ else if (data5 === "" || data5 === 0 || data5 === false) {
925
+ coerced5 = null;
926
+ }
927
+ else {
928
+ validate16.errors = [{ instancePath: instancePath + "/completed", schemaPath: "#/properties/completed/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
929
+ return false;
930
+ }
931
+ }
932
+ if (coerced5 !== undefined) {
933
+ data5 = coerced5;
934
+ if (data !== undefined) {
935
+ data["completed"] = coerced5;
936
+ }
937
+ }
938
+ }
939
+ var valid0 = _errs14 === errors;
940
+ }
941
+ else {
942
+ var valid0 = true;
943
+ }
944
+ if (valid0) {
945
+ if (data.errorCode !== undefined) {
946
+ let data6 = data.errorCode;
947
+ const _errs17 = errors;
948
+ if ((typeof data6 !== "string") && (data6 !== null)) {
949
+ let dataType6 = typeof data6;
950
+ let coerced6 = undefined;
951
+ if (dataType6 == 'object' && Array.isArray(data6) && data6.length == 1) {
952
+ data6 = data6[0];
953
+ dataType6 = typeof data6;
954
+ if ((typeof data6 === "string") && (data6 === null)) {
955
+ coerced6 = data6;
956
+ }
957
+ }
958
+ if (!(coerced6 !== undefined)) {
959
+ if (dataType6 == "number" || dataType6 == "boolean") {
960
+ coerced6 = "" + data6;
961
+ }
962
+ else if (data6 === null) {
963
+ coerced6 = "";
964
+ }
965
+ else if (data6 === "" || data6 === 0 || data6 === false) {
966
+ coerced6 = null;
967
+ }
968
+ else {
969
+ validate16.errors = [{ instancePath: instancePath + "/errorCode", schemaPath: "#/properties/errorCode/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
970
+ return false;
971
+ }
972
+ }
973
+ if (coerced6 !== undefined) {
974
+ data6 = coerced6;
975
+ if (data !== undefined) {
976
+ data["errorCode"] = coerced6;
977
+ }
978
+ }
979
+ }
980
+ var valid0 = _errs17 === errors;
981
+ }
982
+ else {
983
+ var valid0 = true;
984
+ }
985
+ if (valid0) {
986
+ if (data.errorMessage !== undefined) {
987
+ let data7 = data.errorMessage;
988
+ const _errs20 = errors;
989
+ if ((typeof data7 !== "string") && (data7 !== null)) {
990
+ let dataType7 = typeof data7;
991
+ let coerced7 = undefined;
992
+ if (dataType7 == 'object' && Array.isArray(data7) && data7.length == 1) {
993
+ data7 = data7[0];
994
+ dataType7 = typeof data7;
995
+ if ((typeof data7 === "string") && (data7 === null)) {
996
+ coerced7 = data7;
997
+ }
998
+ }
999
+ if (!(coerced7 !== undefined)) {
1000
+ if (dataType7 == "number" || dataType7 == "boolean") {
1001
+ coerced7 = "" + data7;
1002
+ }
1003
+ else if (data7 === null) {
1004
+ coerced7 = "";
1005
+ }
1006
+ else if (data7 === "" || data7 === 0 || data7 === false) {
1007
+ coerced7 = null;
1008
+ }
1009
+ else {
1010
+ validate16.errors = [{ instancePath: instancePath + "/errorMessage", schemaPath: "#/properties/errorMessage/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1011
+ return false;
1012
+ }
1013
+ }
1014
+ if (coerced7 !== undefined) {
1015
+ data7 = coerced7;
1016
+ if (data !== undefined) {
1017
+ data["errorMessage"] = coerced7;
1018
+ }
1019
+ }
1020
+ }
1021
+ var valid0 = _errs20 === errors;
1022
+ }
1023
+ else {
1024
+ var valid0 = true;
1025
+ }
1026
+ }
1027
+ }
1028
+ }
1029
+ }
1030
+ }
1031
+ }
1032
+ }
1033
+ }
1034
+ }
1035
+ }
1036
+ else {
1037
+ validate16.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
1038
+ return false;
1039
+ }
1040
+ }
1041
+ validate16.errors = vErrors;
1042
+ return errors === 0;
1043
+ }
1044
+ exports.RegisteredNameInfo = validate17;
1045
+ const schema19 = { "type": "object", "properties": { "name": { "type": "string" }, "generation": { "type": "integer", "minimum": 0 }, "updatingKey": { "type": "string", "nullable": true }, "nodeUri": { "type": "string" }, "created": { "type": "integer", "nullable": true }, "signingKey": { "type": "string", "nullable": true }, "validFrom": { "type": "integer", "nullable": true }, "digest": { "type": "string", "nullable": true } }, "additionalProperties": false, "required": ["name", "generation", "nodeUri"] };
1046
+ function validate17(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
1047
+ let vErrors = null;
1048
+ let errors = 0;
1049
+ if (errors === 0) {
1050
+ if (data && typeof data == "object" && !Array.isArray(data)) {
1051
+ let missing0;
1052
+ if ((((data.name === undefined) && (missing0 = "name")) || ((data.generation === undefined) && (missing0 = "generation"))) || ((data.nodeUri === undefined) && (missing0 = "nodeUri"))) {
1053
+ validate17.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
1054
+ return false;
1055
+ }
1056
+ else {
1057
+ const _errs1 = errors;
1058
+ for (const key0 in data) {
1059
+ if (!((((((((key0 === "name") || (key0 === "generation")) || (key0 === "updatingKey")) || (key0 === "nodeUri")) || (key0 === "created")) || (key0 === "signingKey")) || (key0 === "validFrom")) || (key0 === "digest"))) {
1060
+ delete data[key0];
1061
+ }
1062
+ }
1063
+ if (_errs1 === errors) {
1064
+ if (data.name !== undefined) {
1065
+ let data0 = data.name;
1066
+ const _errs2 = errors;
1067
+ if (typeof data0 !== "string") {
1068
+ let dataType0 = typeof data0;
1069
+ let coerced0 = undefined;
1070
+ if (dataType0 == 'object' && Array.isArray(data0) && data0.length == 1) {
1071
+ data0 = data0[0];
1072
+ dataType0 = typeof data0;
1073
+ if (typeof data0 === "string") {
1074
+ coerced0 = data0;
1075
+ }
1076
+ }
1077
+ if (!(coerced0 !== undefined)) {
1078
+ if (dataType0 == "number" || dataType0 == "boolean") {
1079
+ coerced0 = "" + data0;
1080
+ }
1081
+ else if (data0 === null) {
1082
+ coerced0 = "";
1083
+ }
1084
+ else {
1085
+ validate17.errors = [{ instancePath: instancePath + "/name", schemaPath: "#/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1086
+ return false;
1087
+ }
1088
+ }
1089
+ if (coerced0 !== undefined) {
1090
+ data0 = coerced0;
1091
+ if (data !== undefined) {
1092
+ data["name"] = coerced0;
1093
+ }
1094
+ }
1095
+ }
1096
+ var valid0 = _errs2 === errors;
1097
+ }
1098
+ else {
1099
+ var valid0 = true;
1100
+ }
1101
+ if (valid0) {
1102
+ if (data.generation !== undefined) {
1103
+ let data1 = data.generation;
1104
+ const _errs4 = errors;
1105
+ if (!(((typeof data1 == "number") && (!(data1 % 1) && !isNaN(data1))) && (isFinite(data1)))) {
1106
+ let dataType1 = typeof data1;
1107
+ let coerced1 = undefined;
1108
+ if (dataType1 == 'object' && Array.isArray(data1) && data1.length == 1) {
1109
+ data1 = data1[0];
1110
+ dataType1 = typeof data1;
1111
+ if (((typeof data1 == "number") && (!(data1 % 1) && !isNaN(data1))) && (isFinite(data1))) {
1112
+ coerced1 = data1;
1113
+ }
1114
+ }
1115
+ if (!(coerced1 !== undefined)) {
1116
+ if (dataType1 === "boolean" || data1 === null
1117
+ || (dataType1 === "string" && data1 && data1 == +data1 && !(data1 % 1))) {
1118
+ coerced1 = +data1;
1119
+ }
1120
+ else {
1121
+ validate17.errors = [{ instancePath: instancePath + "/generation", schemaPath: "#/properties/generation/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
1122
+ return false;
1123
+ }
1124
+ }
1125
+ if (coerced1 !== undefined) {
1126
+ data1 = coerced1;
1127
+ if (data !== undefined) {
1128
+ data["generation"] = coerced1;
1129
+ }
1130
+ }
1131
+ }
1132
+ if (errors === _errs4) {
1133
+ if ((typeof data1 == "number") && (isFinite(data1))) {
1134
+ if (data1 < 0 || isNaN(data1)) {
1135
+ validate17.errors = [{ instancePath: instancePath + "/generation", schemaPath: "#/properties/generation/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
1136
+ return false;
1137
+ }
1138
+ }
1139
+ }
1140
+ var valid0 = _errs4 === errors;
1141
+ }
1142
+ else {
1143
+ var valid0 = true;
1144
+ }
1145
+ if (valid0) {
1146
+ if (data.updatingKey !== undefined) {
1147
+ let data2 = data.updatingKey;
1148
+ const _errs6 = errors;
1149
+ if ((typeof data2 !== "string") && (data2 !== null)) {
1150
+ let dataType2 = typeof data2;
1151
+ let coerced2 = undefined;
1152
+ if (dataType2 == 'object' && Array.isArray(data2) && data2.length == 1) {
1153
+ data2 = data2[0];
1154
+ dataType2 = typeof data2;
1155
+ if ((typeof data2 === "string") && (data2 === null)) {
1156
+ coerced2 = data2;
1157
+ }
1158
+ }
1159
+ if (!(coerced2 !== undefined)) {
1160
+ if (dataType2 == "number" || dataType2 == "boolean") {
1161
+ coerced2 = "" + data2;
1162
+ }
1163
+ else if (data2 === null) {
1164
+ coerced2 = "";
1165
+ }
1166
+ else if (data2 === "" || data2 === 0 || data2 === false) {
1167
+ coerced2 = null;
1168
+ }
1169
+ else {
1170
+ validate17.errors = [{ instancePath: instancePath + "/updatingKey", schemaPath: "#/properties/updatingKey/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1171
+ return false;
1172
+ }
1173
+ }
1174
+ if (coerced2 !== undefined) {
1175
+ data2 = coerced2;
1176
+ if (data !== undefined) {
1177
+ data["updatingKey"] = coerced2;
1178
+ }
1179
+ }
1180
+ }
1181
+ var valid0 = _errs6 === errors;
1182
+ }
1183
+ else {
1184
+ var valid0 = true;
1185
+ }
1186
+ if (valid0) {
1187
+ if (data.nodeUri !== undefined) {
1188
+ let data3 = data.nodeUri;
1189
+ const _errs9 = errors;
1190
+ if (typeof data3 !== "string") {
1191
+ let dataType3 = typeof data3;
1192
+ let coerced3 = undefined;
1193
+ if (dataType3 == 'object' && Array.isArray(data3) && data3.length == 1) {
1194
+ data3 = data3[0];
1195
+ dataType3 = typeof data3;
1196
+ if (typeof data3 === "string") {
1197
+ coerced3 = data3;
1198
+ }
1199
+ }
1200
+ if (!(coerced3 !== undefined)) {
1201
+ if (dataType3 == "number" || dataType3 == "boolean") {
1202
+ coerced3 = "" + data3;
1203
+ }
1204
+ else if (data3 === null) {
1205
+ coerced3 = "";
1206
+ }
1207
+ else {
1208
+ validate17.errors = [{ instancePath: instancePath + "/nodeUri", schemaPath: "#/properties/nodeUri/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1209
+ return false;
1210
+ }
1211
+ }
1212
+ if (coerced3 !== undefined) {
1213
+ data3 = coerced3;
1214
+ if (data !== undefined) {
1215
+ data["nodeUri"] = coerced3;
1216
+ }
1217
+ }
1218
+ }
1219
+ var valid0 = _errs9 === errors;
1220
+ }
1221
+ else {
1222
+ var valid0 = true;
1223
+ }
1224
+ if (valid0) {
1225
+ if (data.created !== undefined) {
1226
+ let data4 = data.created;
1227
+ const _errs11 = errors;
1228
+ if ((!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))) && (data4 !== null)) {
1229
+ let dataType4 = typeof data4;
1230
+ let coerced4 = undefined;
1231
+ if (dataType4 == 'object' && Array.isArray(data4) && data4.length == 1) {
1232
+ data4 = data4[0];
1233
+ dataType4 = typeof data4;
1234
+ if ((((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4))) && (data4 === null)) {
1235
+ coerced4 = data4;
1236
+ }
1237
+ }
1238
+ if (!(coerced4 !== undefined)) {
1239
+ if (dataType4 === "boolean" || data4 === null
1240
+ || (dataType4 === "string" && data4 && data4 == +data4 && !(data4 % 1))) {
1241
+ coerced4 = +data4;
1242
+ }
1243
+ else if (data4 === "" || data4 === 0 || data4 === false) {
1244
+ coerced4 = null;
1245
+ }
1246
+ else {
1247
+ validate17.errors = [{ instancePath: instancePath + "/created", schemaPath: "#/properties/created/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
1248
+ return false;
1249
+ }
1250
+ }
1251
+ if (coerced4 !== undefined) {
1252
+ data4 = coerced4;
1253
+ if (data !== undefined) {
1254
+ data["created"] = coerced4;
1255
+ }
1256
+ }
1257
+ }
1258
+ var valid0 = _errs11 === errors;
1259
+ }
1260
+ else {
1261
+ var valid0 = true;
1262
+ }
1263
+ if (valid0) {
1264
+ if (data.signingKey !== undefined) {
1265
+ let data5 = data.signingKey;
1266
+ const _errs14 = errors;
1267
+ if ((typeof data5 !== "string") && (data5 !== null)) {
1268
+ let dataType5 = typeof data5;
1269
+ let coerced5 = undefined;
1270
+ if (dataType5 == 'object' && Array.isArray(data5) && data5.length == 1) {
1271
+ data5 = data5[0];
1272
+ dataType5 = typeof data5;
1273
+ if ((typeof data5 === "string") && (data5 === null)) {
1274
+ coerced5 = data5;
1275
+ }
1276
+ }
1277
+ if (!(coerced5 !== undefined)) {
1278
+ if (dataType5 == "number" || dataType5 == "boolean") {
1279
+ coerced5 = "" + data5;
1280
+ }
1281
+ else if (data5 === null) {
1282
+ coerced5 = "";
1283
+ }
1284
+ else if (data5 === "" || data5 === 0 || data5 === false) {
1285
+ coerced5 = null;
1286
+ }
1287
+ else {
1288
+ validate17.errors = [{ instancePath: instancePath + "/signingKey", schemaPath: "#/properties/signingKey/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1289
+ return false;
1290
+ }
1291
+ }
1292
+ if (coerced5 !== undefined) {
1293
+ data5 = coerced5;
1294
+ if (data !== undefined) {
1295
+ data["signingKey"] = coerced5;
1296
+ }
1297
+ }
1298
+ }
1299
+ var valid0 = _errs14 === errors;
1300
+ }
1301
+ else {
1302
+ var valid0 = true;
1303
+ }
1304
+ if (valid0) {
1305
+ if (data.validFrom !== undefined) {
1306
+ let data6 = data.validFrom;
1307
+ const _errs17 = errors;
1308
+ if ((!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) && (data6 !== null)) {
1309
+ let dataType6 = typeof data6;
1310
+ let coerced6 = undefined;
1311
+ if (dataType6 == 'object' && Array.isArray(data6) && data6.length == 1) {
1312
+ data6 = data6[0];
1313
+ dataType6 = typeof data6;
1314
+ if ((((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6))) && (data6 === null)) {
1315
+ coerced6 = data6;
1316
+ }
1317
+ }
1318
+ if (!(coerced6 !== undefined)) {
1319
+ if (dataType6 === "boolean" || data6 === null
1320
+ || (dataType6 === "string" && data6 && data6 == +data6 && !(data6 % 1))) {
1321
+ coerced6 = +data6;
1322
+ }
1323
+ else if (data6 === "" || data6 === 0 || data6 === false) {
1324
+ coerced6 = null;
1325
+ }
1326
+ else {
1327
+ validate17.errors = [{ instancePath: instancePath + "/validFrom", schemaPath: "#/properties/validFrom/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
1328
+ return false;
1329
+ }
1330
+ }
1331
+ if (coerced6 !== undefined) {
1332
+ data6 = coerced6;
1333
+ if (data !== undefined) {
1334
+ data["validFrom"] = coerced6;
1335
+ }
1336
+ }
1337
+ }
1338
+ var valid0 = _errs17 === errors;
1339
+ }
1340
+ else {
1341
+ var valid0 = true;
1342
+ }
1343
+ if (valid0) {
1344
+ if (data.digest !== undefined) {
1345
+ let data7 = data.digest;
1346
+ const _errs20 = errors;
1347
+ if ((typeof data7 !== "string") && (data7 !== null)) {
1348
+ let dataType7 = typeof data7;
1349
+ let coerced7 = undefined;
1350
+ if (dataType7 == 'object' && Array.isArray(data7) && data7.length == 1) {
1351
+ data7 = data7[0];
1352
+ dataType7 = typeof data7;
1353
+ if ((typeof data7 === "string") && (data7 === null)) {
1354
+ coerced7 = data7;
1355
+ }
1356
+ }
1357
+ if (!(coerced7 !== undefined)) {
1358
+ if (dataType7 == "number" || dataType7 == "boolean") {
1359
+ coerced7 = "" + data7;
1360
+ }
1361
+ else if (data7 === null) {
1362
+ coerced7 = "";
1363
+ }
1364
+ else if (data7 === "" || data7 === 0 || data7 === false) {
1365
+ coerced7 = null;
1366
+ }
1367
+ else {
1368
+ validate17.errors = [{ instancePath: instancePath + "/digest", schemaPath: "#/properties/digest/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1369
+ return false;
1370
+ }
1371
+ }
1372
+ if (coerced7 !== undefined) {
1373
+ data7 = coerced7;
1374
+ if (data !== undefined) {
1375
+ data["digest"] = coerced7;
1376
+ }
1377
+ }
1378
+ }
1379
+ var valid0 = _errs20 === errors;
1380
+ }
1381
+ else {
1382
+ var valid0 = true;
1383
+ }
1384
+ }
1385
+ }
1386
+ }
1387
+ }
1388
+ }
1389
+ }
1390
+ }
1391
+ }
1392
+ }
1393
+ }
1394
+ else {
1395
+ validate17.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
1396
+ return false;
1397
+ }
1398
+ }
1399
+ validate17.errors = vErrors;
1400
+ return errors === 0;
1401
+ }
1402
+ exports.RegisteredNameInfoArray = validate18;
1403
+ const schema20 = { "type": "array", "items": { "$ref": "naming#/definitions/RegisteredNameInfo" } };
1404
+ function validate18(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
1405
+ let vErrors = null;
1406
+ let errors = 0;
1407
+ if (!(Array.isArray(data))) {
1408
+ let dataType0 = typeof data;
1409
+ let coerced0 = undefined;
1410
+ if (dataType0 == 'object' && Array.isArray(data) && data.length == 1) {
1411
+ data = data[0];
1412
+ dataType0 = typeof data;
1413
+ if (Array.isArray(data)) {
1414
+ coerced0 = data;
1415
+ }
1416
+ }
1417
+ if (!(coerced0 !== undefined)) {
1418
+ if (dataType0 === "string" || dataType0 === "number"
1419
+ || dataType0 === "boolean" || data === null) {
1420
+ coerced0 = [data];
1421
+ }
1422
+ else {
1423
+ validate18.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
1424
+ return false;
1425
+ }
1426
+ }
1427
+ if (coerced0 !== undefined) {
1428
+ data = coerced0;
1429
+ if (parentData !== undefined) {
1430
+ parentData[parentDataProperty] = coerced0;
1431
+ }
1432
+ }
1433
+ }
1434
+ if (errors === 0) {
1435
+ if (Array.isArray(data)) {
1436
+ var valid0 = true;
1437
+ const len0 = data.length;
1438
+ for (let i0 = 0; i0 < len0; i0++) {
1439
+ let data0 = data[i0];
1440
+ const _errs1 = errors;
1441
+ const _errs2 = errors;
1442
+ if (errors === _errs2) {
1443
+ if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
1444
+ let missing0;
1445
+ if ((((data0.name === undefined) && (missing0 = "name")) || ((data0.generation === undefined) && (missing0 = "generation"))) || ((data0.nodeUri === undefined) && (missing0 = "nodeUri"))) {
1446
+ validate18.errors = [{ instancePath: instancePath + "/" + i0, schemaPath: "naming#/definitions/RegisteredNameInfo/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
1447
+ return false;
1448
+ }
1449
+ else {
1450
+ const _errs4 = errors;
1451
+ for (const key0 in data0) {
1452
+ if (!((((((((key0 === "name") || (key0 === "generation")) || (key0 === "updatingKey")) || (key0 === "nodeUri")) || (key0 === "created")) || (key0 === "signingKey")) || (key0 === "validFrom")) || (key0 === "digest"))) {
1453
+ delete data0[key0];
1454
+ }
1455
+ }
1456
+ if (_errs4 === errors) {
1457
+ if (data0.name !== undefined) {
1458
+ let data1 = data0.name;
1459
+ const _errs5 = errors;
1460
+ if (typeof data1 !== "string") {
1461
+ let dataType1 = typeof data1;
1462
+ let coerced1 = undefined;
1463
+ if (dataType1 == 'object' && Array.isArray(data1) && data1.length == 1) {
1464
+ data1 = data1[0];
1465
+ dataType1 = typeof data1;
1466
+ if (typeof data1 === "string") {
1467
+ coerced1 = data1;
1468
+ }
1469
+ }
1470
+ if (!(coerced1 !== undefined)) {
1471
+ if (dataType1 == "number" || dataType1 == "boolean") {
1472
+ coerced1 = "" + data1;
1473
+ }
1474
+ else if (data1 === null) {
1475
+ coerced1 = "";
1476
+ }
1477
+ else {
1478
+ validate18.errors = [{ instancePath: instancePath + "/" + i0 + "/name", schemaPath: "naming#/definitions/RegisteredNameInfo/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1479
+ return false;
1480
+ }
1481
+ }
1482
+ if (coerced1 !== undefined) {
1483
+ data1 = coerced1;
1484
+ if (data0 !== undefined) {
1485
+ data0["name"] = coerced1;
1486
+ }
1487
+ }
1488
+ }
1489
+ var valid2 = _errs5 === errors;
1490
+ }
1491
+ else {
1492
+ var valid2 = true;
1493
+ }
1494
+ if (valid2) {
1495
+ if (data0.generation !== undefined) {
1496
+ let data2 = data0.generation;
1497
+ const _errs7 = errors;
1498
+ if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) {
1499
+ let dataType2 = typeof data2;
1500
+ let coerced2 = undefined;
1501
+ if (dataType2 == 'object' && Array.isArray(data2) && data2.length == 1) {
1502
+ data2 = data2[0];
1503
+ dataType2 = typeof data2;
1504
+ if (((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2))) {
1505
+ coerced2 = data2;
1506
+ }
1507
+ }
1508
+ if (!(coerced2 !== undefined)) {
1509
+ if (dataType2 === "boolean" || data2 === null
1510
+ || (dataType2 === "string" && data2 && data2 == +data2 && !(data2 % 1))) {
1511
+ coerced2 = +data2;
1512
+ }
1513
+ else {
1514
+ validate18.errors = [{ instancePath: instancePath + "/" + i0 + "/generation", schemaPath: "naming#/definitions/RegisteredNameInfo/properties/generation/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
1515
+ return false;
1516
+ }
1517
+ }
1518
+ if (coerced2 !== undefined) {
1519
+ data2 = coerced2;
1520
+ if (data0 !== undefined) {
1521
+ data0["generation"] = coerced2;
1522
+ }
1523
+ }
1524
+ }
1525
+ if (errors === _errs7) {
1526
+ if ((typeof data2 == "number") && (isFinite(data2))) {
1527
+ if (data2 < 0 || isNaN(data2)) {
1528
+ validate18.errors = [{ instancePath: instancePath + "/" + i0 + "/generation", schemaPath: "naming#/definitions/RegisteredNameInfo/properties/generation/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
1529
+ return false;
1530
+ }
1531
+ }
1532
+ }
1533
+ var valid2 = _errs7 === errors;
1534
+ }
1535
+ else {
1536
+ var valid2 = true;
1537
+ }
1538
+ if (valid2) {
1539
+ if (data0.updatingKey !== undefined) {
1540
+ let data3 = data0.updatingKey;
1541
+ const _errs9 = errors;
1542
+ if ((typeof data3 !== "string") && (data3 !== null)) {
1543
+ let dataType3 = typeof data3;
1544
+ let coerced3 = undefined;
1545
+ if (dataType3 == 'object' && Array.isArray(data3) && data3.length == 1) {
1546
+ data3 = data3[0];
1547
+ dataType3 = typeof data3;
1548
+ if ((typeof data3 === "string") && (data3 === null)) {
1549
+ coerced3 = data3;
1550
+ }
1551
+ }
1552
+ if (!(coerced3 !== undefined)) {
1553
+ if (dataType3 == "number" || dataType3 == "boolean") {
1554
+ coerced3 = "" + data3;
1555
+ }
1556
+ else if (data3 === null) {
1557
+ coerced3 = "";
1558
+ }
1559
+ else if (data3 === "" || data3 === 0 || data3 === false) {
1560
+ coerced3 = null;
1561
+ }
1562
+ else {
1563
+ validate18.errors = [{ instancePath: instancePath + "/" + i0 + "/updatingKey", schemaPath: "naming#/definitions/RegisteredNameInfo/properties/updatingKey/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1564
+ return false;
1565
+ }
1566
+ }
1567
+ if (coerced3 !== undefined) {
1568
+ data3 = coerced3;
1569
+ if (data0 !== undefined) {
1570
+ data0["updatingKey"] = coerced3;
1571
+ }
1572
+ }
1573
+ }
1574
+ var valid2 = _errs9 === errors;
1575
+ }
1576
+ else {
1577
+ var valid2 = true;
1578
+ }
1579
+ if (valid2) {
1580
+ if (data0.nodeUri !== undefined) {
1581
+ let data4 = data0.nodeUri;
1582
+ const _errs12 = errors;
1583
+ if (typeof data4 !== "string") {
1584
+ let dataType4 = typeof data4;
1585
+ let coerced4 = undefined;
1586
+ if (dataType4 == 'object' && Array.isArray(data4) && data4.length == 1) {
1587
+ data4 = data4[0];
1588
+ dataType4 = typeof data4;
1589
+ if (typeof data4 === "string") {
1590
+ coerced4 = data4;
1591
+ }
1592
+ }
1593
+ if (!(coerced4 !== undefined)) {
1594
+ if (dataType4 == "number" || dataType4 == "boolean") {
1595
+ coerced4 = "" + data4;
1596
+ }
1597
+ else if (data4 === null) {
1598
+ coerced4 = "";
1599
+ }
1600
+ else {
1601
+ validate18.errors = [{ instancePath: instancePath + "/" + i0 + "/nodeUri", schemaPath: "naming#/definitions/RegisteredNameInfo/properties/nodeUri/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1602
+ return false;
1603
+ }
1604
+ }
1605
+ if (coerced4 !== undefined) {
1606
+ data4 = coerced4;
1607
+ if (data0 !== undefined) {
1608
+ data0["nodeUri"] = coerced4;
1609
+ }
1610
+ }
1611
+ }
1612
+ var valid2 = _errs12 === errors;
1613
+ }
1614
+ else {
1615
+ var valid2 = true;
1616
+ }
1617
+ if (valid2) {
1618
+ if (data0.created !== undefined) {
1619
+ let data5 = data0.created;
1620
+ const _errs14 = errors;
1621
+ if ((!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) && (data5 !== null)) {
1622
+ let dataType5 = typeof data5;
1623
+ let coerced5 = undefined;
1624
+ if (dataType5 == 'object' && Array.isArray(data5) && data5.length == 1) {
1625
+ data5 = data5[0];
1626
+ dataType5 = typeof data5;
1627
+ if ((((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5))) && (data5 === null)) {
1628
+ coerced5 = data5;
1629
+ }
1630
+ }
1631
+ if (!(coerced5 !== undefined)) {
1632
+ if (dataType5 === "boolean" || data5 === null
1633
+ || (dataType5 === "string" && data5 && data5 == +data5 && !(data5 % 1))) {
1634
+ coerced5 = +data5;
1635
+ }
1636
+ else if (data5 === "" || data5 === 0 || data5 === false) {
1637
+ coerced5 = null;
1638
+ }
1639
+ else {
1640
+ validate18.errors = [{ instancePath: instancePath + "/" + i0 + "/created", schemaPath: "naming#/definitions/RegisteredNameInfo/properties/created/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
1641
+ return false;
1642
+ }
1643
+ }
1644
+ if (coerced5 !== undefined) {
1645
+ data5 = coerced5;
1646
+ if (data0 !== undefined) {
1647
+ data0["created"] = coerced5;
1648
+ }
1649
+ }
1650
+ }
1651
+ var valid2 = _errs14 === errors;
1652
+ }
1653
+ else {
1654
+ var valid2 = true;
1655
+ }
1656
+ if (valid2) {
1657
+ if (data0.signingKey !== undefined) {
1658
+ let data6 = data0.signingKey;
1659
+ const _errs17 = errors;
1660
+ if ((typeof data6 !== "string") && (data6 !== null)) {
1661
+ let dataType6 = typeof data6;
1662
+ let coerced6 = undefined;
1663
+ if (dataType6 == 'object' && Array.isArray(data6) && data6.length == 1) {
1664
+ data6 = data6[0];
1665
+ dataType6 = typeof data6;
1666
+ if ((typeof data6 === "string") && (data6 === null)) {
1667
+ coerced6 = data6;
1668
+ }
1669
+ }
1670
+ if (!(coerced6 !== undefined)) {
1671
+ if (dataType6 == "number" || dataType6 == "boolean") {
1672
+ coerced6 = "" + data6;
1673
+ }
1674
+ else if (data6 === null) {
1675
+ coerced6 = "";
1676
+ }
1677
+ else if (data6 === "" || data6 === 0 || data6 === false) {
1678
+ coerced6 = null;
1679
+ }
1680
+ else {
1681
+ validate18.errors = [{ instancePath: instancePath + "/" + i0 + "/signingKey", schemaPath: "naming#/definitions/RegisteredNameInfo/properties/signingKey/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1682
+ return false;
1683
+ }
1684
+ }
1685
+ if (coerced6 !== undefined) {
1686
+ data6 = coerced6;
1687
+ if (data0 !== undefined) {
1688
+ data0["signingKey"] = coerced6;
1689
+ }
1690
+ }
1691
+ }
1692
+ var valid2 = _errs17 === errors;
1693
+ }
1694
+ else {
1695
+ var valid2 = true;
1696
+ }
1697
+ if (valid2) {
1698
+ if (data0.validFrom !== undefined) {
1699
+ let data7 = data0.validFrom;
1700
+ const _errs20 = errors;
1701
+ if ((!(((typeof data7 == "number") && (!(data7 % 1) && !isNaN(data7))) && (isFinite(data7)))) && (data7 !== null)) {
1702
+ let dataType7 = typeof data7;
1703
+ let coerced7 = undefined;
1704
+ if (dataType7 == 'object' && Array.isArray(data7) && data7.length == 1) {
1705
+ data7 = data7[0];
1706
+ dataType7 = typeof data7;
1707
+ if ((((typeof data7 == "number") && (!(data7 % 1) && !isNaN(data7))) && (isFinite(data7))) && (data7 === null)) {
1708
+ coerced7 = data7;
1709
+ }
1710
+ }
1711
+ if (!(coerced7 !== undefined)) {
1712
+ if (dataType7 === "boolean" || data7 === null
1713
+ || (dataType7 === "string" && data7 && data7 == +data7 && !(data7 % 1))) {
1714
+ coerced7 = +data7;
1715
+ }
1716
+ else if (data7 === "" || data7 === 0 || data7 === false) {
1717
+ coerced7 = null;
1718
+ }
1719
+ else {
1720
+ validate18.errors = [{ instancePath: instancePath + "/" + i0 + "/validFrom", schemaPath: "naming#/definitions/RegisteredNameInfo/properties/validFrom/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
1721
+ return false;
1722
+ }
1723
+ }
1724
+ if (coerced7 !== undefined) {
1725
+ data7 = coerced7;
1726
+ if (data0 !== undefined) {
1727
+ data0["validFrom"] = coerced7;
1728
+ }
1729
+ }
1730
+ }
1731
+ var valid2 = _errs20 === errors;
1732
+ }
1733
+ else {
1734
+ var valid2 = true;
1735
+ }
1736
+ if (valid2) {
1737
+ if (data0.digest !== undefined) {
1738
+ let data8 = data0.digest;
1739
+ const _errs23 = errors;
1740
+ if ((typeof data8 !== "string") && (data8 !== null)) {
1741
+ let dataType8 = typeof data8;
1742
+ let coerced8 = undefined;
1743
+ if (dataType8 == 'object' && Array.isArray(data8) && data8.length == 1) {
1744
+ data8 = data8[0];
1745
+ dataType8 = typeof data8;
1746
+ if ((typeof data8 === "string") && (data8 === null)) {
1747
+ coerced8 = data8;
1748
+ }
1749
+ }
1750
+ if (!(coerced8 !== undefined)) {
1751
+ if (dataType8 == "number" || dataType8 == "boolean") {
1752
+ coerced8 = "" + data8;
1753
+ }
1754
+ else if (data8 === null) {
1755
+ coerced8 = "";
1756
+ }
1757
+ else if (data8 === "" || data8 === 0 || data8 === false) {
1758
+ coerced8 = null;
1759
+ }
1760
+ else {
1761
+ validate18.errors = [{ instancePath: instancePath + "/" + i0 + "/digest", schemaPath: "naming#/definitions/RegisteredNameInfo/properties/digest/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1762
+ return false;
1763
+ }
1764
+ }
1765
+ if (coerced8 !== undefined) {
1766
+ data8 = coerced8;
1767
+ if (data0 !== undefined) {
1768
+ data0["digest"] = coerced8;
1769
+ }
1770
+ }
1771
+ }
1772
+ var valid2 = _errs23 === errors;
1773
+ }
1774
+ else {
1775
+ var valid2 = true;
1776
+ }
1777
+ }
1778
+ }
1779
+ }
1780
+ }
1781
+ }
1782
+ }
1783
+ }
1784
+ }
1785
+ }
1786
+ }
1787
+ else {
1788
+ validate18.errors = [{ instancePath: instancePath + "/" + i0, schemaPath: "naming#/definitions/RegisteredNameInfo/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
1789
+ return false;
1790
+ }
1791
+ }
1792
+ var valid0 = _errs1 === errors;
1793
+ if (!valid0) {
1794
+ break;
1795
+ }
1796
+ }
1797
+ }
1798
+ }
1799
+ validate18.errors = vErrors;
1800
+ return errors === 0;
1801
+ }
1802
+ exports.SigningKeyInfo = validate19;
1803
+ const schema22 = { "type": "object", "properties": { "key": { "type": "string" }, "validFrom": { "type": "number" } }, "additionalProperties": false, "required": ["key", "validFrom"] };
1804
+ function validate19(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
1805
+ let vErrors = null;
1806
+ let errors = 0;
1807
+ if (errors === 0) {
1808
+ if (data && typeof data == "object" && !Array.isArray(data)) {
1809
+ let missing0;
1810
+ if (((data.key === undefined) && (missing0 = "key")) || ((data.validFrom === undefined) && (missing0 = "validFrom"))) {
1811
+ validate19.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
1812
+ return false;
1813
+ }
1814
+ else {
1815
+ const _errs1 = errors;
1816
+ for (const key0 in data) {
1817
+ if (!((key0 === "key") || (key0 === "validFrom"))) {
1818
+ delete data[key0];
1819
+ }
1820
+ }
1821
+ if (_errs1 === errors) {
1822
+ if (data.key !== undefined) {
1823
+ let data0 = data.key;
1824
+ const _errs2 = errors;
1825
+ if (typeof data0 !== "string") {
1826
+ let dataType0 = typeof data0;
1827
+ let coerced0 = undefined;
1828
+ if (dataType0 == 'object' && Array.isArray(data0) && data0.length == 1) {
1829
+ data0 = data0[0];
1830
+ dataType0 = typeof data0;
1831
+ if (typeof data0 === "string") {
1832
+ coerced0 = data0;
1833
+ }
1834
+ }
1835
+ if (!(coerced0 !== undefined)) {
1836
+ if (dataType0 == "number" || dataType0 == "boolean") {
1837
+ coerced0 = "" + data0;
1838
+ }
1839
+ else if (data0 === null) {
1840
+ coerced0 = "";
1841
+ }
1842
+ else {
1843
+ validate19.errors = [{ instancePath: instancePath + "/key", schemaPath: "#/properties/key/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1844
+ return false;
1845
+ }
1846
+ }
1847
+ if (coerced0 !== undefined) {
1848
+ data0 = coerced0;
1849
+ if (data !== undefined) {
1850
+ data["key"] = coerced0;
1851
+ }
1852
+ }
1853
+ }
1854
+ var valid0 = _errs2 === errors;
1855
+ }
1856
+ else {
1857
+ var valid0 = true;
1858
+ }
1859
+ if (valid0) {
1860
+ if (data.validFrom !== undefined) {
1861
+ let data1 = data.validFrom;
1862
+ const _errs4 = errors;
1863
+ if (!((typeof data1 == "number") && (isFinite(data1)))) {
1864
+ let dataType1 = typeof data1;
1865
+ let coerced1 = undefined;
1866
+ if (dataType1 == 'object' && Array.isArray(data1) && data1.length == 1) {
1867
+ data1 = data1[0];
1868
+ dataType1 = typeof data1;
1869
+ if ((typeof data1 == "number") && (isFinite(data1))) {
1870
+ coerced1 = data1;
1871
+ }
1872
+ }
1873
+ if (!(coerced1 !== undefined)) {
1874
+ if (dataType1 == "boolean" || data1 === null
1875
+ || (dataType1 == "string" && data1 && data1 == +data1)) {
1876
+ coerced1 = +data1;
1877
+ }
1878
+ else {
1879
+ validate19.errors = [{ instancePath: instancePath + "/validFrom", schemaPath: "#/properties/validFrom/type", keyword: "type", params: { type: "number" }, message: "must be number" }];
1880
+ return false;
1881
+ }
1882
+ }
1883
+ if (coerced1 !== undefined) {
1884
+ data1 = coerced1;
1885
+ if (data !== undefined) {
1886
+ data["validFrom"] = coerced1;
1887
+ }
1888
+ }
1889
+ }
1890
+ var valid0 = _errs4 === errors;
1891
+ }
1892
+ else {
1893
+ var valid0 = true;
1894
+ }
1895
+ }
1896
+ }
1897
+ }
1898
+ }
1899
+ else {
1900
+ validate19.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
1901
+ return false;
1902
+ }
1903
+ }
1904
+ validate19.errors = vErrors;
1905
+ return errors === 0;
1906
+ }
1907
+ exports.SigningKeyInfoArray = validate20;
1908
+ const schema23 = { "type": "array", "items": { "$ref": "naming#/definitions/SigningKeyInfo" } };
1909
+ function validate20(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
1910
+ let vErrors = null;
1911
+ let errors = 0;
1912
+ if (!(Array.isArray(data))) {
1913
+ let dataType0 = typeof data;
1914
+ let coerced0 = undefined;
1915
+ if (dataType0 == 'object' && Array.isArray(data) && data.length == 1) {
1916
+ data = data[0];
1917
+ dataType0 = typeof data;
1918
+ if (Array.isArray(data)) {
1919
+ coerced0 = data;
1920
+ }
1921
+ }
1922
+ if (!(coerced0 !== undefined)) {
1923
+ if (dataType0 === "string" || dataType0 === "number"
1924
+ || dataType0 === "boolean" || data === null) {
1925
+ coerced0 = [data];
1926
+ }
1927
+ else {
1928
+ validate20.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
1929
+ return false;
1930
+ }
1931
+ }
1932
+ if (coerced0 !== undefined) {
1933
+ data = coerced0;
1934
+ if (parentData !== undefined) {
1935
+ parentData[parentDataProperty] = coerced0;
1936
+ }
1937
+ }
1938
+ }
1939
+ if (errors === 0) {
1940
+ if (Array.isArray(data)) {
1941
+ var valid0 = true;
1942
+ const len0 = data.length;
1943
+ for (let i0 = 0; i0 < len0; i0++) {
1944
+ let data0 = data[i0];
1945
+ const _errs1 = errors;
1946
+ const _errs2 = errors;
1947
+ if (errors === _errs2) {
1948
+ if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
1949
+ let missing0;
1950
+ if (((data0.key === undefined) && (missing0 = "key")) || ((data0.validFrom === undefined) && (missing0 = "validFrom"))) {
1951
+ validate20.errors = [{ instancePath: instancePath + "/" + i0, schemaPath: "naming#/definitions/SigningKeyInfo/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
1952
+ return false;
1953
+ }
1954
+ else {
1955
+ const _errs4 = errors;
1956
+ for (const key0 in data0) {
1957
+ if (!((key0 === "key") || (key0 === "validFrom"))) {
1958
+ delete data0[key0];
1959
+ }
1960
+ }
1961
+ if (_errs4 === errors) {
1962
+ if (data0.key !== undefined) {
1963
+ let data1 = data0.key;
1964
+ const _errs5 = errors;
1965
+ if (typeof data1 !== "string") {
1966
+ let dataType1 = typeof data1;
1967
+ let coerced1 = undefined;
1968
+ if (dataType1 == 'object' && Array.isArray(data1) && data1.length == 1) {
1969
+ data1 = data1[0];
1970
+ dataType1 = typeof data1;
1971
+ if (typeof data1 === "string") {
1972
+ coerced1 = data1;
1973
+ }
1974
+ }
1975
+ if (!(coerced1 !== undefined)) {
1976
+ if (dataType1 == "number" || dataType1 == "boolean") {
1977
+ coerced1 = "" + data1;
1978
+ }
1979
+ else if (data1 === null) {
1980
+ coerced1 = "";
1981
+ }
1982
+ else {
1983
+ validate20.errors = [{ instancePath: instancePath + "/" + i0 + "/key", schemaPath: "naming#/definitions/SigningKeyInfo/properties/key/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1984
+ return false;
1985
+ }
1986
+ }
1987
+ if (coerced1 !== undefined) {
1988
+ data1 = coerced1;
1989
+ if (data0 !== undefined) {
1990
+ data0["key"] = coerced1;
1991
+ }
1992
+ }
1993
+ }
1994
+ var valid2 = _errs5 === errors;
1995
+ }
1996
+ else {
1997
+ var valid2 = true;
1998
+ }
1999
+ if (valid2) {
2000
+ if (data0.validFrom !== undefined) {
2001
+ let data2 = data0.validFrom;
2002
+ const _errs7 = errors;
2003
+ if (!((typeof data2 == "number") && (isFinite(data2)))) {
2004
+ let dataType2 = typeof data2;
2005
+ let coerced2 = undefined;
2006
+ if (dataType2 == 'object' && Array.isArray(data2) && data2.length == 1) {
2007
+ data2 = data2[0];
2008
+ dataType2 = typeof data2;
2009
+ if ((typeof data2 == "number") && (isFinite(data2))) {
2010
+ coerced2 = data2;
2011
+ }
2012
+ }
2013
+ if (!(coerced2 !== undefined)) {
2014
+ if (dataType2 == "boolean" || data2 === null
2015
+ || (dataType2 == "string" && data2 && data2 == +data2)) {
2016
+ coerced2 = +data2;
2017
+ }
2018
+ else {
2019
+ validate20.errors = [{ instancePath: instancePath + "/" + i0 + "/validFrom", schemaPath: "naming#/definitions/SigningKeyInfo/properties/validFrom/type", keyword: "type", params: { type: "number" }, message: "must be number" }];
2020
+ return false;
2021
+ }
2022
+ }
2023
+ if (coerced2 !== undefined) {
2024
+ data2 = coerced2;
2025
+ if (data0 !== undefined) {
2026
+ data0["validFrom"] = coerced2;
2027
+ }
2028
+ }
2029
+ }
2030
+ var valid2 = _errs7 === errors;
2031
+ }
2032
+ else {
2033
+ var valid2 = true;
2034
+ }
2035
+ }
2036
+ }
2037
+ }
2038
+ }
2039
+ else {
2040
+ validate20.errors = [{ instancePath: instancePath + "/" + i0, schemaPath: "naming#/definitions/SigningKeyInfo/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
2041
+ return false;
2042
+ }
2043
+ }
2044
+ var valid0 = _errs1 === errors;
2045
+ if (!valid0) {
2046
+ break;
2047
+ }
2048
+ }
2049
+ }
2050
+ }
2051
+ validate20.errors = vErrors;
2052
+ return errors === 0;
2053
+ }
2054
+ exports.NAMING_API_VALIDATORS = {
2055
+ "ObjectResult": exports.ObjectResult,
2056
+ "BooleanResult": exports.BooleanResult,
2057
+ "StringResult": exports.StringResult,
2058
+ "ErrorResult": exports.ErrorResult,
2059
+ "OperationStatus": exports.OperationStatus,
2060
+ "OperationStatusInfo": exports.OperationStatusInfo,
2061
+ "RegisteredNameInfo": exports.RegisteredNameInfo,
2062
+ "RegisteredNameInfoArray": exports.RegisteredNameInfoArray,
2063
+ "SigningKeyInfo": exports.SigningKeyInfo,
2064
+ "SigningKeyInfoArray": exports.SigningKeyInfoArray,
2065
+ };