@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
package/dist/helpers.d.ts
CHANGED
package/dist/helpers.esm.js
CHANGED
@@ -16,10 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
16
16
|
}
|
17
17
|
return to;
|
18
18
|
};
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
21
|
-
mod
|
22
|
-
));
|
19
|
+
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));
|
23
20
|
|
24
21
|
// ../learn-card-types/dist/types.cjs.development.js
|
25
22
|
var require_types_cjs_development = __commonJS({
|
@@ -63,6 +60,7 @@ var require_types_cjs_development = __commonJS({
|
|
63
60
|
CredentialSubjectValidator: () => CredentialSubjectValidator,
|
64
61
|
CriteriaValidator: () => CriteriaValidator,
|
65
62
|
EncryptedCredentialRecordValidator: () => EncryptedCredentialRecordValidator,
|
63
|
+
EncryptedRecordValidator: () => EncryptedRecordValidator,
|
66
64
|
EndorsementCredentialValidator: () => EndorsementCredentialValidator,
|
67
65
|
EndorsementSubjectValidator: () => EndorsementSubjectValidator,
|
68
66
|
EvidenceValidator: () => EvidenceValidator,
|
@@ -88,6 +86,7 @@ var require_types_cjs_development = __commonJS({
|
|
88
86
|
LCNSigningAuthorityForUserValidator: () => LCNSigningAuthorityForUserValidator,
|
89
87
|
LCNSigningAuthorityValidator: () => LCNSigningAuthorityValidator,
|
90
88
|
PaginatedEncryptedCredentialRecordsValidator: () => PaginatedEncryptedCredentialRecordsValidator,
|
89
|
+
PaginatedEncryptedRecordsValidator: () => PaginatedEncryptedRecordsValidator,
|
91
90
|
PaginationOptionsValidator: () => PaginationOptionsValidator,
|
92
91
|
PaginationResponseValidator: () => PaginationResponseValidator,
|
93
92
|
ProfileValidator: () => ProfileValidator,
|
@@ -547,7 +546,7 @@ var require_types_cjs_development = __commonJS({
|
|
547
546
|
var isAborted = /* @__PURE__ */ __name2((x) => x.status === "aborted", "isAborted");
|
548
547
|
var isDirty = /* @__PURE__ */ __name2((x) => x.status === "dirty", "isDirty");
|
549
548
|
var isValid = /* @__PURE__ */ __name2((x) => x.status === "valid", "isValid");
|
550
|
-
var isAsync = /* @__PURE__ */ __name2((x) => typeof Promise !==
|
549
|
+
var isAsync = /* @__PURE__ */ __name2((x) => typeof Promise !== void 0 && x instanceof Promise, "isAsync");
|
551
550
|
var errorUtil;
|
552
551
|
(function(errorUtil2) {
|
553
552
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
@@ -766,29 +765,28 @@ var require_types_cjs_development = __commonJS({
|
|
766
765
|
return this._refinement(refinement);
|
767
766
|
}
|
768
767
|
optional() {
|
769
|
-
return ZodOptional.create(this
|
768
|
+
return ZodOptional.create(this);
|
770
769
|
}
|
771
770
|
nullable() {
|
772
|
-
return ZodNullable.create(this
|
771
|
+
return ZodNullable.create(this);
|
773
772
|
}
|
774
773
|
nullish() {
|
775
|
-
return this.
|
774
|
+
return this.optional().nullable();
|
776
775
|
}
|
777
776
|
array() {
|
778
|
-
return ZodArray.create(this
|
777
|
+
return ZodArray.create(this);
|
779
778
|
}
|
780
779
|
promise() {
|
781
|
-
return ZodPromise.create(this
|
780
|
+
return ZodPromise.create(this);
|
782
781
|
}
|
783
782
|
or(option) {
|
784
|
-
return ZodUnion.create([this, option]
|
783
|
+
return ZodUnion.create([this, option]);
|
785
784
|
}
|
786
785
|
and(incoming) {
|
787
|
-
return ZodIntersection.create(this, incoming
|
786
|
+
return ZodIntersection.create(this, incoming);
|
788
787
|
}
|
789
788
|
transform(transform) {
|
790
789
|
return new ZodEffects({
|
791
|
-
...processCreateParams(this._def),
|
792
790
|
schema: this,
|
793
791
|
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
794
792
|
effect: { type: "transform", transform }
|
@@ -797,7 +795,6 @@ var require_types_cjs_development = __commonJS({
|
|
797
795
|
default(def) {
|
798
796
|
const defaultValueFunc = typeof def === "function" ? def : () => def;
|
799
797
|
return new ZodDefault({
|
800
|
-
...processCreateParams(this._def),
|
801
798
|
innerType: this,
|
802
799
|
defaultValue: defaultValueFunc,
|
803
800
|
typeName: ZodFirstPartyTypeKind.ZodDefault
|
@@ -807,15 +804,14 @@ var require_types_cjs_development = __commonJS({
|
|
807
804
|
return new ZodBranded({
|
808
805
|
typeName: ZodFirstPartyTypeKind.ZodBranded,
|
809
806
|
type: this,
|
810
|
-
...processCreateParams(
|
807
|
+
...processCreateParams(void 0)
|
811
808
|
});
|
812
809
|
}
|
813
810
|
catch(def) {
|
814
|
-
const
|
811
|
+
const defaultValueFunc = typeof def === "function" ? def : () => def;
|
815
812
|
return new ZodCatch({
|
816
|
-
...processCreateParams(this._def),
|
817
813
|
innerType: this,
|
818
|
-
|
814
|
+
defaultValue: defaultValueFunc,
|
819
815
|
typeName: ZodFirstPartyTypeKind.ZodCatch
|
820
816
|
});
|
821
817
|
}
|
@@ -838,25 +834,24 @@ var require_types_cjs_development = __commonJS({
|
|
838
834
|
}, "ZodType");
|
839
835
|
__name2(ZodType, "ZodType");
|
840
836
|
var cuidRegex = /^c[^\s-]{8,}$/i;
|
841
|
-
var cuid2Regex = /^[a-z][a-z0-9]*$/;
|
842
837
|
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;
|
843
|
-
var emailRegex = /^(([^<>()[\]
|
838
|
+
var emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
|
844
839
|
var datetimeRegex = /* @__PURE__ */ __name2((args) => {
|
845
840
|
if (args.precision) {
|
846
841
|
if (args.offset) {
|
847
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}
|
842
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
|
848
843
|
} else {
|
849
844
|
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
|
850
845
|
}
|
851
846
|
} else if (args.precision === 0) {
|
852
847
|
if (args.offset) {
|
853
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}
|
848
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
|
854
849
|
} else {
|
855
850
|
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
|
856
851
|
}
|
857
852
|
} else {
|
858
853
|
if (args.offset) {
|
859
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}
|
854
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
|
860
855
|
} else {
|
861
856
|
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
|
862
857
|
}
|
@@ -883,14 +878,11 @@ var require_types_cjs_development = __commonJS({
|
|
883
878
|
const parsedType = this._getType(input);
|
884
879
|
if (parsedType !== ZodParsedType.string) {
|
885
880
|
const ctx2 = this._getOrReturnCtx(input);
|
886
|
-
addIssueToContext(
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
received: ctx2.parsedType
|
892
|
-
}
|
893
|
-
);
|
881
|
+
addIssueToContext(ctx2, {
|
882
|
+
code: ZodIssueCode.invalid_type,
|
883
|
+
expected: ZodParsedType.string,
|
884
|
+
received: ctx2.parsedType
|
885
|
+
});
|
894
886
|
return INVALID;
|
895
887
|
}
|
896
888
|
const status = new ParseStatus();
|
@@ -978,16 +970,6 @@ var require_types_cjs_development = __commonJS({
|
|
978
970
|
});
|
979
971
|
status.dirty();
|
980
972
|
}
|
981
|
-
} else if (check.kind === "cuid2") {
|
982
|
-
if (!cuid2Regex.test(input.data)) {
|
983
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
984
|
-
addIssueToContext(ctx, {
|
985
|
-
validation: "cuid2",
|
986
|
-
code: ZodIssueCode.invalid_string,
|
987
|
-
message: check.message
|
988
|
-
});
|
989
|
-
status.dirty();
|
990
|
-
}
|
991
973
|
} else if (check.kind === "url") {
|
992
974
|
try {
|
993
975
|
new URL(input.data);
|
@@ -1069,9 +1051,6 @@ var require_types_cjs_development = __commonJS({
|
|
1069
1051
|
cuid(message) {
|
1070
1052
|
return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
|
1071
1053
|
}
|
1072
|
-
cuid2(message) {
|
1073
|
-
return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
|
1074
|
-
}
|
1075
1054
|
datetime(options) {
|
1076
1055
|
var _a;
|
1077
1056
|
if (typeof options === "string") {
|
@@ -1146,9 +1125,6 @@ var require_types_cjs_development = __commonJS({
|
|
1146
1125
|
get isCUID() {
|
1147
1126
|
return !!this._def.checks.find((ch) => ch.kind === "cuid");
|
1148
1127
|
}
|
1149
|
-
get isCUID2() {
|
1150
|
-
return !!this._def.checks.find((ch) => ch.kind === "cuid2");
|
1151
|
-
}
|
1152
1128
|
get minLength() {
|
1153
1129
|
let min = null;
|
1154
1130
|
for (const ch of this._def.checks) {
|
@@ -1382,22 +1358,7 @@ var require_types_cjs_development = __commonJS({
|
|
1382
1358
|
return max;
|
1383
1359
|
}
|
1384
1360
|
get isInt() {
|
1385
|
-
return !!this._def.checks.find((ch) => ch.kind === "int"
|
1386
|
-
}
|
1387
|
-
get isFinite() {
|
1388
|
-
let max = null, min = null;
|
1389
|
-
for (const ch of this._def.checks) {
|
1390
|
-
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
1391
|
-
return true;
|
1392
|
-
} else if (ch.kind === "min") {
|
1393
|
-
if (min === null || ch.value > min)
|
1394
|
-
min = ch.value;
|
1395
|
-
} else if (ch.kind === "max") {
|
1396
|
-
if (max === null || ch.value < max)
|
1397
|
-
max = ch.value;
|
1398
|
-
}
|
1399
|
-
}
|
1400
|
-
return Number.isFinite(min) && Number.isFinite(max);
|
1361
|
+
return !!this._def.checks.find((ch) => ch.kind === "int");
|
1401
1362
|
}
|
1402
1363
|
}, "ZodNumber");
|
1403
1364
|
__name2(ZodNumber, "ZodNumber");
|
@@ -1765,13 +1726,13 @@ var require_types_cjs_development = __commonJS({
|
|
1765
1726
|
}
|
1766
1727
|
}
|
1767
1728
|
if (ctx.common.async) {
|
1768
|
-
return Promise.all(
|
1729
|
+
return Promise.all(ctx.data.map((item, i) => {
|
1769
1730
|
return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
1770
1731
|
})).then((result2) => {
|
1771
1732
|
return ParseStatus.mergeArray(status, result2);
|
1772
1733
|
});
|
1773
1734
|
}
|
1774
|
-
const result =
|
1735
|
+
const result = ctx.data.map((item, i) => {
|
1775
1736
|
return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
1776
1737
|
});
|
1777
1738
|
return ParseStatus.mergeArray(status, result);
|
@@ -1821,6 +1782,15 @@ var require_types_cjs_development = __commonJS({
|
|
1821
1782
|
};
|
1822
1783
|
};
|
1823
1784
|
})(objectUtil || (objectUtil = {}));
|
1785
|
+
var AugmentFactory = /* @__PURE__ */ __name2((def) => (augmentation) => {
|
1786
|
+
return new ZodObject({
|
1787
|
+
...def,
|
1788
|
+
shape: () => ({
|
1789
|
+
...def.shape(),
|
1790
|
+
...augmentation
|
1791
|
+
})
|
1792
|
+
});
|
1793
|
+
}, "AugmentFactory");
|
1824
1794
|
function deepPartialify(schema) {
|
1825
1795
|
if (schema instanceof ZodObject) {
|
1826
1796
|
const newShape = {};
|
@@ -1851,7 +1821,8 @@ var require_types_cjs_development = __commonJS({
|
|
1851
1821
|
super(...arguments);
|
1852
1822
|
this._cached = null;
|
1853
1823
|
this.nonstrict = this.passthrough;
|
1854
|
-
this.augment = this.
|
1824
|
+
this.augment = AugmentFactory(this._def);
|
1825
|
+
this.extend = AugmentFactory(this._def);
|
1855
1826
|
}
|
1856
1827
|
_getCached() {
|
1857
1828
|
if (this._cached !== null)
|
@@ -1919,9 +1890,7 @@ var require_types_cjs_development = __commonJS({
|
|
1919
1890
|
const value = ctx.data[key];
|
1920
1891
|
pairs.push({
|
1921
1892
|
key: { status: "valid", value: key },
|
1922
|
-
value: catchall._parse(
|
1923
|
-
new ParseInputLazyPath(ctx, value, ctx.path, key)
|
1924
|
-
),
|
1893
|
+
value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
|
1925
1894
|
alwaysSet: key in ctx.data
|
1926
1895
|
});
|
1927
1896
|
}
|
@@ -1980,14 +1949,8 @@ var require_types_cjs_development = __commonJS({
|
|
1980
1949
|
unknownKeys: "passthrough"
|
1981
1950
|
});
|
1982
1951
|
}
|
1983
|
-
|
1984
|
-
return
|
1985
|
-
...this._def,
|
1986
|
-
shape: () => ({
|
1987
|
-
...this._def.shape(),
|
1988
|
-
...augmentation
|
1989
|
-
})
|
1990
|
-
});
|
1952
|
+
setKey(key, schema) {
|
1953
|
+
return this.augment({ [key]: schema });
|
1991
1954
|
}
|
1992
1955
|
merge(merging) {
|
1993
1956
|
const merged = new ZodObject({
|
@@ -1998,9 +1961,6 @@ var require_types_cjs_development = __commonJS({
|
|
1998
1961
|
});
|
1999
1962
|
return merged;
|
2000
1963
|
}
|
2001
|
-
setKey(key, schema) {
|
2002
|
-
return this.augment({ [key]: schema });
|
2003
|
-
}
|
2004
1964
|
catchall(index) {
|
2005
1965
|
return new ZodObject({
|
2006
1966
|
...this._def,
|
@@ -2009,10 +1969,9 @@ var require_types_cjs_development = __commonJS({
|
|
2009
1969
|
}
|
2010
1970
|
pick(mask) {
|
2011
1971
|
const shape = {};
|
2012
|
-
util.objectKeys(mask).
|
2013
|
-
if (
|
1972
|
+
util.objectKeys(mask).map((key) => {
|
1973
|
+
if (this.shape[key])
|
2014
1974
|
shape[key] = this.shape[key];
|
2015
|
-
}
|
2016
1975
|
});
|
2017
1976
|
return new ZodObject({
|
2018
1977
|
...this._def,
|
@@ -2021,8 +1980,8 @@ var require_types_cjs_development = __commonJS({
|
|
2021
1980
|
}
|
2022
1981
|
omit(mask) {
|
2023
1982
|
const shape = {};
|
2024
|
-
util.objectKeys(this.shape).
|
2025
|
-
if (
|
1983
|
+
util.objectKeys(this.shape).map((key) => {
|
1984
|
+
if (util.objectKeys(mask).indexOf(key) === -1) {
|
2026
1985
|
shape[key] = this.shape[key];
|
2027
1986
|
}
|
2028
1987
|
});
|
@@ -2036,14 +1995,24 @@ var require_types_cjs_development = __commonJS({
|
|
2036
1995
|
}
|
2037
1996
|
partial(mask) {
|
2038
1997
|
const newShape = {};
|
2039
|
-
|
2040
|
-
|
2041
|
-
|
2042
|
-
|
2043
|
-
|
1998
|
+
if (mask) {
|
1999
|
+
util.objectKeys(this.shape).map((key) => {
|
2000
|
+
if (util.objectKeys(mask).indexOf(key) === -1) {
|
2001
|
+
newShape[key] = this.shape[key];
|
2002
|
+
} else {
|
2003
|
+
newShape[key] = this.shape[key].optional();
|
2004
|
+
}
|
2005
|
+
});
|
2006
|
+
return new ZodObject({
|
2007
|
+
...this._def,
|
2008
|
+
shape: () => newShape
|
2009
|
+
});
|
2010
|
+
} else {
|
2011
|
+
for (const key in this.shape) {
|
2012
|
+
const fieldSchema = this.shape[key];
|
2044
2013
|
newShape[key] = fieldSchema.optional();
|
2045
2014
|
}
|
2046
|
-
}
|
2015
|
+
}
|
2047
2016
|
return new ZodObject({
|
2048
2017
|
...this._def,
|
2049
2018
|
shape: () => newShape
|
@@ -2051,10 +2020,21 @@ var require_types_cjs_development = __commonJS({
|
|
2051
2020
|
}
|
2052
2021
|
required(mask) {
|
2053
2022
|
const newShape = {};
|
2054
|
-
|
2055
|
-
|
2056
|
-
|
2057
|
-
|
2023
|
+
if (mask) {
|
2024
|
+
util.objectKeys(this.shape).map((key) => {
|
2025
|
+
if (util.objectKeys(mask).indexOf(key) === -1) {
|
2026
|
+
newShape[key] = this.shape[key];
|
2027
|
+
} else {
|
2028
|
+
const fieldSchema = this.shape[key];
|
2029
|
+
let newField = fieldSchema;
|
2030
|
+
while (newField instanceof ZodOptional) {
|
2031
|
+
newField = newField._def.innerType;
|
2032
|
+
}
|
2033
|
+
newShape[key] = newField;
|
2034
|
+
}
|
2035
|
+
});
|
2036
|
+
} else {
|
2037
|
+
for (const key in this.shape) {
|
2058
2038
|
const fieldSchema = this.shape[key];
|
2059
2039
|
let newField = fieldSchema;
|
2060
2040
|
while (newField instanceof ZodOptional) {
|
@@ -2062,7 +2042,7 @@ var require_types_cjs_development = __commonJS({
|
|
2062
2042
|
}
|
2063
2043
|
newShape[key] = newField;
|
2064
2044
|
}
|
2065
|
-
}
|
2045
|
+
}
|
2066
2046
|
return new ZodObject({
|
2067
2047
|
...this._def,
|
2068
2048
|
shape: () => newShape
|
@@ -2410,7 +2390,7 @@ var require_types_cjs_development = __commonJS({
|
|
2410
2390
|
});
|
2411
2391
|
status.dirty();
|
2412
2392
|
}
|
2413
|
-
const items =
|
2393
|
+
const items = ctx.data.map((item, itemIndex) => {
|
2414
2394
|
const schema = this._def.items[itemIndex] || this._def.rest;
|
2415
2395
|
if (!schema)
|
2416
2396
|
return null;
|
@@ -2789,7 +2769,6 @@ var require_types_cjs_development = __commonJS({
|
|
2789
2769
|
if (input.data !== this._def.value) {
|
2790
2770
|
const ctx = this._getOrReturnCtx(input);
|
2791
2771
|
addIssueToContext(ctx, {
|
2792
|
-
received: ctx.data,
|
2793
2772
|
code: ZodIssueCode.invalid_literal,
|
2794
2773
|
expected: this._def.value
|
2795
2774
|
});
|
@@ -2866,12 +2845,6 @@ var require_types_cjs_development = __commonJS({
|
|
2866
2845
|
}
|
2867
2846
|
return enumValues;
|
2868
2847
|
}
|
2869
|
-
extract(values) {
|
2870
|
-
return ZodEnum.create(values);
|
2871
|
-
}
|
2872
|
-
exclude(values) {
|
2873
|
-
return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));
|
2874
|
-
}
|
2875
2848
|
}, "ZodEnum");
|
2876
2849
|
__name2(ZodEnum, "ZodEnum");
|
2877
2850
|
ZodEnum.create = createZodEnum;
|
@@ -2912,9 +2885,6 @@ var require_types_cjs_development = __commonJS({
|
|
2912
2885
|
});
|
2913
2886
|
};
|
2914
2887
|
var ZodPromise = /* @__PURE__ */ __name(class extends ZodType {
|
2915
|
-
unwrap() {
|
2916
|
-
return this._def.type;
|
2917
|
-
}
|
2918
2888
|
_parse(input) {
|
2919
2889
|
const { ctx } = this._processInputParams(input);
|
2920
2890
|
if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
|
@@ -3133,29 +3103,23 @@ var require_types_cjs_development = __commonJS({
|
|
3133
3103
|
const result = this._def.innerType._parse({
|
3134
3104
|
data: ctx.data,
|
3135
3105
|
path: ctx.path,
|
3136
|
-
parent:
|
3137
|
-
...ctx,
|
3138
|
-
common: {
|
3139
|
-
...ctx.common,
|
3140
|
-
issues: []
|
3141
|
-
}
|
3142
|
-
}
|
3106
|
+
parent: ctx
|
3143
3107
|
});
|
3144
3108
|
if (isAsync(result)) {
|
3145
3109
|
return result.then((result2) => {
|
3146
3110
|
return {
|
3147
3111
|
status: "valid",
|
3148
|
-
value: result2.status === "valid" ? result2.value : this._def.
|
3112
|
+
value: result2.status === "valid" ? result2.value : this._def.defaultValue()
|
3149
3113
|
};
|
3150
3114
|
});
|
3151
3115
|
} else {
|
3152
3116
|
return {
|
3153
3117
|
status: "valid",
|
3154
|
-
value: result.status === "valid" ? result.value : this._def.
|
3118
|
+
value: result.status === "valid" ? result.value : this._def.defaultValue()
|
3155
3119
|
};
|
3156
3120
|
}
|
3157
3121
|
}
|
3158
|
-
|
3122
|
+
removeDefault() {
|
3159
3123
|
return this._def.innerType;
|
3160
3124
|
}
|
3161
3125
|
}, "ZodCatch");
|
@@ -3164,7 +3128,7 @@ var require_types_cjs_development = __commonJS({
|
|
3164
3128
|
return new ZodCatch({
|
3165
3129
|
innerType: type,
|
3166
3130
|
typeName: ZodFirstPartyTypeKind.ZodCatch,
|
3167
|
-
|
3131
|
+
defaultValue: typeof params.default === "function" ? params.default : () => params.default,
|
3168
3132
|
...processCreateParams(params)
|
3169
3133
|
});
|
3170
3134
|
};
|
@@ -3357,10 +3321,7 @@ var require_types_cjs_development = __commonJS({
|
|
3357
3321
|
var coerce = {
|
3358
3322
|
string: (arg) => ZodString.create({ ...arg, coerce: true }),
|
3359
3323
|
number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
|
3360
|
-
boolean: (arg) => ZodBoolean.create({
|
3361
|
-
...arg,
|
3362
|
-
coerce: true
|
3363
|
-
}),
|
3324
|
+
boolean: (arg) => ZodBoolean.create({ ...arg, coerce: true }),
|
3364
3325
|
bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
|
3365
3326
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
3366
3327
|
};
|
@@ -3484,13 +3445,11 @@ var require_types_cjs_development = __commonJS({
|
|
3484
3445
|
type: mod.string().optional(),
|
3485
3446
|
narrative: mod.string().optional()
|
3486
3447
|
});
|
3487
|
-
var ImageValidator = mod.string().or(
|
3488
|
-
mod.
|
3489
|
-
|
3490
|
-
|
3491
|
-
|
3492
|
-
})
|
3493
|
-
);
|
3448
|
+
var ImageValidator = mod.string().or(mod.object({
|
3449
|
+
id: mod.string(),
|
3450
|
+
type: mod.string(),
|
3451
|
+
caption: mod.string().optional()
|
3452
|
+
}));
|
3494
3453
|
var GeoCoordinatesValidator = mod.object({
|
3495
3454
|
type: mod.string().min(1).or(mod.string().array().nonempty()),
|
3496
3455
|
latitude: mod.number(),
|
@@ -3532,31 +3491,29 @@ var require_types_cjs_development = __commonJS({
|
|
3532
3491
|
identifier: mod.string(),
|
3533
3492
|
identifierType: IdentifierTypeValidator
|
3534
3493
|
});
|
3535
|
-
var ProfileValidator = mod.string().or(
|
3536
|
-
mod.
|
3537
|
-
|
3538
|
-
|
3539
|
-
|
3540
|
-
|
3541
|
-
|
3542
|
-
|
3543
|
-
|
3544
|
-
|
3545
|
-
|
3546
|
-
|
3547
|
-
|
3548
|
-
|
3549
|
-
|
3550
|
-
|
3551
|
-
|
3552
|
-
|
3553
|
-
|
3554
|
-
|
3555
|
-
|
3556
|
-
|
3557
|
-
|
3558
|
-
}).catchall(mod.any())
|
3559
|
-
);
|
3494
|
+
var ProfileValidator = mod.string().or(mod.object({
|
3495
|
+
id: mod.string().optional(),
|
3496
|
+
type: mod.string().or(mod.string().array().nonempty().optional()),
|
3497
|
+
name: mod.string().optional(),
|
3498
|
+
url: mod.string().optional(),
|
3499
|
+
phone: mod.string().optional(),
|
3500
|
+
description: mod.string().optional(),
|
3501
|
+
endorsement: mod.any().array().optional(),
|
3502
|
+
image: ImageValidator.optional(),
|
3503
|
+
email: mod.string().email().optional(),
|
3504
|
+
address: AddressValidator.optional(),
|
3505
|
+
otherIdentifier: IdentifierEntryValidator.array().optional(),
|
3506
|
+
official: mod.string().optional(),
|
3507
|
+
parentOrg: mod.any().optional(),
|
3508
|
+
familyName: mod.string().optional(),
|
3509
|
+
givenName: mod.string().optional(),
|
3510
|
+
additionalName: mod.string().optional(),
|
3511
|
+
patronymicName: mod.string().optional(),
|
3512
|
+
honorificPrefix: mod.string().optional(),
|
3513
|
+
honorificSuffix: mod.string().optional(),
|
3514
|
+
familyNamePrefix: mod.string().optional(),
|
3515
|
+
dateOfBirth: mod.string().optional()
|
3516
|
+
}).catchall(mod.any()));
|
3560
3517
|
var CredentialSubjectValidator = mod.object({ id: mod.string().optional() }).catchall(mod.any());
|
3561
3518
|
var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() });
|
3562
3519
|
var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() });
|
@@ -3838,11 +3795,13 @@ var require_types_cjs_development = __commonJS({
|
|
3838
3795
|
aad: mod.string().optional(),
|
3839
3796
|
recipients: JWERecipientValidator.array().optional()
|
3840
3797
|
});
|
3841
|
-
var
|
3842
|
-
|
3843
|
-
|
3798
|
+
var EncryptedRecordValidator = mod.object({ encryptedRecord: JWEValidator2, fields: mod.string().array() }).catchall(mod.any());
|
3799
|
+
var PaginatedEncryptedRecordsValidator = PaginationResponseValidator.extend({
|
3800
|
+
records: EncryptedRecordValidator.array()
|
3801
|
+
});
|
3802
|
+
var EncryptedCredentialRecordValidator = EncryptedRecordValidator.extend({
|
3844
3803
|
id: mod.string()
|
3845
|
-
})
|
3804
|
+
});
|
3846
3805
|
var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.extend({
|
3847
3806
|
records: EncryptedCredentialRecordValidator.array()
|
3848
3807
|
});
|
@@ -3879,7 +3838,7 @@ var require_types_cjs_development = __commonJS({
|
|
3879
3838
|
var BoostRecipientValidator = mod.object({
|
3880
3839
|
to: LCNProfileValidator,
|
3881
3840
|
from: mod.string(),
|
3882
|
-
received: mod.string()
|
3841
|
+
received: mod.string().optional()
|
3883
3842
|
});
|
3884
3843
|
var LCNNotificationTypeEnumValidator = mod.enum([
|
3885
3844
|
"CONNECTION_REQUEST",
|