@learncard/helpers 1.0.5 → 1.0.7
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/helpers.cjs.development.js +118 -159
- package/dist/helpers.cjs.development.js.map +3 -3
- package/dist/helpers.cjs.production.min.js +1 -1
- package/dist/helpers.cjs.production.min.js.map +3 -3
- package/dist/helpers.d.ts +1 -1
- package/dist/helpers.esm.js +118 -159
- package/dist/helpers.esm.js.map +3 -3
- package/package.json +3 -4
@@ -20,10 +20,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
20
20
|
}
|
21
21
|
return to;
|
22
22
|
};
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
25
|
-
mod
|
26
|
-
));
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
27
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
28
25
|
|
29
26
|
// ../learn-card-types/dist/types.cjs.development.js
|
@@ -68,6 +65,7 @@ var require_types_cjs_development = __commonJS({
|
|
68
65
|
CredentialSubjectValidator: () => CredentialSubjectValidator,
|
69
66
|
CriteriaValidator: () => CriteriaValidator,
|
70
67
|
EncryptedCredentialRecordValidator: () => EncryptedCredentialRecordValidator,
|
68
|
+
EncryptedRecordValidator: () => EncryptedRecordValidator,
|
71
69
|
EndorsementCredentialValidator: () => EndorsementCredentialValidator,
|
72
70
|
EndorsementSubjectValidator: () => EndorsementSubjectValidator,
|
73
71
|
EvidenceValidator: () => EvidenceValidator,
|
@@ -93,6 +91,7 @@ var require_types_cjs_development = __commonJS({
|
|
93
91
|
LCNSigningAuthorityForUserValidator: () => LCNSigningAuthorityForUserValidator,
|
94
92
|
LCNSigningAuthorityValidator: () => LCNSigningAuthorityValidator,
|
95
93
|
PaginatedEncryptedCredentialRecordsValidator: () => PaginatedEncryptedCredentialRecordsValidator,
|
94
|
+
PaginatedEncryptedRecordsValidator: () => PaginatedEncryptedRecordsValidator,
|
96
95
|
PaginationOptionsValidator: () => PaginationOptionsValidator,
|
97
96
|
PaginationResponseValidator: () => PaginationResponseValidator,
|
98
97
|
ProfileValidator: () => ProfileValidator,
|
@@ -552,7 +551,7 @@ var require_types_cjs_development = __commonJS({
|
|
552
551
|
var isAborted = /* @__PURE__ */ __name2((x) => x.status === "aborted", "isAborted");
|
553
552
|
var isDirty = /* @__PURE__ */ __name2((x) => x.status === "dirty", "isDirty");
|
554
553
|
var isValid = /* @__PURE__ */ __name2((x) => x.status === "valid", "isValid");
|
555
|
-
var isAsync = /* @__PURE__ */ __name2((x) => typeof Promise !==
|
554
|
+
var isAsync = /* @__PURE__ */ __name2((x) => typeof Promise !== void 0 && x instanceof Promise, "isAsync");
|
556
555
|
var errorUtil;
|
557
556
|
(function(errorUtil2) {
|
558
557
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
@@ -771,29 +770,28 @@ var require_types_cjs_development = __commonJS({
|
|
771
770
|
return this._refinement(refinement);
|
772
771
|
}
|
773
772
|
optional() {
|
774
|
-
return ZodOptional.create(this
|
773
|
+
return ZodOptional.create(this);
|
775
774
|
}
|
776
775
|
nullable() {
|
777
|
-
return ZodNullable.create(this
|
776
|
+
return ZodNullable.create(this);
|
778
777
|
}
|
779
778
|
nullish() {
|
780
|
-
return this.
|
779
|
+
return this.optional().nullable();
|
781
780
|
}
|
782
781
|
array() {
|
783
|
-
return ZodArray.create(this
|
782
|
+
return ZodArray.create(this);
|
784
783
|
}
|
785
784
|
promise() {
|
786
|
-
return ZodPromise.create(this
|
785
|
+
return ZodPromise.create(this);
|
787
786
|
}
|
788
787
|
or(option) {
|
789
|
-
return ZodUnion.create([this, option]
|
788
|
+
return ZodUnion.create([this, option]);
|
790
789
|
}
|
791
790
|
and(incoming) {
|
792
|
-
return ZodIntersection.create(this, incoming
|
791
|
+
return ZodIntersection.create(this, incoming);
|
793
792
|
}
|
794
793
|
transform(transform) {
|
795
794
|
return new ZodEffects({
|
796
|
-
...processCreateParams(this._def),
|
797
795
|
schema: this,
|
798
796
|
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
799
797
|
effect: { type: "transform", transform }
|
@@ -802,7 +800,6 @@ var require_types_cjs_development = __commonJS({
|
|
802
800
|
default(def) {
|
803
801
|
const defaultValueFunc = typeof def === "function" ? def : () => def;
|
804
802
|
return new ZodDefault({
|
805
|
-
...processCreateParams(this._def),
|
806
803
|
innerType: this,
|
807
804
|
defaultValue: defaultValueFunc,
|
808
805
|
typeName: ZodFirstPartyTypeKind.ZodDefault
|
@@ -812,15 +809,14 @@ var require_types_cjs_development = __commonJS({
|
|
812
809
|
return new ZodBranded({
|
813
810
|
typeName: ZodFirstPartyTypeKind.ZodBranded,
|
814
811
|
type: this,
|
815
|
-
...processCreateParams(
|
812
|
+
...processCreateParams(void 0)
|
816
813
|
});
|
817
814
|
}
|
818
815
|
catch(def) {
|
819
|
-
const
|
816
|
+
const defaultValueFunc = typeof def === "function" ? def : () => def;
|
820
817
|
return new ZodCatch({
|
821
|
-
...processCreateParams(this._def),
|
822
818
|
innerType: this,
|
823
|
-
|
819
|
+
defaultValue: defaultValueFunc,
|
824
820
|
typeName: ZodFirstPartyTypeKind.ZodCatch
|
825
821
|
});
|
826
822
|
}
|
@@ -843,25 +839,24 @@ var require_types_cjs_development = __commonJS({
|
|
843
839
|
}, "ZodType");
|
844
840
|
__name2(ZodType, "ZodType");
|
845
841
|
var cuidRegex = /^c[^\s-]{8,}$/i;
|
846
|
-
var cuid2Regex = /^[a-z][a-z0-9]*$/;
|
847
842
|
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;
|
848
|
-
var emailRegex = /^(([^<>()[\]
|
843
|
+
var emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
|
849
844
|
var datetimeRegex = /* @__PURE__ */ __name2((args) => {
|
850
845
|
if (args.precision) {
|
851
846
|
if (args.offset) {
|
852
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}
|
847
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
|
853
848
|
} else {
|
854
849
|
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
|
855
850
|
}
|
856
851
|
} else if (args.precision === 0) {
|
857
852
|
if (args.offset) {
|
858
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}
|
853
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
|
859
854
|
} else {
|
860
855
|
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
|
861
856
|
}
|
862
857
|
} else {
|
863
858
|
if (args.offset) {
|
864
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}
|
859
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
|
865
860
|
} else {
|
866
861
|
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
|
867
862
|
}
|
@@ -888,14 +883,11 @@ var require_types_cjs_development = __commonJS({
|
|
888
883
|
const parsedType = this._getType(input);
|
889
884
|
if (parsedType !== ZodParsedType.string) {
|
890
885
|
const ctx2 = this._getOrReturnCtx(input);
|
891
|
-
addIssueToContext(
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
received: ctx2.parsedType
|
897
|
-
}
|
898
|
-
);
|
886
|
+
addIssueToContext(ctx2, {
|
887
|
+
code: ZodIssueCode.invalid_type,
|
888
|
+
expected: ZodParsedType.string,
|
889
|
+
received: ctx2.parsedType
|
890
|
+
});
|
899
891
|
return INVALID;
|
900
892
|
}
|
901
893
|
const status = new ParseStatus();
|
@@ -983,16 +975,6 @@ var require_types_cjs_development = __commonJS({
|
|
983
975
|
});
|
984
976
|
status.dirty();
|
985
977
|
}
|
986
|
-
} else if (check.kind === "cuid2") {
|
987
|
-
if (!cuid2Regex.test(input.data)) {
|
988
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
989
|
-
addIssueToContext(ctx, {
|
990
|
-
validation: "cuid2",
|
991
|
-
code: ZodIssueCode.invalid_string,
|
992
|
-
message: check.message
|
993
|
-
});
|
994
|
-
status.dirty();
|
995
|
-
}
|
996
978
|
} else if (check.kind === "url") {
|
997
979
|
try {
|
998
980
|
new URL(input.data);
|
@@ -1074,9 +1056,6 @@ var require_types_cjs_development = __commonJS({
|
|
1074
1056
|
cuid(message) {
|
1075
1057
|
return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
|
1076
1058
|
}
|
1077
|
-
cuid2(message) {
|
1078
|
-
return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
|
1079
|
-
}
|
1080
1059
|
datetime(options) {
|
1081
1060
|
var _a;
|
1082
1061
|
if (typeof options === "string") {
|
@@ -1151,9 +1130,6 @@ var require_types_cjs_development = __commonJS({
|
|
1151
1130
|
get isCUID() {
|
1152
1131
|
return !!this._def.checks.find((ch) => ch.kind === "cuid");
|
1153
1132
|
}
|
1154
|
-
get isCUID2() {
|
1155
|
-
return !!this._def.checks.find((ch) => ch.kind === "cuid2");
|
1156
|
-
}
|
1157
1133
|
get minLength() {
|
1158
1134
|
let min = null;
|
1159
1135
|
for (const ch of this._def.checks) {
|
@@ -1387,22 +1363,7 @@ var require_types_cjs_development = __commonJS({
|
|
1387
1363
|
return max;
|
1388
1364
|
}
|
1389
1365
|
get isInt() {
|
1390
|
-
return !!this._def.checks.find((ch) => ch.kind === "int"
|
1391
|
-
}
|
1392
|
-
get isFinite() {
|
1393
|
-
let max = null, min = null;
|
1394
|
-
for (const ch of this._def.checks) {
|
1395
|
-
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
1396
|
-
return true;
|
1397
|
-
} else if (ch.kind === "min") {
|
1398
|
-
if (min === null || ch.value > min)
|
1399
|
-
min = ch.value;
|
1400
|
-
} else if (ch.kind === "max") {
|
1401
|
-
if (max === null || ch.value < max)
|
1402
|
-
max = ch.value;
|
1403
|
-
}
|
1404
|
-
}
|
1405
|
-
return Number.isFinite(min) && Number.isFinite(max);
|
1366
|
+
return !!this._def.checks.find((ch) => ch.kind === "int");
|
1406
1367
|
}
|
1407
1368
|
}, "ZodNumber");
|
1408
1369
|
__name2(ZodNumber, "ZodNumber");
|
@@ -1770,13 +1731,13 @@ var require_types_cjs_development = __commonJS({
|
|
1770
1731
|
}
|
1771
1732
|
}
|
1772
1733
|
if (ctx.common.async) {
|
1773
|
-
return Promise.all(
|
1734
|
+
return Promise.all(ctx.data.map((item, i) => {
|
1774
1735
|
return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
1775
1736
|
})).then((result2) => {
|
1776
1737
|
return ParseStatus.mergeArray(status, result2);
|
1777
1738
|
});
|
1778
1739
|
}
|
1779
|
-
const result =
|
1740
|
+
const result = ctx.data.map((item, i) => {
|
1780
1741
|
return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
1781
1742
|
});
|
1782
1743
|
return ParseStatus.mergeArray(status, result);
|
@@ -1826,6 +1787,15 @@ var require_types_cjs_development = __commonJS({
|
|
1826
1787
|
};
|
1827
1788
|
};
|
1828
1789
|
})(objectUtil || (objectUtil = {}));
|
1790
|
+
var AugmentFactory = /* @__PURE__ */ __name2((def) => (augmentation) => {
|
1791
|
+
return new ZodObject({
|
1792
|
+
...def,
|
1793
|
+
shape: () => ({
|
1794
|
+
...def.shape(),
|
1795
|
+
...augmentation
|
1796
|
+
})
|
1797
|
+
});
|
1798
|
+
}, "AugmentFactory");
|
1829
1799
|
function deepPartialify(schema) {
|
1830
1800
|
if (schema instanceof ZodObject) {
|
1831
1801
|
const newShape = {};
|
@@ -1856,7 +1826,8 @@ var require_types_cjs_development = __commonJS({
|
|
1856
1826
|
super(...arguments);
|
1857
1827
|
this._cached = null;
|
1858
1828
|
this.nonstrict = this.passthrough;
|
1859
|
-
this.augment = this.
|
1829
|
+
this.augment = AugmentFactory(this._def);
|
1830
|
+
this.extend = AugmentFactory(this._def);
|
1860
1831
|
}
|
1861
1832
|
_getCached() {
|
1862
1833
|
if (this._cached !== null)
|
@@ -1924,9 +1895,7 @@ var require_types_cjs_development = __commonJS({
|
|
1924
1895
|
const value = ctx.data[key];
|
1925
1896
|
pairs.push({
|
1926
1897
|
key: { status: "valid", value: key },
|
1927
|
-
value: catchall._parse(
|
1928
|
-
new ParseInputLazyPath(ctx, value, ctx.path, key)
|
1929
|
-
),
|
1898
|
+
value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
|
1930
1899
|
alwaysSet: key in ctx.data
|
1931
1900
|
});
|
1932
1901
|
}
|
@@ -1985,14 +1954,8 @@ var require_types_cjs_development = __commonJS({
|
|
1985
1954
|
unknownKeys: "passthrough"
|
1986
1955
|
});
|
1987
1956
|
}
|
1988
|
-
|
1989
|
-
return
|
1990
|
-
...this._def,
|
1991
|
-
shape: () => ({
|
1992
|
-
...this._def.shape(),
|
1993
|
-
...augmentation
|
1994
|
-
})
|
1995
|
-
});
|
1957
|
+
setKey(key, schema) {
|
1958
|
+
return this.augment({ [key]: schema });
|
1996
1959
|
}
|
1997
1960
|
merge(merging) {
|
1998
1961
|
const merged = new ZodObject({
|
@@ -2003,9 +1966,6 @@ var require_types_cjs_development = __commonJS({
|
|
2003
1966
|
});
|
2004
1967
|
return merged;
|
2005
1968
|
}
|
2006
|
-
setKey(key, schema) {
|
2007
|
-
return this.augment({ [key]: schema });
|
2008
|
-
}
|
2009
1969
|
catchall(index) {
|
2010
1970
|
return new ZodObject({
|
2011
1971
|
...this._def,
|
@@ -2014,10 +1974,9 @@ var require_types_cjs_development = __commonJS({
|
|
2014
1974
|
}
|
2015
1975
|
pick(mask) {
|
2016
1976
|
const shape = {};
|
2017
|
-
util.objectKeys(mask).
|
2018
|
-
if (
|
1977
|
+
util.objectKeys(mask).map((key) => {
|
1978
|
+
if (this.shape[key])
|
2019
1979
|
shape[key] = this.shape[key];
|
2020
|
-
}
|
2021
1980
|
});
|
2022
1981
|
return new ZodObject({
|
2023
1982
|
...this._def,
|
@@ -2026,8 +1985,8 @@ var require_types_cjs_development = __commonJS({
|
|
2026
1985
|
}
|
2027
1986
|
omit(mask) {
|
2028
1987
|
const shape = {};
|
2029
|
-
util.objectKeys(this.shape).
|
2030
|
-
if (
|
1988
|
+
util.objectKeys(this.shape).map((key) => {
|
1989
|
+
if (util.objectKeys(mask).indexOf(key) === -1) {
|
2031
1990
|
shape[key] = this.shape[key];
|
2032
1991
|
}
|
2033
1992
|
});
|
@@ -2041,14 +2000,24 @@ var require_types_cjs_development = __commonJS({
|
|
2041
2000
|
}
|
2042
2001
|
partial(mask) {
|
2043
2002
|
const newShape = {};
|
2044
|
-
|
2045
|
-
|
2046
|
-
|
2047
|
-
|
2048
|
-
|
2003
|
+
if (mask) {
|
2004
|
+
util.objectKeys(this.shape).map((key) => {
|
2005
|
+
if (util.objectKeys(mask).indexOf(key) === -1) {
|
2006
|
+
newShape[key] = this.shape[key];
|
2007
|
+
} else {
|
2008
|
+
newShape[key] = this.shape[key].optional();
|
2009
|
+
}
|
2010
|
+
});
|
2011
|
+
return new ZodObject({
|
2012
|
+
...this._def,
|
2013
|
+
shape: () => newShape
|
2014
|
+
});
|
2015
|
+
} else {
|
2016
|
+
for (const key in this.shape) {
|
2017
|
+
const fieldSchema = this.shape[key];
|
2049
2018
|
newShape[key] = fieldSchema.optional();
|
2050
2019
|
}
|
2051
|
-
}
|
2020
|
+
}
|
2052
2021
|
return new ZodObject({
|
2053
2022
|
...this._def,
|
2054
2023
|
shape: () => newShape
|
@@ -2056,10 +2025,21 @@ var require_types_cjs_development = __commonJS({
|
|
2056
2025
|
}
|
2057
2026
|
required(mask) {
|
2058
2027
|
const newShape = {};
|
2059
|
-
|
2060
|
-
|
2061
|
-
|
2062
|
-
|
2028
|
+
if (mask) {
|
2029
|
+
util.objectKeys(this.shape).map((key) => {
|
2030
|
+
if (util.objectKeys(mask).indexOf(key) === -1) {
|
2031
|
+
newShape[key] = this.shape[key];
|
2032
|
+
} else {
|
2033
|
+
const fieldSchema = this.shape[key];
|
2034
|
+
let newField = fieldSchema;
|
2035
|
+
while (newField instanceof ZodOptional) {
|
2036
|
+
newField = newField._def.innerType;
|
2037
|
+
}
|
2038
|
+
newShape[key] = newField;
|
2039
|
+
}
|
2040
|
+
});
|
2041
|
+
} else {
|
2042
|
+
for (const key in this.shape) {
|
2063
2043
|
const fieldSchema = this.shape[key];
|
2064
2044
|
let newField = fieldSchema;
|
2065
2045
|
while (newField instanceof ZodOptional) {
|
@@ -2067,7 +2047,7 @@ var require_types_cjs_development = __commonJS({
|
|
2067
2047
|
}
|
2068
2048
|
newShape[key] = newField;
|
2069
2049
|
}
|
2070
|
-
}
|
2050
|
+
}
|
2071
2051
|
return new ZodObject({
|
2072
2052
|
...this._def,
|
2073
2053
|
shape: () => newShape
|
@@ -2415,7 +2395,7 @@ var require_types_cjs_development = __commonJS({
|
|
2415
2395
|
});
|
2416
2396
|
status.dirty();
|
2417
2397
|
}
|
2418
|
-
const items =
|
2398
|
+
const items = ctx.data.map((item, itemIndex) => {
|
2419
2399
|
const schema = this._def.items[itemIndex] || this._def.rest;
|
2420
2400
|
if (!schema)
|
2421
2401
|
return null;
|
@@ -2794,7 +2774,6 @@ var require_types_cjs_development = __commonJS({
|
|
2794
2774
|
if (input.data !== this._def.value) {
|
2795
2775
|
const ctx = this._getOrReturnCtx(input);
|
2796
2776
|
addIssueToContext(ctx, {
|
2797
|
-
received: ctx.data,
|
2798
2777
|
code: ZodIssueCode.invalid_literal,
|
2799
2778
|
expected: this._def.value
|
2800
2779
|
});
|
@@ -2871,12 +2850,6 @@ var require_types_cjs_development = __commonJS({
|
|
2871
2850
|
}
|
2872
2851
|
return enumValues;
|
2873
2852
|
}
|
2874
|
-
extract(values) {
|
2875
|
-
return ZodEnum.create(values);
|
2876
|
-
}
|
2877
|
-
exclude(values) {
|
2878
|
-
return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));
|
2879
|
-
}
|
2880
2853
|
}, "ZodEnum");
|
2881
2854
|
__name2(ZodEnum, "ZodEnum");
|
2882
2855
|
ZodEnum.create = createZodEnum;
|
@@ -2917,9 +2890,6 @@ var require_types_cjs_development = __commonJS({
|
|
2917
2890
|
});
|
2918
2891
|
};
|
2919
2892
|
var ZodPromise = /* @__PURE__ */ __name(class extends ZodType {
|
2920
|
-
unwrap() {
|
2921
|
-
return this._def.type;
|
2922
|
-
}
|
2923
2893
|
_parse(input) {
|
2924
2894
|
const { ctx } = this._processInputParams(input);
|
2925
2895
|
if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
|
@@ -3138,29 +3108,23 @@ var require_types_cjs_development = __commonJS({
|
|
3138
3108
|
const result = this._def.innerType._parse({
|
3139
3109
|
data: ctx.data,
|
3140
3110
|
path: ctx.path,
|
3141
|
-
parent:
|
3142
|
-
...ctx,
|
3143
|
-
common: {
|
3144
|
-
...ctx.common,
|
3145
|
-
issues: []
|
3146
|
-
}
|
3147
|
-
}
|
3111
|
+
parent: ctx
|
3148
3112
|
});
|
3149
3113
|
if (isAsync(result)) {
|
3150
3114
|
return result.then((result2) => {
|
3151
3115
|
return {
|
3152
3116
|
status: "valid",
|
3153
|
-
value: result2.status === "valid" ? result2.value : this._def.
|
3117
|
+
value: result2.status === "valid" ? result2.value : this._def.defaultValue()
|
3154
3118
|
};
|
3155
3119
|
});
|
3156
3120
|
} else {
|
3157
3121
|
return {
|
3158
3122
|
status: "valid",
|
3159
|
-
value: result.status === "valid" ? result.value : this._def.
|
3123
|
+
value: result.status === "valid" ? result.value : this._def.defaultValue()
|
3160
3124
|
};
|
3161
3125
|
}
|
3162
3126
|
}
|
3163
|
-
|
3127
|
+
removeDefault() {
|
3164
3128
|
return this._def.innerType;
|
3165
3129
|
}
|
3166
3130
|
}, "ZodCatch");
|
@@ -3169,7 +3133,7 @@ var require_types_cjs_development = __commonJS({
|
|
3169
3133
|
return new ZodCatch({
|
3170
3134
|
innerType: type,
|
3171
3135
|
typeName: ZodFirstPartyTypeKind.ZodCatch,
|
3172
|
-
|
3136
|
+
defaultValue: typeof params.default === "function" ? params.default : () => params.default,
|
3173
3137
|
...processCreateParams(params)
|
3174
3138
|
});
|
3175
3139
|
};
|
@@ -3362,10 +3326,7 @@ var require_types_cjs_development = __commonJS({
|
|
3362
3326
|
var coerce = {
|
3363
3327
|
string: (arg) => ZodString.create({ ...arg, coerce: true }),
|
3364
3328
|
number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
|
3365
|
-
boolean: (arg) => ZodBoolean.create({
|
3366
|
-
...arg,
|
3367
|
-
coerce: true
|
3368
|
-
}),
|
3329
|
+
boolean: (arg) => ZodBoolean.create({ ...arg, coerce: true }),
|
3369
3330
|
bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
|
3370
3331
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
3371
3332
|
};
|
@@ -3489,13 +3450,11 @@ var require_types_cjs_development = __commonJS({
|
|
3489
3450
|
type: mod.string().optional(),
|
3490
3451
|
narrative: mod.string().optional()
|
3491
3452
|
});
|
3492
|
-
var ImageValidator = mod.string().or(
|
3493
|
-
mod.
|
3494
|
-
|
3495
|
-
|
3496
|
-
|
3497
|
-
})
|
3498
|
-
);
|
3453
|
+
var ImageValidator = mod.string().or(mod.object({
|
3454
|
+
id: mod.string(),
|
3455
|
+
type: mod.string(),
|
3456
|
+
caption: mod.string().optional()
|
3457
|
+
}));
|
3499
3458
|
var GeoCoordinatesValidator = mod.object({
|
3500
3459
|
type: mod.string().min(1).or(mod.string().array().nonempty()),
|
3501
3460
|
latitude: mod.number(),
|
@@ -3537,31 +3496,29 @@ var require_types_cjs_development = __commonJS({
|
|
3537
3496
|
identifier: mod.string(),
|
3538
3497
|
identifierType: IdentifierTypeValidator
|
3539
3498
|
});
|
3540
|
-
var ProfileValidator = mod.string().or(
|
3541
|
-
mod.
|
3542
|
-
|
3543
|
-
|
3544
|
-
|
3545
|
-
|
3546
|
-
|
3547
|
-
|
3548
|
-
|
3549
|
-
|
3550
|
-
|
3551
|
-
|
3552
|
-
|
3553
|
-
|
3554
|
-
|
3555
|
-
|
3556
|
-
|
3557
|
-
|
3558
|
-
|
3559
|
-
|
3560
|
-
|
3561
|
-
|
3562
|
-
|
3563
|
-
}).catchall(mod.any())
|
3564
|
-
);
|
3499
|
+
var ProfileValidator = mod.string().or(mod.object({
|
3500
|
+
id: mod.string().optional(),
|
3501
|
+
type: mod.string().or(mod.string().array().nonempty().optional()),
|
3502
|
+
name: mod.string().optional(),
|
3503
|
+
url: mod.string().optional(),
|
3504
|
+
phone: mod.string().optional(),
|
3505
|
+
description: mod.string().optional(),
|
3506
|
+
endorsement: mod.any().array().optional(),
|
3507
|
+
image: ImageValidator.optional(),
|
3508
|
+
email: mod.string().email().optional(),
|
3509
|
+
address: AddressValidator.optional(),
|
3510
|
+
otherIdentifier: IdentifierEntryValidator.array().optional(),
|
3511
|
+
official: mod.string().optional(),
|
3512
|
+
parentOrg: mod.any().optional(),
|
3513
|
+
familyName: mod.string().optional(),
|
3514
|
+
givenName: mod.string().optional(),
|
3515
|
+
additionalName: mod.string().optional(),
|
3516
|
+
patronymicName: mod.string().optional(),
|
3517
|
+
honorificPrefix: mod.string().optional(),
|
3518
|
+
honorificSuffix: mod.string().optional(),
|
3519
|
+
familyNamePrefix: mod.string().optional(),
|
3520
|
+
dateOfBirth: mod.string().optional()
|
3521
|
+
}).catchall(mod.any()));
|
3565
3522
|
var CredentialSubjectValidator = mod.object({ id: mod.string().optional() }).catchall(mod.any());
|
3566
3523
|
var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() });
|
3567
3524
|
var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() });
|
@@ -3843,11 +3800,13 @@ var require_types_cjs_development = __commonJS({
|
|
3843
3800
|
aad: mod.string().optional(),
|
3844
3801
|
recipients: JWERecipientValidator.array().optional()
|
3845
3802
|
});
|
3846
|
-
var
|
3847
|
-
|
3848
|
-
|
3803
|
+
var EncryptedRecordValidator = mod.object({ encryptedRecord: JWEValidator2, fields: mod.string().array() }).catchall(mod.any());
|
3804
|
+
var PaginatedEncryptedRecordsValidator = PaginationResponseValidator.extend({
|
3805
|
+
records: EncryptedRecordValidator.array()
|
3806
|
+
});
|
3807
|
+
var EncryptedCredentialRecordValidator = EncryptedRecordValidator.extend({
|
3849
3808
|
id: mod.string()
|
3850
|
-
})
|
3809
|
+
});
|
3851
3810
|
var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.extend({
|
3852
3811
|
records: EncryptedCredentialRecordValidator.array()
|
3853
3812
|
});
|
@@ -3884,7 +3843,7 @@ var require_types_cjs_development = __commonJS({
|
|
3884
3843
|
var BoostRecipientValidator = mod.object({
|
3885
3844
|
to: LCNProfileValidator,
|
3886
3845
|
from: mod.string(),
|
3887
|
-
received: mod.string()
|
3846
|
+
received: mod.string().optional()
|
3888
3847
|
});
|
3889
3848
|
var LCNNotificationTypeEnumValidator = mod.enum([
|
3890
3849
|
"CONNECTION_REQUEST",
|