@wise/dynamic-flow-types 2.15.1 → 2.15.3-experimental-rendererfor-4f35dc5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/main.mjs CHANGED
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
 
21
- // ../../node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
21
+ // ../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs
22
22
  var util;
23
23
  (function(util2) {
24
24
  util2.assertEqual = (val) => val;
@@ -168,7 +168,7 @@ var quotelessJson = (obj) => {
168
168
  const json = JSON.stringify(obj, null, 2);
169
169
  return json.replace(/"([^"]+)":/g, "$1:");
170
170
  };
171
- var ZodError = class extends Error {
171
+ var ZodError = class _ZodError extends Error {
172
172
  constructor(issues) {
173
173
  super();
174
174
  this.issues = [];
@@ -226,6 +226,11 @@ var ZodError = class extends Error {
226
226
  processError(this);
227
227
  return fieldErrors;
228
228
  }
229
+ static assert(value) {
230
+ if (!(value instanceof _ZodError)) {
231
+ throw new Error(`Not a ZodError: ${value}`);
232
+ }
233
+ }
229
234
  toString() {
230
235
  return this.message;
231
236
  }
@@ -367,6 +372,12 @@ var makeIssue = (params) => {
367
372
  const fullIssue = __spreadProps(__spreadValues({}, issueData), {
368
373
  path: fullPath
369
374
  });
375
+ if (issueData.message !== void 0) {
376
+ return __spreadProps(__spreadValues({}, issueData), {
377
+ path: fullPath,
378
+ message: issueData.message
379
+ });
380
+ }
370
381
  let errorMessage = "";
371
382
  const maps = errorMaps.filter((m) => !!m).slice().reverse();
372
383
  for (const map of maps) {
@@ -374,11 +385,12 @@ var makeIssue = (params) => {
374
385
  }
375
386
  return __spreadProps(__spreadValues({}, issueData), {
376
387
  path: fullPath,
377
- message: issueData.message || errorMessage
388
+ message: errorMessage
378
389
  });
379
390
  };
380
391
  var EMPTY_PATH = [];
381
392
  function addIssueToContext(ctx, issueData) {
393
+ const overrideMap = getErrorMap();
382
394
  const issue = makeIssue({
383
395
  issueData,
384
396
  data: ctx.data,
@@ -386,8 +398,8 @@ function addIssueToContext(ctx, issueData) {
386
398
  errorMaps: [
387
399
  ctx.common.contextualErrorMap,
388
400
  ctx.schemaErrorMap,
389
- getErrorMap(),
390
- errorMap
401
+ overrideMap,
402
+ overrideMap === errorMap ? void 0 : errorMap
391
403
  // then global default map
392
404
  ].filter((x) => !!x)
393
405
  });
@@ -419,9 +431,11 @@ var ParseStatus = class _ParseStatus {
419
431
  static async mergeObjectAsync(status, pairs) {
420
432
  const syncPairs = [];
421
433
  for (const pair of pairs) {
434
+ const key = await pair.key;
435
+ const value = await pair.value;
422
436
  syncPairs.push({
423
- key: await pair.key,
424
- value: await pair.value
437
+ key,
438
+ value
425
439
  });
426
440
  }
427
441
  return _ParseStatus.mergeObjectSync(status, syncPairs);
@@ -454,11 +468,29 @@ var isAborted = (x) => x.status === "aborted";
454
468
  var isDirty = (x) => x.status === "dirty";
455
469
  var isValid = (x) => x.status === "valid";
456
470
  var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
471
+ function __classPrivateFieldGet(receiver, state, kind, f) {
472
+ if (kind === "a" && !f)
473
+ throw new TypeError("Private accessor was defined without a getter");
474
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
475
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
476
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
477
+ }
478
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
479
+ if (kind === "m")
480
+ throw new TypeError("Private method is not writable");
481
+ if (kind === "a" && !f)
482
+ throw new TypeError("Private accessor was defined without a setter");
483
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
484
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
485
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
486
+ }
457
487
  var errorUtil;
458
488
  (function(errorUtil2) {
459
489
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
460
490
  errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
461
491
  })(errorUtil || (errorUtil = {}));
492
+ var _ZodEnum_cache;
493
+ var _ZodNativeEnum_cache;
462
494
  var ParseInputLazyPath = class {
463
495
  constructor(parent, value, path, key) {
464
496
  this._cachedPath = [];
@@ -507,12 +539,17 @@ function processCreateParams(params) {
507
539
  if (errorMap2)
508
540
  return { errorMap: errorMap2, description };
509
541
  const customMap = (iss, ctx) => {
510
- if (iss.code !== "invalid_type")
511
- return { message: ctx.defaultError };
542
+ var _a, _b;
543
+ const { message } = params;
544
+ if (iss.code === "invalid_enum_value") {
545
+ return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
546
+ }
512
547
  if (typeof ctx.data === "undefined") {
513
- return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError };
548
+ return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
514
549
  }
515
- return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError };
550
+ if (iss.code !== "invalid_type")
551
+ return { message: ctx.defaultError };
552
+ return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
516
553
  };
517
554
  return { errorMap: customMap, description };
518
555
  }
@@ -754,35 +791,40 @@ var ZodType = class {
754
791
  }
755
792
  };
756
793
  var cuidRegex = /^c[^\s-]{8,}$/i;
757
- var cuid2Regex = /^[a-z][a-z0-9]*$/;
794
+ var cuid2Regex = /^[0-9a-z]+$/;
758
795
  var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
759
796
  var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
760
- var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
797
+ var nanoidRegex = /^[a-z0-9_-]{21}$/i;
798
+ var durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
799
+ var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
761
800
  var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
762
801
  var emojiRegex;
763
- var ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;
802
+ var ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
764
803
  var ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
765
- var datetimeRegex = (args) => {
804
+ var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
805
+ var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
806
+ var dateRegex = new RegExp(`^${dateRegexSource}$`);
807
+ function timeRegexSource(args) {
808
+ let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
766
809
  if (args.precision) {
767
- if (args.offset) {
768
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
769
- } else {
770
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
771
- }
772
- } else if (args.precision === 0) {
773
- if (args.offset) {
774
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
775
- } else {
776
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
777
- }
778
- } else {
779
- if (args.offset) {
780
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
781
- } else {
782
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
783
- }
810
+ regex = `${regex}\\.\\d{${args.precision}}`;
811
+ } else if (args.precision == null) {
812
+ regex = `${regex}(\\.\\d+)?`;
784
813
  }
785
- };
814
+ return regex;
815
+ }
816
+ function timeRegex(args) {
817
+ return new RegExp(`^${timeRegexSource(args)}$`);
818
+ }
819
+ function datetimeRegex(args) {
820
+ let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
821
+ const opts = [];
822
+ opts.push(args.local ? `Z?` : `Z`);
823
+ if (args.offset)
824
+ opts.push(`([+-]\\d{2}:?\\d{2})`);
825
+ regex = `${regex}(${opts.join("|")})`;
826
+ return new RegExp(`^${regex}$`);
827
+ }
786
828
  function isValidIP(ip, version) {
787
829
  if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
788
830
  return true;
@@ -800,15 +842,11 @@ var ZodString = class _ZodString extends ZodType {
800
842
  const parsedType = this._getType(input);
801
843
  if (parsedType !== ZodParsedType.string) {
802
844
  const ctx2 = this._getOrReturnCtx(input);
803
- addIssueToContext(
804
- ctx2,
805
- {
806
- code: ZodIssueCode.invalid_type,
807
- expected: ZodParsedType.string,
808
- received: ctx2.parsedType
809
- }
810
- //
811
- );
845
+ addIssueToContext(ctx2, {
846
+ code: ZodIssueCode.invalid_type,
847
+ expected: ZodParsedType.string,
848
+ received: ctx2.parsedType
849
+ });
812
850
  return INVALID;
813
851
  }
814
852
  const status = new ParseStatus();
@@ -899,6 +937,16 @@ var ZodString = class _ZodString extends ZodType {
899
937
  });
900
938
  status.dirty();
901
939
  }
940
+ } else if (check.kind === "nanoid") {
941
+ if (!nanoidRegex.test(input.data)) {
942
+ ctx = this._getOrReturnCtx(input, ctx);
943
+ addIssueToContext(ctx, {
944
+ validation: "nanoid",
945
+ code: ZodIssueCode.invalid_string,
946
+ message: check.message
947
+ });
948
+ status.dirty();
949
+ }
902
950
  } else if (check.kind === "cuid") {
903
951
  if (!cuidRegex.test(input.data)) {
904
952
  ctx = this._getOrReturnCtx(input, ctx);
@@ -1000,6 +1048,38 @@ var ZodString = class _ZodString extends ZodType {
1000
1048
  });
1001
1049
  status.dirty();
1002
1050
  }
1051
+ } else if (check.kind === "date") {
1052
+ const regex = dateRegex;
1053
+ if (!regex.test(input.data)) {
1054
+ ctx = this._getOrReturnCtx(input, ctx);
1055
+ addIssueToContext(ctx, {
1056
+ code: ZodIssueCode.invalid_string,
1057
+ validation: "date",
1058
+ message: check.message
1059
+ });
1060
+ status.dirty();
1061
+ }
1062
+ } else if (check.kind === "time") {
1063
+ const regex = timeRegex(check);
1064
+ if (!regex.test(input.data)) {
1065
+ ctx = this._getOrReturnCtx(input, ctx);
1066
+ addIssueToContext(ctx, {
1067
+ code: ZodIssueCode.invalid_string,
1068
+ validation: "time",
1069
+ message: check.message
1070
+ });
1071
+ status.dirty();
1072
+ }
1073
+ } else if (check.kind === "duration") {
1074
+ if (!durationRegex.test(input.data)) {
1075
+ ctx = this._getOrReturnCtx(input, ctx);
1076
+ addIssueToContext(ctx, {
1077
+ validation: "duration",
1078
+ code: ZodIssueCode.invalid_string,
1079
+ message: check.message
1080
+ });
1081
+ status.dirty();
1082
+ }
1003
1083
  } else if (check.kind === "ip") {
1004
1084
  if (!isValidIP(input.data, check.version)) {
1005
1085
  ctx = this._getOrReturnCtx(input, ctx);
@@ -1010,6 +1090,16 @@ var ZodString = class _ZodString extends ZodType {
1010
1090
  });
1011
1091
  status.dirty();
1012
1092
  }
1093
+ } else if (check.kind === "base64") {
1094
+ if (!base64Regex.test(input.data)) {
1095
+ ctx = this._getOrReturnCtx(input, ctx);
1096
+ addIssueToContext(ctx, {
1097
+ validation: "base64",
1098
+ code: ZodIssueCode.invalid_string,
1099
+ message: check.message
1100
+ });
1101
+ status.dirty();
1102
+ }
1013
1103
  } else {
1014
1104
  util.assertNever(check);
1015
1105
  }
@@ -1039,6 +1129,9 @@ var ZodString = class _ZodString extends ZodType {
1039
1129
  uuid(message) {
1040
1130
  return this._addCheck(__spreadValues({ kind: "uuid" }, errorUtil.errToObj(message)));
1041
1131
  }
1132
+ nanoid(message) {
1133
+ return this._addCheck(__spreadValues({ kind: "nanoid" }, errorUtil.errToObj(message)));
1134
+ }
1042
1135
  cuid(message) {
1043
1136
  return this._addCheck(__spreadValues({ kind: "cuid" }, errorUtil.errToObj(message)));
1044
1137
  }
@@ -1048,25 +1141,49 @@ var ZodString = class _ZodString extends ZodType {
1048
1141
  ulid(message) {
1049
1142
  return this._addCheck(__spreadValues({ kind: "ulid" }, errorUtil.errToObj(message)));
1050
1143
  }
1144
+ base64(message) {
1145
+ return this._addCheck(__spreadValues({ kind: "base64" }, errorUtil.errToObj(message)));
1146
+ }
1051
1147
  ip(options) {
1052
1148
  return this._addCheck(__spreadValues({ kind: "ip" }, errorUtil.errToObj(options)));
1053
1149
  }
1054
1150
  datetime(options) {
1055
- var _a;
1151
+ var _a, _b;
1056
1152
  if (typeof options === "string") {
1057
1153
  return this._addCheck({
1058
1154
  kind: "datetime",
1059
1155
  precision: null,
1060
1156
  offset: false,
1157
+ local: false,
1061
1158
  message: options
1062
1159
  });
1063
1160
  }
1064
1161
  return this._addCheck(__spreadValues({
1065
1162
  kind: "datetime",
1066
1163
  precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
1067
- offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false
1164
+ offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
1165
+ local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false
1166
+ }, errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)));
1167
+ }
1168
+ date(message) {
1169
+ return this._addCheck({ kind: "date", message });
1170
+ }
1171
+ time(options) {
1172
+ if (typeof options === "string") {
1173
+ return this._addCheck({
1174
+ kind: "time",
1175
+ precision: null,
1176
+ message: options
1177
+ });
1178
+ }
1179
+ return this._addCheck(__spreadValues({
1180
+ kind: "time",
1181
+ precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision
1068
1182
  }, errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)));
1069
1183
  }
1184
+ duration(message) {
1185
+ return this._addCheck(__spreadValues({ kind: "duration" }, errorUtil.errToObj(message)));
1186
+ }
1070
1187
  regex(regex, message) {
1071
1188
  return this._addCheck(__spreadValues({
1072
1189
  kind: "regex",
@@ -1135,6 +1252,15 @@ var ZodString = class _ZodString extends ZodType {
1135
1252
  get isDatetime() {
1136
1253
  return !!this._def.checks.find((ch) => ch.kind === "datetime");
1137
1254
  }
1255
+ get isDate() {
1256
+ return !!this._def.checks.find((ch) => ch.kind === "date");
1257
+ }
1258
+ get isTime() {
1259
+ return !!this._def.checks.find((ch) => ch.kind === "time");
1260
+ }
1261
+ get isDuration() {
1262
+ return !!this._def.checks.find((ch) => ch.kind === "duration");
1263
+ }
1138
1264
  get isEmail() {
1139
1265
  return !!this._def.checks.find((ch) => ch.kind === "email");
1140
1266
  }
@@ -1147,6 +1273,9 @@ var ZodString = class _ZodString extends ZodType {
1147
1273
  get isUUID() {
1148
1274
  return !!this._def.checks.find((ch) => ch.kind === "uuid");
1149
1275
  }
1276
+ get isNANOID() {
1277
+ return !!this._def.checks.find((ch) => ch.kind === "nanoid");
1278
+ }
1150
1279
  get isCUID() {
1151
1280
  return !!this._def.checks.find((ch) => ch.kind === "cuid");
1152
1281
  }
@@ -1159,6 +1288,9 @@ var ZodString = class _ZodString extends ZodType {
1159
1288
  get isIP() {
1160
1289
  return !!this._def.checks.find((ch) => ch.kind === "ip");
1161
1290
  }
1291
+ get isBase64() {
1292
+ return !!this._def.checks.find((ch) => ch.kind === "base64");
1293
+ }
1162
1294
  get minLength() {
1163
1295
  let min = null;
1164
1296
  for (const ch of this._def.checks) {
@@ -2049,9 +2181,10 @@ var ZodObject = class _ZodObject extends ZodType {
2049
2181
  const syncPairs = [];
2050
2182
  for (const pair of pairs) {
2051
2183
  const key = await pair.key;
2184
+ const value = await pair.value;
2052
2185
  syncPairs.push({
2053
2186
  key,
2054
- value: await pair.value,
2187
+ value,
2055
2188
  alwaysSet: pair.alwaysSet
2056
2189
  });
2057
2190
  }
@@ -2378,15 +2511,25 @@ var getDiscriminator = (type) => {
2378
2511
  } else if (type instanceof ZodEnum) {
2379
2512
  return type.options;
2380
2513
  } else if (type instanceof ZodNativeEnum) {
2381
- return Object.keys(type.enum);
2514
+ return util.objectValues(type.enum);
2382
2515
  } else if (type instanceof ZodDefault) {
2383
2516
  return getDiscriminator(type._def.innerType);
2384
2517
  } else if (type instanceof ZodUndefined) {
2385
2518
  return [void 0];
2386
2519
  } else if (type instanceof ZodNull) {
2387
2520
  return [null];
2521
+ } else if (type instanceof ZodOptional) {
2522
+ return [void 0, ...getDiscriminator(type.unwrap())];
2523
+ } else if (type instanceof ZodNullable) {
2524
+ return [null, ...getDiscriminator(type.unwrap())];
2525
+ } else if (type instanceof ZodBranded) {
2526
+ return getDiscriminator(type.unwrap());
2527
+ } else if (type instanceof ZodReadonly) {
2528
+ return getDiscriminator(type.unwrap());
2529
+ } else if (type instanceof ZodCatch) {
2530
+ return getDiscriminator(type._def.innerType);
2388
2531
  } else {
2389
- return null;
2532
+ return [];
2390
2533
  }
2391
2534
  };
2392
2535
  var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
@@ -2446,7 +2589,7 @@ var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
2446
2589
  const optionsMap = /* @__PURE__ */ new Map();
2447
2590
  for (const type of options) {
2448
2591
  const discriminatorValues = getDiscriminator(type.shape[discriminator]);
2449
- if (!discriminatorValues) {
2592
+ if (!discriminatorValues.length) {
2450
2593
  throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
2451
2594
  }
2452
2595
  for (const value of discriminatorValues) {
@@ -2642,7 +2785,8 @@ var ZodRecord = class _ZodRecord extends ZodType {
2642
2785
  for (const key in ctx.data) {
2643
2786
  pairs.push({
2644
2787
  key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
2645
- value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key))
2788
+ value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
2789
+ alwaysSet: key in ctx.data
2646
2790
  });
2647
2791
  }
2648
2792
  if (ctx.common.async) {
@@ -2974,6 +3118,10 @@ function createZodEnum(values, params) {
2974
3118
  }, processCreateParams(params)));
2975
3119
  }
2976
3120
  var ZodEnum = class _ZodEnum extends ZodType {
3121
+ constructor() {
3122
+ super(...arguments);
3123
+ _ZodEnum_cache.set(this, void 0);
3124
+ }
2977
3125
  _parse(input) {
2978
3126
  if (typeof input.data !== "string") {
2979
3127
  const ctx = this._getOrReturnCtx(input);
@@ -2985,7 +3133,10 @@ var ZodEnum = class _ZodEnum extends ZodType {
2985
3133
  });
2986
3134
  return INVALID;
2987
3135
  }
2988
- if (this._def.values.indexOf(input.data) === -1) {
3136
+ if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
3137
+ __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
3138
+ }
3139
+ if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
2989
3140
  const ctx = this._getOrReturnCtx(input);
2990
3141
  const expectedValues = this._def.values;
2991
3142
  addIssueToContext(ctx, {
@@ -3021,15 +3172,20 @@ var ZodEnum = class _ZodEnum extends ZodType {
3021
3172
  }
3022
3173
  return enumValues;
3023
3174
  }
3024
- extract(values) {
3025
- return _ZodEnum.create(values);
3175
+ extract(values, newDef = this._def) {
3176
+ return _ZodEnum.create(values, __spreadValues(__spreadValues({}, this._def), newDef));
3026
3177
  }
3027
- exclude(values) {
3028
- return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));
3178
+ exclude(values, newDef = this._def) {
3179
+ return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), __spreadValues(__spreadValues({}, this._def), newDef));
3029
3180
  }
3030
3181
  };
3182
+ _ZodEnum_cache = /* @__PURE__ */ new WeakMap();
3031
3183
  ZodEnum.create = createZodEnum;
3032
3184
  var ZodNativeEnum = class extends ZodType {
3185
+ constructor() {
3186
+ super(...arguments);
3187
+ _ZodNativeEnum_cache.set(this, void 0);
3188
+ }
3033
3189
  _parse(input) {
3034
3190
  const nativeEnumValues = util.getValidEnumValues(this._def.values);
3035
3191
  const ctx = this._getOrReturnCtx(input);
@@ -3042,7 +3198,10 @@ var ZodNativeEnum = class extends ZodType {
3042
3198
  });
3043
3199
  return INVALID;
3044
3200
  }
3045
- if (nativeEnumValues.indexOf(input.data) === -1) {
3201
+ if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
3202
+ __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
3203
+ }
3204
+ if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
3046
3205
  const expectedValues = util.objectValues(nativeEnumValues);
3047
3206
  addIssueToContext(ctx, {
3048
3207
  received: ctx.data,
@@ -3057,6 +3216,7 @@ var ZodNativeEnum = class extends ZodType {
3057
3216
  return this._def.values;
3058
3217
  }
3059
3218
  };
3219
+ _ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
3060
3220
  ZodNativeEnum.create = (values, params) => {
3061
3221
  return new ZodNativeEnum(__spreadValues({
3062
3222
  values,
@@ -3118,26 +3278,38 @@ var ZodEffects = class extends ZodType {
3118
3278
  checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
3119
3279
  if (effect.type === "preprocess") {
3120
3280
  const processed = effect.transform(ctx.data, checkCtx);
3121
- if (ctx.common.issues.length) {
3122
- return {
3123
- status: "dirty",
3124
- value: ctx.data
3125
- };
3126
- }
3127
3281
  if (ctx.common.async) {
3128
- return Promise.resolve(processed).then((processed2) => {
3129
- return this._def.schema._parseAsync({
3282
+ return Promise.resolve(processed).then(async (processed2) => {
3283
+ if (status.value === "aborted")
3284
+ return INVALID;
3285
+ const result = await this._def.schema._parseAsync({
3130
3286
  data: processed2,
3131
3287
  path: ctx.path,
3132
3288
  parent: ctx
3133
3289
  });
3290
+ if (result.status === "aborted")
3291
+ return INVALID;
3292
+ if (result.status === "dirty")
3293
+ return DIRTY(result.value);
3294
+ if (status.value === "dirty")
3295
+ return DIRTY(result.value);
3296
+ return result;
3134
3297
  });
3135
3298
  } else {
3136
- return this._def.schema._parseSync({
3299
+ if (status.value === "aborted")
3300
+ return INVALID;
3301
+ const result = this._def.schema._parseSync({
3137
3302
  data: processed,
3138
3303
  path: ctx.path,
3139
3304
  parent: ctx
3140
3305
  });
3306
+ if (result.status === "aborted")
3307
+ return INVALID;
3308
+ if (result.status === "dirty")
3309
+ return DIRTY(result.value);
3310
+ if (status.value === "dirty")
3311
+ return DIRTY(result.value);
3312
+ return result;
3141
3313
  }
3142
3314
  }
3143
3315
  if (effect.type === "refinement") {
@@ -3415,10 +3587,16 @@ var ZodPipeline = class _ZodPipeline extends ZodType {
3415
3587
  var ZodReadonly = class extends ZodType {
3416
3588
  _parse(input) {
3417
3589
  const result = this._def.innerType._parse(input);
3418
- if (isValid(result)) {
3419
- result.value = Object.freeze(result.value);
3420
- }
3421
- return result;
3590
+ const freeze = (data) => {
3591
+ if (isValid(data)) {
3592
+ data.value = Object.freeze(data.value);
3593
+ }
3594
+ return data;
3595
+ };
3596
+ return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
3597
+ }
3598
+ unwrap() {
3599
+ return this._def.innerType;
3422
3600
  }
3423
3601
  };
3424
3602
  ZodReadonly.create = (type, params) => {
@@ -3427,7 +3605,7 @@ ZodReadonly.create = (type, params) => {
3427
3605
  typeName: ZodFirstPartyTypeKind.ZodReadonly
3428
3606
  }, processCreateParams(params)));
3429
3607
  };
3430
- var custom = (check, params = {}, fatal) => {
3608
+ function custom(check, params = {}, fatal) {
3431
3609
  if (check)
3432
3610
  return ZodAny.create().superRefine((data, ctx) => {
3433
3611
  var _a, _b;
@@ -3439,7 +3617,7 @@ var custom = (check, params = {}, fatal) => {
3439
3617
  }
3440
3618
  });
3441
3619
  return ZodAny.create();
3442
- };
3620
+ }
3443
3621
  var late = {
3444
3622
  object: ZodObject.lazycreate
3445
3623
  };
@@ -3557,6 +3735,7 @@ var z = /* @__PURE__ */ Object.freeze({
3557
3735
  ZodParsedType,
3558
3736
  getParsedType,
3559
3737
  ZodType,
3738
+ datetimeRegex,
3560
3739
  ZodString,
3561
3740
  ZodNumber,
3562
3741
  ZodBigInt,
@@ -3649,21 +3828,13 @@ var z = /* @__PURE__ */ Object.freeze({
3649
3828
  });
3650
3829
 
3651
3830
  // src/zod/schemas.ts
3652
- var imageSchema = z.object({
3653
- text: z.string().optional(),
3654
- url: z.string(),
3655
- accessibilityDescription: z.string().optional()
3656
- });
3657
- var httpMethodSchema = z.union([
3658
- z.literal("GET"),
3659
- z.literal("POST"),
3660
- z.literal("PUT"),
3661
- z.literal("PATCH"),
3662
- z.literal("DELETE")
3831
+ var sizeSchema = z.union([
3832
+ z.literal("xs"),
3833
+ z.literal("sm"),
3834
+ z.literal("md"),
3835
+ z.literal("lg"),
3836
+ z.literal("xl")
3663
3837
  ]);
3664
- var iconNamedSchema = z.object({
3665
- name: z.string()
3666
- });
3667
3838
  var contextSchema = z.union([
3668
3839
  z.literal("positive"),
3669
3840
  z.literal("neutral"),
@@ -3674,18 +3845,114 @@ var contextSchema = z.union([
3674
3845
  z.literal("info"),
3675
3846
  z.literal("primary")
3676
3847
  ]);
3677
- var iconTextSchema = z.object({
3678
- text: z.string()
3679
- });
3680
- var sizeSchema = z.union([
3681
- z.literal("xs"),
3682
- z.literal("sm"),
3683
- z.literal("md"),
3684
- z.literal("lg"),
3685
- z.literal("xl")
3848
+ var columnsLayoutBiasSchema = z.union([
3849
+ z.literal("none"),
3850
+ z.literal("left"),
3851
+ z.literal("right")
3852
+ ]);
3853
+ var statusListLayoutStatusSchema = z.union([
3854
+ z.literal("not-done"),
3855
+ z.literal("pending"),
3856
+ z.literal("done")
3686
3857
  ]);
3687
3858
  var alignSchema = z.union([z.literal("left"), z.literal("center"), z.literal("right")]);
3688
- var iconSchema = z.union([iconNamedSchema, iconTextSchema]);
3859
+ var formLayoutSchemaReferenceSchema = z.object({
3860
+ $ref: z.string()
3861
+ });
3862
+ var modalLayoutTriggerSchema = z.object({
3863
+ title: z.string()
3864
+ });
3865
+ var httpMethodSchema = z.union([
3866
+ z.literal("GET"),
3867
+ z.literal("POST"),
3868
+ z.literal("PUT"),
3869
+ z.literal("PATCH"),
3870
+ z.literal("DELETE")
3871
+ ]);
3872
+ var dividerLayoutSchema = z.object({
3873
+ type: z.literal("divider"),
3874
+ control: z.string().optional(),
3875
+ margin: sizeSchema.optional()
3876
+ });
3877
+ var listLayoutStatusSchema = z.union([
3878
+ z.literal("warning"),
3879
+ z.literal("neutral"),
3880
+ z.literal("positive")
3881
+ ]);
3882
+ var headingLayoutSchema = z.object({
3883
+ type: z.literal("heading"),
3884
+ text: z.string(),
3885
+ size: sizeSchema.optional(),
3886
+ align: alignSchema.optional(),
3887
+ control: z.string().optional(),
3888
+ margin: sizeSchema.optional()
3889
+ });
3890
+ var alertLayoutSchema = z.object({
3891
+ type: z.literal("alert"),
3892
+ markdown: z.string(),
3893
+ context: contextSchema.optional(),
3894
+ control: z.string().optional(),
3895
+ margin: sizeSchema.optional()
3896
+ });
3897
+ var formLayoutSchema = z.object({
3898
+ type: z.literal("form"),
3899
+ schema: formLayoutSchemaReferenceSchema.optional(),
3900
+ schemaId: z.string(),
3901
+ control: z.string().optional(),
3902
+ margin: sizeSchema.optional()
3903
+ });
3904
+ var imageLayoutSchema = z.object({
3905
+ type: z.literal("image"),
3906
+ text: z.string().optional(),
3907
+ url: z.string(),
3908
+ size: sizeSchema.optional(),
3909
+ accessibilityDescription: z.string().optional(),
3910
+ control: z.string().optional(),
3911
+ margin: sizeSchema.optional()
3912
+ });
3913
+ var infoLayoutSchema = z.object({
3914
+ type: z.literal("info"),
3915
+ markdown: z.string(),
3916
+ align: alignSchema.optional(),
3917
+ control: z.string().optional(),
3918
+ margin: sizeSchema.optional()
3919
+ });
3920
+ var loadingIndicatorLayoutSchema = z.object({
3921
+ type: z.literal("loading-indicator"),
3922
+ size: sizeSchema.optional(),
3923
+ control: z.string().optional(),
3924
+ margin: sizeSchema.optional()
3925
+ });
3926
+ var paragraphLayoutSchema = z.object({
3927
+ type: z.literal("paragraph"),
3928
+ text: z.string(),
3929
+ align: alignSchema.optional(),
3930
+ control: z.string().optional(),
3931
+ margin: sizeSchema.optional()
3932
+ });
3933
+ var instructionsLayoutItemSchema = z.object({
3934
+ text: z.string(),
3935
+ context: contextSchema
3936
+ });
3937
+ var helpSchema = z.object({
3938
+ markdown: z.string()
3939
+ });
3940
+ var imageSchema = z.object({
3941
+ text: z.string().optional(),
3942
+ url: z.string(),
3943
+ accessibilityDescription: z.string().optional()
3944
+ });
3945
+ var summaryProviderSchema = z.object({
3946
+ providesTitle: z.boolean().optional(),
3947
+ providesDescription: z.boolean().optional(),
3948
+ providesIcon: z.boolean().optional(),
3949
+ providesImage: z.boolean().optional()
3950
+ });
3951
+ var validateAsyncSchema = z.object({
3952
+ param: z.string(),
3953
+ method: httpMethodSchema,
3954
+ url: z.string()
3955
+ });
3689
3956
  var autocompleteTokenSchema = z.union([
3690
3957
  z.literal("on"),
3691
3958
  z.literal("name"),
@@ -3751,113 +4018,14 @@ var autocompleteTokenSchema = z.union([
3751
4018
  z.literal("fax"),
3752
4019
  z.literal("pager")
3753
4020
  ]);
3754
- var loadingIndicatorLayoutSchema = z.object({
3755
- type: z.literal("loading-indicator"),
3756
- size: sizeSchema.optional(),
3757
- control: z.string().optional(),
3758
- margin: sizeSchema.optional()
3759
- });
3760
- var alertLayoutSchema = z.object({
3761
- type: z.literal("alert"),
3762
- markdown: z.string(),
3763
- context: contextSchema.optional(),
3764
- control: z.string().optional(),
3765
- margin: sizeSchema.optional()
3766
- });
3767
- var paragraphLayoutSchema = z.object({
3768
- type: z.literal("paragraph"),
3769
- text: z.string(),
3770
- align: alignSchema.optional(),
3771
- control: z.string().optional(),
3772
- margin: sizeSchema.optional()
3773
- });
3774
- var dividerLayoutSchema = z.object({
3775
- type: z.literal("divider"),
3776
- control: z.string().optional(),
3777
- margin: sizeSchema.optional()
3778
- });
3779
- var listLayoutStatusSchema = z.union([
3780
- z.literal("warning"),
3781
- z.literal("neutral"),
3782
- z.literal("positive")
3783
- ]);
3784
- var formLayoutSchemaReferenceSchema = z.object({
3785
- $ref: z.string()
3786
- });
3787
- var imageLayoutSchema = z.object({
3788
- type: z.literal("image"),
3789
- text: z.string().optional(),
3790
- url: z.string(),
3791
- size: sizeSchema.optional(),
3792
- accessibilityDescription: z.string().optional(),
3793
- control: z.string().optional(),
3794
- margin: sizeSchema.optional()
3795
- });
3796
- var statusListLayoutStatusSchema = z.union([
3797
- z.literal("not-done"),
3798
- z.literal("pending"),
3799
- z.literal("done")
3800
- ]);
3801
- var instructionsLayoutItemSchema = z.object({
3802
- text: z.string(),
3803
- context: contextSchema
3804
- });
3805
- var modalLayoutTriggerSchema = z.object({
3806
- title: z.string()
3807
- });
3808
- var searchLayoutSchema = z.object({
3809
- type: z.literal("search"),
3810
- title: z.string(),
3811
- method: httpMethodSchema,
3812
- url: z.string(),
3813
- param: z.string(),
3814
- emptyMessage: z.string().optional(),
3815
- control: z.string().optional(),
3816
- margin: sizeSchema.optional()
3817
- });
3818
- var infoLayoutSchema = z.object({
3819
- type: z.literal("info"),
3820
- markdown: z.string(),
3821
- align: alignSchema.optional(),
3822
- control: z.string().optional(),
3823
- margin: sizeSchema.optional()
3824
- });
3825
- var formLayoutSchema = z.object({
3826
- type: z.literal("form"),
3827
- schema: formLayoutSchemaReferenceSchema.optional(),
3828
- schemaId: z.string(),
3829
- control: z.string().optional(),
3830
- margin: sizeSchema.optional()
3831
- });
3832
- var headingLayoutSchema = z.object({
3833
- type: z.literal("heading"),
3834
- text: z.string(),
3835
- size: sizeSchema.optional(),
3836
- align: alignSchema.optional(),
3837
- control: z.string().optional(),
3838
- margin: sizeSchema.optional()
3839
- });
3840
- var markdownLayoutSchema = z.object({
3841
- type: z.literal("markdown"),
3842
- content: z.string(),
3843
- align: alignSchema.optional(),
3844
- control: z.string().optional(),
3845
- margin: sizeSchema.optional()
3846
- });
3847
- var columnsLayoutBiasSchema = z.union([
3848
- z.literal("none"),
3849
- z.literal("left"),
3850
- z.literal("right")
4021
+ var stringSchemaFormatSchema = z.union([
4022
+ z.literal("date"),
4023
+ z.literal("email"),
4024
+ z.literal("numeric"),
4025
+ z.literal("password"),
4026
+ z.literal("phone-number"),
4027
+ z.literal("base64url")
3851
4028
  ]);
3852
- var helpSchema = z.object({
3853
- markdown: z.string()
3854
- });
3855
- var searchSearchRequestSchema = z.object({
3856
- url: z.string(),
3857
- method: httpMethodSchema,
3858
- param: z.string(),
3859
- query: z.string()
3860
- });
3861
4029
  var jsonElementSchema = z.lazy(
3862
4030
  () => z.union([
3863
4031
  z.string(),
@@ -3867,6 +4035,7 @@ var jsonElementSchema = z.lazy(
3867
4035
  z.array(jsonElementSchema)
3868
4036
  ]).nullable()
3869
4037
  );
4038
+ var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
3870
4039
  var externalSchema = z.object({
3871
4040
  url: z.string()
3872
4041
  });
@@ -3874,36 +4043,19 @@ var stepErrorSchema = z.object({
3874
4043
  error: z.string().optional(),
3875
4044
  validation: jsonElementSchema.optional()
3876
4045
  });
3877
- var stringSchemaFormatSchema = z.union([
3878
- z.literal("date"),
3879
- z.literal("email"),
3880
- z.literal("numeric"),
3881
- z.literal("password"),
3882
- z.literal("phone-number"),
3883
- z.literal("base64url")
3884
- ]);
3885
- var summarySummariserSchema = z.object({
3886
- defaultTitle: z.string().optional(),
3887
- defaultDescription: z.string().optional(),
3888
- defaultIcon: iconSchema.optional(),
3889
- defaultImage: imageLayoutSchema.optional(),
3890
- providesTitle: z.boolean().optional(),
3891
- providesDescription: z.boolean().optional(),
3892
- providesIcon: z.boolean().optional(),
3893
- providesImage: z.boolean().optional()
4046
+ var errorResponseBodySchema = z.object({
4047
+ refreshFormUrl: z.string().optional(),
4048
+ analytics: z.record(z.string()).optional(),
4049
+ error: z.string().optional(),
4050
+ validation: jsonElementSchema.optional(),
4051
+ refreshUrl: z.string().optional()
3894
4052
  });
3895
- var validateAsyncSchema = z.object({
3896
- param: z.string(),
4053
+ var searchSearchRequestSchema = z.object({
4054
+ url: z.string(),
3897
4055
  method: httpMethodSchema,
3898
- url: z.string()
3899
- });
3900
- var summaryProviderSchema = z.object({
3901
- providesTitle: z.boolean().optional(),
3902
- providesDescription: z.boolean().optional(),
3903
- providesIcon: z.boolean().optional(),
3904
- providesImage: z.boolean().optional()
4056
+ param: z.string(),
4057
+ query: z.string()
3905
4058
  });
3906
- var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
3907
4059
  var navigationStackBehaviorSchema = z.union([
3908
4060
  z.literal("default"),
3909
4061
  z.literal("remove-previous"),
@@ -3917,7 +4069,12 @@ var actionTypeSchema = z.union([
3917
4069
  z.literal("positive"),
3918
4070
  z.literal("negative")
3919
4071
  ]);
3920
- var summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
4072
+ var iconNamedSchema = z.object({
4073
+ name: z.string()
4074
+ });
4075
+ var iconTextSchema = z.object({
4076
+ text: z.string()
4077
+ });
3921
4078
  var actionSchema = z.object({
3922
4079
  title: z.string().optional(),
3923
4080
  type: actionTypeSchema.optional(),
@@ -3933,25 +4090,26 @@ var actionSchema = z.object({
3933
4090
  timeout: z.number().optional(),
3934
4091
  skipValidation: z.boolean().optional()
3935
4092
  });
3936
- var listLayoutItemSchema = z.object({
3937
- title: z.string(),
3938
- description: z.string().optional(),
3939
- icon: iconSchema,
3940
- status: listLayoutStatusSchema.optional()
4093
+ var markdownLayoutSchema = z.object({
4094
+ type: z.literal("markdown"),
4095
+ content: z.string(),
4096
+ align: alignSchema.optional(),
4097
+ control: z.string().optional(),
4098
+ margin: sizeSchema.optional()
3941
4099
  });
3942
- var decisionLayoutOptionSchema = z.object({
3943
- action: actionSchema,
4100
+ var searchLayoutSchema = z.object({
4101
+ type: z.literal("search"),
3944
4102
  title: z.string(),
3945
- description: z.string().optional(),
3946
- disabled: z.boolean().optional(),
3947
- icon: iconSchema.optional(),
3948
- image: imageLayoutSchema.optional()
4103
+ method: httpMethodSchema,
4104
+ url: z.string(),
4105
+ param: z.string(),
4106
+ emptyMessage: z.string().optional(),
4107
+ control: z.string().optional(),
4108
+ margin: sizeSchema.optional()
3949
4109
  });
3950
- var statusListLayoutItemSchema = z.object({
4110
+ var reviewLayoutCallToActionSchema = z.object({
3951
4111
  title: z.string(),
3952
- description: z.string().optional(),
3953
- icon: iconSchema,
3954
- status: statusListLayoutStatusSchema.optional()
4112
+ action: actionSchema
3955
4113
  });
3956
4114
  var instructionsLayoutSchema = z.object({
3957
4115
  type: z.literal("instructions"),
@@ -3960,51 +4118,17 @@ var instructionsLayoutSchema = z.object({
3960
4118
  control: z.string().optional(),
3961
4119
  margin: sizeSchema.optional()
3962
4120
  });
3963
- var buttonLayoutSchema = z.object({
3964
- type: z.literal("button"),
3965
- size: sizeSchema.optional(),
3966
- title: z.string().optional(),
3967
- action: actionSchema,
3968
- context: contextSchema.optional(),
3969
- disabled: z.boolean().optional(),
3970
- pinOrder: z.number().optional(),
3971
- control: z.string().optional(),
3972
- margin: sizeSchema.optional()
3973
- });
4121
+ var iconSchema = z.union([iconNamedSchema, iconTextSchema]);
3974
4122
  var reviewLayoutFieldSchema = z.object({
3975
4123
  label: z.string(),
3976
4124
  value: z.string(),
3977
4125
  help: helpSchema.optional()
3978
4126
  });
3979
- var searchResultSearchSchema = z.object({
3980
- type: z.literal("search"),
3981
- title: z.string(),
3982
- description: z.string().optional(),
3983
- icon: iconSchema.optional(),
3984
- image: imageLayoutSchema.optional(),
3985
- value: searchSearchRequestSchema
3986
- });
3987
- var searchResultActionSchema = z.object({
3988
- type: z.literal("action"),
4127
+ var statusListLayoutItemSchema = z.object({
3989
4128
  title: z.string(),
3990
4129
  description: z.string().optional(),
3991
- icon: iconSchema.optional(),
3992
- image: imageLayoutSchema.optional(),
3993
- value: actionSchema
3994
- });
3995
- var actionResponseBodySchema = z.object({
3996
- action: actionSchema
3997
- });
3998
- var errorResponseBodySchema = z.object({
3999
- refreshFormUrl: z.string().optional(),
4000
- analytics: z.record(z.string()).optional(),
4001
- error: z.string().optional(),
4002
- validation: jsonElementSchema.optional(),
4003
- refreshUrl: z.string().optional()
4004
- });
4005
- var linkHandlerSchema = z.object({
4006
- regexPattern: z.string(),
4007
- action: actionSchema
4130
+ icon: iconSchema,
4131
+ status: statusListLayoutStatusSchema.optional()
4008
4132
  });
4009
4133
  var blobSchemaSchema = z.object({
4010
4134
  type: z.literal("blob"),
@@ -4044,37 +4168,66 @@ var constSchemaSchema = z.object({
4044
4168
  analyticsId: z.string().optional(),
4045
4169
  disabled: z.boolean().optional()
4046
4170
  });
4047
- var pollingOnErrorSchema = z.object({
4171
+ var summarySummariserSchema = z.object({
4172
+ defaultTitle: z.string().optional(),
4173
+ defaultDescription: z.string().optional(),
4174
+ defaultIcon: iconSchema.optional(),
4175
+ defaultImage: imageLayoutSchema.optional(),
4176
+ providesTitle: z.boolean().optional(),
4177
+ providesDescription: z.boolean().optional(),
4178
+ providesIcon: z.boolean().optional(),
4179
+ providesImage: z.boolean().optional()
4180
+ });
4181
+ var linkHandlerSchema = z.object({
4182
+ regexPattern: z.string(),
4048
4183
  action: actionSchema
4049
4184
  });
4050
- var navigationBackBehaviourSchema = z.object({
4051
- title: z.string().optional(),
4185
+ var actionResponseBodySchema = z.object({
4052
4186
  action: actionSchema
4053
4187
  });
4054
- var reviewLayoutCallToActionSchema = z.object({
4188
+ var searchResultSearchSchema = z.object({
4189
+ type: z.literal("search"),
4055
4190
  title: z.string(),
4191
+ description: z.string().optional(),
4192
+ icon: iconSchema.optional(),
4193
+ image: imageLayoutSchema.optional(),
4194
+ value: searchSearchRequestSchema
4195
+ });
4196
+ var searchResultActionSchema = z.object({
4197
+ type: z.literal("action"),
4198
+ title: z.string(),
4199
+ description: z.string().optional(),
4200
+ icon: iconSchema.optional(),
4201
+ image: imageLayoutSchema.optional(),
4202
+ value: actionSchema
4203
+ });
4204
+ var pollingOnErrorSchema = z.object({
4056
4205
  action: actionSchema
4057
4206
  });
4058
- var listLayoutSchema = z.object({
4059
- type: z.literal("list"),
4060
- items: z.array(listLayoutItemSchema),
4207
+ var navigationBackBehaviourSchema = z.object({
4061
4208
  title: z.string().optional(),
4062
- control: z.string().optional(),
4063
- margin: sizeSchema.optional()
4064
- });
4065
- var decisionLayoutSchema = z.object({
4066
- type: z.literal("decision"),
4067
- options: z.array(decisionLayoutOptionSchema),
4068
- control: z.string().optional(),
4069
- margin: sizeSchema.optional()
4209
+ action: actionSchema
4070
4210
  });
4071
- var statusListLayoutSchema = z.object({
4072
- type: z.literal("status-list"),
4073
- items: z.array(statusListLayoutItemSchema),
4211
+ var summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
4212
+ var buttonLayoutSchema = z.object({
4213
+ type: z.literal("button"),
4214
+ size: sizeSchema.optional(),
4074
4215
  title: z.string().optional(),
4216
+ action: actionSchema,
4217
+ context: contextSchema.optional(),
4218
+ disabled: z.boolean().optional(),
4219
+ pinOrder: z.number().optional(),
4075
4220
  control: z.string().optional(),
4076
4221
  margin: sizeSchema.optional()
4077
4222
  });
4223
+ var decisionLayoutOptionSchema = z.object({
4224
+ action: actionSchema,
4225
+ title: z.string(),
4226
+ description: z.string().optional(),
4227
+ disabled: z.boolean().optional(),
4228
+ icon: iconSchema.optional(),
4229
+ image: imageLayoutSchema.optional()
4230
+ });
4078
4231
  var reviewLayoutSchema = z.object({
4079
4232
  type: z.literal("review"),
4080
4233
  orientation: z.string().optional(),
@@ -4085,7 +4238,19 @@ var reviewLayoutSchema = z.object({
4085
4238
  control: z.string().optional(),
4086
4239
  margin: sizeSchema.optional()
4087
4240
  });
4088
- var searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
4241
+ var statusListLayoutSchema = z.object({
4242
+ type: z.literal("status-list"),
4243
+ items: z.array(statusListLayoutItemSchema),
4244
+ title: z.string().optional(),
4245
+ control: z.string().optional(),
4246
+ margin: sizeSchema.optional()
4247
+ });
4248
+ var listLayoutItemSchema = z.object({
4249
+ title: z.string(),
4250
+ description: z.string().optional(),
4251
+ icon: iconSchema,
4252
+ status: listLayoutStatusSchema.optional()
4253
+ });
4089
4254
  var pollingSchema = z.object({
4090
4255
  url: z.string(),
4091
4256
  interval: z.number(),
@@ -4097,9 +4262,33 @@ var navigationSchema = z.object({
4097
4262
  back: navigationBackBehaviourSchema.optional(),
4098
4263
  stackBehavior: navigationStackBehaviorSchema.optional()
4099
4264
  });
4265
+ var searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
4266
+ var decisionLayoutSchema = z.object({
4267
+ type: z.literal("decision"),
4268
+ options: z.array(decisionLayoutOptionSchema),
4269
+ control: z.string().optional(),
4270
+ margin: sizeSchema.optional()
4271
+ });
4272
+ var listLayoutSchema = z.object({
4273
+ type: z.literal("list"),
4274
+ items: z.array(listLayoutItemSchema),
4275
+ title: z.string().optional(),
4276
+ control: z.string().optional(),
4277
+ margin: sizeSchema.optional()
4278
+ });
4100
4279
  var searchResponseBodySchema = z.object({
4101
4280
  results: z.array(searchResultSchema)
4102
4281
  });
4282
+ var columnsLayoutSchema = z.lazy(
4283
+ () => z.object({
4284
+ type: z.literal("columns"),
4285
+ left: z.array(layoutSchema),
4286
+ right: z.array(layoutSchema),
4287
+ bias: columnsLayoutBiasSchema.optional(),
4288
+ control: z.string().optional(),
4289
+ margin: sizeSchema.optional()
4290
+ })
4291
+ );
4103
4292
  var layoutSchema = z.lazy(
4104
4293
  () => z.union([
4105
4294
  alertLayoutSchema,
@@ -4123,26 +4312,6 @@ var layoutSchema = z.lazy(
4123
4312
  statusListLayoutSchema
4124
4313
  ])
4125
4314
  );
4126
- var boxLayoutSchema = z.lazy(
4127
- () => z.object({
4128
- type: z.literal("box"),
4129
- components: z.array(layoutSchema),
4130
- width: sizeSchema.optional(),
4131
- border: z.boolean().optional(),
4132
- control: z.string().optional(),
4133
- margin: sizeSchema.optional()
4134
- })
4135
- );
4136
- var columnsLayoutSchema = z.lazy(
4137
- () => z.object({
4138
- type: z.literal("columns"),
4139
- left: z.array(layoutSchema),
4140
- right: z.array(layoutSchema),
4141
- bias: columnsLayoutBiasSchema.optional(),
4142
- control: z.string().optional(),
4143
- margin: sizeSchema.optional()
4144
- })
4145
- );
4146
4315
  var modalLayoutSchema = z.lazy(
4147
4316
  () => z.object({
4148
4317
  type: z.literal("modal"),
@@ -4157,25 +4326,14 @@ var modalLayoutContentSchema = z.lazy(
4157
4326
  components: z.array(layoutSchema)
4158
4327
  })
4159
4328
  );
4160
- var stepSchema = z.lazy(
4329
+ var boxLayoutSchema = z.lazy(
4161
4330
  () => z.object({
4162
- key: z.string().optional(),
4163
- type: z.string().optional(),
4164
- description: z.string().optional(),
4165
- actions: z.array(actionSchema).optional(),
4166
- refreshFormUrl: z.string().optional(),
4167
- id: z.string(),
4168
- title: z.string(),
4169
- schemas: z.array(schemaSchema),
4170
- layout: z.array(layoutSchema),
4171
- model: jsonElementSchema.optional(),
4172
- external: externalSchema.optional(),
4173
- polling: pollingSchema.optional(),
4174
- linkHandlers: z.array(linkHandlerSchema).optional(),
4175
- analytics: z.record(z.string()).optional(),
4176
- errors: stepErrorSchema.optional(),
4177
- navigation: navigationSchema.optional(),
4178
- refreshUrl: z.string().optional()
4331
+ type: z.literal("box"),
4332
+ components: z.array(layoutSchema),
4333
+ width: sizeSchema.optional(),
4334
+ border: z.boolean().optional(),
4335
+ control: z.string().optional(),
4336
+ margin: sizeSchema.optional()
4179
4337
  })
4180
4338
  );
4181
4339
  var schemaSchema = z.lazy(
@@ -4401,17 +4559,21 @@ var stringSchemaSchema = z.lazy(
4401
4559
  help: helpSchema.optional()
4402
4560
  })
4403
4561
  );
4404
- var arraySchemaListSchema = z.lazy(
4562
+ var persistAsyncSchema = z.lazy(
4563
+ () => z.object({
4564
+ param: z.string(),
4565
+ idProperty: z.string(),
4566
+ schema: schemaSchema,
4567
+ url: z.string(),
4568
+ method: httpMethodSchema
4569
+ })
4570
+ );
4571
+ var arraySchemaTupleSchema = z.lazy(
4405
4572
  () => z.object({
4406
4573
  type: z.literal("array"),
4407
4574
  promoted: z.boolean().optional(),
4408
4575
  $id: z.string().optional(),
4409
- items: schemaSchema,
4410
- addItemTitle: z.string(),
4411
- editItemTitle: z.string(),
4412
- minItems: z.number().optional(),
4413
- maxItems: z.number().optional(),
4414
- placeholder: z.string().optional(),
4576
+ items: z.array(schemaSchema),
4415
4577
  title: z.string().optional(),
4416
4578
  description: z.string().optional(),
4417
4579
  control: z.string().optional(),
@@ -4419,30 +4581,24 @@ var arraySchemaListSchema = z.lazy(
4419
4581
  icon: iconSchema.optional(),
4420
4582
  image: imageSchema.optional(),
4421
4583
  keywords: z.array(z.string()).optional(),
4422
- summary: summarySummariserSchema.optional(),
4584
+ summary: summaryProviderSchema.optional(),
4423
4585
  analyticsId: z.string().optional(),
4424
4586
  persistAsync: persistAsyncSchema.optional(),
4425
4587
  validationAsync: validateAsyncSchema.optional(),
4426
- alert: alertLayoutSchema.optional(),
4427
- validationMessages: z.record(z.string()).optional(),
4428
- disabled: z.boolean().optional()
4429
- })
4430
- );
4431
- var persistAsyncSchema = z.lazy(
4432
- () => z.object({
4433
- param: z.string(),
4434
- idProperty: z.string(),
4435
- schema: schemaSchema,
4436
- url: z.string(),
4437
- method: httpMethodSchema
4588
+ alert: alertLayoutSchema.optional()
4438
4589
  })
4439
4590
  );
4440
- var arraySchemaTupleSchema = z.lazy(
4591
+ var arraySchemaListSchema = z.lazy(
4441
4592
  () => z.object({
4442
4593
  type: z.literal("array"),
4443
4594
  promoted: z.boolean().optional(),
4444
4595
  $id: z.string().optional(),
4445
- items: z.array(schemaSchema),
4596
+ items: schemaSchema,
4597
+ addItemTitle: z.string(),
4598
+ editItemTitle: z.string(),
4599
+ minItems: z.number().optional(),
4600
+ maxItems: z.number().optional(),
4601
+ placeholder: z.string().optional(),
4446
4602
  title: z.string().optional(),
4447
4603
  description: z.string().optional(),
4448
4604
  control: z.string().optional(),
@@ -4450,11 +4606,34 @@ var arraySchemaTupleSchema = z.lazy(
4450
4606
  icon: iconSchema.optional(),
4451
4607
  image: imageSchema.optional(),
4452
4608
  keywords: z.array(z.string()).optional(),
4453
- summary: summaryProviderSchema.optional(),
4609
+ summary: summarySummariserSchema.optional(),
4454
4610
  analyticsId: z.string().optional(),
4455
4611
  persistAsync: persistAsyncSchema.optional(),
4456
4612
  validationAsync: validateAsyncSchema.optional(),
4457
- alert: alertLayoutSchema.optional()
4613
+ alert: alertLayoutSchema.optional(),
4614
+ validationMessages: z.record(z.string()).optional(),
4615
+ disabled: z.boolean().optional()
4616
+ })
4617
+ );
4618
+ var stepSchema = z.lazy(
4619
+ () => z.object({
4620
+ key: z.string().optional(),
4621
+ type: z.string().optional(),
4622
+ actions: z.array(actionSchema).optional(),
4623
+ refreshFormUrl: z.string().optional(),
4624
+ id: z.string(),
4625
+ title: z.string(),
4626
+ description: z.string().optional(),
4627
+ schemas: z.array(schemaSchema),
4628
+ layout: z.array(layoutSchema),
4629
+ model: jsonElementSchema.optional(),
4630
+ external: externalSchema.optional(),
4631
+ polling: pollingSchema.optional(),
4632
+ linkHandlers: z.array(linkHandlerSchema).optional(),
4633
+ analytics: z.record(z.string()).optional(),
4634
+ errors: stepErrorSchema.optional(),
4635
+ navigation: navigationSchema.optional(),
4636
+ refreshUrl: z.string().optional()
4458
4637
  })
4459
4638
  );
4460
4639