@learncard/network-brain-client 2.2.34 → 2.3.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.
@@ -80,7 +80,7 @@ var require_helpers_cjs_development = __commonJS({
80
80
  }
81
81
  return to;
82
82
  }, "__copyProps");
83
- var __toCommonJS22 = /* @__PURE__ */ __name2((mod2) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod2), "__toCommonJS");
83
+ var __toCommonJS22 = /* @__PURE__ */ __name2((mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod), "__toCommonJS");
84
84
  var src_exports22 = {};
85
85
  __export22(src_exports22, {
86
86
  AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX: () => AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX,
@@ -270,6 +270,15 @@ var require_helpers_cjs_development = __commonJS({
270
270
  return value;
271
271
  };
272
272
  })(util || (util = {}));
273
+ var objectUtil;
274
+ (function(objectUtil2) {
275
+ objectUtil2.mergeShapes = (first, second) => {
276
+ return {
277
+ ...first,
278
+ ...second
279
+ };
280
+ };
281
+ })(objectUtil || (objectUtil = {}));
273
282
  var ZodParsedType = util.arrayToEnum([
274
283
  "string",
275
284
  "nan",
@@ -413,6 +422,11 @@ var require_helpers_cjs_development = __commonJS({
413
422
  processError(this);
414
423
  return fieldErrors;
415
424
  }
425
+ static assert(value) {
426
+ if (!(value instanceof ZodError)) {
427
+ throw new Error(`Not a ZodError: ${value}`);
428
+ }
429
+ }
416
430
  toString() {
417
431
  return this.message;
418
432
  }
@@ -480,7 +494,12 @@ var require_helpers_cjs_development = __commonJS({
480
494
  break;
481
495
  case ZodIssueCode.invalid_string:
482
496
  if (typeof issue.validation === "object") {
483
- if ("startsWith" in issue.validation) {
497
+ if ("includes" in issue.validation) {
498
+ message = `Invalid input: must include "${issue.validation.includes}"`;
499
+ if (typeof issue.validation.position === "number") {
500
+ message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
501
+ }
502
+ } else if ("startsWith" in issue.validation) {
484
503
  message = `Invalid input: must start with "${issue.validation.startsWith}"`;
485
504
  } else if ("endsWith" in issue.validation) {
486
505
  message = `Invalid input: must end with "${issue.validation.endsWith}"`;
@@ -501,7 +520,7 @@ var require_helpers_cjs_development = __commonJS({
501
520
  else if (issue.type === "number")
502
521
  message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
503
522
  else if (issue.type === "date")
504
- message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(issue.minimum)}`;
523
+ message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
505
524
  else
506
525
  message = "Invalid input";
507
526
  break;
@@ -512,8 +531,10 @@ var require_helpers_cjs_development = __commonJS({
512
531
  message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
513
532
  else if (issue.type === "number")
514
533
  message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
534
+ else if (issue.type === "bigint")
535
+ message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
515
536
  else if (issue.type === "date")
516
- message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(issue.maximum)}`;
537
+ message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
517
538
  else
518
539
  message = "Invalid input";
519
540
  break;
@@ -555,6 +576,13 @@ var require_helpers_cjs_development = __commonJS({
555
576
  ...issueData,
556
577
  path: fullPath
557
578
  };
579
+ if (issueData.message !== void 0) {
580
+ return {
581
+ ...issueData,
582
+ path: fullPath,
583
+ message: issueData.message
584
+ };
585
+ }
558
586
  let errorMessage = "";
559
587
  const maps = errorMaps.filter((m) => !!m).slice().reverse();
560
588
  for (const map of maps) {
@@ -563,11 +591,12 @@ var require_helpers_cjs_development = __commonJS({
563
591
  return {
564
592
  ...issueData,
565
593
  path: fullPath,
566
- message: issueData.message || errorMessage
594
+ message: errorMessage
567
595
  };
568
596
  }, "makeIssue");
569
597
  var EMPTY_PATH = [];
570
598
  function addIssueToContext(ctx, issueData) {
599
+ const overrideMap = getErrorMap();
571
600
  const issue = makeIssue({
572
601
  issueData,
573
602
  data: ctx.data,
@@ -575,8 +604,8 @@ var require_helpers_cjs_development = __commonJS({
575
604
  errorMaps: [
576
605
  ctx.common.contextualErrorMap,
577
606
  ctx.schemaErrorMap,
578
- getErrorMap(),
579
- errorMap
607
+ overrideMap,
608
+ overrideMap === errorMap ? void 0 : errorMap
580
609
  ].filter((x) => !!x)
581
610
  });
582
611
  ctx.common.issues.push(issue);
@@ -610,9 +639,11 @@ var require_helpers_cjs_development = __commonJS({
610
639
  static async mergeObjectAsync(status, pairs) {
611
640
  const syncPairs = [];
612
641
  for (const pair of pairs) {
642
+ const key = await pair.key;
643
+ const value = await pair.value;
613
644
  syncPairs.push({
614
- key: await pair.key,
615
- value: await pair.value
645
+ key,
646
+ value
616
647
  });
617
648
  }
618
649
  return ParseStatus.mergeObjectSync(status, syncPairs);
@@ -629,7 +660,7 @@ var require_helpers_cjs_development = __commonJS({
629
660
  status.dirty();
630
661
  if (value.status === "dirty")
631
662
  status.dirty();
632
- if (typeof value.value !== "undefined" || pair.alwaysSet) {
663
+ if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
633
664
  finalObject[key.value] = value.value;
634
665
  }
635
666
  }
@@ -645,21 +676,53 @@ var require_helpers_cjs_development = __commonJS({
645
676
  var isAborted = /* @__PURE__ */ __name22((x) => x.status === "aborted", "isAborted");
646
677
  var isDirty = /* @__PURE__ */ __name22((x) => x.status === "dirty", "isDirty");
647
678
  var isValid = /* @__PURE__ */ __name22((x) => x.status === "valid", "isValid");
648
- var isAsync = /* @__PURE__ */ __name22((x) => typeof Promise !== void 0 && x instanceof Promise, "isAsync");
679
+ var isAsync = /* @__PURE__ */ __name22((x) => typeof Promise !== "undefined" && x instanceof Promise, "isAsync");
680
+ function __classPrivateFieldGet(receiver, state, kind, f) {
681
+ if (kind === "a" && !f)
682
+ throw new TypeError("Private accessor was defined without a getter");
683
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
684
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
685
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
686
+ }
687
+ __name(__classPrivateFieldGet, "__classPrivateFieldGet");
688
+ __name2(__classPrivateFieldGet, "__classPrivateFieldGet");
689
+ __name22(__classPrivateFieldGet, "__classPrivateFieldGet");
690
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
691
+ if (kind === "m")
692
+ throw new TypeError("Private method is not writable");
693
+ if (kind === "a" && !f)
694
+ throw new TypeError("Private accessor was defined without a setter");
695
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
696
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
697
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
698
+ }
699
+ __name(__classPrivateFieldSet, "__classPrivateFieldSet");
700
+ __name2(__classPrivateFieldSet, "__classPrivateFieldSet");
701
+ __name22(__classPrivateFieldSet, "__classPrivateFieldSet");
649
702
  var errorUtil;
650
703
  (function(errorUtil2) {
651
704
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
652
705
  errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
653
706
  })(errorUtil || (errorUtil = {}));
707
+ var _ZodEnum_cache;
708
+ var _ZodNativeEnum_cache;
654
709
  var ParseInputLazyPath = /* @__PURE__ */ __name2(class {
655
710
  constructor(parent, value, path, key) {
711
+ this._cachedPath = [];
656
712
  this.parent = parent;
657
713
  this.data = value;
658
714
  this._path = path;
659
715
  this._key = key;
660
716
  }
661
717
  get path() {
662
- return this._path.concat(this._key);
718
+ if (!this._cachedPath.length) {
719
+ if (this._key instanceof Array) {
720
+ this._cachedPath.push(...this._path, ...this._key);
721
+ } else {
722
+ this._cachedPath.push(...this._path, this._key);
723
+ }
724
+ }
725
+ return this._cachedPath;
663
726
  }
664
727
  }, "ParseInputLazyPath");
665
728
  __name22(ParseInputLazyPath, "ParseInputLazyPath");
@@ -670,8 +733,16 @@ var require_helpers_cjs_development = __commonJS({
670
733
  if (!ctx.common.issues.length) {
671
734
  throw new Error("Validation failed but no issues detected.");
672
735
  }
673
- const error = new ZodError(ctx.common.issues);
674
- return { success: false, error };
736
+ return {
737
+ success: false,
738
+ get error() {
739
+ if (this._error)
740
+ return this._error;
741
+ const error = new ZodError(ctx.common.issues);
742
+ this._error = error;
743
+ return this._error;
744
+ }
745
+ };
675
746
  }
676
747
  }, "handleResult");
677
748
  function processCreateParams(params) {
@@ -684,12 +755,17 @@ var require_helpers_cjs_development = __commonJS({
684
755
  if (errorMap2)
685
756
  return { errorMap: errorMap2, description };
686
757
  const customMap = /* @__PURE__ */ __name22((iss, ctx) => {
687
- if (iss.code !== "invalid_type")
688
- return { message: ctx.defaultError };
758
+ var _a, _b;
759
+ const { message } = params;
760
+ if (iss.code === "invalid_enum_value") {
761
+ return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
762
+ }
689
763
  if (typeof ctx.data === "undefined") {
690
- return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError };
764
+ return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
691
765
  }
692
- return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError };
766
+ if (iss.code !== "invalid_type")
767
+ return { message: ctx.defaultError };
768
+ return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
693
769
  }, "customMap");
694
770
  return { errorMap: customMap, description };
695
771
  }
@@ -721,6 +797,7 @@ var require_helpers_cjs_development = __commonJS({
721
797
  this.catch = this.catch.bind(this);
722
798
  this.describe = this.describe.bind(this);
723
799
  this.pipe = this.pipe.bind(this);
800
+ this.readonly = this.readonly.bind(this);
724
801
  this.isNullable = this.isNullable.bind(this);
725
802
  this.isOptional = this.isOptional.bind(this);
726
803
  }
@@ -865,28 +942,29 @@ var require_helpers_cjs_development = __commonJS({
865
942
  return this._refinement(refinement);
866
943
  }
867
944
  optional() {
868
- return ZodOptional.create(this);
945
+ return ZodOptional.create(this, this._def);
869
946
  }
870
947
  nullable() {
871
- return ZodNullable.create(this);
948
+ return ZodNullable.create(this, this._def);
872
949
  }
873
950
  nullish() {
874
- return this.optional().nullable();
951
+ return this.nullable().optional();
875
952
  }
876
953
  array() {
877
- return ZodArray.create(this);
954
+ return ZodArray.create(this, this._def);
878
955
  }
879
956
  promise() {
880
- return ZodPromise.create(this);
957
+ return ZodPromise.create(this, this._def);
881
958
  }
882
959
  or(option) {
883
- return ZodUnion.create([this, option]);
960
+ return ZodUnion.create([this, option], this._def);
884
961
  }
885
962
  and(incoming) {
886
- return ZodIntersection.create(this, incoming);
963
+ return ZodIntersection.create(this, incoming, this._def);
887
964
  }
888
965
  transform(transform) {
889
966
  return new ZodEffects({
967
+ ...processCreateParams(this._def),
890
968
  schema: this,
891
969
  typeName: ZodFirstPartyTypeKind.ZodEffects,
892
970
  effect: { type: "transform", transform }
@@ -895,6 +973,7 @@ var require_helpers_cjs_development = __commonJS({
895
973
  default(def) {
896
974
  const defaultValueFunc = typeof def === "function" ? def : () => def;
897
975
  return new ZodDefault({
976
+ ...processCreateParams(this._def),
898
977
  innerType: this,
899
978
  defaultValue: defaultValueFunc,
900
979
  typeName: ZodFirstPartyTypeKind.ZodDefault
@@ -904,14 +983,15 @@ var require_helpers_cjs_development = __commonJS({
904
983
  return new ZodBranded({
905
984
  typeName: ZodFirstPartyTypeKind.ZodBranded,
906
985
  type: this,
907
- ...processCreateParams(void 0)
986
+ ...processCreateParams(this._def)
908
987
  });
909
988
  }
910
989
  catch(def) {
911
- const defaultValueFunc = typeof def === "function" ? def : () => def;
990
+ const catchValueFunc = typeof def === "function" ? def : () => def;
912
991
  return new ZodCatch({
992
+ ...processCreateParams(this._def),
913
993
  innerType: this,
914
- defaultValue: defaultValueFunc,
994
+ catchValue: catchValueFunc,
915
995
  typeName: ZodFirstPartyTypeKind.ZodCatch
916
996
  });
917
997
  }
@@ -925,6 +1005,9 @@ var require_helpers_cjs_development = __commonJS({
925
1005
  pipe(target) {
926
1006
  return ZodPipeline.create(this, target);
927
1007
  }
1008
+ readonly() {
1009
+ return ZodReadonly.create(this);
1010
+ }
928
1011
  isOptional() {
929
1012
  return this.safeParse(void 0).success;
930
1013
  }
@@ -934,43 +1017,62 @@ var require_helpers_cjs_development = __commonJS({
934
1017
  }, "ZodType");
935
1018
  __name22(ZodType, "ZodType");
936
1019
  var cuidRegex = /^c[^\s-]{8,}$/i;
937
- var uuidRegex = /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;
938
- var emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
939
- var datetimeRegex = /* @__PURE__ */ __name22((args) => {
1020
+ var cuid2Regex = /^[0-9a-z]+$/;
1021
+ var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
1022
+ 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;
1023
+ var nanoidRegex = /^[a-z0-9_-]{21}$/i;
1024
+ 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)?)??$/;
1025
+ var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
1026
+ var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
1027
+ var emojiRegex;
1028
+ 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])$/;
1029
+ 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})))$/;
1030
+ var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
1031
+ 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])))`;
1032
+ var dateRegex = new RegExp(`^${dateRegexSource}$`);
1033
+ function timeRegexSource(args) {
1034
+ let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
940
1035
  if (args.precision) {
941
- if (args.offset) {
942
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
943
- } else {
944
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
945
- }
946
- } else if (args.precision === 0) {
947
- if (args.offset) {
948
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
949
- } else {
950
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
951
- }
952
- } else {
953
- if (args.offset) {
954
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
955
- } else {
956
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
957
- }
1036
+ regex = `${regex}\\.\\d{${args.precision}}`;
1037
+ } else if (args.precision == null) {
1038
+ regex = `${regex}(\\.\\d+)?`;
958
1039
  }
959
- }, "datetimeRegex");
960
- var ZodString = /* @__PURE__ */ __name2(class extends ZodType {
961
- constructor() {
962
- super(...arguments);
963
- this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {
964
- validation,
965
- code: ZodIssueCode.invalid_string,
966
- ...errorUtil.errToObj(message)
967
- });
968
- this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));
969
- this.trim = () => new ZodString({
970
- ...this._def,
971
- checks: [...this._def.checks, { kind: "trim" }]
972
- });
1040
+ return regex;
1041
+ }
1042
+ __name(timeRegexSource, "timeRegexSource");
1043
+ __name2(timeRegexSource, "timeRegexSource");
1044
+ __name22(timeRegexSource, "timeRegexSource");
1045
+ function timeRegex(args) {
1046
+ return new RegExp(`^${timeRegexSource(args)}$`);
1047
+ }
1048
+ __name(timeRegex, "timeRegex");
1049
+ __name2(timeRegex, "timeRegex");
1050
+ __name22(timeRegex, "timeRegex");
1051
+ function datetimeRegex(args) {
1052
+ let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
1053
+ const opts = [];
1054
+ opts.push(args.local ? `Z?` : `Z`);
1055
+ if (args.offset)
1056
+ opts.push(`([+-]\\d{2}:?\\d{2})`);
1057
+ regex = `${regex}(${opts.join("|")})`;
1058
+ return new RegExp(`^${regex}$`);
1059
+ }
1060
+ __name(datetimeRegex, "datetimeRegex");
1061
+ __name2(datetimeRegex, "datetimeRegex");
1062
+ __name22(datetimeRegex, "datetimeRegex");
1063
+ function isValidIP(ip, version) {
1064
+ if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
1065
+ return true;
973
1066
  }
1067
+ if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
1068
+ return true;
1069
+ }
1070
+ return false;
1071
+ }
1072
+ __name(isValidIP, "isValidIP");
1073
+ __name2(isValidIP, "isValidIP");
1074
+ __name22(isValidIP, "isValidIP");
1075
+ var ZodString = /* @__PURE__ */ __name2(class extends ZodType {
974
1076
  _parse(input) {
975
1077
  if (this._def.coerce) {
976
1078
  input.data = String(input.data);
@@ -978,14 +1080,11 @@ var require_helpers_cjs_development = __commonJS({
978
1080
  const parsedType = this._getType(input);
979
1081
  if (parsedType !== ZodParsedType.string) {
980
1082
  const ctx2 = this._getOrReturnCtx(input);
981
- addIssueToContext(
982
- ctx2,
983
- {
984
- code: ZodIssueCode.invalid_type,
985
- expected: ZodParsedType.string,
986
- received: ctx2.parsedType
987
- }
988
- );
1083
+ addIssueToContext(ctx2, {
1084
+ code: ZodIssueCode.invalid_type,
1085
+ expected: ZodParsedType.string,
1086
+ received: ctx2.parsedType
1087
+ });
989
1088
  return INVALID;
990
1089
  }
991
1090
  const status = new ParseStatus();
@@ -1053,6 +1152,19 @@ var require_helpers_cjs_development = __commonJS({
1053
1152
  });
1054
1153
  status.dirty();
1055
1154
  }
1155
+ } else if (check.kind === "emoji") {
1156
+ if (!emojiRegex) {
1157
+ emojiRegex = new RegExp(_emojiRegex, "u");
1158
+ }
1159
+ if (!emojiRegex.test(input.data)) {
1160
+ ctx = this._getOrReturnCtx(input, ctx);
1161
+ addIssueToContext(ctx, {
1162
+ validation: "emoji",
1163
+ code: ZodIssueCode.invalid_string,
1164
+ message: check.message
1165
+ });
1166
+ status.dirty();
1167
+ }
1056
1168
  } else if (check.kind === "uuid") {
1057
1169
  if (!uuidRegex.test(input.data)) {
1058
1170
  ctx = this._getOrReturnCtx(input, ctx);
@@ -1063,6 +1175,16 @@ var require_helpers_cjs_development = __commonJS({
1063
1175
  });
1064
1176
  status.dirty();
1065
1177
  }
1178
+ } else if (check.kind === "nanoid") {
1179
+ if (!nanoidRegex.test(input.data)) {
1180
+ ctx = this._getOrReturnCtx(input, ctx);
1181
+ addIssueToContext(ctx, {
1182
+ validation: "nanoid",
1183
+ code: ZodIssueCode.invalid_string,
1184
+ message: check.message
1185
+ });
1186
+ status.dirty();
1187
+ }
1066
1188
  } else if (check.kind === "cuid") {
1067
1189
  if (!cuidRegex.test(input.data)) {
1068
1190
  ctx = this._getOrReturnCtx(input, ctx);
@@ -1073,6 +1195,26 @@ var require_helpers_cjs_development = __commonJS({
1073
1195
  });
1074
1196
  status.dirty();
1075
1197
  }
1198
+ } else if (check.kind === "cuid2") {
1199
+ if (!cuid2Regex.test(input.data)) {
1200
+ ctx = this._getOrReturnCtx(input, ctx);
1201
+ addIssueToContext(ctx, {
1202
+ validation: "cuid2",
1203
+ code: ZodIssueCode.invalid_string,
1204
+ message: check.message
1205
+ });
1206
+ status.dirty();
1207
+ }
1208
+ } else if (check.kind === "ulid") {
1209
+ if (!ulidRegex.test(input.data)) {
1210
+ ctx = this._getOrReturnCtx(input, ctx);
1211
+ addIssueToContext(ctx, {
1212
+ validation: "ulid",
1213
+ code: ZodIssueCode.invalid_string,
1214
+ message: check.message
1215
+ });
1216
+ status.dirty();
1217
+ }
1076
1218
  } else if (check.kind === "url") {
1077
1219
  try {
1078
1220
  new URL(input.data);
@@ -1099,6 +1241,20 @@ var require_helpers_cjs_development = __commonJS({
1099
1241
  }
1100
1242
  } else if (check.kind === "trim") {
1101
1243
  input.data = input.data.trim();
1244
+ } else if (check.kind === "includes") {
1245
+ if (!input.data.includes(check.value, check.position)) {
1246
+ ctx = this._getOrReturnCtx(input, ctx);
1247
+ addIssueToContext(ctx, {
1248
+ code: ZodIssueCode.invalid_string,
1249
+ validation: { includes: check.value, position: check.position },
1250
+ message: check.message
1251
+ });
1252
+ status.dirty();
1253
+ }
1254
+ } else if (check.kind === "toLowerCase") {
1255
+ input.data = input.data.toLowerCase();
1256
+ } else if (check.kind === "toUpperCase") {
1257
+ input.data = input.data.toUpperCase();
1102
1258
  } else if (check.kind === "startsWith") {
1103
1259
  if (!input.data.startsWith(check.value)) {
1104
1260
  ctx = this._getOrReturnCtx(input, ctx);
@@ -1130,12 +1286,71 @@ var require_helpers_cjs_development = __commonJS({
1130
1286
  });
1131
1287
  status.dirty();
1132
1288
  }
1289
+ } else if (check.kind === "date") {
1290
+ const regex = dateRegex;
1291
+ if (!regex.test(input.data)) {
1292
+ ctx = this._getOrReturnCtx(input, ctx);
1293
+ addIssueToContext(ctx, {
1294
+ code: ZodIssueCode.invalid_string,
1295
+ validation: "date",
1296
+ message: check.message
1297
+ });
1298
+ status.dirty();
1299
+ }
1300
+ } else if (check.kind === "time") {
1301
+ const regex = timeRegex(check);
1302
+ if (!regex.test(input.data)) {
1303
+ ctx = this._getOrReturnCtx(input, ctx);
1304
+ addIssueToContext(ctx, {
1305
+ code: ZodIssueCode.invalid_string,
1306
+ validation: "time",
1307
+ message: check.message
1308
+ });
1309
+ status.dirty();
1310
+ }
1311
+ } else if (check.kind === "duration") {
1312
+ if (!durationRegex.test(input.data)) {
1313
+ ctx = this._getOrReturnCtx(input, ctx);
1314
+ addIssueToContext(ctx, {
1315
+ validation: "duration",
1316
+ code: ZodIssueCode.invalid_string,
1317
+ message: check.message
1318
+ });
1319
+ status.dirty();
1320
+ }
1321
+ } else if (check.kind === "ip") {
1322
+ if (!isValidIP(input.data, check.version)) {
1323
+ ctx = this._getOrReturnCtx(input, ctx);
1324
+ addIssueToContext(ctx, {
1325
+ validation: "ip",
1326
+ code: ZodIssueCode.invalid_string,
1327
+ message: check.message
1328
+ });
1329
+ status.dirty();
1330
+ }
1331
+ } else if (check.kind === "base64") {
1332
+ if (!base64Regex.test(input.data)) {
1333
+ ctx = this._getOrReturnCtx(input, ctx);
1334
+ addIssueToContext(ctx, {
1335
+ validation: "base64",
1336
+ code: ZodIssueCode.invalid_string,
1337
+ message: check.message
1338
+ });
1339
+ status.dirty();
1340
+ }
1133
1341
  } else {
1134
1342
  util.assertNever(check);
1135
1343
  }
1136
1344
  }
1137
1345
  return { status: status.value, value: input.data };
1138
1346
  }
1347
+ _regex(regex, validation, message) {
1348
+ return this.refinement((data) => regex.test(data), {
1349
+ validation,
1350
+ code: ZodIssueCode.invalid_string,
1351
+ ...errorUtil.errToObj(message)
1352
+ });
1353
+ }
1139
1354
  _addCheck(check) {
1140
1355
  return new ZodString({
1141
1356
  ...this._def,
@@ -1148,19 +1363,38 @@ var require_helpers_cjs_development = __commonJS({
1148
1363
  url(message) {
1149
1364
  return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) });
1150
1365
  }
1366
+ emoji(message) {
1367
+ return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) });
1368
+ }
1151
1369
  uuid(message) {
1152
1370
  return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
1153
1371
  }
1372
+ nanoid(message) {
1373
+ return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
1374
+ }
1154
1375
  cuid(message) {
1155
1376
  return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
1156
1377
  }
1378
+ cuid2(message) {
1379
+ return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
1380
+ }
1381
+ ulid(message) {
1382
+ return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
1383
+ }
1384
+ base64(message) {
1385
+ return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
1386
+ }
1387
+ ip(options) {
1388
+ return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
1389
+ }
1157
1390
  datetime(options) {
1158
- var _a;
1391
+ var _a, _b;
1159
1392
  if (typeof options === "string") {
1160
1393
  return this._addCheck({
1161
1394
  kind: "datetime",
1162
1395
  precision: null,
1163
1396
  offset: false,
1397
+ local: false,
1164
1398
  message: options
1165
1399
  });
1166
1400
  }
@@ -1168,9 +1402,30 @@ var require_helpers_cjs_development = __commonJS({
1168
1402
  kind: "datetime",
1169
1403
  precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
1170
1404
  offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
1405
+ local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
1406
+ ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
1407
+ });
1408
+ }
1409
+ date(message) {
1410
+ return this._addCheck({ kind: "date", message });
1411
+ }
1412
+ time(options) {
1413
+ if (typeof options === "string") {
1414
+ return this._addCheck({
1415
+ kind: "time",
1416
+ precision: null,
1417
+ message: options
1418
+ });
1419
+ }
1420
+ return this._addCheck({
1421
+ kind: "time",
1422
+ precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
1171
1423
  ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
1172
1424
  });
1173
1425
  }
1426
+ duration(message) {
1427
+ return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
1428
+ }
1174
1429
  regex(regex, message) {
1175
1430
  return this._addCheck({
1176
1431
  kind: "regex",
@@ -1178,6 +1433,14 @@ var require_helpers_cjs_development = __commonJS({
1178
1433
  ...errorUtil.errToObj(message)
1179
1434
  });
1180
1435
  }
1436
+ includes(value, options) {
1437
+ return this._addCheck({
1438
+ kind: "includes",
1439
+ value,
1440
+ position: options === null || options === void 0 ? void 0 : options.position,
1441
+ ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
1442
+ });
1443
+ }
1181
1444
  startsWith(value, message) {
1182
1445
  return this._addCheck({
1183
1446
  kind: "startsWith",
@@ -1213,21 +1476,69 @@ var require_helpers_cjs_development = __commonJS({
1213
1476
  ...errorUtil.errToObj(message)
1214
1477
  });
1215
1478
  }
1479
+ nonempty(message) {
1480
+ return this.min(1, errorUtil.errToObj(message));
1481
+ }
1482
+ trim() {
1483
+ return new ZodString({
1484
+ ...this._def,
1485
+ checks: [...this._def.checks, { kind: "trim" }]
1486
+ });
1487
+ }
1488
+ toLowerCase() {
1489
+ return new ZodString({
1490
+ ...this._def,
1491
+ checks: [...this._def.checks, { kind: "toLowerCase" }]
1492
+ });
1493
+ }
1494
+ toUpperCase() {
1495
+ return new ZodString({
1496
+ ...this._def,
1497
+ checks: [...this._def.checks, { kind: "toUpperCase" }]
1498
+ });
1499
+ }
1216
1500
  get isDatetime() {
1217
1501
  return !!this._def.checks.find((ch) => ch.kind === "datetime");
1218
1502
  }
1503
+ get isDate() {
1504
+ return !!this._def.checks.find((ch) => ch.kind === "date");
1505
+ }
1506
+ get isTime() {
1507
+ return !!this._def.checks.find((ch) => ch.kind === "time");
1508
+ }
1509
+ get isDuration() {
1510
+ return !!this._def.checks.find((ch) => ch.kind === "duration");
1511
+ }
1219
1512
  get isEmail() {
1220
1513
  return !!this._def.checks.find((ch) => ch.kind === "email");
1221
1514
  }
1222
1515
  get isURL() {
1223
1516
  return !!this._def.checks.find((ch) => ch.kind === "url");
1224
1517
  }
1518
+ get isEmoji() {
1519
+ return !!this._def.checks.find((ch) => ch.kind === "emoji");
1520
+ }
1225
1521
  get isUUID() {
1226
1522
  return !!this._def.checks.find((ch) => ch.kind === "uuid");
1227
1523
  }
1524
+ get isNANOID() {
1525
+ return !!this._def.checks.find((ch) => ch.kind === "nanoid");
1526
+ }
1228
1527
  get isCUID() {
1229
1528
  return !!this._def.checks.find((ch) => ch.kind === "cuid");
1230
1529
  }
1530
+ get isCUID2() {
1531
+ return !!this._def.checks.find((ch) => ch.kind === "cuid2");
1532
+ }
1533
+ get isULID() {
1534
+ return !!this._def.checks.find((ch) => ch.kind === "ulid");
1535
+ }
1536
+ get isIP() {
1537
+ return !!this._def.checks.find((ch) => ch.kind === "ip");
1538
+ }
1539
+ get isBase64() {
1540
+ return !!this._def.checks.find((ch) => ch.kind === "base64");
1541
+ }
1231
1542
  get minLength() {
1232
1543
  let min = null;
1233
1544
  for (const ch of this._def.checks) {
@@ -1441,6 +1752,19 @@ var require_helpers_cjs_development = __commonJS({
1441
1752
  message: errorUtil.toString(message)
1442
1753
  });
1443
1754
  }
1755
+ safe(message) {
1756
+ return this._addCheck({
1757
+ kind: "min",
1758
+ inclusive: true,
1759
+ value: Number.MIN_SAFE_INTEGER,
1760
+ message: errorUtil.toString(message)
1761
+ })._addCheck({
1762
+ kind: "max",
1763
+ inclusive: true,
1764
+ value: Number.MAX_SAFE_INTEGER,
1765
+ message: errorUtil.toString(message)
1766
+ });
1767
+ }
1444
1768
  get minValue() {
1445
1769
  let min = null;
1446
1770
  for (const ch of this._def.checks) {
@@ -1462,7 +1786,22 @@ var require_helpers_cjs_development = __commonJS({
1462
1786
  return max;
1463
1787
  }
1464
1788
  get isInt() {
1465
- return !!this._def.checks.find((ch) => ch.kind === "int");
1789
+ return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
1790
+ }
1791
+ get isFinite() {
1792
+ let max = null, min = null;
1793
+ for (const ch of this._def.checks) {
1794
+ if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
1795
+ return true;
1796
+ } else if (ch.kind === "min") {
1797
+ if (min === null || ch.value > min)
1798
+ min = ch.value;
1799
+ } else if (ch.kind === "max") {
1800
+ if (max === null || ch.value < max)
1801
+ max = ch.value;
1802
+ }
1803
+ }
1804
+ return Number.isFinite(min) && Number.isFinite(max);
1466
1805
  }
1467
1806
  }, "ZodNumber");
1468
1807
  __name22(ZodNumber, "ZodNumber");
@@ -1475,27 +1814,167 @@ var require_helpers_cjs_development = __commonJS({
1475
1814
  });
1476
1815
  };
1477
1816
  var ZodBigInt = /* @__PURE__ */ __name2(class extends ZodType {
1817
+ constructor() {
1818
+ super(...arguments);
1819
+ this.min = this.gte;
1820
+ this.max = this.lte;
1821
+ }
1478
1822
  _parse(input) {
1479
1823
  if (this._def.coerce) {
1480
1824
  input.data = BigInt(input.data);
1481
1825
  }
1482
1826
  const parsedType = this._getType(input);
1483
1827
  if (parsedType !== ZodParsedType.bigint) {
1484
- const ctx = this._getOrReturnCtx(input);
1485
- addIssueToContext(ctx, {
1828
+ const ctx2 = this._getOrReturnCtx(input);
1829
+ addIssueToContext(ctx2, {
1486
1830
  code: ZodIssueCode.invalid_type,
1487
1831
  expected: ZodParsedType.bigint,
1488
- received: ctx.parsedType
1832
+ received: ctx2.parsedType
1489
1833
  });
1490
1834
  return INVALID;
1491
1835
  }
1492
- return OK(input.data);
1836
+ let ctx = void 0;
1837
+ const status = new ParseStatus();
1838
+ for (const check of this._def.checks) {
1839
+ if (check.kind === "min") {
1840
+ const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
1841
+ if (tooSmall) {
1842
+ ctx = this._getOrReturnCtx(input, ctx);
1843
+ addIssueToContext(ctx, {
1844
+ code: ZodIssueCode.too_small,
1845
+ type: "bigint",
1846
+ minimum: check.value,
1847
+ inclusive: check.inclusive,
1848
+ message: check.message
1849
+ });
1850
+ status.dirty();
1851
+ }
1852
+ } else if (check.kind === "max") {
1853
+ const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
1854
+ if (tooBig) {
1855
+ ctx = this._getOrReturnCtx(input, ctx);
1856
+ addIssueToContext(ctx, {
1857
+ code: ZodIssueCode.too_big,
1858
+ type: "bigint",
1859
+ maximum: check.value,
1860
+ inclusive: check.inclusive,
1861
+ message: check.message
1862
+ });
1863
+ status.dirty();
1864
+ }
1865
+ } else if (check.kind === "multipleOf") {
1866
+ if (input.data % check.value !== BigInt(0)) {
1867
+ ctx = this._getOrReturnCtx(input, ctx);
1868
+ addIssueToContext(ctx, {
1869
+ code: ZodIssueCode.not_multiple_of,
1870
+ multipleOf: check.value,
1871
+ message: check.message
1872
+ });
1873
+ status.dirty();
1874
+ }
1875
+ } else {
1876
+ util.assertNever(check);
1877
+ }
1878
+ }
1879
+ return { status: status.value, value: input.data };
1880
+ }
1881
+ gte(value, message) {
1882
+ return this.setLimit("min", value, true, errorUtil.toString(message));
1883
+ }
1884
+ gt(value, message) {
1885
+ return this.setLimit("min", value, false, errorUtil.toString(message));
1886
+ }
1887
+ lte(value, message) {
1888
+ return this.setLimit("max", value, true, errorUtil.toString(message));
1889
+ }
1890
+ lt(value, message) {
1891
+ return this.setLimit("max", value, false, errorUtil.toString(message));
1892
+ }
1893
+ setLimit(kind, value, inclusive, message) {
1894
+ return new ZodBigInt({
1895
+ ...this._def,
1896
+ checks: [
1897
+ ...this._def.checks,
1898
+ {
1899
+ kind,
1900
+ value,
1901
+ inclusive,
1902
+ message: errorUtil.toString(message)
1903
+ }
1904
+ ]
1905
+ });
1906
+ }
1907
+ _addCheck(check) {
1908
+ return new ZodBigInt({
1909
+ ...this._def,
1910
+ checks: [...this._def.checks, check]
1911
+ });
1912
+ }
1913
+ positive(message) {
1914
+ return this._addCheck({
1915
+ kind: "min",
1916
+ value: BigInt(0),
1917
+ inclusive: false,
1918
+ message: errorUtil.toString(message)
1919
+ });
1920
+ }
1921
+ negative(message) {
1922
+ return this._addCheck({
1923
+ kind: "max",
1924
+ value: BigInt(0),
1925
+ inclusive: false,
1926
+ message: errorUtil.toString(message)
1927
+ });
1928
+ }
1929
+ nonpositive(message) {
1930
+ return this._addCheck({
1931
+ kind: "max",
1932
+ value: BigInt(0),
1933
+ inclusive: true,
1934
+ message: errorUtil.toString(message)
1935
+ });
1936
+ }
1937
+ nonnegative(message) {
1938
+ return this._addCheck({
1939
+ kind: "min",
1940
+ value: BigInt(0),
1941
+ inclusive: true,
1942
+ message: errorUtil.toString(message)
1943
+ });
1944
+ }
1945
+ multipleOf(value, message) {
1946
+ return this._addCheck({
1947
+ kind: "multipleOf",
1948
+ value,
1949
+ message: errorUtil.toString(message)
1950
+ });
1951
+ }
1952
+ get minValue() {
1953
+ let min = null;
1954
+ for (const ch of this._def.checks) {
1955
+ if (ch.kind === "min") {
1956
+ if (min === null || ch.value > min)
1957
+ min = ch.value;
1958
+ }
1959
+ }
1960
+ return min;
1961
+ }
1962
+ get maxValue() {
1963
+ let max = null;
1964
+ for (const ch of this._def.checks) {
1965
+ if (ch.kind === "max") {
1966
+ if (max === null || ch.value < max)
1967
+ max = ch.value;
1968
+ }
1969
+ }
1970
+ return max;
1493
1971
  }
1494
1972
  }, "ZodBigInt");
1495
1973
  __name22(ZodBigInt, "ZodBigInt");
1496
1974
  ZodBigInt.create = (params) => {
1497
1975
  var _a;
1498
1976
  return new ZodBigInt({
1977
+ checks: [],
1499
1978
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
1500
1979
  coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
1501
1980
  ...processCreateParams(params)
@@ -1830,13 +2309,13 @@ var require_helpers_cjs_development = __commonJS({
1830
2309
  }
1831
2310
  }
1832
2311
  if (ctx.common.async) {
1833
- return Promise.all(ctx.data.map((item, i) => {
2312
+ return Promise.all([...ctx.data].map((item, i) => {
1834
2313
  return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
1835
2314
  })).then((result2) => {
1836
2315
  return ParseStatus.mergeArray(status, result2);
1837
2316
  });
1838
2317
  }
1839
- const result = ctx.data.map((item, i) => {
2318
+ const result = [...ctx.data].map((item, i) => {
1840
2319
  return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
1841
2320
  });
1842
2321
  return ParseStatus.mergeArray(status, result);
@@ -1877,24 +2356,6 @@ var require_helpers_cjs_development = __commonJS({
1877
2356
  ...processCreateParams(params)
1878
2357
  });
1879
2358
  };
1880
- var objectUtil;
1881
- (function(objectUtil2) {
1882
- objectUtil2.mergeShapes = (first, second) => {
1883
- return {
1884
- ...first,
1885
- ...second
1886
- };
1887
- };
1888
- })(objectUtil || (objectUtil = {}));
1889
- var AugmentFactory = /* @__PURE__ */ __name22((def) => (augmentation) => {
1890
- return new ZodObject({
1891
- ...def,
1892
- shape: () => ({
1893
- ...def.shape(),
1894
- ...augmentation
1895
- })
1896
- });
1897
- }, "AugmentFactory");
1898
2359
  function deepPartialify(schema) {
1899
2360
  if (schema instanceof ZodObject) {
1900
2361
  const newShape = {};
@@ -1907,7 +2368,10 @@ var require_helpers_cjs_development = __commonJS({
1907
2368
  shape: () => newShape
1908
2369
  });
1909
2370
  } else if (schema instanceof ZodArray) {
1910
- return ZodArray.create(deepPartialify(schema.element));
2371
+ return new ZodArray({
2372
+ ...schema._def,
2373
+ type: deepPartialify(schema.element)
2374
+ });
1911
2375
  } else if (schema instanceof ZodOptional) {
1912
2376
  return ZodOptional.create(deepPartialify(schema.unwrap()));
1913
2377
  } else if (schema instanceof ZodNullable) {
@@ -1926,8 +2390,7 @@ var require_helpers_cjs_development = __commonJS({
1926
2390
  super(...arguments);
1927
2391
  this._cached = null;
1928
2392
  this.nonstrict = this.passthrough;
1929
- this.augment = AugmentFactory(this._def);
1930
- this.extend = AugmentFactory(this._def);
2393
+ this.augment = this.extend;
1931
2394
  }
1932
2395
  _getCached() {
1933
2396
  if (this._cached !== null)
@@ -2007,9 +2470,10 @@ var require_helpers_cjs_development = __commonJS({
2007
2470
  const syncPairs = [];
2008
2471
  for (const pair of pairs) {
2009
2472
  const key = await pair.key;
2473
+ const value = await pair.value;
2010
2474
  syncPairs.push({
2011
2475
  key,
2012
- value: await pair.value,
2476
+ value,
2013
2477
  alwaysSet: pair.alwaysSet
2014
2478
  });
2015
2479
  }
@@ -2056,18 +2520,30 @@ var require_helpers_cjs_development = __commonJS({
2056
2520
  unknownKeys: "passthrough"
2057
2521
  });
2058
2522
  }
2059
- setKey(key, schema) {
2060
- return this.augment({ [key]: schema });
2523
+ extend(augmentation) {
2524
+ return new ZodObject({
2525
+ ...this._def,
2526
+ shape: () => ({
2527
+ ...this._def.shape(),
2528
+ ...augmentation
2529
+ })
2530
+ });
2061
2531
  }
2062
2532
  merge(merging) {
2063
2533
  const merged = new ZodObject({
2064
2534
  unknownKeys: merging._def.unknownKeys,
2065
2535
  catchall: merging._def.catchall,
2066
- shape: () => objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
2536
+ shape: () => ({
2537
+ ...this._def.shape(),
2538
+ ...merging._def.shape()
2539
+ }),
2067
2540
  typeName: ZodFirstPartyTypeKind.ZodObject
2068
2541
  });
2069
2542
  return merged;
2070
2543
  }
2544
+ setKey(key, schema) {
2545
+ return this.augment({ [key]: schema });
2546
+ }
2071
2547
  catchall(index) {
2072
2548
  return new ZodObject({
2073
2549
  ...this._def,
@@ -2076,9 +2552,10 @@ var require_helpers_cjs_development = __commonJS({
2076
2552
  }
2077
2553
  pick(mask) {
2078
2554
  const shape = {};
2079
- util.objectKeys(mask).map((key) => {
2080
- if (this.shape[key])
2555
+ util.objectKeys(mask).forEach((key) => {
2556
+ if (mask[key] && this.shape[key]) {
2081
2557
  shape[key] = this.shape[key];
2558
+ }
2082
2559
  });
2083
2560
  return new ZodObject({
2084
2561
  ...this._def,
@@ -2087,8 +2564,8 @@ var require_helpers_cjs_development = __commonJS({
2087
2564
  }
2088
2565
  omit(mask) {
2089
2566
  const shape = {};
2090
- util.objectKeys(this.shape).map((key) => {
2091
- if (util.objectKeys(mask).indexOf(key) === -1) {
2567
+ util.objectKeys(this.shape).forEach((key) => {
2568
+ if (!mask[key]) {
2092
2569
  shape[key] = this.shape[key];
2093
2570
  }
2094
2571
  });
@@ -2102,24 +2579,14 @@ var require_helpers_cjs_development = __commonJS({
2102
2579
  }
2103
2580
  partial(mask) {
2104
2581
  const newShape = {};
2105
- if (mask) {
2106
- util.objectKeys(this.shape).map((key) => {
2107
- if (util.objectKeys(mask).indexOf(key) === -1) {
2108
- newShape[key] = this.shape[key];
2109
- } else {
2110
- newShape[key] = this.shape[key].optional();
2111
- }
2112
- });
2113
- return new ZodObject({
2114
- ...this._def,
2115
- shape: () => newShape
2116
- });
2117
- } else {
2118
- for (const key in this.shape) {
2119
- const fieldSchema = this.shape[key];
2582
+ util.objectKeys(this.shape).forEach((key) => {
2583
+ const fieldSchema = this.shape[key];
2584
+ if (mask && !mask[key]) {
2585
+ newShape[key] = fieldSchema;
2586
+ } else {
2120
2587
  newShape[key] = fieldSchema.optional();
2121
2588
  }
2122
- }
2589
+ });
2123
2590
  return new ZodObject({
2124
2591
  ...this._def,
2125
2592
  shape: () => newShape
@@ -2127,21 +2594,10 @@ var require_helpers_cjs_development = __commonJS({
2127
2594
  }
2128
2595
  required(mask) {
2129
2596
  const newShape = {};
2130
- if (mask) {
2131
- util.objectKeys(this.shape).map((key) => {
2132
- if (util.objectKeys(mask).indexOf(key) === -1) {
2133
- newShape[key] = this.shape[key];
2134
- } else {
2135
- const fieldSchema = this.shape[key];
2136
- let newField = fieldSchema;
2137
- while (newField instanceof ZodOptional) {
2138
- newField = newField._def.innerType;
2139
- }
2140
- newShape[key] = newField;
2141
- }
2142
- });
2143
- } else {
2144
- for (const key in this.shape) {
2597
+ util.objectKeys(this.shape).forEach((key) => {
2598
+ if (mask && !mask[key]) {
2599
+ newShape[key] = this.shape[key];
2600
+ } else {
2145
2601
  const fieldSchema = this.shape[key];
2146
2602
  let newField = fieldSchema;
2147
2603
  while (newField instanceof ZodOptional) {
@@ -2149,7 +2605,7 @@ var require_helpers_cjs_development = __commonJS({
2149
2605
  }
2150
2606
  newShape[key] = newField;
2151
2607
  }
2152
- }
2608
+ });
2153
2609
  return new ZodObject({
2154
2610
  ...this._def,
2155
2611
  shape: () => newShape
@@ -2292,15 +2748,25 @@ var require_helpers_cjs_development = __commonJS({
2292
2748
  } else if (type instanceof ZodEnum) {
2293
2749
  return type.options;
2294
2750
  } else if (type instanceof ZodNativeEnum) {
2295
- return Object.keys(type.enum);
2751
+ return util.objectValues(type.enum);
2296
2752
  } else if (type instanceof ZodDefault) {
2297
2753
  return getDiscriminator(type._def.innerType);
2298
2754
  } else if (type instanceof ZodUndefined) {
2299
2755
  return [void 0];
2300
2756
  } else if (type instanceof ZodNull) {
2301
2757
  return [null];
2758
+ } else if (type instanceof ZodOptional) {
2759
+ return [void 0, ...getDiscriminator(type.unwrap())];
2760
+ } else if (type instanceof ZodNullable) {
2761
+ return [null, ...getDiscriminator(type.unwrap())];
2762
+ } else if (type instanceof ZodBranded) {
2763
+ return getDiscriminator(type.unwrap());
2764
+ } else if (type instanceof ZodReadonly) {
2765
+ return getDiscriminator(type.unwrap());
2766
+ } else if (type instanceof ZodCatch) {
2767
+ return getDiscriminator(type._def.innerType);
2302
2768
  } else {
2303
- return null;
2769
+ return [];
2304
2770
  }
2305
2771
  }, "getDiscriminator");
2306
2772
  var ZodDiscriminatedUnion = /* @__PURE__ */ __name2(class extends ZodType {
@@ -2352,7 +2818,7 @@ var require_helpers_cjs_development = __commonJS({
2352
2818
  const optionsMap = /* @__PURE__ */ new Map();
2353
2819
  for (const type of options) {
2354
2820
  const discriminatorValues = getDiscriminator(type.shape[discriminator]);
2355
- if (!discriminatorValues) {
2821
+ if (!discriminatorValues.length) {
2356
2822
  throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
2357
2823
  }
2358
2824
  for (const value of discriminatorValues) {
@@ -2499,7 +2965,7 @@ var require_helpers_cjs_development = __commonJS({
2499
2965
  });
2500
2966
  status.dirty();
2501
2967
  }
2502
- const items = ctx.data.map((item, itemIndex) => {
2968
+ const items = [...ctx.data].map((item, itemIndex) => {
2503
2969
  const schema = this._def.items[itemIndex] || this._def.rest;
2504
2970
  if (!schema)
2505
2971
  return null;
@@ -2558,7 +3024,8 @@ var require_helpers_cjs_development = __commonJS({
2558
3024
  for (const key in ctx.data) {
2559
3025
  pairs.push({
2560
3026
  key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
2561
- value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key))
3027
+ value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
3028
+ alwaysSet: key in ctx.data
2562
3029
  });
2563
3030
  }
2564
3031
  if (ctx.common.async) {
@@ -2589,6 +3056,12 @@ var require_helpers_cjs_development = __commonJS({
2589
3056
  }, "ZodRecord");
2590
3057
  __name22(ZodRecord, "ZodRecord");
2591
3058
  var ZodMap = /* @__PURE__ */ __name2(class extends ZodType {
3059
+ get keySchema() {
3060
+ return this._def.keyType;
3061
+ }
3062
+ get valueSchema() {
3063
+ return this._def.valueType;
3064
+ }
2592
3065
  _parse(input) {
2593
3066
  const { status, ctx } = this._processInputParams(input);
2594
3067
  if (ctx.parsedType !== ZodParsedType.map) {
@@ -2794,27 +3267,29 @@ var require_helpers_cjs_development = __commonJS({
2794
3267
  const params = { errorMap: ctx.common.contextualErrorMap };
2795
3268
  const fn = ctx.data;
2796
3269
  if (this._def.returns instanceof ZodPromise) {
2797
- return OK(async (...args) => {
3270
+ const me = this;
3271
+ return OK(async function(...args) {
2798
3272
  const error = new ZodError([]);
2799
- const parsedArgs = await this._def.args.parseAsync(args, params).catch((e) => {
3273
+ const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
2800
3274
  error.addIssue(makeArgsIssue(args, e));
2801
3275
  throw error;
2802
3276
  });
2803
- const result = await fn(...parsedArgs);
2804
- const parsedReturns = await this._def.returns._def.type.parseAsync(result, params).catch((e) => {
3277
+ const result = await Reflect.apply(fn, this, parsedArgs);
3278
+ const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
2805
3279
  error.addIssue(makeReturnsIssue(result, e));
2806
3280
  throw error;
2807
3281
  });
2808
3282
  return parsedReturns;
2809
3283
  });
2810
3284
  } else {
2811
- return OK((...args) => {
2812
- const parsedArgs = this._def.args.safeParse(args, params);
3285
+ const me = this;
3286
+ return OK(function(...args) {
3287
+ const parsedArgs = me._def.args.safeParse(args, params);
2813
3288
  if (!parsedArgs.success) {
2814
3289
  throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
2815
3290
  }
2816
- const result = fn(...parsedArgs.data);
2817
- const parsedReturns = this._def.returns.safeParse(result, params);
3291
+ const result = Reflect.apply(fn, this, parsedArgs.data);
3292
+ const parsedReturns = me._def.returns.safeParse(result, params);
2818
3293
  if (!parsedReturns.success) {
2819
3294
  throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
2820
3295
  }
@@ -2881,6 +3356,7 @@ var require_helpers_cjs_development = __commonJS({
2881
3356
  if (input.data !== this._def.value) {
2882
3357
  const ctx = this._getOrReturnCtx(input);
2883
3358
  addIssueToContext(ctx, {
3359
+ received: ctx.data,
2884
3360
  code: ZodIssueCode.invalid_literal,
2885
3361
  expected: this._def.value
2886
3362
  });
@@ -2911,6 +3387,10 @@ var require_helpers_cjs_development = __commonJS({
2911
3387
  __name2(createZodEnum, "createZodEnum");
2912
3388
  __name22(createZodEnum, "createZodEnum");
2913
3389
  var ZodEnum = /* @__PURE__ */ __name2(class extends ZodType {
3390
+ constructor() {
3391
+ super(...arguments);
3392
+ _ZodEnum_cache.set(this, void 0);
3393
+ }
2914
3394
  _parse(input) {
2915
3395
  if (typeof input.data !== "string") {
2916
3396
  const ctx = this._getOrReturnCtx(input);
@@ -2922,7 +3402,10 @@ var require_helpers_cjs_development = __commonJS({
2922
3402
  });
2923
3403
  return INVALID;
2924
3404
  }
2925
- if (this._def.values.indexOf(input.data) === -1) {
3405
+ if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
3406
+ __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
3407
+ }
3408
+ if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
2926
3409
  const ctx = this._getOrReturnCtx(input);
2927
3410
  const expectedValues = this._def.values;
2928
3411
  addIssueToContext(ctx, {
@@ -2958,10 +3441,27 @@ var require_helpers_cjs_development = __commonJS({
2958
3441
  }
2959
3442
  return enumValues;
2960
3443
  }
3444
+ extract(values, newDef = this._def) {
3445
+ return ZodEnum.create(values, {
3446
+ ...this._def,
3447
+ ...newDef
3448
+ });
3449
+ }
3450
+ exclude(values, newDef = this._def) {
3451
+ return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
3452
+ ...this._def,
3453
+ ...newDef
3454
+ });
3455
+ }
2961
3456
  }, "ZodEnum");
2962
3457
  __name22(ZodEnum, "ZodEnum");
3458
+ _ZodEnum_cache = /* @__PURE__ */ new WeakMap();
2963
3459
  ZodEnum.create = createZodEnum;
2964
3460
  var ZodNativeEnum = /* @__PURE__ */ __name2(class extends ZodType {
3461
+ constructor() {
3462
+ super(...arguments);
3463
+ _ZodNativeEnum_cache.set(this, void 0);
3464
+ }
2965
3465
  _parse(input) {
2966
3466
  const nativeEnumValues = util.getValidEnumValues(this._def.values);
2967
3467
  const ctx = this._getOrReturnCtx(input);
@@ -2974,7 +3474,10 @@ var require_helpers_cjs_development = __commonJS({
2974
3474
  });
2975
3475
  return INVALID;
2976
3476
  }
2977
- if (nativeEnumValues.indexOf(input.data) === -1) {
3477
+ if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
3478
+ __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
3479
+ }
3480
+ if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
2978
3481
  const expectedValues = util.objectValues(nativeEnumValues);
2979
3482
  addIssueToContext(ctx, {
2980
3483
  received: ctx.data,
@@ -2990,6 +3493,7 @@ var require_helpers_cjs_development = __commonJS({
2990
3493
  }
2991
3494
  }, "ZodNativeEnum");
2992
3495
  __name22(ZodNativeEnum, "ZodNativeEnum");
3496
+ _ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
2993
3497
  ZodNativeEnum.create = (values, params) => {
2994
3498
  return new ZodNativeEnum({
2995
3499
  values,
@@ -2998,6 +3502,9 @@ var require_helpers_cjs_development = __commonJS({
2998
3502
  });
2999
3503
  };
3000
3504
  var ZodPromise = /* @__PURE__ */ __name2(class extends ZodType {
3505
+ unwrap() {
3506
+ return this._def.type;
3507
+ }
3001
3508
  _parse(input) {
3002
3509
  const { ctx } = this._processInputParams(input);
3003
3510
  if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
@@ -3035,24 +3542,6 @@ var require_helpers_cjs_development = __commonJS({
3035
3542
  _parse(input) {
3036
3543
  const { status, ctx } = this._processInputParams(input);
3037
3544
  const effect = this._def.effect || null;
3038
- if (effect.type === "preprocess") {
3039
- const processed = effect.transform(ctx.data);
3040
- if (ctx.common.async) {
3041
- return Promise.resolve(processed).then((processed2) => {
3042
- return this._def.schema._parseAsync({
3043
- data: processed2,
3044
- path: ctx.path,
3045
- parent: ctx
3046
- });
3047
- });
3048
- } else {
3049
- return this._def.schema._parseSync({
3050
- data: processed,
3051
- path: ctx.path,
3052
- parent: ctx
3053
- });
3054
- }
3055
- }
3056
3545
  const checkCtx = {
3057
3546
  addIssue: (arg) => {
3058
3547
  addIssueToContext(ctx, arg);
@@ -3067,6 +3556,42 @@ var require_helpers_cjs_development = __commonJS({
3067
3556
  }
3068
3557
  };
3069
3558
  checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
3559
+ if (effect.type === "preprocess") {
3560
+ const processed = effect.transform(ctx.data, checkCtx);
3561
+ if (ctx.common.async) {
3562
+ return Promise.resolve(processed).then(async (processed2) => {
3563
+ if (status.value === "aborted")
3564
+ return INVALID;
3565
+ const result = await this._def.schema._parseAsync({
3566
+ data: processed2,
3567
+ path: ctx.path,
3568
+ parent: ctx
3569
+ });
3570
+ if (result.status === "aborted")
3571
+ return INVALID;
3572
+ if (result.status === "dirty")
3573
+ return DIRTY(result.value);
3574
+ if (status.value === "dirty")
3575
+ return DIRTY(result.value);
3576
+ return result;
3577
+ });
3578
+ } else {
3579
+ if (status.value === "aborted")
3580
+ return INVALID;
3581
+ const result = this._def.schema._parseSync({
3582
+ data: processed,
3583
+ path: ctx.path,
3584
+ parent: ctx
3585
+ });
3586
+ if (result.status === "aborted")
3587
+ return INVALID;
3588
+ if (result.status === "dirty")
3589
+ return DIRTY(result.value);
3590
+ if (status.value === "dirty")
3591
+ return DIRTY(result.value);
3592
+ return result;
3593
+ }
3594
+ }
3070
3595
  if (effect.type === "refinement") {
3071
3596
  const executeRefinement = /* @__PURE__ */ __name22((acc) => {
3072
3597
  const result = effect.refinement(acc, checkCtx);
@@ -3213,26 +3738,45 @@ var require_helpers_cjs_development = __commonJS({
3213
3738
  var ZodCatch = /* @__PURE__ */ __name2(class extends ZodType {
3214
3739
  _parse(input) {
3215
3740
  const { ctx } = this._processInputParams(input);
3741
+ const newCtx = {
3742
+ ...ctx,
3743
+ common: {
3744
+ ...ctx.common,
3745
+ issues: []
3746
+ }
3747
+ };
3216
3748
  const result = this._def.innerType._parse({
3217
- data: ctx.data,
3218
- path: ctx.path,
3219
- parent: ctx
3749
+ data: newCtx.data,
3750
+ path: newCtx.path,
3751
+ parent: {
3752
+ ...newCtx
3753
+ }
3220
3754
  });
3221
3755
  if (isAsync(result)) {
3222
3756
  return result.then((result2) => {
3223
3757
  return {
3224
3758
  status: "valid",
3225
- value: result2.status === "valid" ? result2.value : this._def.defaultValue()
3759
+ value: result2.status === "valid" ? result2.value : this._def.catchValue({
3760
+ get error() {
3761
+ return new ZodError(newCtx.common.issues);
3762
+ },
3763
+ input: newCtx.data
3764
+ })
3226
3765
  };
3227
3766
  });
3228
3767
  } else {
3229
3768
  return {
3230
3769
  status: "valid",
3231
- value: result.status === "valid" ? result.value : this._def.defaultValue()
3770
+ value: result.status === "valid" ? result.value : this._def.catchValue({
3771
+ get error() {
3772
+ return new ZodError(newCtx.common.issues);
3773
+ },
3774
+ input: newCtx.data
3775
+ })
3232
3776
  };
3233
3777
  }
3234
3778
  }
3235
- removeDefault() {
3779
+ removeCatch() {
3236
3780
  return this._def.innerType;
3237
3781
  }
3238
3782
  }, "ZodCatch");
@@ -3241,7 +3785,7 @@ var require_helpers_cjs_development = __commonJS({
3241
3785
  return new ZodCatch({
3242
3786
  innerType: type,
3243
3787
  typeName: ZodFirstPartyTypeKind.ZodCatch,
3244
- defaultValue: typeof params.default === "function" ? params.default : () => params.default,
3788
+ catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
3245
3789
  ...processCreateParams(params)
3246
3790
  });
3247
3791
  };
@@ -3339,17 +3883,45 @@ var require_helpers_cjs_development = __commonJS({
3339
3883
  }
3340
3884
  }, "ZodPipeline");
3341
3885
  __name22(ZodPipeline, "ZodPipeline");
3342
- var custom = /* @__PURE__ */ __name22((check, params = {}, fatal) => {
3886
+ var ZodReadonly = /* @__PURE__ */ __name2(class extends ZodType {
3887
+ _parse(input) {
3888
+ const result = this._def.innerType._parse(input);
3889
+ const freeze = /* @__PURE__ */ __name22((data) => {
3890
+ if (isValid(data)) {
3891
+ data.value = Object.freeze(data.value);
3892
+ }
3893
+ return data;
3894
+ }, "freeze");
3895
+ return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
3896
+ }
3897
+ unwrap() {
3898
+ return this._def.innerType;
3899
+ }
3900
+ }, "ZodReadonly");
3901
+ __name22(ZodReadonly, "ZodReadonly");
3902
+ ZodReadonly.create = (type, params) => {
3903
+ return new ZodReadonly({
3904
+ innerType: type,
3905
+ typeName: ZodFirstPartyTypeKind.ZodReadonly,
3906
+ ...processCreateParams(params)
3907
+ });
3908
+ };
3909
+ function custom(check, params = {}, fatal) {
3343
3910
  if (check)
3344
3911
  return ZodAny.create().superRefine((data, ctx) => {
3912
+ var _a, _b;
3345
3913
  if (!check(data)) {
3346
- const p = typeof params === "function" ? params(data) : params;
3914
+ const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
3915
+ const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
3347
3916
  const p2 = typeof p === "string" ? { message: p } : p;
3348
- ctx.addIssue({ code: "custom", ...p2, fatal });
3917
+ ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
3349
3918
  }
3350
3919
  });
3351
3920
  return ZodAny.create();
3352
- }, "custom");
3921
+ }
3922
+ __name(custom, "custom");
3923
+ __name2(custom, "custom");
3924
+ __name22(custom, "custom");
3353
3925
  var late = {
3354
3926
  object: ZodObject.lazycreate
3355
3927
  };
@@ -3390,10 +3962,11 @@ var require_helpers_cjs_development = __commonJS({
3390
3962
  ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise";
3391
3963
  ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded";
3392
3964
  ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
3965
+ ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
3393
3966
  })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
3394
3967
  var instanceOfType = /* @__PURE__ */ __name22((cls, params = {
3395
3968
  message: `Input not instance of ${cls.name}`
3396
- }) => custom((data) => data instanceof cls, params, true), "instanceOfType");
3969
+ }) => custom((data) => data instanceof cls, params), "instanceOfType");
3397
3970
  var stringType = ZodString.create;
3398
3971
  var numberType = ZodNumber.create;
3399
3972
  var nanType = ZodNaN.create;
@@ -3434,12 +4007,15 @@ var require_helpers_cjs_development = __commonJS({
3434
4007
  var coerce = {
3435
4008
  string: (arg) => ZodString.create({ ...arg, coerce: true }),
3436
4009
  number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
3437
- boolean: (arg) => ZodBoolean.create({ ...arg, coerce: true }),
4010
+ boolean: (arg) => ZodBoolean.create({
4011
+ ...arg,
4012
+ coerce: true
4013
+ }),
3438
4014
  bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
3439
4015
  date: (arg) => ZodDate.create({ ...arg, coerce: true })
3440
4016
  };
3441
4017
  var NEVER = INVALID;
3442
- var mod = /* @__PURE__ */ Object.freeze({
4018
+ var z = /* @__PURE__ */ Object.freeze({
3443
4019
  __proto__: null,
3444
4020
  defaultErrorMap: errorMap,
3445
4021
  setErrorMap,
@@ -3458,9 +4034,13 @@ var require_helpers_cjs_development = __commonJS({
3458
4034
  get util() {
3459
4035
  return util;
3460
4036
  },
4037
+ get objectUtil() {
4038
+ return objectUtil;
4039
+ },
3461
4040
  ZodParsedType,
3462
4041
  getParsedType,
3463
4042
  ZodType,
4043
+ datetimeRegex,
3464
4044
  ZodString,
3465
4045
  ZodNumber,
3466
4046
  ZodBigInt,
@@ -3474,9 +4054,6 @@ var require_helpers_cjs_development = __commonJS({
3474
4054
  ZodNever,
3475
4055
  ZodVoid,
3476
4056
  ZodArray,
3477
- get objectUtil() {
3478
- return objectUtil;
3479
- },
3480
4057
  ZodObject,
3481
4058
  ZodUnion,
3482
4059
  ZodDiscriminatedUnion,
@@ -3501,6 +4078,7 @@ var require_helpers_cjs_development = __commonJS({
3501
4078
  BRAND,
3502
4079
  ZodBranded,
3503
4080
  ZodPipeline,
4081
+ ZodReadonly,
3504
4082
  custom,
3505
4083
  Schema: ZodType,
3506
4084
  ZodSchema: ZodType,
@@ -3553,35 +4131,133 @@ var require_helpers_cjs_development = __commonJS({
3553
4131
  quotelessJson,
3554
4132
  ZodError
3555
4133
  });
3556
- var ContextValidator = mod.array(mod.string().or(mod.record(mod.any())));
3557
- var AchievementCriteriaValidator = mod.object({
3558
- type: mod.string().optional(),
3559
- narrative: mod.string().optional()
4134
+ var currentSymbol = Symbol("current");
4135
+ var previousSymbol = Symbol("previous");
4136
+ var mergeOpenApi = /* @__PURE__ */ __name22((openapi, {
4137
+ ref: _ref,
4138
+ refType: _refType,
4139
+ param: _param,
4140
+ header: _header,
4141
+ ...rest
4142
+ } = {}) => ({
4143
+ ...rest,
4144
+ ...openapi
4145
+ }), "mergeOpenApi");
4146
+ function extendZodWithOpenApi(zod) {
4147
+ if (typeof zod.ZodType.prototype.openapi !== "undefined") {
4148
+ return;
4149
+ }
4150
+ zod.ZodType.prototype.openapi = function(openapi) {
4151
+ const { zodOpenApi, ...rest } = this._def;
4152
+ const result = new this.constructor({
4153
+ ...rest,
4154
+ zodOpenApi: {
4155
+ openapi: mergeOpenApi(
4156
+ openapi,
4157
+ zodOpenApi == null ? void 0 : zodOpenApi.openapi
4158
+ )
4159
+ }
4160
+ });
4161
+ result._def.zodOpenApi[currentSymbol] = result;
4162
+ if (zodOpenApi) {
4163
+ result._def.zodOpenApi[previousSymbol] = this;
4164
+ }
4165
+ return result;
4166
+ };
4167
+ const zodDescribe = zod.ZodType.prototype.describe;
4168
+ zod.ZodType.prototype.describe = function(...args) {
4169
+ const result = zodDescribe.apply(this, args);
4170
+ const def = result._def;
4171
+ if (def.zodOpenApi) {
4172
+ const cloned = { ...def.zodOpenApi };
4173
+ cloned.openapi = mergeOpenApi({ description: args[0] }, cloned.openapi);
4174
+ cloned[previousSymbol] = this;
4175
+ cloned[currentSymbol] = result;
4176
+ def.zodOpenApi = cloned;
4177
+ } else {
4178
+ def.zodOpenApi = {
4179
+ openapi: { description: args[0] },
4180
+ [currentSymbol]: result
4181
+ };
4182
+ }
4183
+ return result;
4184
+ };
4185
+ const zodObjectExtend = zod.ZodObject.prototype.extend;
4186
+ zod.ZodObject.prototype.extend = function(...args) {
4187
+ const extendResult = zodObjectExtend.apply(this, args);
4188
+ const zodOpenApi = extendResult._def.zodOpenApi;
4189
+ if (zodOpenApi) {
4190
+ const cloned = { ...zodOpenApi };
4191
+ cloned.openapi = mergeOpenApi({}, cloned.openapi);
4192
+ cloned[previousSymbol] = this;
4193
+ extendResult._def.zodOpenApi = cloned;
4194
+ } else {
4195
+ extendResult._def.zodOpenApi = {
4196
+ [previousSymbol]: this
4197
+ };
4198
+ }
4199
+ return extendResult;
4200
+ };
4201
+ const zodObjectOmit = zod.ZodObject.prototype.omit;
4202
+ zod.ZodObject.prototype.omit = function(...args) {
4203
+ const omitResult = zodObjectOmit.apply(this, args);
4204
+ const zodOpenApi = omitResult._def.zodOpenApi;
4205
+ if (zodOpenApi) {
4206
+ const cloned = { ...zodOpenApi };
4207
+ cloned.openapi = mergeOpenApi({}, cloned.openapi);
4208
+ delete cloned[previousSymbol];
4209
+ delete cloned[currentSymbol];
4210
+ omitResult._def.zodOpenApi = cloned;
4211
+ }
4212
+ return omitResult;
4213
+ };
4214
+ const zodObjectPick = zod.ZodObject.prototype.pick;
4215
+ zod.ZodObject.prototype.pick = function(...args) {
4216
+ const pickResult = zodObjectPick.apply(this, args);
4217
+ const zodOpenApi = pickResult._def.zodOpenApi;
4218
+ if (zodOpenApi) {
4219
+ const cloned = { ...zodOpenApi };
4220
+ cloned.openapi = mergeOpenApi({}, cloned.openapi);
4221
+ delete cloned[previousSymbol];
4222
+ delete cloned[currentSymbol];
4223
+ pickResult._def.zodOpenApi = cloned;
4224
+ }
4225
+ return pickResult;
4226
+ };
4227
+ }
4228
+ __name(extendZodWithOpenApi, "extendZodWithOpenApi");
4229
+ __name2(extendZodWithOpenApi, "extendZodWithOpenApi");
4230
+ __name22(extendZodWithOpenApi, "extendZodWithOpenApi");
4231
+ extendZodWithOpenApi(z);
4232
+ var ContextValidator = z.array(z.string().or(z.record(z.any())));
4233
+ var AchievementCriteriaValidator = z.object({
4234
+ type: z.string().optional(),
4235
+ narrative: z.string().optional()
3560
4236
  });
3561
- var ImageValidator = mod.string().or(
3562
- mod.object({
3563
- id: mod.string(),
3564
- type: mod.string(),
3565
- caption: mod.string().optional()
4237
+ var ImageValidator = z.string().or(
4238
+ z.object({
4239
+ id: z.string(),
4240
+ type: z.string(),
4241
+ caption: z.string().optional()
3566
4242
  })
3567
4243
  );
3568
- var GeoCoordinatesValidator = mod.object({
3569
- type: mod.string().min(1).or(mod.string().array().nonempty()),
3570
- latitude: mod.number(),
3571
- longitude: mod.number()
4244
+ var GeoCoordinatesValidator = z.object({
4245
+ type: z.string().min(1).or(z.string().array().nonempty()),
4246
+ latitude: z.number(),
4247
+ longitude: z.number()
3572
4248
  });
3573
- var AddressValidator = mod.object({
3574
- type: mod.string().min(1).or(mod.string().array().nonempty()),
3575
- addressCountry: mod.string().optional(),
3576
- addressCountryCode: mod.string().optional(),
3577
- addressRegion: mod.string().optional(),
3578
- addressLocality: mod.string().optional(),
3579
- streetAddress: mod.string().optional(),
3580
- postOfficeBoxNumber: mod.string().optional(),
3581
- postalCode: mod.string().optional(),
4249
+ var AddressValidator = z.object({
4250
+ type: z.string().min(1).or(z.string().array().nonempty()),
4251
+ addressCountry: z.string().optional(),
4252
+ addressCountryCode: z.string().optional(),
4253
+ addressRegion: z.string().optional(),
4254
+ addressLocality: z.string().optional(),
4255
+ streetAddress: z.string().optional(),
4256
+ postOfficeBoxNumber: z.string().optional(),
4257
+ postalCode: z.string().optional(),
3582
4258
  geo: GeoCoordinatesValidator.optional()
3583
4259
  });
3584
- var IdentifierTypeValidator = mod.enum([
4260
+ var IdentifierTypeValidator = z.enum([
3585
4261
  "sourcedId",
3586
4262
  "systemId",
3587
4263
  "productId",
@@ -3600,140 +4276,140 @@ var require_helpers_cjs_development = __commonJS({
3600
4276
  "ltiPlatformId",
3601
4277
  "ltiUserId",
3602
4278
  "identifier"
3603
- ]).or(mod.string());
3604
- var IdentifierEntryValidator = mod.object({
3605
- type: mod.string().min(1).or(mod.string().array().nonempty()),
3606
- identifier: mod.string(),
4279
+ ]).or(z.string());
4280
+ var IdentifierEntryValidator = z.object({
4281
+ type: z.string().min(1).or(z.string().array().nonempty()),
4282
+ identifier: z.string(),
3607
4283
  identifierType: IdentifierTypeValidator
3608
4284
  });
3609
- var ProfileValidator = mod.string().or(
3610
- mod.object({
3611
- id: mod.string().optional(),
3612
- type: mod.string().or(mod.string().array().nonempty().optional()),
3613
- name: mod.string().optional(),
3614
- url: mod.string().optional(),
3615
- phone: mod.string().optional(),
3616
- description: mod.string().optional(),
3617
- endorsement: mod.any().array().optional(),
4285
+ var ProfileValidator = z.string().or(
4286
+ z.object({
4287
+ id: z.string().optional(),
4288
+ type: z.string().or(z.string().array().nonempty().optional()),
4289
+ name: z.string().optional(),
4290
+ url: z.string().optional(),
4291
+ phone: z.string().optional(),
4292
+ description: z.string().optional(),
4293
+ endorsement: z.any().array().optional(),
3618
4294
  image: ImageValidator.optional(),
3619
- email: mod.string().email().optional(),
4295
+ email: z.string().email().optional(),
3620
4296
  address: AddressValidator.optional(),
3621
4297
  otherIdentifier: IdentifierEntryValidator.array().optional(),
3622
- official: mod.string().optional(),
3623
- parentOrg: mod.any().optional(),
3624
- familyName: mod.string().optional(),
3625
- givenName: mod.string().optional(),
3626
- additionalName: mod.string().optional(),
3627
- patronymicName: mod.string().optional(),
3628
- honorificPrefix: mod.string().optional(),
3629
- honorificSuffix: mod.string().optional(),
3630
- familyNamePrefix: mod.string().optional(),
3631
- dateOfBirth: mod.string().optional()
3632
- }).catchall(mod.any())
4298
+ official: z.string().optional(),
4299
+ parentOrg: z.any().optional(),
4300
+ familyName: z.string().optional(),
4301
+ givenName: z.string().optional(),
4302
+ additionalName: z.string().optional(),
4303
+ patronymicName: z.string().optional(),
4304
+ honorificPrefix: z.string().optional(),
4305
+ honorificSuffix: z.string().optional(),
4306
+ familyNamePrefix: z.string().optional(),
4307
+ dateOfBirth: z.string().optional()
4308
+ }).catchall(z.any())
3633
4309
  );
3634
- var CredentialSubjectValidator = mod.object({ id: mod.string().optional() }).catchall(mod.any());
3635
- var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() }).catchall(mod.any());
3636
- var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() }).catchall(mod.any());
3637
- var RefreshServiceValidator = mod.object({ id: mod.string().optional(), type: mod.string() }).catchall(mod.any());
3638
- var TermsOfUseValidator = mod.object({ type: mod.string(), id: mod.string().optional() }).catchall(mod.any());
3639
- var VC2EvidenceValidator = mod.object({ type: mod.string().or(mod.string().array().nonempty()), id: mod.string().optional() }).catchall(mod.any());
3640
- var UnsignedVCValidator = mod.object({
4310
+ var CredentialSubjectValidator = z.object({ id: z.string().optional() }).catchall(z.any());
4311
+ var CredentialStatusValidator = z.object({ type: z.string(), id: z.string() }).catchall(z.any());
4312
+ var CredentialSchemaValidator = z.object({ id: z.string(), type: z.string() }).catchall(z.any());
4313
+ var RefreshServiceValidator = z.object({ id: z.string().optional(), type: z.string() }).catchall(z.any());
4314
+ var TermsOfUseValidator = z.object({ type: z.string(), id: z.string().optional() }).catchall(z.any());
4315
+ var VC2EvidenceValidator = z.object({ type: z.string().or(z.string().array().nonempty()), id: z.string().optional() }).catchall(z.any());
4316
+ var UnsignedVCValidator = z.object({
3641
4317
  "@context": ContextValidator,
3642
- id: mod.string().optional(),
3643
- type: mod.string().array().nonempty(),
4318
+ id: z.string().optional(),
4319
+ type: z.string().array().nonempty(),
3644
4320
  issuer: ProfileValidator,
3645
4321
  credentialSubject: CredentialSubjectValidator.or(CredentialSubjectValidator.array()),
3646
4322
  refreshService: RefreshServiceValidator.or(RefreshServiceValidator.array()).optional(),
3647
4323
  credentialSchema: CredentialSchemaValidator.or(
3648
4324
  CredentialSchemaValidator.array()
3649
4325
  ).optional(),
3650
- issuanceDate: mod.string().optional(),
3651
- expirationDate: mod.string().optional(),
4326
+ issuanceDate: z.string().optional(),
4327
+ expirationDate: z.string().optional(),
3652
4328
  credentialStatus: CredentialStatusValidator.or(
3653
4329
  CredentialStatusValidator.array()
3654
4330
  ).optional(),
3655
- name: mod.string().optional(),
3656
- description: mod.string().optional(),
3657
- validFrom: mod.string().optional(),
3658
- validUntil: mod.string().optional(),
4331
+ name: z.string().optional(),
4332
+ description: z.string().optional(),
4333
+ validFrom: z.string().optional(),
4334
+ validUntil: z.string().optional(),
3659
4335
  status: CredentialStatusValidator.or(CredentialStatusValidator.array()).optional(),
3660
4336
  termsOfUse: TermsOfUseValidator.or(TermsOfUseValidator.array()).optional(),
3661
4337
  evidence: VC2EvidenceValidator.or(VC2EvidenceValidator.array()).optional()
3662
- }).catchall(mod.any());
3663
- var ProofValidator = mod.object({
3664
- type: mod.string(),
3665
- created: mod.string(),
3666
- challenge: mod.string().optional(),
3667
- domain: mod.string().optional(),
3668
- nonce: mod.string().optional(),
3669
- proofPurpose: mod.string(),
3670
- verificationMethod: mod.string(),
3671
- jws: mod.string().optional()
3672
- }).catchall(mod.any());
4338
+ }).catchall(z.any());
4339
+ var ProofValidator = z.object({
4340
+ type: z.string(),
4341
+ created: z.string(),
4342
+ challenge: z.string().optional(),
4343
+ domain: z.string().optional(),
4344
+ nonce: z.string().optional(),
4345
+ proofPurpose: z.string(),
4346
+ verificationMethod: z.string(),
4347
+ jws: z.string().optional()
4348
+ }).catchall(z.any());
3673
4349
  var VCValidator = UnsignedVCValidator.extend({
3674
4350
  proof: ProofValidator.or(ProofValidator.array())
3675
4351
  });
3676
- var UnsignedVPValidator = mod.object({
4352
+ var UnsignedVPValidator = z.object({
3677
4353
  "@context": ContextValidator,
3678
- id: mod.string().optional(),
3679
- type: mod.string().or(mod.string().array().nonempty()),
4354
+ id: z.string().optional(),
4355
+ type: z.string().or(z.string().array().nonempty()),
3680
4356
  verifiableCredential: VCValidator.or(VCValidator.array()).optional(),
3681
- holder: mod.string().optional()
3682
- }).catchall(mod.any());
4357
+ holder: z.string().optional()
4358
+ }).catchall(z.any());
3683
4359
  var VPValidator = UnsignedVPValidator.extend({
3684
4360
  proof: ProofValidator.or(ProofValidator.array())
3685
4361
  });
3686
- var JWKValidator = mod.object({
3687
- kty: mod.string(),
3688
- crv: mod.string(),
3689
- x: mod.string(),
3690
- y: mod.string().optional(),
3691
- n: mod.string().optional(),
3692
- d: mod.string().optional()
4362
+ var JWKValidator = z.object({
4363
+ kty: z.string(),
4364
+ crv: z.string(),
4365
+ x: z.string(),
4366
+ y: z.string().optional(),
4367
+ n: z.string().optional(),
4368
+ d: z.string().optional()
3693
4369
  });
3694
- var JWKWithPrivateKeyValidator = JWKValidator.omit({ d: true }).extend({ d: mod.string() });
3695
- var JWERecipientHeaderValidator = mod.object({
3696
- alg: mod.string(),
3697
- iv: mod.string(),
3698
- tag: mod.string(),
4370
+ var JWKWithPrivateKeyValidator = JWKValidator.omit({ d: true }).extend({ d: z.string() });
4371
+ var JWERecipientHeaderValidator = z.object({
4372
+ alg: z.string(),
4373
+ iv: z.string(),
4374
+ tag: z.string(),
3699
4375
  epk: JWKValidator.partial().optional(),
3700
- kid: mod.string().optional(),
3701
- apv: mod.string().optional(),
3702
- apu: mod.string().optional()
4376
+ kid: z.string().optional(),
4377
+ apv: z.string().optional(),
4378
+ apu: z.string().optional()
3703
4379
  });
3704
- var JWERecipientValidator = mod.object({
4380
+ var JWERecipientValidator = z.object({
3705
4381
  header: JWERecipientHeaderValidator,
3706
- encrypted_key: mod.string()
4382
+ encrypted_key: z.string()
3707
4383
  });
3708
- var JWEValidator2 = mod.object({
3709
- protected: mod.string(),
3710
- iv: mod.string(),
3711
- ciphertext: mod.string(),
3712
- tag: mod.string(),
3713
- aad: mod.string().optional(),
4384
+ var JWEValidator2 = z.object({
4385
+ protected: z.string(),
4386
+ iv: z.string(),
4387
+ ciphertext: z.string(),
4388
+ tag: z.string(),
4389
+ aad: z.string().optional(),
3714
4390
  recipients: JWERecipientValidator.array().optional()
3715
4391
  });
3716
- var VerificationMethodValidator = mod.string().or(
3717
- mod.object({
4392
+ var VerificationMethodValidator = z.string().or(
4393
+ z.object({
3718
4394
  "@context": ContextValidator.optional(),
3719
- id: mod.string(),
3720
- type: mod.string(),
3721
- controller: mod.string(),
4395
+ id: z.string(),
4396
+ type: z.string(),
4397
+ controller: z.string(),
3722
4398
  publicKeyJwk: JWKValidator.optional(),
3723
- publicKeyBase58: mod.string().optional(),
3724
- blockChainAccountId: mod.string().optional()
3725
- }).catchall(mod.any())
4399
+ publicKeyBase58: z.string().optional(),
4400
+ blockChainAccountId: z.string().optional()
4401
+ }).catchall(z.any())
3726
4402
  );
3727
- var ServiceValidator = mod.object({
3728
- id: mod.string(),
3729
- type: mod.string().or(mod.string().array().nonempty()),
3730
- serviceEndpoint: mod.any().or(mod.any().array().nonempty())
3731
- }).catchall(mod.any());
3732
- var DidDocumentValidator = mod.object({
4403
+ var ServiceValidator = z.object({
4404
+ id: z.string(),
4405
+ type: z.string().or(z.string().array().nonempty()),
4406
+ serviceEndpoint: z.any().or(z.any().array().nonempty())
4407
+ }).catchall(z.any());
4408
+ var DidDocumentValidator = z.object({
3733
4409
  "@context": ContextValidator,
3734
- id: mod.string(),
3735
- alsoKnownAs: mod.string().optional(),
3736
- controller: mod.string().or(mod.string().array().nonempty()).optional(),
4410
+ id: z.string(),
4411
+ alsoKnownAs: z.string().optional(),
4412
+ controller: z.string().or(z.string().array().nonempty()).optional(),
3737
4413
  verificationMethod: VerificationMethodValidator.array().optional(),
3738
4414
  authentication: VerificationMethodValidator.array().optional(),
3739
4415
  assertionMethod: VerificationMethodValidator.array().optional(),
@@ -3743,8 +4419,8 @@ var require_helpers_cjs_development = __commonJS({
3743
4419
  publicKey: VerificationMethodValidator.array().optional(),
3744
4420
  service: ServiceValidator.array().optional(),
3745
4421
  proof: ProofValidator.or(ProofValidator.array()).optional()
3746
- }).catchall(mod.any());
3747
- var AlignmentTargetTypeValidator = mod.enum([
4422
+ }).catchall(z.any());
4423
+ var AlignmentTargetTypeValidator = z.enum([
3748
4424
  "ceasn:Competency",
3749
4425
  "ceterms:Credential",
3750
4426
  "CFItem",
@@ -3752,17 +4428,17 @@ var require_helpers_cjs_development = __commonJS({
3752
4428
  "CFRubricCriterion",
3753
4429
  "CFRubricCriterionLevel",
3754
4430
  "CTDL"
3755
- ]).or(mod.string());
3756
- var AlignmentValidator = mod.object({
3757
- type: mod.string().array().nonempty(),
3758
- targetCode: mod.string().optional(),
3759
- targetDescription: mod.string().optional(),
3760
- targetName: mod.string(),
3761
- targetFramework: mod.string().optional(),
4431
+ ]).or(z.string());
4432
+ var AlignmentValidator = z.object({
4433
+ type: z.string().array().nonempty(),
4434
+ targetCode: z.string().optional(),
4435
+ targetDescription: z.string().optional(),
4436
+ targetName: z.string(),
4437
+ targetFramework: z.string().optional(),
3762
4438
  targetType: AlignmentTargetTypeValidator.optional(),
3763
- targetUrl: mod.string()
4439
+ targetUrl: z.string()
3764
4440
  });
3765
- var KnownAchievementTypeValidator = mod.enum([
4441
+ var KnownAchievementTypeValidator = z.enum([
3766
4442
  "Achievement",
3767
4443
  "ApprenticeshipCertificate",
3768
4444
  "Assessment",
@@ -3795,23 +4471,23 @@ var require_helpers_cjs_development = __commonJS({
3795
4471
  "ResearchDoctorate",
3796
4472
  "SecondarySchoolDiploma"
3797
4473
  ]);
3798
- var AchievementTypeValidator = KnownAchievementTypeValidator.or(mod.string());
3799
- var CriteriaValidator = mod.object({ id: mod.string().optional(), narrative: mod.string().optional() }).catchall(mod.any());
3800
- var EndorsementSubjectValidator = mod.object({
3801
- id: mod.string(),
3802
- type: mod.string().array().nonempty(),
3803
- endorsementComment: mod.string().optional()
4474
+ var AchievementTypeValidator = KnownAchievementTypeValidator.or(z.string());
4475
+ var CriteriaValidator = z.object({ id: z.string().optional(), narrative: z.string().optional() }).catchall(z.any());
4476
+ var EndorsementSubjectValidator = z.object({
4477
+ id: z.string(),
4478
+ type: z.string().array().nonempty(),
4479
+ endorsementComment: z.string().optional()
3804
4480
  });
3805
4481
  var EndorsementCredentialValidator = UnsignedVCValidator.extend({
3806
4482
  credentialSubject: EndorsementSubjectValidator,
3807
4483
  proof: ProofValidator.or(ProofValidator.array()).optional()
3808
4484
  });
3809
- var RelatedValidator = mod.object({
3810
- id: mod.string(),
3811
- "@language": mod.string().optional(),
3812
- version: mod.string().optional()
4485
+ var RelatedValidator = z.object({
4486
+ id: z.string(),
4487
+ "@language": z.string().optional(),
4488
+ version: z.string().optional()
3813
4489
  });
3814
- var ResultTypeValidator = mod.enum([
4490
+ var ResultTypeValidator = z.enum([
3815
4491
  "GradePointAverage",
3816
4492
  "LetterGrade",
3817
4493
  "Percent",
@@ -3824,59 +4500,59 @@ var require_helpers_cjs_development = __commonJS({
3824
4500
  "RubricScore",
3825
4501
  "ScaledScore",
3826
4502
  "Status"
3827
- ]).or(mod.string());
3828
- var RubricCriterionValidator = mod.object({
3829
- id: mod.string(),
3830
- type: mod.string().array().nonempty(),
4503
+ ]).or(z.string());
4504
+ var RubricCriterionValidator = z.object({
4505
+ id: z.string(),
4506
+ type: z.string().array().nonempty(),
3831
4507
  alignment: AlignmentValidator.array().optional(),
3832
- description: mod.string().optional(),
3833
- level: mod.string().optional(),
3834
- name: mod.string(),
3835
- points: mod.string().optional()
3836
- }).catchall(mod.any());
3837
- var ResultDescriptionValidator = mod.object({
3838
- id: mod.string(),
3839
- type: mod.string().array().nonempty(),
4508
+ description: z.string().optional(),
4509
+ level: z.string().optional(),
4510
+ name: z.string(),
4511
+ points: z.string().optional()
4512
+ }).catchall(z.any());
4513
+ var ResultDescriptionValidator = z.object({
4514
+ id: z.string(),
4515
+ type: z.string().array().nonempty(),
3840
4516
  alignment: AlignmentValidator.array().optional(),
3841
- allowedValue: mod.string().array().optional(),
3842
- name: mod.string(),
3843
- requiredLevel: mod.string().optional(),
3844
- requiredValue: mod.string().optional(),
4517
+ allowedValue: z.string().array().optional(),
4518
+ name: z.string(),
4519
+ requiredLevel: z.string().optional(),
4520
+ requiredValue: z.string().optional(),
3845
4521
  resultType: ResultTypeValidator,
3846
4522
  rubricCriterionLevel: RubricCriterionValidator.array().optional(),
3847
- valueMax: mod.string().optional(),
3848
- valueMin: mod.string().optional()
3849
- }).catchall(mod.any());
3850
- var AchievementValidator = mod.object({
3851
- id: mod.string().optional(),
3852
- type: mod.string().array().nonempty(),
4523
+ valueMax: z.string().optional(),
4524
+ valueMin: z.string().optional()
4525
+ }).catchall(z.any());
4526
+ var AchievementValidator = z.object({
4527
+ id: z.string().optional(),
4528
+ type: z.string().array().nonempty(),
3853
4529
  alignment: AlignmentValidator.array().optional(),
3854
4530
  achievementType: AchievementTypeValidator.optional(),
3855
4531
  creator: ProfileValidator.optional(),
3856
- creditsAvailable: mod.number().optional(),
4532
+ creditsAvailable: z.number().optional(),
3857
4533
  criteria: CriteriaValidator,
3858
- description: mod.string(),
4534
+ description: z.string(),
3859
4535
  endorsement: EndorsementCredentialValidator.array().optional(),
3860
- fieldOfStudy: mod.string().optional(),
3861
- humanCode: mod.string().optional(),
4536
+ fieldOfStudy: z.string().optional(),
4537
+ humanCode: z.string().optional(),
3862
4538
  image: ImageValidator.optional(),
3863
- "@language": mod.string().optional(),
3864
- name: mod.string(),
4539
+ "@language": z.string().optional(),
4540
+ name: z.string(),
3865
4541
  otherIdentifier: IdentifierEntryValidator.array().optional(),
3866
4542
  related: RelatedValidator.array().optional(),
3867
4543
  resultDescription: ResultDescriptionValidator.array().optional(),
3868
- specialization: mod.string().optional(),
3869
- tag: mod.string().array().optional(),
3870
- version: mod.string().optional()
3871
- }).catchall(mod.any());
3872
- var IdentityObjectValidator = mod.object({
3873
- type: mod.string(),
3874
- hashed: mod.boolean(),
3875
- identityHash: mod.string(),
3876
- identityType: mod.string(),
3877
- salt: mod.string().optional()
4544
+ specialization: z.string().optional(),
4545
+ tag: z.string().array().optional(),
4546
+ version: z.string().optional()
4547
+ }).catchall(z.any());
4548
+ var IdentityObjectValidator = z.object({
4549
+ type: z.string(),
4550
+ hashed: z.boolean(),
4551
+ identityHash: z.string(),
4552
+ identityType: z.string(),
4553
+ salt: z.string().optional()
3878
4554
  });
3879
- var ResultStatusTypeValidator = mod.enum([
4555
+ var ResultStatusTypeValidator = z.enum([
3880
4556
  "Completed",
3881
4557
  "Enrolled",
3882
4558
  "Failed",
@@ -3884,42 +4560,42 @@ var require_helpers_cjs_development = __commonJS({
3884
4560
  "OnHold",
3885
4561
  "Withdrew"
3886
4562
  ]);
3887
- var ResultValidator = mod.object({
3888
- type: mod.string().array().nonempty(),
3889
- achievedLevel: mod.string().optional(),
4563
+ var ResultValidator = z.object({
4564
+ type: z.string().array().nonempty(),
4565
+ achievedLevel: z.string().optional(),
3890
4566
  alignment: AlignmentValidator.array().optional(),
3891
- resultDescription: mod.string().optional(),
4567
+ resultDescription: z.string().optional(),
3892
4568
  status: ResultStatusTypeValidator.optional(),
3893
- value: mod.string().optional()
3894
- }).catchall(mod.any());
3895
- var AchievementSubjectValidator = mod.object({
3896
- id: mod.string().optional(),
3897
- type: mod.string().array().nonempty(),
3898
- activityEndDate: mod.string().optional(),
3899
- activityStartDate: mod.string().optional(),
3900
- creditsEarned: mod.number().optional(),
4569
+ value: z.string().optional()
4570
+ }).catchall(z.any());
4571
+ var AchievementSubjectValidator = z.object({
4572
+ id: z.string().optional(),
4573
+ type: z.string().array().nonempty(),
4574
+ activityEndDate: z.string().optional(),
4575
+ activityStartDate: z.string().optional(),
4576
+ creditsEarned: z.number().optional(),
3901
4577
  achievement: AchievementValidator.optional(),
3902
4578
  identifier: IdentityObjectValidator.array().optional(),
3903
4579
  image: ImageValidator.optional(),
3904
- licenseNumber: mod.string().optional(),
3905
- narrative: mod.string().optional(),
4580
+ licenseNumber: z.string().optional(),
4581
+ narrative: z.string().optional(),
3906
4582
  result: ResultValidator.array().optional(),
3907
- role: mod.string().optional(),
4583
+ role: z.string().optional(),
3908
4584
  source: ProfileValidator.optional(),
3909
- term: mod.string().optional()
3910
- }).catchall(mod.any());
3911
- var EvidenceValidator = mod.object({
3912
- id: mod.string().optional(),
3913
- type: mod.string().or(mod.string().array().nonempty()),
3914
- narrative: mod.string().optional(),
3915
- name: mod.string().optional(),
3916
- description: mod.string().optional(),
3917
- genre: mod.string().optional(),
3918
- audience: mod.string().optional()
3919
- }).catchall(mod.any());
4585
+ term: z.string().optional()
4586
+ }).catchall(z.any());
4587
+ var EvidenceValidator = z.object({
4588
+ id: z.string().optional(),
4589
+ type: z.string().or(z.string().array().nonempty()),
4590
+ narrative: z.string().optional(),
4591
+ name: z.string().optional(),
4592
+ description: z.string().optional(),
4593
+ genre: z.string().optional(),
4594
+ audience: z.string().optional()
4595
+ }).catchall(z.any());
3920
4596
  var UnsignedAchievementCredentialValidator = UnsignedVCValidator.extend({
3921
- name: mod.string().optional(),
3922
- description: mod.string().optional(),
4597
+ name: z.string().optional(),
4598
+ description: z.string().optional(),
3923
4599
  image: ImageValidator.optional(),
3924
4600
  credentialSubject: AchievementSubjectValidator.or(
3925
4601
  AchievementSubjectValidator.array()
@@ -3930,42 +4606,42 @@ var require_helpers_cjs_development = __commonJS({
3930
4606
  var AchievementCredentialValidator = UnsignedAchievementCredentialValidator.extend({
3931
4607
  proof: ProofValidator.or(ProofValidator.array())
3932
4608
  });
3933
- var VerificationCheckValidator = mod.object({
3934
- checks: mod.string().array(),
3935
- warnings: mod.string().array(),
3936
- errors: mod.string().array()
4609
+ var VerificationCheckValidator = z.object({
4610
+ checks: z.string().array(),
4611
+ warnings: z.string().array(),
4612
+ errors: z.string().array()
3937
4613
  });
3938
- var VerificationStatusValidator = mod.enum(["Success", "Failed", "Error"]);
4614
+ var VerificationStatusValidator = z.enum(["Success", "Failed", "Error"]);
3939
4615
  var VerificationStatusEnum = VerificationStatusValidator.enum;
3940
- var VerificationItemValidator = mod.object({
3941
- check: mod.string(),
4616
+ var VerificationItemValidator = z.object({
4617
+ check: z.string(),
3942
4618
  status: VerificationStatusValidator,
3943
- message: mod.string().optional(),
3944
- details: mod.string().optional()
4619
+ message: z.string().optional(),
4620
+ details: z.string().optional()
3945
4621
  });
3946
- var CredentialInfoValidator = mod.object({
3947
- title: mod.string().optional(),
3948
- createdAt: mod.string().optional(),
4622
+ var CredentialInfoValidator = z.object({
4623
+ title: z.string().optional(),
4624
+ createdAt: z.string().optional(),
3949
4625
  issuer: ProfileValidator.optional(),
3950
4626
  issuee: ProfileValidator.optional(),
3951
4627
  credentialSubject: CredentialSubjectValidator.optional()
3952
4628
  });
3953
- var CredentialRecordValidator = mod.object({ id: mod.string(), uri: mod.string() }).catchall(mod.any());
3954
- var PaginationOptionsValidator = mod.object({
3955
- limit: mod.number(),
3956
- cursor: mod.string().optional(),
3957
- sort: mod.string().optional()
4629
+ var CredentialRecordValidator = z.object({ id: z.string(), uri: z.string() }).catchall(z.any());
4630
+ var PaginationOptionsValidator = z.object({
4631
+ limit: z.number(),
4632
+ cursor: z.string().optional(),
4633
+ sort: z.string().optional()
3958
4634
  });
3959
- var PaginationResponseValidator = mod.object({
3960
- cursor: mod.string().optional(),
3961
- hasMore: mod.boolean()
4635
+ var PaginationResponseValidator = z.object({
4636
+ cursor: z.string().optional(),
4637
+ hasMore: z.boolean()
3962
4638
  });
3963
- var EncryptedRecordValidator = mod.object({ encryptedRecord: JWEValidator2, fields: mod.string().array() }).catchall(mod.any());
4639
+ var EncryptedRecordValidator = z.object({ encryptedRecord: JWEValidator2, fields: z.string().array() }).catchall(z.any());
3964
4640
  var PaginatedEncryptedRecordsValidator = PaginationResponseValidator.extend({
3965
4641
  records: EncryptedRecordValidator.array()
3966
4642
  });
3967
4643
  var EncryptedCredentialRecordValidator = EncryptedRecordValidator.extend({
3968
- id: mod.string()
4644
+ id: z.string()
3969
4645
  });
3970
4646
  var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.extend({
3971
4647
  records: EncryptedCredentialRecordValidator.array()
@@ -3976,8 +4652,8 @@ var require_helpers_cjs_development = __commonJS({
3976
4652
  throw new Error("Invalid RegExp string format");
3977
4653
  return { pattern: match[1], flags: match[2] };
3978
4654
  }, "parseRegexString");
3979
- var RegExpValidator = mod.instanceof(RegExp).or(
3980
- mod.string().refine(
4655
+ var RegExpValidator = z.instanceof(RegExp).or(
4656
+ z.string().refine(
3981
4657
  (str) => {
3982
4658
  try {
3983
4659
  parseRegexString(str);
@@ -3998,71 +4674,71 @@ var require_helpers_cjs_development = __commonJS({
3998
4674
  }
3999
4675
  })
4000
4676
  );
4001
- var StringQuery = mod.string().or(mod.object({ $in: mod.string().array() })).or(mod.object({ $regex: RegExpValidator }));
4002
- var LCNProfileDisplayValidator = mod.object({
4003
- backgroundColor: mod.string().optional(),
4004
- backgroundImage: mod.string().optional(),
4005
- fadeBackgroundImage: mod.boolean().optional(),
4006
- repeatBackgroundImage: mod.boolean().optional(),
4007
- fontColor: mod.string().optional(),
4008
- accentColor: mod.string().optional(),
4009
- accentFontColor: mod.string().optional(),
4010
- idBackgroundImage: mod.string().optional(),
4011
- fadeIdBackgroundImage: mod.boolean().optional(),
4012
- idBackgroundColor: mod.string().optional(),
4013
- repeatIdBackgroundImage: mod.boolean().optional()
4677
+ var StringQuery = z.string().or(z.object({ $in: z.string().array() })).or(z.object({ $regex: RegExpValidator }));
4678
+ var LCNProfileDisplayValidator = z.object({
4679
+ backgroundColor: z.string().optional(),
4680
+ backgroundImage: z.string().optional(),
4681
+ fadeBackgroundImage: z.boolean().optional(),
4682
+ repeatBackgroundImage: z.boolean().optional(),
4683
+ fontColor: z.string().optional(),
4684
+ accentColor: z.string().optional(),
4685
+ accentFontColor: z.string().optional(),
4686
+ idBackgroundImage: z.string().optional(),
4687
+ fadeIdBackgroundImage: z.boolean().optional(),
4688
+ idBackgroundColor: z.string().optional(),
4689
+ repeatIdBackgroundImage: z.boolean().optional()
4014
4690
  });
4015
- var LCNProfileValidator = mod.object({
4016
- profileId: mod.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),
4017
- displayName: mod.string().default("").describe("Human-readable display name for the profile."),
4018
- shortBio: mod.string().default("").describe("Short bio for the profile."),
4019
- bio: mod.string().default("").describe("Longer bio for the profile."),
4020
- did: mod.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),
4021
- isPrivate: mod.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),
4022
- email: mod.string().optional().describe("Contact email address for the profile."),
4023
- image: mod.string().optional().describe("Profile image URL for the profile."),
4024
- heroImage: mod.string().optional().describe("Hero image URL for the profile."),
4025
- websiteLink: mod.string().optional().describe("Website link for the profile."),
4026
- isServiceProfile: mod.boolean().default(false).optional().describe("Whether the profile is a service profile or not."),
4027
- type: mod.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),
4028
- notificationsWebhook: mod.string().url().startsWith("http").optional().describe("URL to send notifications to."),
4691
+ var LCNProfileValidator = z.object({
4692
+ profileId: z.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),
4693
+ displayName: z.string().default("").describe("Human-readable display name for the profile."),
4694
+ shortBio: z.string().default("").describe("Short bio for the profile."),
4695
+ bio: z.string().default("").describe("Longer bio for the profile."),
4696
+ did: z.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),
4697
+ isPrivate: z.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),
4698
+ email: z.string().optional().describe("Contact email address for the profile."),
4699
+ image: z.string().optional().describe("Profile image URL for the profile."),
4700
+ heroImage: z.string().optional().describe("Hero image URL for the profile."),
4701
+ websiteLink: z.string().optional().describe("Website link for the profile."),
4702
+ isServiceProfile: z.boolean().default(false).optional().describe("Whether the profile is a service profile or not."),
4703
+ type: z.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),
4704
+ notificationsWebhook: z.string().url().startsWith("http").optional().describe("URL to send notifications to."),
4029
4705
  display: LCNProfileDisplayValidator.optional().describe("Display settings for the profile."),
4030
- role: mod.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),
4031
- dob: mod.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".')
4706
+ role: z.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),
4707
+ dob: z.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".')
4032
4708
  });
4033
- var LCNProfileQueryValidator = mod.object({
4709
+ var LCNProfileQueryValidator = z.object({
4034
4710
  profileId: StringQuery,
4035
4711
  displayName: StringQuery,
4036
4712
  shortBio: StringQuery,
4037
4713
  bio: StringQuery,
4038
4714
  email: StringQuery,
4039
4715
  websiteLink: StringQuery,
4040
- isServiceProfile: mod.boolean(),
4716
+ isServiceProfile: z.boolean(),
4041
4717
  type: StringQuery
4042
4718
  }).partial();
4043
4719
  var PaginatedLCNProfilesValidator = PaginationResponseValidator.extend({
4044
4720
  records: LCNProfileValidator.array()
4045
4721
  });
4046
- var LCNProfileConnectionStatusEnum = mod.enum([
4722
+ var LCNProfileConnectionStatusEnum = z.enum([
4047
4723
  "CONNECTED",
4048
4724
  "PENDING_REQUEST_SENT",
4049
4725
  "PENDING_REQUEST_RECEIVED",
4050
4726
  "NOT_CONNECTED"
4051
4727
  ]);
4052
- var LCNProfileManagerValidator = mod.object({
4053
- id: mod.string(),
4054
- created: mod.string(),
4055
- displayName: mod.string().default("").optional(),
4056
- shortBio: mod.string().default("").optional(),
4057
- bio: mod.string().default("").optional(),
4058
- email: mod.string().optional(),
4059
- image: mod.string().optional(),
4060
- heroImage: mod.string().optional()
4728
+ var LCNProfileManagerValidator = z.object({
4729
+ id: z.string(),
4730
+ created: z.string(),
4731
+ displayName: z.string().default("").optional(),
4732
+ shortBio: z.string().default("").optional(),
4733
+ bio: z.string().default("").optional(),
4734
+ email: z.string().optional(),
4735
+ image: z.string().optional(),
4736
+ heroImage: z.string().optional()
4061
4737
  });
4062
4738
  var PaginatedLCNProfileManagersValidator = PaginationResponseValidator.extend({
4063
- records: LCNProfileManagerValidator.extend({ did: mod.string() }).array()
4739
+ records: LCNProfileManagerValidator.extend({ did: z.string() }).array()
4064
4740
  });
4065
- var LCNProfileManagerQueryValidator = mod.object({
4741
+ var LCNProfileManagerQueryValidator = z.object({
4066
4742
  id: StringQuery,
4067
4743
  displayName: StringQuery,
4068
4744
  shortBio: StringQuery,
@@ -4070,296 +4746,296 @@ var require_helpers_cjs_development = __commonJS({
4070
4746
  email: StringQuery
4071
4747
  }).partial();
4072
4748
  var PaginatedLCNProfilesAndManagersValidator = PaginationResponseValidator.extend({
4073
- records: mod.object({
4749
+ records: z.object({
4074
4750
  profile: LCNProfileValidator,
4075
- manager: LCNProfileManagerValidator.extend({ did: mod.string() }).optional()
4751
+ manager: LCNProfileManagerValidator.extend({ did: z.string() }).optional()
4076
4752
  }).array()
4077
4753
  });
4078
- var SentCredentialInfoValidator = mod.object({
4079
- uri: mod.string(),
4080
- to: mod.string(),
4081
- from: mod.string(),
4082
- sent: mod.string().datetime(),
4083
- received: mod.string().datetime().optional()
4754
+ var SentCredentialInfoValidator = z.object({
4755
+ uri: z.string(),
4756
+ to: z.string(),
4757
+ from: z.string(),
4758
+ sent: z.string().datetime(),
4759
+ received: z.string().datetime().optional()
4084
4760
  });
4085
- var BoostPermissionsValidator = mod.object({
4086
- role: mod.string(),
4087
- canEdit: mod.boolean(),
4088
- canIssue: mod.boolean(),
4089
- canRevoke: mod.boolean(),
4090
- canManagePermissions: mod.boolean(),
4091
- canIssueChildren: mod.string(),
4092
- canCreateChildren: mod.string(),
4093
- canEditChildren: mod.string(),
4094
- canRevokeChildren: mod.string(),
4095
- canManageChildrenPermissions: mod.string(),
4096
- canManageChildrenProfiles: mod.boolean().default(false).optional(),
4097
- canViewAnalytics: mod.boolean()
4761
+ var BoostPermissionsValidator = z.object({
4762
+ role: z.string(),
4763
+ canEdit: z.boolean(),
4764
+ canIssue: z.boolean(),
4765
+ canRevoke: z.boolean(),
4766
+ canManagePermissions: z.boolean(),
4767
+ canIssueChildren: z.string(),
4768
+ canCreateChildren: z.string(),
4769
+ canEditChildren: z.string(),
4770
+ canRevokeChildren: z.string(),
4771
+ canManageChildrenPermissions: z.string(),
4772
+ canManageChildrenProfiles: z.boolean().default(false).optional(),
4773
+ canViewAnalytics: z.boolean()
4098
4774
  });
4099
- var BoostPermissionsQueryValidator = mod.object({
4775
+ var BoostPermissionsQueryValidator = z.object({
4100
4776
  role: StringQuery,
4101
- canEdit: mod.boolean(),
4102
- canIssue: mod.boolean(),
4103
- canRevoke: mod.boolean(),
4104
- canManagePermissions: mod.boolean(),
4777
+ canEdit: z.boolean(),
4778
+ canIssue: z.boolean(),
4779
+ canRevoke: z.boolean(),
4780
+ canManagePermissions: z.boolean(),
4105
4781
  canIssueChildren: StringQuery,
4106
4782
  canCreateChildren: StringQuery,
4107
4783
  canEditChildren: StringQuery,
4108
4784
  canRevokeChildren: StringQuery,
4109
4785
  canManageChildrenPermissions: StringQuery,
4110
- canManageChildrenProfiles: mod.boolean(),
4111
- canViewAnalytics: mod.boolean()
4786
+ canManageChildrenProfiles: z.boolean(),
4787
+ canViewAnalytics: z.boolean()
4112
4788
  }).partial();
4113
- var ClaimHookTypeValidator = mod.enum(["GRANT_PERMISSIONS", "ADD_ADMIN"]);
4114
- var ClaimHookValidator = mod.discriminatedUnion("type", [
4115
- mod.object({
4116
- type: mod.literal(ClaimHookTypeValidator.Values.GRANT_PERMISSIONS),
4117
- data: mod.object({
4118
- claimUri: mod.string(),
4119
- targetUri: mod.string(),
4789
+ var ClaimHookTypeValidator = z.enum(["GRANT_PERMISSIONS", "ADD_ADMIN"]);
4790
+ var ClaimHookValidator = z.discriminatedUnion("type", [
4791
+ z.object({
4792
+ type: z.literal(ClaimHookTypeValidator.Values.GRANT_PERMISSIONS),
4793
+ data: z.object({
4794
+ claimUri: z.string(),
4795
+ targetUri: z.string(),
4120
4796
  permissions: BoostPermissionsValidator.partial()
4121
4797
  })
4122
4798
  }),
4123
- mod.object({
4124
- type: mod.literal(ClaimHookTypeValidator.Values.ADD_ADMIN),
4125
- data: mod.object({ claimUri: mod.string(), targetUri: mod.string() })
4799
+ z.object({
4800
+ type: z.literal(ClaimHookTypeValidator.Values.ADD_ADMIN),
4801
+ data: z.object({ claimUri: z.string(), targetUri: z.string() })
4126
4802
  })
4127
4803
  ]);
4128
- var ClaimHookQueryValidator = mod.object({
4804
+ var ClaimHookQueryValidator = z.object({
4129
4805
  type: StringQuery,
4130
- data: mod.object({
4806
+ data: z.object({
4131
4807
  claimUri: StringQuery,
4132
4808
  targetUri: StringQuery,
4133
4809
  permissions: BoostPermissionsQueryValidator
4134
4810
  })
4135
4811
  }).deepPartial();
4136
- var FullClaimHookValidator = mod.object({ id: mod.string(), createdAt: mod.string(), updatedAt: mod.string() }).and(ClaimHookValidator);
4812
+ var FullClaimHookValidator = z.object({ id: z.string(), createdAt: z.string(), updatedAt: z.string() }).and(ClaimHookValidator);
4137
4813
  var PaginatedClaimHooksValidator = PaginationResponseValidator.extend({
4138
4814
  records: FullClaimHookValidator.array()
4139
4815
  });
4140
- var LCNBoostStatus = mod.enum(["DRAFT", "LIVE"]);
4141
- var BoostValidator = mod.object({
4142
- uri: mod.string(),
4143
- name: mod.string().optional(),
4144
- type: mod.string().optional(),
4145
- category: mod.string().optional(),
4816
+ var LCNBoostStatus = z.enum(["DRAFT", "LIVE"]);
4817
+ var BoostValidator = z.object({
4818
+ uri: z.string(),
4819
+ name: z.string().optional(),
4820
+ type: z.string().optional(),
4821
+ category: z.string().optional(),
4146
4822
  status: LCNBoostStatus.optional(),
4147
- autoConnectRecipients: mod.boolean().optional(),
4148
- meta: mod.record(mod.any()).optional(),
4823
+ autoConnectRecipients: z.boolean().optional(),
4824
+ meta: z.record(z.any()).optional(),
4149
4825
  claimPermissions: BoostPermissionsValidator.optional()
4150
4826
  });
4151
- var BoostQueryValidator = mod.object({
4827
+ var BoostQueryValidator = z.object({
4152
4828
  uri: StringQuery,
4153
4829
  name: StringQuery,
4154
4830
  type: StringQuery,
4155
4831
  category: StringQuery,
4156
- meta: mod.record(StringQuery),
4157
- status: LCNBoostStatus.or(mod.object({ $in: LCNBoostStatus.array() })),
4158
- autoConnectRecipients: mod.boolean()
4832
+ meta: z.record(StringQuery),
4833
+ status: LCNBoostStatus.or(z.object({ $in: LCNBoostStatus.array() })),
4834
+ autoConnectRecipients: z.boolean()
4159
4835
  }).partial();
4160
4836
  var PaginatedBoostsValidator = PaginationResponseValidator.extend({
4161
4837
  records: BoostValidator.array()
4162
4838
  });
4163
- var BoostRecipientValidator = mod.object({
4839
+ var BoostRecipientValidator = z.object({
4164
4840
  to: LCNProfileValidator,
4165
- from: mod.string(),
4166
- received: mod.string().optional(),
4167
- uri: mod.string().optional()
4841
+ from: z.string(),
4842
+ received: z.string().optional(),
4843
+ uri: z.string().optional()
4168
4844
  });
4169
4845
  var PaginatedBoostRecipientsValidator = PaginationResponseValidator.extend({
4170
4846
  records: BoostRecipientValidator.array()
4171
4847
  });
4172
- var LCNBoostClaimLinkSigningAuthorityValidator = mod.object({
4173
- endpoint: mod.string(),
4174
- name: mod.string(),
4175
- did: mod.string().optional()
4848
+ var LCNBoostClaimLinkSigningAuthorityValidator = z.object({
4849
+ endpoint: z.string(),
4850
+ name: z.string(),
4851
+ did: z.string().optional()
4176
4852
  });
4177
- var LCNBoostClaimLinkOptionsValidator = mod.object({
4178
- ttlSeconds: mod.number().optional(),
4179
- totalUses: mod.number().optional()
4853
+ var LCNBoostClaimLinkOptionsValidator = z.object({
4854
+ ttlSeconds: z.number().optional(),
4855
+ totalUses: z.number().optional()
4180
4856
  });
4181
- var LCNSigningAuthorityValidator = mod.object({
4182
- endpoint: mod.string()
4857
+ var LCNSigningAuthorityValidator = z.object({
4858
+ endpoint: z.string()
4183
4859
  });
4184
- var LCNSigningAuthorityForUserValidator = mod.object({
4860
+ var LCNSigningAuthorityForUserValidator = z.object({
4185
4861
  signingAuthority: LCNSigningAuthorityValidator,
4186
- relationship: mod.object({
4187
- name: mod.string().max(15).regex(/^[a-z0-9-]+$/, {
4862
+ relationship: z.object({
4863
+ name: z.string().max(15).regex(/^[a-z0-9-]+$/, {
4188
4864
  message: "The input string must contain only lowercase letters, numbers, and hyphens."
4189
4865
  }),
4190
- did: mod.string()
4866
+ did: z.string()
4191
4867
  })
4192
4868
  });
4193
- var AutoBoostConfigValidator = mod.object({
4194
- boostUri: mod.string(),
4195
- signingAuthority: mod.object({
4196
- endpoint: mod.string(),
4197
- name: mod.string()
4869
+ var AutoBoostConfigValidator = z.object({
4870
+ boostUri: z.string(),
4871
+ signingAuthority: z.object({
4872
+ endpoint: z.string(),
4873
+ name: z.string()
4198
4874
  })
4199
4875
  });
4200
- var ConsentFlowTermsStatusValidator = mod.enum(["live", "stale", "withdrawn"]);
4201
- var ConsentFlowContractValidator = mod.object({
4202
- read: mod.object({
4203
- anonymize: mod.boolean().optional(),
4204
- credentials: mod.object({ categories: mod.record(mod.object({ required: mod.boolean() })).default({}) }).default({}),
4205
- personal: mod.record(mod.object({ required: mod.boolean() })).default({})
4876
+ var ConsentFlowTermsStatusValidator = z.enum(["live", "stale", "withdrawn"]);
4877
+ var ConsentFlowContractValidator = z.object({
4878
+ read: z.object({
4879
+ anonymize: z.boolean().optional(),
4880
+ credentials: z.object({ categories: z.record(z.object({ required: z.boolean() })).default({}) }).default({}),
4881
+ personal: z.record(z.object({ required: z.boolean() })).default({})
4206
4882
  }).default({}),
4207
- write: mod.object({
4208
- credentials: mod.object({ categories: mod.record(mod.object({ required: mod.boolean() })).default({}) }).default({}),
4209
- personal: mod.record(mod.object({ required: mod.boolean() })).default({})
4883
+ write: z.object({
4884
+ credentials: z.object({ categories: z.record(z.object({ required: z.boolean() })).default({}) }).default({}),
4885
+ personal: z.record(z.object({ required: z.boolean() })).default({})
4210
4886
  }).default({})
4211
4887
  });
4212
- var ConsentFlowContractDetailsValidator = mod.object({
4888
+ var ConsentFlowContractDetailsValidator = z.object({
4213
4889
  contract: ConsentFlowContractValidator,
4214
4890
  owner: LCNProfileValidator,
4215
- name: mod.string(),
4216
- subtitle: mod.string().optional(),
4217
- description: mod.string().optional(),
4218
- reasonForAccessing: mod.string().optional(),
4219
- image: mod.string().optional(),
4220
- uri: mod.string(),
4221
- needsGuardianConsent: mod.boolean().optional(),
4222
- redirectUrl: mod.string().optional(),
4223
- frontDoorBoostUri: mod.string().optional(),
4224
- createdAt: mod.string(),
4225
- updatedAt: mod.string(),
4226
- expiresAt: mod.string().optional(),
4227
- autoBoosts: mod.string().array().optional(),
4228
- writers: mod.array(LCNProfileValidator).optional()
4891
+ name: z.string(),
4892
+ subtitle: z.string().optional(),
4893
+ description: z.string().optional(),
4894
+ reasonForAccessing: z.string().optional(),
4895
+ image: z.string().optional(),
4896
+ uri: z.string(),
4897
+ needsGuardianConsent: z.boolean().optional(),
4898
+ redirectUrl: z.string().optional(),
4899
+ frontDoorBoostUri: z.string().optional(),
4900
+ createdAt: z.string(),
4901
+ updatedAt: z.string(),
4902
+ expiresAt: z.string().optional(),
4903
+ autoBoosts: z.string().array().optional(),
4904
+ writers: z.array(LCNProfileValidator).optional()
4229
4905
  });
4230
4906
  var PaginatedConsentFlowContractsValidator = PaginationResponseValidator.extend({
4231
4907
  records: ConsentFlowContractDetailsValidator.omit({ owner: true }).array()
4232
4908
  });
4233
- var ConsentFlowContractDataValidator = mod.object({
4234
- credentials: mod.object({ categories: mod.record(mod.string().array()).default({}) }),
4235
- personal: mod.record(mod.string()).default({}),
4236
- date: mod.string()
4909
+ var ConsentFlowContractDataValidator = z.object({
4910
+ credentials: z.object({ categories: z.record(z.string().array()).default({}) }),
4911
+ personal: z.record(z.string()).default({}),
4912
+ date: z.string()
4237
4913
  });
4238
4914
  var PaginatedConsentFlowDataValidator = PaginationResponseValidator.extend({
4239
4915
  records: ConsentFlowContractDataValidator.array()
4240
4916
  });
4241
- var ConsentFlowContractDataForDidValidator = mod.object({
4242
- credentials: mod.object({ category: mod.string(), uri: mod.string() }).array(),
4243
- personal: mod.record(mod.string()).default({}),
4244
- date: mod.string(),
4245
- contractUri: mod.string()
4917
+ var ConsentFlowContractDataForDidValidator = z.object({
4918
+ credentials: z.object({ category: z.string(), uri: z.string() }).array(),
4919
+ personal: z.record(z.string()).default({}),
4920
+ date: z.string(),
4921
+ contractUri: z.string()
4246
4922
  });
4247
4923
  var PaginatedConsentFlowDataForDidValidator = PaginationResponseValidator.extend({
4248
4924
  records: ConsentFlowContractDataForDidValidator.array()
4249
4925
  });
4250
- var ConsentFlowTermValidator = mod.object({
4251
- sharing: mod.boolean().optional(),
4252
- shared: mod.string().array().optional(),
4253
- shareAll: mod.boolean().optional(),
4254
- shareUntil: mod.string().optional()
4926
+ var ConsentFlowTermValidator = z.object({
4927
+ sharing: z.boolean().optional(),
4928
+ shared: z.string().array().optional(),
4929
+ shareAll: z.boolean().optional(),
4930
+ shareUntil: z.string().optional()
4255
4931
  });
4256
- var ConsentFlowTermsValidator = mod.object({
4257
- read: mod.object({
4258
- anonymize: mod.boolean().optional(),
4259
- credentials: mod.object({
4260
- shareAll: mod.boolean().optional(),
4261
- sharing: mod.boolean().optional(),
4262
- categories: mod.record(ConsentFlowTermValidator).default({})
4932
+ var ConsentFlowTermsValidator = z.object({
4933
+ read: z.object({
4934
+ anonymize: z.boolean().optional(),
4935
+ credentials: z.object({
4936
+ shareAll: z.boolean().optional(),
4937
+ sharing: z.boolean().optional(),
4938
+ categories: z.record(ConsentFlowTermValidator).default({})
4263
4939
  }).default({}),
4264
- personal: mod.record(mod.string()).default({})
4940
+ personal: z.record(z.string()).default({})
4265
4941
  }).default({}),
4266
- write: mod.object({
4267
- credentials: mod.object({ categories: mod.record(mod.boolean()).default({}) }).default({}),
4268
- personal: mod.record(mod.boolean()).default({})
4942
+ write: z.object({
4943
+ credentials: z.object({ categories: z.record(z.boolean()).default({}) }).default({}),
4944
+ personal: z.record(z.boolean()).default({})
4269
4945
  }).default({}),
4270
- deniedWriters: mod.array(mod.string()).optional()
4946
+ deniedWriters: z.array(z.string()).optional()
4271
4947
  });
4272
4948
  var PaginatedConsentFlowTermsValidator = PaginationResponseValidator.extend({
4273
- records: mod.object({
4274
- expiresAt: mod.string().optional(),
4275
- oneTime: mod.boolean().optional(),
4949
+ records: z.object({
4950
+ expiresAt: z.string().optional(),
4951
+ oneTime: z.boolean().optional(),
4276
4952
  terms: ConsentFlowTermsValidator,
4277
4953
  contract: ConsentFlowContractDetailsValidator,
4278
- uri: mod.string(),
4954
+ uri: z.string(),
4279
4955
  consenter: LCNProfileValidator,
4280
4956
  status: ConsentFlowTermsStatusValidator
4281
4957
  }).array()
4282
4958
  });
4283
- var ConsentFlowContractQueryValidator = mod.object({
4284
- read: mod.object({
4285
- anonymize: mod.boolean().optional(),
4286
- credentials: mod.object({
4287
- categories: mod.record(mod.object({ required: mod.boolean().optional() })).optional()
4959
+ var ConsentFlowContractQueryValidator = z.object({
4960
+ read: z.object({
4961
+ anonymize: z.boolean().optional(),
4962
+ credentials: z.object({
4963
+ categories: z.record(z.object({ required: z.boolean().optional() })).optional()
4288
4964
  }).optional(),
4289
- personal: mod.record(mod.object({ required: mod.boolean().optional() })).optional()
4965
+ personal: z.record(z.object({ required: z.boolean().optional() })).optional()
4290
4966
  }).optional(),
4291
- write: mod.object({
4292
- credentials: mod.object({
4293
- categories: mod.record(mod.object({ required: mod.boolean().optional() })).optional()
4967
+ write: z.object({
4968
+ credentials: z.object({
4969
+ categories: z.record(z.object({ required: z.boolean().optional() })).optional()
4294
4970
  }).optional(),
4295
- personal: mod.record(mod.object({ required: mod.boolean().optional() })).optional()
4971
+ personal: z.record(z.object({ required: z.boolean().optional() })).optional()
4296
4972
  }).optional()
4297
4973
  });
4298
- var ConsentFlowDataQueryValidator = mod.object({
4299
- anonymize: mod.boolean().optional(),
4300
- credentials: mod.object({ categories: mod.record(mod.boolean()).optional() }).optional(),
4301
- personal: mod.record(mod.boolean()).optional()
4974
+ var ConsentFlowDataQueryValidator = z.object({
4975
+ anonymize: z.boolean().optional(),
4976
+ credentials: z.object({ categories: z.record(z.boolean()).optional() }).optional(),
4977
+ personal: z.record(z.boolean()).optional()
4302
4978
  });
4303
- var ConsentFlowDataForDidQueryValidator = mod.object({
4304
- credentials: mod.object({ categories: mod.record(mod.boolean()).optional() }).optional(),
4305
- personal: mod.record(mod.boolean()).optional(),
4979
+ var ConsentFlowDataForDidQueryValidator = z.object({
4980
+ credentials: z.object({ categories: z.record(z.boolean()).optional() }).optional(),
4981
+ personal: z.record(z.boolean()).optional(),
4306
4982
  id: StringQuery.optional()
4307
4983
  });
4308
- var ConsentFlowTermsQueryValidator = mod.object({
4309
- read: mod.object({
4310
- anonymize: mod.boolean().optional(),
4311
- credentials: mod.object({
4312
- shareAll: mod.boolean().optional(),
4313
- sharing: mod.boolean().optional(),
4314
- categories: mod.record(ConsentFlowTermValidator.optional()).optional()
4984
+ var ConsentFlowTermsQueryValidator = z.object({
4985
+ read: z.object({
4986
+ anonymize: z.boolean().optional(),
4987
+ credentials: z.object({
4988
+ shareAll: z.boolean().optional(),
4989
+ sharing: z.boolean().optional(),
4990
+ categories: z.record(ConsentFlowTermValidator.optional()).optional()
4315
4991
  }).optional(),
4316
- personal: mod.record(mod.string()).optional()
4992
+ personal: z.record(z.string()).optional()
4317
4993
  }).optional(),
4318
- write: mod.object({
4319
- credentials: mod.object({ categories: mod.record(mod.boolean()).optional() }).optional(),
4320
- personal: mod.record(mod.boolean()).optional()
4994
+ write: z.object({
4995
+ credentials: z.object({ categories: z.record(z.boolean()).optional() }).optional(),
4996
+ personal: z.record(z.boolean()).optional()
4321
4997
  }).optional()
4322
4998
  });
4323
- var ConsentFlowTransactionActionValidator = mod.enum([
4999
+ var ConsentFlowTransactionActionValidator = z.enum([
4324
5000
  "consent",
4325
5001
  "update",
4326
5002
  "sync",
4327
5003
  "withdraw",
4328
5004
  "write"
4329
5005
  ]);
4330
- var ConsentFlowTransactionsQueryValidator = mod.object({
5006
+ var ConsentFlowTransactionsQueryValidator = z.object({
4331
5007
  terms: ConsentFlowTermsQueryValidator.optional(),
4332
5008
  action: ConsentFlowTransactionActionValidator.or(
4333
5009
  ConsentFlowTransactionActionValidator.array()
4334
5010
  ).optional(),
4335
- date: mod.object({ $gt: mod.string() }).or(mod.object({ $lt: mod.string() })).or(mod.object({ $eq: mod.string() })).optional(),
4336
- expiresAt: mod.object({ $gt: mod.string() }).or(mod.object({ $lt: mod.string() })).or(mod.object({ $eq: mod.string() })).optional(),
4337
- oneTime: mod.boolean().optional()
5011
+ date: z.object({ $gt: z.string() }).or(z.object({ $lt: z.string() })).or(z.object({ $eq: z.string() })).optional(),
5012
+ expiresAt: z.object({ $gt: z.string() }).or(z.object({ $lt: z.string() })).or(z.object({ $eq: z.string() })).optional(),
5013
+ oneTime: z.boolean().optional()
4338
5014
  });
4339
- var ConsentFlowTransactionValidator = mod.object({
4340
- expiresAt: mod.string().optional(),
4341
- oneTime: mod.boolean().optional(),
5015
+ var ConsentFlowTransactionValidator = z.object({
5016
+ expiresAt: z.string().optional(),
5017
+ oneTime: z.boolean().optional(),
4342
5018
  terms: ConsentFlowTermsValidator.optional(),
4343
- id: mod.string(),
5019
+ id: z.string(),
4344
5020
  action: ConsentFlowTransactionActionValidator,
4345
- date: mod.string(),
4346
- uris: mod.string().array().optional()
5021
+ date: z.string(),
5022
+ uris: z.string().array().optional()
4347
5023
  });
4348
5024
  var PaginatedConsentFlowTransactionsValidator = PaginationResponseValidator.extend({
4349
5025
  records: ConsentFlowTransactionValidator.array()
4350
5026
  });
4351
- var ContractCredentialValidator = mod.object({
4352
- credentialUri: mod.string(),
4353
- termsUri: mod.string(),
4354
- contractUri: mod.string(),
4355
- boostUri: mod.string(),
4356
- category: mod.string().optional(),
4357
- date: mod.string()
5027
+ var ContractCredentialValidator = z.object({
5028
+ credentialUri: z.string(),
5029
+ termsUri: z.string(),
5030
+ contractUri: z.string(),
5031
+ boostUri: z.string(),
5032
+ category: z.string().optional(),
5033
+ date: z.string()
4358
5034
  });
4359
5035
  var PaginatedContractCredentialsValidator = PaginationResponseValidator.extend({
4360
5036
  records: ContractCredentialValidator.array()
4361
5037
  });
4362
- var LCNNotificationTypeEnumValidator = mod.enum([
5038
+ var LCNNotificationTypeEnumValidator = z.enum([
4363
5039
  "CONNECTION_REQUEST",
4364
5040
  "CONNECTION_ACCEPTED",
4365
5041
  "CREDENTIAL_RECEIVED",
@@ -4370,40 +5046,40 @@ var require_helpers_cjs_development = __commonJS({
4370
5046
  "PRESENTATION_RECEIVED",
4371
5047
  "CONSENT_FLOW_TRANSACTION"
4372
5048
  ]);
4373
- var LCNNotificationMessageValidator = mod.object({
4374
- title: mod.string().optional(),
4375
- body: mod.string().optional()
5049
+ var LCNNotificationMessageValidator = z.object({
5050
+ title: z.string().optional(),
5051
+ body: z.string().optional()
4376
5052
  });
4377
- var LCNNotificationDataValidator = mod.object({
4378
- vcUris: mod.array(mod.string()).optional(),
4379
- vpUris: mod.array(mod.string()).optional(),
5053
+ var LCNNotificationDataValidator = z.object({
5054
+ vcUris: z.array(z.string()).optional(),
5055
+ vpUris: z.array(z.string()).optional(),
4380
5056
  transaction: ConsentFlowTransactionValidator.optional()
4381
5057
  });
4382
- var LCNNotificationValidator = mod.object({
5058
+ var LCNNotificationValidator = z.object({
4383
5059
  type: LCNNotificationTypeEnumValidator,
4384
- to: LCNProfileValidator.partial().and(mod.object({ did: mod.string() })),
4385
- from: LCNProfileValidator.partial().and(mod.object({ did: mod.string() })),
5060
+ to: LCNProfileValidator.partial().and(z.object({ did: z.string() })),
5061
+ from: LCNProfileValidator.partial().and(z.object({ did: z.string() })),
4386
5062
  message: LCNNotificationMessageValidator.optional(),
4387
5063
  data: LCNNotificationDataValidator.optional(),
4388
- sent: mod.string().datetime().optional()
5064
+ sent: z.string().datetime().optional()
4389
5065
  });
4390
5066
  var AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX = "auth-grant:";
4391
- var AuthGrantValidator = mod.object({
4392
- id: mod.string(),
4393
- name: mod.string(),
4394
- description: mod.string().optional(),
4395
- challenge: mod.string().startsWith(AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX).min(10, { message: "Challenge is too short" }).max(100, { message: "Challenge is too long" }),
4396
- status: mod.enum(["revoked", "active"], {
5067
+ var AuthGrantValidator = z.object({
5068
+ id: z.string(),
5069
+ name: z.string(),
5070
+ description: z.string().optional(),
5071
+ challenge: z.string().startsWith(AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX).min(10, { message: "Challenge is too short" }).max(100, { message: "Challenge is too long" }),
5072
+ status: z.enum(["revoked", "active"], {
4397
5073
  required_error: "Status is required",
4398
5074
  invalid_type_error: "Status must be either active or revoked"
4399
5075
  }),
4400
- scope: mod.string(),
4401
- createdAt: mod.string().datetime({ message: "createdAt must be a valid ISO 8601 datetime string" }),
4402
- expiresAt: mod.string().datetime({ message: "expiresAt must be a valid ISO 8601 datetime string" }).nullish().optional()
5076
+ scope: z.string(),
5077
+ createdAt: z.string().datetime({ message: "createdAt must be a valid ISO 8601 datetime string" }),
5078
+ expiresAt: z.string().datetime({ message: "expiresAt must be a valid ISO 8601 datetime string" }).nullish().optional()
4403
5079
  });
4404
- var FlatAuthGrantValidator = mod.object({ id: mod.string() }).catchall(mod.any());
4405
- var AuthGrantStatusValidator = mod.enum(["active", "revoked"]);
4406
- var AuthGrantQueryValidator = mod.object({
5080
+ var FlatAuthGrantValidator = z.object({ id: z.string() }).catchall(z.any());
5081
+ var AuthGrantStatusValidator = z.enum(["active", "revoked"]);
5082
+ var AuthGrantQueryValidator = z.object({
4407
5083
  id: StringQuery,
4408
5084
  name: StringQuery,
4409
5085
  description: StringQuery,
@@ -4525,16 +5201,17 @@ var callbackLink = /* @__PURE__ */ __name((callback) => {
4525
5201
  // src/index.ts
4526
5202
  var getClient = /* @__PURE__ */ __name(async (url, didAuthFunction) => {
4527
5203
  let challenges = [];
4528
- const challengeRequester = (0, import_client.createTRPCProxyClient)({
4529
- transformer: {
4530
- input: import_helpers.RegExpTransformer,
4531
- output: { serialize: (o) => o, deserialize: (o) => o }
4532
- },
5204
+ const challengeRequester = (0, import_client.createTRPCClient)({
4533
5205
  links: [
4534
5206
  (0, import_client.httpBatchLink)({
5207
+ methodOverride: "POST",
4535
5208
  url,
4536
- maxURLLength: 2048,
4537
- headers: { Authorization: `Bearer ${await didAuthFunction()}` }
5209
+ maxURLLength: 3072,
5210
+ headers: { Authorization: `Bearer ${await didAuthFunction()}` },
5211
+ transformer: {
5212
+ input: import_helpers.RegExpTransformer,
5213
+ output: { serialize: (o) => o, deserialize: (o) => o }
5214
+ }
4538
5215
  })
4539
5216
  ]
4540
5217
  });
@@ -4542,22 +5219,23 @@ var getClient = /* @__PURE__ */ __name(async (url, didAuthFunction) => {
4542
5219
  return challengeRequester.utilities.getChallenges.query({ amount });
4543
5220
  }, "getChallenges");
4544
5221
  getChallenges().then((result) => challenges = result);
4545
- const trpc = (0, import_client.createTRPCProxyClient)({
4546
- transformer: {
4547
- input: import_helpers.RegExpTransformer,
4548
- output: { serialize: (o) => o, deserialize: (o) => o }
4549
- },
5222
+ const trpc = (0, import_client.createTRPCClient)({
4550
5223
  links: [
4551
5224
  callbackLink(async () => {
4552
5225
  challenges = await getChallenges();
4553
5226
  }),
4554
5227
  (0, import_client.httpBatchLink)({
4555
- maxURLLength: 2048,
5228
+ methodOverride: "POST",
5229
+ maxURLLength: 3072,
4556
5230
  url,
4557
5231
  headers: async () => {
4558
5232
  if (challenges.length === 0)
4559
5233
  challenges.push(...await getChallenges());
4560
5234
  return { Authorization: `Bearer ${await didAuthFunction(challenges.pop())}` };
5235
+ },
5236
+ transformer: {
5237
+ input: import_helpers.RegExpTransformer,
5238
+ output: { serialize: (o) => o, deserialize: (o) => o }
4561
5239
  }
4562
5240
  })
4563
5241
  ]