@learncard/network-plugin 1.4.17 → 1.4.19

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.
@@ -832,7 +832,7 @@ var getClient = /* @__PURE__ */ __name2(async (url, didAuthFunction) => {
832
832
  return trpc;
833
833
  }, "getClient");
834
834
 
835
- // ../../../node_modules/.pnpm/zod@3.20.6/node_modules/zod/lib/index.mjs
835
+ // ../../../node_modules/.pnpm/zod@3.20.2/node_modules/zod/lib/index.mjs
836
836
  var util;
837
837
  (function(util2) {
838
838
  util2.assertEqual = (val) => val;
@@ -1263,7 +1263,7 @@ var OK = /* @__PURE__ */ __name((value) => ({ status: "valid", value }), "OK");
1263
1263
  var isAborted = /* @__PURE__ */ __name((x) => x.status === "aborted", "isAborted");
1264
1264
  var isDirty = /* @__PURE__ */ __name((x) => x.status === "dirty", "isDirty");
1265
1265
  var isValid = /* @__PURE__ */ __name((x) => x.status === "valid", "isValid");
1266
- var isAsync = /* @__PURE__ */ __name((x) => typeof Promise !== "undefined" && x instanceof Promise, "isAsync");
1266
+ var isAsync = /* @__PURE__ */ __name((x) => typeof Promise !== void 0 && x instanceof Promise, "isAsync");
1267
1267
  var errorUtil;
1268
1268
  (function(errorUtil2) {
1269
1269
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
@@ -1481,29 +1481,28 @@ var ZodType = class {
1481
1481
  return this._refinement(refinement);
1482
1482
  }
1483
1483
  optional() {
1484
- return ZodOptional.create(this, this._def);
1484
+ return ZodOptional.create(this);
1485
1485
  }
1486
1486
  nullable() {
1487
- return ZodNullable.create(this, this._def);
1487
+ return ZodNullable.create(this);
1488
1488
  }
1489
1489
  nullish() {
1490
- return this.nullable().optional();
1490
+ return this.optional().nullable();
1491
1491
  }
1492
1492
  array() {
1493
- return ZodArray.create(this, this._def);
1493
+ return ZodArray.create(this);
1494
1494
  }
1495
1495
  promise() {
1496
- return ZodPromise.create(this, this._def);
1496
+ return ZodPromise.create(this);
1497
1497
  }
1498
1498
  or(option) {
1499
- return ZodUnion.create([this, option], this._def);
1499
+ return ZodUnion.create([this, option]);
1500
1500
  }
1501
1501
  and(incoming) {
1502
- return ZodIntersection.create(this, incoming, this._def);
1502
+ return ZodIntersection.create(this, incoming);
1503
1503
  }
1504
1504
  transform(transform) {
1505
1505
  return new ZodEffects({
1506
- ...processCreateParams(this._def),
1507
1506
  schema: this,
1508
1507
  typeName: ZodFirstPartyTypeKind.ZodEffects,
1509
1508
  effect: { type: "transform", transform }
@@ -1512,7 +1511,6 @@ var ZodType = class {
1512
1511
  default(def) {
1513
1512
  const defaultValueFunc = typeof def === "function" ? def : () => def;
1514
1513
  return new ZodDefault({
1515
- ...processCreateParams(this._def),
1516
1514
  innerType: this,
1517
1515
  defaultValue: defaultValueFunc,
1518
1516
  typeName: ZodFirstPartyTypeKind.ZodDefault
@@ -1522,15 +1520,14 @@ var ZodType = class {
1522
1520
  return new ZodBranded({
1523
1521
  typeName: ZodFirstPartyTypeKind.ZodBranded,
1524
1522
  type: this,
1525
- ...processCreateParams(this._def)
1523
+ ...processCreateParams(void 0)
1526
1524
  });
1527
1525
  }
1528
1526
  catch(def) {
1529
- const catchValueFunc = typeof def === "function" ? def : () => def;
1527
+ const defaultValueFunc = typeof def === "function" ? def : () => def;
1530
1528
  return new ZodCatch({
1531
- ...processCreateParams(this._def),
1532
1529
  innerType: this,
1533
- catchValue: catchValueFunc,
1530
+ defaultValue: defaultValueFunc,
1534
1531
  typeName: ZodFirstPartyTypeKind.ZodCatch
1535
1532
  });
1536
1533
  }
@@ -1553,25 +1550,24 @@ var ZodType = class {
1553
1550
  };
1554
1551
  __name(ZodType, "ZodType");
1555
1552
  var cuidRegex = /^c[^\s-]{8,}$/i;
1556
- var cuid2Regex = /^[a-z][a-z0-9]*$/;
1557
1553
  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;
1558
- 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,}))$/;
1554
+ var emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
1559
1555
  var datetimeRegex = /* @__PURE__ */ __name((args) => {
1560
1556
  if (args.precision) {
1561
1557
  if (args.offset) {
1562
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
1558
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
1563
1559
  } else {
1564
1560
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
1565
1561
  }
1566
1562
  } else if (args.precision === 0) {
1567
1563
  if (args.offset) {
1568
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
1564
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
1569
1565
  } else {
1570
1566
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
1571
1567
  }
1572
1568
  } else {
1573
1569
  if (args.offset) {
1574
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
1570
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
1575
1571
  } else {
1576
1572
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
1577
1573
  }
@@ -1598,14 +1594,11 @@ var ZodString = class extends ZodType {
1598
1594
  const parsedType = this._getType(input);
1599
1595
  if (parsedType !== ZodParsedType.string) {
1600
1596
  const ctx2 = this._getOrReturnCtx(input);
1601
- addIssueToContext(
1602
- ctx2,
1603
- {
1604
- code: ZodIssueCode.invalid_type,
1605
- expected: ZodParsedType.string,
1606
- received: ctx2.parsedType
1607
- }
1608
- );
1597
+ addIssueToContext(ctx2, {
1598
+ code: ZodIssueCode.invalid_type,
1599
+ expected: ZodParsedType.string,
1600
+ received: ctx2.parsedType
1601
+ });
1609
1602
  return INVALID;
1610
1603
  }
1611
1604
  const status = new ParseStatus();
@@ -1693,16 +1686,6 @@ var ZodString = class extends ZodType {
1693
1686
  });
1694
1687
  status.dirty();
1695
1688
  }
1696
- } else if (check.kind === "cuid2") {
1697
- if (!cuid2Regex.test(input.data)) {
1698
- ctx = this._getOrReturnCtx(input, ctx);
1699
- addIssueToContext(ctx, {
1700
- validation: "cuid2",
1701
- code: ZodIssueCode.invalid_string,
1702
- message: check.message
1703
- });
1704
- status.dirty();
1705
- }
1706
1689
  } else if (check.kind === "url") {
1707
1690
  try {
1708
1691
  new URL(input.data);
@@ -1784,9 +1767,6 @@ var ZodString = class extends ZodType {
1784
1767
  cuid(message) {
1785
1768
  return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
1786
1769
  }
1787
- cuid2(message) {
1788
- return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
1789
- }
1790
1770
  datetime(options) {
1791
1771
  var _a;
1792
1772
  if (typeof options === "string") {
@@ -1861,9 +1841,6 @@ var ZodString = class extends ZodType {
1861
1841
  get isCUID() {
1862
1842
  return !!this._def.checks.find((ch) => ch.kind === "cuid");
1863
1843
  }
1864
- get isCUID2() {
1865
- return !!this._def.checks.find((ch) => ch.kind === "cuid2");
1866
- }
1867
1844
  get minLength() {
1868
1845
  let min = null;
1869
1846
  for (const ch of this._def.checks) {
@@ -2096,22 +2073,7 @@ var ZodNumber = class extends ZodType {
2096
2073
  return max;
2097
2074
  }
2098
2075
  get isInt() {
2099
- return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
2100
- }
2101
- get isFinite() {
2102
- let max = null, min = null;
2103
- for (const ch of this._def.checks) {
2104
- if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
2105
- return true;
2106
- } else if (ch.kind === "min") {
2107
- if (min === null || ch.value > min)
2108
- min = ch.value;
2109
- } else if (ch.kind === "max") {
2110
- if (max === null || ch.value < max)
2111
- max = ch.value;
2112
- }
2113
- }
2114
- return Number.isFinite(min) && Number.isFinite(max);
2076
+ return !!this._def.checks.find((ch) => ch.kind === "int");
2115
2077
  }
2116
2078
  };
2117
2079
  __name(ZodNumber, "ZodNumber");
@@ -2479,13 +2441,13 @@ var ZodArray = class extends ZodType {
2479
2441
  }
2480
2442
  }
2481
2443
  if (ctx.common.async) {
2482
- return Promise.all([...ctx.data].map((item, i) => {
2444
+ return Promise.all(ctx.data.map((item, i) => {
2483
2445
  return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
2484
2446
  })).then((result2) => {
2485
2447
  return ParseStatus.mergeArray(status, result2);
2486
2448
  });
2487
2449
  }
2488
- const result = [...ctx.data].map((item, i) => {
2450
+ const result = ctx.data.map((item, i) => {
2489
2451
  return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
2490
2452
  });
2491
2453
  return ParseStatus.mergeArray(status, result);
@@ -2535,6 +2497,15 @@ var objectUtil;
2535
2497
  };
2536
2498
  };
2537
2499
  })(objectUtil || (objectUtil = {}));
2500
+ var AugmentFactory = /* @__PURE__ */ __name((def) => (augmentation) => {
2501
+ return new ZodObject({
2502
+ ...def,
2503
+ shape: () => ({
2504
+ ...def.shape(),
2505
+ ...augmentation
2506
+ })
2507
+ });
2508
+ }, "AugmentFactory");
2538
2509
  function deepPartialify(schema) {
2539
2510
  if (schema instanceof ZodObject) {
2540
2511
  const newShape = {};
@@ -2564,7 +2535,8 @@ var ZodObject = class extends ZodType {
2564
2535
  super(...arguments);
2565
2536
  this._cached = null;
2566
2537
  this.nonstrict = this.passthrough;
2567
- this.augment = this.extend;
2538
+ this.augment = AugmentFactory(this._def);
2539
+ this.extend = AugmentFactory(this._def);
2568
2540
  }
2569
2541
  _getCached() {
2570
2542
  if (this._cached !== null)
@@ -2632,9 +2604,7 @@ var ZodObject = class extends ZodType {
2632
2604
  const value = ctx.data[key];
2633
2605
  pairs.push({
2634
2606
  key: { status: "valid", value: key },
2635
- value: catchall._parse(
2636
- new ParseInputLazyPath(ctx, value, ctx.path, key)
2637
- ),
2607
+ value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
2638
2608
  alwaysSet: key in ctx.data
2639
2609
  });
2640
2610
  }
@@ -2693,14 +2663,8 @@ var ZodObject = class extends ZodType {
2693
2663
  unknownKeys: "passthrough"
2694
2664
  });
2695
2665
  }
2696
- extend(augmentation) {
2697
- return new ZodObject({
2698
- ...this._def,
2699
- shape: () => ({
2700
- ...this._def.shape(),
2701
- ...augmentation
2702
- })
2703
- });
2666
+ setKey(key, schema) {
2667
+ return this.augment({ [key]: schema });
2704
2668
  }
2705
2669
  merge(merging) {
2706
2670
  const merged = new ZodObject({
@@ -2711,9 +2675,6 @@ var ZodObject = class extends ZodType {
2711
2675
  });
2712
2676
  return merged;
2713
2677
  }
2714
- setKey(key, schema) {
2715
- return this.augment({ [key]: schema });
2716
- }
2717
2678
  catchall(index) {
2718
2679
  return new ZodObject({
2719
2680
  ...this._def,
@@ -2722,10 +2683,9 @@ var ZodObject = class extends ZodType {
2722
2683
  }
2723
2684
  pick(mask) {
2724
2685
  const shape = {};
2725
- util.objectKeys(mask).forEach((key) => {
2726
- if (mask[key] && this.shape[key]) {
2686
+ util.objectKeys(mask).map((key) => {
2687
+ if (this.shape[key])
2727
2688
  shape[key] = this.shape[key];
2728
- }
2729
2689
  });
2730
2690
  return new ZodObject({
2731
2691
  ...this._def,
@@ -2734,8 +2694,8 @@ var ZodObject = class extends ZodType {
2734
2694
  }
2735
2695
  omit(mask) {
2736
2696
  const shape = {};
2737
- util.objectKeys(this.shape).forEach((key) => {
2738
- if (!mask[key]) {
2697
+ util.objectKeys(this.shape).map((key) => {
2698
+ if (util.objectKeys(mask).indexOf(key) === -1) {
2739
2699
  shape[key] = this.shape[key];
2740
2700
  }
2741
2701
  });
@@ -2749,14 +2709,24 @@ var ZodObject = class extends ZodType {
2749
2709
  }
2750
2710
  partial(mask) {
2751
2711
  const newShape = {};
2752
- util.objectKeys(this.shape).forEach((key) => {
2753
- const fieldSchema = this.shape[key];
2754
- if (mask && !mask[key]) {
2755
- newShape[key] = fieldSchema;
2756
- } else {
2712
+ if (mask) {
2713
+ util.objectKeys(this.shape).map((key) => {
2714
+ if (util.objectKeys(mask).indexOf(key) === -1) {
2715
+ newShape[key] = this.shape[key];
2716
+ } else {
2717
+ newShape[key] = this.shape[key].optional();
2718
+ }
2719
+ });
2720
+ return new ZodObject({
2721
+ ...this._def,
2722
+ shape: () => newShape
2723
+ });
2724
+ } else {
2725
+ for (const key in this.shape) {
2726
+ const fieldSchema = this.shape[key];
2757
2727
  newShape[key] = fieldSchema.optional();
2758
2728
  }
2759
- });
2729
+ }
2760
2730
  return new ZodObject({
2761
2731
  ...this._def,
2762
2732
  shape: () => newShape
@@ -2764,10 +2734,21 @@ var ZodObject = class extends ZodType {
2764
2734
  }
2765
2735
  required(mask) {
2766
2736
  const newShape = {};
2767
- util.objectKeys(this.shape).forEach((key) => {
2768
- if (mask && !mask[key]) {
2769
- newShape[key] = this.shape[key];
2770
- } else {
2737
+ if (mask) {
2738
+ util.objectKeys(this.shape).map((key) => {
2739
+ if (util.objectKeys(mask).indexOf(key) === -1) {
2740
+ newShape[key] = this.shape[key];
2741
+ } else {
2742
+ const fieldSchema = this.shape[key];
2743
+ let newField = fieldSchema;
2744
+ while (newField instanceof ZodOptional) {
2745
+ newField = newField._def.innerType;
2746
+ }
2747
+ newShape[key] = newField;
2748
+ }
2749
+ });
2750
+ } else {
2751
+ for (const key in this.shape) {
2771
2752
  const fieldSchema = this.shape[key];
2772
2753
  let newField = fieldSchema;
2773
2754
  while (newField instanceof ZodOptional) {
@@ -2775,7 +2756,7 @@ var ZodObject = class extends ZodType {
2775
2756
  }
2776
2757
  newShape[key] = newField;
2777
2758
  }
2778
- });
2759
+ }
2779
2760
  return new ZodObject({
2780
2761
  ...this._def,
2781
2762
  shape: () => newShape
@@ -3121,7 +3102,7 @@ var ZodTuple = class extends ZodType {
3121
3102
  });
3122
3103
  status.dirty();
3123
3104
  }
3124
- const items = [...ctx.data].map((item, itemIndex) => {
3105
+ const items = ctx.data.map((item, itemIndex) => {
3125
3106
  const schema = this._def.items[itemIndex] || this._def.rest;
3126
3107
  if (!schema)
3127
3108
  return null;
@@ -3497,7 +3478,6 @@ var ZodLiteral = class extends ZodType {
3497
3478
  if (input.data !== this._def.value) {
3498
3479
  const ctx = this._getOrReturnCtx(input);
3499
3480
  addIssueToContext(ctx, {
3500
- received: ctx.data,
3501
3481
  code: ZodIssueCode.invalid_literal,
3502
3482
  expected: this._def.value
3503
3483
  });
@@ -3573,12 +3553,6 @@ var ZodEnum = class extends ZodType {
3573
3553
  }
3574
3554
  return enumValues;
3575
3555
  }
3576
- extract(values) {
3577
- return ZodEnum.create(values);
3578
- }
3579
- exclude(values) {
3580
- return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));
3581
- }
3582
3556
  };
3583
3557
  __name(ZodEnum, "ZodEnum");
3584
3558
  ZodEnum.create = createZodEnum;
@@ -3619,9 +3593,6 @@ ZodNativeEnum.create = (values, params) => {
3619
3593
  });
3620
3594
  };
3621
3595
  var ZodPromise = class extends ZodType {
3622
- unwrap() {
3623
- return this._def.type;
3624
- }
3625
3596
  _parse(input) {
3626
3597
  const { ctx } = this._processInputParams(input);
3627
3598
  if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
@@ -3840,29 +3811,23 @@ var ZodCatch = class extends ZodType {
3840
3811
  const result = this._def.innerType._parse({
3841
3812
  data: ctx.data,
3842
3813
  path: ctx.path,
3843
- parent: {
3844
- ...ctx,
3845
- common: {
3846
- ...ctx.common,
3847
- issues: []
3848
- }
3849
- }
3814
+ parent: ctx
3850
3815
  });
3851
3816
  if (isAsync(result)) {
3852
3817
  return result.then((result2) => {
3853
3818
  return {
3854
3819
  status: "valid",
3855
- value: result2.status === "valid" ? result2.value : this._def.catchValue()
3820
+ value: result2.status === "valid" ? result2.value : this._def.defaultValue()
3856
3821
  };
3857
3822
  });
3858
3823
  } else {
3859
3824
  return {
3860
3825
  status: "valid",
3861
- value: result.status === "valid" ? result.value : this._def.catchValue()
3826
+ value: result.status === "valid" ? result.value : this._def.defaultValue()
3862
3827
  };
3863
3828
  }
3864
3829
  }
3865
- removeCatch() {
3830
+ removeDefault() {
3866
3831
  return this._def.innerType;
3867
3832
  }
3868
3833
  };
@@ -3871,7 +3836,7 @@ ZodCatch.create = (type, params) => {
3871
3836
  return new ZodCatch({
3872
3837
  innerType: type,
3873
3838
  typeName: ZodFirstPartyTypeKind.ZodCatch,
3874
- catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
3839
+ defaultValue: typeof params.default === "function" ? params.default : () => params.default,
3875
3840
  ...processCreateParams(params)
3876
3841
  });
3877
3842
  };
@@ -4064,10 +4029,7 @@ var oboolean = /* @__PURE__ */ __name(() => booleanType().optional(), "oboolean"
4064
4029
  var coerce = {
4065
4030
  string: (arg) => ZodString.create({ ...arg, coerce: true }),
4066
4031
  number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
4067
- boolean: (arg) => ZodBoolean.create({
4068
- ...arg,
4069
- coerce: true
4070
- }),
4032
+ boolean: (arg) => ZodBoolean.create({ ...arg, coerce: true }),
4071
4033
  bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
4072
4034
  date: (arg) => ZodDate.create({ ...arg, coerce: true })
4073
4035
  };
@@ -4193,13 +4155,11 @@ var AchievementCriteriaValidator = mod.object({
4193
4155
  type: mod.string().optional(),
4194
4156
  narrative: mod.string().optional()
4195
4157
  });
4196
- var ImageValidator = mod.string().or(
4197
- mod.object({
4198
- id: mod.string(),
4199
- type: mod.string(),
4200
- caption: mod.string().optional()
4201
- })
4202
- );
4158
+ var ImageValidator = mod.string().or(mod.object({
4159
+ id: mod.string(),
4160
+ type: mod.string(),
4161
+ caption: mod.string().optional()
4162
+ }));
4203
4163
  var GeoCoordinatesValidator = mod.object({
4204
4164
  type: mod.string().min(1).or(mod.string().array().nonempty()),
4205
4165
  latitude: mod.number(),
@@ -4241,31 +4201,29 @@ var IdentifierEntryValidator = mod.object({
4241
4201
  identifier: mod.string(),
4242
4202
  identifierType: IdentifierTypeValidator
4243
4203
  });
4244
- var ProfileValidator = mod.string().or(
4245
- mod.object({
4246
- id: mod.string().optional(),
4247
- type: mod.string().or(mod.string().array().nonempty().optional()),
4248
- name: mod.string().optional(),
4249
- url: mod.string().optional(),
4250
- phone: mod.string().optional(),
4251
- description: mod.string().optional(),
4252
- endorsement: mod.any().array().optional(),
4253
- image: ImageValidator.optional(),
4254
- email: mod.string().email().optional(),
4255
- address: AddressValidator.optional(),
4256
- otherIdentifier: IdentifierEntryValidator.array().optional(),
4257
- official: mod.string().optional(),
4258
- parentOrg: mod.any().optional(),
4259
- familyName: mod.string().optional(),
4260
- givenName: mod.string().optional(),
4261
- additionalName: mod.string().optional(),
4262
- patronymicName: mod.string().optional(),
4263
- honorificPrefix: mod.string().optional(),
4264
- honorificSuffix: mod.string().optional(),
4265
- familyNamePrefix: mod.string().optional(),
4266
- dateOfBirth: mod.string().optional()
4267
- }).catchall(mod.any())
4268
- );
4204
+ var ProfileValidator = mod.string().or(mod.object({
4205
+ id: mod.string().optional(),
4206
+ type: mod.string().or(mod.string().array().nonempty().optional()),
4207
+ name: mod.string().optional(),
4208
+ url: mod.string().optional(),
4209
+ phone: mod.string().optional(),
4210
+ description: mod.string().optional(),
4211
+ endorsement: mod.any().array().optional(),
4212
+ image: ImageValidator.optional(),
4213
+ email: mod.string().email().optional(),
4214
+ address: AddressValidator.optional(),
4215
+ otherIdentifier: IdentifierEntryValidator.array().optional(),
4216
+ official: mod.string().optional(),
4217
+ parentOrg: mod.any().optional(),
4218
+ familyName: mod.string().optional(),
4219
+ givenName: mod.string().optional(),
4220
+ additionalName: mod.string().optional(),
4221
+ patronymicName: mod.string().optional(),
4222
+ honorificPrefix: mod.string().optional(),
4223
+ honorificSuffix: mod.string().optional(),
4224
+ familyNamePrefix: mod.string().optional(),
4225
+ dateOfBirth: mod.string().optional()
4226
+ }).catchall(mod.any()));
4269
4227
  var CredentialSubjectValidator = mod.object({ id: mod.string().optional() }).catchall(mod.any());
4270
4228
  var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() });
4271
4229
  var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() });
@@ -4547,11 +4505,13 @@ var JWEValidator = mod.object({
4547
4505
  aad: mod.string().optional(),
4548
4506
  recipients: JWERecipientValidator.array().optional()
4549
4507
  });
4550
- var EncryptedCredentialRecordValidator = mod.object({
4551
- encryptedRecord: JWEValidator,
4552
- fields: mod.string().array(),
4508
+ var EncryptedRecordValidator = mod.object({ encryptedRecord: JWEValidator, fields: mod.string().array() }).catchall(mod.any());
4509
+ var PaginatedEncryptedRecordsValidator = PaginationResponseValidator.extend({
4510
+ records: EncryptedRecordValidator.array()
4511
+ });
4512
+ var EncryptedCredentialRecordValidator = EncryptedRecordValidator.extend({
4553
4513
  id: mod.string()
4554
- }).catchall(mod.any());
4514
+ });
4555
4515
  var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.extend({
4556
4516
  records: EncryptedCredentialRecordValidator.array()
4557
4517
  });
@@ -5055,13 +5015,9 @@ var getVerifyBoostPlugin = /* @__PURE__ */ __name(async (learnCard, trustedBoost
5055
5015
  const boostCredential = credential?.boostCredential;
5056
5016
  try {
5057
5017
  if (boostCredential) {
5058
- const verifyBoostCredential = await learnCard.invoke.verifyCredential(
5059
- boostCredential
5060
- );
5018
+ const verifyBoostCredential = await learnCard.invoke.verifyCredential(boostCredential);
5061
5019
  if (!boostCredential?.boostId && !credential?.boostId) {
5062
- verificationCheck.warnings.push(
5063
- "Boost Authenticity could not be verified: Boost ID metadata is missing."
5064
- );
5020
+ verificationCheck.warnings.push("Boost Authenticity could not be verified: Boost ID metadata is missing.");
5065
5021
  }
5066
5022
  if (verifyBoostCredential.errors?.length > 0) {
5067
5023
  verificationCheck.errors = [
@@ -5070,21 +5026,13 @@ var getVerifyBoostPlugin = /* @__PURE__ */ __name(async (learnCard, trustedBoost
5070
5026
  "Boost Credential could not be verified."
5071
5027
  ];
5072
5028
  } else if (boostCredential?.boostId !== credential?.boostId) {
5073
- verificationCheck.errors.push(
5074
- "Boost Authenticity could not be verified: Boost ID metadata is mismatched."
5075
- );
5029
+ verificationCheck.errors.push("Boost Authenticity could not be verified: Boost ID metadata is mismatched.");
5076
5030
  } else {
5077
5031
  const trustedBoostIssuer = getTrustedBoostVerifier(credential?.issuer);
5078
5032
  if (trustedBoostIssuer) {
5079
- verificationCheck.checks.push(
5080
- `Boost is Authentic. Verified by ${trustedBoostIssuer.id}.`
5081
- );
5033
+ verificationCheck.checks.push(`Boost is Authentic. Verified by ${trustedBoostIssuer.id}.`);
5082
5034
  } else {
5083
- verificationCheck.warnings.push(
5084
- `Boost Authenticity could not be verified. Issuer is outside of trust network: ${getIssuerDID(
5085
- credential?.issuer
5086
- )}`
5087
- );
5035
+ verificationCheck.warnings.push(`Boost Authenticity could not be verified. Issuer is outside of trust network: ${getIssuerDID(credential?.issuer)}`);
5088
5036
  }
5089
5037
  }
5090
5038
  }