@sentio/sdk-bundle 4.0.1-rc.2 → 4.0.1-rc.4

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 (64) hide show
  1. package/assets/chainlink-oracles-sepolia.json +21 -0
  2. package/assets/chainlink-oracles.json +219 -0
  3. package/dist/{0x1-B_N1Dd6d.js → 0x1-CWhLCIJf.js} +30 -22
  4. package/dist/0x1-CWhLCIJf.js.map +1 -0
  5. package/dist/{AbstractKeylessAccount-dvYSW9Go.js → AbstractKeylessAccount-DE1e2Glg.js} +3 -2
  6. package/dist/{AbstractKeylessAccount-dvYSW9Go.js.map → AbstractKeylessAccount-DE1e2Glg.js.map} +1 -1
  7. package/dist/_md-CZAi2AzY.js +644 -0
  8. package/dist/_md-CZAi2AzY.js.map +1 -0
  9. package/dist/aptos/builtin/0x1.js +2 -2
  10. package/dist/aptos/builtin/0x3.js +3 -3
  11. package/dist/aptos/builtin/0x3.js.map +1 -1
  12. package/dist/aptos/builtin/0x4.js +3 -3
  13. package/dist/aptos/builtin/0x4.js.map +1 -1
  14. package/dist/aptos/builtin/index.js +1 -1
  15. package/dist/aptos/ext/index.js +2 -2
  16. package/dist/aptos/index.js +2 -2
  17. package/dist/{aptos-DPeebJ9j.js → aptos-Cgfa8IQj.js} +257 -47
  18. package/dist/{aptos-DPeebJ9j.js.map → aptos-Cgfa8IQj.js.map} +1 -1
  19. package/dist/{coin-DREiK-Br.js → coin-CBrx3CpG.js} +1514 -105
  20. package/dist/coin-CBrx3CpG.js.map +1 -0
  21. package/dist/{coin-CWRVUEBa.js → coin-Mht4Jgvj.js} +803 -4
  22. package/dist/coin-Mht4Jgvj.js.map +1 -0
  23. package/dist/eth/builtin/eacaggregatorproxy.js +1 -1
  24. package/dist/eth/builtin/erc1155.js +1 -1
  25. package/dist/eth/builtin/erc20.js +1 -1
  26. package/dist/eth/builtin/erc721.js +1 -1
  27. package/dist/eth/builtin/index.js +1 -1
  28. package/dist/eth/builtin/weth9.js +1 -1
  29. package/dist/eth/index.js +1 -1
  30. package/dist/iota/builtin/0x1.js +3 -3
  31. package/dist/iota/builtin/0x2.js +168 -5
  32. package/dist/iota/builtin/0x2.js.map +1 -1
  33. package/dist/iota/builtin/0x3.js +3 -3
  34. package/dist/iota/ext/index.js +1 -1
  35. package/dist/iota/index.js +3 -3
  36. package/dist/{keyless-B3QnUmtL.js → keyless-nGiRkJjM.js} +1278 -976
  37. package/dist/keyless-nGiRkJjM.js.map +1 -0
  38. package/dist/move/index.js +1 -1
  39. package/dist/{move-Dr-DL5zT.js → move-BVvdKH2Q.js} +7 -7
  40. package/dist/{move-Dr-DL5zT.js.map → move-BVvdKH2Q.js.map} +1 -1
  41. package/dist/sui/builtin/0x1.js +1 -1
  42. package/dist/sui/builtin/0x2.js +4 -4
  43. package/dist/sui/builtin/0x3.js +4 -4
  44. package/dist/sui/builtin/index.js +1 -1
  45. package/dist/sui/ext/index.js +1 -1
  46. package/dist/sui/index.js +3 -3
  47. package/dist/{sui-BbKeYXM3.js → sui-BcHp8IsJ.js} +17 -17
  48. package/dist/{sui-BbKeYXM3.js.map → sui-BcHp8IsJ.js.map} +1 -1
  49. package/dist/testing/index.js +6 -6
  50. package/dist/utils/index.js +1 -1
  51. package/dist/{utils-Jndk-n_F.js → utils-BQ0dnllb.js} +11 -903
  52. package/dist/utils-BQ0dnllb.js.map +1 -0
  53. package/package.json +2 -2
  54. package/assets/chainlink-oracles-sepolia.csv +0 -19
  55. package/assets/chainlink-oracles.csv +0 -217
  56. package/dist/0x1-B_N1Dd6d.js.map +0 -1
  57. package/dist/base-BvfRCgEy.js +0 -959
  58. package/dist/base-BvfRCgEy.js.map +0 -1
  59. package/dist/coin-CWRVUEBa.js.map +0 -1
  60. package/dist/coin-DREiK-Br.js.map +0 -1
  61. package/dist/dist-CA96PSzE.js +0 -824
  62. package/dist/dist-CA96PSzE.js.map +0 -1
  63. package/dist/keyless-B3QnUmtL.js.map +0 -1
  64. package/dist/utils-Jndk-n_F.js.map +0 -1
