@learncard/helpers 1.1.16 → 1.1.17

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.
@@ -42,7 +42,7 @@ var require_types_cjs_development = __commonJS({
42
42
  }
43
43
  return to;
44
44
  }, "__copyProps");
45
- var __toCommonJS = /* @__PURE__ */ __name((mod2) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod2), "__toCommonJS");
45
+ var __toCommonJS = /* @__PURE__ */ __name((mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod), "__toCommonJS");
46
46
  var src_exports = {};
47
47
  __export(src_exports, {
48
48
  AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX: () => AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX,
@@ -229,6 +229,15 @@ var require_types_cjs_development = __commonJS({
229
229
  return value;
230
230
  };
231
231
  })(util || (util = {}));
232
+ var objectUtil;
233
+ (function(objectUtil2) {
234
+ objectUtil2.mergeShapes = (first, second) => {
235
+ return {
236
+ ...first,
237
+ ...second
238
+ };
239
+ };
240
+ })(objectUtil || (objectUtil = {}));
232
241
  var ZodParsedType = util.arrayToEnum([
233
242
  "string",
234
243
  "nan",
@@ -372,6 +381,11 @@ var require_types_cjs_development = __commonJS({
372
381
  processError(this);
373
382
  return fieldErrors;
374
383
  }
384
+ static assert(value) {
385
+ if (!(value instanceof ZodError)) {
386
+ throw new Error(`Not a ZodError: ${value}`);
387
+ }
388
+ }
375
389
  toString() {
376
390
  return this.message;
377
391
  }
@@ -439,7 +453,12 @@ var require_types_cjs_development = __commonJS({
439
453
  break;
440
454
  case ZodIssueCode.invalid_string:
441
455
  if (typeof issue.validation === "object") {
442
- if ("startsWith" in issue.validation) {
456
+ if ("includes" in issue.validation) {
457
+ message = `Invalid input: must include "${issue.validation.includes}"`;
458
+ if (typeof issue.validation.position === "number") {
459
+ message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
460
+ }
461
+ } else if ("startsWith" in issue.validation) {
443
462
  message = `Invalid input: must start with "${issue.validation.startsWith}"`;
444
463
  } else if ("endsWith" in issue.validation) {
445
464
  message = `Invalid input: must end with "${issue.validation.endsWith}"`;
@@ -460,7 +479,7 @@ var require_types_cjs_development = __commonJS({
460
479
  else if (issue.type === "number")
461
480
  message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
462
481
  else if (issue.type === "date")
463
- message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(issue.minimum)}`;
482
+ message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
464
483
  else
465
484
  message = "Invalid input";
466
485
  break;
@@ -471,8 +490,10 @@ var require_types_cjs_development = __commonJS({
471
490
  message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
472
491
  else if (issue.type === "number")
473
492
  message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
493
+ else if (issue.type === "bigint")
494
+ message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
474
495
  else if (issue.type === "date")
475
- message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(issue.maximum)}`;
496
+ message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
476
497
  else
477
498
  message = "Invalid input";
478
499
  break;
@@ -512,6 +533,13 @@ var require_types_cjs_development = __commonJS({
512
533
  ...issueData,
513
534
  path: fullPath
514
535
  };
536
+ if (issueData.message !== void 0) {
537
+ return {
538
+ ...issueData,
539
+ path: fullPath,
540
+ message: issueData.message
541
+ };
542
+ }
515
543
  let errorMessage = "";
516
544
  const maps = errorMaps.filter((m) => !!m).slice().reverse();
517
545
  for (const map of maps) {
@@ -520,11 +548,12 @@ var require_types_cjs_development = __commonJS({
520
548
  return {
521
549
  ...issueData,
522
550
  path: fullPath,
523
- message: issueData.message || errorMessage
551
+ message: errorMessage
524
552
  };
525
553
  }, "makeIssue");
526
554
  var EMPTY_PATH = [];
527
555
  function addIssueToContext(ctx, issueData) {
556
+ const overrideMap = getErrorMap();
528
557
  const issue = makeIssue({
529
558
  issueData,
530
559
  data: ctx.data,
@@ -532,8 +561,8 @@ var require_types_cjs_development = __commonJS({
532
561
  errorMaps: [
533
562
  ctx.common.contextualErrorMap,
534
563
  ctx.schemaErrorMap,
535
- getErrorMap(),
536
- errorMap
564
+ overrideMap,
565
+ overrideMap === errorMap ? void 0 : errorMap
537
566
  ].filter((x) => !!x)
538
567
  });
539
568
  ctx.common.issues.push(issue);
@@ -566,9 +595,11 @@ var require_types_cjs_development = __commonJS({
566
595
  static async mergeObjectAsync(status, pairs) {
567
596
  const syncPairs = [];
568
597
  for (const pair of pairs) {
598
+ const key = await pair.key;
599
+ const value = await pair.value;
569
600
  syncPairs.push({
570
- key: await pair.key,
571
- value: await pair.value
601
+ key,
602
+ value
572
603
  });
573
604
  }
574
605
  return ParseStatus.mergeObjectSync(status, syncPairs);
@@ -585,7 +616,7 @@ var require_types_cjs_development = __commonJS({
585
616
  status.dirty();
586
617
  if (value.status === "dirty")
587
618
  status.dirty();
588
- if (typeof value.value !== "undefined" || pair.alwaysSet) {
619
+ if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
589
620
  finalObject[key.value] = value.value;
590
621
  }
591
622
  }
@@ -601,21 +632,51 @@ var require_types_cjs_development = __commonJS({
601
632
  var isAborted = /* @__PURE__ */ __name2((x) => x.status === "aborted", "isAborted");
602
633
  var isDirty = /* @__PURE__ */ __name2((x) => x.status === "dirty", "isDirty");
603
634
  var isValid = /* @__PURE__ */ __name2((x) => x.status === "valid", "isValid");
604
- var isAsync = /* @__PURE__ */ __name2((x) => typeof Promise !== void 0 && x instanceof Promise, "isAsync");
635
+ var isAsync = /* @__PURE__ */ __name2((x) => typeof Promise !== "undefined" && x instanceof Promise, "isAsync");
636
+ function __classPrivateFieldGet(receiver, state, kind, f) {
637
+ if (kind === "a" && !f)
638
+ throw new TypeError("Private accessor was defined without a getter");
639
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
640
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
641
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
642
+ }
643
+ __name(__classPrivateFieldGet, "__classPrivateFieldGet");
644
+ __name2(__classPrivateFieldGet, "__classPrivateFieldGet");
645
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
646
+ if (kind === "m")
647
+ throw new TypeError("Private method is not writable");
648
+ if (kind === "a" && !f)
649
+ throw new TypeError("Private accessor was defined without a setter");
650
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
651
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
652
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
653
+ }
654
+ __name(__classPrivateFieldSet, "__classPrivateFieldSet");
655
+ __name2(__classPrivateFieldSet, "__classPrivateFieldSet");
605
656
  var errorUtil;
606
657
  (function(errorUtil2) {
607
658
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
608
659
  errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
609
660
  })(errorUtil || (errorUtil = {}));
661
+ var _ZodEnum_cache;
662
+ var _ZodNativeEnum_cache;
610
663
  var ParseInputLazyPath = /* @__PURE__ */ __name(class {
611
664
  constructor(parent, value, path, key) {
665
+ this._cachedPath = [];
612
666
  this.parent = parent;
613
667
  this.data = value;
614
668
  this._path = path;
615
669
  this._key = key;
616
670
  }
617
671
  get path() {
618
- return this._path.concat(this._key);
672
+ if (!this._cachedPath.length) {
673
+ if (this._key instanceof Array) {
674
+ this._cachedPath.push(...this._path, ...this._key);
675
+ } else {
676
+ this._cachedPath.push(...this._path, this._key);
677
+ }
678
+ }
679
+ return this._cachedPath;
619
680
  }
620
681
  }, "ParseInputLazyPath");
621
682
  __name2(ParseInputLazyPath, "ParseInputLazyPath");
@@ -626,8 +687,16 @@ var require_types_cjs_development = __commonJS({
626
687
  if (!ctx.common.issues.length) {
627
688
  throw new Error("Validation failed but no issues detected.");
628
689
  }
629
- const error = new ZodError(ctx.common.issues);
630
- return { success: false, error };
690
+ return {
691
+ success: false,
692
+ get error() {
693
+ if (this._error)
694
+ return this._error;
695
+ const error = new ZodError(ctx.common.issues);
696
+ this._error = error;
697
+ return this._error;
698
+ }
699
+ };
631
700
  }
632
701
  }, "handleResult");
633
702
  function processCreateParams(params) {
@@ -640,12 +709,17 @@ var require_types_cjs_development = __commonJS({
640
709
  if (errorMap2)
641
710
  return { errorMap: errorMap2, description };
642
711
  const customMap = /* @__PURE__ */ __name2((iss, ctx) => {
643
- if (iss.code !== "invalid_type")
644
- return { message: ctx.defaultError };
712
+ var _a, _b;
713
+ const { message } = params;
714
+ if (iss.code === "invalid_enum_value") {
715
+ return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
716
+ }
645
717
  if (typeof ctx.data === "undefined") {
646
- return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError };
718
+ return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
647
719
  }
648
- return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError };
720
+ if (iss.code !== "invalid_type")
721
+ return { message: ctx.defaultError };
722
+ return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
649
723
  }, "customMap");
650
724
  return { errorMap: customMap, description };
651
725
  }
@@ -676,6 +750,7 @@ var require_types_cjs_development = __commonJS({
676
750
  this.catch = this.catch.bind(this);
677
751
  this.describe = this.describe.bind(this);
678
752
  this.pipe = this.pipe.bind(this);
753
+ this.readonly = this.readonly.bind(this);
679
754
  this.isNullable = this.isNullable.bind(this);
680
755
  this.isOptional = this.isOptional.bind(this);
681
756
  }
@@ -820,28 +895,29 @@ var require_types_cjs_development = __commonJS({
820
895
  return this._refinement(refinement);
821
896
  }
822
897
  optional() {
823
- return ZodOptional.create(this);
898
+ return ZodOptional.create(this, this._def);
824
899
  }
825
900
  nullable() {
826
- return ZodNullable.create(this);
901
+ return ZodNullable.create(this, this._def);
827
902
  }
828
903
  nullish() {
829
- return this.optional().nullable();
904
+ return this.nullable().optional();
830
905
  }
831
906
  array() {
832
- return ZodArray.create(this);
907
+ return ZodArray.create(this, this._def);
833
908
  }
834
909
  promise() {
835
- return ZodPromise.create(this);
910
+ return ZodPromise.create(this, this._def);
836
911
  }
837
912
  or(option) {
838
- return ZodUnion.create([this, option]);
913
+ return ZodUnion.create([this, option], this._def);
839
914
  }
840
915
  and(incoming) {
841
- return ZodIntersection.create(this, incoming);
916
+ return ZodIntersection.create(this, incoming, this._def);
842
917
  }
843
918
  transform(transform) {
844
919
  return new ZodEffects({
920
+ ...processCreateParams(this._def),
845
921
  schema: this,
846
922
  typeName: ZodFirstPartyTypeKind.ZodEffects,
847
923
  effect: { type: "transform", transform }
@@ -850,6 +926,7 @@ var require_types_cjs_development = __commonJS({
850
926
  default(def) {
851
927
  const defaultValueFunc = typeof def === "function" ? def : () => def;
852
928
  return new ZodDefault({
929
+ ...processCreateParams(this._def),
853
930
  innerType: this,
854
931
  defaultValue: defaultValueFunc,
855
932
  typeName: ZodFirstPartyTypeKind.ZodDefault
@@ -859,14 +936,15 @@ var require_types_cjs_development = __commonJS({
859
936
  return new ZodBranded({
860
937
  typeName: ZodFirstPartyTypeKind.ZodBranded,
861
938
  type: this,
862
- ...processCreateParams(void 0)
939
+ ...processCreateParams(this._def)
863
940
  });
864
941
  }
865
942
  catch(def) {
866
- const defaultValueFunc = typeof def === "function" ? def : () => def;
943
+ const catchValueFunc = typeof def === "function" ? def : () => def;
867
944
  return new ZodCatch({
945
+ ...processCreateParams(this._def),
868
946
  innerType: this,
869
- defaultValue: defaultValueFunc,
947
+ catchValue: catchValueFunc,
870
948
  typeName: ZodFirstPartyTypeKind.ZodCatch
871
949
  });
872
950
  }
@@ -880,6 +958,9 @@ var require_types_cjs_development = __commonJS({
880
958
  pipe(target) {
881
959
  return ZodPipeline.create(this, target);
882
960
  }
961
+ readonly() {
962
+ return ZodReadonly.create(this);
963
+ }
883
964
  isOptional() {
884
965
  return this.safeParse(void 0).success;
885
966
  }
@@ -889,43 +970,58 @@ var require_types_cjs_development = __commonJS({
889
970
  }, "ZodType");
890
971
  __name2(ZodType, "ZodType");
891
972
  var cuidRegex = /^c[^\s-]{8,}$/i;
892
- 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;
893
- var emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
894
- var datetimeRegex = /* @__PURE__ */ __name2((args) => {
973
+ var cuid2Regex = /^[0-9a-z]+$/;
974
+ var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
975
+ 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;
976
+ var nanoidRegex = /^[a-z0-9_-]{21}$/i;
977
+ 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)?)??$/;
978
+ var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
979
+ var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
980
+ var emojiRegex;
981
+ 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])$/;
982
+ 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})))$/;
983
+ var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
984
+ 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])))`;
985
+ var dateRegex = new RegExp(`^${dateRegexSource}$`);
986
+ function timeRegexSource(args) {
987
+ let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
895
988
  if (args.precision) {
896
- if (args.offset) {
897
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
898
- } else {
899
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
900
- }
901
- } else if (args.precision === 0) {
902
- if (args.offset) {
903
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
904
- } else {
905
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
906
- }
907
- } else {
908
- if (args.offset) {
909
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
910
- } else {
911
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
912
- }
989
+ regex = `${regex}\\.\\d{${args.precision}}`;
990
+ } else if (args.precision == null) {
991
+ regex = `${regex}(\\.\\d+)?`;
913
992
  }
914
- }, "datetimeRegex");
915
- var ZodString = /* @__PURE__ */ __name(class extends ZodType {
916
- constructor() {
917
- super(...arguments);
918
- this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {
919
- validation,
920
- code: ZodIssueCode.invalid_string,
921
- ...errorUtil.errToObj(message)
922
- });
923
- this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));
924
- this.trim = () => new ZodString({
925
- ...this._def,
926
- checks: [...this._def.checks, { kind: "trim" }]
927
- });
993
+ return regex;
994
+ }
995
+ __name(timeRegexSource, "timeRegexSource");
996
+ __name2(timeRegexSource, "timeRegexSource");
997
+ function timeRegex(args) {
998
+ return new RegExp(`^${timeRegexSource(args)}$`);
999
+ }
1000
+ __name(timeRegex, "timeRegex");
1001
+ __name2(timeRegex, "timeRegex");
1002
+ function datetimeRegex(args) {
1003
+ let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
1004
+ const opts = [];
1005
+ opts.push(args.local ? `Z?` : `Z`);
1006
+ if (args.offset)
1007
+ opts.push(`([+-]\\d{2}:?\\d{2})`);
1008
+ regex = `${regex}(${opts.join("|")})`;
1009
+ return new RegExp(`^${regex}$`);
1010
+ }
1011
+ __name(datetimeRegex, "datetimeRegex");
1012
+ __name2(datetimeRegex, "datetimeRegex");
1013
+ function isValidIP(ip, version) {
1014
+ if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
1015
+ return true;
928
1016
  }
1017
+ if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
1018
+ return true;
1019
+ }
1020
+ return false;
1021
+ }
1022
+ __name(isValidIP, "isValidIP");
1023
+ __name2(isValidIP, "isValidIP");
1024
+ var ZodString = /* @__PURE__ */ __name(class extends ZodType {
929
1025
  _parse(input) {
930
1026
  if (this._def.coerce) {
931
1027
  input.data = String(input.data);
@@ -933,14 +1029,11 @@ var require_types_cjs_development = __commonJS({
933
1029
  const parsedType = this._getType(input);
934
1030
  if (parsedType !== ZodParsedType.string) {
935
1031
  const ctx2 = this._getOrReturnCtx(input);
936
- addIssueToContext(
937
- ctx2,
938
- {
939
- code: ZodIssueCode.invalid_type,
940
- expected: ZodParsedType.string,
941
- received: ctx2.parsedType
942
- }
943
- );
1032
+ addIssueToContext(ctx2, {
1033
+ code: ZodIssueCode.invalid_type,
1034
+ expected: ZodParsedType.string,
1035
+ received: ctx2.parsedType
1036
+ });
944
1037
  return INVALID;
945
1038
  }
946
1039
  const status = new ParseStatus();
@@ -1008,6 +1101,19 @@ var require_types_cjs_development = __commonJS({
1008
1101
  });
1009
1102
  status.dirty();
1010
1103
  }
1104
+ } else if (check.kind === "emoji") {
1105
+ if (!emojiRegex) {
1106
+ emojiRegex = new RegExp(_emojiRegex, "u");
1107
+ }
1108
+ if (!emojiRegex.test(input.data)) {
1109
+ ctx = this._getOrReturnCtx(input, ctx);
1110
+ addIssueToContext(ctx, {
1111
+ validation: "emoji",
1112
+ code: ZodIssueCode.invalid_string,
1113
+ message: check.message
1114
+ });
1115
+ status.dirty();
1116
+ }
1011
1117
  } else if (check.kind === "uuid") {
1012
1118
  if (!uuidRegex.test(input.data)) {
1013
1119
  ctx = this._getOrReturnCtx(input, ctx);
@@ -1018,6 +1124,16 @@ var require_types_cjs_development = __commonJS({
1018
1124
  });
1019
1125
  status.dirty();
1020
1126
  }
1127
+ } else if (check.kind === "nanoid") {
1128
+ if (!nanoidRegex.test(input.data)) {
1129
+ ctx = this._getOrReturnCtx(input, ctx);
1130
+ addIssueToContext(ctx, {
1131
+ validation: "nanoid",
1132
+ code: ZodIssueCode.invalid_string,
1133
+ message: check.message
1134
+ });
1135
+ status.dirty();
1136
+ }
1021
1137
  } else if (check.kind === "cuid") {
1022
1138
  if (!cuidRegex.test(input.data)) {
1023
1139
  ctx = this._getOrReturnCtx(input, ctx);
@@ -1028,6 +1144,26 @@ var require_types_cjs_development = __commonJS({
1028
1144
  });
1029
1145
  status.dirty();
1030
1146
  }
1147
+ } else if (check.kind === "cuid2") {
1148
+ if (!cuid2Regex.test(input.data)) {
1149
+ ctx = this._getOrReturnCtx(input, ctx);
1150
+ addIssueToContext(ctx, {
1151
+ validation: "cuid2",
1152
+ code: ZodIssueCode.invalid_string,
1153
+ message: check.message
1154
+ });
1155
+ status.dirty();
1156
+ }
1157
+ } else if (check.kind === "ulid") {
1158
+ if (!ulidRegex.test(input.data)) {
1159
+ ctx = this._getOrReturnCtx(input, ctx);
1160
+ addIssueToContext(ctx, {
1161
+ validation: "ulid",
1162
+ code: ZodIssueCode.invalid_string,
1163
+ message: check.message
1164
+ });
1165
+ status.dirty();
1166
+ }
1031
1167
  } else if (check.kind === "url") {
1032
1168
  try {
1033
1169
  new URL(input.data);
@@ -1054,6 +1190,20 @@ var require_types_cjs_development = __commonJS({
1054
1190
  }
1055
1191
  } else if (check.kind === "trim") {
1056
1192
  input.data = input.data.trim();
1193
+ } else if (check.kind === "includes") {
1194
+ if (!input.data.includes(check.value, check.position)) {
1195
+ ctx = this._getOrReturnCtx(input, ctx);
1196
+ addIssueToContext(ctx, {
1197
+ code: ZodIssueCode.invalid_string,
1198
+ validation: { includes: check.value, position: check.position },
1199
+ message: check.message
1200
+ });
1201
+ status.dirty();
1202
+ }
1203
+ } else if (check.kind === "toLowerCase") {
1204
+ input.data = input.data.toLowerCase();
1205
+ } else if (check.kind === "toUpperCase") {
1206
+ input.data = input.data.toUpperCase();
1057
1207
  } else if (check.kind === "startsWith") {
1058
1208
  if (!input.data.startsWith(check.value)) {
1059
1209
  ctx = this._getOrReturnCtx(input, ctx);
@@ -1085,12 +1235,71 @@ var require_types_cjs_development = __commonJS({
1085
1235
  });
1086
1236
  status.dirty();
1087
1237
  }
1238
+ } else if (check.kind === "date") {
1239
+ const regex = dateRegex;
1240
+ if (!regex.test(input.data)) {
1241
+ ctx = this._getOrReturnCtx(input, ctx);
1242
+ addIssueToContext(ctx, {
1243
+ code: ZodIssueCode.invalid_string,
1244
+ validation: "date",
1245
+ message: check.message
1246
+ });
1247
+ status.dirty();
1248
+ }
1249
+ } else if (check.kind === "time") {
1250
+ const regex = timeRegex(check);
1251
+ if (!regex.test(input.data)) {
1252
+ ctx = this._getOrReturnCtx(input, ctx);
1253
+ addIssueToContext(ctx, {
1254
+ code: ZodIssueCode.invalid_string,
1255
+ validation: "time",
1256
+ message: check.message
1257
+ });
1258
+ status.dirty();
1259
+ }
1260
+ } else if (check.kind === "duration") {
1261
+ if (!durationRegex.test(input.data)) {
1262
+ ctx = this._getOrReturnCtx(input, ctx);
1263
+ addIssueToContext(ctx, {
1264
+ validation: "duration",
1265
+ code: ZodIssueCode.invalid_string,
1266
+ message: check.message
1267
+ });
1268
+ status.dirty();
1269
+ }
1270
+ } else if (check.kind === "ip") {
1271
+ if (!isValidIP(input.data, check.version)) {
1272
+ ctx = this._getOrReturnCtx(input, ctx);
1273
+ addIssueToContext(ctx, {
1274
+ validation: "ip",
1275
+ code: ZodIssueCode.invalid_string,
1276
+ message: check.message
1277
+ });
1278
+ status.dirty();
1279
+ }
1280
+ } else if (check.kind === "base64") {
1281
+ if (!base64Regex.test(input.data)) {
1282
+ ctx = this._getOrReturnCtx(input, ctx);
1283
+ addIssueToContext(ctx, {
1284
+ validation: "base64",
1285
+ code: ZodIssueCode.invalid_string,
1286
+ message: check.message
1287
+ });
1288
+ status.dirty();
1289
+ }
1088
1290
  } else {
1089
1291
  util.assertNever(check);
1090
1292
  }
1091
1293
  }
1092
1294
  return { status: status.value, value: input.data };
1093
1295
  }
1296
+ _regex(regex, validation, message) {
1297
+ return this.refinement((data) => regex.test(data), {
1298
+ validation,
1299
+ code: ZodIssueCode.invalid_string,
1300
+ ...errorUtil.errToObj(message)
1301
+ });
1302
+ }
1094
1303
  _addCheck(check) {
1095
1304
  return new ZodString({
1096
1305
  ...this._def,
@@ -1103,19 +1312,38 @@ var require_types_cjs_development = __commonJS({
1103
1312
  url(message) {
1104
1313
  return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) });
1105
1314
  }
1315
+ emoji(message) {
1316
+ return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) });
1317
+ }
1106
1318
  uuid(message) {
1107
1319
  return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
1108
1320
  }
1321
+ nanoid(message) {
1322
+ return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
1323
+ }
1109
1324
  cuid(message) {
1110
1325
  return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
1111
1326
  }
1327
+ cuid2(message) {
1328
+ return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
1329
+ }
1330
+ ulid(message) {
1331
+ return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
1332
+ }
1333
+ base64(message) {
1334
+ return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
1335
+ }
1336
+ ip(options) {
1337
+ return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
1338
+ }
1112
1339
  datetime(options) {
1113
- var _a;
1340
+ var _a, _b;
1114
1341
  if (typeof options === "string") {
1115
1342
  return this._addCheck({
1116
1343
  kind: "datetime",
1117
1344
  precision: null,
1118
1345
  offset: false,
1346
+ local: false,
1119
1347
  message: options
1120
1348
  });
1121
1349
  }
@@ -1123,9 +1351,30 @@ var require_types_cjs_development = __commonJS({
1123
1351
  kind: "datetime",
1124
1352
  precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
1125
1353
  offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
1354
+ local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
1355
+ ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
1356
+ });
1357
+ }
1358
+ date(message) {
1359
+ return this._addCheck({ kind: "date", message });
1360
+ }
1361
+ time(options) {
1362
+ if (typeof options === "string") {
1363
+ return this._addCheck({
1364
+ kind: "time",
1365
+ precision: null,
1366
+ message: options
1367
+ });
1368
+ }
1369
+ return this._addCheck({
1370
+ kind: "time",
1371
+ precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
1126
1372
  ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
1127
1373
  });
1128
1374
  }
1375
+ duration(message) {
1376
+ return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
1377
+ }
1129
1378
  regex(regex, message) {
1130
1379
  return this._addCheck({
1131
1380
  kind: "regex",
@@ -1133,6 +1382,14 @@ var require_types_cjs_development = __commonJS({
1133
1382
  ...errorUtil.errToObj(message)
1134
1383
  });
1135
1384
  }
1385
+ includes(value, options) {
1386
+ return this._addCheck({
1387
+ kind: "includes",
1388
+ value,
1389
+ position: options === null || options === void 0 ? void 0 : options.position,
1390
+ ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
1391
+ });
1392
+ }
1136
1393
  startsWith(value, message) {
1137
1394
  return this._addCheck({
1138
1395
  kind: "startsWith",
@@ -1168,21 +1425,69 @@ var require_types_cjs_development = __commonJS({
1168
1425
  ...errorUtil.errToObj(message)
1169
1426
  });
1170
1427
  }
1428
+ nonempty(message) {
1429
+ return this.min(1, errorUtil.errToObj(message));
1430
+ }
1431
+ trim() {
1432
+ return new ZodString({
1433
+ ...this._def,
1434
+ checks: [...this._def.checks, { kind: "trim" }]
1435
+ });
1436
+ }
1437
+ toLowerCase() {
1438
+ return new ZodString({
1439
+ ...this._def,
1440
+ checks: [...this._def.checks, { kind: "toLowerCase" }]
1441
+ });
1442
+ }
1443
+ toUpperCase() {
1444
+ return new ZodString({
1445
+ ...this._def,
1446
+ checks: [...this._def.checks, { kind: "toUpperCase" }]
1447
+ });
1448
+ }
1171
1449
  get isDatetime() {
1172
1450
  return !!this._def.checks.find((ch) => ch.kind === "datetime");
1173
1451
  }
1452
+ get isDate() {
1453
+ return !!this._def.checks.find((ch) => ch.kind === "date");
1454
+ }
1455
+ get isTime() {
1456
+ return !!this._def.checks.find((ch) => ch.kind === "time");
1457
+ }
1458
+ get isDuration() {
1459
+ return !!this._def.checks.find((ch) => ch.kind === "duration");
1460
+ }
1174
1461
  get isEmail() {
1175
1462
  return !!this._def.checks.find((ch) => ch.kind === "email");
1176
1463
  }
1177
1464
  get isURL() {
1178
1465
  return !!this._def.checks.find((ch) => ch.kind === "url");
1179
1466
  }
1467
+ get isEmoji() {
1468
+ return !!this._def.checks.find((ch) => ch.kind === "emoji");
1469
+ }
1180
1470
  get isUUID() {
1181
1471
  return !!this._def.checks.find((ch) => ch.kind === "uuid");
1182
1472
  }
1473
+ get isNANOID() {
1474
+ return !!this._def.checks.find((ch) => ch.kind === "nanoid");
1475
+ }
1183
1476
  get isCUID() {
1184
1477
  return !!this._def.checks.find((ch) => ch.kind === "cuid");
1185
1478
  }
1479
+ get isCUID2() {
1480
+ return !!this._def.checks.find((ch) => ch.kind === "cuid2");
1481
+ }
1482
+ get isULID() {
1483
+ return !!this._def.checks.find((ch) => ch.kind === "ulid");
1484
+ }
1485
+ get isIP() {
1486
+ return !!this._def.checks.find((ch) => ch.kind === "ip");
1487
+ }
1488
+ get isBase64() {
1489
+ return !!this._def.checks.find((ch) => ch.kind === "base64");
1490
+ }
1186
1491
  get minLength() {
1187
1492
  let min = null;
1188
1493
  for (const ch of this._def.checks) {
@@ -1395,6 +1700,19 @@ var require_types_cjs_development = __commonJS({
1395
1700
  message: errorUtil.toString(message)
1396
1701
  });
1397
1702
  }
1703
+ safe(message) {
1704
+ return this._addCheck({
1705
+ kind: "min",
1706
+ inclusive: true,
1707
+ value: Number.MIN_SAFE_INTEGER,
1708
+ message: errorUtil.toString(message)
1709
+ })._addCheck({
1710
+ kind: "max",
1711
+ inclusive: true,
1712
+ value: Number.MAX_SAFE_INTEGER,
1713
+ message: errorUtil.toString(message)
1714
+ });
1715
+ }
1398
1716
  get minValue() {
1399
1717
  let min = null;
1400
1718
  for (const ch of this._def.checks) {
@@ -1416,7 +1734,22 @@ var require_types_cjs_development = __commonJS({
1416
1734
  return max;
1417
1735
  }
1418
1736
  get isInt() {
1419
- return !!this._def.checks.find((ch) => ch.kind === "int");
1737
+ return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
1738
+ }
1739
+ get isFinite() {
1740
+ let max = null, min = null;
1741
+ for (const ch of this._def.checks) {
1742
+ if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
1743
+ return true;
1744
+ } else if (ch.kind === "min") {
1745
+ if (min === null || ch.value > min)
1746
+ min = ch.value;
1747
+ } else if (ch.kind === "max") {
1748
+ if (max === null || ch.value < max)
1749
+ max = ch.value;
1750
+ }
1751
+ }
1752
+ return Number.isFinite(min) && Number.isFinite(max);
1420
1753
  }
1421
1754
  }, "ZodNumber");
1422
1755
  __name2(ZodNumber, "ZodNumber");
@@ -1429,27 +1762,167 @@ var require_types_cjs_development = __commonJS({
1429
1762
  });
1430
1763
  };
1431
1764
  var ZodBigInt = /* @__PURE__ */ __name(class extends ZodType {
1765
+ constructor() {
1766
+ super(...arguments);
1767
+ this.min = this.gte;
1768
+ this.max = this.lte;
1769
+ }
1432
1770
  _parse(input) {
1433
1771
  if (this._def.coerce) {
1434
1772
  input.data = BigInt(input.data);
1435
1773
  }
1436
1774
  const parsedType = this._getType(input);
1437
1775
  if (parsedType !== ZodParsedType.bigint) {
1438
- const ctx = this._getOrReturnCtx(input);
1439
- addIssueToContext(ctx, {
1776
+ const ctx2 = this._getOrReturnCtx(input);
1777
+ addIssueToContext(ctx2, {
1440
1778
  code: ZodIssueCode.invalid_type,
1441
1779
  expected: ZodParsedType.bigint,
1442
- received: ctx.parsedType
1780
+ received: ctx2.parsedType
1443
1781
  });
1444
1782
  return INVALID;
1445
1783
  }
1446
- return OK(input.data);
1784
+ let ctx = void 0;
1785
+ const status = new ParseStatus();
1786
+ for (const check of this._def.checks) {
1787
+ if (check.kind === "min") {
1788
+ const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
1789
+ if (tooSmall) {
1790
+ ctx = this._getOrReturnCtx(input, ctx);
1791
+ addIssueToContext(ctx, {
1792
+ code: ZodIssueCode.too_small,
1793
+ type: "bigint",
1794
+ minimum: check.value,
1795
+ inclusive: check.inclusive,
1796
+ message: check.message
1797
+ });
1798
+ status.dirty();
1799
+ }
1800
+ } else if (check.kind === "max") {
1801
+ const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
1802
+ if (tooBig) {
1803
+ ctx = this._getOrReturnCtx(input, ctx);
1804
+ addIssueToContext(ctx, {
1805
+ code: ZodIssueCode.too_big,
1806
+ type: "bigint",
1807
+ maximum: check.value,
1808
+ inclusive: check.inclusive,
1809
+ message: check.message
1810
+ });
1811
+ status.dirty();
1812
+ }
1813
+ } else if (check.kind === "multipleOf") {
1814
+ if (input.data % check.value !== BigInt(0)) {
1815
+ ctx = this._getOrReturnCtx(input, ctx);
1816
+ addIssueToContext(ctx, {
1817
+ code: ZodIssueCode.not_multiple_of,
1818
+ multipleOf: check.value,
1819
+ message: check.message
1820
+ });
1821
+ status.dirty();
1822
+ }
1823
+ } else {
1824
+ util.assertNever(check);
1825
+ }
1826
+ }
1827
+ return { status: status.value, value: input.data };
1828
+ }
1829
+ gte(value, message) {
1830
+ return this.setLimit("min", value, true, errorUtil.toString(message));
1831
+ }
1832
+ gt(value, message) {
1833
+ return this.setLimit("min", value, false, errorUtil.toString(message));
1834
+ }
1835
+ lte(value, message) {
1836
+ return this.setLimit("max", value, true, errorUtil.toString(message));
1837
+ }
1838
+ lt(value, message) {
1839
+ return this.setLimit("max", value, false, errorUtil.toString(message));
1840
+ }
1841
+ setLimit(kind, value, inclusive, message) {
1842
+ return new ZodBigInt({
1843
+ ...this._def,
1844
+ checks: [
1845
+ ...this._def.checks,
1846
+ {
1847
+ kind,
1848
+ value,
1849
+ inclusive,
1850
+ message: errorUtil.toString(message)
1851
+ }
1852
+ ]
1853
+ });
1854
+ }
1855
+ _addCheck(check) {
1856
+ return new ZodBigInt({
1857
+ ...this._def,
1858
+ checks: [...this._def.checks, check]
1859
+ });
1860
+ }
1861
+ positive(message) {
1862
+ return this._addCheck({
1863
+ kind: "min",
1864
+ value: BigInt(0),
1865
+ inclusive: false,
1866
+ message: errorUtil.toString(message)
1867
+ });
1868
+ }
1869
+ negative(message) {
1870
+ return this._addCheck({
1871
+ kind: "max",
1872
+ value: BigInt(0),
1873
+ inclusive: false,
1874
+ message: errorUtil.toString(message)
1875
+ });
1876
+ }
1877
+ nonpositive(message) {
1878
+ return this._addCheck({
1879
+ kind: "max",
1880
+ value: BigInt(0),
1881
+ inclusive: true,
1882
+ message: errorUtil.toString(message)
1883
+ });
1884
+ }
1885
+ nonnegative(message) {
1886
+ return this._addCheck({
1887
+ kind: "min",
1888
+ value: BigInt(0),
1889
+ inclusive: true,
1890
+ message: errorUtil.toString(message)
1891
+ });
1892
+ }
1893
+ multipleOf(value, message) {
1894
+ return this._addCheck({
1895
+ kind: "multipleOf",
1896
+ value,
1897
+ message: errorUtil.toString(message)
1898
+ });
1899
+ }
1900
+ get minValue() {
1901
+ let min = null;
1902
+ for (const ch of this._def.checks) {
1903
+ if (ch.kind === "min") {
1904
+ if (min === null || ch.value > min)
1905
+ min = ch.value;
1906
+ }
1907
+ }
1908
+ return min;
1909
+ }
1910
+ get maxValue() {
1911
+ let max = null;
1912
+ for (const ch of this._def.checks) {
1913
+ if (ch.kind === "max") {
1914
+ if (max === null || ch.value < max)
1915
+ max = ch.value;
1916
+ }
1917
+ }
1918
+ return max;
1447
1919
  }
1448
1920
  }, "ZodBigInt");
1449
1921
  __name2(ZodBigInt, "ZodBigInt");
1450
1922
  ZodBigInt.create = (params) => {
1451
1923
  var _a;
1452
1924
  return new ZodBigInt({
1925
+ checks: [],
1453
1926
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
1454
1927
  coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
1455
1928
  ...processCreateParams(params)
@@ -1784,13 +2257,13 @@ var require_types_cjs_development = __commonJS({
1784
2257
  }
1785
2258
  }
1786
2259
  if (ctx.common.async) {
1787
- return Promise.all(ctx.data.map((item, i) => {
2260
+ return Promise.all([...ctx.data].map((item, i) => {
1788
2261
  return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
1789
2262
  })).then((result2) => {
1790
2263
  return ParseStatus.mergeArray(status, result2);
1791
2264
  });
1792
2265
  }
1793
- const result = ctx.data.map((item, i) => {
2266
+ const result = [...ctx.data].map((item, i) => {
1794
2267
  return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
1795
2268
  });
1796
2269
  return ParseStatus.mergeArray(status, result);
@@ -1831,24 +2304,6 @@ var require_types_cjs_development = __commonJS({
1831
2304
  ...processCreateParams(params)
1832
2305
  });
1833
2306
  };
1834
- var objectUtil;
1835
- (function(objectUtil2) {
1836
- objectUtil2.mergeShapes = (first, second) => {
1837
- return {
1838
- ...first,
1839
- ...second
1840
- };
1841
- };
1842
- })(objectUtil || (objectUtil = {}));
1843
- var AugmentFactory = /* @__PURE__ */ __name2((def) => (augmentation) => {
1844
- return new ZodObject({
1845
- ...def,
1846
- shape: () => ({
1847
- ...def.shape(),
1848
- ...augmentation
1849
- })
1850
- });
1851
- }, "AugmentFactory");
1852
2307
  function deepPartialify(schema) {
1853
2308
  if (schema instanceof ZodObject) {
1854
2309
  const newShape = {};
@@ -1861,7 +2316,10 @@ var require_types_cjs_development = __commonJS({
1861
2316
  shape: () => newShape
1862
2317
  });
1863
2318
  } else if (schema instanceof ZodArray) {
1864
- return ZodArray.create(deepPartialify(schema.element));
2319
+ return new ZodArray({
2320
+ ...schema._def,
2321
+ type: deepPartialify(schema.element)
2322
+ });
1865
2323
  } else if (schema instanceof ZodOptional) {
1866
2324
  return ZodOptional.create(deepPartialify(schema.unwrap()));
1867
2325
  } else if (schema instanceof ZodNullable) {
@@ -1879,8 +2337,7 @@ var require_types_cjs_development = __commonJS({
1879
2337
  super(...arguments);
1880
2338
  this._cached = null;
1881
2339
  this.nonstrict = this.passthrough;
1882
- this.augment = AugmentFactory(this._def);
1883
- this.extend = AugmentFactory(this._def);
2340
+ this.augment = this.extend;
1884
2341
  }
1885
2342
  _getCached() {
1886
2343
  if (this._cached !== null)
@@ -1960,9 +2417,10 @@ var require_types_cjs_development = __commonJS({
1960
2417
  const syncPairs = [];
1961
2418
  for (const pair of pairs) {
1962
2419
  const key = await pair.key;
2420
+ const value = await pair.value;
1963
2421
  syncPairs.push({
1964
2422
  key,
1965
- value: await pair.value,
2423
+ value,
1966
2424
  alwaysSet: pair.alwaysSet
1967
2425
  });
1968
2426
  }
@@ -2009,18 +2467,30 @@ var require_types_cjs_development = __commonJS({
2009
2467
  unknownKeys: "passthrough"
2010
2468
  });
2011
2469
  }
2012
- setKey(key, schema) {
2013
- return this.augment({ [key]: schema });
2470
+ extend(augmentation) {
2471
+ return new ZodObject({
2472
+ ...this._def,
2473
+ shape: () => ({
2474
+ ...this._def.shape(),
2475
+ ...augmentation
2476
+ })
2477
+ });
2014
2478
  }
2015
2479
  merge(merging) {
2016
2480
  const merged = new ZodObject({
2017
2481
  unknownKeys: merging._def.unknownKeys,
2018
2482
  catchall: merging._def.catchall,
2019
- shape: () => objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
2483
+ shape: () => ({
2484
+ ...this._def.shape(),
2485
+ ...merging._def.shape()
2486
+ }),
2020
2487
  typeName: ZodFirstPartyTypeKind.ZodObject
2021
2488
  });
2022
2489
  return merged;
2023
2490
  }
2491
+ setKey(key, schema) {
2492
+ return this.augment({ [key]: schema });
2493
+ }
2024
2494
  catchall(index) {
2025
2495
  return new ZodObject({
2026
2496
  ...this._def,
@@ -2029,9 +2499,10 @@ var require_types_cjs_development = __commonJS({
2029
2499
  }
2030
2500
  pick(mask) {
2031
2501
  const shape = {};
2032
- util.objectKeys(mask).map((key) => {
2033
- if (this.shape[key])
2502
+ util.objectKeys(mask).forEach((key) => {
2503
+ if (mask[key] && this.shape[key]) {
2034
2504
  shape[key] = this.shape[key];
2505
+ }
2035
2506
  });
2036
2507
  return new ZodObject({
2037
2508
  ...this._def,
@@ -2040,8 +2511,8 @@ var require_types_cjs_development = __commonJS({
2040
2511
  }
2041
2512
  omit(mask) {
2042
2513
  const shape = {};
2043
- util.objectKeys(this.shape).map((key) => {
2044
- if (util.objectKeys(mask).indexOf(key) === -1) {
2514
+ util.objectKeys(this.shape).forEach((key) => {
2515
+ if (!mask[key]) {
2045
2516
  shape[key] = this.shape[key];
2046
2517
  }
2047
2518
  });
@@ -2055,24 +2526,14 @@ var require_types_cjs_development = __commonJS({
2055
2526
  }
2056
2527
  partial(mask) {
2057
2528
  const newShape = {};
2058
- if (mask) {
2059
- util.objectKeys(this.shape).map((key) => {
2060
- if (util.objectKeys(mask).indexOf(key) === -1) {
2061
- newShape[key] = this.shape[key];
2062
- } else {
2063
- newShape[key] = this.shape[key].optional();
2064
- }
2065
- });
2066
- return new ZodObject({
2067
- ...this._def,
2068
- shape: () => newShape
2069
- });
2070
- } else {
2071
- for (const key in this.shape) {
2072
- const fieldSchema = this.shape[key];
2529
+ util.objectKeys(this.shape).forEach((key) => {
2530
+ const fieldSchema = this.shape[key];
2531
+ if (mask && !mask[key]) {
2532
+ newShape[key] = fieldSchema;
2533
+ } else {
2073
2534
  newShape[key] = fieldSchema.optional();
2074
2535
  }
2075
- }
2536
+ });
2076
2537
  return new ZodObject({
2077
2538
  ...this._def,
2078
2539
  shape: () => newShape
@@ -2080,21 +2541,10 @@ var require_types_cjs_development = __commonJS({
2080
2541
  }
2081
2542
  required(mask) {
2082
2543
  const newShape = {};
2083
- if (mask) {
2084
- util.objectKeys(this.shape).map((key) => {
2085
- if (util.objectKeys(mask).indexOf(key) === -1) {
2086
- newShape[key] = this.shape[key];
2087
- } else {
2088
- const fieldSchema = this.shape[key];
2089
- let newField = fieldSchema;
2090
- while (newField instanceof ZodOptional) {
2091
- newField = newField._def.innerType;
2092
- }
2093
- newShape[key] = newField;
2094
- }
2095
- });
2096
- } else {
2097
- for (const key in this.shape) {
2544
+ util.objectKeys(this.shape).forEach((key) => {
2545
+ if (mask && !mask[key]) {
2546
+ newShape[key] = this.shape[key];
2547
+ } else {
2098
2548
  const fieldSchema = this.shape[key];
2099
2549
  let newField = fieldSchema;
2100
2550
  while (newField instanceof ZodOptional) {
@@ -2102,7 +2552,7 @@ var require_types_cjs_development = __commonJS({
2102
2552
  }
2103
2553
  newShape[key] = newField;
2104
2554
  }
2105
- }
2555
+ });
2106
2556
  return new ZodObject({
2107
2557
  ...this._def,
2108
2558
  shape: () => newShape
@@ -2244,15 +2694,25 @@ var require_types_cjs_development = __commonJS({
2244
2694
  } else if (type instanceof ZodEnum) {
2245
2695
  return type.options;
2246
2696
  } else if (type instanceof ZodNativeEnum) {
2247
- return Object.keys(type.enum);
2697
+ return util.objectValues(type.enum);
2248
2698
  } else if (type instanceof ZodDefault) {
2249
2699
  return getDiscriminator(type._def.innerType);
2250
2700
  } else if (type instanceof ZodUndefined) {
2251
2701
  return [void 0];
2252
2702
  } else if (type instanceof ZodNull) {
2253
2703
  return [null];
2704
+ } else if (type instanceof ZodOptional) {
2705
+ return [void 0, ...getDiscriminator(type.unwrap())];
2706
+ } else if (type instanceof ZodNullable) {
2707
+ return [null, ...getDiscriminator(type.unwrap())];
2708
+ } else if (type instanceof ZodBranded) {
2709
+ return getDiscriminator(type.unwrap());
2710
+ } else if (type instanceof ZodReadonly) {
2711
+ return getDiscriminator(type.unwrap());
2712
+ } else if (type instanceof ZodCatch) {
2713
+ return getDiscriminator(type._def.innerType);
2254
2714
  } else {
2255
- return null;
2715
+ return [];
2256
2716
  }
2257
2717
  }, "getDiscriminator");
2258
2718
  var ZodDiscriminatedUnion = /* @__PURE__ */ __name(class extends ZodType {
@@ -2304,7 +2764,7 @@ var require_types_cjs_development = __commonJS({
2304
2764
  const optionsMap = /* @__PURE__ */ new Map();
2305
2765
  for (const type of options) {
2306
2766
  const discriminatorValues = getDiscriminator(type.shape[discriminator]);
2307
- if (!discriminatorValues) {
2767
+ if (!discriminatorValues.length) {
2308
2768
  throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
2309
2769
  }
2310
2770
  for (const value of discriminatorValues) {
@@ -2450,7 +2910,7 @@ var require_types_cjs_development = __commonJS({
2450
2910
  });
2451
2911
  status.dirty();
2452
2912
  }
2453
- const items = ctx.data.map((item, itemIndex) => {
2913
+ const items = [...ctx.data].map((item, itemIndex) => {
2454
2914
  const schema = this._def.items[itemIndex] || this._def.rest;
2455
2915
  if (!schema)
2456
2916
  return null;
@@ -2509,7 +2969,8 @@ var require_types_cjs_development = __commonJS({
2509
2969
  for (const key in ctx.data) {
2510
2970
  pairs.push({
2511
2971
  key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
2512
- value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key))
2972
+ value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
2973
+ alwaysSet: key in ctx.data
2513
2974
  });
2514
2975
  }
2515
2976
  if (ctx.common.async) {
@@ -2540,6 +3001,12 @@ var require_types_cjs_development = __commonJS({
2540
3001
  }, "ZodRecord");
2541
3002
  __name2(ZodRecord, "ZodRecord");
2542
3003
  var ZodMap = /* @__PURE__ */ __name(class extends ZodType {
3004
+ get keySchema() {
3005
+ return this._def.keyType;
3006
+ }
3007
+ get valueSchema() {
3008
+ return this._def.valueType;
3009
+ }
2543
3010
  _parse(input) {
2544
3011
  const { status, ctx } = this._processInputParams(input);
2545
3012
  if (ctx.parsedType !== ZodParsedType.map) {
@@ -2742,27 +3209,29 @@ var require_types_cjs_development = __commonJS({
2742
3209
  const params = { errorMap: ctx.common.contextualErrorMap };
2743
3210
  const fn = ctx.data;
2744
3211
  if (this._def.returns instanceof ZodPromise) {
2745
- return OK(async (...args) => {
3212
+ const me = this;
3213
+ return OK(async function(...args) {
2746
3214
  const error = new ZodError([]);
2747
- const parsedArgs = await this._def.args.parseAsync(args, params).catch((e) => {
3215
+ const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
2748
3216
  error.addIssue(makeArgsIssue(args, e));
2749
3217
  throw error;
2750
3218
  });
2751
- const result = await fn(...parsedArgs);
2752
- const parsedReturns = await this._def.returns._def.type.parseAsync(result, params).catch((e) => {
3219
+ const result = await Reflect.apply(fn, this, parsedArgs);
3220
+ const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
2753
3221
  error.addIssue(makeReturnsIssue(result, e));
2754
3222
  throw error;
2755
3223
  });
2756
3224
  return parsedReturns;
2757
3225
  });
2758
3226
  } else {
2759
- return OK((...args) => {
2760
- const parsedArgs = this._def.args.safeParse(args, params);
3227
+ const me = this;
3228
+ return OK(function(...args) {
3229
+ const parsedArgs = me._def.args.safeParse(args, params);
2761
3230
  if (!parsedArgs.success) {
2762
3231
  throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
2763
3232
  }
2764
- const result = fn(...parsedArgs.data);
2765
- const parsedReturns = this._def.returns.safeParse(result, params);
3233
+ const result = Reflect.apply(fn, this, parsedArgs.data);
3234
+ const parsedReturns = me._def.returns.safeParse(result, params);
2766
3235
  if (!parsedReturns.success) {
2767
3236
  throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
2768
3237
  }
@@ -2829,6 +3298,7 @@ var require_types_cjs_development = __commonJS({
2829
3298
  if (input.data !== this._def.value) {
2830
3299
  const ctx = this._getOrReturnCtx(input);
2831
3300
  addIssueToContext(ctx, {
3301
+ received: ctx.data,
2832
3302
  code: ZodIssueCode.invalid_literal,
2833
3303
  expected: this._def.value
2834
3304
  });
@@ -2858,6 +3328,10 @@ var require_types_cjs_development = __commonJS({
2858
3328
  __name(createZodEnum, "createZodEnum");
2859
3329
  __name2(createZodEnum, "createZodEnum");
2860
3330
  var ZodEnum = /* @__PURE__ */ __name(class extends ZodType {
3331
+ constructor() {
3332
+ super(...arguments);
3333
+ _ZodEnum_cache.set(this, void 0);
3334
+ }
2861
3335
  _parse(input) {
2862
3336
  if (typeof input.data !== "string") {
2863
3337
  const ctx = this._getOrReturnCtx(input);
@@ -2869,7 +3343,10 @@ var require_types_cjs_development = __commonJS({
2869
3343
  });
2870
3344
  return INVALID;
2871
3345
  }
2872
- if (this._def.values.indexOf(input.data) === -1) {
3346
+ if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
3347
+ __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
3348
+ }
3349
+ if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
2873
3350
  const ctx = this._getOrReturnCtx(input);
2874
3351
  const expectedValues = this._def.values;
2875
3352
  addIssueToContext(ctx, {
@@ -2905,10 +3382,27 @@ var require_types_cjs_development = __commonJS({
2905
3382
  }
2906
3383
  return enumValues;
2907
3384
  }
3385
+ extract(values, newDef = this._def) {
3386
+ return ZodEnum.create(values, {
3387
+ ...this._def,
3388
+ ...newDef
3389
+ });
3390
+ }
3391
+ exclude(values, newDef = this._def) {
3392
+ return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
3393
+ ...this._def,
3394
+ ...newDef
3395
+ });
3396
+ }
2908
3397
  }, "ZodEnum");
2909
3398
  __name2(ZodEnum, "ZodEnum");
3399
+ _ZodEnum_cache = /* @__PURE__ */ new WeakMap();
2910
3400
  ZodEnum.create = createZodEnum;
2911
3401
  var ZodNativeEnum = /* @__PURE__ */ __name(class extends ZodType {
3402
+ constructor() {
3403
+ super(...arguments);
3404
+ _ZodNativeEnum_cache.set(this, void 0);
3405
+ }
2912
3406
  _parse(input) {
2913
3407
  const nativeEnumValues = util.getValidEnumValues(this._def.values);
2914
3408
  const ctx = this._getOrReturnCtx(input);
@@ -2921,7 +3415,10 @@ var require_types_cjs_development = __commonJS({
2921
3415
  });
2922
3416
  return INVALID;
2923
3417
  }
2924
- if (nativeEnumValues.indexOf(input.data) === -1) {
3418
+ if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
3419
+ __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
3420
+ }
3421
+ if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
2925
3422
  const expectedValues = util.objectValues(nativeEnumValues);
2926
3423
  addIssueToContext(ctx, {
2927
3424
  received: ctx.data,
@@ -2937,6 +3434,7 @@ var require_types_cjs_development = __commonJS({
2937
3434
  }
2938
3435
  }, "ZodNativeEnum");
2939
3436
  __name2(ZodNativeEnum, "ZodNativeEnum");
3437
+ _ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
2940
3438
  ZodNativeEnum.create = (values, params) => {
2941
3439
  return new ZodNativeEnum({
2942
3440
  values,
@@ -2945,6 +3443,9 @@ var require_types_cjs_development = __commonJS({
2945
3443
  });
2946
3444
  };
2947
3445
  var ZodPromise = /* @__PURE__ */ __name(class extends ZodType {
3446
+ unwrap() {
3447
+ return this._def.type;
3448
+ }
2948
3449
  _parse(input) {
2949
3450
  const { ctx } = this._processInputParams(input);
2950
3451
  if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
@@ -2982,24 +3483,6 @@ var require_types_cjs_development = __commonJS({
2982
3483
  _parse(input) {
2983
3484
  const { status, ctx } = this._processInputParams(input);
2984
3485
  const effect = this._def.effect || null;
2985
- if (effect.type === "preprocess") {
2986
- const processed = effect.transform(ctx.data);
2987
- if (ctx.common.async) {
2988
- return Promise.resolve(processed).then((processed2) => {
2989
- return this._def.schema._parseAsync({
2990
- data: processed2,
2991
- path: ctx.path,
2992
- parent: ctx
2993
- });
2994
- });
2995
- } else {
2996
- return this._def.schema._parseSync({
2997
- data: processed,
2998
- path: ctx.path,
2999
- parent: ctx
3000
- });
3001
- }
3002
- }
3003
3486
  const checkCtx = {
3004
3487
  addIssue: (arg) => {
3005
3488
  addIssueToContext(ctx, arg);
@@ -3014,6 +3497,42 @@ var require_types_cjs_development = __commonJS({
3014
3497
  }
3015
3498
  };
3016
3499
  checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
3500
+ if (effect.type === "preprocess") {
3501
+ const processed = effect.transform(ctx.data, checkCtx);
3502
+ if (ctx.common.async) {
3503
+ return Promise.resolve(processed).then(async (processed2) => {
3504
+ if (status.value === "aborted")
3505
+ return INVALID;
3506
+ const result = await this._def.schema._parseAsync({
3507
+ data: processed2,
3508
+ path: ctx.path,
3509
+ parent: ctx
3510
+ });
3511
+ if (result.status === "aborted")
3512
+ return INVALID;
3513
+ if (result.status === "dirty")
3514
+ return DIRTY(result.value);
3515
+ if (status.value === "dirty")
3516
+ return DIRTY(result.value);
3517
+ return result;
3518
+ });
3519
+ } else {
3520
+ if (status.value === "aborted")
3521
+ return INVALID;
3522
+ const result = this._def.schema._parseSync({
3523
+ data: processed,
3524
+ path: ctx.path,
3525
+ parent: ctx
3526
+ });
3527
+ if (result.status === "aborted")
3528
+ return INVALID;
3529
+ if (result.status === "dirty")
3530
+ return DIRTY(result.value);
3531
+ if (status.value === "dirty")
3532
+ return DIRTY(result.value);
3533
+ return result;
3534
+ }
3535
+ }
3017
3536
  if (effect.type === "refinement") {
3018
3537
  const executeRefinement = /* @__PURE__ */ __name2((acc) => {
3019
3538
  const result = effect.refinement(acc, checkCtx);
@@ -3160,26 +3679,45 @@ var require_types_cjs_development = __commonJS({
3160
3679
  var ZodCatch = /* @__PURE__ */ __name(class extends ZodType {
3161
3680
  _parse(input) {
3162
3681
  const { ctx } = this._processInputParams(input);
3682
+ const newCtx = {
3683
+ ...ctx,
3684
+ common: {
3685
+ ...ctx.common,
3686
+ issues: []
3687
+ }
3688
+ };
3163
3689
  const result = this._def.innerType._parse({
3164
- data: ctx.data,
3165
- path: ctx.path,
3166
- parent: ctx
3690
+ data: newCtx.data,
3691
+ path: newCtx.path,
3692
+ parent: {
3693
+ ...newCtx
3694
+ }
3167
3695
  });
3168
3696
  if (isAsync(result)) {
3169
3697
  return result.then((result2) => {
3170
3698
  return {
3171
3699
  status: "valid",
3172
- value: result2.status === "valid" ? result2.value : this._def.defaultValue()
3700
+ value: result2.status === "valid" ? result2.value : this._def.catchValue({
3701
+ get error() {
3702
+ return new ZodError(newCtx.common.issues);
3703
+ },
3704
+ input: newCtx.data
3705
+ })
3173
3706
  };
3174
3707
  });
3175
3708
  } else {
3176
3709
  return {
3177
3710
  status: "valid",
3178
- value: result.status === "valid" ? result.value : this._def.defaultValue()
3711
+ value: result.status === "valid" ? result.value : this._def.catchValue({
3712
+ get error() {
3713
+ return new ZodError(newCtx.common.issues);
3714
+ },
3715
+ input: newCtx.data
3716
+ })
3179
3717
  };
3180
3718
  }
3181
3719
  }
3182
- removeDefault() {
3720
+ removeCatch() {
3183
3721
  return this._def.innerType;
3184
3722
  }
3185
3723
  }, "ZodCatch");
@@ -3188,7 +3726,7 @@ var require_types_cjs_development = __commonJS({
3188
3726
  return new ZodCatch({
3189
3727
  innerType: type,
3190
3728
  typeName: ZodFirstPartyTypeKind.ZodCatch,
3191
- defaultValue: typeof params.default === "function" ? params.default : () => params.default,
3729
+ catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
3192
3730
  ...processCreateParams(params)
3193
3731
  });
3194
3732
  };
@@ -3286,17 +3824,44 @@ var require_types_cjs_development = __commonJS({
3286
3824
  }
3287
3825
  }, "ZodPipeline");
3288
3826
  __name2(ZodPipeline, "ZodPipeline");
3289
- var custom = /* @__PURE__ */ __name2((check, params = {}, fatal) => {
3827
+ var ZodReadonly = /* @__PURE__ */ __name(class extends ZodType {
3828
+ _parse(input) {
3829
+ const result = this._def.innerType._parse(input);
3830
+ const freeze = /* @__PURE__ */ __name2((data) => {
3831
+ if (isValid(data)) {
3832
+ data.value = Object.freeze(data.value);
3833
+ }
3834
+ return data;
3835
+ }, "freeze");
3836
+ return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
3837
+ }
3838
+ unwrap() {
3839
+ return this._def.innerType;
3840
+ }
3841
+ }, "ZodReadonly");
3842
+ __name2(ZodReadonly, "ZodReadonly");
3843
+ ZodReadonly.create = (type, params) => {
3844
+ return new ZodReadonly({
3845
+ innerType: type,
3846
+ typeName: ZodFirstPartyTypeKind.ZodReadonly,
3847
+ ...processCreateParams(params)
3848
+ });
3849
+ };
3850
+ function custom(check, params = {}, fatal) {
3290
3851
  if (check)
3291
3852
  return ZodAny.create().superRefine((data, ctx) => {
3853
+ var _a, _b;
3292
3854
  if (!check(data)) {
3293
- const p = typeof params === "function" ? params(data) : params;
3855
+ const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
3856
+ const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
3294
3857
  const p2 = typeof p === "string" ? { message: p } : p;
3295
- ctx.addIssue({ code: "custom", ...p2, fatal });
3858
+ ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
3296
3859
  }
3297
3860
  });
3298
3861
  return ZodAny.create();
3299
- }, "custom");
3862
+ }
3863
+ __name(custom, "custom");
3864
+ __name2(custom, "custom");
3300
3865
  var late = {
3301
3866
  object: ZodObject.lazycreate
3302
3867
  };
@@ -3337,10 +3902,11 @@ var require_types_cjs_development = __commonJS({
3337
3902
  ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise";
3338
3903
  ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded";
3339
3904
  ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
3905
+ ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
3340
3906
  })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
3341
3907
  var instanceOfType = /* @__PURE__ */ __name2((cls, params = {
3342
3908
  message: `Input not instance of ${cls.name}`
3343
- }) => custom((data) => data instanceof cls, params, true), "instanceOfType");
3909
+ }) => custom((data) => data instanceof cls, params), "instanceOfType");
3344
3910
  var stringType = ZodString.create;
3345
3911
  var numberType = ZodNumber.create;
3346
3912
  var nanType = ZodNaN.create;
@@ -3381,12 +3947,15 @@ var require_types_cjs_development = __commonJS({
3381
3947
  var coerce = {
3382
3948
  string: (arg) => ZodString.create({ ...arg, coerce: true }),
3383
3949
  number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
3384
- boolean: (arg) => ZodBoolean.create({ ...arg, coerce: true }),
3950
+ boolean: (arg) => ZodBoolean.create({
3951
+ ...arg,
3952
+ coerce: true
3953
+ }),
3385
3954
  bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
3386
3955
  date: (arg) => ZodDate.create({ ...arg, coerce: true })
3387
3956
  };
3388
3957
  var NEVER = INVALID;
3389
- var mod = /* @__PURE__ */ Object.freeze({
3958
+ var z = /* @__PURE__ */ Object.freeze({
3390
3959
  __proto__: null,
3391
3960
  defaultErrorMap: errorMap,
3392
3961
  setErrorMap,
@@ -3405,9 +3974,13 @@ var require_types_cjs_development = __commonJS({
3405
3974
  get util() {
3406
3975
  return util;
3407
3976
  },
3977
+ get objectUtil() {
3978
+ return objectUtil;
3979
+ },
3408
3980
  ZodParsedType,
3409
3981
  getParsedType,
3410
3982
  ZodType,
3983
+ datetimeRegex,
3411
3984
  ZodString,
3412
3985
  ZodNumber,
3413
3986
  ZodBigInt,
@@ -3421,9 +3994,6 @@ var require_types_cjs_development = __commonJS({
3421
3994
  ZodNever,
3422
3995
  ZodVoid,
3423
3996
  ZodArray,
3424
- get objectUtil() {
3425
- return objectUtil;
3426
- },
3427
3997
  ZodObject,
3428
3998
  ZodUnion,
3429
3999
  ZodDiscriminatedUnion,
@@ -3448,6 +4018,7 @@ var require_types_cjs_development = __commonJS({
3448
4018
  BRAND,
3449
4019
  ZodBranded,
3450
4020
  ZodPipeline,
4021
+ ZodReadonly,
3451
4022
  custom,
3452
4023
  Schema: ZodType,
3453
4024
  ZodSchema: ZodType,
@@ -3500,35 +4071,132 @@ var require_types_cjs_development = __commonJS({
3500
4071
  quotelessJson,
3501
4072
  ZodError
3502
4073
  });
3503
- var ContextValidator = mod.array(mod.string().or(mod.record(mod.any())));
3504
- var AchievementCriteriaValidator = mod.object({
3505
- type: mod.string().optional(),
3506
- narrative: mod.string().optional()
4074
+ var currentSymbol = Symbol("current");
4075
+ var previousSymbol = Symbol("previous");
4076
+ var mergeOpenApi = /* @__PURE__ */ __name2((openapi, {
4077
+ ref: _ref,
4078
+ refType: _refType,
4079
+ param: _param,
4080
+ header: _header,
4081
+ ...rest
4082
+ } = {}) => ({
4083
+ ...rest,
4084
+ ...openapi
4085
+ }), "mergeOpenApi");
4086
+ function extendZodWithOpenApi(zod) {
4087
+ if (typeof zod.ZodType.prototype.openapi !== "undefined") {
4088
+ return;
4089
+ }
4090
+ zod.ZodType.prototype.openapi = function(openapi) {
4091
+ const { zodOpenApi, ...rest } = this._def;
4092
+ const result = new this.constructor({
4093
+ ...rest,
4094
+ zodOpenApi: {
4095
+ openapi: mergeOpenApi(
4096
+ openapi,
4097
+ zodOpenApi == null ? void 0 : zodOpenApi.openapi
4098
+ )
4099
+ }
4100
+ });
4101
+ result._def.zodOpenApi[currentSymbol] = result;
4102
+ if (zodOpenApi) {
4103
+ result._def.zodOpenApi[previousSymbol] = this;
4104
+ }
4105
+ return result;
4106
+ };
4107
+ const zodDescribe = zod.ZodType.prototype.describe;
4108
+ zod.ZodType.prototype.describe = function(...args) {
4109
+ const result = zodDescribe.apply(this, args);
4110
+ const def = result._def;
4111
+ if (def.zodOpenApi) {
4112
+ const cloned = { ...def.zodOpenApi };
4113
+ cloned.openapi = mergeOpenApi({ description: args[0] }, cloned.openapi);
4114
+ cloned[previousSymbol] = this;
4115
+ cloned[currentSymbol] = result;
4116
+ def.zodOpenApi = cloned;
4117
+ } else {
4118
+ def.zodOpenApi = {
4119
+ openapi: { description: args[0] },
4120
+ [currentSymbol]: result
4121
+ };
4122
+ }
4123
+ return result;
4124
+ };
4125
+ const zodObjectExtend = zod.ZodObject.prototype.extend;
4126
+ zod.ZodObject.prototype.extend = function(...args) {
4127
+ const extendResult = zodObjectExtend.apply(this, args);
4128
+ const zodOpenApi = extendResult._def.zodOpenApi;
4129
+ if (zodOpenApi) {
4130
+ const cloned = { ...zodOpenApi };
4131
+ cloned.openapi = mergeOpenApi({}, cloned.openapi);
4132
+ cloned[previousSymbol] = this;
4133
+ extendResult._def.zodOpenApi = cloned;
4134
+ } else {
4135
+ extendResult._def.zodOpenApi = {
4136
+ [previousSymbol]: this
4137
+ };
4138
+ }
4139
+ return extendResult;
4140
+ };
4141
+ const zodObjectOmit = zod.ZodObject.prototype.omit;
4142
+ zod.ZodObject.prototype.omit = function(...args) {
4143
+ const omitResult = zodObjectOmit.apply(this, args);
4144
+ const zodOpenApi = omitResult._def.zodOpenApi;
4145
+ if (zodOpenApi) {
4146
+ const cloned = { ...zodOpenApi };
4147
+ cloned.openapi = mergeOpenApi({}, cloned.openapi);
4148
+ delete cloned[previousSymbol];
4149
+ delete cloned[currentSymbol];
4150
+ omitResult._def.zodOpenApi = cloned;
4151
+ }
4152
+ return omitResult;
4153
+ };
4154
+ const zodObjectPick = zod.ZodObject.prototype.pick;
4155
+ zod.ZodObject.prototype.pick = function(...args) {
4156
+ const pickResult = zodObjectPick.apply(this, args);
4157
+ const zodOpenApi = pickResult._def.zodOpenApi;
4158
+ if (zodOpenApi) {
4159
+ const cloned = { ...zodOpenApi };
4160
+ cloned.openapi = mergeOpenApi({}, cloned.openapi);
4161
+ delete cloned[previousSymbol];
4162
+ delete cloned[currentSymbol];
4163
+ pickResult._def.zodOpenApi = cloned;
4164
+ }
4165
+ return pickResult;
4166
+ };
4167
+ }
4168
+ __name(extendZodWithOpenApi, "extendZodWithOpenApi");
4169
+ __name2(extendZodWithOpenApi, "extendZodWithOpenApi");
4170
+ extendZodWithOpenApi(z);
4171
+ var ContextValidator = z.array(z.string().or(z.record(z.any())));
4172
+ var AchievementCriteriaValidator = z.object({
4173
+ type: z.string().optional(),
4174
+ narrative: z.string().optional()
3507
4175
  });
3508
- var ImageValidator = mod.string().or(
3509
- mod.object({
3510
- id: mod.string(),
3511
- type: mod.string(),
3512
- caption: mod.string().optional()
4176
+ var ImageValidator = z.string().or(
4177
+ z.object({
4178
+ id: z.string(),
4179
+ type: z.string(),
4180
+ caption: z.string().optional()
3513
4181
  })
3514
4182
  );
3515
- var GeoCoordinatesValidator = mod.object({
3516
- type: mod.string().min(1).or(mod.string().array().nonempty()),
3517
- latitude: mod.number(),
3518
- longitude: mod.number()
4183
+ var GeoCoordinatesValidator = z.object({
4184
+ type: z.string().min(1).or(z.string().array().nonempty()),
4185
+ latitude: z.number(),
4186
+ longitude: z.number()
3519
4187
  });
3520
- var AddressValidator = mod.object({
3521
- type: mod.string().min(1).or(mod.string().array().nonempty()),
3522
- addressCountry: mod.string().optional(),
3523
- addressCountryCode: mod.string().optional(),
3524
- addressRegion: mod.string().optional(),
3525
- addressLocality: mod.string().optional(),
3526
- streetAddress: mod.string().optional(),
3527
- postOfficeBoxNumber: mod.string().optional(),
3528
- postalCode: mod.string().optional(),
4188
+ var AddressValidator = z.object({
4189
+ type: z.string().min(1).or(z.string().array().nonempty()),
4190
+ addressCountry: z.string().optional(),
4191
+ addressCountryCode: z.string().optional(),
4192
+ addressRegion: z.string().optional(),
4193
+ addressLocality: z.string().optional(),
4194
+ streetAddress: z.string().optional(),
4195
+ postOfficeBoxNumber: z.string().optional(),
4196
+ postalCode: z.string().optional(),
3529
4197
  geo: GeoCoordinatesValidator.optional()
3530
4198
  });
3531
- var IdentifierTypeValidator = mod.enum([
4199
+ var IdentifierTypeValidator = z.enum([
3532
4200
  "sourcedId",
3533
4201
  "systemId",
3534
4202
  "productId",
@@ -3547,140 +4215,140 @@ var require_types_cjs_development = __commonJS({
3547
4215
  "ltiPlatformId",
3548
4216
  "ltiUserId",
3549
4217
  "identifier"
3550
- ]).or(mod.string());
3551
- var IdentifierEntryValidator = mod.object({
3552
- type: mod.string().min(1).or(mod.string().array().nonempty()),
3553
- identifier: mod.string(),
4218
+ ]).or(z.string());
4219
+ var IdentifierEntryValidator = z.object({
4220
+ type: z.string().min(1).or(z.string().array().nonempty()),
4221
+ identifier: z.string(),
3554
4222
  identifierType: IdentifierTypeValidator
3555
4223
  });
3556
- var ProfileValidator = mod.string().or(
3557
- mod.object({
3558
- id: mod.string().optional(),
3559
- type: mod.string().or(mod.string().array().nonempty().optional()),
3560
- name: mod.string().optional(),
3561
- url: mod.string().optional(),
3562
- phone: mod.string().optional(),
3563
- description: mod.string().optional(),
3564
- endorsement: mod.any().array().optional(),
4224
+ var ProfileValidator = z.string().or(
4225
+ z.object({
4226
+ id: z.string().optional(),
4227
+ type: z.string().or(z.string().array().nonempty().optional()),
4228
+ name: z.string().optional(),
4229
+ url: z.string().optional(),
4230
+ phone: z.string().optional(),
4231
+ description: z.string().optional(),
4232
+ endorsement: z.any().array().optional(),
3565
4233
  image: ImageValidator.optional(),
3566
- email: mod.string().email().optional(),
4234
+ email: z.string().email().optional(),
3567
4235
  address: AddressValidator.optional(),
3568
4236
  otherIdentifier: IdentifierEntryValidator.array().optional(),
3569
- official: mod.string().optional(),
3570
- parentOrg: mod.any().optional(),
3571
- familyName: mod.string().optional(),
3572
- givenName: mod.string().optional(),
3573
- additionalName: mod.string().optional(),
3574
- patronymicName: mod.string().optional(),
3575
- honorificPrefix: mod.string().optional(),
3576
- honorificSuffix: mod.string().optional(),
3577
- familyNamePrefix: mod.string().optional(),
3578
- dateOfBirth: mod.string().optional()
3579
- }).catchall(mod.any())
4237
+ official: z.string().optional(),
4238
+ parentOrg: z.any().optional(),
4239
+ familyName: z.string().optional(),
4240
+ givenName: z.string().optional(),
4241
+ additionalName: z.string().optional(),
4242
+ patronymicName: z.string().optional(),
4243
+ honorificPrefix: z.string().optional(),
4244
+ honorificSuffix: z.string().optional(),
4245
+ familyNamePrefix: z.string().optional(),
4246
+ dateOfBirth: z.string().optional()
4247
+ }).catchall(z.any())
3580
4248
  );
3581
- var CredentialSubjectValidator = mod.object({ id: mod.string().optional() }).catchall(mod.any());
3582
- var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() }).catchall(mod.any());
3583
- var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() }).catchall(mod.any());
3584
- var RefreshServiceValidator = mod.object({ id: mod.string().optional(), type: mod.string() }).catchall(mod.any());
3585
- var TermsOfUseValidator = mod.object({ type: mod.string(), id: mod.string().optional() }).catchall(mod.any());
3586
- var VC2EvidenceValidator = mod.object({ type: mod.string().or(mod.string().array().nonempty()), id: mod.string().optional() }).catchall(mod.any());
3587
- var UnsignedVCValidator = mod.object({
4249
+ var CredentialSubjectValidator = z.object({ id: z.string().optional() }).catchall(z.any());
4250
+ var CredentialStatusValidator = z.object({ type: z.string(), id: z.string() }).catchall(z.any());
4251
+ var CredentialSchemaValidator = z.object({ id: z.string(), type: z.string() }).catchall(z.any());
4252
+ var RefreshServiceValidator = z.object({ id: z.string().optional(), type: z.string() }).catchall(z.any());
4253
+ var TermsOfUseValidator = z.object({ type: z.string(), id: z.string().optional() }).catchall(z.any());
4254
+ var VC2EvidenceValidator = z.object({ type: z.string().or(z.string().array().nonempty()), id: z.string().optional() }).catchall(z.any());
4255
+ var UnsignedVCValidator = z.object({
3588
4256
  "@context": ContextValidator,
3589
- id: mod.string().optional(),
3590
- type: mod.string().array().nonempty(),
4257
+ id: z.string().optional(),
4258
+ type: z.string().array().nonempty(),
3591
4259
  issuer: ProfileValidator,
3592
4260
  credentialSubject: CredentialSubjectValidator.or(CredentialSubjectValidator.array()),
3593
4261
  refreshService: RefreshServiceValidator.or(RefreshServiceValidator.array()).optional(),
3594
4262
  credentialSchema: CredentialSchemaValidator.or(
3595
4263
  CredentialSchemaValidator.array()
3596
4264
  ).optional(),
3597
- issuanceDate: mod.string().optional(),
3598
- expirationDate: mod.string().optional(),
4265
+ issuanceDate: z.string().optional(),
4266
+ expirationDate: z.string().optional(),
3599
4267
  credentialStatus: CredentialStatusValidator.or(
3600
4268
  CredentialStatusValidator.array()
3601
4269
  ).optional(),
3602
- name: mod.string().optional(),
3603
- description: mod.string().optional(),
3604
- validFrom: mod.string().optional(),
3605
- validUntil: mod.string().optional(),
4270
+ name: z.string().optional(),
4271
+ description: z.string().optional(),
4272
+ validFrom: z.string().optional(),
4273
+ validUntil: z.string().optional(),
3606
4274
  status: CredentialStatusValidator.or(CredentialStatusValidator.array()).optional(),
3607
4275
  termsOfUse: TermsOfUseValidator.or(TermsOfUseValidator.array()).optional(),
3608
4276
  evidence: VC2EvidenceValidator.or(VC2EvidenceValidator.array()).optional()
3609
- }).catchall(mod.any());
3610
- var ProofValidator = mod.object({
3611
- type: mod.string(),
3612
- created: mod.string(),
3613
- challenge: mod.string().optional(),
3614
- domain: mod.string().optional(),
3615
- nonce: mod.string().optional(),
3616
- proofPurpose: mod.string(),
3617
- verificationMethod: mod.string(),
3618
- jws: mod.string().optional()
3619
- }).catchall(mod.any());
4277
+ }).catchall(z.any());
4278
+ var ProofValidator = z.object({
4279
+ type: z.string(),
4280
+ created: z.string(),
4281
+ challenge: z.string().optional(),
4282
+ domain: z.string().optional(),
4283
+ nonce: z.string().optional(),
4284
+ proofPurpose: z.string(),
4285
+ verificationMethod: z.string(),
4286
+ jws: z.string().optional()
4287
+ }).catchall(z.any());
3620
4288
  var VCValidator = UnsignedVCValidator.extend({
3621
4289
  proof: ProofValidator.or(ProofValidator.array())
3622
4290
  });
3623
- var UnsignedVPValidator = mod.object({
4291
+ var UnsignedVPValidator = z.object({
3624
4292
  "@context": ContextValidator,
3625
- id: mod.string().optional(),
3626
- type: mod.string().or(mod.string().array().nonempty()),
4293
+ id: z.string().optional(),
4294
+ type: z.string().or(z.string().array().nonempty()),
3627
4295
  verifiableCredential: VCValidator.or(VCValidator.array()).optional(),
3628
- holder: mod.string().optional()
3629
- }).catchall(mod.any());
4296
+ holder: z.string().optional()
4297
+ }).catchall(z.any());
3630
4298
  var VPValidator = UnsignedVPValidator.extend({
3631
4299
  proof: ProofValidator.or(ProofValidator.array())
3632
4300
  });
3633
- var JWKValidator = mod.object({
3634
- kty: mod.string(),
3635
- crv: mod.string(),
3636
- x: mod.string(),
3637
- y: mod.string().optional(),
3638
- n: mod.string().optional(),
3639
- d: mod.string().optional()
4301
+ var JWKValidator = z.object({
4302
+ kty: z.string(),
4303
+ crv: z.string(),
4304
+ x: z.string(),
4305
+ y: z.string().optional(),
4306
+ n: z.string().optional(),
4307
+ d: z.string().optional()
3640
4308
  });
3641
- var JWKWithPrivateKeyValidator = JWKValidator.omit({ d: true }).extend({ d: mod.string() });
3642
- var JWERecipientHeaderValidator = mod.object({
3643
- alg: mod.string(),
3644
- iv: mod.string(),
3645
- tag: mod.string(),
4309
+ var JWKWithPrivateKeyValidator = JWKValidator.omit({ d: true }).extend({ d: z.string() });
4310
+ var JWERecipientHeaderValidator = z.object({
4311
+ alg: z.string(),
4312
+ iv: z.string(),
4313
+ tag: z.string(),
3646
4314
  epk: JWKValidator.partial().optional(),
3647
- kid: mod.string().optional(),
3648
- apv: mod.string().optional(),
3649
- apu: mod.string().optional()
4315
+ kid: z.string().optional(),
4316
+ apv: z.string().optional(),
4317
+ apu: z.string().optional()
3650
4318
  });
3651
- var JWERecipientValidator = mod.object({
4319
+ var JWERecipientValidator = z.object({
3652
4320
  header: JWERecipientHeaderValidator,
3653
- encrypted_key: mod.string()
4321
+ encrypted_key: z.string()
3654
4322
  });
3655
- var JWEValidator2 = mod.object({
3656
- protected: mod.string(),
3657
- iv: mod.string(),
3658
- ciphertext: mod.string(),
3659
- tag: mod.string(),
3660
- aad: mod.string().optional(),
4323
+ var JWEValidator2 = z.object({
4324
+ protected: z.string(),
4325
+ iv: z.string(),
4326
+ ciphertext: z.string(),
4327
+ tag: z.string(),
4328
+ aad: z.string().optional(),
3661
4329
  recipients: JWERecipientValidator.array().optional()
3662
4330
  });
3663
- var VerificationMethodValidator = mod.string().or(
3664
- mod.object({
4331
+ var VerificationMethodValidator = z.string().or(
4332
+ z.object({
3665
4333
  "@context": ContextValidator.optional(),
3666
- id: mod.string(),
3667
- type: mod.string(),
3668
- controller: mod.string(),
4334
+ id: z.string(),
4335
+ type: z.string(),
4336
+ controller: z.string(),
3669
4337
  publicKeyJwk: JWKValidator.optional(),
3670
- publicKeyBase58: mod.string().optional(),
3671
- blockChainAccountId: mod.string().optional()
3672
- }).catchall(mod.any())
4338
+ publicKeyBase58: z.string().optional(),
4339
+ blockChainAccountId: z.string().optional()
4340
+ }).catchall(z.any())
3673
4341
  );
3674
- var ServiceValidator = mod.object({
3675
- id: mod.string(),
3676
- type: mod.string().or(mod.string().array().nonempty()),
3677
- serviceEndpoint: mod.any().or(mod.any().array().nonempty())
3678
- }).catchall(mod.any());
3679
- var DidDocumentValidator = mod.object({
4342
+ var ServiceValidator = z.object({
4343
+ id: z.string(),
4344
+ type: z.string().or(z.string().array().nonempty()),
4345
+ serviceEndpoint: z.any().or(z.any().array().nonempty())
4346
+ }).catchall(z.any());
4347
+ var DidDocumentValidator = z.object({
3680
4348
  "@context": ContextValidator,
3681
- id: mod.string(),
3682
- alsoKnownAs: mod.string().optional(),
3683
- controller: mod.string().or(mod.string().array().nonempty()).optional(),
4349
+ id: z.string(),
4350
+ alsoKnownAs: z.string().optional(),
4351
+ controller: z.string().or(z.string().array().nonempty()).optional(),
3684
4352
  verificationMethod: VerificationMethodValidator.array().optional(),
3685
4353
  authentication: VerificationMethodValidator.array().optional(),
3686
4354
  assertionMethod: VerificationMethodValidator.array().optional(),
@@ -3690,8 +4358,8 @@ var require_types_cjs_development = __commonJS({
3690
4358
  publicKey: VerificationMethodValidator.array().optional(),
3691
4359
  service: ServiceValidator.array().optional(),
3692
4360
  proof: ProofValidator.or(ProofValidator.array()).optional()
3693
- }).catchall(mod.any());
3694
- var AlignmentTargetTypeValidator = mod.enum([
4361
+ }).catchall(z.any());
4362
+ var AlignmentTargetTypeValidator = z.enum([
3695
4363
  "ceasn:Competency",
3696
4364
  "ceterms:Credential",
3697
4365
  "CFItem",
@@ -3699,17 +4367,17 @@ var require_types_cjs_development = __commonJS({
3699
4367
  "CFRubricCriterion",
3700
4368
  "CFRubricCriterionLevel",
3701
4369
  "CTDL"
3702
- ]).or(mod.string());
3703
- var AlignmentValidator = mod.object({
3704
- type: mod.string().array().nonempty(),
3705
- targetCode: mod.string().optional(),
3706
- targetDescription: mod.string().optional(),
3707
- targetName: mod.string(),
3708
- targetFramework: mod.string().optional(),
4370
+ ]).or(z.string());
4371
+ var AlignmentValidator = z.object({
4372
+ type: z.string().array().nonempty(),
4373
+ targetCode: z.string().optional(),
4374
+ targetDescription: z.string().optional(),
4375
+ targetName: z.string(),
4376
+ targetFramework: z.string().optional(),
3709
4377
  targetType: AlignmentTargetTypeValidator.optional(),
3710
- targetUrl: mod.string()
4378
+ targetUrl: z.string()
3711
4379
  });
3712
- var KnownAchievementTypeValidator = mod.enum([
4380
+ var KnownAchievementTypeValidator = z.enum([
3713
4381
  "Achievement",
3714
4382
  "ApprenticeshipCertificate",
3715
4383
  "Assessment",
@@ -3742,23 +4410,23 @@ var require_types_cjs_development = __commonJS({
3742
4410
  "ResearchDoctorate",
3743
4411
  "SecondarySchoolDiploma"
3744
4412
  ]);
3745
- var AchievementTypeValidator = KnownAchievementTypeValidator.or(mod.string());
3746
- var CriteriaValidator = mod.object({ id: mod.string().optional(), narrative: mod.string().optional() }).catchall(mod.any());
3747
- var EndorsementSubjectValidator = mod.object({
3748
- id: mod.string(),
3749
- type: mod.string().array().nonempty(),
3750
- endorsementComment: mod.string().optional()
4413
+ var AchievementTypeValidator = KnownAchievementTypeValidator.or(z.string());
4414
+ var CriteriaValidator = z.object({ id: z.string().optional(), narrative: z.string().optional() }).catchall(z.any());
4415
+ var EndorsementSubjectValidator = z.object({
4416
+ id: z.string(),
4417
+ type: z.string().array().nonempty(),
4418
+ endorsementComment: z.string().optional()
3751
4419
  });
3752
4420
  var EndorsementCredentialValidator = UnsignedVCValidator.extend({
3753
4421
  credentialSubject: EndorsementSubjectValidator,
3754
4422
  proof: ProofValidator.or(ProofValidator.array()).optional()
3755
4423
  });
3756
- var RelatedValidator = mod.object({
3757
- id: mod.string(),
3758
- "@language": mod.string().optional(),
3759
- version: mod.string().optional()
4424
+ var RelatedValidator = z.object({
4425
+ id: z.string(),
4426
+ "@language": z.string().optional(),
4427
+ version: z.string().optional()
3760
4428
  });
3761
- var ResultTypeValidator = mod.enum([
4429
+ var ResultTypeValidator = z.enum([
3762
4430
  "GradePointAverage",
3763
4431
  "LetterGrade",
3764
4432
  "Percent",
@@ -3771,59 +4439,59 @@ var require_types_cjs_development = __commonJS({
3771
4439
  "RubricScore",
3772
4440
  "ScaledScore",
3773
4441
  "Status"
3774
- ]).or(mod.string());
3775
- var RubricCriterionValidator = mod.object({
3776
- id: mod.string(),
3777
- type: mod.string().array().nonempty(),
4442
+ ]).or(z.string());
4443
+ var RubricCriterionValidator = z.object({
4444
+ id: z.string(),
4445
+ type: z.string().array().nonempty(),
3778
4446
  alignment: AlignmentValidator.array().optional(),
3779
- description: mod.string().optional(),
3780
- level: mod.string().optional(),
3781
- name: mod.string(),
3782
- points: mod.string().optional()
3783
- }).catchall(mod.any());
3784
- var ResultDescriptionValidator = mod.object({
3785
- id: mod.string(),
3786
- type: mod.string().array().nonempty(),
4447
+ description: z.string().optional(),
4448
+ level: z.string().optional(),
4449
+ name: z.string(),
4450
+ points: z.string().optional()
4451
+ }).catchall(z.any());
4452
+ var ResultDescriptionValidator = z.object({
4453
+ id: z.string(),
4454
+ type: z.string().array().nonempty(),
3787
4455
  alignment: AlignmentValidator.array().optional(),
3788
- allowedValue: mod.string().array().optional(),
3789
- name: mod.string(),
3790
- requiredLevel: mod.string().optional(),
3791
- requiredValue: mod.string().optional(),
4456
+ allowedValue: z.string().array().optional(),
4457
+ name: z.string(),
4458
+ requiredLevel: z.string().optional(),
4459
+ requiredValue: z.string().optional(),
3792
4460
  resultType: ResultTypeValidator,
3793
4461
  rubricCriterionLevel: RubricCriterionValidator.array().optional(),
3794
- valueMax: mod.string().optional(),
3795
- valueMin: mod.string().optional()
3796
- }).catchall(mod.any());
3797
- var AchievementValidator = mod.object({
3798
- id: mod.string().optional(),
3799
- type: mod.string().array().nonempty(),
4462
+ valueMax: z.string().optional(),
4463
+ valueMin: z.string().optional()
4464
+ }).catchall(z.any());
4465
+ var AchievementValidator = z.object({
4466
+ id: z.string().optional(),
4467
+ type: z.string().array().nonempty(),
3800
4468
  alignment: AlignmentValidator.array().optional(),
3801
4469
  achievementType: AchievementTypeValidator.optional(),
3802
4470
  creator: ProfileValidator.optional(),
3803
- creditsAvailable: mod.number().optional(),
4471
+ creditsAvailable: z.number().optional(),
3804
4472
  criteria: CriteriaValidator,
3805
- description: mod.string(),
4473
+ description: z.string(),
3806
4474
  endorsement: EndorsementCredentialValidator.array().optional(),
3807
- fieldOfStudy: mod.string().optional(),
3808
- humanCode: mod.string().optional(),
4475
+ fieldOfStudy: z.string().optional(),
4476
+ humanCode: z.string().optional(),
3809
4477
  image: ImageValidator.optional(),
3810
- "@language": mod.string().optional(),
3811
- name: mod.string(),
4478
+ "@language": z.string().optional(),
4479
+ name: z.string(),
3812
4480
  otherIdentifier: IdentifierEntryValidator.array().optional(),
3813
4481
  related: RelatedValidator.array().optional(),
3814
4482
  resultDescription: ResultDescriptionValidator.array().optional(),
3815
- specialization: mod.string().optional(),
3816
- tag: mod.string().array().optional(),
3817
- version: mod.string().optional()
3818
- }).catchall(mod.any());
3819
- var IdentityObjectValidator = mod.object({
3820
- type: mod.string(),
3821
- hashed: mod.boolean(),
3822
- identityHash: mod.string(),
3823
- identityType: mod.string(),
3824
- salt: mod.string().optional()
4483
+ specialization: z.string().optional(),
4484
+ tag: z.string().array().optional(),
4485
+ version: z.string().optional()
4486
+ }).catchall(z.any());
4487
+ var IdentityObjectValidator = z.object({
4488
+ type: z.string(),
4489
+ hashed: z.boolean(),
4490
+ identityHash: z.string(),
4491
+ identityType: z.string(),
4492
+ salt: z.string().optional()
3825
4493
  });
3826
- var ResultStatusTypeValidator = mod.enum([
4494
+ var ResultStatusTypeValidator = z.enum([
3827
4495
  "Completed",
3828
4496
  "Enrolled",
3829
4497
  "Failed",
@@ -3831,42 +4499,42 @@ var require_types_cjs_development = __commonJS({
3831
4499
  "OnHold",
3832
4500
  "Withdrew"
3833
4501
  ]);
3834
- var ResultValidator = mod.object({
3835
- type: mod.string().array().nonempty(),
3836
- achievedLevel: mod.string().optional(),
4502
+ var ResultValidator = z.object({
4503
+ type: z.string().array().nonempty(),
4504
+ achievedLevel: z.string().optional(),
3837
4505
  alignment: AlignmentValidator.array().optional(),
3838
- resultDescription: mod.string().optional(),
4506
+ resultDescription: z.string().optional(),
3839
4507
  status: ResultStatusTypeValidator.optional(),
3840
- value: mod.string().optional()
3841
- }).catchall(mod.any());
3842
- var AchievementSubjectValidator = mod.object({
3843
- id: mod.string().optional(),
3844
- type: mod.string().array().nonempty(),
3845
- activityEndDate: mod.string().optional(),
3846
- activityStartDate: mod.string().optional(),
3847
- creditsEarned: mod.number().optional(),
4508
+ value: z.string().optional()
4509
+ }).catchall(z.any());
4510
+ var AchievementSubjectValidator = z.object({
4511
+ id: z.string().optional(),
4512
+ type: z.string().array().nonempty(),
4513
+ activityEndDate: z.string().optional(),
4514
+ activityStartDate: z.string().optional(),
4515
+ creditsEarned: z.number().optional(),
3848
4516
  achievement: AchievementValidator.optional(),
3849
4517
  identifier: IdentityObjectValidator.array().optional(),
3850
4518
  image: ImageValidator.optional(),
3851
- licenseNumber: mod.string().optional(),
3852
- narrative: mod.string().optional(),
4519
+ licenseNumber: z.string().optional(),
4520
+ narrative: z.string().optional(),
3853
4521
  result: ResultValidator.array().optional(),
3854
- role: mod.string().optional(),
4522
+ role: z.string().optional(),
3855
4523
  source: ProfileValidator.optional(),
3856
- term: mod.string().optional()
3857
- }).catchall(mod.any());
3858
- var EvidenceValidator = mod.object({
3859
- id: mod.string().optional(),
3860
- type: mod.string().or(mod.string().array().nonempty()),
3861
- narrative: mod.string().optional(),
3862
- name: mod.string().optional(),
3863
- description: mod.string().optional(),
3864
- genre: mod.string().optional(),
3865
- audience: mod.string().optional()
3866
- }).catchall(mod.any());
4524
+ term: z.string().optional()
4525
+ }).catchall(z.any());
4526
+ var EvidenceValidator = z.object({
4527
+ id: z.string().optional(),
4528
+ type: z.string().or(z.string().array().nonempty()),
4529
+ narrative: z.string().optional(),
4530
+ name: z.string().optional(),
4531
+ description: z.string().optional(),
4532
+ genre: z.string().optional(),
4533
+ audience: z.string().optional()
4534
+ }).catchall(z.any());
3867
4535
  var UnsignedAchievementCredentialValidator = UnsignedVCValidator.extend({
3868
- name: mod.string().optional(),
3869
- description: mod.string().optional(),
4536
+ name: z.string().optional(),
4537
+ description: z.string().optional(),
3870
4538
  image: ImageValidator.optional(),
3871
4539
  credentialSubject: AchievementSubjectValidator.or(
3872
4540
  AchievementSubjectValidator.array()
@@ -3877,42 +4545,42 @@ var require_types_cjs_development = __commonJS({
3877
4545
  var AchievementCredentialValidator = UnsignedAchievementCredentialValidator.extend({
3878
4546
  proof: ProofValidator.or(ProofValidator.array())
3879
4547
  });
3880
- var VerificationCheckValidator = mod.object({
3881
- checks: mod.string().array(),
3882
- warnings: mod.string().array(),
3883
- errors: mod.string().array()
4548
+ var VerificationCheckValidator = z.object({
4549
+ checks: z.string().array(),
4550
+ warnings: z.string().array(),
4551
+ errors: z.string().array()
3884
4552
  });
3885
- var VerificationStatusValidator = mod.enum(["Success", "Failed", "Error"]);
4553
+ var VerificationStatusValidator = z.enum(["Success", "Failed", "Error"]);
3886
4554
  var VerificationStatusEnum = VerificationStatusValidator.enum;
3887
- var VerificationItemValidator = mod.object({
3888
- check: mod.string(),
4555
+ var VerificationItemValidator = z.object({
4556
+ check: z.string(),
3889
4557
  status: VerificationStatusValidator,
3890
- message: mod.string().optional(),
3891
- details: mod.string().optional()
4558
+ message: z.string().optional(),
4559
+ details: z.string().optional()
3892
4560
  });
3893
- var CredentialInfoValidator = mod.object({
3894
- title: mod.string().optional(),
3895
- createdAt: mod.string().optional(),
4561
+ var CredentialInfoValidator = z.object({
4562
+ title: z.string().optional(),
4563
+ createdAt: z.string().optional(),
3896
4564
  issuer: ProfileValidator.optional(),
3897
4565
  issuee: ProfileValidator.optional(),
3898
4566
  credentialSubject: CredentialSubjectValidator.optional()
3899
4567
  });
3900
- var CredentialRecordValidator = mod.object({ id: mod.string(), uri: mod.string() }).catchall(mod.any());
3901
- var PaginationOptionsValidator = mod.object({
3902
- limit: mod.number(),
3903
- cursor: mod.string().optional(),
3904
- sort: mod.string().optional()
4568
+ var CredentialRecordValidator = z.object({ id: z.string(), uri: z.string() }).catchall(z.any());
4569
+ var PaginationOptionsValidator = z.object({
4570
+ limit: z.number(),
4571
+ cursor: z.string().optional(),
4572
+ sort: z.string().optional()
3905
4573
  });
3906
- var PaginationResponseValidator = mod.object({
3907
- cursor: mod.string().optional(),
3908
- hasMore: mod.boolean()
4574
+ var PaginationResponseValidator = z.object({
4575
+ cursor: z.string().optional(),
4576
+ hasMore: z.boolean()
3909
4577
  });
3910
- var EncryptedRecordValidator = mod.object({ encryptedRecord: JWEValidator2, fields: mod.string().array() }).catchall(mod.any());
4578
+ var EncryptedRecordValidator = z.object({ encryptedRecord: JWEValidator2, fields: z.string().array() }).catchall(z.any());
3911
4579
  var PaginatedEncryptedRecordsValidator = PaginationResponseValidator.extend({
3912
4580
  records: EncryptedRecordValidator.array()
3913
4581
  });
3914
4582
  var EncryptedCredentialRecordValidator = EncryptedRecordValidator.extend({
3915
- id: mod.string()
4583
+ id: z.string()
3916
4584
  });
3917
4585
  var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.extend({
3918
4586
  records: EncryptedCredentialRecordValidator.array()
@@ -3923,8 +4591,8 @@ var require_types_cjs_development = __commonJS({
3923
4591
  throw new Error("Invalid RegExp string format");
3924
4592
  return { pattern: match[1], flags: match[2] };
3925
4593
  }, "parseRegexString");
3926
- var RegExpValidator = mod.instanceof(RegExp).or(
3927
- mod.string().refine(
4594
+ var RegExpValidator = z.instanceof(RegExp).or(
4595
+ z.string().refine(
3928
4596
  (str) => {
3929
4597
  try {
3930
4598
  parseRegexString(str);
@@ -3945,71 +4613,71 @@ var require_types_cjs_development = __commonJS({
3945
4613
  }
3946
4614
  })
3947
4615
  );
3948
- var StringQuery = mod.string().or(mod.object({ $in: mod.string().array() })).or(mod.object({ $regex: RegExpValidator }));
3949
- var LCNProfileDisplayValidator = mod.object({
3950
- backgroundColor: mod.string().optional(),
3951
- backgroundImage: mod.string().optional(),
3952
- fadeBackgroundImage: mod.boolean().optional(),
3953
- repeatBackgroundImage: mod.boolean().optional(),
3954
- fontColor: mod.string().optional(),
3955
- accentColor: mod.string().optional(),
3956
- accentFontColor: mod.string().optional(),
3957
- idBackgroundImage: mod.string().optional(),
3958
- fadeIdBackgroundImage: mod.boolean().optional(),
3959
- idBackgroundColor: mod.string().optional(),
3960
- repeatIdBackgroundImage: mod.boolean().optional()
4616
+ var StringQuery = z.string().or(z.object({ $in: z.string().array() })).or(z.object({ $regex: RegExpValidator }));
4617
+ var LCNProfileDisplayValidator = z.object({
4618
+ backgroundColor: z.string().optional(),
4619
+ backgroundImage: z.string().optional(),
4620
+ fadeBackgroundImage: z.boolean().optional(),
4621
+ repeatBackgroundImage: z.boolean().optional(),
4622
+ fontColor: z.string().optional(),
4623
+ accentColor: z.string().optional(),
4624
+ accentFontColor: z.string().optional(),
4625
+ idBackgroundImage: z.string().optional(),
4626
+ fadeIdBackgroundImage: z.boolean().optional(),
4627
+ idBackgroundColor: z.string().optional(),
4628
+ repeatIdBackgroundImage: z.boolean().optional()
3961
4629
  });
3962
- var LCNProfileValidator = mod.object({
3963
- profileId: mod.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),
3964
- displayName: mod.string().default("").describe("Human-readable display name for the profile."),
3965
- shortBio: mod.string().default("").describe("Short bio for the profile."),
3966
- bio: mod.string().default("").describe("Longer bio for the profile."),
3967
- did: mod.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),
3968
- isPrivate: mod.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),
3969
- email: mod.string().optional().describe("Contact email address for the profile."),
3970
- image: mod.string().optional().describe("Profile image URL for the profile."),
3971
- heroImage: mod.string().optional().describe("Hero image URL for the profile."),
3972
- websiteLink: mod.string().optional().describe("Website link for the profile."),
3973
- isServiceProfile: mod.boolean().default(false).optional().describe("Whether the profile is a service profile or not."),
3974
- type: mod.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),
3975
- notificationsWebhook: mod.string().url().startsWith("http").optional().describe("URL to send notifications to."),
4630
+ var LCNProfileValidator = z.object({
4631
+ profileId: z.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),
4632
+ displayName: z.string().default("").describe("Human-readable display name for the profile."),
4633
+ shortBio: z.string().default("").describe("Short bio for the profile."),
4634
+ bio: z.string().default("").describe("Longer bio for the profile."),
4635
+ did: z.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),
4636
+ isPrivate: z.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),
4637
+ email: z.string().optional().describe("Contact email address for the profile."),
4638
+ image: z.string().optional().describe("Profile image URL for the profile."),
4639
+ heroImage: z.string().optional().describe("Hero image URL for the profile."),
4640
+ websiteLink: z.string().optional().describe("Website link for the profile."),
4641
+ isServiceProfile: z.boolean().default(false).optional().describe("Whether the profile is a service profile or not."),
4642
+ type: z.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),
4643
+ notificationsWebhook: z.string().url().startsWith("http").optional().describe("URL to send notifications to."),
3976
4644
  display: LCNProfileDisplayValidator.optional().describe("Display settings for the profile."),
3977
- role: mod.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),
3978
- dob: mod.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".')
4645
+ role: z.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),
4646
+ dob: z.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".')
3979
4647
  });
3980
- var LCNProfileQueryValidator = mod.object({
4648
+ var LCNProfileQueryValidator = z.object({
3981
4649
  profileId: StringQuery,
3982
4650
  displayName: StringQuery,
3983
4651
  shortBio: StringQuery,
3984
4652
  bio: StringQuery,
3985
4653
  email: StringQuery,
3986
4654
  websiteLink: StringQuery,
3987
- isServiceProfile: mod.boolean(),
4655
+ isServiceProfile: z.boolean(),
3988
4656
  type: StringQuery
3989
4657
  }).partial();
3990
4658
  var PaginatedLCNProfilesValidator = PaginationResponseValidator.extend({
3991
4659
  records: LCNProfileValidator.array()
3992
4660
  });
3993
- var LCNProfileConnectionStatusEnum = mod.enum([
4661
+ var LCNProfileConnectionStatusEnum = z.enum([
3994
4662
  "CONNECTED",
3995
4663
  "PENDING_REQUEST_SENT",
3996
4664
  "PENDING_REQUEST_RECEIVED",
3997
4665
  "NOT_CONNECTED"
3998
4666
  ]);
3999
- var LCNProfileManagerValidator = mod.object({
4000
- id: mod.string(),
4001
- created: mod.string(),
4002
- displayName: mod.string().default("").optional(),
4003
- shortBio: mod.string().default("").optional(),
4004
- bio: mod.string().default("").optional(),
4005
- email: mod.string().optional(),
4006
- image: mod.string().optional(),
4007
- heroImage: mod.string().optional()
4667
+ var LCNProfileManagerValidator = z.object({
4668
+ id: z.string(),
4669
+ created: z.string(),
4670
+ displayName: z.string().default("").optional(),
4671
+ shortBio: z.string().default("").optional(),
4672
+ bio: z.string().default("").optional(),
4673
+ email: z.string().optional(),
4674
+ image: z.string().optional(),
4675
+ heroImage: z.string().optional()
4008
4676
  });
4009
4677
  var PaginatedLCNProfileManagersValidator = PaginationResponseValidator.extend({
4010
- records: LCNProfileManagerValidator.extend({ did: mod.string() }).array()
4678
+ records: LCNProfileManagerValidator.extend({ did: z.string() }).array()
4011
4679
  });
4012
- var LCNProfileManagerQueryValidator = mod.object({
4680
+ var LCNProfileManagerQueryValidator = z.object({
4013
4681
  id: StringQuery,
4014
4682
  displayName: StringQuery,
4015
4683
  shortBio: StringQuery,
@@ -4017,296 +4685,296 @@ var require_types_cjs_development = __commonJS({
4017
4685
  email: StringQuery
4018
4686
  }).partial();
4019
4687
  var PaginatedLCNProfilesAndManagersValidator = PaginationResponseValidator.extend({
4020
- records: mod.object({
4688
+ records: z.object({
4021
4689
  profile: LCNProfileValidator,
4022
- manager: LCNProfileManagerValidator.extend({ did: mod.string() }).optional()
4690
+ manager: LCNProfileManagerValidator.extend({ did: z.string() }).optional()
4023
4691
  }).array()
4024
4692
  });
4025
- var SentCredentialInfoValidator = mod.object({
4026
- uri: mod.string(),
4027
- to: mod.string(),
4028
- from: mod.string(),
4029
- sent: mod.string().datetime(),
4030
- received: mod.string().datetime().optional()
4693
+ var SentCredentialInfoValidator = z.object({
4694
+ uri: z.string(),
4695
+ to: z.string(),
4696
+ from: z.string(),
4697
+ sent: z.string().datetime(),
4698
+ received: z.string().datetime().optional()
4031
4699
  });
4032
- var BoostPermissionsValidator = mod.object({
4033
- role: mod.string(),
4034
- canEdit: mod.boolean(),
4035
- canIssue: mod.boolean(),
4036
- canRevoke: mod.boolean(),
4037
- canManagePermissions: mod.boolean(),
4038
- canIssueChildren: mod.string(),
4039
- canCreateChildren: mod.string(),
4040
- canEditChildren: mod.string(),
4041
- canRevokeChildren: mod.string(),
4042
- canManageChildrenPermissions: mod.string(),
4043
- canManageChildrenProfiles: mod.boolean().default(false).optional(),
4044
- canViewAnalytics: mod.boolean()
4700
+ var BoostPermissionsValidator = z.object({
4701
+ role: z.string(),
4702
+ canEdit: z.boolean(),
4703
+ canIssue: z.boolean(),
4704
+ canRevoke: z.boolean(),
4705
+ canManagePermissions: z.boolean(),
4706
+ canIssueChildren: z.string(),
4707
+ canCreateChildren: z.string(),
4708
+ canEditChildren: z.string(),
4709
+ canRevokeChildren: z.string(),
4710
+ canManageChildrenPermissions: z.string(),
4711
+ canManageChildrenProfiles: z.boolean().default(false).optional(),
4712
+ canViewAnalytics: z.boolean()
4045
4713
  });
4046
- var BoostPermissionsQueryValidator = mod.object({
4714
+ var BoostPermissionsQueryValidator = z.object({
4047
4715
  role: StringQuery,
4048
- canEdit: mod.boolean(),
4049
- canIssue: mod.boolean(),
4050
- canRevoke: mod.boolean(),
4051
- canManagePermissions: mod.boolean(),
4716
+ canEdit: z.boolean(),
4717
+ canIssue: z.boolean(),
4718
+ canRevoke: z.boolean(),
4719
+ canManagePermissions: z.boolean(),
4052
4720
  canIssueChildren: StringQuery,
4053
4721
  canCreateChildren: StringQuery,
4054
4722
  canEditChildren: StringQuery,
4055
4723
  canRevokeChildren: StringQuery,
4056
4724
  canManageChildrenPermissions: StringQuery,
4057
- canManageChildrenProfiles: mod.boolean(),
4058
- canViewAnalytics: mod.boolean()
4725
+ canManageChildrenProfiles: z.boolean(),
4726
+ canViewAnalytics: z.boolean()
4059
4727
  }).partial();
4060
- var ClaimHookTypeValidator = mod.enum(["GRANT_PERMISSIONS", "ADD_ADMIN"]);
4061
- var ClaimHookValidator = mod.discriminatedUnion("type", [
4062
- mod.object({
4063
- type: mod.literal(ClaimHookTypeValidator.Values.GRANT_PERMISSIONS),
4064
- data: mod.object({
4065
- claimUri: mod.string(),
4066
- targetUri: mod.string(),
4728
+ var ClaimHookTypeValidator = z.enum(["GRANT_PERMISSIONS", "ADD_ADMIN"]);
4729
+ var ClaimHookValidator = z.discriminatedUnion("type", [
4730
+ z.object({
4731
+ type: z.literal(ClaimHookTypeValidator.Values.GRANT_PERMISSIONS),
4732
+ data: z.object({
4733
+ claimUri: z.string(),
4734
+ targetUri: z.string(),
4067
4735
  permissions: BoostPermissionsValidator.partial()
4068
4736
  })
4069
4737
  }),
4070
- mod.object({
4071
- type: mod.literal(ClaimHookTypeValidator.Values.ADD_ADMIN),
4072
- data: mod.object({ claimUri: mod.string(), targetUri: mod.string() })
4738
+ z.object({
4739
+ type: z.literal(ClaimHookTypeValidator.Values.ADD_ADMIN),
4740
+ data: z.object({ claimUri: z.string(), targetUri: z.string() })
4073
4741
  })
4074
4742
  ]);
4075
- var ClaimHookQueryValidator = mod.object({
4743
+ var ClaimHookQueryValidator = z.object({
4076
4744
  type: StringQuery,
4077
- data: mod.object({
4745
+ data: z.object({
4078
4746
  claimUri: StringQuery,
4079
4747
  targetUri: StringQuery,
4080
4748
  permissions: BoostPermissionsQueryValidator
4081
4749
  })
4082
4750
  }).deepPartial();
4083
- var FullClaimHookValidator = mod.object({ id: mod.string(), createdAt: mod.string(), updatedAt: mod.string() }).and(ClaimHookValidator);
4751
+ var FullClaimHookValidator = z.object({ id: z.string(), createdAt: z.string(), updatedAt: z.string() }).and(ClaimHookValidator);
4084
4752
  var PaginatedClaimHooksValidator = PaginationResponseValidator.extend({
4085
4753
  records: FullClaimHookValidator.array()
4086
4754
  });
4087
- var LCNBoostStatus = mod.enum(["DRAFT", "LIVE"]);
4088
- var BoostValidator = mod.object({
4089
- uri: mod.string(),
4090
- name: mod.string().optional(),
4091
- type: mod.string().optional(),
4092
- category: mod.string().optional(),
4755
+ var LCNBoostStatus = z.enum(["DRAFT", "LIVE"]);
4756
+ var BoostValidator = z.object({
4757
+ uri: z.string(),
4758
+ name: z.string().optional(),
4759
+ type: z.string().optional(),
4760
+ category: z.string().optional(),
4093
4761
  status: LCNBoostStatus.optional(),
4094
- autoConnectRecipients: mod.boolean().optional(),
4095
- meta: mod.record(mod.any()).optional(),
4762
+ autoConnectRecipients: z.boolean().optional(),
4763
+ meta: z.record(z.any()).optional(),
4096
4764
  claimPermissions: BoostPermissionsValidator.optional()
4097
4765
  });
4098
- var BoostQueryValidator = mod.object({
4766
+ var BoostQueryValidator = z.object({
4099
4767
  uri: StringQuery,
4100
4768
  name: StringQuery,
4101
4769
  type: StringQuery,
4102
4770
  category: StringQuery,
4103
- meta: mod.record(StringQuery),
4104
- status: LCNBoostStatus.or(mod.object({ $in: LCNBoostStatus.array() })),
4105
- autoConnectRecipients: mod.boolean()
4771
+ meta: z.record(StringQuery),
4772
+ status: LCNBoostStatus.or(z.object({ $in: LCNBoostStatus.array() })),
4773
+ autoConnectRecipients: z.boolean()
4106
4774
  }).partial();
4107
4775
  var PaginatedBoostsValidator = PaginationResponseValidator.extend({
4108
4776
  records: BoostValidator.array()
4109
4777
  });
4110
- var BoostRecipientValidator = mod.object({
4778
+ var BoostRecipientValidator = z.object({
4111
4779
  to: LCNProfileValidator,
4112
- from: mod.string(),
4113
- received: mod.string().optional(),
4114
- uri: mod.string().optional()
4780
+ from: z.string(),
4781
+ received: z.string().optional(),
4782
+ uri: z.string().optional()
4115
4783
  });
4116
4784
  var PaginatedBoostRecipientsValidator = PaginationResponseValidator.extend({
4117
4785
  records: BoostRecipientValidator.array()
4118
4786
  });
4119
- var LCNBoostClaimLinkSigningAuthorityValidator = mod.object({
4120
- endpoint: mod.string(),
4121
- name: mod.string(),
4122
- did: mod.string().optional()
4787
+ var LCNBoostClaimLinkSigningAuthorityValidator = z.object({
4788
+ endpoint: z.string(),
4789
+ name: z.string(),
4790
+ did: z.string().optional()
4123
4791
  });
4124
- var LCNBoostClaimLinkOptionsValidator = mod.object({
4125
- ttlSeconds: mod.number().optional(),
4126
- totalUses: mod.number().optional()
4792
+ var LCNBoostClaimLinkOptionsValidator = z.object({
4793
+ ttlSeconds: z.number().optional(),
4794
+ totalUses: z.number().optional()
4127
4795
  });
4128
- var LCNSigningAuthorityValidator = mod.object({
4129
- endpoint: mod.string()
4796
+ var LCNSigningAuthorityValidator = z.object({
4797
+ endpoint: z.string()
4130
4798
  });
4131
- var LCNSigningAuthorityForUserValidator = mod.object({
4799
+ var LCNSigningAuthorityForUserValidator = z.object({
4132
4800
  signingAuthority: LCNSigningAuthorityValidator,
4133
- relationship: mod.object({
4134
- name: mod.string().max(15).regex(/^[a-z0-9-]+$/, {
4801
+ relationship: z.object({
4802
+ name: z.string().max(15).regex(/^[a-z0-9-]+$/, {
4135
4803
  message: "The input string must contain only lowercase letters, numbers, and hyphens."
4136
4804
  }),
4137
- did: mod.string()
4805
+ did: z.string()
4138
4806
  })
4139
4807
  });
4140
- var AutoBoostConfigValidator = mod.object({
4141
- boostUri: mod.string(),
4142
- signingAuthority: mod.object({
4143
- endpoint: mod.string(),
4144
- name: mod.string()
4808
+ var AutoBoostConfigValidator = z.object({
4809
+ boostUri: z.string(),
4810
+ signingAuthority: z.object({
4811
+ endpoint: z.string(),
4812
+ name: z.string()
4145
4813
  })
4146
4814
  });
4147
- var ConsentFlowTermsStatusValidator = mod.enum(["live", "stale", "withdrawn"]);
4148
- var ConsentFlowContractValidator = mod.object({
4149
- read: mod.object({
4150
- anonymize: mod.boolean().optional(),
4151
- credentials: mod.object({ categories: mod.record(mod.object({ required: mod.boolean() })).default({}) }).default({}),
4152
- personal: mod.record(mod.object({ required: mod.boolean() })).default({})
4815
+ var ConsentFlowTermsStatusValidator = z.enum(["live", "stale", "withdrawn"]);
4816
+ var ConsentFlowContractValidator = z.object({
4817
+ read: z.object({
4818
+ anonymize: z.boolean().optional(),
4819
+ credentials: z.object({ categories: z.record(z.object({ required: z.boolean() })).default({}) }).default({}),
4820
+ personal: z.record(z.object({ required: z.boolean() })).default({})
4153
4821
  }).default({}),
4154
- write: mod.object({
4155
- credentials: mod.object({ categories: mod.record(mod.object({ required: mod.boolean() })).default({}) }).default({}),
4156
- personal: mod.record(mod.object({ required: mod.boolean() })).default({})
4822
+ write: z.object({
4823
+ credentials: z.object({ categories: z.record(z.object({ required: z.boolean() })).default({}) }).default({}),
4824
+ personal: z.record(z.object({ required: z.boolean() })).default({})
4157
4825
  }).default({})
4158
4826
  });
4159
- var ConsentFlowContractDetailsValidator = mod.object({
4827
+ var ConsentFlowContractDetailsValidator = z.object({
4160
4828
  contract: ConsentFlowContractValidator,
4161
4829
  owner: LCNProfileValidator,
4162
- name: mod.string(),
4163
- subtitle: mod.string().optional(),
4164
- description: mod.string().optional(),
4165
- reasonForAccessing: mod.string().optional(),
4166
- image: mod.string().optional(),
4167
- uri: mod.string(),
4168
- needsGuardianConsent: mod.boolean().optional(),
4169
- redirectUrl: mod.string().optional(),
4170
- frontDoorBoostUri: mod.string().optional(),
4171
- createdAt: mod.string(),
4172
- updatedAt: mod.string(),
4173
- expiresAt: mod.string().optional(),
4174
- autoBoosts: mod.string().array().optional(),
4175
- writers: mod.array(LCNProfileValidator).optional()
4830
+ name: z.string(),
4831
+ subtitle: z.string().optional(),
4832
+ description: z.string().optional(),
4833
+ reasonForAccessing: z.string().optional(),
4834
+ image: z.string().optional(),
4835
+ uri: z.string(),
4836
+ needsGuardianConsent: z.boolean().optional(),
4837
+ redirectUrl: z.string().optional(),
4838
+ frontDoorBoostUri: z.string().optional(),
4839
+ createdAt: z.string(),
4840
+ updatedAt: z.string(),
4841
+ expiresAt: z.string().optional(),
4842
+ autoBoosts: z.string().array().optional(),
4843
+ writers: z.array(LCNProfileValidator).optional()
4176
4844
  });
4177
4845
  var PaginatedConsentFlowContractsValidator = PaginationResponseValidator.extend({
4178
4846
  records: ConsentFlowContractDetailsValidator.omit({ owner: true }).array()
4179
4847
  });
4180
- var ConsentFlowContractDataValidator = mod.object({
4181
- credentials: mod.object({ categories: mod.record(mod.string().array()).default({}) }),
4182
- personal: mod.record(mod.string()).default({}),
4183
- date: mod.string()
4848
+ var ConsentFlowContractDataValidator = z.object({
4849
+ credentials: z.object({ categories: z.record(z.string().array()).default({}) }),
4850
+ personal: z.record(z.string()).default({}),
4851
+ date: z.string()
4184
4852
  });
4185
4853
  var PaginatedConsentFlowDataValidator = PaginationResponseValidator.extend({
4186
4854
  records: ConsentFlowContractDataValidator.array()
4187
4855
  });
4188
- var ConsentFlowContractDataForDidValidator = mod.object({
4189
- credentials: mod.object({ category: mod.string(), uri: mod.string() }).array(),
4190
- personal: mod.record(mod.string()).default({}),
4191
- date: mod.string(),
4192
- contractUri: mod.string()
4856
+ var ConsentFlowContractDataForDidValidator = z.object({
4857
+ credentials: z.object({ category: z.string(), uri: z.string() }).array(),
4858
+ personal: z.record(z.string()).default({}),
4859
+ date: z.string(),
4860
+ contractUri: z.string()
4193
4861
  });
4194
4862
  var PaginatedConsentFlowDataForDidValidator = PaginationResponseValidator.extend({
4195
4863
  records: ConsentFlowContractDataForDidValidator.array()
4196
4864
  });
4197
- var ConsentFlowTermValidator = mod.object({
4198
- sharing: mod.boolean().optional(),
4199
- shared: mod.string().array().optional(),
4200
- shareAll: mod.boolean().optional(),
4201
- shareUntil: mod.string().optional()
4865
+ var ConsentFlowTermValidator = z.object({
4866
+ sharing: z.boolean().optional(),
4867
+ shared: z.string().array().optional(),
4868
+ shareAll: z.boolean().optional(),
4869
+ shareUntil: z.string().optional()
4202
4870
  });
4203
- var ConsentFlowTermsValidator = mod.object({
4204
- read: mod.object({
4205
- anonymize: mod.boolean().optional(),
4206
- credentials: mod.object({
4207
- shareAll: mod.boolean().optional(),
4208
- sharing: mod.boolean().optional(),
4209
- categories: mod.record(ConsentFlowTermValidator).default({})
4871
+ var ConsentFlowTermsValidator = z.object({
4872
+ read: z.object({
4873
+ anonymize: z.boolean().optional(),
4874
+ credentials: z.object({
4875
+ shareAll: z.boolean().optional(),
4876
+ sharing: z.boolean().optional(),
4877
+ categories: z.record(ConsentFlowTermValidator).default({})
4210
4878
  }).default({}),
4211
- personal: mod.record(mod.string()).default({})
4879
+ personal: z.record(z.string()).default({})
4212
4880
  }).default({}),
4213
- write: mod.object({
4214
- credentials: mod.object({ categories: mod.record(mod.boolean()).default({}) }).default({}),
4215
- personal: mod.record(mod.boolean()).default({})
4881
+ write: z.object({
4882
+ credentials: z.object({ categories: z.record(z.boolean()).default({}) }).default({}),
4883
+ personal: z.record(z.boolean()).default({})
4216
4884
  }).default({}),
4217
- deniedWriters: mod.array(mod.string()).optional()
4885
+ deniedWriters: z.array(z.string()).optional()
4218
4886
  });
4219
4887
  var PaginatedConsentFlowTermsValidator = PaginationResponseValidator.extend({
4220
- records: mod.object({
4221
- expiresAt: mod.string().optional(),
4222
- oneTime: mod.boolean().optional(),
4888
+ records: z.object({
4889
+ expiresAt: z.string().optional(),
4890
+ oneTime: z.boolean().optional(),
4223
4891
  terms: ConsentFlowTermsValidator,
4224
4892
  contract: ConsentFlowContractDetailsValidator,
4225
- uri: mod.string(),
4893
+ uri: z.string(),
4226
4894
  consenter: LCNProfileValidator,
4227
4895
  status: ConsentFlowTermsStatusValidator
4228
4896
  }).array()
4229
4897
  });
4230
- var ConsentFlowContractQueryValidator = mod.object({
4231
- read: mod.object({
4232
- anonymize: mod.boolean().optional(),
4233
- credentials: mod.object({
4234
- categories: mod.record(mod.object({ required: mod.boolean().optional() })).optional()
4898
+ var ConsentFlowContractQueryValidator = z.object({
4899
+ read: z.object({
4900
+ anonymize: z.boolean().optional(),
4901
+ credentials: z.object({
4902
+ categories: z.record(z.object({ required: z.boolean().optional() })).optional()
4235
4903
  }).optional(),
4236
- personal: mod.record(mod.object({ required: mod.boolean().optional() })).optional()
4904
+ personal: z.record(z.object({ required: z.boolean().optional() })).optional()
4237
4905
  }).optional(),
4238
- write: mod.object({
4239
- credentials: mod.object({
4240
- categories: mod.record(mod.object({ required: mod.boolean().optional() })).optional()
4906
+ write: z.object({
4907
+ credentials: z.object({
4908
+ categories: z.record(z.object({ required: z.boolean().optional() })).optional()
4241
4909
  }).optional(),
4242
- personal: mod.record(mod.object({ required: mod.boolean().optional() })).optional()
4910
+ personal: z.record(z.object({ required: z.boolean().optional() })).optional()
4243
4911
  }).optional()
4244
4912
  });
4245
- var ConsentFlowDataQueryValidator = mod.object({
4246
- anonymize: mod.boolean().optional(),
4247
- credentials: mod.object({ categories: mod.record(mod.boolean()).optional() }).optional(),
4248
- personal: mod.record(mod.boolean()).optional()
4913
+ var ConsentFlowDataQueryValidator = z.object({
4914
+ anonymize: z.boolean().optional(),
4915
+ credentials: z.object({ categories: z.record(z.boolean()).optional() }).optional(),
4916
+ personal: z.record(z.boolean()).optional()
4249
4917
  });
4250
- var ConsentFlowDataForDidQueryValidator = mod.object({
4251
- credentials: mod.object({ categories: mod.record(mod.boolean()).optional() }).optional(),
4252
- personal: mod.record(mod.boolean()).optional(),
4918
+ var ConsentFlowDataForDidQueryValidator = z.object({
4919
+ credentials: z.object({ categories: z.record(z.boolean()).optional() }).optional(),
4920
+ personal: z.record(z.boolean()).optional(),
4253
4921
  id: StringQuery.optional()
4254
4922
  });
4255
- var ConsentFlowTermsQueryValidator = mod.object({
4256
- read: mod.object({
4257
- anonymize: mod.boolean().optional(),
4258
- credentials: mod.object({
4259
- shareAll: mod.boolean().optional(),
4260
- sharing: mod.boolean().optional(),
4261
- categories: mod.record(ConsentFlowTermValidator.optional()).optional()
4923
+ var ConsentFlowTermsQueryValidator = z.object({
4924
+ read: z.object({
4925
+ anonymize: z.boolean().optional(),
4926
+ credentials: z.object({
4927
+ shareAll: z.boolean().optional(),
4928
+ sharing: z.boolean().optional(),
4929
+ categories: z.record(ConsentFlowTermValidator.optional()).optional()
4262
4930
  }).optional(),
4263
- personal: mod.record(mod.string()).optional()
4931
+ personal: z.record(z.string()).optional()
4264
4932
  }).optional(),
4265
- write: mod.object({
4266
- credentials: mod.object({ categories: mod.record(mod.boolean()).optional() }).optional(),
4267
- personal: mod.record(mod.boolean()).optional()
4933
+ write: z.object({
4934
+ credentials: z.object({ categories: z.record(z.boolean()).optional() }).optional(),
4935
+ personal: z.record(z.boolean()).optional()
4268
4936
  }).optional()
4269
4937
  });
4270
- var ConsentFlowTransactionActionValidator = mod.enum([
4938
+ var ConsentFlowTransactionActionValidator = z.enum([
4271
4939
  "consent",
4272
4940
  "update",
4273
4941
  "sync",
4274
4942
  "withdraw",
4275
4943
  "write"
4276
4944
  ]);
4277
- var ConsentFlowTransactionsQueryValidator = mod.object({
4945
+ var ConsentFlowTransactionsQueryValidator = z.object({
4278
4946
  terms: ConsentFlowTermsQueryValidator.optional(),
4279
4947
  action: ConsentFlowTransactionActionValidator.or(
4280
4948
  ConsentFlowTransactionActionValidator.array()
4281
4949
  ).optional(),
4282
- date: mod.object({ $gt: mod.string() }).or(mod.object({ $lt: mod.string() })).or(mod.object({ $eq: mod.string() })).optional(),
4283
- expiresAt: mod.object({ $gt: mod.string() }).or(mod.object({ $lt: mod.string() })).or(mod.object({ $eq: mod.string() })).optional(),
4284
- oneTime: mod.boolean().optional()
4950
+ date: z.object({ $gt: z.string() }).or(z.object({ $lt: z.string() })).or(z.object({ $eq: z.string() })).optional(),
4951
+ expiresAt: z.object({ $gt: z.string() }).or(z.object({ $lt: z.string() })).or(z.object({ $eq: z.string() })).optional(),
4952
+ oneTime: z.boolean().optional()
4285
4953
  });
4286
- var ConsentFlowTransactionValidator = mod.object({
4287
- expiresAt: mod.string().optional(),
4288
- oneTime: mod.boolean().optional(),
4954
+ var ConsentFlowTransactionValidator = z.object({
4955
+ expiresAt: z.string().optional(),
4956
+ oneTime: z.boolean().optional(),
4289
4957
  terms: ConsentFlowTermsValidator.optional(),
4290
- id: mod.string(),
4958
+ id: z.string(),
4291
4959
  action: ConsentFlowTransactionActionValidator,
4292
- date: mod.string(),
4293
- uris: mod.string().array().optional()
4960
+ date: z.string(),
4961
+ uris: z.string().array().optional()
4294
4962
  });
4295
4963
  var PaginatedConsentFlowTransactionsValidator = PaginationResponseValidator.extend({
4296
4964
  records: ConsentFlowTransactionValidator.array()
4297
4965
  });
4298
- var ContractCredentialValidator = mod.object({
4299
- credentialUri: mod.string(),
4300
- termsUri: mod.string(),
4301
- contractUri: mod.string(),
4302
- boostUri: mod.string(),
4303
- category: mod.string().optional(),
4304
- date: mod.string()
4966
+ var ContractCredentialValidator = z.object({
4967
+ credentialUri: z.string(),
4968
+ termsUri: z.string(),
4969
+ contractUri: z.string(),
4970
+ boostUri: z.string(),
4971
+ category: z.string().optional(),
4972
+ date: z.string()
4305
4973
  });
4306
4974
  var PaginatedContractCredentialsValidator = PaginationResponseValidator.extend({
4307
4975
  records: ContractCredentialValidator.array()
4308
4976
  });
4309
- var LCNNotificationTypeEnumValidator = mod.enum([
4977
+ var LCNNotificationTypeEnumValidator = z.enum([
4310
4978
  "CONNECTION_REQUEST",
4311
4979
  "CONNECTION_ACCEPTED",
4312
4980
  "CREDENTIAL_RECEIVED",
@@ -4317,40 +4985,40 @@ var require_types_cjs_development = __commonJS({
4317
4985
  "PRESENTATION_RECEIVED",
4318
4986
  "CONSENT_FLOW_TRANSACTION"
4319
4987
  ]);
4320
- var LCNNotificationMessageValidator = mod.object({
4321
- title: mod.string().optional(),
4322
- body: mod.string().optional()
4988
+ var LCNNotificationMessageValidator = z.object({
4989
+ title: z.string().optional(),
4990
+ body: z.string().optional()
4323
4991
  });
4324
- var LCNNotificationDataValidator = mod.object({
4325
- vcUris: mod.array(mod.string()).optional(),
4326
- vpUris: mod.array(mod.string()).optional(),
4992
+ var LCNNotificationDataValidator = z.object({
4993
+ vcUris: z.array(z.string()).optional(),
4994
+ vpUris: z.array(z.string()).optional(),
4327
4995
  transaction: ConsentFlowTransactionValidator.optional()
4328
4996
  });
4329
- var LCNNotificationValidator = mod.object({
4997
+ var LCNNotificationValidator = z.object({
4330
4998
  type: LCNNotificationTypeEnumValidator,
4331
- to: LCNProfileValidator.partial().and(mod.object({ did: mod.string() })),
4332
- from: LCNProfileValidator.partial().and(mod.object({ did: mod.string() })),
4999
+ to: LCNProfileValidator.partial().and(z.object({ did: z.string() })),
5000
+ from: LCNProfileValidator.partial().and(z.object({ did: z.string() })),
4333
5001
  message: LCNNotificationMessageValidator.optional(),
4334
5002
  data: LCNNotificationDataValidator.optional(),
4335
- sent: mod.string().datetime().optional()
5003
+ sent: z.string().datetime().optional()
4336
5004
  });
4337
5005
  var AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX = "auth-grant:";
4338
- var AuthGrantValidator = mod.object({
4339
- id: mod.string(),
4340
- name: mod.string(),
4341
- description: mod.string().optional(),
4342
- challenge: mod.string().startsWith(AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX).min(10, { message: "Challenge is too short" }).max(100, { message: "Challenge is too long" }),
4343
- status: mod.enum(["revoked", "active"], {
5006
+ var AuthGrantValidator = z.object({
5007
+ id: z.string(),
5008
+ name: z.string(),
5009
+ description: z.string().optional(),
5010
+ challenge: z.string().startsWith(AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX).min(10, { message: "Challenge is too short" }).max(100, { message: "Challenge is too long" }),
5011
+ status: z.enum(["revoked", "active"], {
4344
5012
  required_error: "Status is required",
4345
5013
  invalid_type_error: "Status must be either active or revoked"
4346
5014
  }),
4347
- scope: mod.string(),
4348
- createdAt: mod.string().datetime({ message: "createdAt must be a valid ISO 8601 datetime string" }),
4349
- expiresAt: mod.string().datetime({ message: "expiresAt must be a valid ISO 8601 datetime string" }).nullish().optional()
5015
+ scope: z.string(),
5016
+ createdAt: z.string().datetime({ message: "createdAt must be a valid ISO 8601 datetime string" }),
5017
+ expiresAt: z.string().datetime({ message: "expiresAt must be a valid ISO 8601 datetime string" }).nullish().optional()
4350
5018
  });
4351
- var FlatAuthGrantValidator = mod.object({ id: mod.string() }).catchall(mod.any());
4352
- var AuthGrantStatusValidator = mod.enum(["active", "revoked"]);
4353
- var AuthGrantQueryValidator = mod.object({
5019
+ var FlatAuthGrantValidator = z.object({ id: z.string() }).catchall(z.any());
5020
+ var AuthGrantStatusValidator = z.enum(["active", "revoked"]);
5021
+ var AuthGrantQueryValidator = z.object({
4354
5022
  id: StringQuery,
4355
5023
  name: StringQuery,
4356
5024
  description: StringQuery,