@learncard/didkey-plugin 1.0.2 → 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.
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -57,10 +56,7 @@ var __copyProps2 = /* @__PURE__ */ __name((to, from, except, desc) => {
57
56
  }
58
57
  return to;
59
58
  }, "__copyProps");
60
- var __toESM = /* @__PURE__ */ __name((mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps2(
61
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
62
- mod
63
- )), "__toESM");
59
+ var __toESM = /* @__PURE__ */ __name((mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps2(isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, mod)), "__toESM");
64
60
  var require_types_cjs_development = __commonJS({
65
61
  "../learn-card-types/dist/types.cjs.development.js"(exports, module2) {
66
62
  "use strict";
@@ -594,7 +590,7 @@ var require_types_cjs_development = __commonJS({
594
590
  var isAborted = /* @__PURE__ */ __name22((x) => x.status === "aborted", "isAborted");
595
591
  var isDirty = /* @__PURE__ */ __name22((x) => x.status === "dirty", "isDirty");
596
592
  var isValid = /* @__PURE__ */ __name22((x) => x.status === "valid", "isValid");
597
- var isAsync = /* @__PURE__ */ __name22((x) => typeof Promise !== "undefined" && x instanceof Promise, "isAsync");
593
+ var isAsync = /* @__PURE__ */ __name22((x) => typeof Promise !== void 0 && x instanceof Promise, "isAsync");
598
594
  var errorUtil;
599
595
  (function(errorUtil2) {
600
596
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
@@ -814,29 +810,28 @@ var require_types_cjs_development = __commonJS({
814
810
  return this._refinement(refinement);
815
811
  }
816
812
  optional() {
817
- return ZodOptional.create(this, this._def);
813
+ return ZodOptional.create(this);
818
814
  }
819
815
  nullable() {
820
- return ZodNullable.create(this, this._def);
816
+ return ZodNullable.create(this);
821
817
  }
822
818
  nullish() {
823
- return this.nullable().optional();
819
+ return this.optional().nullable();
824
820
  }
825
821
  array() {
826
- return ZodArray.create(this, this._def);
822
+ return ZodArray.create(this);
827
823
  }
828
824
  promise() {
829
- return ZodPromise.create(this, this._def);
825
+ return ZodPromise.create(this);
830
826
  }
831
827
  or(option) {
832
- return ZodUnion.create([this, option], this._def);
828
+ return ZodUnion.create([this, option]);
833
829
  }
834
830
  and(incoming) {
835
- return ZodIntersection.create(this, incoming, this._def);
831
+ return ZodIntersection.create(this, incoming);
836
832
  }
837
833
  transform(transform) {
838
834
  return new ZodEffects({
839
- ...processCreateParams(this._def),
840
835
  schema: this,
841
836
  typeName: ZodFirstPartyTypeKind.ZodEffects,
842
837
  effect: { type: "transform", transform }
@@ -845,7 +840,6 @@ var require_types_cjs_development = __commonJS({
845
840
  default(def) {
846
841
  const defaultValueFunc = typeof def === "function" ? def : () => def;
847
842
  return new ZodDefault({
848
- ...processCreateParams(this._def),
849
843
  innerType: this,
850
844
  defaultValue: defaultValueFunc,
851
845
  typeName: ZodFirstPartyTypeKind.ZodDefault
@@ -855,15 +849,14 @@ var require_types_cjs_development = __commonJS({
855
849
  return new ZodBranded({
856
850
  typeName: ZodFirstPartyTypeKind.ZodBranded,
857
851
  type: this,
858
- ...processCreateParams(this._def)
852
+ ...processCreateParams(void 0)
859
853
  });
860
854
  }
861
855
  catch(def) {
862
- const catchValueFunc = typeof def === "function" ? def : () => def;
856
+ const defaultValueFunc = typeof def === "function" ? def : () => def;
863
857
  return new ZodCatch({
864
- ...processCreateParams(this._def),
865
858
  innerType: this,
866
- catchValue: catchValueFunc,
859
+ defaultValue: defaultValueFunc,
867
860
  typeName: ZodFirstPartyTypeKind.ZodCatch
868
861
  });
869
862
  }
@@ -886,25 +879,24 @@ var require_types_cjs_development = __commonJS({
886
879
  }, "ZodType");
887
880
  __name22(ZodType, "ZodType");
888
881
  var cuidRegex = /^c[^\s-]{8,}$/i;
889
- var cuid2Regex = /^[a-z][a-z0-9]*$/;
890
882
  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;
891
- 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,}))$/;
883
+ var emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
892
884
  var datetimeRegex = /* @__PURE__ */ __name22((args) => {
893
885
  if (args.precision) {
894
886
  if (args.offset) {
895
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
887
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
896
888
  } else {
897
889
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
898
890
  }
899
891
  } else if (args.precision === 0) {
900
892
  if (args.offset) {
901
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
893
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
902
894
  } else {
903
895
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
904
896
  }
905
897
  } else {
906
898
  if (args.offset) {
907
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
899
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
908
900
  } else {
909
901
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
910
902
  }
@@ -931,14 +923,11 @@ var require_types_cjs_development = __commonJS({
931
923
  const parsedType = this._getType(input);
932
924
  if (parsedType !== ZodParsedType.string) {
933
925
  const ctx2 = this._getOrReturnCtx(input);
934
- addIssueToContext(
935
- ctx2,
936
- {
937
- code: ZodIssueCode.invalid_type,
938
- expected: ZodParsedType.string,
939
- received: ctx2.parsedType
940
- }
941
- );
926
+ addIssueToContext(ctx2, {
927
+ code: ZodIssueCode.invalid_type,
928
+ expected: ZodParsedType.string,
929
+ received: ctx2.parsedType
930
+ });
942
931
  return INVALID;
943
932
  }
944
933
  const status = new ParseStatus();
@@ -1026,16 +1015,6 @@ var require_types_cjs_development = __commonJS({
1026
1015
  });
1027
1016
  status.dirty();
1028
1017
  }
1029
- } else if (check.kind === "cuid2") {
1030
- if (!cuid2Regex.test(input.data)) {
1031
- ctx = this._getOrReturnCtx(input, ctx);
1032
- addIssueToContext(ctx, {
1033
- validation: "cuid2",
1034
- code: ZodIssueCode.invalid_string,
1035
- message: check.message
1036
- });
1037
- status.dirty();
1038
- }
1039
1018
  } else if (check.kind === "url") {
1040
1019
  try {
1041
1020
  new URL(input.data);
@@ -1117,9 +1096,6 @@ var require_types_cjs_development = __commonJS({
1117
1096
  cuid(message) {
1118
1097
  return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
1119
1098
  }
1120
- cuid2(message) {
1121
- return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
1122
- }
1123
1099
  datetime(options) {
1124
1100
  var _a;
1125
1101
  if (typeof options === "string") {
@@ -1194,9 +1170,6 @@ var require_types_cjs_development = __commonJS({
1194
1170
  get isCUID() {
1195
1171
  return !!this._def.checks.find((ch) => ch.kind === "cuid");
1196
1172
  }
1197
- get isCUID2() {
1198
- return !!this._def.checks.find((ch) => ch.kind === "cuid2");
1199
- }
1200
1173
  get minLength() {
1201
1174
  let min = null;
1202
1175
  for (const ch of this._def.checks) {
@@ -1431,22 +1404,7 @@ var require_types_cjs_development = __commonJS({
1431
1404
  return max;
1432
1405
  }
1433
1406
  get isInt() {
1434
- return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
1435
- }
1436
- get isFinite() {
1437
- let max = null, min = null;
1438
- for (const ch of this._def.checks) {
1439
- if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
1440
- return true;
1441
- } else if (ch.kind === "min") {
1442
- if (min === null || ch.value > min)
1443
- min = ch.value;
1444
- } else if (ch.kind === "max") {
1445
- if (max === null || ch.value < max)
1446
- max = ch.value;
1447
- }
1448
- }
1449
- return Number.isFinite(min) && Number.isFinite(max);
1407
+ return !!this._def.checks.find((ch) => ch.kind === "int");
1450
1408
  }
1451
1409
  }, "ZodNumber");
1452
1410
  __name22(ZodNumber, "ZodNumber");
@@ -1814,13 +1772,13 @@ var require_types_cjs_development = __commonJS({
1814
1772
  }
1815
1773
  }
1816
1774
  if (ctx.common.async) {
1817
- return Promise.all([...ctx.data].map((item, i) => {
1775
+ return Promise.all(ctx.data.map((item, i) => {
1818
1776
  return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
1819
1777
  })).then((result2) => {
1820
1778
  return ParseStatus.mergeArray(status, result2);
1821
1779
  });
1822
1780
  }
1823
- const result = [...ctx.data].map((item, i) => {
1781
+ const result = ctx.data.map((item, i) => {
1824
1782
  return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
1825
1783
  });
1826
1784
  return ParseStatus.mergeArray(status, result);
@@ -1870,6 +1828,15 @@ var require_types_cjs_development = __commonJS({
1870
1828
  };
1871
1829
  };
1872
1830
  })(objectUtil || (objectUtil = {}));
1831
+ var AugmentFactory = /* @__PURE__ */ __name22((def) => (augmentation) => {
1832
+ return new ZodObject({
1833
+ ...def,
1834
+ shape: () => ({
1835
+ ...def.shape(),
1836
+ ...augmentation
1837
+ })
1838
+ });
1839
+ }, "AugmentFactory");
1873
1840
  function deepPartialify(schema) {
1874
1841
  if (schema instanceof ZodObject) {
1875
1842
  const newShape = {};
@@ -1901,7 +1868,8 @@ var require_types_cjs_development = __commonJS({
1901
1868
  super(...arguments);
1902
1869
  this._cached = null;
1903
1870
  this.nonstrict = this.passthrough;
1904
- this.augment = this.extend;
1871
+ this.augment = AugmentFactory(this._def);
1872
+ this.extend = AugmentFactory(this._def);
1905
1873
  }
1906
1874
  _getCached() {
1907
1875
  if (this._cached !== null)
@@ -1969,9 +1937,7 @@ var require_types_cjs_development = __commonJS({
1969
1937
  const value = ctx.data[key];
1970
1938
  pairs.push({
1971
1939
  key: { status: "valid", value: key },
1972
- value: catchall._parse(
1973
- new ParseInputLazyPath(ctx, value, ctx.path, key)
1974
- ),
1940
+ value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
1975
1941
  alwaysSet: key in ctx.data
1976
1942
  });
1977
1943
  }
@@ -2030,14 +1996,8 @@ var require_types_cjs_development = __commonJS({
2030
1996
  unknownKeys: "passthrough"
2031
1997
  });
2032
1998
  }
2033
- extend(augmentation) {
2034
- return new ZodObject({
2035
- ...this._def,
2036
- shape: () => ({
2037
- ...this._def.shape(),
2038
- ...augmentation
2039
- })
2040
- });
1999
+ setKey(key, schema) {
2000
+ return this.augment({ [key]: schema });
2041
2001
  }
2042
2002
  merge(merging) {
2043
2003
  const merged = new ZodObject({
@@ -2048,9 +2008,6 @@ var require_types_cjs_development = __commonJS({
2048
2008
  });
2049
2009
  return merged;
2050
2010
  }
2051
- setKey(key, schema) {
2052
- return this.augment({ [key]: schema });
2053
- }
2054
2011
  catchall(index) {
2055
2012
  return new ZodObject({
2056
2013
  ...this._def,
@@ -2059,10 +2016,9 @@ var require_types_cjs_development = __commonJS({
2059
2016
  }
2060
2017
  pick(mask) {
2061
2018
  const shape = {};
2062
- util.objectKeys(mask).forEach((key) => {
2063
- if (mask[key] && this.shape[key]) {
2019
+ util.objectKeys(mask).map((key) => {
2020
+ if (this.shape[key])
2064
2021
  shape[key] = this.shape[key];
2065
- }
2066
2022
  });
2067
2023
  return new ZodObject({
2068
2024
  ...this._def,
@@ -2071,8 +2027,8 @@ var require_types_cjs_development = __commonJS({
2071
2027
  }
2072
2028
  omit(mask) {
2073
2029
  const shape = {};
2074
- util.objectKeys(this.shape).forEach((key) => {
2075
- if (!mask[key]) {
2030
+ util.objectKeys(this.shape).map((key) => {
2031
+ if (util.objectKeys(mask).indexOf(key) === -1) {
2076
2032
  shape[key] = this.shape[key];
2077
2033
  }
2078
2034
  });
@@ -2086,14 +2042,24 @@ var require_types_cjs_development = __commonJS({
2086
2042
  }
2087
2043
  partial(mask) {
2088
2044
  const newShape = {};
2089
- util.objectKeys(this.shape).forEach((key) => {
2090
- const fieldSchema = this.shape[key];
2091
- if (mask && !mask[key]) {
2092
- newShape[key] = fieldSchema;
2093
- } else {
2045
+ if (mask) {
2046
+ util.objectKeys(this.shape).map((key) => {
2047
+ if (util.objectKeys(mask).indexOf(key) === -1) {
2048
+ newShape[key] = this.shape[key];
2049
+ } else {
2050
+ newShape[key] = this.shape[key].optional();
2051
+ }
2052
+ });
2053
+ return new ZodObject({
2054
+ ...this._def,
2055
+ shape: () => newShape
2056
+ });
2057
+ } else {
2058
+ for (const key in this.shape) {
2059
+ const fieldSchema = this.shape[key];
2094
2060
  newShape[key] = fieldSchema.optional();
2095
2061
  }
2096
- });
2062
+ }
2097
2063
  return new ZodObject({
2098
2064
  ...this._def,
2099
2065
  shape: () => newShape
@@ -2101,10 +2067,21 @@ var require_types_cjs_development = __commonJS({
2101
2067
  }
2102
2068
  required(mask) {
2103
2069
  const newShape = {};
2104
- util.objectKeys(this.shape).forEach((key) => {
2105
- if (mask && !mask[key]) {
2106
- newShape[key] = this.shape[key];
2107
- } else {
2070
+ if (mask) {
2071
+ util.objectKeys(this.shape).map((key) => {
2072
+ if (util.objectKeys(mask).indexOf(key) === -1) {
2073
+ newShape[key] = this.shape[key];
2074
+ } else {
2075
+ const fieldSchema = this.shape[key];
2076
+ let newField = fieldSchema;
2077
+ while (newField instanceof ZodOptional) {
2078
+ newField = newField._def.innerType;
2079
+ }
2080
+ newShape[key] = newField;
2081
+ }
2082
+ });
2083
+ } else {
2084
+ for (const key in this.shape) {
2108
2085
  const fieldSchema = this.shape[key];
2109
2086
  let newField = fieldSchema;
2110
2087
  while (newField instanceof ZodOptional) {
@@ -2112,7 +2089,7 @@ var require_types_cjs_development = __commonJS({
2112
2089
  }
2113
2090
  newShape[key] = newField;
2114
2091
  }
2115
- });
2092
+ }
2116
2093
  return new ZodObject({
2117
2094
  ...this._def,
2118
2095
  shape: () => newShape
@@ -2462,7 +2439,7 @@ var require_types_cjs_development = __commonJS({
2462
2439
  });
2463
2440
  status.dirty();
2464
2441
  }
2465
- const items = [...ctx.data].map((item, itemIndex) => {
2442
+ const items = ctx.data.map((item, itemIndex) => {
2466
2443
  const schema = this._def.items[itemIndex] || this._def.rest;
2467
2444
  if (!schema)
2468
2445
  return null;
@@ -2844,7 +2821,6 @@ var require_types_cjs_development = __commonJS({
2844
2821
  if (input.data !== this._def.value) {
2845
2822
  const ctx = this._getOrReturnCtx(input);
2846
2823
  addIssueToContext(ctx, {
2847
- received: ctx.data,
2848
2824
  code: ZodIssueCode.invalid_literal,
2849
2825
  expected: this._def.value
2850
2826
  });
@@ -2922,12 +2898,6 @@ var require_types_cjs_development = __commonJS({
2922
2898
  }
2923
2899
  return enumValues;
2924
2900
  }
2925
- extract(values) {
2926
- return ZodEnum.create(values);
2927
- }
2928
- exclude(values) {
2929
- return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));
2930
- }
2931
2901
  }, "ZodEnum");
2932
2902
  __name22(ZodEnum, "ZodEnum");
2933
2903
  ZodEnum.create = createZodEnum;
@@ -2968,9 +2938,6 @@ var require_types_cjs_development = __commonJS({
2968
2938
  });
2969
2939
  };
2970
2940
  var ZodPromise = /* @__PURE__ */ __name2(class extends ZodType {
2971
- unwrap() {
2972
- return this._def.type;
2973
- }
2974
2941
  _parse(input) {
2975
2942
  const { ctx } = this._processInputParams(input);
2976
2943
  if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
@@ -3189,29 +3156,23 @@ var require_types_cjs_development = __commonJS({
3189
3156
  const result = this._def.innerType._parse({
3190
3157
  data: ctx.data,
3191
3158
  path: ctx.path,
3192
- parent: {
3193
- ...ctx,
3194
- common: {
3195
- ...ctx.common,
3196
- issues: []
3197
- }
3198
- }
3159
+ parent: ctx
3199
3160
  });
3200
3161
  if (isAsync(result)) {
3201
3162
  return result.then((result2) => {
3202
3163
  return {
3203
3164
  status: "valid",
3204
- value: result2.status === "valid" ? result2.value : this._def.catchValue()
3165
+ value: result2.status === "valid" ? result2.value : this._def.defaultValue()
3205
3166
  };
3206
3167
  });
3207
3168
  } else {
3208
3169
  return {
3209
3170
  status: "valid",
3210
- value: result.status === "valid" ? result.value : this._def.catchValue()
3171
+ value: result.status === "valid" ? result.value : this._def.defaultValue()
3211
3172
  };
3212
3173
  }
3213
3174
  }
3214
- removeCatch() {
3175
+ removeDefault() {
3215
3176
  return this._def.innerType;
3216
3177
  }
3217
3178
  }, "ZodCatch");
@@ -3220,7 +3181,7 @@ var require_types_cjs_development = __commonJS({
3220
3181
  return new ZodCatch({
3221
3182
  innerType: type,
3222
3183
  typeName: ZodFirstPartyTypeKind.ZodCatch,
3223
- catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
3184
+ defaultValue: typeof params.default === "function" ? params.default : () => params.default,
3224
3185
  ...processCreateParams(params)
3225
3186
  });
3226
3187
  };
@@ -3413,10 +3374,7 @@ var require_types_cjs_development = __commonJS({
3413
3374
  var coerce = {
3414
3375
  string: (arg) => ZodString.create({ ...arg, coerce: true }),
3415
3376
  number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
3416
- boolean: (arg) => ZodBoolean.create({
3417
- ...arg,
3418
- coerce: true
3419
- }),
3377
+ boolean: (arg) => ZodBoolean.create({ ...arg, coerce: true }),
3420
3378
  bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
3421
3379
  date: (arg) => ZodDate.create({ ...arg, coerce: true })
3422
3380
  };
@@ -3540,13 +3498,11 @@ var require_types_cjs_development = __commonJS({
3540
3498
  type: mod.string().optional(),
3541
3499
  narrative: mod.string().optional()
3542
3500
  });
3543
- var ImageValidator = mod.string().or(
3544
- mod.object({
3545
- id: mod.string(),
3546
- type: mod.string(),
3547
- caption: mod.string().optional()
3548
- })
3549
- );
3501
+ var ImageValidator = mod.string().or(mod.object({
3502
+ id: mod.string(),
3503
+ type: mod.string(),
3504
+ caption: mod.string().optional()
3505
+ }));
3550
3506
  var GeoCoordinatesValidator = mod.object({
3551
3507
  type: mod.string().min(1).or(mod.string().array().nonempty()),
3552
3508
  latitude: mod.number(),
@@ -3588,31 +3544,29 @@ var require_types_cjs_development = __commonJS({
3588
3544
  identifier: mod.string(),
3589
3545
  identifierType: IdentifierTypeValidator
3590
3546
  });
3591
- var ProfileValidator = mod.string().or(
3592
- mod.object({
3593
- id: mod.string().optional(),
3594
- type: mod.string().or(mod.string().array().nonempty().optional()),
3595
- name: mod.string().optional(),
3596
- url: mod.string().optional(),
3597
- phone: mod.string().optional(),
3598
- description: mod.string().optional(),
3599
- endorsement: mod.any().array().optional(),
3600
- image: ImageValidator.optional(),
3601
- email: mod.string().email().optional(),
3602
- address: AddressValidator.optional(),
3603
- otherIdentifier: IdentifierEntryValidator.array().optional(),
3604
- official: mod.string().optional(),
3605
- parentOrg: mod.any().optional(),
3606
- familyName: mod.string().optional(),
3607
- givenName: mod.string().optional(),
3608
- additionalName: mod.string().optional(),
3609
- patronymicName: mod.string().optional(),
3610
- honorificPrefix: mod.string().optional(),
3611
- honorificSuffix: mod.string().optional(),
3612
- familyNamePrefix: mod.string().optional(),
3613
- dateOfBirth: mod.string().optional()
3614
- }).catchall(mod.any())
3615
- );
3547
+ var ProfileValidator = mod.string().or(mod.object({
3548
+ id: mod.string().optional(),
3549
+ type: mod.string().or(mod.string().array().nonempty().optional()),
3550
+ name: mod.string().optional(),
3551
+ url: mod.string().optional(),
3552
+ phone: mod.string().optional(),
3553
+ description: mod.string().optional(),
3554
+ endorsement: mod.any().array().optional(),
3555
+ image: ImageValidator.optional(),
3556
+ email: mod.string().email().optional(),
3557
+ address: AddressValidator.optional(),
3558
+ otherIdentifier: IdentifierEntryValidator.array().optional(),
3559
+ official: mod.string().optional(),
3560
+ parentOrg: mod.any().optional(),
3561
+ familyName: mod.string().optional(),
3562
+ givenName: mod.string().optional(),
3563
+ additionalName: mod.string().optional(),
3564
+ patronymicName: mod.string().optional(),
3565
+ honorificPrefix: mod.string().optional(),
3566
+ honorificSuffix: mod.string().optional(),
3567
+ familyNamePrefix: mod.string().optional(),
3568
+ dateOfBirth: mod.string().optional()
3569
+ }).catchall(mod.any()));
3616
3570
  var CredentialSubjectValidator = mod.object({ id: mod.string().optional() }).catchall(mod.any());
3617
3571
  var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() });
3618
3572
  var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() });
@@ -4035,15 +3989,9 @@ var getDidKeyPlugin = /* @__PURE__ */ __name(async (learnCard, key, defaultDidMe
4035
3989
  if (key.length > 64)
4036
3990
  throw new Error("Key must be less than 64 characters");
4037
3991
  if (key.length < 64) {
4038
- console.warn(
4039
- "Warning: A LearnCard has been initialized with a seed that is less than 32 bytes, and will be padded with zeroes"
4040
- );
4041
- console.warn(
4042
- "Please instantiate LearnCards using 32 bytes that have been randomly generated in a cryptographically secure fashion!"
4043
- );
4044
- console.warn(
4045
- "See https://app.gitbook.com/o/6uDv1QDlxaaZC7i8EaGb/s/FXvEJ9j3Vf3FW5Nc557n/learn-card-packages/learncard-core/instantiation#key-generation for details"
4046
- );
3992
+ console.warn("Warning: A LearnCard has been initialized with a seed that is less than 32 bytes, and will be padded with zeroes");
3993
+ console.warn("Please instantiate LearnCards using 32 bytes that have been randomly generated in a cryptographically secure fashion!");
3994
+ console.warn("See https://app.gitbook.com/o/6uDv1QDlxaaZC7i8EaGb/s/FXvEJ9j3Vf3FW5Nc557n/learn-card-packages/learncard-core/instantiation#key-generation for details");
4047
3995
  }
4048
3996
  const seed = key.padStart(64, "0");
4049
3997
  const seedBytes = toUint8Array(seed);