@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.
@@ -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;
@@ -857,7 +856,7 @@ var getClient = /* @__PURE__ */ __name2(async (url, didAuthFunction) => {
857
856
  return trpc;
858
857
  }, "getClient");
859
858
 
860
- // ../../../node_modules/.pnpm/zod@3.20.6/node_modules/zod/lib/index.mjs
859
+ // ../../../node_modules/.pnpm/zod@3.20.2/node_modules/zod/lib/index.mjs
861
860
  var util;
862
861
  (function(util2) {
863
862
  util2.assertEqual = (val) => val;
@@ -1288,7 +1287,7 @@ var OK = /* @__PURE__ */ __name((value) => ({ status: "valid", value }), "OK");
1288
1287
  var isAborted = /* @__PURE__ */ __name((x) => x.status === "aborted", "isAborted");
1289
1288
  var isDirty = /* @__PURE__ */ __name((x) => x.status === "dirty", "isDirty");
1290
1289
  var isValid = /* @__PURE__ */ __name((x) => x.status === "valid", "isValid");
1291
- var isAsync = /* @__PURE__ */ __name((x) => typeof Promise !== "undefined" && x instanceof Promise, "isAsync");
1290
+ var isAsync = /* @__PURE__ */ __name((x) => typeof Promise !== void 0 && x instanceof Promise, "isAsync");
1292
1291
  var errorUtil;
1293
1292
  (function(errorUtil2) {
1294
1293
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
@@ -1506,29 +1505,28 @@ var ZodType = class {
1506
1505
  return this._refinement(refinement);
1507
1506
  }
1508
1507
  optional() {
1509
- return ZodOptional.create(this, this._def);
1508
+ return ZodOptional.create(this);
1510
1509
  }
1511
1510
  nullable() {
1512
- return ZodNullable.create(this, this._def);
1511
+ return ZodNullable.create(this);
1513
1512
  }
1514
1513
  nullish() {
1515
- return this.nullable().optional();
1514
+ return this.optional().nullable();
1516
1515
  }
1517
1516
  array() {
1518
- return ZodArray.create(this, this._def);
1517
+ return ZodArray.create(this);
1519
1518
  }
1520
1519
  promise() {
1521
- return ZodPromise.create(this, this._def);
1520
+ return ZodPromise.create(this);
1522
1521
  }
1523
1522
  or(option) {
1524
- return ZodUnion.create([this, option], this._def);
1523
+ return ZodUnion.create([this, option]);
1525
1524
  }
1526
1525
  and(incoming) {
1527
- return ZodIntersection.create(this, incoming, this._def);
1526
+ return ZodIntersection.create(this, incoming);
1528
1527
  }
1529
1528
  transform(transform) {
1530
1529
  return new ZodEffects({
1531
- ...processCreateParams(this._def),
1532
1530
  schema: this,
1533
1531
  typeName: ZodFirstPartyTypeKind.ZodEffects,
1534
1532
  effect: { type: "transform", transform }
@@ -1537,7 +1535,6 @@ var ZodType = class {
1537
1535
  default(def) {
1538
1536
  const defaultValueFunc = typeof def === "function" ? def : () => def;
1539
1537
  return new ZodDefault({
1540
- ...processCreateParams(this._def),
1541
1538
  innerType: this,
1542
1539
  defaultValue: defaultValueFunc,
1543
1540
  typeName: ZodFirstPartyTypeKind.ZodDefault
@@ -1547,15 +1544,14 @@ var ZodType = class {
1547
1544
  return new ZodBranded({
1548
1545
  typeName: ZodFirstPartyTypeKind.ZodBranded,
1549
1546
  type: this,
1550
- ...processCreateParams(this._def)
1547
+ ...processCreateParams(void 0)
1551
1548
  });
1552
1549
  }
1553
1550
  catch(def) {
1554
- const catchValueFunc = typeof def === "function" ? def : () => def;
1551
+ const defaultValueFunc = typeof def === "function" ? def : () => def;
1555
1552
  return new ZodCatch({
1556
- ...processCreateParams(this._def),
1557
1553
  innerType: this,
1558
- catchValue: catchValueFunc,
1554
+ defaultValue: defaultValueFunc,
1559
1555
  typeName: ZodFirstPartyTypeKind.ZodCatch
1560
1556
  });
1561
1557
  }
@@ -1578,25 +1574,24 @@ var ZodType = class {
1578
1574
  };
1579
1575
  __name(ZodType, "ZodType");
1580
1576
  var cuidRegex = /^c[^\s-]{8,}$/i;
1581
- var cuid2Regex = /^[a-z][a-z0-9]*$/;
1582
1577
  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;
1583
- 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,}))$/;
1578
+ var emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
1584
1579
  var datetimeRegex = /* @__PURE__ */ __name((args) => {
1585
1580
  if (args.precision) {
1586
1581
  if (args.offset) {
1587
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
1582
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
1588
1583
  } else {
1589
1584
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
1590
1585
  }
1591
1586
  } else if (args.precision === 0) {
1592
1587
  if (args.offset) {
1593
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
1588
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
1594
1589
  } else {
1595
1590
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
1596
1591
  }
1597
1592
  } else {
1598
1593
  if (args.offset) {
1599
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
1594
+ return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
1600
1595
  } else {
1601
1596
  return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
1602
1597
  }
@@ -1623,14 +1618,11 @@ var ZodString = class extends ZodType {
1623
1618
  const parsedType = this._getType(input);
1624
1619
  if (parsedType !== ZodParsedType.string) {
1625
1620
  const ctx2 = this._getOrReturnCtx(input);
1626
- addIssueToContext(
1627
- ctx2,
1628
- {
1629
- code: ZodIssueCode.invalid_type,
1630
- expected: ZodParsedType.string,
1631
- received: ctx2.parsedType
1632
- }
1633
- );
1621
+ addIssueToContext(ctx2, {
1622
+ code: ZodIssueCode.invalid_type,
1623
+ expected: ZodParsedType.string,
1624
+ received: ctx2.parsedType
1625
+ });
1634
1626
  return INVALID;
1635
1627
  }
1636
1628
  const status = new ParseStatus();
@@ -1718,16 +1710,6 @@ var ZodString = class extends ZodType {
1718
1710
  });
1719
1711
  status.dirty();
1720
1712
  }
1721
- } else if (check.kind === "cuid2") {
1722
- if (!cuid2Regex.test(input.data)) {
1723
- ctx = this._getOrReturnCtx(input, ctx);
1724
- addIssueToContext(ctx, {
1725
- validation: "cuid2",
1726
- code: ZodIssueCode.invalid_string,
1727
- message: check.message
1728
- });
1729
- status.dirty();
1730
- }
1731
1713
  } else if (check.kind === "url") {
1732
1714
  try {
1733
1715
  new URL(input.data);
@@ -1809,9 +1791,6 @@ var ZodString = class extends ZodType {
1809
1791
  cuid(message) {
1810
1792
  return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
1811
1793
  }
1812
- cuid2(message) {
1813
- return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
1814
- }
1815
1794
  datetime(options) {
1816
1795
  var _a;
1817
1796
  if (typeof options === "string") {
@@ -1886,9 +1865,6 @@ var ZodString = class extends ZodType {
1886
1865
  get isCUID() {
1887
1866
  return !!this._def.checks.find((ch) => ch.kind === "cuid");
1888
1867
  }
1889
- get isCUID2() {
1890
- return !!this._def.checks.find((ch) => ch.kind === "cuid2");
1891
- }
1892
1868
  get minLength() {
1893
1869
  let min = null;
1894
1870
  for (const ch of this._def.checks) {
@@ -2121,22 +2097,7 @@ var ZodNumber = class extends ZodType {
2121
2097
  return max;
2122
2098
  }
2123
2099
  get isInt() {
2124
- return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
2125
- }
2126
- get isFinite() {
2127
- let max = null, min = null;
2128
- for (const ch of this._def.checks) {
2129
- if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
2130
- return true;
2131
- } else if (ch.kind === "min") {
2132
- if (min === null || ch.value > min)
2133
- min = ch.value;
2134
- } else if (ch.kind === "max") {
2135
- if (max === null || ch.value < max)
2136
- max = ch.value;
2137
- }
2138
- }
2139
- return Number.isFinite(min) && Number.isFinite(max);
2100
+ return !!this._def.checks.find((ch) => ch.kind === "int");
2140
2101
  }
2141
2102
  };
2142
2103
  __name(ZodNumber, "ZodNumber");
@@ -2504,13 +2465,13 @@ var ZodArray = class extends ZodType {
2504
2465
  }
2505
2466
  }
2506
2467
  if (ctx.common.async) {
2507
- return Promise.all([...ctx.data].map((item, i) => {
2468
+ return Promise.all(ctx.data.map((item, i) => {
2508
2469
  return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
2509
2470
  })).then((result2) => {
2510
2471
  return ParseStatus.mergeArray(status, result2);
2511
2472
  });
2512
2473
  }
2513
- const result = [...ctx.data].map((item, i) => {
2474
+ const result = ctx.data.map((item, i) => {
2514
2475
  return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
2515
2476
  });
2516
2477
  return ParseStatus.mergeArray(status, result);
@@ -2560,6 +2521,15 @@ var objectUtil;
2560
2521
  };
2561
2522
  };
2562
2523
  })(objectUtil || (objectUtil = {}));
2524
+ var AugmentFactory = /* @__PURE__ */ __name((def) => (augmentation) => {
2525
+ return new ZodObject({
2526
+ ...def,
2527
+ shape: () => ({
2528
+ ...def.shape(),
2529
+ ...augmentation
2530
+ })
2531
+ });
2532
+ }, "AugmentFactory");
2563
2533
  function deepPartialify(schema) {
2564
2534
  if (schema instanceof ZodObject) {
2565
2535
  const newShape = {};
@@ -2589,7 +2559,8 @@ var ZodObject = class extends ZodType {
2589
2559
  super(...arguments);
2590
2560
  this._cached = null;
2591
2561
  this.nonstrict = this.passthrough;
2592
- this.augment = this.extend;
2562
+ this.augment = AugmentFactory(this._def);
2563
+ this.extend = AugmentFactory(this._def);
2593
2564
  }
2594
2565
  _getCached() {
2595
2566
  if (this._cached !== null)
@@ -2657,9 +2628,7 @@ var ZodObject = class extends ZodType {
2657
2628
  const value = ctx.data[key];
2658
2629
  pairs.push({
2659
2630
  key: { status: "valid", value: key },
2660
- value: catchall._parse(
2661
- new ParseInputLazyPath(ctx, value, ctx.path, key)
2662
- ),
2631
+ value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
2663
2632
  alwaysSet: key in ctx.data
2664
2633
  });
2665
2634
  }
@@ -2718,14 +2687,8 @@ var ZodObject = class extends ZodType {
2718
2687
  unknownKeys: "passthrough"
2719
2688
  });
2720
2689
  }
2721
- extend(augmentation) {
2722
- return new ZodObject({
2723
- ...this._def,
2724
- shape: () => ({
2725
- ...this._def.shape(),
2726
- ...augmentation
2727
- })
2728
- });
2690
+ setKey(key, schema) {
2691
+ return this.augment({ [key]: schema });
2729
2692
  }
2730
2693
  merge(merging) {
2731
2694
  const merged = new ZodObject({
@@ -2736,9 +2699,6 @@ var ZodObject = class extends ZodType {
2736
2699
  });
2737
2700
  return merged;
2738
2701
  }
2739
- setKey(key, schema) {
2740
- return this.augment({ [key]: schema });
2741
- }
2742
2702
  catchall(index) {
2743
2703
  return new ZodObject({
2744
2704
  ...this._def,
@@ -2747,10 +2707,9 @@ var ZodObject = class extends ZodType {
2747
2707
  }
2748
2708
  pick(mask) {
2749
2709
  const shape = {};
2750
- util.objectKeys(mask).forEach((key) => {
2751
- if (mask[key] && this.shape[key]) {
2710
+ util.objectKeys(mask).map((key) => {
2711
+ if (this.shape[key])
2752
2712
  shape[key] = this.shape[key];
2753
- }
2754
2713
  });
2755
2714
  return new ZodObject({
2756
2715
  ...this._def,
@@ -2759,8 +2718,8 @@ var ZodObject = class extends ZodType {
2759
2718
  }
2760
2719
  omit(mask) {
2761
2720
  const shape = {};
2762
- util.objectKeys(this.shape).forEach((key) => {
2763
- if (!mask[key]) {
2721
+ util.objectKeys(this.shape).map((key) => {
2722
+ if (util.objectKeys(mask).indexOf(key) === -1) {
2764
2723
  shape[key] = this.shape[key];
2765
2724
  }
2766
2725
  });
@@ -2774,14 +2733,24 @@ var ZodObject = class extends ZodType {
2774
2733
  }
2775
2734
  partial(mask) {
2776
2735
  const newShape = {};
2777
- util.objectKeys(this.shape).forEach((key) => {
2778
- const fieldSchema = this.shape[key];
2779
- if (mask && !mask[key]) {
2780
- newShape[key] = fieldSchema;
2781
- } else {
2736
+ if (mask) {
2737
+ util.objectKeys(this.shape).map((key) => {
2738
+ if (util.objectKeys(mask).indexOf(key) === -1) {
2739
+ newShape[key] = this.shape[key];
2740
+ } else {
2741
+ newShape[key] = this.shape[key].optional();
2742
+ }
2743
+ });
2744
+ return new ZodObject({
2745
+ ...this._def,
2746
+ shape: () => newShape
2747
+ });
2748
+ } else {
2749
+ for (const key in this.shape) {
2750
+ const fieldSchema = this.shape[key];
2782
2751
  newShape[key] = fieldSchema.optional();
2783
2752
  }
2784
- });
2753
+ }
2785
2754
  return new ZodObject({
2786
2755
  ...this._def,
2787
2756
  shape: () => newShape
@@ -2789,10 +2758,21 @@ var ZodObject = class extends ZodType {
2789
2758
  }
2790
2759
  required(mask) {
2791
2760
  const newShape = {};
2792
- util.objectKeys(this.shape).forEach((key) => {
2793
- if (mask && !mask[key]) {
2794
- newShape[key] = this.shape[key];
2795
- } else {
2761
+ if (mask) {
2762
+ util.objectKeys(this.shape).map((key) => {
2763
+ if (util.objectKeys(mask).indexOf(key) === -1) {
2764
+ newShape[key] = this.shape[key];
2765
+ } else {
2766
+ const fieldSchema = this.shape[key];
2767
+ let newField = fieldSchema;
2768
+ while (newField instanceof ZodOptional) {
2769
+ newField = newField._def.innerType;
2770
+ }
2771
+ newShape[key] = newField;
2772
+ }
2773
+ });
2774
+ } else {
2775
+ for (const key in this.shape) {
2796
2776
  const fieldSchema = this.shape[key];
2797
2777
  let newField = fieldSchema;
2798
2778
  while (newField instanceof ZodOptional) {
@@ -2800,7 +2780,7 @@ var ZodObject = class extends ZodType {
2800
2780
  }
2801
2781
  newShape[key] = newField;
2802
2782
  }
2803
- });
2783
+ }
2804
2784
  return new ZodObject({
2805
2785
  ...this._def,
2806
2786
  shape: () => newShape
@@ -3146,7 +3126,7 @@ var ZodTuple = class extends ZodType {
3146
3126
  });
3147
3127
  status.dirty();
3148
3128
  }
3149
- const items = [...ctx.data].map((item, itemIndex) => {
3129
+ const items = ctx.data.map((item, itemIndex) => {
3150
3130
  const schema = this._def.items[itemIndex] || this._def.rest;
3151
3131
  if (!schema)
3152
3132
  return null;
@@ -3522,7 +3502,6 @@ var ZodLiteral = class extends ZodType {
3522
3502
  if (input.data !== this._def.value) {
3523
3503
  const ctx = this._getOrReturnCtx(input);
3524
3504
  addIssueToContext(ctx, {
3525
- received: ctx.data,
3526
3505
  code: ZodIssueCode.invalid_literal,
3527
3506
  expected: this._def.value
3528
3507
  });
@@ -3598,12 +3577,6 @@ var ZodEnum = class extends ZodType {
3598
3577
  }
3599
3578
  return enumValues;
3600
3579
  }
3601
- extract(values) {
3602
- return ZodEnum.create(values);
3603
- }
3604
- exclude(values) {
3605
- return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));
3606
- }
3607
3580
  };
3608
3581
  __name(ZodEnum, "ZodEnum");
3609
3582
  ZodEnum.create = createZodEnum;
@@ -3644,9 +3617,6 @@ ZodNativeEnum.create = (values, params) => {
3644
3617
  });
3645
3618
  };
3646
3619
  var ZodPromise = class extends ZodType {
3647
- unwrap() {
3648
- return this._def.type;
3649
- }
3650
3620
  _parse(input) {
3651
3621
  const { ctx } = this._processInputParams(input);
3652
3622
  if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
@@ -3865,29 +3835,23 @@ var ZodCatch = class extends ZodType {
3865
3835
  const result = this._def.innerType._parse({
3866
3836
  data: ctx.data,
3867
3837
  path: ctx.path,
3868
- parent: {
3869
- ...ctx,
3870
- common: {
3871
- ...ctx.common,
3872
- issues: []
3873
- }
3874
- }
3838
+ parent: ctx
3875
3839
  });
3876
3840
  if (isAsync(result)) {
3877
3841
  return result.then((result2) => {
3878
3842
  return {
3879
3843
  status: "valid",
3880
- value: result2.status === "valid" ? result2.value : this._def.catchValue()
3844
+ value: result2.status === "valid" ? result2.value : this._def.defaultValue()
3881
3845
  };
3882
3846
  });
3883
3847
  } else {
3884
3848
  return {
3885
3849
  status: "valid",
3886
- value: result.status === "valid" ? result.value : this._def.catchValue()
3850
+ value: result.status === "valid" ? result.value : this._def.defaultValue()
3887
3851
  };
3888
3852
  }
3889
3853
  }
3890
- removeCatch() {
3854
+ removeDefault() {
3891
3855
  return this._def.innerType;
3892
3856
  }
3893
3857
  };
@@ -3896,7 +3860,7 @@ ZodCatch.create = (type, params) => {
3896
3860
  return new ZodCatch({
3897
3861
  innerType: type,
3898
3862
  typeName: ZodFirstPartyTypeKind.ZodCatch,
3899
- catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
3863
+ defaultValue: typeof params.default === "function" ? params.default : () => params.default,
3900
3864
  ...processCreateParams(params)
3901
3865
  });
3902
3866
  };
@@ -4089,10 +4053,7 @@ var oboolean = /* @__PURE__ */ __name(() => booleanType().optional(), "oboolean"
4089
4053
  var coerce = {
4090
4054
  string: (arg) => ZodString.create({ ...arg, coerce: true }),
4091
4055
  number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
4092
- boolean: (arg) => ZodBoolean.create({
4093
- ...arg,
4094
- coerce: true
4095
- }),
4056
+ boolean: (arg) => ZodBoolean.create({ ...arg, coerce: true }),
4096
4057
  bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
4097
4058
  date: (arg) => ZodDate.create({ ...arg, coerce: true })
4098
4059
  };
@@ -4218,13 +4179,11 @@ var AchievementCriteriaValidator = mod.object({
4218
4179
  type: mod.string().optional(),
4219
4180
  narrative: mod.string().optional()
4220
4181
  });
4221
- var ImageValidator = mod.string().or(
4222
- mod.object({
4223
- id: mod.string(),
4224
- type: mod.string(),
4225
- caption: mod.string().optional()
4226
- })
4227
- );
4182
+ var ImageValidator = mod.string().or(mod.object({
4183
+ id: mod.string(),
4184
+ type: mod.string(),
4185
+ caption: mod.string().optional()
4186
+ }));
4228
4187
  var GeoCoordinatesValidator = mod.object({
4229
4188
  type: mod.string().min(1).or(mod.string().array().nonempty()),
4230
4189
  latitude: mod.number(),
@@ -4266,31 +4225,29 @@ var IdentifierEntryValidator = mod.object({
4266
4225
  identifier: mod.string(),
4267
4226
  identifierType: IdentifierTypeValidator
4268
4227
  });
4269
- var ProfileValidator = mod.string().or(
4270
- mod.object({
4271
- id: mod.string().optional(),
4272
- type: mod.string().or(mod.string().array().nonempty().optional()),
4273
- name: mod.string().optional(),
4274
- url: mod.string().optional(),
4275
- phone: mod.string().optional(),
4276
- description: mod.string().optional(),
4277
- endorsement: mod.any().array().optional(),
4278
- image: ImageValidator.optional(),
4279
- email: mod.string().email().optional(),
4280
- address: AddressValidator.optional(),
4281
- otherIdentifier: IdentifierEntryValidator.array().optional(),
4282
- official: mod.string().optional(),
4283
- parentOrg: mod.any().optional(),
4284
- familyName: mod.string().optional(),
4285
- givenName: mod.string().optional(),
4286
- additionalName: mod.string().optional(),
4287
- patronymicName: mod.string().optional(),
4288
- honorificPrefix: mod.string().optional(),
4289
- honorificSuffix: mod.string().optional(),
4290
- familyNamePrefix: mod.string().optional(),
4291
- dateOfBirth: mod.string().optional()
4292
- }).catchall(mod.any())
4293
- );
4228
+ var ProfileValidator = mod.string().or(mod.object({
4229
+ id: mod.string().optional(),
4230
+ type: mod.string().or(mod.string().array().nonempty().optional()),
4231
+ name: mod.string().optional(),
4232
+ url: mod.string().optional(),
4233
+ phone: mod.string().optional(),
4234
+ description: mod.string().optional(),
4235
+ endorsement: mod.any().array().optional(),
4236
+ image: ImageValidator.optional(),
4237
+ email: mod.string().email().optional(),
4238
+ address: AddressValidator.optional(),
4239
+ otherIdentifier: IdentifierEntryValidator.array().optional(),
4240
+ official: mod.string().optional(),
4241
+ parentOrg: mod.any().optional(),
4242
+ familyName: mod.string().optional(),
4243
+ givenName: mod.string().optional(),
4244
+ additionalName: mod.string().optional(),
4245
+ patronymicName: mod.string().optional(),
4246
+ honorificPrefix: mod.string().optional(),
4247
+ honorificSuffix: mod.string().optional(),
4248
+ familyNamePrefix: mod.string().optional(),
4249
+ dateOfBirth: mod.string().optional()
4250
+ }).catchall(mod.any()));
4294
4251
  var CredentialSubjectValidator = mod.object({ id: mod.string().optional() }).catchall(mod.any());
4295
4252
  var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() });
4296
4253
  var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() });
@@ -4572,11 +4529,13 @@ var JWEValidator = mod.object({
4572
4529
  aad: mod.string().optional(),
4573
4530
  recipients: JWERecipientValidator.array().optional()
4574
4531
  });
4575
- var EncryptedCredentialRecordValidator = mod.object({
4576
- encryptedRecord: JWEValidator,
4577
- fields: mod.string().array(),
4532
+ var EncryptedRecordValidator = mod.object({ encryptedRecord: JWEValidator, fields: mod.string().array() }).catchall(mod.any());
4533
+ var PaginatedEncryptedRecordsValidator = PaginationResponseValidator.extend({
4534
+ records: EncryptedRecordValidator.array()
4535
+ });
4536
+ var EncryptedCredentialRecordValidator = EncryptedRecordValidator.extend({
4578
4537
  id: mod.string()
4579
- }).catchall(mod.any());
4538
+ });
4580
4539
  var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.extend({
4581
4540
  records: EncryptedCredentialRecordValidator.array()
4582
4541
  });
@@ -5080,13 +5039,9 @@ var getVerifyBoostPlugin = /* @__PURE__ */ __name(async (learnCard, trustedBoost
5080
5039
  const boostCredential = credential?.boostCredential;
5081
5040
  try {
5082
5041
  if (boostCredential) {
5083
- const verifyBoostCredential = await learnCard.invoke.verifyCredential(
5084
- boostCredential
5085
- );
5042
+ const verifyBoostCredential = await learnCard.invoke.verifyCredential(boostCredential);
5086
5043
  if (!boostCredential?.boostId && !credential?.boostId) {
5087
- verificationCheck.warnings.push(
5088
- "Boost Authenticity could not be verified: Boost ID metadata is missing."
5089
- );
5044
+ verificationCheck.warnings.push("Boost Authenticity could not be verified: Boost ID metadata is missing.");
5090
5045
  }
5091
5046
  if (verifyBoostCredential.errors?.length > 0) {
5092
5047
  verificationCheck.errors = [
@@ -5095,21 +5050,13 @@ var getVerifyBoostPlugin = /* @__PURE__ */ __name(async (learnCard, trustedBoost
5095
5050
  "Boost Credential could not be verified."
5096
5051
  ];
5097
5052
  } else if (boostCredential?.boostId !== credential?.boostId) {
5098
- verificationCheck.errors.push(
5099
- "Boost Authenticity could not be verified: Boost ID metadata is mismatched."
5100
- );
5053
+ verificationCheck.errors.push("Boost Authenticity could not be verified: Boost ID metadata is mismatched.");
5101
5054
  } else {
5102
5055
  const trustedBoostIssuer = getTrustedBoostVerifier(credential?.issuer);
5103
5056
  if (trustedBoostIssuer) {
5104
- verificationCheck.checks.push(
5105
- `Boost is Authentic. Verified by ${trustedBoostIssuer.id}.`
5106
- );
5057
+ verificationCheck.checks.push(`Boost is Authentic. Verified by ${trustedBoostIssuer.id}.`);
5107
5058
  } else {
5108
- verificationCheck.warnings.push(
5109
- `Boost Authenticity could not be verified. Issuer is outside of trust network: ${getIssuerDID(
5110
- credential?.issuer
5111
- )}`
5112
- );
5059
+ verificationCheck.warnings.push(`Boost Authenticity could not be verified. Issuer is outside of trust network: ${getIssuerDID(credential?.issuer)}`);
5113
5060
  }
5114
5061
  }
5115
5062
  }