@learncard/types 5.3.1 → 5.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -39,6 +39,7 @@ __export(src_exports, {
39
39
  CredentialSubjectValidator: () => CredentialSubjectValidator,
40
40
  CriteriaValidator: () => CriteriaValidator,
41
41
  EncryptedCredentialRecordValidator: () => EncryptedCredentialRecordValidator,
42
+ EncryptedRecordValidator: () => EncryptedRecordValidator,
42
43
  EndorsementCredentialValidator: () => EndorsementCredentialValidator,
43
44
  EndorsementSubjectValidator: () => EndorsementSubjectValidator,
44
45
  EvidenceValidator: () => EvidenceValidator,
@@ -64,6 +65,7 @@ __export(src_exports, {
64
65
  LCNSigningAuthorityForUserValidator: () => LCNSigningAuthorityForUserValidator,
65
66
  LCNSigningAuthorityValidator: () => LCNSigningAuthorityValidator,
66
67
  PaginatedEncryptedCredentialRecordsValidator: () => PaginatedEncryptedCredentialRecordsValidator,
68
+ PaginatedEncryptedRecordsValidator: () => PaginatedEncryptedRecordsValidator,
67
69
  PaginationOptionsValidator: () => PaginationOptionsValidator,
68
70
  PaginationResponseValidator: () => PaginationResponseValidator,
69
71
  ProfileValidator: () => ProfileValidator,
@@ -88,7 +90,7 @@ __export(src_exports, {
88
90
  });
89
91
  module.exports = __toCommonJS(src_exports);
90
92
 
91
- // ../../node_modules/.pnpm/zod@3.20.6/node_modules/zod/lib/index.mjs
93
+ // ../../node_modules/.pnpm/zod@3.20.2/node_modules/zod/lib/index.mjs
92
94
  var util;
93
95
  (function(util2) {
94
96
  util2.assertEqual = (val) => val;
@@ -520,7 +522,7 @@ var OK = /* @__PURE__ */ __name((value) => ({ status: "valid", value }), "OK");
520
522
  var isAborted = /* @__PURE__ */ __name((x) => x.status === "aborted", "isAborted");
521
523
  var isDirty = /* @__PURE__ */ __name((x) => x.status === "dirty", "isDirty");
522
524
  var isValid = /* @__PURE__ */ __name((x) => x.status === "valid", "isValid");
523
- var isAsync = /* @__PURE__ */ __name((x) => typeof Promise !== "undefined" && x instanceof Promise, "isAsync");
525
+ var isAsync = /* @__PURE__ */ __name((x) => typeof Promise !== void 0 && x instanceof Promise, "isAsync");
524
526
  var errorUtil;
525
527
  (function(errorUtil2) {
526
528
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
@@ -738,29 +740,28 @@ var ZodType = class {
738
740
  return this._refinement(refinement);
739
741
  }
740
742
  optional() {
741
- return ZodOptional.create(this, this._def);
743
+ return ZodOptional.create(this);
742
744
  }
743
745
  nullable() {
744
- return ZodNullable.create(this, this._def);
746
+ return ZodNullable.create(this);
745
747
  }
746
748
  nullish() {
747
- return this.nullable().optional();
749
+ return this.optional().nullable();
748
750
  }
749
751
  array() {
750
- return ZodArray.create(this, this._def);
752
+ return ZodArray.create(this);
751
753
  }
752
754
  promise() {
753
- return ZodPromise.create(this, this._def);
755
+ return ZodPromise.create(this);
754
756
  }
755
757
  or(option) {
756
- return ZodUnion.create([this, option], this._def);
758
+ return ZodUnion.create([this, option]);
757
759
  }
758
760
  and(incoming) {
759
- return ZodIntersection.create(this, incoming, this._def);
761
+ return ZodIntersection.create(this, incoming);
760
762
  }
761
763
  transform(transform) {
762
764
  return new ZodEffects({
763
- ...processCreateParams(this._def),
764
765
  schema: this,
765
766
  typeName: ZodFirstPartyTypeKind.ZodEffects,
766
767
  effect: { type: "transform", transform }
@@ -769,7 +770,6 @@ var ZodType = class {
769
770
  default(def) {
770
771
  const defaultValueFunc = typeof def === "function" ? def : () => def;
771
772
  return new ZodDefault({
772
- ...processCreateParams(this._def),
773
773
  innerType: this,
774
774
  defaultValue: defaultValueFunc,
775
775
  typeName: ZodFirstPartyTypeKind.ZodDefault
@@ -779,15 +779,14 @@ var ZodType = class {
779
779
  return new ZodBranded({
780
780
  typeName: ZodFirstPartyTypeKind.ZodBranded,
781
781
  type: this,
782
- ...processCreateParams(this._def)
782
+ ...processCreateParams(void 0)
783
783
  });
784
784
  }
785
785
  catch(def) {
786
- const catchValueFunc = typeof def === "function" ? def : () => def;
786
+ const defaultValueFunc = typeof def === "function" ? def : () => def;
787
787
  return new ZodCatch({
788
- ...processCreateParams(this._def),
789
788
  innerType: this,
790
- catchValue: catchValueFunc,
789
+ defaultValue: defaultValueFunc,
791
790
  typeName: ZodFirstPartyTypeKind.ZodCatch
792
791
  });
793
792
  }
@@ -810,25 +809,24 @@ var ZodType = class {
810
809
  };
811
810
  __name(ZodType, "ZodType");
812
811
  var cuidRegex = /^c[^\s-]{8,}$/i;
813
- var cuid2Regex = /^[a-z][a-z0-9]*$/;
814
812
  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;
815
- var emailRegex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|([^-]([a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}))$/;
813
+ var emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
816
814
  var datetimeRegex = /* @__PURE__ */ __name((args) => {
817
815
  if (args.precision) {
818
816
  if (args.offset) {
819
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
817
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
820
818
  } else {
821
819
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
822
820
  }
823
821
  } else if (args.precision === 0) {
824
822
  if (args.offset) {
825
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
823
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
826
824
  } else {
827
825
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
828
826
  }
829
827
  } else {
830
828
  if (args.offset) {
831
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
829
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
832
830
  } else {
833
831
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
834
832
  }
@@ -951,16 +949,6 @@ var ZodString = class extends ZodType {
951
949
  });
952
950
  status.dirty();
953
951
  }
954
- } else if (check.kind === "cuid2") {
955
- if (!cuid2Regex.test(input.data)) {
956
- ctx = this._getOrReturnCtx(input, ctx);
957
- addIssueToContext(ctx, {
958
- validation: "cuid2",
959
- code: ZodIssueCode.invalid_string,
960
- message: check.message
961
- });
962
- status.dirty();
963
- }
964
952
  } else if (check.kind === "url") {
965
953
  try {
966
954
  new URL(input.data);
@@ -1042,9 +1030,6 @@ var ZodString = class extends ZodType {
1042
1030
  cuid(message) {
1043
1031
  return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
1044
1032
  }
1045
- cuid2(message) {
1046
- return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
1047
- }
1048
1033
  datetime(options) {
1049
1034
  var _a;
1050
1035
  if (typeof options === "string") {
@@ -1119,9 +1104,6 @@ var ZodString = class extends ZodType {
1119
1104
  get isCUID() {
1120
1105
  return !!this._def.checks.find((ch) => ch.kind === "cuid");
1121
1106
  }
1122
- get isCUID2() {
1123
- return !!this._def.checks.find((ch) => ch.kind === "cuid2");
1124
- }
1125
1107
  get minLength() {
1126
1108
  let min = null;
1127
1109
  for (const ch of this._def.checks) {
@@ -1354,22 +1336,7 @@ var ZodNumber = class extends ZodType {
1354
1336
  return max;
1355
1337
  }
1356
1338
  get isInt() {
1357
- return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
1358
- }
1359
- get isFinite() {
1360
- let max = null, min = null;
1361
- for (const ch of this._def.checks) {
1362
- if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
1363
- return true;
1364
- } else if (ch.kind === "min") {
1365
- if (min === null || ch.value > min)
1366
- min = ch.value;
1367
- } else if (ch.kind === "max") {
1368
- if (max === null || ch.value < max)
1369
- max = ch.value;
1370
- }
1371
- }
1372
- return Number.isFinite(min) && Number.isFinite(max);
1339
+ return !!this._def.checks.find((ch) => ch.kind === "int");
1373
1340
  }
1374
1341
  };
1375
1342
  __name(ZodNumber, "ZodNumber");
@@ -1737,13 +1704,13 @@ var ZodArray = class extends ZodType {
1737
1704
  }
1738
1705
  }
1739
1706
  if (ctx.common.async) {
1740
- return Promise.all([...ctx.data].map((item, i) => {
1707
+ return Promise.all(ctx.data.map((item, i) => {
1741
1708
  return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
1742
1709
  })).then((result2) => {
1743
1710
  return ParseStatus.mergeArray(status, result2);
1744
1711
  });
1745
1712
  }
1746
- const result = [...ctx.data].map((item, i) => {
1713
+ const result = ctx.data.map((item, i) => {
1747
1714
  return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
1748
1715
  });
1749
1716
  return ParseStatus.mergeArray(status, result);
@@ -1794,6 +1761,15 @@ var objectUtil;
1794
1761
  };
1795
1762
  };
1796
1763
  })(objectUtil || (objectUtil = {}));
1764
+ var AugmentFactory = /* @__PURE__ */ __name((def) => (augmentation) => {
1765
+ return new ZodObject({
1766
+ ...def,
1767
+ shape: () => ({
1768
+ ...def.shape(),
1769
+ ...augmentation
1770
+ })
1771
+ });
1772
+ }, "AugmentFactory");
1797
1773
  function deepPartialify(schema) {
1798
1774
  if (schema instanceof ZodObject) {
1799
1775
  const newShape = {};
@@ -1823,7 +1799,8 @@ var ZodObject = class extends ZodType {
1823
1799
  super(...arguments);
1824
1800
  this._cached = null;
1825
1801
  this.nonstrict = this.passthrough;
1826
- this.augment = this.extend;
1802
+ this.augment = AugmentFactory(this._def);
1803
+ this.extend = AugmentFactory(this._def);
1827
1804
  }
1828
1805
  _getCached() {
1829
1806
  if (this._cached !== null)
@@ -1953,31 +1930,8 @@ var ZodObject = class extends ZodType {
1953
1930
  unknownKeys: "passthrough"
1954
1931
  });
1955
1932
  }
1956
- // const AugmentFactory =
1957
- // <Def extends ZodObjectDef>(def: Def) =>
1958
- // <Augmentation extends ZodRawShape>(
1959
- // augmentation: Augmentation
1960
- // ): ZodObject<
1961
- // extendShape<ReturnType<Def["shape"]>, Augmentation>,
1962
- // Def["unknownKeys"],
1963
- // Def["catchall"]
1964
- // > => {
1965
- // return new ZodObject({
1966
- // ...def,
1967
- // shape: () => ({
1968
- // ...def.shape(),
1969
- // ...augmentation,
1970
- // }),
1971
- // }) as any;
1972
- // };
1973
- extend(augmentation) {
1974
- return new ZodObject({
1975
- ...this._def,
1976
- shape: () => ({
1977
- ...this._def.shape(),
1978
- ...augmentation
1979
- })
1980
- });
1933
+ setKey(key, schema) {
1934
+ return this.augment({ [key]: schema });
1981
1935
  }
1982
1936
  /**
1983
1937
  * Prior to zod@1.0.12 there was a bug in the
@@ -1993,65 +1947,6 @@ var ZodObject = class extends ZodType {
1993
1947
  });
1994
1948
  return merged;
1995
1949
  }
1996
- // merge<
1997
- // Incoming extends AnyZodObject,
1998
- // Augmentation extends Incoming["shape"],
1999
- // NewOutput extends {
2000
- // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
2001
- // ? Augmentation[k]["_output"]
2002
- // : k extends keyof Output
2003
- // ? Output[k]
2004
- // : never;
2005
- // },
2006
- // NewInput extends {
2007
- // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
2008
- // ? Augmentation[k]["_input"]
2009
- // : k extends keyof Input
2010
- // ? Input[k]
2011
- // : never;
2012
- // }
2013
- // >(
2014
- // merging: Incoming
2015
- // ): ZodObject<
2016
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
2017
- // Incoming["_def"]["unknownKeys"],
2018
- // Incoming["_def"]["catchall"],
2019
- // NewOutput,
2020
- // NewInput
2021
- // > {
2022
- // const merged: any = new ZodObject({
2023
- // unknownKeys: merging._def.unknownKeys,
2024
- // catchall: merging._def.catchall,
2025
- // shape: () =>
2026
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
2027
- // typeName: ZodFirstPartyTypeKind.ZodObject,
2028
- // }) as any;
2029
- // return merged;
2030
- // }
2031
- setKey(key, schema) {
2032
- return this.augment({ [key]: schema });
2033
- }
2034
- // merge<Incoming extends AnyZodObject>(
2035
- // merging: Incoming
2036
- // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
2037
- // ZodObject<
2038
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
2039
- // Incoming["_def"]["unknownKeys"],
2040
- // Incoming["_def"]["catchall"]
2041
- // > {
2042
- // // const mergedShape = objectUtil.mergeShapes(
2043
- // // this._def.shape(),
2044
- // // merging._def.shape()
2045
- // // );
2046
- // const merged: any = new ZodObject({
2047
- // unknownKeys: merging._def.unknownKeys,
2048
- // catchall: merging._def.catchall,
2049
- // shape: () =>
2050
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
2051
- // typeName: ZodFirstPartyTypeKind.ZodObject,
2052
- // }) as any;
2053
- // return merged;
2054
- // }
2055
1950
  catchall(index) {
2056
1951
  return new ZodObject({
2057
1952
  ...this._def,
@@ -2060,10 +1955,9 @@ var ZodObject = class extends ZodType {
2060
1955
  }
2061
1956
  pick(mask) {
2062
1957
  const shape = {};
2063
- util.objectKeys(mask).forEach((key) => {
2064
- if (mask[key] && this.shape[key]) {
1958
+ util.objectKeys(mask).map((key) => {
1959
+ if (this.shape[key])
2065
1960
  shape[key] = this.shape[key];
2066
- }
2067
1961
  });
2068
1962
  return new ZodObject({
2069
1963
  ...this._def,
@@ -2072,8 +1966,8 @@ var ZodObject = class extends ZodType {
2072
1966
  }
2073
1967
  omit(mask) {
2074
1968
  const shape = {};
2075
- util.objectKeys(this.shape).forEach((key) => {
2076
- if (!mask[key]) {
1969
+ util.objectKeys(this.shape).map((key) => {
1970
+ if (util.objectKeys(mask).indexOf(key) === -1) {
2077
1971
  shape[key] = this.shape[key];
2078
1972
  }
2079
1973
  });
@@ -2087,14 +1981,24 @@ var ZodObject = class extends ZodType {
2087
1981
  }
2088
1982
  partial(mask) {
2089
1983
  const newShape = {};
2090
- util.objectKeys(this.shape).forEach((key) => {
2091
- const fieldSchema = this.shape[key];
2092
- if (mask && !mask[key]) {
2093
- newShape[key] = fieldSchema;
2094
- } else {
1984
+ if (mask) {
1985
+ util.objectKeys(this.shape).map((key) => {
1986
+ if (util.objectKeys(mask).indexOf(key) === -1) {
1987
+ newShape[key] = this.shape[key];
1988
+ } else {
1989
+ newShape[key] = this.shape[key].optional();
1990
+ }
1991
+ });
1992
+ return new ZodObject({
1993
+ ...this._def,
1994
+ shape: () => newShape
1995
+ });
1996
+ } else {
1997
+ for (const key in this.shape) {
1998
+ const fieldSchema = this.shape[key];
2095
1999
  newShape[key] = fieldSchema.optional();
2096
2000
  }
2097
- });
2001
+ }
2098
2002
  return new ZodObject({
2099
2003
  ...this._def,
2100
2004
  shape: () => newShape
@@ -2102,10 +2006,21 @@ var ZodObject = class extends ZodType {
2102
2006
  }
2103
2007
  required(mask) {
2104
2008
  const newShape = {};
2105
- util.objectKeys(this.shape).forEach((key) => {
2106
- if (mask && !mask[key]) {
2107
- newShape[key] = this.shape[key];
2108
- } else {
2009
+ if (mask) {
2010
+ util.objectKeys(this.shape).map((key) => {
2011
+ if (util.objectKeys(mask).indexOf(key) === -1) {
2012
+ newShape[key] = this.shape[key];
2013
+ } else {
2014
+ const fieldSchema = this.shape[key];
2015
+ let newField = fieldSchema;
2016
+ while (newField instanceof ZodOptional) {
2017
+ newField = newField._def.innerType;
2018
+ }
2019
+ newShape[key] = newField;
2020
+ }
2021
+ });
2022
+ } else {
2023
+ for (const key in this.shape) {
2109
2024
  const fieldSchema = this.shape[key];
2110
2025
  let newField = fieldSchema;
2111
2026
  while (newField instanceof ZodOptional) {
@@ -2113,7 +2028,7 @@ var ZodObject = class extends ZodType {
2113
2028
  }
2114
2029
  newShape[key] = newField;
2115
2030
  }
2116
- });
2031
+ }
2117
2032
  return new ZodObject({
2118
2033
  ...this._def,
2119
2034
  shape: () => newShape
@@ -2467,7 +2382,7 @@ var ZodTuple = class extends ZodType {
2467
2382
  });
2468
2383
  status.dirty();
2469
2384
  }
2470
- const items = [...ctx.data].map((item, itemIndex) => {
2385
+ const items = ctx.data.map((item, itemIndex) => {
2471
2386
  const schema = this._def.items[itemIndex] || this._def.rest;
2472
2387
  if (!schema)
2473
2388
  return null;
@@ -2843,7 +2758,6 @@ var ZodLiteral = class extends ZodType {
2843
2758
  if (input.data !== this._def.value) {
2844
2759
  const ctx = this._getOrReturnCtx(input);
2845
2760
  addIssueToContext(ctx, {
2846
- received: ctx.data,
2847
2761
  code: ZodIssueCode.invalid_literal,
2848
2762
  expected: this._def.value
2849
2763
  });
@@ -2919,12 +2833,6 @@ var ZodEnum = class extends ZodType {
2919
2833
  }
2920
2834
  return enumValues;
2921
2835
  }
2922
- extract(values) {
2923
- return ZodEnum.create(values);
2924
- }
2925
- exclude(values) {
2926
- return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));
2927
- }
2928
2836
  };
2929
2837
  __name(ZodEnum, "ZodEnum");
2930
2838
  ZodEnum.create = createZodEnum;
@@ -2965,9 +2873,6 @@ ZodNativeEnum.create = (values, params) => {
2965
2873
  });
2966
2874
  };
2967
2875
  var ZodPromise = class extends ZodType {
2968
- unwrap() {
2969
- return this._def.type;
2970
- }
2971
2876
  _parse(input) {
2972
2877
  const { ctx } = this._processInputParams(input);
2973
2878
  if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
@@ -3186,30 +3091,23 @@ var ZodCatch = class extends ZodType {
3186
3091
  const result = this._def.innerType._parse({
3187
3092
  data: ctx.data,
3188
3093
  path: ctx.path,
3189
- parent: {
3190
- ...ctx,
3191
- common: {
3192
- ...ctx.common,
3193
- issues: []
3194
- // don't collect issues from inner type
3195
- }
3196
- }
3094
+ parent: ctx
3197
3095
  });
3198
3096
  if (isAsync(result)) {
3199
3097
  return result.then((result2) => {
3200
3098
  return {
3201
3099
  status: "valid",
3202
- value: result2.status === "valid" ? result2.value : this._def.catchValue()
3100
+ value: result2.status === "valid" ? result2.value : this._def.defaultValue()
3203
3101
  };
3204
3102
  });
3205
3103
  } else {
3206
3104
  return {
3207
3105
  status: "valid",
3208
- value: result.status === "valid" ? result.value : this._def.catchValue()
3106
+ value: result.status === "valid" ? result.value : this._def.defaultValue()
3209
3107
  };
3210
3108
  }
3211
3109
  }
3212
- removeCatch() {
3110
+ removeDefault() {
3213
3111
  return this._def.innerType;
3214
3112
  }
3215
3113
  };
@@ -3218,7 +3116,7 @@ ZodCatch.create = (type, params) => {
3218
3116
  return new ZodCatch({
3219
3117
  innerType: type,
3220
3118
  typeName: ZodFirstPartyTypeKind.ZodCatch,
3221
- catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
3119
+ defaultValue: typeof params.default === "function" ? params.default : () => params.default,
3222
3120
  ...processCreateParams(params)
3223
3121
  });
3224
3122
  };
@@ -3411,10 +3309,7 @@ var oboolean = /* @__PURE__ */ __name(() => booleanType().optional(), "oboolean"
3411
3309
  var coerce = {
3412
3310
  string: (arg) => ZodString.create({ ...arg, coerce: true }),
3413
3311
  number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
3414
- boolean: (arg) => ZodBoolean.create({
3415
- ...arg,
3416
- coerce: true
3417
- }),
3312
+ boolean: (arg) => ZodBoolean.create({ ...arg, coerce: true }),
3418
3313
  bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
3419
3314
  date: (arg) => ZodDate.create({ ...arg, coerce: true })
3420
3315
  };
@@ -3616,8 +3511,8 @@ var ProfileValidator = mod.string().or(
3616
3511
  }).catchall(mod.any())
3617
3512
  );
3618
3513
  var CredentialSubjectValidator = mod.object({ id: mod.string().optional() }).catchall(mod.any());
3619
- var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() });
3620
- var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() });
3514
+ var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() }).catchall(mod.any());
3515
+ var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() }).catchall(mod.any());
3621
3516
  var RefreshServiceValidator = mod.object({ id: mod.string(), type: mod.string() }).catchall(mod.any());
3622
3517
  var UnsignedVCValidator = mod.object({
3623
3518
  "@context": ContextValidator,
@@ -3647,7 +3542,7 @@ var VCValidator = UnsignedVCValidator.extend({
3647
3542
  var UnsignedVPValidator = mod.object({
3648
3543
  "@context": ContextValidator,
3649
3544
  id: mod.string().optional(),
3650
- type: mod.string().array().nonempty(),
3545
+ type: mod.string().or(mod.string().array().nonempty()),
3651
3546
  verifiableCredential: VCValidator.or(VCValidator.array()).optional(),
3652
3547
  holder: mod.string().optional()
3653
3548
  }).catchall(mod.any());
@@ -3906,11 +3801,13 @@ var JWEValidator = mod.object({
3906
3801
  });
3907
3802
 
3908
3803
  // src/learncloud.ts
3909
- var EncryptedCredentialRecordValidator = mod.object({
3910
- encryptedRecord: JWEValidator,
3911
- fields: mod.string().array(),
3804
+ var EncryptedRecordValidator = mod.object({ encryptedRecord: JWEValidator, fields: mod.string().array() }).catchall(mod.any());
3805
+ var PaginatedEncryptedRecordsValidator = PaginationResponseValidator.extend({
3806
+ records: EncryptedRecordValidator.array()
3807
+ });
3808
+ var EncryptedCredentialRecordValidator = EncryptedRecordValidator.extend({
3912
3809
  id: mod.string()
3913
- }).catchall(mod.any());
3810
+ });
3914
3811
  var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.extend({
3915
3812
  records: EncryptedCredentialRecordValidator.array()
3916
3813
  });