@@ -1,824 +0,0 @@
1
- import { a as __name } from "./bignumber-DddanwOv.js";
2
-
3
- //#region ../../node_modules/.pnpm/valibot@1.2.0_typescript@6.0.3/node_modules/valibot/dist/index.mjs
4
- let store$4;
5
- /**
6
- * Returns the global configuration.
7
- *
8
- * @param config The config to merge.
9
- *
10
- * @returns The configuration.
11
- */
12
- /* @__NO_SIDE_EFFECTS__ */
13
- function getGlobalConfig(config$1) {
14
- return {
15
- lang: config$1?.lang ?? store$4?.lang,
16
- message: config$1?.message,
17
- abortEarly: config$1?.abortEarly ?? store$4?.abortEarly,
18
- abortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly
19
- };
20
- }
21
- let store$3;
22
- /**
23
- * Returns a global error message.
24
- *
25
- * @param lang The language of the message.
26
- *
27
- * @returns The error message.
28
- */
29
- /* @__NO_SIDE_EFFECTS__ */
30
- function getGlobalMessage(lang) {
31
- return store$3?.get(lang);
32
- }
33
- let store$2;
34
- /**
35
- * Returns a schema error message.
36
- *
37
- * @param lang The language of the message.
38
- *
39
- * @returns The error message.
40
- */
41
- /* @__NO_SIDE_EFFECTS__ */
42
- function getSchemaMessage(lang) {
43
- return store$2?.get(lang);
44
- }
45
- let store$1;
46
- /**
47
- * Returns a specific error message.
48
- *
49
- * @param reference The identifier reference.
50
- * @param lang The language of the message.
51
- *
52
- * @returns The error message.
53
- */
54
- /* @__NO_SIDE_EFFECTS__ */
55
- function getSpecificMessage(reference, lang) {
56
- return store$1?.get(reference)?.get(lang);
57
- }
58
- /**
59
- * Stringifies an unknown input to a literal or type string.
60
- *
61
- * @param input The unknown input.
62
- *
63
- * @returns A literal or type string.
64
- *
65
- * @internal
66
- */
67
- /* @__NO_SIDE_EFFECTS__ */
68
- function _stringify(input) {
69
- const type = typeof input;
70
- if (type === "string") return `"${input}"`;
71
- if (type === "number" || type === "bigint" || type === "boolean") return `${input}`;
72
- if (type === "object" || type === "function") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
73
- return type;
74
- }
75
- /**
76
- * Adds an issue to the dataset.
77
- *
78
- * @param context The issue context.
79
- * @param label The issue label.
80
- * @param dataset The input dataset.
81
- * @param config The configuration.
82
- * @param other The optional props.
83
- *
84
- * @internal
85
- */
86
- function _addIssue(context, label, dataset, config$1, other) {
87
- const input = other && "input" in other ? other.input : dataset.value;
88
- const expected = other?.expected ?? context.expects ?? null;
89
- const received = other?.received ?? /* @__PURE__ */ _stringify(input);
90
- const issue = {
91
- kind: context.kind,
92
- type: context.type,
93
- input,
94
- expected,
95
- received,
96
- message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : "R"}eceived ${received}`,
97
- requirement: context.requirement,
98
- path: other?.path,
99
- issues: other?.issues,
100
- lang: config$1.lang,
101
- abortEarly: config$1.abortEarly,
102
- abortPipeEarly: config$1.abortPipeEarly
103
- };
104
- const isSchema = context.kind === "schema";
105
- const message$1 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config$1.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang);
106
- if (message$1 !== void 0) issue.message = typeof message$1 === "function" ? message$1(issue) : message$1;
107
- if (isSchema) dataset.typed = false;
108
- if (dataset.issues) dataset.issues.push(issue);
109
- else dataset.issues = [issue];
110
- }
111
- /**
112
- * Returns the Standard Schema properties.
113
- *
114
- * @param context The schema context.
115
- *
116
- * @returns The Standard Schema properties.
117
- */
118
- /* @__NO_SIDE_EFFECTS__ */
119
- function _getStandardProps(context) {
120
- return {
121
- version: 1,
122
- vendor: "valibot",
123
- validate(value$1) {
124
- return context["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig());
125
- }
126
- };
127
- }
128
- /**
129
- * Disallows inherited object properties and prevents object prototype
130
- * pollution by disallowing certain keys.
131
- *
132
- * @param object The object to check.
133
- * @param key The key to check.
134
- *
135
- * @returns Whether the key is allowed.
136
- *
137
- * @internal
138
- */
139
- /* @__NO_SIDE_EFFECTS__ */
140
- function _isValidObjectKey(object$1, key) {
141
- return Object.hasOwn(object$1, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor";
142
- }
143
- /**
144
- * Joins multiple `expects` values with the given separator.
145
- *
146
- * @param values The `expects` values.
147
- * @param separator The separator.
148
- *
149
- * @returns The joined `expects` property.
150
- *
151
- * @internal
152
- */
153
- /* @__NO_SIDE_EFFECTS__ */
154
- function _joinExpects(values$1, separator) {
155
- const list = [...new Set(values$1)];
156
- if (list.length > 1) return `(${list.join(` ${separator} `)})`;
157
- return list[0] ?? "never";
158
- }
159
- /**
160
- * A Valibot error with useful information.
161
- */
162
- var ValiError = class extends Error {
163
- /**
164
- * Creates a Valibot error with useful information.
165
- *
166
- * @param issues The error issues.
167
- */
168
- constructor(issues) {
169
- super(issues[0].message);
170
- this.name = "ValiError";
171
- this.issues = issues;
172
- }
173
- };
174
- /* @__NO_SIDE_EFFECTS__ */
175
- function check(requirement, message$1) {
176
- return {
177
- kind: "validation",
178
- type: "check",
179
- reference: check,
180
- async: false,
181
- expects: null,
182
- requirement,
183
- message: message$1,
184
- "~run"(dataset, config$1) {
185
- if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1);
186
- return dataset;
187
- }
188
- };
189
- }
190
- /* @__NO_SIDE_EFFECTS__ */
191
- function integer(message$1) {
192
- return {
193
- kind: "validation",
194
- type: "integer",
195
- reference: integer,
196
- async: false,
197
- expects: null,
198
- requirement: Number.isInteger,
199
- message: message$1,
200
- "~run"(dataset, config$1) {
201
- if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "integer", dataset, config$1);
202
- return dataset;
203
- }
204
- };
205
- }
206
- /**
207
- * Creates a custom transformation action.
208
- *
209
- * @param operation The transformation operation.
210
- *
211
- * @returns A transform action.
212
- */
213
- /* @__NO_SIDE_EFFECTS__ */
214
- function transform(operation) {
215
- return {
216
- kind: "transformation",
217
- type: "transform",
218
- reference: transform,
219
- async: false,
220
- operation,
221
- "~run"(dataset) {
222
- dataset.value = this.operation(dataset.value);
223
- return dataset;
224
- }
225
- };
226
- }
227
- /**
228
- * Returns the fallback value of the schema.
229
- *
230
- * @param schema The schema to get it from.
231
- * @param dataset The output dataset if available.
232
- * @param config The config if available.
233
- *
234
- * @returns The fallback value.
235
- */
236
- /* @__NO_SIDE_EFFECTS__ */
237
- function getFallback(schema, dataset, config$1) {
238
- return typeof schema.fallback === "function" ? schema.fallback(dataset, config$1) : schema.fallback;
239
- }
240
- /**
241
- * Returns the default value of the schema.
242
- *
243
- * @param schema The schema to get it from.
244
- * @param dataset The input dataset if available.
245
- * @param config The config if available.
246
- *
247
- * @returns The default value.
248
- */
249
- /* @__NO_SIDE_EFFECTS__ */
250
- function getDefault(schema, dataset, config$1) {
251
- return typeof schema.default === "function" ? schema.default(dataset, config$1) : schema.default;
252
- }
253
- /**
254
- * Checks if the input matches the schema. By using a type predicate, this
255
- * function can be used as a type guard.
256
- *
257
- * @param schema The schema to be used.
258
- * @param input The input to be tested.
259
- *
260
- * @returns Whether the input matches the schema.
261
- */
262
- /* @__NO_SIDE_EFFECTS__ */
263
- function is(schema, input) {
264
- return !schema["~run"]({ value: input }, { abortEarly: true }).issues;
265
- }
266
- /* @__NO_SIDE_EFFECTS__ */
267
- function array(item, message$1) {
268
- return {
269
- kind: "schema",
270
- type: "array",
271
- reference: array,
272
- expects: "Array",
273
- async: false,
274
- item,
275
- message: message$1,
276
- get "~standard"() {
277
- return /* @__PURE__ */ _getStandardProps(this);
278
- },
279
- "~run"(dataset, config$1) {
280
- const input = dataset.value;
281
- if (Array.isArray(input)) {
282
- dataset.typed = true;
283
- dataset.value = [];
284
- for (let key = 0; key < input.length; key++) {
285
- const value$1 = input[key];
286
- const itemDataset = this.item["~run"]({ value: value$1 }, config$1);
287
- if (itemDataset.issues) {
288
- const pathItem = {
289
- type: "array",
290
- origin: "value",
291
- input,
292
- key,
293
- value: value$1
294
- };
295
- for (const issue of itemDataset.issues) {
296
- if (issue.path) issue.path.unshift(pathItem);
297
- else issue.path = [pathItem];
298
- dataset.issues?.push(issue);
299
- }
300
- if (!dataset.issues) dataset.issues = itemDataset.issues;
301
- if (config$1.abortEarly) {
302
- dataset.typed = false;
303
- break;
304
- }
305
- }
306
- if (!itemDataset.typed) dataset.typed = false;
307
- dataset.value.push(itemDataset.value);
308
- }
309
- } else _addIssue(this, "type", dataset, config$1);
310
- return dataset;
311
- }
312
- };
313
- }
314
- /* @__NO_SIDE_EFFECTS__ */
315
- function bigint(message$1) {
316
- return {
317
- kind: "schema",
318
- type: "bigint",
319
- reference: bigint,
320
- expects: "bigint",
321
- async: false,
322
- message: message$1,
323
- get "~standard"() {
324
- return /* @__PURE__ */ _getStandardProps(this);
325
- },
326
- "~run"(dataset, config$1) {
327
- if (typeof dataset.value === "bigint") dataset.typed = true;
328
- else _addIssue(this, "type", dataset, config$1);
329
- return dataset;
330
- }
331
- };
332
- }
333
- /* @__NO_SIDE_EFFECTS__ */
334
- function boolean(message$1) {
335
- return {
336
- kind: "schema",
337
- type: "boolean",
338
- reference: boolean,
339
- expects: "boolean",
340
- async: false,
341
- message: message$1,
342
- get "~standard"() {
343
- return /* @__PURE__ */ _getStandardProps(this);
344
- },
345
- "~run"(dataset, config$1) {
346
- if (typeof dataset.value === "boolean") dataset.typed = true;
347
- else _addIssue(this, "type", dataset, config$1);
348
- return dataset;
349
- }
350
- };
351
- }
352
- /**
353
- * Creates a lazy schema.
354
- *
355
- * @param getter The schema getter.
356
- *
357
- * @returns A lazy schema.
358
- */
359
- /* @__NO_SIDE_EFFECTS__ */
360
- function lazy(getter) {
361
- return {
362
- kind: "schema",
363
- type: "lazy",
364
- reference: lazy,
365
- expects: "unknown",
366
- async: false,
367
- getter,
368
- get "~standard"() {
369
- return /* @__PURE__ */ _getStandardProps(this);
370
- },
371
- "~run"(dataset, config$1) {
372
- return this.getter(dataset.value)["~run"](dataset, config$1);
373
- }
374
- };
375
- }
376
- /* @__NO_SIDE_EFFECTS__ */
377
- function literal(literal_, message$1) {
378
- return {
379
- kind: "schema",
380
- type: "literal",
381
- reference: literal,
382
- expects: /* @__PURE__ */ _stringify(literal_),
383
- async: false,
384
- literal: literal_,
385
- message: message$1,
386
- get "~standard"() {
387
- return /* @__PURE__ */ _getStandardProps(this);
388
- },
389
- "~run"(dataset, config$1) {
390
- if (dataset.value === this.literal) dataset.typed = true;
391
- else _addIssue(this, "type", dataset, config$1);
392
- return dataset;
393
- }
394
- };
395
- }
396
- /* @__NO_SIDE_EFFECTS__ */
397
- function nullable(wrapped, default_) {
398
- return {
399
- kind: "schema",
400
- type: "nullable",
401
- reference: nullable,
402
- expects: `(${wrapped.expects} | null)`,
403
- async: false,
404
- wrapped,
405
- default: default_,
406
- get "~standard"() {
407
- return /* @__PURE__ */ _getStandardProps(this);
408
- },
409
- "~run"(dataset, config$1) {
410
- if (dataset.value === null) {
411
- if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
412
- if (dataset.value === null) {
413
- dataset.typed = true;
414
- return dataset;
415
- }
416
- }
417
- return this.wrapped["~run"](dataset, config$1);
418
- }
419
- };
420
- }
421
- /* @__NO_SIDE_EFFECTS__ */
422
- function nullish(wrapped, default_) {
423
- return {
424
- kind: "schema",
425
- type: "nullish",
426
- reference: nullish,
427
- expects: `(${wrapped.expects} | null | undefined)`,
428
- async: false,
429
- wrapped,
430
- default: default_,
431
- get "~standard"() {
432
- return /* @__PURE__ */ _getStandardProps(this);
433
- },
434
- "~run"(dataset, config$1) {
435
- if (dataset.value === null || dataset.value === void 0) {
436
- if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
437
- if (dataset.value === null || dataset.value === void 0) {
438
- dataset.typed = true;
439
- return dataset;
440
- }
441
- }
442
- return this.wrapped["~run"](dataset, config$1);
443
- }
444
- };
445
- }
446
- /* @__NO_SIDE_EFFECTS__ */
447
- function number(message$1) {
448
- return {
449
- kind: "schema",
450
- type: "number",
451
- reference: number,
452
- expects: "number",
453
- async: false,
454
- message: message$1,
455
- get "~standard"() {
456
- return /* @__PURE__ */ _getStandardProps(this);
457
- },
458
- "~run"(dataset, config$1) {
459
- if (typeof dataset.value === "number" && !isNaN(dataset.value)) dataset.typed = true;
460
- else _addIssue(this, "type", dataset, config$1);
461
- return dataset;
462
- }
463
- };
464
- }
465
- /* @__NO_SIDE_EFFECTS__ */
466
- function object(entries$1, message$1) {
467
- return {
468
- kind: "schema",
469
- type: "object",
470
- reference: object,
471
- expects: "Object",
472
- async: false,
473
- entries: entries$1,
474
- message: message$1,
475
- get "~standard"() {
476
- return /* @__PURE__ */ _getStandardProps(this);
477
- },
478
- "~run"(dataset, config$1) {
479
- const input = dataset.value;
480
- if (input && typeof input === "object") {
481
- dataset.typed = true;
482
- dataset.value = {};
483
- for (const key in this.entries) {
484
- const valueSchema = this.entries[key];
485
- if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
486
- const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
487
- const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1);
488
- if (valueDataset.issues) {
489
- const pathItem = {
490
- type: "object",
491
- origin: "value",
492
- input,
493
- key,
494
- value: value$1
495
- };
496
- for (const issue of valueDataset.issues) {
497
- if (issue.path) issue.path.unshift(pathItem);
498
- else issue.path = [pathItem];
499
- dataset.issues?.push(issue);
500
- }
501
- if (!dataset.issues) dataset.issues = valueDataset.issues;
502
- if (config$1.abortEarly) {
503
- dataset.typed = false;
504
- break;
505
- }
506
- }
507
- if (!valueDataset.typed) dataset.typed = false;
508
- dataset.value[key] = valueDataset.value;
509
- } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
510
- else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
511
- _addIssue(this, "key", dataset, config$1, {
512
- input: void 0,
513
- expected: `"${key}"`,
514
- path: [{
515
- type: "object",
516
- origin: "key",
517
- input,
518
- key,
519
- value: input[key]
520
- }]
521
- });
522
- if (config$1.abortEarly) break;
523
- }
524
- }
525
- } else _addIssue(this, "type", dataset, config$1);
526
- return dataset;
527
- }
528
- };
529
- }
530
- /* @__NO_SIDE_EFFECTS__ */
531
- function optional(wrapped, default_) {
532
- return {
533
- kind: "schema",
534
- type: "optional",
535
- reference: optional,
536
- expects: `(${wrapped.expects} | undefined)`,
537
- async: false,
538
- wrapped,
539
- default: default_,
540
- get "~standard"() {
541
- return /* @__PURE__ */ _getStandardProps(this);
542
- },
543
- "~run"(dataset, config$1) {
544
- if (dataset.value === void 0) {
545
- if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
546
- if (dataset.value === void 0) {
547
- dataset.typed = true;
548
- return dataset;
549
- }
550
- }
551
- return this.wrapped["~run"](dataset, config$1);
552
- }
553
- };
554
- }
555
- /* @__NO_SIDE_EFFECTS__ */
556
- function picklist(options, message$1) {
557
- return {
558
- kind: "schema",
559
- type: "picklist",
560
- reference: picklist,
561
- expects: /* @__PURE__ */ _joinExpects(options.map(_stringify), "|"),
562
- async: false,
563
- options,
564
- message: message$1,
565
- get "~standard"() {
566
- return /* @__PURE__ */ _getStandardProps(this);
567
- },
568
- "~run"(dataset, config$1) {
569
- if (this.options.includes(dataset.value)) dataset.typed = true;
570
- else _addIssue(this, "type", dataset, config$1);
571
- return dataset;
572
- }
573
- };
574
- }
575
- /* @__NO_SIDE_EFFECTS__ */
576
- function record(key, value$1, message$1) {
577
- return {
578
- kind: "schema",
579
- type: "record",
580
- reference: record,
581
- expects: "Object",
582
- async: false,
583
- key,
584
- value: value$1,
585
- message: message$1,
586
- get "~standard"() {
587
- return /* @__PURE__ */ _getStandardProps(this);
588
- },
589
- "~run"(dataset, config$1) {
590
- const input = dataset.value;
591
- if (input && typeof input === "object") {
592
- dataset.typed = true;
593
- dataset.value = {};
594
- for (const entryKey in input) if (/* @__PURE__ */ _isValidObjectKey(input, entryKey)) {
595
- const entryValue = input[entryKey];
596
- const keyDataset = this.key["~run"]({ value: entryKey }, config$1);
597
- if (keyDataset.issues) {
598
- const pathItem = {
599
- type: "object",
600
- origin: "key",
601
- input,
602
- key: entryKey,
603
- value: entryValue
604
- };
605
- for (const issue of keyDataset.issues) {
606
- issue.path = [pathItem];
607
- dataset.issues?.push(issue);
608
- }
609
- if (!dataset.issues) dataset.issues = keyDataset.issues;
610
- if (config$1.abortEarly) {
611
- dataset.typed = false;
612
- break;
613
- }
614
- }
615
- const valueDataset = this.value["~run"]({ value: entryValue }, config$1);
616
- if (valueDataset.issues) {
617
- const pathItem = {
618
- type: "object",
619
- origin: "value",
620
- input,
621
- key: entryKey,
622
- value: entryValue
623
- };
624
- for (const issue of valueDataset.issues) {
625
- if (issue.path) issue.path.unshift(pathItem);
626
- else issue.path = [pathItem];
627
- dataset.issues?.push(issue);
628
- }
629
- if (!dataset.issues) dataset.issues = valueDataset.issues;
630
- if (config$1.abortEarly) {
631
- dataset.typed = false;
632
- break;
633
- }
634
- }
635
- if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;
636
- if (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value;
637
- }
638
- } else _addIssue(this, "type", dataset, config$1);
639
- return dataset;
640
- }
641
- };
642
- }
643
- /* @__NO_SIDE_EFFECTS__ */
644
- function string(message$1) {
645
- return {
646
- kind: "schema",
647
- type: "string",
648
- reference: string,
649
- expects: "string",
650
- async: false,
651
- message: message$1,
652
- get "~standard"() {
653
- return /* @__PURE__ */ _getStandardProps(this);
654
- },
655
- "~run"(dataset, config$1) {
656
- if (typeof dataset.value === "string") dataset.typed = true;
657
- else _addIssue(this, "type", dataset, config$1);
658
- return dataset;
659
- }
660
- };
661
- }
662
- /* @__NO_SIDE_EFFECTS__ */
663
- function tuple(items, message$1) {
664
- return {
665
- kind: "schema",
666
- type: "tuple",
667
- reference: tuple,
668
- expects: "Array",
669
- async: false,
670
- items,
671
- message: message$1,
672
- get "~standard"() {
673
- return /* @__PURE__ */ _getStandardProps(this);
674
- },
675
- "~run"(dataset, config$1) {
676
- const input = dataset.value;
677
- if (Array.isArray(input)) {
678
- dataset.typed = true;
679
- dataset.value = [];
680
- for (let key = 0; key < this.items.length; key++) {
681
- const value$1 = input[key];
682
- const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1);
683
- if (itemDataset.issues) {
684
- const pathItem = {
685
- type: "array",
686
- origin: "value",
687
- input,
688
- key,
689
- value: value$1
690
- };
691
- for (const issue of itemDataset.issues) {
692
- if (issue.path) issue.path.unshift(pathItem);
693
- else issue.path = [pathItem];
694
- dataset.issues?.push(issue);
695
- }
696
- if (!dataset.issues) dataset.issues = itemDataset.issues;
697
- if (config$1.abortEarly) {
698
- dataset.typed = false;
699
- break;
700
- }
701
- }
702
- if (!itemDataset.typed) dataset.typed = false;
703
- dataset.value.push(itemDataset.value);
704
- }
705
- } else _addIssue(this, "type", dataset, config$1);
706
- return dataset;
707
- }
708
- };
709
- }
710
- /**
711
- * Returns the sub issues of the provided datasets for the union issue.
712
- *
713
- * @param datasets The datasets.
714
- *
715
- * @returns The sub issues.
716
- *
717
- * @internal
718
- */
719
- /* @__NO_SIDE_EFFECTS__ */
720
- function _subIssues(datasets) {
721
- let issues;
722
- if (datasets) for (const dataset of datasets) if (issues) issues.push(...dataset.issues);
723
- else issues = dataset.issues;
724
- return issues;
725
- }
726
- /* @__NO_SIDE_EFFECTS__ */
727
- function union(options, message$1) {
728
- return {
729
- kind: "schema",
730
- type: "union",
731
- reference: union,
732
- expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"),
733
- async: false,
734
- options,
735
- message: message$1,
736
- get "~standard"() {
737
- return /* @__PURE__ */ _getStandardProps(this);
738
- },
739
- "~run"(dataset, config$1) {
740
- let validDataset;
741
- let typedDatasets;
742
- let untypedDatasets;
743
- for (const schema of this.options) {
744
- const optionDataset = schema["~run"]({ value: dataset.value }, config$1);
745
- if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);
746
- else typedDatasets = [optionDataset];
747
- else {
748
- validDataset = optionDataset;
749
- break;
750
- }
751
- else if (untypedDatasets) untypedDatasets.push(optionDataset);
752
- else untypedDatasets = [optionDataset];
753
- }
754
- if (validDataset) return validDataset;
755
- if (typedDatasets) {
756
- if (typedDatasets.length === 1) return typedDatasets[0];
757
- _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });
758
- dataset.typed = true;
759
- } else if (untypedDatasets?.length === 1) return untypedDatasets[0];
760
- else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });
761
- return dataset;
762
- }
763
- };
764
- }
765
- /**
766
- * Creates a unknown schema.
767
- *
768
- * @returns A unknown schema.
769
- */
770
- /* @__NO_SIDE_EFFECTS__ */
771
- function unknown() {
772
- return {
773
- kind: "schema",
774
- type: "unknown",
775
- reference: unknown,
776
- expects: "unknown",
777
- async: false,
778
- get "~standard"() {
779
- return /* @__PURE__ */ _getStandardProps(this);
780
- },
781
- "~run"(dataset) {
782
- dataset.typed = true;
783
- return dataset;
784
- }
785
- };
786
- }
787
- /**
788
- * Parses an unknown input based on a schema.
789
- *
790
- * @param schema The schema to be used.
791
- * @param input The input to be parsed.
792
- * @param config The parse configuration.
793
- *
794
- * @returns The parsed input.
795
- */
796
- function parse(schema, input, config$1) {
797
- const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));
798
- if (dataset.issues) throw new ValiError(dataset.issues);
799
- return dataset.value;
800
- }
801
- /* @__NO_SIDE_EFFECTS__ */
802
- function pipe(...pipe$1) {
803
- return {
804
- ...pipe$1[0],
805
- pipe: pipe$1,
806
- get "~standard"() {
807
- return /* @__PURE__ */ _getStandardProps(this);
808
- },
809
- "~run"(dataset, config$1) {
810
- for (const item of pipe$1) if (item.kind !== "metadata") {
811
- if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
812
- dataset.typed = false;
813
- break;
814
- }
815
- if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item["~run"](dataset, config$1);
816
- }
817
- return dataset;
818
- }
819
- };
820
- }
821
-
822
- //#endregion
823
- export { unknown as S, record as _, integer as a, tuple as b, literal as c, number as d, object as f, pipe as g, picklist as h, check as i, nullable as l, parse as m, bigint as n, is as o, optional as p, boolean as r, lazy as s, array as t, nullish as u, string as v, union as x, transform as y };
824
- //# sourceMappingURL=dist-CA96PSzE.js.map