@learncard/vc-api-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.
- package/dist/vc-api-plugin.cjs.development.js +116 -157
- package/dist/vc-api-plugin.cjs.development.js.map +4 -4
- package/dist/vc-api-plugin.cjs.production.min.js +1 -1
- package/dist/vc-api-plugin.cjs.production.min.js.map +4 -4
- package/dist/vc-api-plugin.esm.js +116 -156
- package/dist/vc-api-plugin.esm.js.map +4 -4
- package/package.json +3 -3
|
@@ -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;
|
|
@@ -25,7 +24,7 @@ __export(src_exports, {
|
|
|
25
24
|
});
|
|
26
25
|
module.exports = __toCommonJS(src_exports);
|
|
27
26
|
|
|
28
|
-
// ../../../node_modules/.pnpm/zod@3.20.
|
|
27
|
+
// ../../../node_modules/.pnpm/zod@3.20.2/node_modules/zod/lib/index.mjs
|
|
29
28
|
var util;
|
|
30
29
|
(function(util2) {
|
|
31
30
|
util2.assertEqual = (val) => val;
|
|
@@ -456,7 +455,7 @@ var OK = /* @__PURE__ */ __name((value) => ({ status: "valid", value }), "OK");
|
|
|
456
455
|
var isAborted = /* @__PURE__ */ __name((x) => x.status === "aborted", "isAborted");
|
|
457
456
|
var isDirty = /* @__PURE__ */ __name((x) => x.status === "dirty", "isDirty");
|
|
458
457
|
var isValid = /* @__PURE__ */ __name((x) => x.status === "valid", "isValid");
|
|
459
|
-
var isAsync = /* @__PURE__ */ __name((x) => typeof Promise !==
|
|
458
|
+
var isAsync = /* @__PURE__ */ __name((x) => typeof Promise !== void 0 && x instanceof Promise, "isAsync");
|
|
460
459
|
var errorUtil;
|
|
461
460
|
(function(errorUtil2) {
|
|
462
461
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
@@ -674,29 +673,28 @@ var ZodType = class {
|
|
|
674
673
|
return this._refinement(refinement);
|
|
675
674
|
}
|
|
676
675
|
optional() {
|
|
677
|
-
return ZodOptional.create(this
|
|
676
|
+
return ZodOptional.create(this);
|
|
678
677
|
}
|
|
679
678
|
nullable() {
|
|
680
|
-
return ZodNullable.create(this
|
|
679
|
+
return ZodNullable.create(this);
|
|
681
680
|
}
|
|
682
681
|
nullish() {
|
|
683
|
-
return this.
|
|
682
|
+
return this.optional().nullable();
|
|
684
683
|
}
|
|
685
684
|
array() {
|
|
686
|
-
return ZodArray.create(this
|
|
685
|
+
return ZodArray.create(this);
|
|
687
686
|
}
|
|
688
687
|
promise() {
|
|
689
|
-
return ZodPromise.create(this
|
|
688
|
+
return ZodPromise.create(this);
|
|
690
689
|
}
|
|
691
690
|
or(option) {
|
|
692
|
-
return ZodUnion.create([this, option]
|
|
691
|
+
return ZodUnion.create([this, option]);
|
|
693
692
|
}
|
|
694
693
|
and(incoming) {
|
|
695
|
-
return ZodIntersection.create(this, incoming
|
|
694
|
+
return ZodIntersection.create(this, incoming);
|
|
696
695
|
}
|
|
697
696
|
transform(transform) {
|
|
698
697
|
return new ZodEffects({
|
|
699
|
-
...processCreateParams(this._def),
|
|
700
698
|
schema: this,
|
|
701
699
|
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
|
702
700
|
effect: { type: "transform", transform }
|
|
@@ -705,7 +703,6 @@ var ZodType = class {
|
|
|
705
703
|
default(def) {
|
|
706
704
|
const defaultValueFunc = typeof def === "function" ? def : () => def;
|
|
707
705
|
return new ZodDefault({
|
|
708
|
-
...processCreateParams(this._def),
|
|
709
706
|
innerType: this,
|
|
710
707
|
defaultValue: defaultValueFunc,
|
|
711
708
|
typeName: ZodFirstPartyTypeKind.ZodDefault
|
|
@@ -715,15 +712,14 @@ var ZodType = class {
|
|
|
715
712
|
return new ZodBranded({
|
|
716
713
|
typeName: ZodFirstPartyTypeKind.ZodBranded,
|
|
717
714
|
type: this,
|
|
718
|
-
...processCreateParams(
|
|
715
|
+
...processCreateParams(void 0)
|
|
719
716
|
});
|
|
720
717
|
}
|
|
721
718
|
catch(def) {
|
|
722
|
-
const
|
|
719
|
+
const defaultValueFunc = typeof def === "function" ? def : () => def;
|
|
723
720
|
return new ZodCatch({
|
|
724
|
-
...processCreateParams(this._def),
|
|
725
721
|
innerType: this,
|
|
726
|
-
|
|
722
|
+
defaultValue: defaultValueFunc,
|
|
727
723
|
typeName: ZodFirstPartyTypeKind.ZodCatch
|
|
728
724
|
});
|
|
729
725
|
}
|
|
@@ -746,25 +742,24 @@ var ZodType = class {
|
|
|
746
742
|
};
|
|
747
743
|
__name(ZodType, "ZodType");
|
|
748
744
|
var cuidRegex = /^c[^\s-]{8,}$/i;
|
|
749
|
-
var cuid2Regex = /^[a-z][a-z0-9]*$/;
|
|
750
745
|
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;
|
|
751
|
-
var emailRegex = /^(([^<>()[\]
|
|
746
|
+
var emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
|
|
752
747
|
var datetimeRegex = /* @__PURE__ */ __name((args) => {
|
|
753
748
|
if (args.precision) {
|
|
754
749
|
if (args.offset) {
|
|
755
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}
|
|
750
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
|
|
756
751
|
} else {
|
|
757
752
|
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
|
|
758
753
|
}
|
|
759
754
|
} else if (args.precision === 0) {
|
|
760
755
|
if (args.offset) {
|
|
761
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}
|
|
756
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
|
|
762
757
|
} else {
|
|
763
758
|
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
|
|
764
759
|
}
|
|
765
760
|
} else {
|
|
766
761
|
if (args.offset) {
|
|
767
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}
|
|
762
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
|
|
768
763
|
} else {
|
|
769
764
|
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
|
|
770
765
|
}
|
|
@@ -791,14 +786,11 @@ var ZodString = class extends ZodType {
|
|
|
791
786
|
const parsedType = this._getType(input);
|
|
792
787
|
if (parsedType !== ZodParsedType.string) {
|
|
793
788
|
const ctx2 = this._getOrReturnCtx(input);
|
|
794
|
-
addIssueToContext(
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
received: ctx2.parsedType
|
|
800
|
-
}
|
|
801
|
-
);
|
|
789
|
+
addIssueToContext(ctx2, {
|
|
790
|
+
code: ZodIssueCode.invalid_type,
|
|
791
|
+
expected: ZodParsedType.string,
|
|
792
|
+
received: ctx2.parsedType
|
|
793
|
+
});
|
|
802
794
|
return INVALID;
|
|
803
795
|
}
|
|
804
796
|
const status = new ParseStatus();
|
|
@@ -886,16 +878,6 @@ var ZodString = class extends ZodType {
|
|
|
886
878
|
});
|
|
887
879
|
status.dirty();
|
|
888
880
|
}
|
|
889
|
-
} else if (check.kind === "cuid2") {
|
|
890
|
-
if (!cuid2Regex.test(input.data)) {
|
|
891
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
|
892
|
-
addIssueToContext(ctx, {
|
|
893
|
-
validation: "cuid2",
|
|
894
|
-
code: ZodIssueCode.invalid_string,
|
|
895
|
-
message: check.message
|
|
896
|
-
});
|
|
897
|
-
status.dirty();
|
|
898
|
-
}
|
|
899
881
|
} else if (check.kind === "url") {
|
|
900
882
|
try {
|
|
901
883
|
new URL(input.data);
|
|
@@ -977,9 +959,6 @@ var ZodString = class extends ZodType {
|
|
|
977
959
|
cuid(message) {
|
|
978
960
|
return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
|
|
979
961
|
}
|
|
980
|
-
cuid2(message) {
|
|
981
|
-
return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
|
|
982
|
-
}
|
|
983
962
|
datetime(options) {
|
|
984
963
|
var _a;
|
|
985
964
|
if (typeof options === "string") {
|
|
@@ -1054,9 +1033,6 @@ var ZodString = class extends ZodType {
|
|
|
1054
1033
|
get isCUID() {
|
|
1055
1034
|
return !!this._def.checks.find((ch) => ch.kind === "cuid");
|
|
1056
1035
|
}
|
|
1057
|
-
get isCUID2() {
|
|
1058
|
-
return !!this._def.checks.find((ch) => ch.kind === "cuid2");
|
|
1059
|
-
}
|
|
1060
1036
|
get minLength() {
|
|
1061
1037
|
let min = null;
|
|
1062
1038
|
for (const ch of this._def.checks) {
|
|
@@ -1289,22 +1265,7 @@ var ZodNumber = class extends ZodType {
|
|
|
1289
1265
|
return max;
|
|
1290
1266
|
}
|
|
1291
1267
|
get isInt() {
|
|
1292
|
-
return !!this._def.checks.find((ch) => ch.kind === "int"
|
|
1293
|
-
}
|
|
1294
|
-
get isFinite() {
|
|
1295
|
-
let max = null, min = null;
|
|
1296
|
-
for (const ch of this._def.checks) {
|
|
1297
|
-
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
|
1298
|
-
return true;
|
|
1299
|
-
} else if (ch.kind === "min") {
|
|
1300
|
-
if (min === null || ch.value > min)
|
|
1301
|
-
min = ch.value;
|
|
1302
|
-
} else if (ch.kind === "max") {
|
|
1303
|
-
if (max === null || ch.value < max)
|
|
1304
|
-
max = ch.value;
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
1307
|
-
return Number.isFinite(min) && Number.isFinite(max);
|
|
1268
|
+
return !!this._def.checks.find((ch) => ch.kind === "int");
|
|
1308
1269
|
}
|
|
1309
1270
|
};
|
|
1310
1271
|
__name(ZodNumber, "ZodNumber");
|
|
@@ -1672,13 +1633,13 @@ var ZodArray = class extends ZodType {
|
|
|
1672
1633
|
}
|
|
1673
1634
|
}
|
|
1674
1635
|
if (ctx.common.async) {
|
|
1675
|
-
return Promise.all(
|
|
1636
|
+
return Promise.all(ctx.data.map((item, i) => {
|
|
1676
1637
|
return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
|
1677
1638
|
})).then((result2) => {
|
|
1678
1639
|
return ParseStatus.mergeArray(status, result2);
|
|
1679
1640
|
});
|
|
1680
1641
|
}
|
|
1681
|
-
const result =
|
|
1642
|
+
const result = ctx.data.map((item, i) => {
|
|
1682
1643
|
return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
|
1683
1644
|
});
|
|
1684
1645
|
return ParseStatus.mergeArray(status, result);
|
|
@@ -1728,6 +1689,15 @@ var objectUtil;
|
|
|
1728
1689
|
};
|
|
1729
1690
|
};
|
|
1730
1691
|
})(objectUtil || (objectUtil = {}));
|
|
1692
|
+
var AugmentFactory = /* @__PURE__ */ __name((def) => (augmentation) => {
|
|
1693
|
+
return new ZodObject({
|
|
1694
|
+
...def,
|
|
1695
|
+
shape: () => ({
|
|
1696
|
+
...def.shape(),
|
|
1697
|
+
...augmentation
|
|
1698
|
+
})
|
|
1699
|
+
});
|
|
1700
|
+
}, "AugmentFactory");
|
|
1731
1701
|
function deepPartialify(schema) {
|
|
1732
1702
|
if (schema instanceof ZodObject) {
|
|
1733
1703
|
const newShape = {};
|
|
@@ -1757,7 +1727,8 @@ var ZodObject = class extends ZodType {
|
|
|
1757
1727
|
super(...arguments);
|
|
1758
1728
|
this._cached = null;
|
|
1759
1729
|
this.nonstrict = this.passthrough;
|
|
1760
|
-
this.augment = this.
|
|
1730
|
+
this.augment = AugmentFactory(this._def);
|
|
1731
|
+
this.extend = AugmentFactory(this._def);
|
|
1761
1732
|
}
|
|
1762
1733
|
_getCached() {
|
|
1763
1734
|
if (this._cached !== null)
|
|
@@ -1825,9 +1796,7 @@ var ZodObject = class extends ZodType {
|
|
|
1825
1796
|
const value = ctx.data[key];
|
|
1826
1797
|
pairs.push({
|
|
1827
1798
|
key: { status: "valid", value: key },
|
|
1828
|
-
value: catchall._parse(
|
|
1829
|
-
new ParseInputLazyPath(ctx, value, ctx.path, key)
|
|
1830
|
-
),
|
|
1799
|
+
value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
|
|
1831
1800
|
alwaysSet: key in ctx.data
|
|
1832
1801
|
});
|
|
1833
1802
|
}
|
|
@@ -1886,14 +1855,8 @@ var ZodObject = class extends ZodType {
|
|
|
1886
1855
|
unknownKeys: "passthrough"
|
|
1887
1856
|
});
|
|
1888
1857
|
}
|
|
1889
|
-
|
|
1890
|
-
return
|
|
1891
|
-
...this._def,
|
|
1892
|
-
shape: () => ({
|
|
1893
|
-
...this._def.shape(),
|
|
1894
|
-
...augmentation
|
|
1895
|
-
})
|
|
1896
|
-
});
|
|
1858
|
+
setKey(key, schema) {
|
|
1859
|
+
return this.augment({ [key]: schema });
|
|
1897
1860
|
}
|
|
1898
1861
|
merge(merging) {
|
|
1899
1862
|
const merged = new ZodObject({
|
|
@@ -1904,9 +1867,6 @@ var ZodObject = class extends ZodType {
|
|
|
1904
1867
|
});
|
|
1905
1868
|
return merged;
|
|
1906
1869
|
}
|
|
1907
|
-
setKey(key, schema) {
|
|
1908
|
-
return this.augment({ [key]: schema });
|
|
1909
|
-
}
|
|
1910
1870
|
catchall(index) {
|
|
1911
1871
|
return new ZodObject({
|
|
1912
1872
|
...this._def,
|
|
@@ -1915,10 +1875,9 @@ var ZodObject = class extends ZodType {
|
|
|
1915
1875
|
}
|
|
1916
1876
|
pick(mask) {
|
|
1917
1877
|
const shape = {};
|
|
1918
|
-
util.objectKeys(mask).
|
|
1919
|
-
if (
|
|
1878
|
+
util.objectKeys(mask).map((key) => {
|
|
1879
|
+
if (this.shape[key])
|
|
1920
1880
|
shape[key] = this.shape[key];
|
|
1921
|
-
}
|
|
1922
1881
|
});
|
|
1923
1882
|
return new ZodObject({
|
|
1924
1883
|
...this._def,
|
|
@@ -1927,8 +1886,8 @@ var ZodObject = class extends ZodType {
|
|
|
1927
1886
|
}
|
|
1928
1887
|
omit(mask) {
|
|
1929
1888
|
const shape = {};
|
|
1930
|
-
util.objectKeys(this.shape).
|
|
1931
|
-
if (
|
|
1889
|
+
util.objectKeys(this.shape).map((key) => {
|
|
1890
|
+
if (util.objectKeys(mask).indexOf(key) === -1) {
|
|
1932
1891
|
shape[key] = this.shape[key];
|
|
1933
1892
|
}
|
|
1934
1893
|
});
|
|
@@ -1942,14 +1901,24 @@ var ZodObject = class extends ZodType {
|
|
|
1942
1901
|
}
|
|
1943
1902
|
partial(mask) {
|
|
1944
1903
|
const newShape = {};
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1904
|
+
if (mask) {
|
|
1905
|
+
util.objectKeys(this.shape).map((key) => {
|
|
1906
|
+
if (util.objectKeys(mask).indexOf(key) === -1) {
|
|
1907
|
+
newShape[key] = this.shape[key];
|
|
1908
|
+
} else {
|
|
1909
|
+
newShape[key] = this.shape[key].optional();
|
|
1910
|
+
}
|
|
1911
|
+
});
|
|
1912
|
+
return new ZodObject({
|
|
1913
|
+
...this._def,
|
|
1914
|
+
shape: () => newShape
|
|
1915
|
+
});
|
|
1916
|
+
} else {
|
|
1917
|
+
for (const key in this.shape) {
|
|
1918
|
+
const fieldSchema = this.shape[key];
|
|
1950
1919
|
newShape[key] = fieldSchema.optional();
|
|
1951
1920
|
}
|
|
1952
|
-
}
|
|
1921
|
+
}
|
|
1953
1922
|
return new ZodObject({
|
|
1954
1923
|
...this._def,
|
|
1955
1924
|
shape: () => newShape
|
|
@@ -1957,10 +1926,21 @@ var ZodObject = class extends ZodType {
|
|
|
1957
1926
|
}
|
|
1958
1927
|
required(mask) {
|
|
1959
1928
|
const newShape = {};
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1929
|
+
if (mask) {
|
|
1930
|
+
util.objectKeys(this.shape).map((key) => {
|
|
1931
|
+
if (util.objectKeys(mask).indexOf(key) === -1) {
|
|
1932
|
+
newShape[key] = this.shape[key];
|
|
1933
|
+
} else {
|
|
1934
|
+
const fieldSchema = this.shape[key];
|
|
1935
|
+
let newField = fieldSchema;
|
|
1936
|
+
while (newField instanceof ZodOptional) {
|
|
1937
|
+
newField = newField._def.innerType;
|
|
1938
|
+
}
|
|
1939
|
+
newShape[key] = newField;
|
|
1940
|
+
}
|
|
1941
|
+
});
|
|
1942
|
+
} else {
|
|
1943
|
+
for (const key in this.shape) {
|
|
1964
1944
|
const fieldSchema = this.shape[key];
|
|
1965
1945
|
let newField = fieldSchema;
|
|
1966
1946
|
while (newField instanceof ZodOptional) {
|
|
@@ -1968,7 +1948,7 @@ var ZodObject = class extends ZodType {
|
|
|
1968
1948
|
}
|
|
1969
1949
|
newShape[key] = newField;
|
|
1970
1950
|
}
|
|
1971
|
-
}
|
|
1951
|
+
}
|
|
1972
1952
|
return new ZodObject({
|
|
1973
1953
|
...this._def,
|
|
1974
1954
|
shape: () => newShape
|
|
@@ -2314,7 +2294,7 @@ var ZodTuple = class extends ZodType {
|
|
|
2314
2294
|
});
|
|
2315
2295
|
status.dirty();
|
|
2316
2296
|
}
|
|
2317
|
-
const items =
|
|
2297
|
+
const items = ctx.data.map((item, itemIndex) => {
|
|
2318
2298
|
const schema = this._def.items[itemIndex] || this._def.rest;
|
|
2319
2299
|
if (!schema)
|
|
2320
2300
|
return null;
|
|
@@ -2690,7 +2670,6 @@ var ZodLiteral = class extends ZodType {
|
|
|
2690
2670
|
if (input.data !== this._def.value) {
|
|
2691
2671
|
const ctx = this._getOrReturnCtx(input);
|
|
2692
2672
|
addIssueToContext(ctx, {
|
|
2693
|
-
received: ctx.data,
|
|
2694
2673
|
code: ZodIssueCode.invalid_literal,
|
|
2695
2674
|
expected: this._def.value
|
|
2696
2675
|
});
|
|
@@ -2766,12 +2745,6 @@ var ZodEnum = class extends ZodType {
|
|
|
2766
2745
|
}
|
|
2767
2746
|
return enumValues;
|
|
2768
2747
|
}
|
|
2769
|
-
extract(values) {
|
|
2770
|
-
return ZodEnum.create(values);
|
|
2771
|
-
}
|
|
2772
|
-
exclude(values) {
|
|
2773
|
-
return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));
|
|
2774
|
-
}
|
|
2775
2748
|
};
|
|
2776
2749
|
__name(ZodEnum, "ZodEnum");
|
|
2777
2750
|
ZodEnum.create = createZodEnum;
|
|
@@ -2812,9 +2785,6 @@ ZodNativeEnum.create = (values, params) => {
|
|
|
2812
2785
|
});
|
|
2813
2786
|
};
|
|
2814
2787
|
var ZodPromise = class extends ZodType {
|
|
2815
|
-
unwrap() {
|
|
2816
|
-
return this._def.type;
|
|
2817
|
-
}
|
|
2818
2788
|
_parse(input) {
|
|
2819
2789
|
const { ctx } = this._processInputParams(input);
|
|
2820
2790
|
if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
|
|
@@ -3033,29 +3003,23 @@ var ZodCatch = class extends ZodType {
|
|
|
3033
3003
|
const result = this._def.innerType._parse({
|
|
3034
3004
|
data: ctx.data,
|
|
3035
3005
|
path: ctx.path,
|
|
3036
|
-
parent:
|
|
3037
|
-
...ctx,
|
|
3038
|
-
common: {
|
|
3039
|
-
...ctx.common,
|
|
3040
|
-
issues: []
|
|
3041
|
-
}
|
|
3042
|
-
}
|
|
3006
|
+
parent: ctx
|
|
3043
3007
|
});
|
|
3044
3008
|
if (isAsync(result)) {
|
|
3045
3009
|
return result.then((result2) => {
|
|
3046
3010
|
return {
|
|
3047
3011
|
status: "valid",
|
|
3048
|
-
value: result2.status === "valid" ? result2.value : this._def.
|
|
3012
|
+
value: result2.status === "valid" ? result2.value : this._def.defaultValue()
|
|
3049
3013
|
};
|
|
3050
3014
|
});
|
|
3051
3015
|
} else {
|
|
3052
3016
|
return {
|
|
3053
3017
|
status: "valid",
|
|
3054
|
-
value: result.status === "valid" ? result.value : this._def.
|
|
3018
|
+
value: result.status === "valid" ? result.value : this._def.defaultValue()
|
|
3055
3019
|
};
|
|
3056
3020
|
}
|
|
3057
3021
|
}
|
|
3058
|
-
|
|
3022
|
+
removeDefault() {
|
|
3059
3023
|
return this._def.innerType;
|
|
3060
3024
|
}
|
|
3061
3025
|
};
|
|
@@ -3064,7 +3028,7 @@ ZodCatch.create = (type, params) => {
|
|
|
3064
3028
|
return new ZodCatch({
|
|
3065
3029
|
innerType: type,
|
|
3066
3030
|
typeName: ZodFirstPartyTypeKind.ZodCatch,
|
|
3067
|
-
|
|
3031
|
+
defaultValue: typeof params.default === "function" ? params.default : () => params.default,
|
|
3068
3032
|
...processCreateParams(params)
|
|
3069
3033
|
});
|
|
3070
3034
|
};
|
|
@@ -3257,10 +3221,7 @@ var oboolean = /* @__PURE__ */ __name(() => booleanType().optional(), "oboolean"
|
|
|
3257
3221
|
var coerce = {
|
|
3258
3222
|
string: (arg) => ZodString.create({ ...arg, coerce: true }),
|
|
3259
3223
|
number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
|
|
3260
|
-
boolean: (arg) => ZodBoolean.create({
|
|
3261
|
-
...arg,
|
|
3262
|
-
coerce: true
|
|
3263
|
-
}),
|
|
3224
|
+
boolean: (arg) => ZodBoolean.create({ ...arg, coerce: true }),
|
|
3264
3225
|
bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
|
|
3265
3226
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
3266
3227
|
};
|
|
@@ -3386,13 +3347,11 @@ var AchievementCriteriaValidator = mod.object({
|
|
|
3386
3347
|
type: mod.string().optional(),
|
|
3387
3348
|
narrative: mod.string().optional()
|
|
3388
3349
|
});
|
|
3389
|
-
var ImageValidator = mod.string().or(
|
|
3390
|
-
mod.
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
})
|
|
3395
|
-
);
|
|
3350
|
+
var ImageValidator = mod.string().or(mod.object({
|
|
3351
|
+
id: mod.string(),
|
|
3352
|
+
type: mod.string(),
|
|
3353
|
+
caption: mod.string().optional()
|
|
3354
|
+
}));
|
|
3396
3355
|
var GeoCoordinatesValidator = mod.object({
|
|
3397
3356
|
type: mod.string().min(1).or(mod.string().array().nonempty()),
|
|
3398
3357
|
latitude: mod.number(),
|
|
@@ -3434,31 +3393,29 @@ var IdentifierEntryValidator = mod.object({
|
|
|
3434
3393
|
identifier: mod.string(),
|
|
3435
3394
|
identifierType: IdentifierTypeValidator
|
|
3436
3395
|
});
|
|
3437
|
-
var ProfileValidator = mod.string().or(
|
|
3438
|
-
mod.
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
}).catchall(mod.any())
|
|
3461
|
-
);
|
|
3396
|
+
var ProfileValidator = mod.string().or(mod.object({
|
|
3397
|
+
id: mod.string().optional(),
|
|
3398
|
+
type: mod.string().or(mod.string().array().nonempty().optional()),
|
|
3399
|
+
name: mod.string().optional(),
|
|
3400
|
+
url: mod.string().optional(),
|
|
3401
|
+
phone: mod.string().optional(),
|
|
3402
|
+
description: mod.string().optional(),
|
|
3403
|
+
endorsement: mod.any().array().optional(),
|
|
3404
|
+
image: ImageValidator.optional(),
|
|
3405
|
+
email: mod.string().email().optional(),
|
|
3406
|
+
address: AddressValidator.optional(),
|
|
3407
|
+
otherIdentifier: IdentifierEntryValidator.array().optional(),
|
|
3408
|
+
official: mod.string().optional(),
|
|
3409
|
+
parentOrg: mod.any().optional(),
|
|
3410
|
+
familyName: mod.string().optional(),
|
|
3411
|
+
givenName: mod.string().optional(),
|
|
3412
|
+
additionalName: mod.string().optional(),
|
|
3413
|
+
patronymicName: mod.string().optional(),
|
|
3414
|
+
honorificPrefix: mod.string().optional(),
|
|
3415
|
+
honorificSuffix: mod.string().optional(),
|
|
3416
|
+
familyNamePrefix: mod.string().optional(),
|
|
3417
|
+
dateOfBirth: mod.string().optional()
|
|
3418
|
+
}).catchall(mod.any()));
|
|
3462
3419
|
var CredentialSubjectValidator = mod.object({ id: mod.string().optional() }).catchall(mod.any());
|
|
3463
3420
|
var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() });
|
|
3464
3421
|
var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() });
|
|
@@ -3740,11 +3697,13 @@ var JWEValidator = mod.object({
|
|
|
3740
3697
|
aad: mod.string().optional(),
|
|
3741
3698
|
recipients: JWERecipientValidator.array().optional()
|
|
3742
3699
|
});
|
|
3743
|
-
var
|
|
3744
|
-
|
|
3745
|
-
|
|
3700
|
+
var EncryptedRecordValidator = mod.object({ encryptedRecord: JWEValidator, fields: mod.string().array() }).catchall(mod.any());
|
|
3701
|
+
var PaginatedEncryptedRecordsValidator = PaginationResponseValidator.extend({
|
|
3702
|
+
records: EncryptedRecordValidator.array()
|
|
3703
|
+
});
|
|
3704
|
+
var EncryptedCredentialRecordValidator = EncryptedRecordValidator.extend({
|
|
3746
3705
|
id: mod.string()
|
|
3747
|
-
})
|
|
3706
|
+
});
|
|
3748
3707
|
var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.extend({
|
|
3749
3708
|
records: EncryptedCredentialRecordValidator.array()
|
|
3750
3709
|
});
|
|
@@ -3781,7 +3740,7 @@ var BoostValidator = mod.object({
|
|
|
3781
3740
|
var BoostRecipientValidator = mod.object({
|
|
3782
3741
|
to: LCNProfileValidator,
|
|
3783
3742
|
from: mod.string(),
|
|
3784
|
-
received: mod.string()
|
|
3743
|
+
received: mod.string().optional()
|
|
3785
3744
|
});
|
|
3786
3745
|
var LCNNotificationTypeEnumValidator = mod.enum([
|
|
3787
3746
|
"CONNECTION_REQUEST",
|