@learncard/didkey-plugin 1.0.1 → 1.0.3

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.
@@ -33,10 +33,7 @@ var __copyProps = /* @__PURE__ */ __name((to, from, except, desc) => {
33
33
  }
34
34
  return to;
35
35
  }, "__copyProps");
36
- var __toESM = /* @__PURE__ */ __name((mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
37
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
38
- mod
39
- )), "__toESM");
36
+ var __toESM = /* @__PURE__ */ __name((mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, mod)), "__toESM");
40
37
  var require_types_cjs_development = __commonJS({
41
38
  "../learn-card-types/dist/types.cjs.development.js"(exports, module) {
42
39
  "use strict";
@@ -78,6 +75,7 @@ var require_types_cjs_development = __commonJS({
78
75
  CredentialSubjectValidator: () => CredentialSubjectValidator,
79
76
  CriteriaValidator: () => CriteriaValidator,
80
77
  EncryptedCredentialRecordValidator: () => EncryptedCredentialRecordValidator,
78
+ EncryptedRecordValidator: () => EncryptedRecordValidator,
81
79
  EndorsementCredentialValidator: () => EndorsementCredentialValidator,
82
80
  EndorsementSubjectValidator: () => EndorsementSubjectValidator,
83
81
  EvidenceValidator: () => EvidenceValidator,
@@ -103,6 +101,7 @@ var require_types_cjs_development = __commonJS({
103
101
  LCNSigningAuthorityForUserValidator: () => LCNSigningAuthorityForUserValidator,
104
102
  LCNSigningAuthorityValidator: () => LCNSigningAuthorityValidator,
105
103
  PaginatedEncryptedCredentialRecordsValidator: () => PaginatedEncryptedCredentialRecordsValidator,
104
+ PaginatedEncryptedRecordsValidator: () => PaginatedEncryptedRecordsValidator,
106
105
  PaginationOptionsValidator: () => PaginationOptionsValidator,
107
106
  PaginationResponseValidator: () => PaginationResponseValidator,
108
107
  ProfileValidator: () => ProfileValidator,
@@ -568,7 +567,7 @@ var require_types_cjs_development = __commonJS({
568
567
  var isAborted = /* @__PURE__ */ __name22((x) => x.status === "aborted", "isAborted");
569
568
  var isDirty = /* @__PURE__ */ __name22((x) => x.status === "dirty", "isDirty");
570
569
  var isValid = /* @__PURE__ */ __name22((x) => x.status === "valid", "isValid");
571
- var isAsync = /* @__PURE__ */ __name22((x) => typeof Promise !== "undefined" && x instanceof Promise, "isAsync");
570
+ var isAsync = /* @__PURE__ */ __name22((x) => typeof Promise !== void 0 && x instanceof Promise, "isAsync");
572
571
  var errorUtil;
573
572
  (function(errorUtil2) {
574
573
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
@@ -788,29 +787,28 @@ var require_types_cjs_development = __commonJS({
788
787
  return this._refinement(refinement);
789
788
  }
790
789
  optional() {
791
- return ZodOptional.create(this, this._def);
790
+ return ZodOptional.create(this);
792
791
  }
793
792
  nullable() {
794
- return ZodNullable.create(this, this._def);
793
+ return ZodNullable.create(this);
795
794
  }
796
795
  nullish() {
797
- return this.nullable().optional();
796
+ return this.optional().nullable();
798
797
  }
799
798
  array() {
800
- return ZodArray.create(this, this._def);
799
+ return ZodArray.create(this);
801
800
  }
802
801
  promise() {
803
- return ZodPromise.create(this, this._def);
802
+ return ZodPromise.create(this);
804
803
  }
805
804
  or(option) {
806
- return ZodUnion.create([this, option], this._def);
805
+ return ZodUnion.create([this, option]);
807
806
  }
808
807
  and(incoming) {
809
- return ZodIntersection.create(this, incoming, this._def);
808
+ return ZodIntersection.create(this, incoming);
810
809
  }
811
810
  transform(transform) {
812
811
  return new ZodEffects({
813
- ...processCreateParams(this._def),
814
812
  schema: this,
815
813
  typeName: ZodFirstPartyTypeKind.ZodEffects,
816
814
  effect: { type: "transform", transform }
@@ -819,7 +817,6 @@ var require_types_cjs_development = __commonJS({
819
817
  default(def) {
820
818
  const defaultValueFunc = typeof def === "function" ? def : () => def;
821
819
  return new ZodDefault({
822
- ...processCreateParams(this._def),
823
820
  innerType: this,
824
821
  defaultValue: defaultValueFunc,
825
822
  typeName: ZodFirstPartyTypeKind.ZodDefault
@@ -829,15 +826,14 @@ var require_types_cjs_development = __commonJS({
829
826
  return new ZodBranded({
830
827
  typeName: ZodFirstPartyTypeKind.ZodBranded,
831
828
  type: this,
832
- ...processCreateParams(this._def)
829
+ ...processCreateParams(void 0)
833
830
  });
834
831
  }
835
832
  catch(def) {
836
- const catchValueFunc = typeof def === "function" ? def : () => def;
833
+ const defaultValueFunc = typeof def === "function" ? def : () => def;
837
834
  return new ZodCatch({
838
- ...processCreateParams(this._def),
839
835
  innerType: this,
840
- catchValue: catchValueFunc,
836
+ defaultValue: defaultValueFunc,
841
837
  typeName: ZodFirstPartyTypeKind.ZodCatch
842
838
  });
843
839
  }
@@ -860,25 +856,24 @@ var require_types_cjs_development = __commonJS({
860
856
  }, "ZodType");
861
857
  __name22(ZodType, "ZodType");
862
858
  var cuidRegex = /^c[^\s-]{8,}$/i;
863
- var cuid2Regex = /^[a-z][a-z0-9]*$/;
864
859
  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;
865
- 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,}))$/;
860
+ var emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
866
861
  var datetimeRegex = /* @__PURE__ */ __name22((args) => {
867
862
  if (args.precision) {
868
863
  if (args.offset) {
869
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
864
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
870
865
  } else {
871
866
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
872
867
  }
873
868
  } else if (args.precision === 0) {
874
869
  if (args.offset) {
875
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
870
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
876
871
  } else {
877
872
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
878
873
  }
879
874
  } else {
880
875
  if (args.offset) {
881
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
876
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
882
877
  } else {
883
878
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
884
879
  }
@@ -905,14 +900,11 @@ var require_types_cjs_development = __commonJS({
905
900
  const parsedType = this._getType(input);
906
901
  if (parsedType !== ZodParsedType.string) {
907
902
  const ctx2 = this._getOrReturnCtx(input);
908
- addIssueToContext(
909
- ctx2,
910
- {
911
- code: ZodIssueCode.invalid_type,
912
- expected: ZodParsedType.string,
913
- received: ctx2.parsedType
914
- }
915
- );
903
+ addIssueToContext(ctx2, {
904
+ code: ZodIssueCode.invalid_type,
905
+ expected: ZodParsedType.string,
906
+ received: ctx2.parsedType
907
+ });
916
908
  return INVALID;
917
909
  }
918
910
  const status = new ParseStatus();
@@ -1000,16 +992,6 @@ var require_types_cjs_development = __commonJS({
1000
992
  });
1001
993
  status.dirty();
1002
994
  }
1003
- } else if (check.kind === "cuid2") {
1004
- if (!cuid2Regex.test(input.data)) {
1005
- ctx = this._getOrReturnCtx(input, ctx);
1006
- addIssueToContext(ctx, {
1007
- validation: "cuid2",
1008
- code: ZodIssueCode.invalid_string,
1009
- message: check.message
1010
- });
1011
- status.dirty();
1012
- }
1013
995
  } else if (check.kind === "url") {
1014
996
  try {
1015
997
  new URL(input.data);
@@ -1091,9 +1073,6 @@ var require_types_cjs_development = __commonJS({
1091
1073
  cuid(message) {
1092
1074
  return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
1093
1075
  }
1094
- cuid2(message) {
1095
- return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
1096
- }
1097
1076
  datetime(options) {
1098
1077
  var _a;
1099
1078
  if (typeof options === "string") {
@@ -1168,9 +1147,6 @@ var require_types_cjs_development = __commonJS({
1168
1147
  get isCUID() {
1169
1148
  return !!this._def.checks.find((ch) => ch.kind === "cuid");
1170
1149
  }
1171
- get isCUID2() {
1172
- return !!this._def.checks.find((ch) => ch.kind === "cuid2");
1173
- }
1174
1150
  get minLength() {
1175
1151
  let min = null;
1176
1152
  for (const ch of this._def.checks) {
@@ -1405,22 +1381,7 @@ var require_types_cjs_development = __commonJS({
1405
1381
  return max;
1406
1382
  }
1407
1383
  get isInt() {
1408
- return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
1409
- }
1410
- get isFinite() {
1411
- let max = null, min = null;
1412
- for (const ch of this._def.checks) {
1413
- if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
1414
- return true;
1415
- } else if (ch.kind === "min") {
1416
- if (min === null || ch.value > min)
1417
- min = ch.value;
1418
- } else if (ch.kind === "max") {
1419
- if (max === null || ch.value < max)
1420
- max = ch.value;
1421
- }
1422
- }
1423
- return Number.isFinite(min) && Number.isFinite(max);
1384
+ return !!this._def.checks.find((ch) => ch.kind === "int");
1424
1385
  }
1425
1386
  }, "ZodNumber");
1426
1387
  __name22(ZodNumber, "ZodNumber");
@@ -1788,13 +1749,13 @@ var require_types_cjs_development = __commonJS({
1788
1749
  }
1789
1750
  }
1790
1751
  if (ctx.common.async) {
1791
- return Promise.all([...ctx.data].map((item, i) => {
1752
+ return Promise.all(ctx.data.map((item, i) => {
1792
1753
  return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
1793
1754
  })).then((result2) => {
1794
1755
  return ParseStatus.mergeArray(status, result2);
1795
1756
  });
1796
1757
  }
1797
- const result = [...ctx.data].map((item, i) => {
1758
+ const result = ctx.data.map((item, i) => {
1798
1759
  return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
1799
1760
  });
1800
1761
  return ParseStatus.mergeArray(status, result);
@@ -1844,6 +1805,15 @@ var require_types_cjs_development = __commonJS({
1844
1805
  };
1845
1806
  };
1846
1807
  })(objectUtil || (objectUtil = {}));
1808
+ var AugmentFactory = /* @__PURE__ */ __name22((def) => (augmentation) => {
1809
+ return new ZodObject({
1810
+ ...def,
1811
+ shape: () => ({
1812
+ ...def.shape(),
1813
+ ...augmentation
1814
+ })
1815
+ });
1816
+ }, "AugmentFactory");
1847
1817
  function deepPartialify(schema) {
1848
1818
  if (schema instanceof ZodObject) {
1849
1819
  const newShape = {};
@@ -1875,7 +1845,8 @@ var require_types_cjs_development = __commonJS({
1875
1845
  super(...arguments);
1876
1846
  this._cached = null;
1877
1847
  this.nonstrict = this.passthrough;
1878
- this.augment = this.extend;
1848
+ this.augment = AugmentFactory(this._def);
1849
+ this.extend = AugmentFactory(this._def);
1879
1850
  }
1880
1851
  _getCached() {
1881
1852
  if (this._cached !== null)
@@ -1943,9 +1914,7 @@ var require_types_cjs_development = __commonJS({
1943
1914
  const value = ctx.data[key];
1944
1915
  pairs.push({
1945
1916
  key: { status: "valid", value: key },
1946
- value: catchall._parse(
1947
- new ParseInputLazyPath(ctx, value, ctx.path, key)
1948
- ),
1917
+ value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
1949
1918
  alwaysSet: key in ctx.data
1950
1919
  });
1951
1920
  }
@@ -2004,14 +1973,8 @@ var require_types_cjs_development = __commonJS({
2004
1973
  unknownKeys: "passthrough"
2005
1974
  });
2006
1975
  }
2007
- extend(augmentation) {
2008
- return new ZodObject({
2009
- ...this._def,
2010
- shape: () => ({
2011
- ...this._def.shape(),
2012
- ...augmentation
2013
- })
2014
- });
1976
+ setKey(key, schema) {
1977
+ return this.augment({ [key]: schema });
2015
1978
  }
2016
1979
  merge(merging) {
2017
1980
  const merged = new ZodObject({
@@ -2022,9 +1985,6 @@ var require_types_cjs_development = __commonJS({
2022
1985
  });
2023
1986
  return merged;
2024
1987
  }
2025
- setKey(key, schema) {
2026
- return this.augment({ [key]: schema });
2027
- }
2028
1988
  catchall(index) {
2029
1989
  return new ZodObject({
2030
1990
  ...this._def,
@@ -2033,10 +1993,9 @@ var require_types_cjs_development = __commonJS({
2033
1993
  }
2034
1994
  pick(mask) {
2035
1995
  const shape = {};
2036
- util.objectKeys(mask).forEach((key) => {
2037
- if (mask[key] && this.shape[key]) {
1996
+ util.objectKeys(mask).map((key) => {
1997
+ if (this.shape[key])
2038
1998
  shape[key] = this.shape[key];
2039
- }
2040
1999
  });
2041
2000
  return new ZodObject({
2042
2001
  ...this._def,
@@ -2045,8 +2004,8 @@ var require_types_cjs_development = __commonJS({
2045
2004
  }
2046
2005
  omit(mask) {
2047
2006
  const shape = {};
2048
- util.objectKeys(this.shape).forEach((key) => {
2049
- if (!mask[key]) {
2007
+ util.objectKeys(this.shape).map((key) => {
2008
+ if (util.objectKeys(mask).indexOf(key) === -1) {
2050
2009
  shape[key] = this.shape[key];
2051
2010
  }
2052
2011
  });
@@ -2060,14 +2019,24 @@ var require_types_cjs_development = __commonJS({
2060
2019
  }
2061
2020
  partial(mask) {
2062
2021
  const newShape = {};
2063
- util.objectKeys(this.shape).forEach((key) => {
2064
- const fieldSchema = this.shape[key];
2065
- if (mask && !mask[key]) {
2066
- newShape[key] = fieldSchema;
2067
- } else {
2022
+ if (mask) {
2023
+ util.objectKeys(this.shape).map((key) => {
2024
+ if (util.objectKeys(mask).indexOf(key) === -1) {
2025
+ newShape[key] = this.shape[key];
2026
+ } else {
2027
+ newShape[key] = this.shape[key].optional();
2028
+ }
2029
+ });
2030
+ return new ZodObject({
2031
+ ...this._def,
2032
+ shape: () => newShape
2033
+ });
2034
+ } else {
2035
+ for (const key in this.shape) {
2036
+ const fieldSchema = this.shape[key];
2068
2037
  newShape[key] = fieldSchema.optional();
2069
2038
  }
2070
- });
2039
+ }
2071
2040
  return new ZodObject({
2072
2041
  ...this._def,
2073
2042
  shape: () => newShape
@@ -2075,10 +2044,21 @@ var require_types_cjs_development = __commonJS({
2075
2044
  }
2076
2045
  required(mask) {
2077
2046
  const newShape = {};
2078
- util.objectKeys(this.shape).forEach((key) => {
2079
- if (mask && !mask[key]) {
2080
- newShape[key] = this.shape[key];
2081
- } else {
2047
+ if (mask) {
2048
+ util.objectKeys(this.shape).map((key) => {
2049
+ if (util.objectKeys(mask).indexOf(key) === -1) {
2050
+ newShape[key] = this.shape[key];
2051
+ } else {
2052
+ const fieldSchema = this.shape[key];
2053
+ let newField = fieldSchema;
2054
+ while (newField instanceof ZodOptional) {
2055
+ newField = newField._def.innerType;
2056
+ }
2057
+ newShape[key] = newField;
2058
+ }
2059
+ });
2060
+ } else {
2061
+ for (const key in this.shape) {
2082
2062
  const fieldSchema = this.shape[key];
2083
2063
  let newField = fieldSchema;
2084
2064
  while (newField instanceof ZodOptional) {
@@ -2086,7 +2066,7 @@ var require_types_cjs_development = __commonJS({
2086
2066
  }
2087
2067
  newShape[key] = newField;
2088
2068
  }
2089
- });
2069
+ }
2090
2070
  return new ZodObject({
2091
2071
  ...this._def,
2092
2072
  shape: () => newShape
@@ -2436,7 +2416,7 @@ var require_types_cjs_development = __commonJS({
2436
2416
  });
2437
2417
  status.dirty();
2438
2418
  }
2439
- const items = [...ctx.data].map((item, itemIndex) => {
2419
+ const items = ctx.data.map((item, itemIndex) => {
2440
2420
  const schema = this._def.items[itemIndex] || this._def.rest;
2441
2421
  if (!schema)
2442
2422
  return null;
@@ -2818,7 +2798,6 @@ var require_types_cjs_development = __commonJS({
2818
2798
  if (input.data !== this._def.value) {
2819
2799
  const ctx = this._getOrReturnCtx(input);
2820
2800
  addIssueToContext(ctx, {
2821
- received: ctx.data,
2822
2801
  code: ZodIssueCode.invalid_literal,
2823
2802
  expected: this._def.value
2824
2803
  });
@@ -2896,12 +2875,6 @@ var require_types_cjs_development = __commonJS({
2896
2875
  }
2897
2876
  return enumValues;
2898
2877
  }
2899
- extract(values) {
2900
- return ZodEnum.create(values);
2901
- }
2902
- exclude(values) {
2903
- return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));
2904
- }
2905
2878
  }, "ZodEnum");
2906
2879
  __name22(ZodEnum, "ZodEnum");
2907
2880
  ZodEnum.create = createZodEnum;
@@ -2942,9 +2915,6 @@ var require_types_cjs_development = __commonJS({
2942
2915
  });
2943
2916
  };
2944
2917
  var ZodPromise = /* @__PURE__ */ __name2(class extends ZodType {
2945
- unwrap() {
2946
- return this._def.type;
2947
- }
2948
2918
  _parse(input) {
2949
2919
  const { ctx } = this._processInputParams(input);
2950
2920
  if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
@@ -3163,29 +3133,23 @@ var require_types_cjs_development = __commonJS({
3163
3133
  const result = this._def.innerType._parse({
3164
3134
  data: ctx.data,
3165
3135
  path: ctx.path,
3166
- parent: {
3167
- ...ctx,
3168
- common: {
3169
- ...ctx.common,
3170
- issues: []
3171
- }
3172
- }
3136
+ parent: ctx
3173
3137
  });
3174
3138
  if (isAsync(result)) {
3175
3139
  return result.then((result2) => {
3176
3140
  return {
3177
3141
  status: "valid",
3178
- value: result2.status === "valid" ? result2.value : this._def.catchValue()
3142
+ value: result2.status === "valid" ? result2.value : this._def.defaultValue()
3179
3143
  };
3180
3144
  });
3181
3145
  } else {
3182
3146
  return {
3183
3147
  status: "valid",
3184
- value: result.status === "valid" ? result.value : this._def.catchValue()
3148
+ value: result.status === "valid" ? result.value : this._def.defaultValue()
3185
3149
  };
3186
3150
  }
3187
3151
  }
3188
- removeCatch() {
3152
+ removeDefault() {
3189
3153
  return this._def.innerType;
3190
3154
  }
3191
3155
  }, "ZodCatch");
@@ -3194,7 +3158,7 @@ var require_types_cjs_development = __commonJS({
3194
3158
  return new ZodCatch({
3195
3159
  innerType: type,
3196
3160
  typeName: ZodFirstPartyTypeKind.ZodCatch,
3197
- catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
3161
+ defaultValue: typeof params.default === "function" ? params.default : () => params.default,
3198
3162
  ...processCreateParams(params)
3199
3163
  });
3200
3164
  };
@@ -3387,10 +3351,7 @@ var require_types_cjs_development = __commonJS({
3387
3351
  var coerce = {
3388
3352
  string: (arg) => ZodString.create({ ...arg, coerce: true }),
3389
3353
  number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
3390
- boolean: (arg) => ZodBoolean.create({
3391
- ...arg,
3392
- coerce: true
3393
- }),
3354
+ boolean: (arg) => ZodBoolean.create({ ...arg, coerce: true }),
3394
3355
  bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
3395
3356
  date: (arg) => ZodDate.create({ ...arg, coerce: true })
3396
3357
  };
@@ -3514,13 +3475,11 @@ var require_types_cjs_development = __commonJS({
3514
3475
  type: mod.string().optional(),
3515
3476
  narrative: mod.string().optional()
3516
3477
  });
3517
- var ImageValidator = mod.string().or(
3518
- mod.object({
3519
- id: mod.string(),
3520
- type: mod.string(),
3521
- caption: mod.string().optional()
3522
- })
3523
- );
3478
+ var ImageValidator = mod.string().or(mod.object({
3479
+ id: mod.string(),
3480
+ type: mod.string(),
3481
+ caption: mod.string().optional()
3482
+ }));
3524
3483
  var GeoCoordinatesValidator = mod.object({
3525
3484
  type: mod.string().min(1).or(mod.string().array().nonempty()),
3526
3485
  latitude: mod.number(),
@@ -3562,31 +3521,29 @@ var require_types_cjs_development = __commonJS({
3562
3521
  identifier: mod.string(),
3563
3522
  identifierType: IdentifierTypeValidator
3564
3523
  });
3565
- var ProfileValidator = mod.string().or(
3566
- mod.object({
3567
- id: mod.string().optional(),
3568
- type: mod.string().or(mod.string().array().nonempty().optional()),
3569
- name: mod.string().optional(),
3570
- url: mod.string().optional(),
3571
- phone: mod.string().optional(),
3572
- description: mod.string().optional(),
3573
- endorsement: mod.any().array().optional(),
3574
- image: ImageValidator.optional(),
3575
- email: mod.string().email().optional(),
3576
- address: AddressValidator.optional(),
3577
- otherIdentifier: IdentifierEntryValidator.array().optional(),
3578
- official: mod.string().optional(),
3579
- parentOrg: mod.any().optional(),
3580
- familyName: mod.string().optional(),
3581
- givenName: mod.string().optional(),
3582
- additionalName: mod.string().optional(),
3583
- patronymicName: mod.string().optional(),
3584
- honorificPrefix: mod.string().optional(),
3585
- honorificSuffix: mod.string().optional(),
3586
- familyNamePrefix: mod.string().optional(),
3587
- dateOfBirth: mod.string().optional()
3588
- }).catchall(mod.any())
3589
- );
3524
+ var ProfileValidator = mod.string().or(mod.object({
3525
+ id: mod.string().optional(),
3526
+ type: mod.string().or(mod.string().array().nonempty().optional()),
3527
+ name: mod.string().optional(),
3528
+ url: mod.string().optional(),
3529
+ phone: mod.string().optional(),
3530
+ description: mod.string().optional(),
3531
+ endorsement: mod.any().array().optional(),
3532
+ image: ImageValidator.optional(),
3533
+ email: mod.string().email().optional(),
3534
+ address: AddressValidator.optional(),
3535
+ otherIdentifier: IdentifierEntryValidator.array().optional(),
3536
+ official: mod.string().optional(),
3537
+ parentOrg: mod.any().optional(),
3538
+ familyName: mod.string().optional(),
3539
+ givenName: mod.string().optional(),
3540
+ additionalName: mod.string().optional(),
3541
+ patronymicName: mod.string().optional(),
3542
+ honorificPrefix: mod.string().optional(),
3543
+ honorificSuffix: mod.string().optional(),
3544
+ familyNamePrefix: mod.string().optional(),
3545
+ dateOfBirth: mod.string().optional()
3546
+ }).catchall(mod.any()));
3590
3547
  var CredentialSubjectValidator = mod.object({ id: mod.string().optional() }).catchall(mod.any());
3591
3548
  var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() });
3592
3549
  var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() });
@@ -3868,11 +3825,13 @@ var require_types_cjs_development = __commonJS({
3868
3825
  aad: mod.string().optional(),
3869
3826
  recipients: JWERecipientValidator.array().optional()
3870
3827
  });
3871
- var EncryptedCredentialRecordValidator = mod.object({
3872
- encryptedRecord: JWEValidator2,
3873
- fields: mod.string().array(),
3828
+ var EncryptedRecordValidator = mod.object({ encryptedRecord: JWEValidator2, fields: mod.string().array() }).catchall(mod.any());
3829
+ var PaginatedEncryptedRecordsValidator = PaginationResponseValidator.extend({
3830
+ records: EncryptedRecordValidator.array()
3831
+ });
3832
+ var EncryptedCredentialRecordValidator = EncryptedRecordValidator.extend({
3874
3833
  id: mod.string()
3875
- }).catchall(mod.any());
3834
+ });
3876
3835
  var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.extend({
3877
3836
  records: EncryptedCredentialRecordValidator.array()
3878
3837
  });
@@ -3909,7 +3868,7 @@ var require_types_cjs_development = __commonJS({
3909
3868
  var BoostRecipientValidator = mod.object({
3910
3869
  to: LCNProfileValidator,
3911
3870
  from: mod.string(),
3912
- received: mod.string()
3871
+ received: mod.string().optional()
3913
3872
  });
3914
3873
  var LCNNotificationTypeEnumValidator = mod.enum([
3915
3874
  "CONNECTION_REQUEST",
@@ -4007,15 +3966,9 @@ var getDidKeyPlugin = /* @__PURE__ */ __name(async (learnCard, key, defaultDidMe
4007
3966
  if (key.length > 64)
4008
3967
  throw new Error("Key must be less than 64 characters");
4009
3968
  if (key.length < 64) {
4010
- console.warn(
4011
- "Warning: A LearnCard has been initialized with a seed that is less than 32 bytes, and will be padded with zeroes"
4012
- );
4013
- console.warn(
4014
- "Please instantiate LearnCards using 32 bytes that have been randomly generated in a cryptographically secure fashion!"
4015
- );
4016
- console.warn(
4017
- "See https://app.gitbook.com/o/6uDv1QDlxaaZC7i8EaGb/s/FXvEJ9j3Vf3FW5Nc557n/learn-card-packages/learncard-core/instantiation#key-generation for details"
4018
- );
3969
+ console.warn("Warning: A LearnCard has been initialized with a seed that is less than 32 bytes, and will be padded with zeroes");
3970
+ console.warn("Please instantiate LearnCards using 32 bytes that have been randomly generated in a cryptographically secure fashion!");
3971
+ console.warn("See https://app.gitbook.com/o/6uDv1QDlxaaZC7i8EaGb/s/FXvEJ9j3Vf3FW5Nc557n/learn-card-packages/learncard-core/instantiation#key-generation for details");
4019
3972
  }
4020
3973
  const seed = key.padStart(64, "0");
4021
3974
  const seedBytes = toUint8Array(seed);