@learncard/ceramic-plugin 1.0.38 → 1.0.40
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/ceramic-plugin.cjs.development.js +1467 -801
- package/dist/ceramic-plugin.cjs.development.js.map +4 -4
- package/dist/ceramic-plugin.cjs.production.min.js +53 -53
- package/dist/ceramic-plugin.cjs.production.min.js.map +4 -4
- package/dist/ceramic-plugin.esm.js +1467 -801
- package/dist/ceramic-plugin.esm.js.map +4 -4
- package/package.json +4 -4
|
@@ -15,8 +15,8 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
15
15
|
var __esm = (fn, res) => function __init() {
|
|
16
16
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
17
17
|
};
|
|
18
|
-
var __commonJS = (cb,
|
|
19
|
-
return
|
|
18
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
19
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
20
20
|
};
|
|
21
21
|
var __export = (target, all) => {
|
|
22
22
|
for (var name3 in all)
|
|
@@ -30,11 +30,11 @@ var __copyProps = (to, from4, except, desc) => {
|
|
|
30
30
|
}
|
|
31
31
|
return to;
|
|
32
32
|
};
|
|
33
|
-
var __toESM = (
|
|
34
|
-
isNodeMode || !
|
|
35
|
-
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
34
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
|
+
mod
|
|
36
36
|
));
|
|
37
|
-
var __toCommonJS = (
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
38
|
|
|
39
39
|
// ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js
|
|
40
40
|
var require_lodash = __commonJS({
|
|
@@ -8996,8 +8996,8 @@ var require_bn = __commonJS({
|
|
|
8996
8996
|
limbLen--;
|
|
8997
8997
|
limbPow = limbPow / base4 | 0;
|
|
8998
8998
|
var total = number.length - start;
|
|
8999
|
-
var
|
|
9000
|
-
var end = Math.min(total, total -
|
|
8999
|
+
var mod = total % limbLen;
|
|
9000
|
+
var end = Math.min(total, total - mod) + start;
|
|
9001
9001
|
var word = 0;
|
|
9002
9002
|
for (var i2 = start; i2 < end; i2 += limbLen) {
|
|
9003
9003
|
word = parseBase(number, i2, i2 + limbLen, base4);
|
|
@@ -9008,10 +9008,10 @@ var require_bn = __commonJS({
|
|
|
9008
9008
|
this._iaddn(word);
|
|
9009
9009
|
}
|
|
9010
9010
|
}
|
|
9011
|
-
if (
|
|
9011
|
+
if (mod !== 0) {
|
|
9012
9012
|
var pow = 1;
|
|
9013
9013
|
word = parseBase(number, i2, number.length, base4);
|
|
9014
|
-
for (i2 = 0; i2 <
|
|
9014
|
+
for (i2 = 0; i2 < mod; i2++) {
|
|
9015
9015
|
pow *= base4;
|
|
9016
9016
|
}
|
|
9017
9017
|
this.imuln(pow);
|
|
@@ -10746,21 +10746,21 @@ var require_bn = __commonJS({
|
|
|
10746
10746
|
mod: new BN3(0)
|
|
10747
10747
|
};
|
|
10748
10748
|
}
|
|
10749
|
-
var div,
|
|
10749
|
+
var div, mod, res;
|
|
10750
10750
|
if (this.negative !== 0 && num.negative === 0) {
|
|
10751
10751
|
res = this.neg().divmod(num, mode);
|
|
10752
10752
|
if (mode !== "mod") {
|
|
10753
10753
|
div = res.div.neg();
|
|
10754
10754
|
}
|
|
10755
10755
|
if (mode !== "div") {
|
|
10756
|
-
|
|
10757
|
-
if (positive &&
|
|
10758
|
-
|
|
10756
|
+
mod = res.mod.neg();
|
|
10757
|
+
if (positive && mod.negative !== 0) {
|
|
10758
|
+
mod.iadd(num);
|
|
10759
10759
|
}
|
|
10760
10760
|
}
|
|
10761
10761
|
return {
|
|
10762
10762
|
div,
|
|
10763
|
-
mod
|
|
10763
|
+
mod
|
|
10764
10764
|
};
|
|
10765
10765
|
}
|
|
10766
10766
|
if (this.negative === 0 && num.negative !== 0) {
|
|
@@ -10776,14 +10776,14 @@ var require_bn = __commonJS({
|
|
|
10776
10776
|
if ((this.negative & num.negative) !== 0) {
|
|
10777
10777
|
res = this.neg().divmod(num.neg(), mode);
|
|
10778
10778
|
if (mode !== "div") {
|
|
10779
|
-
|
|
10780
|
-
if (positive &&
|
|
10781
|
-
|
|
10779
|
+
mod = res.mod.neg();
|
|
10780
|
+
if (positive && mod.negative !== 0) {
|
|
10781
|
+
mod.isub(num);
|
|
10782
10782
|
}
|
|
10783
10783
|
}
|
|
10784
10784
|
return {
|
|
10785
10785
|
div: res.div,
|
|
10786
|
-
mod
|
|
10786
|
+
mod
|
|
10787
10787
|
};
|
|
10788
10788
|
}
|
|
10789
10789
|
if (num.length > this.length || this.cmp(num) < 0) {
|
|
@@ -10815,7 +10815,7 @@ var require_bn = __commonJS({
|
|
|
10815
10815
|
BN3.prototype.div = /* @__PURE__ */ __name(function div(num) {
|
|
10816
10816
|
return this.divmod(num, "div", false).div;
|
|
10817
10817
|
}, "div");
|
|
10818
|
-
BN3.prototype.mod = /* @__PURE__ */ __name(function
|
|
10818
|
+
BN3.prototype.mod = /* @__PURE__ */ __name(function mod(num) {
|
|
10819
10819
|
return this.divmod(num, "mod", false).mod;
|
|
10820
10820
|
}, "mod");
|
|
10821
10821
|
BN3.prototype.umod = /* @__PURE__ */ __name(function umod(num) {
|
|
@@ -10825,10 +10825,10 @@ var require_bn = __commonJS({
|
|
|
10825
10825
|
var dm = this.divmod(num);
|
|
10826
10826
|
if (dm.mod.isZero())
|
|
10827
10827
|
return dm.div;
|
|
10828
|
-
var
|
|
10828
|
+
var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
|
|
10829
10829
|
var half = num.ushrn(1);
|
|
10830
10830
|
var r2 = num.andln(1);
|
|
10831
|
-
var cmp =
|
|
10831
|
+
var cmp = mod.cmp(half);
|
|
10832
10832
|
if (cmp < 0 || r2 === 1 && cmp === 0)
|
|
10833
10833
|
return dm.div;
|
|
10834
10834
|
return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
|
|
@@ -11474,12 +11474,12 @@ var require_bn = __commonJS({
|
|
|
11474
11474
|
var one = new BN3(1).toRed(this);
|
|
11475
11475
|
var nOne = one.redNeg();
|
|
11476
11476
|
var lpow = this.m.subn(1).iushrn(1);
|
|
11477
|
-
var
|
|
11478
|
-
|
|
11479
|
-
while (this.pow(
|
|
11480
|
-
|
|
11477
|
+
var z2 = this.m.bitLength();
|
|
11478
|
+
z2 = new BN3(2 * z2 * z2).toRed(this);
|
|
11479
|
+
while (this.pow(z2, lpow).cmp(nOne) !== 0) {
|
|
11480
|
+
z2.redIAdd(nOne);
|
|
11481
11481
|
}
|
|
11482
|
-
var c = this.pow(
|
|
11482
|
+
var c = this.pow(z2, q);
|
|
11483
11483
|
var r2 = this.pow(a2, q.addn(1).iushrn(1));
|
|
11484
11484
|
var t = this.pow(a2, q);
|
|
11485
11485
|
var m = s2;
|
|
@@ -11723,18 +11723,18 @@ var require_utils2 = __commonJS({
|
|
|
11723
11723
|
var ws = 1 << w + 1;
|
|
11724
11724
|
var k = num.clone();
|
|
11725
11725
|
for (i2 = 0; i2 < naf.length; i2++) {
|
|
11726
|
-
var
|
|
11727
|
-
var
|
|
11726
|
+
var z2;
|
|
11727
|
+
var mod = k.andln(ws - 1);
|
|
11728
11728
|
if (k.isOdd()) {
|
|
11729
|
-
if (
|
|
11730
|
-
|
|
11729
|
+
if (mod > (ws >> 1) - 1)
|
|
11730
|
+
z2 = (ws >> 1) - mod;
|
|
11731
11731
|
else
|
|
11732
|
-
|
|
11733
|
-
k.isubn(
|
|
11732
|
+
z2 = mod;
|
|
11733
|
+
k.isubn(z2);
|
|
11734
11734
|
} else {
|
|
11735
|
-
|
|
11735
|
+
z2 = 0;
|
|
11736
11736
|
}
|
|
11737
|
-
naf[i2] =
|
|
11737
|
+
naf[i2] = z2;
|
|
11738
11738
|
k.iushrn(1);
|
|
11739
11739
|
}
|
|
11740
11740
|
return naf;
|
|
@@ -11953,18 +11953,18 @@ var require_base = __commonJS({
|
|
|
11953
11953
|
acc = acc.dblp(l);
|
|
11954
11954
|
if (i2 < 0)
|
|
11955
11955
|
break;
|
|
11956
|
-
var
|
|
11957
|
-
assert2(
|
|
11956
|
+
var z2 = naf[i2];
|
|
11957
|
+
assert2(z2 !== 0);
|
|
11958
11958
|
if (p.type === "affine") {
|
|
11959
|
-
if (
|
|
11960
|
-
acc = acc.mixedAdd(wnd[
|
|
11959
|
+
if (z2 > 0)
|
|
11960
|
+
acc = acc.mixedAdd(wnd[z2 - 1 >> 1]);
|
|
11961
11961
|
else
|
|
11962
|
-
acc = acc.mixedAdd(wnd[-
|
|
11962
|
+
acc = acc.mixedAdd(wnd[-z2 - 1 >> 1].neg());
|
|
11963
11963
|
} else {
|
|
11964
|
-
if (
|
|
11965
|
-
acc = acc.add(wnd[
|
|
11964
|
+
if (z2 > 0)
|
|
11965
|
+
acc = acc.add(wnd[z2 - 1 >> 1]);
|
|
11966
11966
|
else
|
|
11967
|
-
acc = acc.add(wnd[-
|
|
11967
|
+
acc = acc.add(wnd[-z2 - 1 >> 1].neg());
|
|
11968
11968
|
}
|
|
11969
11969
|
}
|
|
11970
11970
|
return p.type === "affine" ? acc.toP() : acc;
|
|
@@ -12054,14 +12054,14 @@ var require_base = __commonJS({
|
|
|
12054
12054
|
if (i2 < 0)
|
|
12055
12055
|
break;
|
|
12056
12056
|
for (j = 0; j < len; j++) {
|
|
12057
|
-
var
|
|
12057
|
+
var z2 = tmp[j];
|
|
12058
12058
|
p;
|
|
12059
|
-
if (
|
|
12059
|
+
if (z2 === 0)
|
|
12060
12060
|
continue;
|
|
12061
|
-
else if (
|
|
12062
|
-
p = wnd[j][
|
|
12063
|
-
else if (
|
|
12064
|
-
p = wnd[j][-
|
|
12061
|
+
else if (z2 > 0)
|
|
12062
|
+
p = wnd[j][z2 - 1 >> 1];
|
|
12063
|
+
else if (z2 < 0)
|
|
12064
|
+
p = wnd[j][-z2 - 1 >> 1].neg();
|
|
12065
12065
|
if (p.type === "affine")
|
|
12066
12066
|
acc = acc.mixedAdd(p);
|
|
12067
12067
|
else
|
|
@@ -12605,16 +12605,16 @@ var require_short = __commonJS({
|
|
|
12605
12605
|
var res = this.curve.jpoint(this.x, this.y, this.curve.one);
|
|
12606
12606
|
return res;
|
|
12607
12607
|
}, "toJ");
|
|
12608
|
-
function JPoint2(curve, x, y,
|
|
12608
|
+
function JPoint2(curve, x, y, z2) {
|
|
12609
12609
|
Base.BasePoint.call(this, curve, "jacobian");
|
|
12610
|
-
if (x === null && y === null &&
|
|
12610
|
+
if (x === null && y === null && z2 === null) {
|
|
12611
12611
|
this.x = this.curve.one;
|
|
12612
12612
|
this.y = this.curve.one;
|
|
12613
12613
|
this.z = new BN3(0);
|
|
12614
12614
|
} else {
|
|
12615
12615
|
this.x = new BN3(x, 16);
|
|
12616
12616
|
this.y = new BN3(y, 16);
|
|
12617
|
-
this.z = new BN3(
|
|
12617
|
+
this.z = new BN3(z2, 16);
|
|
12618
12618
|
}
|
|
12619
12619
|
if (!this.x.red)
|
|
12620
12620
|
this.x = this.x.toRed(this.curve.red);
|
|
@@ -12626,8 +12626,8 @@ var require_short = __commonJS({
|
|
|
12626
12626
|
}
|
|
12627
12627
|
__name(JPoint2, "JPoint");
|
|
12628
12628
|
inherits(JPoint2, Base.BasePoint);
|
|
12629
|
-
ShortCurve2.prototype.jpoint = /* @__PURE__ */ __name(function jpoint2(x, y,
|
|
12630
|
-
return new JPoint2(this, x, y,
|
|
12629
|
+
ShortCurve2.prototype.jpoint = /* @__PURE__ */ __name(function jpoint2(x, y, z2) {
|
|
12630
|
+
return new JPoint2(this, x, y, z2);
|
|
12631
12631
|
}, "jpoint");
|
|
12632
12632
|
JPoint2.prototype.toP = /* @__PURE__ */ __name(function toP2() {
|
|
12633
12633
|
if (this.isInfinity())
|
|
@@ -12941,14 +12941,14 @@ var require_mont = __commonJS({
|
|
|
12941
12941
|
var y = rhs.redSqrt();
|
|
12942
12942
|
return y.redSqr().cmp(rhs) === 0;
|
|
12943
12943
|
}, "validate");
|
|
12944
|
-
function Point2(curve, x,
|
|
12944
|
+
function Point2(curve, x, z2) {
|
|
12945
12945
|
Base.BasePoint.call(this, curve, "projective");
|
|
12946
|
-
if (x === null &&
|
|
12946
|
+
if (x === null && z2 === null) {
|
|
12947
12947
|
this.x = this.curve.one;
|
|
12948
12948
|
this.z = this.curve.zero;
|
|
12949
12949
|
} else {
|
|
12950
12950
|
this.x = new BN3(x, 16);
|
|
12951
|
-
this.z = new BN3(
|
|
12951
|
+
this.z = new BN3(z2, 16);
|
|
12952
12952
|
if (!this.x.red)
|
|
12953
12953
|
this.x = this.x.toRed(this.curve.red);
|
|
12954
12954
|
if (!this.z.red)
|
|
@@ -12960,8 +12960,8 @@ var require_mont = __commonJS({
|
|
|
12960
12960
|
MontCurve.prototype.decodePoint = /* @__PURE__ */ __name(function decodePoint2(bytes, enc) {
|
|
12961
12961
|
return this.point(utils.toArray(bytes, enc), 1);
|
|
12962
12962
|
}, "decodePoint");
|
|
12963
|
-
MontCurve.prototype.point = /* @__PURE__ */ __name(function point3(x,
|
|
12964
|
-
return new Point2(this, x,
|
|
12963
|
+
MontCurve.prototype.point = /* @__PURE__ */ __name(function point3(x, z2) {
|
|
12964
|
+
return new Point2(this, x, z2);
|
|
12965
12965
|
}, "point");
|
|
12966
12966
|
MontCurve.prototype.pointFromJSON = /* @__PURE__ */ __name(function pointFromJSON2(obj) {
|
|
12967
12967
|
return Point2.fromJSON(this, obj);
|
|
@@ -13083,8 +13083,8 @@ var require_edwards = __commonJS({
|
|
|
13083
13083
|
else
|
|
13084
13084
|
return this.c.redMul(num);
|
|
13085
13085
|
}, "_mulC");
|
|
13086
|
-
EdwardsCurve.prototype.jpoint = /* @__PURE__ */ __name(function jpoint2(x, y,
|
|
13087
|
-
return this.point(x, y,
|
|
13086
|
+
EdwardsCurve.prototype.jpoint = /* @__PURE__ */ __name(function jpoint2(x, y, z2, t) {
|
|
13087
|
+
return this.point(x, y, z2, t);
|
|
13088
13088
|
}, "jpoint");
|
|
13089
13089
|
EdwardsCurve.prototype.pointFromX = /* @__PURE__ */ __name(function pointFromX2(x, odd) {
|
|
13090
13090
|
x = new BN3(x, 16);
|
|
@@ -13133,9 +13133,9 @@ var require_edwards = __commonJS({
|
|
|
13133
13133
|
var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));
|
|
13134
13134
|
return lhs.cmp(rhs) === 0;
|
|
13135
13135
|
}, "validate");
|
|
13136
|
-
function Point2(curve, x, y,
|
|
13136
|
+
function Point2(curve, x, y, z2, t) {
|
|
13137
13137
|
Base.BasePoint.call(this, curve, "projective");
|
|
13138
|
-
if (x === null && y === null &&
|
|
13138
|
+
if (x === null && y === null && z2 === null) {
|
|
13139
13139
|
this.x = this.curve.zero;
|
|
13140
13140
|
this.y = this.curve.one;
|
|
13141
13141
|
this.z = this.curve.one;
|
|
@@ -13144,7 +13144,7 @@ var require_edwards = __commonJS({
|
|
|
13144
13144
|
} else {
|
|
13145
13145
|
this.x = new BN3(x, 16);
|
|
13146
13146
|
this.y = new BN3(y, 16);
|
|
13147
|
-
this.z =
|
|
13147
|
+
this.z = z2 ? new BN3(z2, 16) : this.curve.one;
|
|
13148
13148
|
this.t = t && new BN3(t, 16);
|
|
13149
13149
|
if (!this.x.red)
|
|
13150
13150
|
this.x = this.x.toRed(this.curve.red);
|
|
@@ -13167,8 +13167,8 @@ var require_edwards = __commonJS({
|
|
|
13167
13167
|
EdwardsCurve.prototype.pointFromJSON = /* @__PURE__ */ __name(function pointFromJSON2(obj) {
|
|
13168
13168
|
return Point2.fromJSON(this, obj);
|
|
13169
13169
|
}, "pointFromJSON");
|
|
13170
|
-
EdwardsCurve.prototype.point = /* @__PURE__ */ __name(function point3(x, y,
|
|
13171
|
-
return new Point2(this, x, y,
|
|
13170
|
+
EdwardsCurve.prototype.point = /* @__PURE__ */ __name(function point3(x, y, z2, t) {
|
|
13171
|
+
return new Point2(this, x, y, z2, t);
|
|
13172
13172
|
}, "point");
|
|
13173
13173
|
Point2.fromJSON = /* @__PURE__ */ __name(function fromJSON2(curve, obj) {
|
|
13174
13174
|
return new Point2(curve, obj[0], obj[1], obj[2]);
|
|
@@ -13717,28 +13717,28 @@ var require_common2 = __commonJS({
|
|
|
13717
13717
|
"use strict";
|
|
13718
13718
|
var utils = require_utils3();
|
|
13719
13719
|
var rotr32 = utils.rotr32;
|
|
13720
|
-
function ft_1(s2, x, y,
|
|
13720
|
+
function ft_1(s2, x, y, z2) {
|
|
13721
13721
|
if (s2 === 0)
|
|
13722
|
-
return ch32(x, y,
|
|
13722
|
+
return ch32(x, y, z2);
|
|
13723
13723
|
if (s2 === 1 || s2 === 3)
|
|
13724
|
-
return p32(x, y,
|
|
13724
|
+
return p32(x, y, z2);
|
|
13725
13725
|
if (s2 === 2)
|
|
13726
|
-
return maj32(x, y,
|
|
13726
|
+
return maj32(x, y, z2);
|
|
13727
13727
|
}
|
|
13728
13728
|
__name(ft_1, "ft_1");
|
|
13729
13729
|
exports.ft_1 = ft_1;
|
|
13730
|
-
function ch32(x, y,
|
|
13731
|
-
return x & y ^ ~x &
|
|
13730
|
+
function ch32(x, y, z2) {
|
|
13731
|
+
return x & y ^ ~x & z2;
|
|
13732
13732
|
}
|
|
13733
13733
|
__name(ch32, "ch32");
|
|
13734
13734
|
exports.ch32 = ch32;
|
|
13735
|
-
function maj32(x, y,
|
|
13736
|
-
return x & y ^ x &
|
|
13735
|
+
function maj32(x, y, z2) {
|
|
13736
|
+
return x & y ^ x & z2 ^ y & z2;
|
|
13737
13737
|
}
|
|
13738
13738
|
__name(maj32, "maj32");
|
|
13739
13739
|
exports.maj32 = maj32;
|
|
13740
|
-
function p32(x, y,
|
|
13741
|
-
return x ^ y ^
|
|
13740
|
+
function p32(x, y, z2) {
|
|
13741
|
+
return x ^ y ^ z2;
|
|
13742
13742
|
}
|
|
13743
13743
|
__name(p32, "p32");
|
|
13744
13744
|
exports.p32 = p32;
|
|
@@ -14612,17 +14612,17 @@ var require_ripemd = __commonJS({
|
|
|
14612
14612
|
else
|
|
14613
14613
|
return utils.split32(this.h, "little");
|
|
14614
14614
|
}, "digest");
|
|
14615
|
-
function f(j, x, y,
|
|
14615
|
+
function f(j, x, y, z2) {
|
|
14616
14616
|
if (j <= 15)
|
|
14617
|
-
return x ^ y ^
|
|
14617
|
+
return x ^ y ^ z2;
|
|
14618
14618
|
else if (j <= 31)
|
|
14619
|
-
return x & y | ~x &
|
|
14619
|
+
return x & y | ~x & z2;
|
|
14620
14620
|
else if (j <= 47)
|
|
14621
|
-
return (x | ~y) ^
|
|
14621
|
+
return (x | ~y) ^ z2;
|
|
14622
14622
|
else if (j <= 63)
|
|
14623
|
-
return x &
|
|
14623
|
+
return x & z2 | y & ~z2;
|
|
14624
14624
|
else
|
|
14625
|
-
return x ^ (y | ~
|
|
14625
|
+
return x ^ (y | ~z2);
|
|
14626
14626
|
}
|
|
14627
14627
|
__name(f, "f");
|
|
14628
14628
|
function K(j) {
|
|
@@ -18518,9 +18518,9 @@ var require_ed25519 = __commonJS({
|
|
|
18518
18518
|
sub(b, gf1, y);
|
|
18519
18519
|
inv25519(b, b);
|
|
18520
18520
|
mul3(a2, a2, b);
|
|
18521
|
-
let
|
|
18522
|
-
pack25519(
|
|
18523
|
-
return
|
|
18521
|
+
let z2 = new Uint8Array(32);
|
|
18522
|
+
pack25519(z2, a2);
|
|
18523
|
+
return z2;
|
|
18524
18524
|
}
|
|
18525
18525
|
__name(convertPublicKeyToX255192, "convertPublicKeyToX25519");
|
|
18526
18526
|
exports.convertPublicKeyToX25519 = convertPublicKeyToX255192;
|
|
@@ -19080,21 +19080,21 @@ var require_x25519 = __commonJS({
|
|
|
19080
19080
|
}
|
|
19081
19081
|
__name(inv25519, "inv25519");
|
|
19082
19082
|
function scalarMult(n2, p) {
|
|
19083
|
-
const
|
|
19083
|
+
const z2 = new Uint8Array(32);
|
|
19084
19084
|
const x = new Float64Array(80);
|
|
19085
19085
|
const a2 = gf(), b = gf(), c = gf(), d = gf(), e2 = gf(), f = gf();
|
|
19086
19086
|
for (let i2 = 0; i2 < 31; i2++) {
|
|
19087
|
-
|
|
19087
|
+
z2[i2] = n2[i2];
|
|
19088
19088
|
}
|
|
19089
|
-
|
|
19090
|
-
|
|
19089
|
+
z2[31] = n2[31] & 127 | 64;
|
|
19090
|
+
z2[0] &= 248;
|
|
19091
19091
|
unpack25519(x, p);
|
|
19092
19092
|
for (let i2 = 0; i2 < 16; i2++) {
|
|
19093
19093
|
b[i2] = x[i2];
|
|
19094
19094
|
}
|
|
19095
19095
|
a2[0] = d[0] = 1;
|
|
19096
19096
|
for (let i2 = 254; i2 >= 0; --i2) {
|
|
19097
|
-
const r2 =
|
|
19097
|
+
const r2 = z2[i2 >>> 3] >>> (i2 & 7) & 1;
|
|
19098
19098
|
sel25519(a2, b, r2);
|
|
19099
19099
|
sel25519(c, d, r2);
|
|
19100
19100
|
add3(e2, a2, c);
|
|
@@ -31383,8 +31383,8 @@ var require_bn2 = __commonJS({
|
|
|
31383
31383
|
limbLen--;
|
|
31384
31384
|
limbPow = limbPow / base4 | 0;
|
|
31385
31385
|
var total = number.length - start;
|
|
31386
|
-
var
|
|
31387
|
-
var end = Math.min(total, total -
|
|
31386
|
+
var mod = total % limbLen;
|
|
31387
|
+
var end = Math.min(total, total - mod) + start;
|
|
31388
31388
|
var word = 0;
|
|
31389
31389
|
for (var i2 = start; i2 < end; i2 += limbLen) {
|
|
31390
31390
|
word = parseBase(number, i2, i2 + limbLen, base4);
|
|
@@ -31395,10 +31395,10 @@ var require_bn2 = __commonJS({
|
|
|
31395
31395
|
this._iaddn(word);
|
|
31396
31396
|
}
|
|
31397
31397
|
}
|
|
31398
|
-
if (
|
|
31398
|
+
if (mod !== 0) {
|
|
31399
31399
|
var pow = 1;
|
|
31400
31400
|
word = parseBase(number, i2, number.length, base4);
|
|
31401
|
-
for (i2 = 0; i2 <
|
|
31401
|
+
for (i2 = 0; i2 < mod; i2++) {
|
|
31402
31402
|
pow *= base4;
|
|
31403
31403
|
}
|
|
31404
31404
|
this.imuln(pow);
|
|
@@ -33202,21 +33202,21 @@ var require_bn2 = __commonJS({
|
|
|
33202
33202
|
mod: new BN3(0)
|
|
33203
33203
|
};
|
|
33204
33204
|
}
|
|
33205
|
-
var div,
|
|
33205
|
+
var div, mod, res;
|
|
33206
33206
|
if (this.negative !== 0 && num.negative === 0) {
|
|
33207
33207
|
res = this.neg().divmod(num, mode);
|
|
33208
33208
|
if (mode !== "mod") {
|
|
33209
33209
|
div = res.div.neg();
|
|
33210
33210
|
}
|
|
33211
33211
|
if (mode !== "div") {
|
|
33212
|
-
|
|
33213
|
-
if (positive &&
|
|
33214
|
-
|
|
33212
|
+
mod = res.mod.neg();
|
|
33213
|
+
if (positive && mod.negative !== 0) {
|
|
33214
|
+
mod.iadd(num);
|
|
33215
33215
|
}
|
|
33216
33216
|
}
|
|
33217
33217
|
return {
|
|
33218
33218
|
div,
|
|
33219
|
-
mod
|
|
33219
|
+
mod
|
|
33220
33220
|
};
|
|
33221
33221
|
}
|
|
33222
33222
|
if (this.negative === 0 && num.negative !== 0) {
|
|
@@ -33232,14 +33232,14 @@ var require_bn2 = __commonJS({
|
|
|
33232
33232
|
if ((this.negative & num.negative) !== 0) {
|
|
33233
33233
|
res = this.neg().divmod(num.neg(), mode);
|
|
33234
33234
|
if (mode !== "div") {
|
|
33235
|
-
|
|
33236
|
-
if (positive &&
|
|
33237
|
-
|
|
33235
|
+
mod = res.mod.neg();
|
|
33236
|
+
if (positive && mod.negative !== 0) {
|
|
33237
|
+
mod.isub(num);
|
|
33238
33238
|
}
|
|
33239
33239
|
}
|
|
33240
33240
|
return {
|
|
33241
33241
|
div: res.div,
|
|
33242
|
-
mod
|
|
33242
|
+
mod
|
|
33243
33243
|
};
|
|
33244
33244
|
}
|
|
33245
33245
|
if (num.length > this.length || this.cmp(num) < 0) {
|
|
@@ -33271,7 +33271,7 @@ var require_bn2 = __commonJS({
|
|
|
33271
33271
|
BN3.prototype.div = /* @__PURE__ */ __name(function div(num) {
|
|
33272
33272
|
return this.divmod(num, "div", false).div;
|
|
33273
33273
|
}, "div");
|
|
33274
|
-
BN3.prototype.mod = /* @__PURE__ */ __name(function
|
|
33274
|
+
BN3.prototype.mod = /* @__PURE__ */ __name(function mod(num) {
|
|
33275
33275
|
return this.divmod(num, "mod", false).mod;
|
|
33276
33276
|
}, "mod");
|
|
33277
33277
|
BN3.prototype.umod = /* @__PURE__ */ __name(function umod(num) {
|
|
@@ -33281,10 +33281,10 @@ var require_bn2 = __commonJS({
|
|
|
33281
33281
|
var dm = this.divmod(num);
|
|
33282
33282
|
if (dm.mod.isZero())
|
|
33283
33283
|
return dm.div;
|
|
33284
|
-
var
|
|
33284
|
+
var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
|
|
33285
33285
|
var half = num.ushrn(1);
|
|
33286
33286
|
var r2 = num.andln(1);
|
|
33287
|
-
var cmp =
|
|
33287
|
+
var cmp = mod.cmp(half);
|
|
33288
33288
|
if (cmp < 0 || r2 === 1 && cmp === 0)
|
|
33289
33289
|
return dm.div;
|
|
33290
33290
|
return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
|
|
@@ -33941,12 +33941,12 @@ var require_bn2 = __commonJS({
|
|
|
33941
33941
|
var one = new BN3(1).toRed(this);
|
|
33942
33942
|
var nOne = one.redNeg();
|
|
33943
33943
|
var lpow = this.m.subn(1).iushrn(1);
|
|
33944
|
-
var
|
|
33945
|
-
|
|
33946
|
-
while (this.pow(
|
|
33947
|
-
|
|
33944
|
+
var z2 = this.m.bitLength();
|
|
33945
|
+
z2 = new BN3(2 * z2 * z2).toRed(this);
|
|
33946
|
+
while (this.pow(z2, lpow).cmp(nOne) !== 0) {
|
|
33947
|
+
z2.redIAdd(nOne);
|
|
33948
33948
|
}
|
|
33949
|
-
var c = this.pow(
|
|
33949
|
+
var c = this.pow(z2, q);
|
|
33950
33950
|
var r2 = this.pow(a2, q.addn(1).iushrn(1));
|
|
33951
33951
|
var t = this.pow(a2, q);
|
|
33952
33952
|
var m = s2;
|
|
@@ -41995,18 +41995,18 @@ var utils_1$1 = createCommonjsModule(function(module, exports) {
|
|
|
41995
41995
|
var ws = 1 << w + 1;
|
|
41996
41996
|
var k = num.clone();
|
|
41997
41997
|
for (i2 = 0; i2 < naf.length; i2++) {
|
|
41998
|
-
var
|
|
41999
|
-
var
|
|
41998
|
+
var z2;
|
|
41999
|
+
var mod = k.andln(ws - 1);
|
|
42000
42000
|
if (k.isOdd()) {
|
|
42001
|
-
if (
|
|
42002
|
-
|
|
42001
|
+
if (mod > (ws >> 1) - 1)
|
|
42002
|
+
z2 = (ws >> 1) - mod;
|
|
42003
42003
|
else
|
|
42004
|
-
|
|
42005
|
-
k.isubn(
|
|
42004
|
+
z2 = mod;
|
|
42005
|
+
k.isubn(z2);
|
|
42006
42006
|
} else {
|
|
42007
|
-
|
|
42007
|
+
z2 = 0;
|
|
42008
42008
|
}
|
|
42009
|
-
naf[i2] =
|
|
42009
|
+
naf[i2] = z2;
|
|
42010
42010
|
k.iushrn(1);
|
|
42011
42011
|
}
|
|
42012
42012
|
return naf;
|
|
@@ -42159,18 +42159,18 @@ BaseCurve.prototype._wnafMul = /* @__PURE__ */ __name(function _wnafMul(p, k) {
|
|
|
42159
42159
|
acc = acc.dblp(l);
|
|
42160
42160
|
if (i2 < 0)
|
|
42161
42161
|
break;
|
|
42162
|
-
var
|
|
42163
|
-
assert$1(
|
|
42162
|
+
var z2 = naf[i2];
|
|
42163
|
+
assert$1(z2 !== 0);
|
|
42164
42164
|
if (p.type === "affine") {
|
|
42165
|
-
if (
|
|
42166
|
-
acc = acc.mixedAdd(wnd[
|
|
42165
|
+
if (z2 > 0)
|
|
42166
|
+
acc = acc.mixedAdd(wnd[z2 - 1 >> 1]);
|
|
42167
42167
|
else
|
|
42168
|
-
acc = acc.mixedAdd(wnd[-
|
|
42168
|
+
acc = acc.mixedAdd(wnd[-z2 - 1 >> 1].neg());
|
|
42169
42169
|
} else {
|
|
42170
|
-
if (
|
|
42171
|
-
acc = acc.add(wnd[
|
|
42170
|
+
if (z2 > 0)
|
|
42171
|
+
acc = acc.add(wnd[z2 - 1 >> 1]);
|
|
42172
42172
|
else
|
|
42173
|
-
acc = acc.add(wnd[-
|
|
42173
|
+
acc = acc.add(wnd[-z2 - 1 >> 1].neg());
|
|
42174
42174
|
}
|
|
42175
42175
|
}
|
|
42176
42176
|
return p.type === "affine" ? acc.toP() : acc;
|
|
@@ -42260,14 +42260,14 @@ BaseCurve.prototype._wnafMulAdd = /* @__PURE__ */ __name(function _wnafMulAdd(de
|
|
|
42260
42260
|
if (i2 < 0)
|
|
42261
42261
|
break;
|
|
42262
42262
|
for (j = 0; j < len; j++) {
|
|
42263
|
-
var
|
|
42263
|
+
var z2 = tmp[j];
|
|
42264
42264
|
p;
|
|
42265
|
-
if (
|
|
42265
|
+
if (z2 === 0)
|
|
42266
42266
|
continue;
|
|
42267
|
-
else if (
|
|
42268
|
-
p = wnd[j][
|
|
42269
|
-
else if (
|
|
42270
|
-
p = wnd[j][-
|
|
42267
|
+
else if (z2 > 0)
|
|
42268
|
+
p = wnd[j][z2 - 1 >> 1];
|
|
42269
|
+
else if (z2 < 0)
|
|
42270
|
+
p = wnd[j][-z2 - 1 >> 1].neg();
|
|
42271
42271
|
if (p.type === "affine")
|
|
42272
42272
|
acc = acc.mixedAdd(p);
|
|
42273
42273
|
else
|
|
@@ -42796,16 +42796,16 @@ Point.prototype.toJ = /* @__PURE__ */ __name(function toJ() {
|
|
|
42796
42796
|
var res = this.curve.jpoint(this.x, this.y, this.curve.one);
|
|
42797
42797
|
return res;
|
|
42798
42798
|
}, "toJ");
|
|
42799
|
-
function JPoint(curve, x, y,
|
|
42799
|
+
function JPoint(curve, x, y, z2) {
|
|
42800
42800
|
base3.BasePoint.call(this, curve, "jacobian");
|
|
42801
|
-
if (x === null && y === null &&
|
|
42801
|
+
if (x === null && y === null && z2 === null) {
|
|
42802
42802
|
this.x = this.curve.one;
|
|
42803
42803
|
this.y = this.curve.one;
|
|
42804
42804
|
this.z = new import_bn2.default(0);
|
|
42805
42805
|
} else {
|
|
42806
42806
|
this.x = new import_bn2.default(x, 16);
|
|
42807
42807
|
this.y = new import_bn2.default(y, 16);
|
|
42808
|
-
this.z = new import_bn2.default(
|
|
42808
|
+
this.z = new import_bn2.default(z2, 16);
|
|
42809
42809
|
}
|
|
42810
42810
|
if (!this.x.red)
|
|
42811
42811
|
this.x = this.x.toRed(this.curve.red);
|
|
@@ -42817,8 +42817,8 @@ function JPoint(curve, x, y, z) {
|
|
|
42817
42817
|
}
|
|
42818
42818
|
__name(JPoint, "JPoint");
|
|
42819
42819
|
inherits_browser(JPoint, base3.BasePoint);
|
|
42820
|
-
ShortCurve.prototype.jpoint = /* @__PURE__ */ __name(function jpoint(x, y,
|
|
42821
|
-
return new JPoint(this, x, y,
|
|
42820
|
+
ShortCurve.prototype.jpoint = /* @__PURE__ */ __name(function jpoint(x, y, z2) {
|
|
42821
|
+
return new JPoint(this, x, y, z2);
|
|
42822
42822
|
}, "jpoint");
|
|
42823
42823
|
JPoint.prototype.toP = /* @__PURE__ */ __name(function toP() {
|
|
42824
42824
|
if (this.isInfinity())
|
|
@@ -49922,7 +49922,7 @@ var CeramicClient = class {
|
|
|
49922
49922
|
};
|
|
49923
49923
|
__name(CeramicClient, "CeramicClient");
|
|
49924
49924
|
|
|
49925
|
-
// ../../../node_modules/.pnpm/zod@3.
|
|
49925
|
+
// ../../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs
|
|
49926
49926
|
var util;
|
|
49927
49927
|
(function(util2) {
|
|
49928
49928
|
util2.assertEqual = (val) => val;
|
|
@@ -49984,6 +49984,15 @@ var util;
|
|
|
49984
49984
|
return value;
|
|
49985
49985
|
};
|
|
49986
49986
|
})(util || (util = {}));
|
|
49987
|
+
var objectUtil;
|
|
49988
|
+
(function(objectUtil2) {
|
|
49989
|
+
objectUtil2.mergeShapes = (first2, second) => {
|
|
49990
|
+
return {
|
|
49991
|
+
...first2,
|
|
49992
|
+
...second
|
|
49993
|
+
};
|
|
49994
|
+
};
|
|
49995
|
+
})(objectUtil || (objectUtil = {}));
|
|
49987
49996
|
var ZodParsedType = util.arrayToEnum([
|
|
49988
49997
|
"string",
|
|
49989
49998
|
"nan",
|
|
@@ -50127,6 +50136,11 @@ var ZodError = class extends Error {
|
|
|
50127
50136
|
processError(this);
|
|
50128
50137
|
return fieldErrors;
|
|
50129
50138
|
}
|
|
50139
|
+
static assert(value) {
|
|
50140
|
+
if (!(value instanceof ZodError)) {
|
|
50141
|
+
throw new Error(`Not a ZodError: ${value}`);
|
|
50142
|
+
}
|
|
50143
|
+
}
|
|
50130
50144
|
toString() {
|
|
50131
50145
|
return this.message;
|
|
50132
50146
|
}
|
|
@@ -50194,7 +50208,12 @@ var errorMap = /* @__PURE__ */ __name((issue, _ctx) => {
|
|
|
50194
50208
|
break;
|
|
50195
50209
|
case ZodIssueCode.invalid_string:
|
|
50196
50210
|
if (typeof issue.validation === "object") {
|
|
50197
|
-
if ("
|
|
50211
|
+
if ("includes" in issue.validation) {
|
|
50212
|
+
message = `Invalid input: must include "${issue.validation.includes}"`;
|
|
50213
|
+
if (typeof issue.validation.position === "number") {
|
|
50214
|
+
message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
|
|
50215
|
+
}
|
|
50216
|
+
} else if ("startsWith" in issue.validation) {
|
|
50198
50217
|
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
|
|
50199
50218
|
} else if ("endsWith" in issue.validation) {
|
|
50200
50219
|
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
|
@@ -50215,7 +50234,7 @@ var errorMap = /* @__PURE__ */ __name((issue, _ctx) => {
|
|
|
50215
50234
|
else if (issue.type === "number")
|
|
50216
50235
|
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
50217
50236
|
else if (issue.type === "date")
|
|
50218
|
-
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(issue.minimum)}`;
|
|
50237
|
+
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
|
|
50219
50238
|
else
|
|
50220
50239
|
message = "Invalid input";
|
|
50221
50240
|
break;
|
|
@@ -50226,8 +50245,10 @@ var errorMap = /* @__PURE__ */ __name((issue, _ctx) => {
|
|
|
50226
50245
|
message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
|
50227
50246
|
else if (issue.type === "number")
|
|
50228
50247
|
message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
|
50248
|
+
else if (issue.type === "bigint")
|
|
50249
|
+
message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
|
50229
50250
|
else if (issue.type === "date")
|
|
50230
|
-
message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(issue.maximum)}`;
|
|
50251
|
+
message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
|
|
50231
50252
|
else
|
|
50232
50253
|
message = "Invalid input";
|
|
50233
50254
|
break;
|
|
@@ -50265,6 +50286,13 @@ var makeIssue = /* @__PURE__ */ __name((params) => {
|
|
|
50265
50286
|
...issueData,
|
|
50266
50287
|
path: fullPath
|
|
50267
50288
|
};
|
|
50289
|
+
if (issueData.message !== void 0) {
|
|
50290
|
+
return {
|
|
50291
|
+
...issueData,
|
|
50292
|
+
path: fullPath,
|
|
50293
|
+
message: issueData.message
|
|
50294
|
+
};
|
|
50295
|
+
}
|
|
50268
50296
|
let errorMessage = "";
|
|
50269
50297
|
const maps = errorMaps.filter((m) => !!m).slice().reverse();
|
|
50270
50298
|
for (const map2 of maps) {
|
|
@@ -50273,11 +50301,12 @@ var makeIssue = /* @__PURE__ */ __name((params) => {
|
|
|
50273
50301
|
return {
|
|
50274
50302
|
...issueData,
|
|
50275
50303
|
path: fullPath,
|
|
50276
|
-
message:
|
|
50304
|
+
message: errorMessage
|
|
50277
50305
|
};
|
|
50278
50306
|
}, "makeIssue");
|
|
50279
50307
|
var EMPTY_PATH = [];
|
|
50280
50308
|
function addIssueToContext(ctx, issueData) {
|
|
50309
|
+
const overrideMap = getErrorMap();
|
|
50281
50310
|
const issue = makeIssue({
|
|
50282
50311
|
issueData,
|
|
50283
50312
|
data: ctx.data,
|
|
@@ -50285,8 +50314,8 @@ function addIssueToContext(ctx, issueData) {
|
|
|
50285
50314
|
errorMaps: [
|
|
50286
50315
|
ctx.common.contextualErrorMap,
|
|
50287
50316
|
ctx.schemaErrorMap,
|
|
50288
|
-
|
|
50289
|
-
errorMap
|
|
50317
|
+
overrideMap,
|
|
50318
|
+
overrideMap === errorMap ? void 0 : errorMap
|
|
50290
50319
|
].filter((x) => !!x)
|
|
50291
50320
|
});
|
|
50292
50321
|
ctx.common.issues.push(issue);
|
|
@@ -50318,9 +50347,11 @@ var ParseStatus = class {
|
|
|
50318
50347
|
static async mergeObjectAsync(status, pairs) {
|
|
50319
50348
|
const syncPairs = [];
|
|
50320
50349
|
for (const pair of pairs) {
|
|
50350
|
+
const key2 = await pair.key;
|
|
50351
|
+
const value = await pair.value;
|
|
50321
50352
|
syncPairs.push({
|
|
50322
|
-
key:
|
|
50323
|
-
value
|
|
50353
|
+
key: key2,
|
|
50354
|
+
value
|
|
50324
50355
|
});
|
|
50325
50356
|
}
|
|
50326
50357
|
return ParseStatus.mergeObjectSync(status, syncPairs);
|
|
@@ -50337,7 +50368,7 @@ var ParseStatus = class {
|
|
|
50337
50368
|
status.dirty();
|
|
50338
50369
|
if (value.status === "dirty")
|
|
50339
50370
|
status.dirty();
|
|
50340
|
-
if (typeof value.value !== "undefined" || pair.alwaysSet) {
|
|
50371
|
+
if (key2.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
|
|
50341
50372
|
finalObject[key2.value] = value.value;
|
|
50342
50373
|
}
|
|
50343
50374
|
}
|
|
@@ -50353,21 +50384,49 @@ var OK = /* @__PURE__ */ __name((value) => ({ status: "valid", value }), "OK");
|
|
|
50353
50384
|
var isAborted = /* @__PURE__ */ __name((x) => x.status === "aborted", "isAborted");
|
|
50354
50385
|
var isDirty = /* @__PURE__ */ __name((x) => x.status === "dirty", "isDirty");
|
|
50355
50386
|
var isValid = /* @__PURE__ */ __name((x) => x.status === "valid", "isValid");
|
|
50356
|
-
var isAsync = /* @__PURE__ */ __name((x) => typeof Promise !==
|
|
50387
|
+
var isAsync = /* @__PURE__ */ __name((x) => typeof Promise !== "undefined" && x instanceof Promise, "isAsync");
|
|
50388
|
+
function __classPrivateFieldGet2(receiver, state, kind, f) {
|
|
50389
|
+
if (kind === "a" && !f)
|
|
50390
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
50391
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
50392
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
50393
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
50394
|
+
}
|
|
50395
|
+
__name(__classPrivateFieldGet2, "__classPrivateFieldGet");
|
|
50396
|
+
function __classPrivateFieldSet2(receiver, state, value, kind, f) {
|
|
50397
|
+
if (kind === "m")
|
|
50398
|
+
throw new TypeError("Private method is not writable");
|
|
50399
|
+
if (kind === "a" && !f)
|
|
50400
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
50401
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
50402
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
50403
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
50404
|
+
}
|
|
50405
|
+
__name(__classPrivateFieldSet2, "__classPrivateFieldSet");
|
|
50357
50406
|
var errorUtil;
|
|
50358
50407
|
(function(errorUtil2) {
|
|
50359
50408
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
50360
50409
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
|
|
50361
50410
|
})(errorUtil || (errorUtil = {}));
|
|
50411
|
+
var _ZodEnum_cache;
|
|
50412
|
+
var _ZodNativeEnum_cache;
|
|
50362
50413
|
var ParseInputLazyPath = class {
|
|
50363
50414
|
constructor(parent, value, path, key2) {
|
|
50415
|
+
this._cachedPath = [];
|
|
50364
50416
|
this.parent = parent;
|
|
50365
50417
|
this.data = value;
|
|
50366
50418
|
this._path = path;
|
|
50367
50419
|
this._key = key2;
|
|
50368
50420
|
}
|
|
50369
50421
|
get path() {
|
|
50370
|
-
|
|
50422
|
+
if (!this._cachedPath.length) {
|
|
50423
|
+
if (this._key instanceof Array) {
|
|
50424
|
+
this._cachedPath.push(...this._path, ...this._key);
|
|
50425
|
+
} else {
|
|
50426
|
+
this._cachedPath.push(...this._path, this._key);
|
|
50427
|
+
}
|
|
50428
|
+
}
|
|
50429
|
+
return this._cachedPath;
|
|
50371
50430
|
}
|
|
50372
50431
|
};
|
|
50373
50432
|
__name(ParseInputLazyPath, "ParseInputLazyPath");
|
|
@@ -50378,8 +50437,16 @@ var handleResult = /* @__PURE__ */ __name((ctx, result) => {
|
|
|
50378
50437
|
if (!ctx.common.issues.length) {
|
|
50379
50438
|
throw new Error("Validation failed but no issues detected.");
|
|
50380
50439
|
}
|
|
50381
|
-
|
|
50382
|
-
|
|
50440
|
+
return {
|
|
50441
|
+
success: false,
|
|
50442
|
+
get error() {
|
|
50443
|
+
if (this._error)
|
|
50444
|
+
return this._error;
|
|
50445
|
+
const error = new ZodError(ctx.common.issues);
|
|
50446
|
+
this._error = error;
|
|
50447
|
+
return this._error;
|
|
50448
|
+
}
|
|
50449
|
+
};
|
|
50383
50450
|
}
|
|
50384
50451
|
}, "handleResult");
|
|
50385
50452
|
function processCreateParams(params) {
|
|
@@ -50392,12 +50459,17 @@ function processCreateParams(params) {
|
|
|
50392
50459
|
if (errorMap2)
|
|
50393
50460
|
return { errorMap: errorMap2, description };
|
|
50394
50461
|
const customMap = /* @__PURE__ */ __name((iss, ctx) => {
|
|
50395
|
-
|
|
50396
|
-
|
|
50462
|
+
var _a, _b;
|
|
50463
|
+
const { message } = params;
|
|
50464
|
+
if (iss.code === "invalid_enum_value") {
|
|
50465
|
+
return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
|
|
50466
|
+
}
|
|
50397
50467
|
if (typeof ctx.data === "undefined") {
|
|
50398
|
-
return { message:
|
|
50468
|
+
return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
|
|
50399
50469
|
}
|
|
50400
|
-
|
|
50470
|
+
if (iss.code !== "invalid_type")
|
|
50471
|
+
return { message: ctx.defaultError };
|
|
50472
|
+
return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
|
|
50401
50473
|
}, "customMap");
|
|
50402
50474
|
return { errorMap: customMap, description };
|
|
50403
50475
|
}
|
|
@@ -50427,6 +50499,7 @@ var ZodType = class {
|
|
|
50427
50499
|
this.catch = this.catch.bind(this);
|
|
50428
50500
|
this.describe = this.describe.bind(this);
|
|
50429
50501
|
this.pipe = this.pipe.bind(this);
|
|
50502
|
+
this.readonly = this.readonly.bind(this);
|
|
50430
50503
|
this.isNullable = this.isNullable.bind(this);
|
|
50431
50504
|
this.isOptional = this.isOptional.bind(this);
|
|
50432
50505
|
}
|
|
@@ -50571,28 +50644,29 @@ var ZodType = class {
|
|
|
50571
50644
|
return this._refinement(refinement);
|
|
50572
50645
|
}
|
|
50573
50646
|
optional() {
|
|
50574
|
-
return ZodOptional.create(this);
|
|
50647
|
+
return ZodOptional.create(this, this._def);
|
|
50575
50648
|
}
|
|
50576
50649
|
nullable() {
|
|
50577
|
-
return ZodNullable.create(this);
|
|
50650
|
+
return ZodNullable.create(this, this._def);
|
|
50578
50651
|
}
|
|
50579
50652
|
nullish() {
|
|
50580
|
-
return this.
|
|
50653
|
+
return this.nullable().optional();
|
|
50581
50654
|
}
|
|
50582
50655
|
array() {
|
|
50583
|
-
return ZodArray.create(this);
|
|
50656
|
+
return ZodArray.create(this, this._def);
|
|
50584
50657
|
}
|
|
50585
50658
|
promise() {
|
|
50586
|
-
return ZodPromise.create(this);
|
|
50659
|
+
return ZodPromise.create(this, this._def);
|
|
50587
50660
|
}
|
|
50588
50661
|
or(option) {
|
|
50589
|
-
return ZodUnion.create([this, option]);
|
|
50662
|
+
return ZodUnion.create([this, option], this._def);
|
|
50590
50663
|
}
|
|
50591
50664
|
and(incoming) {
|
|
50592
|
-
return ZodIntersection.create(this, incoming);
|
|
50665
|
+
return ZodIntersection.create(this, incoming, this._def);
|
|
50593
50666
|
}
|
|
50594
50667
|
transform(transform) {
|
|
50595
50668
|
return new ZodEffects({
|
|
50669
|
+
...processCreateParams(this._def),
|
|
50596
50670
|
schema: this,
|
|
50597
50671
|
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
|
50598
50672
|
effect: { type: "transform", transform }
|
|
@@ -50601,6 +50675,7 @@ var ZodType = class {
|
|
|
50601
50675
|
default(def) {
|
|
50602
50676
|
const defaultValueFunc = typeof def === "function" ? def : () => def;
|
|
50603
50677
|
return new ZodDefault({
|
|
50678
|
+
...processCreateParams(this._def),
|
|
50604
50679
|
innerType: this,
|
|
50605
50680
|
defaultValue: defaultValueFunc,
|
|
50606
50681
|
typeName: ZodFirstPartyTypeKind.ZodDefault
|
|
@@ -50610,14 +50685,15 @@ var ZodType = class {
|
|
|
50610
50685
|
return new ZodBranded({
|
|
50611
50686
|
typeName: ZodFirstPartyTypeKind.ZodBranded,
|
|
50612
50687
|
type: this,
|
|
50613
|
-
...processCreateParams(
|
|
50688
|
+
...processCreateParams(this._def)
|
|
50614
50689
|
});
|
|
50615
50690
|
}
|
|
50616
50691
|
catch(def) {
|
|
50617
|
-
const
|
|
50692
|
+
const catchValueFunc = typeof def === "function" ? def : () => def;
|
|
50618
50693
|
return new ZodCatch({
|
|
50694
|
+
...processCreateParams(this._def),
|
|
50619
50695
|
innerType: this,
|
|
50620
|
-
|
|
50696
|
+
catchValue: catchValueFunc,
|
|
50621
50697
|
typeName: ZodFirstPartyTypeKind.ZodCatch
|
|
50622
50698
|
});
|
|
50623
50699
|
}
|
|
@@ -50631,6 +50707,9 @@ var ZodType = class {
|
|
|
50631
50707
|
pipe(target) {
|
|
50632
50708
|
return ZodPipeline.create(this, target);
|
|
50633
50709
|
}
|
|
50710
|
+
readonly() {
|
|
50711
|
+
return ZodReadonly.create(this);
|
|
50712
|
+
}
|
|
50634
50713
|
isOptional() {
|
|
50635
50714
|
return this.safeParse(void 0).success;
|
|
50636
50715
|
}
|
|
@@ -50640,43 +50719,54 @@ var ZodType = class {
|
|
|
50640
50719
|
};
|
|
50641
50720
|
__name(ZodType, "ZodType");
|
|
50642
50721
|
var cuidRegex = /^c[^\s-]{8,}$/i;
|
|
50643
|
-
var
|
|
50644
|
-
var
|
|
50645
|
-
var
|
|
50722
|
+
var cuid2Regex = /^[0-9a-z]+$/;
|
|
50723
|
+
var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
|
|
50724
|
+
var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
|
|
50725
|
+
var nanoidRegex = /^[a-z0-9_-]{21}$/i;
|
|
50726
|
+
var durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
|
50727
|
+
var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
|
50728
|
+
var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
50729
|
+
var emojiRegex;
|
|
50730
|
+
var ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
|
50731
|
+
var ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
|
|
50732
|
+
var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
50733
|
+
var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
|
50734
|
+
var dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
50735
|
+
function timeRegexSource(args) {
|
|
50736
|
+
let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
|
|
50646
50737
|
if (args.precision) {
|
|
50647
|
-
|
|
50648
|
-
|
|
50649
|
-
|
|
50650
|
-
|
|
50651
|
-
|
|
50652
|
-
|
|
50653
|
-
|
|
50654
|
-
|
|
50655
|
-
|
|
50656
|
-
|
|
50657
|
-
|
|
50658
|
-
|
|
50659
|
-
|
|
50660
|
-
|
|
50661
|
-
|
|
50662
|
-
|
|
50663
|
-
}
|
|
50738
|
+
regex = `${regex}\\.\\d{${args.precision}}`;
|
|
50739
|
+
} else if (args.precision == null) {
|
|
50740
|
+
regex = `${regex}(\\.\\d+)?`;
|
|
50741
|
+
}
|
|
50742
|
+
return regex;
|
|
50743
|
+
}
|
|
50744
|
+
__name(timeRegexSource, "timeRegexSource");
|
|
50745
|
+
function timeRegex(args) {
|
|
50746
|
+
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
50747
|
+
}
|
|
50748
|
+
__name(timeRegex, "timeRegex");
|
|
50749
|
+
function datetimeRegex(args) {
|
|
50750
|
+
let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
|
|
50751
|
+
const opts = [];
|
|
50752
|
+
opts.push(args.local ? `Z?` : `Z`);
|
|
50753
|
+
if (args.offset)
|
|
50754
|
+
opts.push(`([+-]\\d{2}:?\\d{2})`);
|
|
50755
|
+
regex = `${regex}(${opts.join("|")})`;
|
|
50756
|
+
return new RegExp(`^${regex}$`);
|
|
50757
|
+
}
|
|
50758
|
+
__name(datetimeRegex, "datetimeRegex");
|
|
50759
|
+
function isValidIP(ip, version11) {
|
|
50760
|
+
if ((version11 === "v4" || !version11) && ipv4Regex.test(ip)) {
|
|
50761
|
+
return true;
|
|
50664
50762
|
}
|
|
50665
|
-
|
|
50666
|
-
|
|
50667
|
-
constructor() {
|
|
50668
|
-
super(...arguments);
|
|
50669
|
-
this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {
|
|
50670
|
-
validation,
|
|
50671
|
-
code: ZodIssueCode.invalid_string,
|
|
50672
|
-
...errorUtil.errToObj(message)
|
|
50673
|
-
});
|
|
50674
|
-
this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));
|
|
50675
|
-
this.trim = () => new ZodString({
|
|
50676
|
-
...this._def,
|
|
50677
|
-
checks: [...this._def.checks, { kind: "trim" }]
|
|
50678
|
-
});
|
|
50763
|
+
if ((version11 === "v6" || !version11) && ipv6Regex.test(ip)) {
|
|
50764
|
+
return true;
|
|
50679
50765
|
}
|
|
50766
|
+
return false;
|
|
50767
|
+
}
|
|
50768
|
+
__name(isValidIP, "isValidIP");
|
|
50769
|
+
var ZodString = class extends ZodType {
|
|
50680
50770
|
_parse(input) {
|
|
50681
50771
|
if (this._def.coerce) {
|
|
50682
50772
|
input.data = String(input.data);
|
|
@@ -50684,14 +50774,11 @@ var ZodString = class extends ZodType {
|
|
|
50684
50774
|
const parsedType = this._getType(input);
|
|
50685
50775
|
if (parsedType !== ZodParsedType.string) {
|
|
50686
50776
|
const ctx2 = this._getOrReturnCtx(input);
|
|
50687
|
-
addIssueToContext(
|
|
50688
|
-
|
|
50689
|
-
|
|
50690
|
-
|
|
50691
|
-
|
|
50692
|
-
received: ctx2.parsedType
|
|
50693
|
-
}
|
|
50694
|
-
);
|
|
50777
|
+
addIssueToContext(ctx2, {
|
|
50778
|
+
code: ZodIssueCode.invalid_type,
|
|
50779
|
+
expected: ZodParsedType.string,
|
|
50780
|
+
received: ctx2.parsedType
|
|
50781
|
+
});
|
|
50695
50782
|
return INVALID;
|
|
50696
50783
|
}
|
|
50697
50784
|
const status = new ParseStatus();
|
|
@@ -50759,6 +50846,19 @@ var ZodString = class extends ZodType {
|
|
|
50759
50846
|
});
|
|
50760
50847
|
status.dirty();
|
|
50761
50848
|
}
|
|
50849
|
+
} else if (check.kind === "emoji") {
|
|
50850
|
+
if (!emojiRegex) {
|
|
50851
|
+
emojiRegex = new RegExp(_emojiRegex, "u");
|
|
50852
|
+
}
|
|
50853
|
+
if (!emojiRegex.test(input.data)) {
|
|
50854
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
50855
|
+
addIssueToContext(ctx, {
|
|
50856
|
+
validation: "emoji",
|
|
50857
|
+
code: ZodIssueCode.invalid_string,
|
|
50858
|
+
message: check.message
|
|
50859
|
+
});
|
|
50860
|
+
status.dirty();
|
|
50861
|
+
}
|
|
50762
50862
|
} else if (check.kind === "uuid") {
|
|
50763
50863
|
if (!uuidRegex.test(input.data)) {
|
|
50764
50864
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
@@ -50769,6 +50869,16 @@ var ZodString = class extends ZodType {
|
|
|
50769
50869
|
});
|
|
50770
50870
|
status.dirty();
|
|
50771
50871
|
}
|
|
50872
|
+
} else if (check.kind === "nanoid") {
|
|
50873
|
+
if (!nanoidRegex.test(input.data)) {
|
|
50874
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
50875
|
+
addIssueToContext(ctx, {
|
|
50876
|
+
validation: "nanoid",
|
|
50877
|
+
code: ZodIssueCode.invalid_string,
|
|
50878
|
+
message: check.message
|
|
50879
|
+
});
|
|
50880
|
+
status.dirty();
|
|
50881
|
+
}
|
|
50772
50882
|
} else if (check.kind === "cuid") {
|
|
50773
50883
|
if (!cuidRegex.test(input.data)) {
|
|
50774
50884
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
@@ -50779,6 +50889,26 @@ var ZodString = class extends ZodType {
|
|
|
50779
50889
|
});
|
|
50780
50890
|
status.dirty();
|
|
50781
50891
|
}
|
|
50892
|
+
} else if (check.kind === "cuid2") {
|
|
50893
|
+
if (!cuid2Regex.test(input.data)) {
|
|
50894
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
50895
|
+
addIssueToContext(ctx, {
|
|
50896
|
+
validation: "cuid2",
|
|
50897
|
+
code: ZodIssueCode.invalid_string,
|
|
50898
|
+
message: check.message
|
|
50899
|
+
});
|
|
50900
|
+
status.dirty();
|
|
50901
|
+
}
|
|
50902
|
+
} else if (check.kind === "ulid") {
|
|
50903
|
+
if (!ulidRegex.test(input.data)) {
|
|
50904
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
50905
|
+
addIssueToContext(ctx, {
|
|
50906
|
+
validation: "ulid",
|
|
50907
|
+
code: ZodIssueCode.invalid_string,
|
|
50908
|
+
message: check.message
|
|
50909
|
+
});
|
|
50910
|
+
status.dirty();
|
|
50911
|
+
}
|
|
50782
50912
|
} else if (check.kind === "url") {
|
|
50783
50913
|
try {
|
|
50784
50914
|
new URL(input.data);
|
|
@@ -50805,6 +50935,20 @@ var ZodString = class extends ZodType {
|
|
|
50805
50935
|
}
|
|
50806
50936
|
} else if (check.kind === "trim") {
|
|
50807
50937
|
input.data = input.data.trim();
|
|
50938
|
+
} else if (check.kind === "includes") {
|
|
50939
|
+
if (!input.data.includes(check.value, check.position)) {
|
|
50940
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
50941
|
+
addIssueToContext(ctx, {
|
|
50942
|
+
code: ZodIssueCode.invalid_string,
|
|
50943
|
+
validation: { includes: check.value, position: check.position },
|
|
50944
|
+
message: check.message
|
|
50945
|
+
});
|
|
50946
|
+
status.dirty();
|
|
50947
|
+
}
|
|
50948
|
+
} else if (check.kind === "toLowerCase") {
|
|
50949
|
+
input.data = input.data.toLowerCase();
|
|
50950
|
+
} else if (check.kind === "toUpperCase") {
|
|
50951
|
+
input.data = input.data.toUpperCase();
|
|
50808
50952
|
} else if (check.kind === "startsWith") {
|
|
50809
50953
|
if (!input.data.startsWith(check.value)) {
|
|
50810
50954
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
@@ -50836,12 +50980,71 @@ var ZodString = class extends ZodType {
|
|
|
50836
50980
|
});
|
|
50837
50981
|
status.dirty();
|
|
50838
50982
|
}
|
|
50983
|
+
} else if (check.kind === "date") {
|
|
50984
|
+
const regex = dateRegex;
|
|
50985
|
+
if (!regex.test(input.data)) {
|
|
50986
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
50987
|
+
addIssueToContext(ctx, {
|
|
50988
|
+
code: ZodIssueCode.invalid_string,
|
|
50989
|
+
validation: "date",
|
|
50990
|
+
message: check.message
|
|
50991
|
+
});
|
|
50992
|
+
status.dirty();
|
|
50993
|
+
}
|
|
50994
|
+
} else if (check.kind === "time") {
|
|
50995
|
+
const regex = timeRegex(check);
|
|
50996
|
+
if (!regex.test(input.data)) {
|
|
50997
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
50998
|
+
addIssueToContext(ctx, {
|
|
50999
|
+
code: ZodIssueCode.invalid_string,
|
|
51000
|
+
validation: "time",
|
|
51001
|
+
message: check.message
|
|
51002
|
+
});
|
|
51003
|
+
status.dirty();
|
|
51004
|
+
}
|
|
51005
|
+
} else if (check.kind === "duration") {
|
|
51006
|
+
if (!durationRegex.test(input.data)) {
|
|
51007
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
51008
|
+
addIssueToContext(ctx, {
|
|
51009
|
+
validation: "duration",
|
|
51010
|
+
code: ZodIssueCode.invalid_string,
|
|
51011
|
+
message: check.message
|
|
51012
|
+
});
|
|
51013
|
+
status.dirty();
|
|
51014
|
+
}
|
|
51015
|
+
} else if (check.kind === "ip") {
|
|
51016
|
+
if (!isValidIP(input.data, check.version)) {
|
|
51017
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
51018
|
+
addIssueToContext(ctx, {
|
|
51019
|
+
validation: "ip",
|
|
51020
|
+
code: ZodIssueCode.invalid_string,
|
|
51021
|
+
message: check.message
|
|
51022
|
+
});
|
|
51023
|
+
status.dirty();
|
|
51024
|
+
}
|
|
51025
|
+
} else if (check.kind === "base64") {
|
|
51026
|
+
if (!base64Regex.test(input.data)) {
|
|
51027
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
51028
|
+
addIssueToContext(ctx, {
|
|
51029
|
+
validation: "base64",
|
|
51030
|
+
code: ZodIssueCode.invalid_string,
|
|
51031
|
+
message: check.message
|
|
51032
|
+
});
|
|
51033
|
+
status.dirty();
|
|
51034
|
+
}
|
|
50839
51035
|
} else {
|
|
50840
51036
|
util.assertNever(check);
|
|
50841
51037
|
}
|
|
50842
51038
|
}
|
|
50843
51039
|
return { status: status.value, value: input.data };
|
|
50844
51040
|
}
|
|
51041
|
+
_regex(regex, validation, message) {
|
|
51042
|
+
return this.refinement((data) => regex.test(data), {
|
|
51043
|
+
validation,
|
|
51044
|
+
code: ZodIssueCode.invalid_string,
|
|
51045
|
+
...errorUtil.errToObj(message)
|
|
51046
|
+
});
|
|
51047
|
+
}
|
|
50845
51048
|
_addCheck(check) {
|
|
50846
51049
|
return new ZodString({
|
|
50847
51050
|
...this._def,
|
|
@@ -50854,19 +51057,38 @@ var ZodString = class extends ZodType {
|
|
|
50854
51057
|
url(message) {
|
|
50855
51058
|
return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) });
|
|
50856
51059
|
}
|
|
51060
|
+
emoji(message) {
|
|
51061
|
+
return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) });
|
|
51062
|
+
}
|
|
50857
51063
|
uuid(message) {
|
|
50858
51064
|
return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
|
|
50859
51065
|
}
|
|
51066
|
+
nanoid(message) {
|
|
51067
|
+
return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
|
|
51068
|
+
}
|
|
50860
51069
|
cuid(message) {
|
|
50861
51070
|
return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
|
|
50862
51071
|
}
|
|
51072
|
+
cuid2(message) {
|
|
51073
|
+
return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
|
|
51074
|
+
}
|
|
51075
|
+
ulid(message) {
|
|
51076
|
+
return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
|
|
51077
|
+
}
|
|
51078
|
+
base64(message) {
|
|
51079
|
+
return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
|
|
51080
|
+
}
|
|
51081
|
+
ip(options) {
|
|
51082
|
+
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
|
|
51083
|
+
}
|
|
50863
51084
|
datetime(options) {
|
|
50864
|
-
var _a;
|
|
51085
|
+
var _a, _b;
|
|
50865
51086
|
if (typeof options === "string") {
|
|
50866
51087
|
return this._addCheck({
|
|
50867
51088
|
kind: "datetime",
|
|
50868
51089
|
precision: null,
|
|
50869
51090
|
offset: false,
|
|
51091
|
+
local: false,
|
|
50870
51092
|
message: options
|
|
50871
51093
|
});
|
|
50872
51094
|
}
|
|
@@ -50874,9 +51096,30 @@ var ZodString = class extends ZodType {
|
|
|
50874
51096
|
kind: "datetime",
|
|
50875
51097
|
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
|
50876
51098
|
offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
|
|
51099
|
+
local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
|
|
51100
|
+
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
|
51101
|
+
});
|
|
51102
|
+
}
|
|
51103
|
+
date(message) {
|
|
51104
|
+
return this._addCheck({ kind: "date", message });
|
|
51105
|
+
}
|
|
51106
|
+
time(options) {
|
|
51107
|
+
if (typeof options === "string") {
|
|
51108
|
+
return this._addCheck({
|
|
51109
|
+
kind: "time",
|
|
51110
|
+
precision: null,
|
|
51111
|
+
message: options
|
|
51112
|
+
});
|
|
51113
|
+
}
|
|
51114
|
+
return this._addCheck({
|
|
51115
|
+
kind: "time",
|
|
51116
|
+
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
|
50877
51117
|
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
|
50878
51118
|
});
|
|
50879
51119
|
}
|
|
51120
|
+
duration(message) {
|
|
51121
|
+
return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
|
|
51122
|
+
}
|
|
50880
51123
|
regex(regex, message) {
|
|
50881
51124
|
return this._addCheck({
|
|
50882
51125
|
kind: "regex",
|
|
@@ -50884,6 +51127,14 @@ var ZodString = class extends ZodType {
|
|
|
50884
51127
|
...errorUtil.errToObj(message)
|
|
50885
51128
|
});
|
|
50886
51129
|
}
|
|
51130
|
+
includes(value, options) {
|
|
51131
|
+
return this._addCheck({
|
|
51132
|
+
kind: "includes",
|
|
51133
|
+
value,
|
|
51134
|
+
position: options === null || options === void 0 ? void 0 : options.position,
|
|
51135
|
+
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
|
51136
|
+
});
|
|
51137
|
+
}
|
|
50887
51138
|
startsWith(value, message) {
|
|
50888
51139
|
return this._addCheck({
|
|
50889
51140
|
kind: "startsWith",
|
|
@@ -50919,21 +51170,69 @@ var ZodString = class extends ZodType {
|
|
|
50919
51170
|
...errorUtil.errToObj(message)
|
|
50920
51171
|
});
|
|
50921
51172
|
}
|
|
51173
|
+
nonempty(message) {
|
|
51174
|
+
return this.min(1, errorUtil.errToObj(message));
|
|
51175
|
+
}
|
|
51176
|
+
trim() {
|
|
51177
|
+
return new ZodString({
|
|
51178
|
+
...this._def,
|
|
51179
|
+
checks: [...this._def.checks, { kind: "trim" }]
|
|
51180
|
+
});
|
|
51181
|
+
}
|
|
51182
|
+
toLowerCase() {
|
|
51183
|
+
return new ZodString({
|
|
51184
|
+
...this._def,
|
|
51185
|
+
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
51186
|
+
});
|
|
51187
|
+
}
|
|
51188
|
+
toUpperCase() {
|
|
51189
|
+
return new ZodString({
|
|
51190
|
+
...this._def,
|
|
51191
|
+
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
51192
|
+
});
|
|
51193
|
+
}
|
|
50922
51194
|
get isDatetime() {
|
|
50923
51195
|
return !!this._def.checks.find((ch) => ch.kind === "datetime");
|
|
50924
51196
|
}
|
|
51197
|
+
get isDate() {
|
|
51198
|
+
return !!this._def.checks.find((ch) => ch.kind === "date");
|
|
51199
|
+
}
|
|
51200
|
+
get isTime() {
|
|
51201
|
+
return !!this._def.checks.find((ch) => ch.kind === "time");
|
|
51202
|
+
}
|
|
51203
|
+
get isDuration() {
|
|
51204
|
+
return !!this._def.checks.find((ch) => ch.kind === "duration");
|
|
51205
|
+
}
|
|
50925
51206
|
get isEmail() {
|
|
50926
51207
|
return !!this._def.checks.find((ch) => ch.kind === "email");
|
|
50927
51208
|
}
|
|
50928
51209
|
get isURL() {
|
|
50929
51210
|
return !!this._def.checks.find((ch) => ch.kind === "url");
|
|
50930
51211
|
}
|
|
51212
|
+
get isEmoji() {
|
|
51213
|
+
return !!this._def.checks.find((ch) => ch.kind === "emoji");
|
|
51214
|
+
}
|
|
50931
51215
|
get isUUID() {
|
|
50932
51216
|
return !!this._def.checks.find((ch) => ch.kind === "uuid");
|
|
50933
51217
|
}
|
|
51218
|
+
get isNANOID() {
|
|
51219
|
+
return !!this._def.checks.find((ch) => ch.kind === "nanoid");
|
|
51220
|
+
}
|
|
50934
51221
|
get isCUID() {
|
|
50935
51222
|
return !!this._def.checks.find((ch) => ch.kind === "cuid");
|
|
50936
51223
|
}
|
|
51224
|
+
get isCUID2() {
|
|
51225
|
+
return !!this._def.checks.find((ch) => ch.kind === "cuid2");
|
|
51226
|
+
}
|
|
51227
|
+
get isULID() {
|
|
51228
|
+
return !!this._def.checks.find((ch) => ch.kind === "ulid");
|
|
51229
|
+
}
|
|
51230
|
+
get isIP() {
|
|
51231
|
+
return !!this._def.checks.find((ch) => ch.kind === "ip");
|
|
51232
|
+
}
|
|
51233
|
+
get isBase64() {
|
|
51234
|
+
return !!this._def.checks.find((ch) => ch.kind === "base64");
|
|
51235
|
+
}
|
|
50937
51236
|
get minLength() {
|
|
50938
51237
|
let min = null;
|
|
50939
51238
|
for (const ch of this._def.checks) {
|
|
@@ -51145,6 +51444,19 @@ var ZodNumber = class extends ZodType {
|
|
|
51145
51444
|
message: errorUtil.toString(message)
|
|
51146
51445
|
});
|
|
51147
51446
|
}
|
|
51447
|
+
safe(message) {
|
|
51448
|
+
return this._addCheck({
|
|
51449
|
+
kind: "min",
|
|
51450
|
+
inclusive: true,
|
|
51451
|
+
value: Number.MIN_SAFE_INTEGER,
|
|
51452
|
+
message: errorUtil.toString(message)
|
|
51453
|
+
})._addCheck({
|
|
51454
|
+
kind: "max",
|
|
51455
|
+
inclusive: true,
|
|
51456
|
+
value: Number.MAX_SAFE_INTEGER,
|
|
51457
|
+
message: errorUtil.toString(message)
|
|
51458
|
+
});
|
|
51459
|
+
}
|
|
51148
51460
|
get minValue() {
|
|
51149
51461
|
let min = null;
|
|
51150
51462
|
for (const ch of this._def.checks) {
|
|
@@ -51166,7 +51478,22 @@ var ZodNumber = class extends ZodType {
|
|
|
51166
51478
|
return max;
|
|
51167
51479
|
}
|
|
51168
51480
|
get isInt() {
|
|
51169
|
-
return !!this._def.checks.find((ch) => ch.kind === "int");
|
|
51481
|
+
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
|
51482
|
+
}
|
|
51483
|
+
get isFinite() {
|
|
51484
|
+
let max = null, min = null;
|
|
51485
|
+
for (const ch of this._def.checks) {
|
|
51486
|
+
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
|
51487
|
+
return true;
|
|
51488
|
+
} else if (ch.kind === "min") {
|
|
51489
|
+
if (min === null || ch.value > min)
|
|
51490
|
+
min = ch.value;
|
|
51491
|
+
} else if (ch.kind === "max") {
|
|
51492
|
+
if (max === null || ch.value < max)
|
|
51493
|
+
max = ch.value;
|
|
51494
|
+
}
|
|
51495
|
+
}
|
|
51496
|
+
return Number.isFinite(min) && Number.isFinite(max);
|
|
51170
51497
|
}
|
|
51171
51498
|
};
|
|
51172
51499
|
__name(ZodNumber, "ZodNumber");
|
|
@@ -51179,27 +51506,167 @@ ZodNumber.create = (params) => {
|
|
|
51179
51506
|
});
|
|
51180
51507
|
};
|
|
51181
51508
|
var ZodBigInt = class extends ZodType {
|
|
51509
|
+
constructor() {
|
|
51510
|
+
super(...arguments);
|
|
51511
|
+
this.min = this.gte;
|
|
51512
|
+
this.max = this.lte;
|
|
51513
|
+
}
|
|
51182
51514
|
_parse(input) {
|
|
51183
51515
|
if (this._def.coerce) {
|
|
51184
51516
|
input.data = BigInt(input.data);
|
|
51185
51517
|
}
|
|
51186
51518
|
const parsedType = this._getType(input);
|
|
51187
51519
|
if (parsedType !== ZodParsedType.bigint) {
|
|
51188
|
-
const
|
|
51189
|
-
addIssueToContext(
|
|
51520
|
+
const ctx2 = this._getOrReturnCtx(input);
|
|
51521
|
+
addIssueToContext(ctx2, {
|
|
51190
51522
|
code: ZodIssueCode.invalid_type,
|
|
51191
51523
|
expected: ZodParsedType.bigint,
|
|
51192
|
-
received:
|
|
51524
|
+
received: ctx2.parsedType
|
|
51193
51525
|
});
|
|
51194
51526
|
return INVALID;
|
|
51195
51527
|
}
|
|
51196
|
-
|
|
51528
|
+
let ctx = void 0;
|
|
51529
|
+
const status = new ParseStatus();
|
|
51530
|
+
for (const check of this._def.checks) {
|
|
51531
|
+
if (check.kind === "min") {
|
|
51532
|
+
const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
|
|
51533
|
+
if (tooSmall) {
|
|
51534
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
51535
|
+
addIssueToContext(ctx, {
|
|
51536
|
+
code: ZodIssueCode.too_small,
|
|
51537
|
+
type: "bigint",
|
|
51538
|
+
minimum: check.value,
|
|
51539
|
+
inclusive: check.inclusive,
|
|
51540
|
+
message: check.message
|
|
51541
|
+
});
|
|
51542
|
+
status.dirty();
|
|
51543
|
+
}
|
|
51544
|
+
} else if (check.kind === "max") {
|
|
51545
|
+
const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
|
|
51546
|
+
if (tooBig) {
|
|
51547
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
51548
|
+
addIssueToContext(ctx, {
|
|
51549
|
+
code: ZodIssueCode.too_big,
|
|
51550
|
+
type: "bigint",
|
|
51551
|
+
maximum: check.value,
|
|
51552
|
+
inclusive: check.inclusive,
|
|
51553
|
+
message: check.message
|
|
51554
|
+
});
|
|
51555
|
+
status.dirty();
|
|
51556
|
+
}
|
|
51557
|
+
} else if (check.kind === "multipleOf") {
|
|
51558
|
+
if (input.data % check.value !== BigInt(0)) {
|
|
51559
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
51560
|
+
addIssueToContext(ctx, {
|
|
51561
|
+
code: ZodIssueCode.not_multiple_of,
|
|
51562
|
+
multipleOf: check.value,
|
|
51563
|
+
message: check.message
|
|
51564
|
+
});
|
|
51565
|
+
status.dirty();
|
|
51566
|
+
}
|
|
51567
|
+
} else {
|
|
51568
|
+
util.assertNever(check);
|
|
51569
|
+
}
|
|
51570
|
+
}
|
|
51571
|
+
return { status: status.value, value: input.data };
|
|
51572
|
+
}
|
|
51573
|
+
gte(value, message) {
|
|
51574
|
+
return this.setLimit("min", value, true, errorUtil.toString(message));
|
|
51575
|
+
}
|
|
51576
|
+
gt(value, message) {
|
|
51577
|
+
return this.setLimit("min", value, false, errorUtil.toString(message));
|
|
51578
|
+
}
|
|
51579
|
+
lte(value, message) {
|
|
51580
|
+
return this.setLimit("max", value, true, errorUtil.toString(message));
|
|
51581
|
+
}
|
|
51582
|
+
lt(value, message) {
|
|
51583
|
+
return this.setLimit("max", value, false, errorUtil.toString(message));
|
|
51584
|
+
}
|
|
51585
|
+
setLimit(kind, value, inclusive, message) {
|
|
51586
|
+
return new ZodBigInt({
|
|
51587
|
+
...this._def,
|
|
51588
|
+
checks: [
|
|
51589
|
+
...this._def.checks,
|
|
51590
|
+
{
|
|
51591
|
+
kind,
|
|
51592
|
+
value,
|
|
51593
|
+
inclusive,
|
|
51594
|
+
message: errorUtil.toString(message)
|
|
51595
|
+
}
|
|
51596
|
+
]
|
|
51597
|
+
});
|
|
51598
|
+
}
|
|
51599
|
+
_addCheck(check) {
|
|
51600
|
+
return new ZodBigInt({
|
|
51601
|
+
...this._def,
|
|
51602
|
+
checks: [...this._def.checks, check]
|
|
51603
|
+
});
|
|
51604
|
+
}
|
|
51605
|
+
positive(message) {
|
|
51606
|
+
return this._addCheck({
|
|
51607
|
+
kind: "min",
|
|
51608
|
+
value: BigInt(0),
|
|
51609
|
+
inclusive: false,
|
|
51610
|
+
message: errorUtil.toString(message)
|
|
51611
|
+
});
|
|
51612
|
+
}
|
|
51613
|
+
negative(message) {
|
|
51614
|
+
return this._addCheck({
|
|
51615
|
+
kind: "max",
|
|
51616
|
+
value: BigInt(0),
|
|
51617
|
+
inclusive: false,
|
|
51618
|
+
message: errorUtil.toString(message)
|
|
51619
|
+
});
|
|
51620
|
+
}
|
|
51621
|
+
nonpositive(message) {
|
|
51622
|
+
return this._addCheck({
|
|
51623
|
+
kind: "max",
|
|
51624
|
+
value: BigInt(0),
|
|
51625
|
+
inclusive: true,
|
|
51626
|
+
message: errorUtil.toString(message)
|
|
51627
|
+
});
|
|
51628
|
+
}
|
|
51629
|
+
nonnegative(message) {
|
|
51630
|
+
return this._addCheck({
|
|
51631
|
+
kind: "min",
|
|
51632
|
+
value: BigInt(0),
|
|
51633
|
+
inclusive: true,
|
|
51634
|
+
message: errorUtil.toString(message)
|
|
51635
|
+
});
|
|
51636
|
+
}
|
|
51637
|
+
multipleOf(value, message) {
|
|
51638
|
+
return this._addCheck({
|
|
51639
|
+
kind: "multipleOf",
|
|
51640
|
+
value,
|
|
51641
|
+
message: errorUtil.toString(message)
|
|
51642
|
+
});
|
|
51643
|
+
}
|
|
51644
|
+
get minValue() {
|
|
51645
|
+
let min = null;
|
|
51646
|
+
for (const ch of this._def.checks) {
|
|
51647
|
+
if (ch.kind === "min") {
|
|
51648
|
+
if (min === null || ch.value > min)
|
|
51649
|
+
min = ch.value;
|
|
51650
|
+
}
|
|
51651
|
+
}
|
|
51652
|
+
return min;
|
|
51653
|
+
}
|
|
51654
|
+
get maxValue() {
|
|
51655
|
+
let max = null;
|
|
51656
|
+
for (const ch of this._def.checks) {
|
|
51657
|
+
if (ch.kind === "max") {
|
|
51658
|
+
if (max === null || ch.value < max)
|
|
51659
|
+
max = ch.value;
|
|
51660
|
+
}
|
|
51661
|
+
}
|
|
51662
|
+
return max;
|
|
51197
51663
|
}
|
|
51198
51664
|
};
|
|
51199
51665
|
__name(ZodBigInt, "ZodBigInt");
|
|
51200
51666
|
ZodBigInt.create = (params) => {
|
|
51201
51667
|
var _a;
|
|
51202
51668
|
return new ZodBigInt({
|
|
51669
|
+
checks: [],
|
|
51203
51670
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
51204
51671
|
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
|
51205
51672
|
...processCreateParams(params)
|
|
@@ -51534,13 +52001,13 @@ var ZodArray = class extends ZodType {
|
|
|
51534
52001
|
}
|
|
51535
52002
|
}
|
|
51536
52003
|
if (ctx.common.async) {
|
|
51537
|
-
return Promise.all(ctx.data.map((item, i2) => {
|
|
52004
|
+
return Promise.all([...ctx.data].map((item, i2) => {
|
|
51538
52005
|
return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i2));
|
|
51539
52006
|
})).then((result2) => {
|
|
51540
52007
|
return ParseStatus.mergeArray(status, result2);
|
|
51541
52008
|
});
|
|
51542
52009
|
}
|
|
51543
|
-
const result = ctx.data.map((item, i2) => {
|
|
52010
|
+
const result = [...ctx.data].map((item, i2) => {
|
|
51544
52011
|
return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i2));
|
|
51545
52012
|
});
|
|
51546
52013
|
return ParseStatus.mergeArray(status, result);
|
|
@@ -51581,24 +52048,6 @@ ZodArray.create = (schema, params) => {
|
|
|
51581
52048
|
...processCreateParams(params)
|
|
51582
52049
|
});
|
|
51583
52050
|
};
|
|
51584
|
-
var objectUtil;
|
|
51585
|
-
(function(objectUtil2) {
|
|
51586
|
-
objectUtil2.mergeShapes = (first2, second) => {
|
|
51587
|
-
return {
|
|
51588
|
-
...first2,
|
|
51589
|
-
...second
|
|
51590
|
-
};
|
|
51591
|
-
};
|
|
51592
|
-
})(objectUtil || (objectUtil = {}));
|
|
51593
|
-
var AugmentFactory = /* @__PURE__ */ __name((def) => (augmentation) => {
|
|
51594
|
-
return new ZodObject({
|
|
51595
|
-
...def,
|
|
51596
|
-
shape: () => ({
|
|
51597
|
-
...def.shape(),
|
|
51598
|
-
...augmentation
|
|
51599
|
-
})
|
|
51600
|
-
});
|
|
51601
|
-
}, "AugmentFactory");
|
|
51602
52051
|
function deepPartialify(schema) {
|
|
51603
52052
|
if (schema instanceof ZodObject) {
|
|
51604
52053
|
const newShape = {};
|
|
@@ -51611,7 +52060,10 @@ function deepPartialify(schema) {
|
|
|
51611
52060
|
shape: () => newShape
|
|
51612
52061
|
});
|
|
51613
52062
|
} else if (schema instanceof ZodArray) {
|
|
51614
|
-
return ZodArray
|
|
52063
|
+
return new ZodArray({
|
|
52064
|
+
...schema._def,
|
|
52065
|
+
type: deepPartialify(schema.element)
|
|
52066
|
+
});
|
|
51615
52067
|
} else if (schema instanceof ZodOptional) {
|
|
51616
52068
|
return ZodOptional.create(deepPartialify(schema.unwrap()));
|
|
51617
52069
|
} else if (schema instanceof ZodNullable) {
|
|
@@ -51628,8 +52080,7 @@ var ZodObject = class extends ZodType {
|
|
|
51628
52080
|
super(...arguments);
|
|
51629
52081
|
this._cached = null;
|
|
51630
52082
|
this.nonstrict = this.passthrough;
|
|
51631
|
-
this.augment =
|
|
51632
|
-
this.extend = AugmentFactory(this._def);
|
|
52083
|
+
this.augment = this.extend;
|
|
51633
52084
|
}
|
|
51634
52085
|
_getCached() {
|
|
51635
52086
|
if (this._cached !== null)
|
|
@@ -51709,9 +52160,10 @@ var ZodObject = class extends ZodType {
|
|
|
51709
52160
|
const syncPairs = [];
|
|
51710
52161
|
for (const pair of pairs) {
|
|
51711
52162
|
const key2 = await pair.key;
|
|
52163
|
+
const value = await pair.value;
|
|
51712
52164
|
syncPairs.push({
|
|
51713
52165
|
key: key2,
|
|
51714
|
-
value
|
|
52166
|
+
value,
|
|
51715
52167
|
alwaysSet: pair.alwaysSet
|
|
51716
52168
|
});
|
|
51717
52169
|
}
|
|
@@ -51758,18 +52210,30 @@ var ZodObject = class extends ZodType {
|
|
|
51758
52210
|
unknownKeys: "passthrough"
|
|
51759
52211
|
});
|
|
51760
52212
|
}
|
|
51761
|
-
|
|
51762
|
-
return
|
|
52213
|
+
extend(augmentation) {
|
|
52214
|
+
return new ZodObject({
|
|
52215
|
+
...this._def,
|
|
52216
|
+
shape: () => ({
|
|
52217
|
+
...this._def.shape(),
|
|
52218
|
+
...augmentation
|
|
52219
|
+
})
|
|
52220
|
+
});
|
|
51763
52221
|
}
|
|
51764
52222
|
merge(merging) {
|
|
51765
52223
|
const merged = new ZodObject({
|
|
51766
52224
|
unknownKeys: merging._def.unknownKeys,
|
|
51767
52225
|
catchall: merging._def.catchall,
|
|
51768
|
-
shape: () =>
|
|
52226
|
+
shape: () => ({
|
|
52227
|
+
...this._def.shape(),
|
|
52228
|
+
...merging._def.shape()
|
|
52229
|
+
}),
|
|
51769
52230
|
typeName: ZodFirstPartyTypeKind.ZodObject
|
|
51770
52231
|
});
|
|
51771
52232
|
return merged;
|
|
51772
52233
|
}
|
|
52234
|
+
setKey(key2, schema) {
|
|
52235
|
+
return this.augment({ [key2]: schema });
|
|
52236
|
+
}
|
|
51773
52237
|
catchall(index) {
|
|
51774
52238
|
return new ZodObject({
|
|
51775
52239
|
...this._def,
|
|
@@ -51778,9 +52242,10 @@ var ZodObject = class extends ZodType {
|
|
|
51778
52242
|
}
|
|
51779
52243
|
pick(mask) {
|
|
51780
52244
|
const shape = {};
|
|
51781
|
-
util.objectKeys(mask).
|
|
51782
|
-
if (this.shape[key2])
|
|
52245
|
+
util.objectKeys(mask).forEach((key2) => {
|
|
52246
|
+
if (mask[key2] && this.shape[key2]) {
|
|
51783
52247
|
shape[key2] = this.shape[key2];
|
|
52248
|
+
}
|
|
51784
52249
|
});
|
|
51785
52250
|
return new ZodObject({
|
|
51786
52251
|
...this._def,
|
|
@@ -51789,8 +52254,8 @@ var ZodObject = class extends ZodType {
|
|
|
51789
52254
|
}
|
|
51790
52255
|
omit(mask) {
|
|
51791
52256
|
const shape = {};
|
|
51792
|
-
util.objectKeys(this.shape).
|
|
51793
|
-
if (
|
|
52257
|
+
util.objectKeys(this.shape).forEach((key2) => {
|
|
52258
|
+
if (!mask[key2]) {
|
|
51794
52259
|
shape[key2] = this.shape[key2];
|
|
51795
52260
|
}
|
|
51796
52261
|
});
|
|
@@ -51804,24 +52269,14 @@ var ZodObject = class extends ZodType {
|
|
|
51804
52269
|
}
|
|
51805
52270
|
partial(mask) {
|
|
51806
52271
|
const newShape = {};
|
|
51807
|
-
|
|
51808
|
-
|
|
51809
|
-
|
|
51810
|
-
|
|
51811
|
-
|
|
51812
|
-
newShape[key2] = this.shape[key2].optional();
|
|
51813
|
-
}
|
|
51814
|
-
});
|
|
51815
|
-
return new ZodObject({
|
|
51816
|
-
...this._def,
|
|
51817
|
-
shape: () => newShape
|
|
51818
|
-
});
|
|
51819
|
-
} else {
|
|
51820
|
-
for (const key2 in this.shape) {
|
|
51821
|
-
const fieldSchema = this.shape[key2];
|
|
52272
|
+
util.objectKeys(this.shape).forEach((key2) => {
|
|
52273
|
+
const fieldSchema = this.shape[key2];
|
|
52274
|
+
if (mask && !mask[key2]) {
|
|
52275
|
+
newShape[key2] = fieldSchema;
|
|
52276
|
+
} else {
|
|
51822
52277
|
newShape[key2] = fieldSchema.optional();
|
|
51823
52278
|
}
|
|
51824
|
-
}
|
|
52279
|
+
});
|
|
51825
52280
|
return new ZodObject({
|
|
51826
52281
|
...this._def,
|
|
51827
52282
|
shape: () => newShape
|
|
@@ -51829,21 +52284,10 @@ var ZodObject = class extends ZodType {
|
|
|
51829
52284
|
}
|
|
51830
52285
|
required(mask) {
|
|
51831
52286
|
const newShape = {};
|
|
51832
|
-
|
|
51833
|
-
|
|
51834
|
-
|
|
51835
|
-
|
|
51836
|
-
} else {
|
|
51837
|
-
const fieldSchema = this.shape[key2];
|
|
51838
|
-
let newField = fieldSchema;
|
|
51839
|
-
while (newField instanceof ZodOptional) {
|
|
51840
|
-
newField = newField._def.innerType;
|
|
51841
|
-
}
|
|
51842
|
-
newShape[key2] = newField;
|
|
51843
|
-
}
|
|
51844
|
-
});
|
|
51845
|
-
} else {
|
|
51846
|
-
for (const key2 in this.shape) {
|
|
52287
|
+
util.objectKeys(this.shape).forEach((key2) => {
|
|
52288
|
+
if (mask && !mask[key2]) {
|
|
52289
|
+
newShape[key2] = this.shape[key2];
|
|
52290
|
+
} else {
|
|
51847
52291
|
const fieldSchema = this.shape[key2];
|
|
51848
52292
|
let newField = fieldSchema;
|
|
51849
52293
|
while (newField instanceof ZodOptional) {
|
|
@@ -51851,7 +52295,7 @@ var ZodObject = class extends ZodType {
|
|
|
51851
52295
|
}
|
|
51852
52296
|
newShape[key2] = newField;
|
|
51853
52297
|
}
|
|
51854
|
-
}
|
|
52298
|
+
});
|
|
51855
52299
|
return new ZodObject({
|
|
51856
52300
|
...this._def,
|
|
51857
52301
|
shape: () => newShape
|
|
@@ -51992,15 +52436,25 @@ var getDiscriminator = /* @__PURE__ */ __name((type) => {
|
|
|
51992
52436
|
} else if (type instanceof ZodEnum) {
|
|
51993
52437
|
return type.options;
|
|
51994
52438
|
} else if (type instanceof ZodNativeEnum) {
|
|
51995
|
-
return
|
|
52439
|
+
return util.objectValues(type.enum);
|
|
51996
52440
|
} else if (type instanceof ZodDefault) {
|
|
51997
52441
|
return getDiscriminator(type._def.innerType);
|
|
51998
52442
|
} else if (type instanceof ZodUndefined) {
|
|
51999
52443
|
return [void 0];
|
|
52000
52444
|
} else if (type instanceof ZodNull) {
|
|
52001
52445
|
return [null];
|
|
52446
|
+
} else if (type instanceof ZodOptional) {
|
|
52447
|
+
return [void 0, ...getDiscriminator(type.unwrap())];
|
|
52448
|
+
} else if (type instanceof ZodNullable) {
|
|
52449
|
+
return [null, ...getDiscriminator(type.unwrap())];
|
|
52450
|
+
} else if (type instanceof ZodBranded) {
|
|
52451
|
+
return getDiscriminator(type.unwrap());
|
|
52452
|
+
} else if (type instanceof ZodReadonly) {
|
|
52453
|
+
return getDiscriminator(type.unwrap());
|
|
52454
|
+
} else if (type instanceof ZodCatch) {
|
|
52455
|
+
return getDiscriminator(type._def.innerType);
|
|
52002
52456
|
} else {
|
|
52003
|
-
return
|
|
52457
|
+
return [];
|
|
52004
52458
|
}
|
|
52005
52459
|
}, "getDiscriminator");
|
|
52006
52460
|
var ZodDiscriminatedUnion = class extends ZodType {
|
|
@@ -52052,7 +52506,7 @@ var ZodDiscriminatedUnion = class extends ZodType {
|
|
|
52052
52506
|
const optionsMap = /* @__PURE__ */ new Map();
|
|
52053
52507
|
for (const type of options) {
|
|
52054
52508
|
const discriminatorValues = getDiscriminator(type.shape[discriminator]);
|
|
52055
|
-
if (!discriminatorValues) {
|
|
52509
|
+
if (!discriminatorValues.length) {
|
|
52056
52510
|
throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
|
|
52057
52511
|
}
|
|
52058
52512
|
for (const value of discriminatorValues) {
|
|
@@ -52197,7 +52651,7 @@ var ZodTuple = class extends ZodType {
|
|
|
52197
52651
|
});
|
|
52198
52652
|
status.dirty();
|
|
52199
52653
|
}
|
|
52200
|
-
const items = ctx.data.map((item, itemIndex) => {
|
|
52654
|
+
const items = [...ctx.data].map((item, itemIndex) => {
|
|
52201
52655
|
const schema = this._def.items[itemIndex] || this._def.rest;
|
|
52202
52656
|
if (!schema)
|
|
52203
52657
|
return null;
|
|
@@ -52256,7 +52710,8 @@ var ZodRecord = class extends ZodType {
|
|
|
52256
52710
|
for (const key2 in ctx.data) {
|
|
52257
52711
|
pairs.push({
|
|
52258
52712
|
key: keyType._parse(new ParseInputLazyPath(ctx, key2, ctx.path, key2)),
|
|
52259
|
-
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key2], ctx.path, key2))
|
|
52713
|
+
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key2], ctx.path, key2)),
|
|
52714
|
+
alwaysSet: key2 in ctx.data
|
|
52260
52715
|
});
|
|
52261
52716
|
}
|
|
52262
52717
|
if (ctx.common.async) {
|
|
@@ -52287,6 +52742,12 @@ var ZodRecord = class extends ZodType {
|
|
|
52287
52742
|
};
|
|
52288
52743
|
__name(ZodRecord, "ZodRecord");
|
|
52289
52744
|
var ZodMap = class extends ZodType {
|
|
52745
|
+
get keySchema() {
|
|
52746
|
+
return this._def.keyType;
|
|
52747
|
+
}
|
|
52748
|
+
get valueSchema() {
|
|
52749
|
+
return this._def.valueType;
|
|
52750
|
+
}
|
|
52290
52751
|
_parse(input) {
|
|
52291
52752
|
const { status, ctx } = this._processInputParams(input);
|
|
52292
52753
|
if (ctx.parsedType !== ZodParsedType.map) {
|
|
@@ -52486,27 +52947,29 @@ var ZodFunction = class extends ZodType {
|
|
|
52486
52947
|
const params = { errorMap: ctx.common.contextualErrorMap };
|
|
52487
52948
|
const fn = ctx.data;
|
|
52488
52949
|
if (this._def.returns instanceof ZodPromise) {
|
|
52489
|
-
|
|
52950
|
+
const me = this;
|
|
52951
|
+
return OK(async function(...args) {
|
|
52490
52952
|
const error = new ZodError([]);
|
|
52491
|
-
const parsedArgs = await
|
|
52953
|
+
const parsedArgs = await me._def.args.parseAsync(args, params).catch((e2) => {
|
|
52492
52954
|
error.addIssue(makeArgsIssue(args, e2));
|
|
52493
52955
|
throw error;
|
|
52494
52956
|
});
|
|
52495
|
-
const result = await fn
|
|
52496
|
-
const parsedReturns = await
|
|
52957
|
+
const result = await Reflect.apply(fn, this, parsedArgs);
|
|
52958
|
+
const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e2) => {
|
|
52497
52959
|
error.addIssue(makeReturnsIssue(result, e2));
|
|
52498
52960
|
throw error;
|
|
52499
52961
|
});
|
|
52500
52962
|
return parsedReturns;
|
|
52501
52963
|
});
|
|
52502
52964
|
} else {
|
|
52503
|
-
|
|
52504
|
-
|
|
52965
|
+
const me = this;
|
|
52966
|
+
return OK(function(...args) {
|
|
52967
|
+
const parsedArgs = me._def.args.safeParse(args, params);
|
|
52505
52968
|
if (!parsedArgs.success) {
|
|
52506
52969
|
throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
|
52507
52970
|
}
|
|
52508
|
-
const result = fn
|
|
52509
|
-
const parsedReturns =
|
|
52971
|
+
const result = Reflect.apply(fn, this, parsedArgs.data);
|
|
52972
|
+
const parsedReturns = me._def.returns.safeParse(result, params);
|
|
52510
52973
|
if (!parsedReturns.success) {
|
|
52511
52974
|
throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
|
|
52512
52975
|
}
|
|
@@ -52573,6 +53036,7 @@ var ZodLiteral = class extends ZodType {
|
|
|
52573
53036
|
if (input.data !== this._def.value) {
|
|
52574
53037
|
const ctx = this._getOrReturnCtx(input);
|
|
52575
53038
|
addIssueToContext(ctx, {
|
|
53039
|
+
received: ctx.data,
|
|
52576
53040
|
code: ZodIssueCode.invalid_literal,
|
|
52577
53041
|
expected: this._def.value
|
|
52578
53042
|
});
|
|
@@ -52601,6 +53065,10 @@ function createZodEnum(values, params) {
|
|
|
52601
53065
|
}
|
|
52602
53066
|
__name(createZodEnum, "createZodEnum");
|
|
52603
53067
|
var ZodEnum = class extends ZodType {
|
|
53068
|
+
constructor() {
|
|
53069
|
+
super(...arguments);
|
|
53070
|
+
_ZodEnum_cache.set(this, void 0);
|
|
53071
|
+
}
|
|
52604
53072
|
_parse(input) {
|
|
52605
53073
|
if (typeof input.data !== "string") {
|
|
52606
53074
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -52612,7 +53080,10 @@ var ZodEnum = class extends ZodType {
|
|
|
52612
53080
|
});
|
|
52613
53081
|
return INVALID;
|
|
52614
53082
|
}
|
|
52615
|
-
if (this
|
|
53083
|
+
if (!__classPrivateFieldGet2(this, _ZodEnum_cache, "f")) {
|
|
53084
|
+
__classPrivateFieldSet2(this, _ZodEnum_cache, new Set(this._def.values), "f");
|
|
53085
|
+
}
|
|
53086
|
+
if (!__classPrivateFieldGet2(this, _ZodEnum_cache, "f").has(input.data)) {
|
|
52616
53087
|
const ctx = this._getOrReturnCtx(input);
|
|
52617
53088
|
const expectedValues = this._def.values;
|
|
52618
53089
|
addIssueToContext(ctx, {
|
|
@@ -52648,10 +53119,27 @@ var ZodEnum = class extends ZodType {
|
|
|
52648
53119
|
}
|
|
52649
53120
|
return enumValues;
|
|
52650
53121
|
}
|
|
53122
|
+
extract(values, newDef = this._def) {
|
|
53123
|
+
return ZodEnum.create(values, {
|
|
53124
|
+
...this._def,
|
|
53125
|
+
...newDef
|
|
53126
|
+
});
|
|
53127
|
+
}
|
|
53128
|
+
exclude(values, newDef = this._def) {
|
|
53129
|
+
return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
|
|
53130
|
+
...this._def,
|
|
53131
|
+
...newDef
|
|
53132
|
+
});
|
|
53133
|
+
}
|
|
52651
53134
|
};
|
|
52652
53135
|
__name(ZodEnum, "ZodEnum");
|
|
53136
|
+
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
52653
53137
|
ZodEnum.create = createZodEnum;
|
|
52654
53138
|
var ZodNativeEnum = class extends ZodType {
|
|
53139
|
+
constructor() {
|
|
53140
|
+
super(...arguments);
|
|
53141
|
+
_ZodNativeEnum_cache.set(this, void 0);
|
|
53142
|
+
}
|
|
52655
53143
|
_parse(input) {
|
|
52656
53144
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
52657
53145
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -52664,7 +53152,10 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
52664
53152
|
});
|
|
52665
53153
|
return INVALID;
|
|
52666
53154
|
}
|
|
52667
|
-
if (
|
|
53155
|
+
if (!__classPrivateFieldGet2(this, _ZodNativeEnum_cache, "f")) {
|
|
53156
|
+
__classPrivateFieldSet2(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
|
|
53157
|
+
}
|
|
53158
|
+
if (!__classPrivateFieldGet2(this, _ZodNativeEnum_cache, "f").has(input.data)) {
|
|
52668
53159
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
52669
53160
|
addIssueToContext(ctx, {
|
|
52670
53161
|
received: ctx.data,
|
|
@@ -52680,6 +53171,7 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
52680
53171
|
}
|
|
52681
53172
|
};
|
|
52682
53173
|
__name(ZodNativeEnum, "ZodNativeEnum");
|
|
53174
|
+
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
52683
53175
|
ZodNativeEnum.create = (values, params) => {
|
|
52684
53176
|
return new ZodNativeEnum({
|
|
52685
53177
|
values,
|
|
@@ -52688,6 +53180,9 @@ ZodNativeEnum.create = (values, params) => {
|
|
|
52688
53180
|
});
|
|
52689
53181
|
};
|
|
52690
53182
|
var ZodPromise = class extends ZodType {
|
|
53183
|
+
unwrap() {
|
|
53184
|
+
return this._def.type;
|
|
53185
|
+
}
|
|
52691
53186
|
_parse(input) {
|
|
52692
53187
|
const { ctx } = this._processInputParams(input);
|
|
52693
53188
|
if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
|
|
@@ -52725,24 +53220,6 @@ var ZodEffects = class extends ZodType {
|
|
|
52725
53220
|
_parse(input) {
|
|
52726
53221
|
const { status, ctx } = this._processInputParams(input);
|
|
52727
53222
|
const effect = this._def.effect || null;
|
|
52728
|
-
if (effect.type === "preprocess") {
|
|
52729
|
-
const processed = effect.transform(ctx.data);
|
|
52730
|
-
if (ctx.common.async) {
|
|
52731
|
-
return Promise.resolve(processed).then((processed2) => {
|
|
52732
|
-
return this._def.schema._parseAsync({
|
|
52733
|
-
data: processed2,
|
|
52734
|
-
path: ctx.path,
|
|
52735
|
-
parent: ctx
|
|
52736
|
-
});
|
|
52737
|
-
});
|
|
52738
|
-
} else {
|
|
52739
|
-
return this._def.schema._parseSync({
|
|
52740
|
-
data: processed,
|
|
52741
|
-
path: ctx.path,
|
|
52742
|
-
parent: ctx
|
|
52743
|
-
});
|
|
52744
|
-
}
|
|
52745
|
-
}
|
|
52746
53223
|
const checkCtx = {
|
|
52747
53224
|
addIssue: (arg) => {
|
|
52748
53225
|
addIssueToContext(ctx, arg);
|
|
@@ -52757,6 +53234,42 @@ var ZodEffects = class extends ZodType {
|
|
|
52757
53234
|
}
|
|
52758
53235
|
};
|
|
52759
53236
|
checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
|
|
53237
|
+
if (effect.type === "preprocess") {
|
|
53238
|
+
const processed = effect.transform(ctx.data, checkCtx);
|
|
53239
|
+
if (ctx.common.async) {
|
|
53240
|
+
return Promise.resolve(processed).then(async (processed2) => {
|
|
53241
|
+
if (status.value === "aborted")
|
|
53242
|
+
return INVALID;
|
|
53243
|
+
const result = await this._def.schema._parseAsync({
|
|
53244
|
+
data: processed2,
|
|
53245
|
+
path: ctx.path,
|
|
53246
|
+
parent: ctx
|
|
53247
|
+
});
|
|
53248
|
+
if (result.status === "aborted")
|
|
53249
|
+
return INVALID;
|
|
53250
|
+
if (result.status === "dirty")
|
|
53251
|
+
return DIRTY(result.value);
|
|
53252
|
+
if (status.value === "dirty")
|
|
53253
|
+
return DIRTY(result.value);
|
|
53254
|
+
return result;
|
|
53255
|
+
});
|
|
53256
|
+
} else {
|
|
53257
|
+
if (status.value === "aborted")
|
|
53258
|
+
return INVALID;
|
|
53259
|
+
const result = this._def.schema._parseSync({
|
|
53260
|
+
data: processed,
|
|
53261
|
+
path: ctx.path,
|
|
53262
|
+
parent: ctx
|
|
53263
|
+
});
|
|
53264
|
+
if (result.status === "aborted")
|
|
53265
|
+
return INVALID;
|
|
53266
|
+
if (result.status === "dirty")
|
|
53267
|
+
return DIRTY(result.value);
|
|
53268
|
+
if (status.value === "dirty")
|
|
53269
|
+
return DIRTY(result.value);
|
|
53270
|
+
return result;
|
|
53271
|
+
}
|
|
53272
|
+
}
|
|
52760
53273
|
if (effect.type === "refinement") {
|
|
52761
53274
|
const executeRefinement = /* @__PURE__ */ __name((acc) => {
|
|
52762
53275
|
const result = effect.refinement(acc, checkCtx);
|
|
@@ -52903,26 +53416,45 @@ ZodDefault.create = (type, params) => {
|
|
|
52903
53416
|
var ZodCatch = class extends ZodType {
|
|
52904
53417
|
_parse(input) {
|
|
52905
53418
|
const { ctx } = this._processInputParams(input);
|
|
53419
|
+
const newCtx = {
|
|
53420
|
+
...ctx,
|
|
53421
|
+
common: {
|
|
53422
|
+
...ctx.common,
|
|
53423
|
+
issues: []
|
|
53424
|
+
}
|
|
53425
|
+
};
|
|
52906
53426
|
const result = this._def.innerType._parse({
|
|
52907
|
-
data:
|
|
52908
|
-
path:
|
|
52909
|
-
parent:
|
|
53427
|
+
data: newCtx.data,
|
|
53428
|
+
path: newCtx.path,
|
|
53429
|
+
parent: {
|
|
53430
|
+
...newCtx
|
|
53431
|
+
}
|
|
52910
53432
|
});
|
|
52911
53433
|
if (isAsync(result)) {
|
|
52912
53434
|
return result.then((result2) => {
|
|
52913
53435
|
return {
|
|
52914
53436
|
status: "valid",
|
|
52915
|
-
value: result2.status === "valid" ? result2.value : this._def.
|
|
53437
|
+
value: result2.status === "valid" ? result2.value : this._def.catchValue({
|
|
53438
|
+
get error() {
|
|
53439
|
+
return new ZodError(newCtx.common.issues);
|
|
53440
|
+
},
|
|
53441
|
+
input: newCtx.data
|
|
53442
|
+
})
|
|
52916
53443
|
};
|
|
52917
53444
|
});
|
|
52918
53445
|
} else {
|
|
52919
53446
|
return {
|
|
52920
53447
|
status: "valid",
|
|
52921
|
-
value: result.status === "valid" ? result.value : this._def.
|
|
53448
|
+
value: result.status === "valid" ? result.value : this._def.catchValue({
|
|
53449
|
+
get error() {
|
|
53450
|
+
return new ZodError(newCtx.common.issues);
|
|
53451
|
+
},
|
|
53452
|
+
input: newCtx.data
|
|
53453
|
+
})
|
|
52922
53454
|
};
|
|
52923
53455
|
}
|
|
52924
53456
|
}
|
|
52925
|
-
|
|
53457
|
+
removeCatch() {
|
|
52926
53458
|
return this._def.innerType;
|
|
52927
53459
|
}
|
|
52928
53460
|
};
|
|
@@ -52931,7 +53463,7 @@ ZodCatch.create = (type, params) => {
|
|
|
52931
53463
|
return new ZodCatch({
|
|
52932
53464
|
innerType: type,
|
|
52933
53465
|
typeName: ZodFirstPartyTypeKind.ZodCatch,
|
|
52934
|
-
|
|
53466
|
+
catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
|
|
52935
53467
|
...processCreateParams(params)
|
|
52936
53468
|
});
|
|
52937
53469
|
};
|
|
@@ -53029,17 +53561,43 @@ var ZodPipeline = class extends ZodType {
|
|
|
53029
53561
|
}
|
|
53030
53562
|
};
|
|
53031
53563
|
__name(ZodPipeline, "ZodPipeline");
|
|
53032
|
-
var
|
|
53564
|
+
var ZodReadonly = class extends ZodType {
|
|
53565
|
+
_parse(input) {
|
|
53566
|
+
const result = this._def.innerType._parse(input);
|
|
53567
|
+
const freeze = /* @__PURE__ */ __name((data) => {
|
|
53568
|
+
if (isValid(data)) {
|
|
53569
|
+
data.value = Object.freeze(data.value);
|
|
53570
|
+
}
|
|
53571
|
+
return data;
|
|
53572
|
+
}, "freeze");
|
|
53573
|
+
return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
|
|
53574
|
+
}
|
|
53575
|
+
unwrap() {
|
|
53576
|
+
return this._def.innerType;
|
|
53577
|
+
}
|
|
53578
|
+
};
|
|
53579
|
+
__name(ZodReadonly, "ZodReadonly");
|
|
53580
|
+
ZodReadonly.create = (type, params) => {
|
|
53581
|
+
return new ZodReadonly({
|
|
53582
|
+
innerType: type,
|
|
53583
|
+
typeName: ZodFirstPartyTypeKind.ZodReadonly,
|
|
53584
|
+
...processCreateParams(params)
|
|
53585
|
+
});
|
|
53586
|
+
};
|
|
53587
|
+
function custom(check, params = {}, fatal) {
|
|
53033
53588
|
if (check)
|
|
53034
53589
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
53590
|
+
var _a, _b;
|
|
53035
53591
|
if (!check(data)) {
|
|
53036
|
-
const p = typeof params === "function" ? params(data) : params;
|
|
53592
|
+
const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
|
|
53593
|
+
const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
|
|
53037
53594
|
const p2 = typeof p === "string" ? { message: p } : p;
|
|
53038
|
-
ctx.addIssue({ code: "custom", ...p2, fatal });
|
|
53595
|
+
ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
|
|
53039
53596
|
}
|
|
53040
53597
|
});
|
|
53041
53598
|
return ZodAny.create();
|
|
53042
|
-
}
|
|
53599
|
+
}
|
|
53600
|
+
__name(custom, "custom");
|
|
53043
53601
|
var late = {
|
|
53044
53602
|
object: ZodObject.lazycreate
|
|
53045
53603
|
};
|
|
@@ -53080,10 +53638,11 @@ var ZodFirstPartyTypeKind;
|
|
|
53080
53638
|
ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise";
|
|
53081
53639
|
ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded";
|
|
53082
53640
|
ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
|
|
53641
|
+
ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
|
|
53083
53642
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
53084
53643
|
var instanceOfType = /* @__PURE__ */ __name((cls, params = {
|
|
53085
53644
|
message: `Input not instance of ${cls.name}`
|
|
53086
|
-
}) => custom((data) => data instanceof cls, params
|
|
53645
|
+
}) => custom((data) => data instanceof cls, params), "instanceOfType");
|
|
53087
53646
|
var stringType = ZodString.create;
|
|
53088
53647
|
var numberType = ZodNumber.create;
|
|
53089
53648
|
var nanType = ZodNaN.create;
|
|
@@ -53124,12 +53683,15 @@ var oboolean = /* @__PURE__ */ __name(() => booleanType().optional(), "oboolean"
|
|
|
53124
53683
|
var coerce2 = {
|
|
53125
53684
|
string: (arg) => ZodString.create({ ...arg, coerce: true }),
|
|
53126
53685
|
number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
|
|
53127
|
-
boolean: (arg) => ZodBoolean.create({
|
|
53686
|
+
boolean: (arg) => ZodBoolean.create({
|
|
53687
|
+
...arg,
|
|
53688
|
+
coerce: true
|
|
53689
|
+
}),
|
|
53128
53690
|
bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
|
|
53129
53691
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
53130
53692
|
};
|
|
53131
53693
|
var NEVER = INVALID;
|
|
53132
|
-
var
|
|
53694
|
+
var z = /* @__PURE__ */ Object.freeze({
|
|
53133
53695
|
__proto__: null,
|
|
53134
53696
|
defaultErrorMap: errorMap,
|
|
53135
53697
|
setErrorMap,
|
|
@@ -53148,9 +53710,13 @@ var mod = /* @__PURE__ */ Object.freeze({
|
|
|
53148
53710
|
get util() {
|
|
53149
53711
|
return util;
|
|
53150
53712
|
},
|
|
53713
|
+
get objectUtil() {
|
|
53714
|
+
return objectUtil;
|
|
53715
|
+
},
|
|
53151
53716
|
ZodParsedType,
|
|
53152
53717
|
getParsedType,
|
|
53153
53718
|
ZodType,
|
|
53719
|
+
datetimeRegex,
|
|
53154
53720
|
ZodString,
|
|
53155
53721
|
ZodNumber,
|
|
53156
53722
|
ZodBigInt,
|
|
@@ -53164,9 +53730,6 @@ var mod = /* @__PURE__ */ Object.freeze({
|
|
|
53164
53730
|
ZodNever,
|
|
53165
53731
|
ZodVoid,
|
|
53166
53732
|
ZodArray,
|
|
53167
|
-
get objectUtil() {
|
|
53168
|
-
return objectUtil;
|
|
53169
|
-
},
|
|
53170
53733
|
ZodObject,
|
|
53171
53734
|
ZodUnion,
|
|
53172
53735
|
ZodDiscriminatedUnion,
|
|
@@ -53191,6 +53754,7 @@ var mod = /* @__PURE__ */ Object.freeze({
|
|
|
53191
53754
|
BRAND,
|
|
53192
53755
|
ZodBranded,
|
|
53193
53756
|
ZodPipeline,
|
|
53757
|
+
ZodReadonly,
|
|
53194
53758
|
custom,
|
|
53195
53759
|
Schema: ZodType,
|
|
53196
53760
|
ZodSchema: ZodType,
|
|
@@ -53244,38 +53808,140 @@ var mod = /* @__PURE__ */ Object.freeze({
|
|
|
53244
53808
|
ZodError
|
|
53245
53809
|
});
|
|
53246
53810
|
|
|
53811
|
+
// ../../../node_modules/.pnpm/zod-openapi@4.2.4_zod@3.23.8/node_modules/zod-openapi/dist/extendZodSymbols.chunk.mjs
|
|
53812
|
+
var currentSymbol = Symbol("current");
|
|
53813
|
+
var previousSymbol = Symbol("previous");
|
|
53814
|
+
|
|
53815
|
+
// ../../../node_modules/.pnpm/zod-openapi@4.2.4_zod@3.23.8/node_modules/zod-openapi/dist/extendZod.chunk.mjs
|
|
53816
|
+
var mergeOpenApi = /* @__PURE__ */ __name((openapi, {
|
|
53817
|
+
ref: _ref,
|
|
53818
|
+
refType: _refType,
|
|
53819
|
+
param: _param,
|
|
53820
|
+
header: _header,
|
|
53821
|
+
...rest
|
|
53822
|
+
} = {}) => ({
|
|
53823
|
+
...rest,
|
|
53824
|
+
...openapi
|
|
53825
|
+
}), "mergeOpenApi");
|
|
53826
|
+
function extendZodWithOpenApi(zod) {
|
|
53827
|
+
if (typeof zod.ZodType.prototype.openapi !== "undefined") {
|
|
53828
|
+
return;
|
|
53829
|
+
}
|
|
53830
|
+
zod.ZodType.prototype.openapi = function(openapi) {
|
|
53831
|
+
const { zodOpenApi, ...rest } = this._def;
|
|
53832
|
+
const result = new this.constructor({
|
|
53833
|
+
...rest,
|
|
53834
|
+
zodOpenApi: {
|
|
53835
|
+
openapi: mergeOpenApi(
|
|
53836
|
+
openapi,
|
|
53837
|
+
zodOpenApi == null ? void 0 : zodOpenApi.openapi
|
|
53838
|
+
)
|
|
53839
|
+
}
|
|
53840
|
+
});
|
|
53841
|
+
result._def.zodOpenApi[currentSymbol] = result;
|
|
53842
|
+
if (zodOpenApi) {
|
|
53843
|
+
result._def.zodOpenApi[previousSymbol] = this;
|
|
53844
|
+
}
|
|
53845
|
+
return result;
|
|
53846
|
+
};
|
|
53847
|
+
const zodDescribe = zod.ZodType.prototype.describe;
|
|
53848
|
+
zod.ZodType.prototype.describe = function(...args) {
|
|
53849
|
+
const result = zodDescribe.apply(this, args);
|
|
53850
|
+
const def = result._def;
|
|
53851
|
+
if (def.zodOpenApi) {
|
|
53852
|
+
const cloned = { ...def.zodOpenApi };
|
|
53853
|
+
cloned.openapi = mergeOpenApi({ description: args[0] }, cloned.openapi);
|
|
53854
|
+
cloned[previousSymbol] = this;
|
|
53855
|
+
cloned[currentSymbol] = result;
|
|
53856
|
+
def.zodOpenApi = cloned;
|
|
53857
|
+
} else {
|
|
53858
|
+
def.zodOpenApi = {
|
|
53859
|
+
openapi: { description: args[0] },
|
|
53860
|
+
[currentSymbol]: result
|
|
53861
|
+
};
|
|
53862
|
+
}
|
|
53863
|
+
return result;
|
|
53864
|
+
};
|
|
53865
|
+
const zodObjectExtend = zod.ZodObject.prototype.extend;
|
|
53866
|
+
zod.ZodObject.prototype.extend = function(...args) {
|
|
53867
|
+
const extendResult = zodObjectExtend.apply(this, args);
|
|
53868
|
+
const zodOpenApi = extendResult._def.zodOpenApi;
|
|
53869
|
+
if (zodOpenApi) {
|
|
53870
|
+
const cloned = { ...zodOpenApi };
|
|
53871
|
+
cloned.openapi = mergeOpenApi({}, cloned.openapi);
|
|
53872
|
+
cloned[previousSymbol] = this;
|
|
53873
|
+
extendResult._def.zodOpenApi = cloned;
|
|
53874
|
+
} else {
|
|
53875
|
+
extendResult._def.zodOpenApi = {
|
|
53876
|
+
[previousSymbol]: this
|
|
53877
|
+
};
|
|
53878
|
+
}
|
|
53879
|
+
return extendResult;
|
|
53880
|
+
};
|
|
53881
|
+
const zodObjectOmit = zod.ZodObject.prototype.omit;
|
|
53882
|
+
zod.ZodObject.prototype.omit = function(...args) {
|
|
53883
|
+
const omitResult = zodObjectOmit.apply(this, args);
|
|
53884
|
+
const zodOpenApi = omitResult._def.zodOpenApi;
|
|
53885
|
+
if (zodOpenApi) {
|
|
53886
|
+
const cloned = { ...zodOpenApi };
|
|
53887
|
+
cloned.openapi = mergeOpenApi({}, cloned.openapi);
|
|
53888
|
+
delete cloned[previousSymbol];
|
|
53889
|
+
delete cloned[currentSymbol];
|
|
53890
|
+
omitResult._def.zodOpenApi = cloned;
|
|
53891
|
+
}
|
|
53892
|
+
return omitResult;
|
|
53893
|
+
};
|
|
53894
|
+
const zodObjectPick = zod.ZodObject.prototype.pick;
|
|
53895
|
+
zod.ZodObject.prototype.pick = function(...args) {
|
|
53896
|
+
const pickResult = zodObjectPick.apply(this, args);
|
|
53897
|
+
const zodOpenApi = pickResult._def.zodOpenApi;
|
|
53898
|
+
if (zodOpenApi) {
|
|
53899
|
+
const cloned = { ...zodOpenApi };
|
|
53900
|
+
cloned.openapi = mergeOpenApi({}, cloned.openapi);
|
|
53901
|
+
delete cloned[previousSymbol];
|
|
53902
|
+
delete cloned[currentSymbol];
|
|
53903
|
+
pickResult._def.zodOpenApi = cloned;
|
|
53904
|
+
}
|
|
53905
|
+
return pickResult;
|
|
53906
|
+
};
|
|
53907
|
+
}
|
|
53908
|
+
__name(extendZodWithOpenApi, "extendZodWithOpenApi");
|
|
53909
|
+
|
|
53910
|
+
// ../../../node_modules/.pnpm/zod-openapi@4.2.4_zod@3.23.8/node_modules/zod-openapi/dist/extend.mjs
|
|
53911
|
+
extendZodWithOpenApi(z);
|
|
53912
|
+
|
|
53247
53913
|
// ../../learn-card-types/dist/types.esm.js
|
|
53248
53914
|
var __defProp2 = Object.defineProperty;
|
|
53249
53915
|
var __name2 = /* @__PURE__ */ __name((target, value) => __defProp2(target, "name", { value, configurable: true }), "__name");
|
|
53250
|
-
var ContextValidator =
|
|
53251
|
-
var AchievementCriteriaValidator =
|
|
53252
|
-
type:
|
|
53253
|
-
narrative:
|
|
53916
|
+
var ContextValidator = z.array(z.string().or(z.record(z.any())));
|
|
53917
|
+
var AchievementCriteriaValidator = z.object({
|
|
53918
|
+
type: z.string().optional(),
|
|
53919
|
+
narrative: z.string().optional()
|
|
53254
53920
|
});
|
|
53255
|
-
var ImageValidator =
|
|
53256
|
-
|
|
53257
|
-
id:
|
|
53258
|
-
type:
|
|
53259
|
-
caption:
|
|
53921
|
+
var ImageValidator = z.string().or(
|
|
53922
|
+
z.object({
|
|
53923
|
+
id: z.string(),
|
|
53924
|
+
type: z.string(),
|
|
53925
|
+
caption: z.string().optional()
|
|
53260
53926
|
})
|
|
53261
53927
|
);
|
|
53262
|
-
var GeoCoordinatesValidator =
|
|
53263
|
-
type:
|
|
53264
|
-
latitude:
|
|
53265
|
-
longitude:
|
|
53928
|
+
var GeoCoordinatesValidator = z.object({
|
|
53929
|
+
type: z.string().min(1).or(z.string().array().nonempty()),
|
|
53930
|
+
latitude: z.number(),
|
|
53931
|
+
longitude: z.number()
|
|
53266
53932
|
});
|
|
53267
|
-
var AddressValidator =
|
|
53268
|
-
type:
|
|
53269
|
-
addressCountry:
|
|
53270
|
-
addressCountryCode:
|
|
53271
|
-
addressRegion:
|
|
53272
|
-
addressLocality:
|
|
53273
|
-
streetAddress:
|
|
53274
|
-
postOfficeBoxNumber:
|
|
53275
|
-
postalCode:
|
|
53933
|
+
var AddressValidator = z.object({
|
|
53934
|
+
type: z.string().min(1).or(z.string().array().nonempty()),
|
|
53935
|
+
addressCountry: z.string().optional(),
|
|
53936
|
+
addressCountryCode: z.string().optional(),
|
|
53937
|
+
addressRegion: z.string().optional(),
|
|
53938
|
+
addressLocality: z.string().optional(),
|
|
53939
|
+
streetAddress: z.string().optional(),
|
|
53940
|
+
postOfficeBoxNumber: z.string().optional(),
|
|
53941
|
+
postalCode: z.string().optional(),
|
|
53276
53942
|
geo: GeoCoordinatesValidator.optional()
|
|
53277
53943
|
});
|
|
53278
|
-
var IdentifierTypeValidator =
|
|
53944
|
+
var IdentifierTypeValidator = z.enum([
|
|
53279
53945
|
"sourcedId",
|
|
53280
53946
|
"systemId",
|
|
53281
53947
|
"productId",
|
|
@@ -53294,140 +53960,140 @@ var IdentifierTypeValidator = mod.enum([
|
|
|
53294
53960
|
"ltiPlatformId",
|
|
53295
53961
|
"ltiUserId",
|
|
53296
53962
|
"identifier"
|
|
53297
|
-
]).or(
|
|
53298
|
-
var IdentifierEntryValidator =
|
|
53299
|
-
type:
|
|
53300
|
-
identifier:
|
|
53963
|
+
]).or(z.string());
|
|
53964
|
+
var IdentifierEntryValidator = z.object({
|
|
53965
|
+
type: z.string().min(1).or(z.string().array().nonempty()),
|
|
53966
|
+
identifier: z.string(),
|
|
53301
53967
|
identifierType: IdentifierTypeValidator
|
|
53302
53968
|
});
|
|
53303
|
-
var ProfileValidator =
|
|
53304
|
-
|
|
53305
|
-
id:
|
|
53306
|
-
type:
|
|
53307
|
-
name:
|
|
53308
|
-
url:
|
|
53309
|
-
phone:
|
|
53310
|
-
description:
|
|
53311
|
-
endorsement:
|
|
53969
|
+
var ProfileValidator = z.string().or(
|
|
53970
|
+
z.object({
|
|
53971
|
+
id: z.string().optional(),
|
|
53972
|
+
type: z.string().or(z.string().array().nonempty().optional()),
|
|
53973
|
+
name: z.string().optional(),
|
|
53974
|
+
url: z.string().optional(),
|
|
53975
|
+
phone: z.string().optional(),
|
|
53976
|
+
description: z.string().optional(),
|
|
53977
|
+
endorsement: z.any().array().optional(),
|
|
53312
53978
|
image: ImageValidator.optional(),
|
|
53313
|
-
email:
|
|
53979
|
+
email: z.string().email().optional(),
|
|
53314
53980
|
address: AddressValidator.optional(),
|
|
53315
53981
|
otherIdentifier: IdentifierEntryValidator.array().optional(),
|
|
53316
|
-
official:
|
|
53317
|
-
parentOrg:
|
|
53318
|
-
familyName:
|
|
53319
|
-
givenName:
|
|
53320
|
-
additionalName:
|
|
53321
|
-
patronymicName:
|
|
53322
|
-
honorificPrefix:
|
|
53323
|
-
honorificSuffix:
|
|
53324
|
-
familyNamePrefix:
|
|
53325
|
-
dateOfBirth:
|
|
53326
|
-
}).catchall(
|
|
53982
|
+
official: z.string().optional(),
|
|
53983
|
+
parentOrg: z.any().optional(),
|
|
53984
|
+
familyName: z.string().optional(),
|
|
53985
|
+
givenName: z.string().optional(),
|
|
53986
|
+
additionalName: z.string().optional(),
|
|
53987
|
+
patronymicName: z.string().optional(),
|
|
53988
|
+
honorificPrefix: z.string().optional(),
|
|
53989
|
+
honorificSuffix: z.string().optional(),
|
|
53990
|
+
familyNamePrefix: z.string().optional(),
|
|
53991
|
+
dateOfBirth: z.string().optional()
|
|
53992
|
+
}).catchall(z.any())
|
|
53327
53993
|
);
|
|
53328
|
-
var CredentialSubjectValidator =
|
|
53329
|
-
var CredentialStatusValidator =
|
|
53330
|
-
var CredentialSchemaValidator =
|
|
53331
|
-
var RefreshServiceValidator =
|
|
53332
|
-
var TermsOfUseValidator =
|
|
53333
|
-
var VC2EvidenceValidator =
|
|
53334
|
-
var UnsignedVCValidator =
|
|
53994
|
+
var CredentialSubjectValidator = z.object({ id: z.string().optional() }).catchall(z.any());
|
|
53995
|
+
var CredentialStatusValidator = z.object({ type: z.string(), id: z.string() }).catchall(z.any());
|
|
53996
|
+
var CredentialSchemaValidator = z.object({ id: z.string(), type: z.string() }).catchall(z.any());
|
|
53997
|
+
var RefreshServiceValidator = z.object({ id: z.string().optional(), type: z.string() }).catchall(z.any());
|
|
53998
|
+
var TermsOfUseValidator = z.object({ type: z.string(), id: z.string().optional() }).catchall(z.any());
|
|
53999
|
+
var VC2EvidenceValidator = z.object({ type: z.string().or(z.string().array().nonempty()), id: z.string().optional() }).catchall(z.any());
|
|
54000
|
+
var UnsignedVCValidator = z.object({
|
|
53335
54001
|
"@context": ContextValidator,
|
|
53336
|
-
id:
|
|
53337
|
-
type:
|
|
54002
|
+
id: z.string().optional(),
|
|
54003
|
+
type: z.string().array().nonempty(),
|
|
53338
54004
|
issuer: ProfileValidator,
|
|
53339
54005
|
credentialSubject: CredentialSubjectValidator.or(CredentialSubjectValidator.array()),
|
|
53340
54006
|
refreshService: RefreshServiceValidator.or(RefreshServiceValidator.array()).optional(),
|
|
53341
54007
|
credentialSchema: CredentialSchemaValidator.or(
|
|
53342
54008
|
CredentialSchemaValidator.array()
|
|
53343
54009
|
).optional(),
|
|
53344
|
-
issuanceDate:
|
|
53345
|
-
expirationDate:
|
|
54010
|
+
issuanceDate: z.string().optional(),
|
|
54011
|
+
expirationDate: z.string().optional(),
|
|
53346
54012
|
credentialStatus: CredentialStatusValidator.or(
|
|
53347
54013
|
CredentialStatusValidator.array()
|
|
53348
54014
|
).optional(),
|
|
53349
|
-
name:
|
|
53350
|
-
description:
|
|
53351
|
-
validFrom:
|
|
53352
|
-
validUntil:
|
|
54015
|
+
name: z.string().optional(),
|
|
54016
|
+
description: z.string().optional(),
|
|
54017
|
+
validFrom: z.string().optional(),
|
|
54018
|
+
validUntil: z.string().optional(),
|
|
53353
54019
|
status: CredentialStatusValidator.or(CredentialStatusValidator.array()).optional(),
|
|
53354
54020
|
termsOfUse: TermsOfUseValidator.or(TermsOfUseValidator.array()).optional(),
|
|
53355
54021
|
evidence: VC2EvidenceValidator.or(VC2EvidenceValidator.array()).optional()
|
|
53356
|
-
}).catchall(
|
|
53357
|
-
var ProofValidator =
|
|
53358
|
-
type:
|
|
53359
|
-
created:
|
|
53360
|
-
challenge:
|
|
53361
|
-
domain:
|
|
53362
|
-
nonce:
|
|
53363
|
-
proofPurpose:
|
|
53364
|
-
verificationMethod:
|
|
53365
|
-
jws:
|
|
53366
|
-
}).catchall(
|
|
54022
|
+
}).catchall(z.any());
|
|
54023
|
+
var ProofValidator = z.object({
|
|
54024
|
+
type: z.string(),
|
|
54025
|
+
created: z.string(),
|
|
54026
|
+
challenge: z.string().optional(),
|
|
54027
|
+
domain: z.string().optional(),
|
|
54028
|
+
nonce: z.string().optional(),
|
|
54029
|
+
proofPurpose: z.string(),
|
|
54030
|
+
verificationMethod: z.string(),
|
|
54031
|
+
jws: z.string().optional()
|
|
54032
|
+
}).catchall(z.any());
|
|
53367
54033
|
var VCValidator = UnsignedVCValidator.extend({
|
|
53368
54034
|
proof: ProofValidator.or(ProofValidator.array())
|
|
53369
54035
|
});
|
|
53370
|
-
var UnsignedVPValidator =
|
|
54036
|
+
var UnsignedVPValidator = z.object({
|
|
53371
54037
|
"@context": ContextValidator,
|
|
53372
|
-
id:
|
|
53373
|
-
type:
|
|
54038
|
+
id: z.string().optional(),
|
|
54039
|
+
type: z.string().or(z.string().array().nonempty()),
|
|
53374
54040
|
verifiableCredential: VCValidator.or(VCValidator.array()).optional(),
|
|
53375
|
-
holder:
|
|
53376
|
-
}).catchall(
|
|
54041
|
+
holder: z.string().optional()
|
|
54042
|
+
}).catchall(z.any());
|
|
53377
54043
|
var VPValidator = UnsignedVPValidator.extend({
|
|
53378
54044
|
proof: ProofValidator.or(ProofValidator.array())
|
|
53379
54045
|
});
|
|
53380
|
-
var JWKValidator =
|
|
53381
|
-
kty:
|
|
53382
|
-
crv:
|
|
53383
|
-
x:
|
|
53384
|
-
y:
|
|
53385
|
-
n:
|
|
53386
|
-
d:
|
|
54046
|
+
var JWKValidator = z.object({
|
|
54047
|
+
kty: z.string(),
|
|
54048
|
+
crv: z.string(),
|
|
54049
|
+
x: z.string(),
|
|
54050
|
+
y: z.string().optional(),
|
|
54051
|
+
n: z.string().optional(),
|
|
54052
|
+
d: z.string().optional()
|
|
53387
54053
|
});
|
|
53388
|
-
var JWKWithPrivateKeyValidator = JWKValidator.omit({ d: true }).extend({ d:
|
|
53389
|
-
var JWERecipientHeaderValidator =
|
|
53390
|
-
alg:
|
|
53391
|
-
iv:
|
|
53392
|
-
tag:
|
|
54054
|
+
var JWKWithPrivateKeyValidator = JWKValidator.omit({ d: true }).extend({ d: z.string() });
|
|
54055
|
+
var JWERecipientHeaderValidator = z.object({
|
|
54056
|
+
alg: z.string(),
|
|
54057
|
+
iv: z.string(),
|
|
54058
|
+
tag: z.string(),
|
|
53393
54059
|
epk: JWKValidator.partial().optional(),
|
|
53394
|
-
kid:
|
|
53395
|
-
apv:
|
|
53396
|
-
apu:
|
|
54060
|
+
kid: z.string().optional(),
|
|
54061
|
+
apv: z.string().optional(),
|
|
54062
|
+
apu: z.string().optional()
|
|
53397
54063
|
});
|
|
53398
|
-
var JWERecipientValidator =
|
|
54064
|
+
var JWERecipientValidator = z.object({
|
|
53399
54065
|
header: JWERecipientHeaderValidator,
|
|
53400
|
-
encrypted_key:
|
|
54066
|
+
encrypted_key: z.string()
|
|
53401
54067
|
});
|
|
53402
|
-
var JWEValidator =
|
|
53403
|
-
protected:
|
|
53404
|
-
iv:
|
|
53405
|
-
ciphertext:
|
|
53406
|
-
tag:
|
|
53407
|
-
aad:
|
|
54068
|
+
var JWEValidator = z.object({
|
|
54069
|
+
protected: z.string(),
|
|
54070
|
+
iv: z.string(),
|
|
54071
|
+
ciphertext: z.string(),
|
|
54072
|
+
tag: z.string(),
|
|
54073
|
+
aad: z.string().optional(),
|
|
53408
54074
|
recipients: JWERecipientValidator.array().optional()
|
|
53409
54075
|
});
|
|
53410
|
-
var VerificationMethodValidator =
|
|
53411
|
-
|
|
54076
|
+
var VerificationMethodValidator = z.string().or(
|
|
54077
|
+
z.object({
|
|
53412
54078
|
"@context": ContextValidator.optional(),
|
|
53413
|
-
id:
|
|
53414
|
-
type:
|
|
53415
|
-
controller:
|
|
54079
|
+
id: z.string(),
|
|
54080
|
+
type: z.string(),
|
|
54081
|
+
controller: z.string(),
|
|
53416
54082
|
publicKeyJwk: JWKValidator.optional(),
|
|
53417
|
-
publicKeyBase58:
|
|
53418
|
-
blockChainAccountId:
|
|
53419
|
-
}).catchall(
|
|
54083
|
+
publicKeyBase58: z.string().optional(),
|
|
54084
|
+
blockChainAccountId: z.string().optional()
|
|
54085
|
+
}).catchall(z.any())
|
|
53420
54086
|
);
|
|
53421
|
-
var ServiceValidator =
|
|
53422
|
-
id:
|
|
53423
|
-
type:
|
|
53424
|
-
serviceEndpoint:
|
|
53425
|
-
}).catchall(
|
|
53426
|
-
var DidDocumentValidator =
|
|
54087
|
+
var ServiceValidator = z.object({
|
|
54088
|
+
id: z.string(),
|
|
54089
|
+
type: z.string().or(z.string().array().nonempty()),
|
|
54090
|
+
serviceEndpoint: z.any().or(z.any().array().nonempty())
|
|
54091
|
+
}).catchall(z.any());
|
|
54092
|
+
var DidDocumentValidator = z.object({
|
|
53427
54093
|
"@context": ContextValidator,
|
|
53428
|
-
id:
|
|
53429
|
-
alsoKnownAs:
|
|
53430
|
-
controller:
|
|
54094
|
+
id: z.string(),
|
|
54095
|
+
alsoKnownAs: z.string().optional(),
|
|
54096
|
+
controller: z.string().or(z.string().array().nonempty()).optional(),
|
|
53431
54097
|
verificationMethod: VerificationMethodValidator.array().optional(),
|
|
53432
54098
|
authentication: VerificationMethodValidator.array().optional(),
|
|
53433
54099
|
assertionMethod: VerificationMethodValidator.array().optional(),
|
|
@@ -53437,8 +54103,8 @@ var DidDocumentValidator = mod.object({
|
|
|
53437
54103
|
publicKey: VerificationMethodValidator.array().optional(),
|
|
53438
54104
|
service: ServiceValidator.array().optional(),
|
|
53439
54105
|
proof: ProofValidator.or(ProofValidator.array()).optional()
|
|
53440
|
-
}).catchall(
|
|
53441
|
-
var AlignmentTargetTypeValidator =
|
|
54106
|
+
}).catchall(z.any());
|
|
54107
|
+
var AlignmentTargetTypeValidator = z.enum([
|
|
53442
54108
|
"ceasn:Competency",
|
|
53443
54109
|
"ceterms:Credential",
|
|
53444
54110
|
"CFItem",
|
|
@@ -53446,17 +54112,17 @@ var AlignmentTargetTypeValidator = mod.enum([
|
|
|
53446
54112
|
"CFRubricCriterion",
|
|
53447
54113
|
"CFRubricCriterionLevel",
|
|
53448
54114
|
"CTDL"
|
|
53449
|
-
]).or(
|
|
53450
|
-
var AlignmentValidator =
|
|
53451
|
-
type:
|
|
53452
|
-
targetCode:
|
|
53453
|
-
targetDescription:
|
|
53454
|
-
targetName:
|
|
53455
|
-
targetFramework:
|
|
54115
|
+
]).or(z.string());
|
|
54116
|
+
var AlignmentValidator = z.object({
|
|
54117
|
+
type: z.string().array().nonempty(),
|
|
54118
|
+
targetCode: z.string().optional(),
|
|
54119
|
+
targetDescription: z.string().optional(),
|
|
54120
|
+
targetName: z.string(),
|
|
54121
|
+
targetFramework: z.string().optional(),
|
|
53456
54122
|
targetType: AlignmentTargetTypeValidator.optional(),
|
|
53457
|
-
targetUrl:
|
|
54123
|
+
targetUrl: z.string()
|
|
53458
54124
|
});
|
|
53459
|
-
var KnownAchievementTypeValidator =
|
|
54125
|
+
var KnownAchievementTypeValidator = z.enum([
|
|
53460
54126
|
"Achievement",
|
|
53461
54127
|
"ApprenticeshipCertificate",
|
|
53462
54128
|
"Assessment",
|
|
@@ -53489,23 +54155,23 @@ var KnownAchievementTypeValidator = mod.enum([
|
|
|
53489
54155
|
"ResearchDoctorate",
|
|
53490
54156
|
"SecondarySchoolDiploma"
|
|
53491
54157
|
]);
|
|
53492
|
-
var AchievementTypeValidator = KnownAchievementTypeValidator.or(
|
|
53493
|
-
var CriteriaValidator =
|
|
53494
|
-
var EndorsementSubjectValidator =
|
|
53495
|
-
id:
|
|
53496
|
-
type:
|
|
53497
|
-
endorsementComment:
|
|
54158
|
+
var AchievementTypeValidator = KnownAchievementTypeValidator.or(z.string());
|
|
54159
|
+
var CriteriaValidator = z.object({ id: z.string().optional(), narrative: z.string().optional() }).catchall(z.any());
|
|
54160
|
+
var EndorsementSubjectValidator = z.object({
|
|
54161
|
+
id: z.string(),
|
|
54162
|
+
type: z.string().array().nonempty(),
|
|
54163
|
+
endorsementComment: z.string().optional()
|
|
53498
54164
|
});
|
|
53499
54165
|
var EndorsementCredentialValidator = UnsignedVCValidator.extend({
|
|
53500
54166
|
credentialSubject: EndorsementSubjectValidator,
|
|
53501
54167
|
proof: ProofValidator.or(ProofValidator.array()).optional()
|
|
53502
54168
|
});
|
|
53503
|
-
var RelatedValidator =
|
|
53504
|
-
id:
|
|
53505
|
-
"@language":
|
|
53506
|
-
version:
|
|
54169
|
+
var RelatedValidator = z.object({
|
|
54170
|
+
id: z.string(),
|
|
54171
|
+
"@language": z.string().optional(),
|
|
54172
|
+
version: z.string().optional()
|
|
53507
54173
|
});
|
|
53508
|
-
var ResultTypeValidator =
|
|
54174
|
+
var ResultTypeValidator = z.enum([
|
|
53509
54175
|
"GradePointAverage",
|
|
53510
54176
|
"LetterGrade",
|
|
53511
54177
|
"Percent",
|
|
@@ -53518,59 +54184,59 @@ var ResultTypeValidator = mod.enum([
|
|
|
53518
54184
|
"RubricScore",
|
|
53519
54185
|
"ScaledScore",
|
|
53520
54186
|
"Status"
|
|
53521
|
-
]).or(
|
|
53522
|
-
var RubricCriterionValidator =
|
|
53523
|
-
id:
|
|
53524
|
-
type:
|
|
54187
|
+
]).or(z.string());
|
|
54188
|
+
var RubricCriterionValidator = z.object({
|
|
54189
|
+
id: z.string(),
|
|
54190
|
+
type: z.string().array().nonempty(),
|
|
53525
54191
|
alignment: AlignmentValidator.array().optional(),
|
|
53526
|
-
description:
|
|
53527
|
-
level:
|
|
53528
|
-
name:
|
|
53529
|
-
points:
|
|
53530
|
-
}).catchall(
|
|
53531
|
-
var ResultDescriptionValidator =
|
|
53532
|
-
id:
|
|
53533
|
-
type:
|
|
54192
|
+
description: z.string().optional(),
|
|
54193
|
+
level: z.string().optional(),
|
|
54194
|
+
name: z.string(),
|
|
54195
|
+
points: z.string().optional()
|
|
54196
|
+
}).catchall(z.any());
|
|
54197
|
+
var ResultDescriptionValidator = z.object({
|
|
54198
|
+
id: z.string(),
|
|
54199
|
+
type: z.string().array().nonempty(),
|
|
53534
54200
|
alignment: AlignmentValidator.array().optional(),
|
|
53535
|
-
allowedValue:
|
|
53536
|
-
name:
|
|
53537
|
-
requiredLevel:
|
|
53538
|
-
requiredValue:
|
|
54201
|
+
allowedValue: z.string().array().optional(),
|
|
54202
|
+
name: z.string(),
|
|
54203
|
+
requiredLevel: z.string().optional(),
|
|
54204
|
+
requiredValue: z.string().optional(),
|
|
53539
54205
|
resultType: ResultTypeValidator,
|
|
53540
54206
|
rubricCriterionLevel: RubricCriterionValidator.array().optional(),
|
|
53541
|
-
valueMax:
|
|
53542
|
-
valueMin:
|
|
53543
|
-
}).catchall(
|
|
53544
|
-
var AchievementValidator =
|
|
53545
|
-
id:
|
|
53546
|
-
type:
|
|
54207
|
+
valueMax: z.string().optional(),
|
|
54208
|
+
valueMin: z.string().optional()
|
|
54209
|
+
}).catchall(z.any());
|
|
54210
|
+
var AchievementValidator = z.object({
|
|
54211
|
+
id: z.string().optional(),
|
|
54212
|
+
type: z.string().array().nonempty(),
|
|
53547
54213
|
alignment: AlignmentValidator.array().optional(),
|
|
53548
54214
|
achievementType: AchievementTypeValidator.optional(),
|
|
53549
54215
|
creator: ProfileValidator.optional(),
|
|
53550
|
-
creditsAvailable:
|
|
54216
|
+
creditsAvailable: z.number().optional(),
|
|
53551
54217
|
criteria: CriteriaValidator,
|
|
53552
|
-
description:
|
|
54218
|
+
description: z.string(),
|
|
53553
54219
|
endorsement: EndorsementCredentialValidator.array().optional(),
|
|
53554
|
-
fieldOfStudy:
|
|
53555
|
-
humanCode:
|
|
54220
|
+
fieldOfStudy: z.string().optional(),
|
|
54221
|
+
humanCode: z.string().optional(),
|
|
53556
54222
|
image: ImageValidator.optional(),
|
|
53557
|
-
"@language":
|
|
53558
|
-
name:
|
|
54223
|
+
"@language": z.string().optional(),
|
|
54224
|
+
name: z.string(),
|
|
53559
54225
|
otherIdentifier: IdentifierEntryValidator.array().optional(),
|
|
53560
54226
|
related: RelatedValidator.array().optional(),
|
|
53561
54227
|
resultDescription: ResultDescriptionValidator.array().optional(),
|
|
53562
|
-
specialization:
|
|
53563
|
-
tag:
|
|
53564
|
-
version:
|
|
53565
|
-
}).catchall(
|
|
53566
|
-
var IdentityObjectValidator =
|
|
53567
|
-
type:
|
|
53568
|
-
hashed:
|
|
53569
|
-
identityHash:
|
|
53570
|
-
identityType:
|
|
53571
|
-
salt:
|
|
54228
|
+
specialization: z.string().optional(),
|
|
54229
|
+
tag: z.string().array().optional(),
|
|
54230
|
+
version: z.string().optional()
|
|
54231
|
+
}).catchall(z.any());
|
|
54232
|
+
var IdentityObjectValidator = z.object({
|
|
54233
|
+
type: z.string(),
|
|
54234
|
+
hashed: z.boolean(),
|
|
54235
|
+
identityHash: z.string(),
|
|
54236
|
+
identityType: z.string(),
|
|
54237
|
+
salt: z.string().optional()
|
|
53572
54238
|
});
|
|
53573
|
-
var ResultStatusTypeValidator =
|
|
54239
|
+
var ResultStatusTypeValidator = z.enum([
|
|
53574
54240
|
"Completed",
|
|
53575
54241
|
"Enrolled",
|
|
53576
54242
|
"Failed",
|
|
@@ -53578,42 +54244,42 @@ var ResultStatusTypeValidator = mod.enum([
|
|
|
53578
54244
|
"OnHold",
|
|
53579
54245
|
"Withdrew"
|
|
53580
54246
|
]);
|
|
53581
|
-
var ResultValidator =
|
|
53582
|
-
type:
|
|
53583
|
-
achievedLevel:
|
|
54247
|
+
var ResultValidator = z.object({
|
|
54248
|
+
type: z.string().array().nonempty(),
|
|
54249
|
+
achievedLevel: z.string().optional(),
|
|
53584
54250
|
alignment: AlignmentValidator.array().optional(),
|
|
53585
|
-
resultDescription:
|
|
54251
|
+
resultDescription: z.string().optional(),
|
|
53586
54252
|
status: ResultStatusTypeValidator.optional(),
|
|
53587
|
-
value:
|
|
53588
|
-
}).catchall(
|
|
53589
|
-
var AchievementSubjectValidator =
|
|
53590
|
-
id:
|
|
53591
|
-
type:
|
|
53592
|
-
activityEndDate:
|
|
53593
|
-
activityStartDate:
|
|
53594
|
-
creditsEarned:
|
|
54253
|
+
value: z.string().optional()
|
|
54254
|
+
}).catchall(z.any());
|
|
54255
|
+
var AchievementSubjectValidator = z.object({
|
|
54256
|
+
id: z.string().optional(),
|
|
54257
|
+
type: z.string().array().nonempty(),
|
|
54258
|
+
activityEndDate: z.string().optional(),
|
|
54259
|
+
activityStartDate: z.string().optional(),
|
|
54260
|
+
creditsEarned: z.number().optional(),
|
|
53595
54261
|
achievement: AchievementValidator.optional(),
|
|
53596
54262
|
identifier: IdentityObjectValidator.array().optional(),
|
|
53597
54263
|
image: ImageValidator.optional(),
|
|
53598
|
-
licenseNumber:
|
|
53599
|
-
narrative:
|
|
54264
|
+
licenseNumber: z.string().optional(),
|
|
54265
|
+
narrative: z.string().optional(),
|
|
53600
54266
|
result: ResultValidator.array().optional(),
|
|
53601
|
-
role:
|
|
54267
|
+
role: z.string().optional(),
|
|
53602
54268
|
source: ProfileValidator.optional(),
|
|
53603
|
-
term:
|
|
53604
|
-
}).catchall(
|
|
53605
|
-
var EvidenceValidator =
|
|
53606
|
-
id:
|
|
53607
|
-
type:
|
|
53608
|
-
narrative:
|
|
53609
|
-
name:
|
|
53610
|
-
description:
|
|
53611
|
-
genre:
|
|
53612
|
-
audience:
|
|
53613
|
-
}).catchall(
|
|
54269
|
+
term: z.string().optional()
|
|
54270
|
+
}).catchall(z.any());
|
|
54271
|
+
var EvidenceValidator = z.object({
|
|
54272
|
+
id: z.string().optional(),
|
|
54273
|
+
type: z.string().or(z.string().array().nonempty()),
|
|
54274
|
+
narrative: z.string().optional(),
|
|
54275
|
+
name: z.string().optional(),
|
|
54276
|
+
description: z.string().optional(),
|
|
54277
|
+
genre: z.string().optional(),
|
|
54278
|
+
audience: z.string().optional()
|
|
54279
|
+
}).catchall(z.any());
|
|
53614
54280
|
var UnsignedAchievementCredentialValidator = UnsignedVCValidator.extend({
|
|
53615
|
-
name:
|
|
53616
|
-
description:
|
|
54281
|
+
name: z.string().optional(),
|
|
54282
|
+
description: z.string().optional(),
|
|
53617
54283
|
image: ImageValidator.optional(),
|
|
53618
54284
|
credentialSubject: AchievementSubjectValidator.or(
|
|
53619
54285
|
AchievementSubjectValidator.array()
|
|
@@ -53624,42 +54290,42 @@ var UnsignedAchievementCredentialValidator = UnsignedVCValidator.extend({
|
|
|
53624
54290
|
var AchievementCredentialValidator = UnsignedAchievementCredentialValidator.extend({
|
|
53625
54291
|
proof: ProofValidator.or(ProofValidator.array())
|
|
53626
54292
|
});
|
|
53627
|
-
var VerificationCheckValidator =
|
|
53628
|
-
checks:
|
|
53629
|
-
warnings:
|
|
53630
|
-
errors:
|
|
54293
|
+
var VerificationCheckValidator = z.object({
|
|
54294
|
+
checks: z.string().array(),
|
|
54295
|
+
warnings: z.string().array(),
|
|
54296
|
+
errors: z.string().array()
|
|
53631
54297
|
});
|
|
53632
|
-
var VerificationStatusValidator =
|
|
54298
|
+
var VerificationStatusValidator = z.enum(["Success", "Failed", "Error"]);
|
|
53633
54299
|
var VerificationStatusEnum = VerificationStatusValidator.enum;
|
|
53634
|
-
var VerificationItemValidator =
|
|
53635
|
-
check:
|
|
54300
|
+
var VerificationItemValidator = z.object({
|
|
54301
|
+
check: z.string(),
|
|
53636
54302
|
status: VerificationStatusValidator,
|
|
53637
|
-
message:
|
|
53638
|
-
details:
|
|
54303
|
+
message: z.string().optional(),
|
|
54304
|
+
details: z.string().optional()
|
|
53639
54305
|
});
|
|
53640
|
-
var CredentialInfoValidator =
|
|
53641
|
-
title:
|
|
53642
|
-
createdAt:
|
|
54306
|
+
var CredentialInfoValidator = z.object({
|
|
54307
|
+
title: z.string().optional(),
|
|
54308
|
+
createdAt: z.string().optional(),
|
|
53643
54309
|
issuer: ProfileValidator.optional(),
|
|
53644
54310
|
issuee: ProfileValidator.optional(),
|
|
53645
54311
|
credentialSubject: CredentialSubjectValidator.optional()
|
|
53646
54312
|
});
|
|
53647
|
-
var CredentialRecordValidator =
|
|
53648
|
-
var PaginationOptionsValidator =
|
|
53649
|
-
limit:
|
|
53650
|
-
cursor:
|
|
53651
|
-
sort:
|
|
54313
|
+
var CredentialRecordValidator = z.object({ id: z.string(), uri: z.string() }).catchall(z.any());
|
|
54314
|
+
var PaginationOptionsValidator = z.object({
|
|
54315
|
+
limit: z.number(),
|
|
54316
|
+
cursor: z.string().optional(),
|
|
54317
|
+
sort: z.string().optional()
|
|
53652
54318
|
});
|
|
53653
|
-
var PaginationResponseValidator =
|
|
53654
|
-
cursor:
|
|
53655
|
-
hasMore:
|
|
54319
|
+
var PaginationResponseValidator = z.object({
|
|
54320
|
+
cursor: z.string().optional(),
|
|
54321
|
+
hasMore: z.boolean()
|
|
53656
54322
|
});
|
|
53657
|
-
var EncryptedRecordValidator =
|
|
54323
|
+
var EncryptedRecordValidator = z.object({ encryptedRecord: JWEValidator, fields: z.string().array() }).catchall(z.any());
|
|
53658
54324
|
var PaginatedEncryptedRecordsValidator = PaginationResponseValidator.extend({
|
|
53659
54325
|
records: EncryptedRecordValidator.array()
|
|
53660
54326
|
});
|
|
53661
54327
|
var EncryptedCredentialRecordValidator = EncryptedRecordValidator.extend({
|
|
53662
|
-
id:
|
|
54328
|
+
id: z.string()
|
|
53663
54329
|
});
|
|
53664
54330
|
var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.extend({
|
|
53665
54331
|
records: EncryptedCredentialRecordValidator.array()
|
|
@@ -53670,8 +54336,8 @@ var parseRegexString = /* @__PURE__ */ __name2((regexStr) => {
|
|
|
53670
54336
|
throw new Error("Invalid RegExp string format");
|
|
53671
54337
|
return { pattern: match[1], flags: match[2] };
|
|
53672
54338
|
}, "parseRegexString");
|
|
53673
|
-
var RegExpValidator =
|
|
53674
|
-
|
|
54339
|
+
var RegExpValidator = z.instanceof(RegExp).or(
|
|
54340
|
+
z.string().refine(
|
|
53675
54341
|
(str) => {
|
|
53676
54342
|
try {
|
|
53677
54343
|
parseRegexString(str);
|
|
@@ -53692,71 +54358,71 @@ var RegExpValidator = mod.instanceof(RegExp).or(
|
|
|
53692
54358
|
}
|
|
53693
54359
|
})
|
|
53694
54360
|
);
|
|
53695
|
-
var StringQuery =
|
|
53696
|
-
var LCNProfileDisplayValidator =
|
|
53697
|
-
backgroundColor:
|
|
53698
|
-
backgroundImage:
|
|
53699
|
-
fadeBackgroundImage:
|
|
53700
|
-
repeatBackgroundImage:
|
|
53701
|
-
fontColor:
|
|
53702
|
-
accentColor:
|
|
53703
|
-
accentFontColor:
|
|
53704
|
-
idBackgroundImage:
|
|
53705
|
-
fadeIdBackgroundImage:
|
|
53706
|
-
idBackgroundColor:
|
|
53707
|
-
repeatIdBackgroundImage:
|
|
54361
|
+
var StringQuery = z.string().or(z.object({ $in: z.string().array() })).or(z.object({ $regex: RegExpValidator }));
|
|
54362
|
+
var LCNProfileDisplayValidator = z.object({
|
|
54363
|
+
backgroundColor: z.string().optional(),
|
|
54364
|
+
backgroundImage: z.string().optional(),
|
|
54365
|
+
fadeBackgroundImage: z.boolean().optional(),
|
|
54366
|
+
repeatBackgroundImage: z.boolean().optional(),
|
|
54367
|
+
fontColor: z.string().optional(),
|
|
54368
|
+
accentColor: z.string().optional(),
|
|
54369
|
+
accentFontColor: z.string().optional(),
|
|
54370
|
+
idBackgroundImage: z.string().optional(),
|
|
54371
|
+
fadeIdBackgroundImage: z.boolean().optional(),
|
|
54372
|
+
idBackgroundColor: z.string().optional(),
|
|
54373
|
+
repeatIdBackgroundImage: z.boolean().optional()
|
|
53708
54374
|
});
|
|
53709
|
-
var LCNProfileValidator =
|
|
53710
|
-
profileId:
|
|
53711
|
-
displayName:
|
|
53712
|
-
shortBio:
|
|
53713
|
-
bio:
|
|
53714
|
-
did:
|
|
53715
|
-
isPrivate:
|
|
53716
|
-
email:
|
|
53717
|
-
image:
|
|
53718
|
-
heroImage:
|
|
53719
|
-
websiteLink:
|
|
53720
|
-
isServiceProfile:
|
|
53721
|
-
type:
|
|
53722
|
-
notificationsWebhook:
|
|
54375
|
+
var LCNProfileValidator = z.object({
|
|
54376
|
+
profileId: z.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),
|
|
54377
|
+
displayName: z.string().default("").describe("Human-readable display name for the profile."),
|
|
54378
|
+
shortBio: z.string().default("").describe("Short bio for the profile."),
|
|
54379
|
+
bio: z.string().default("").describe("Longer bio for the profile."),
|
|
54380
|
+
did: z.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),
|
|
54381
|
+
isPrivate: z.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),
|
|
54382
|
+
email: z.string().optional().describe("Contact email address for the profile."),
|
|
54383
|
+
image: z.string().optional().describe("Profile image URL for the profile."),
|
|
54384
|
+
heroImage: z.string().optional().describe("Hero image URL for the profile."),
|
|
54385
|
+
websiteLink: z.string().optional().describe("Website link for the profile."),
|
|
54386
|
+
isServiceProfile: z.boolean().default(false).optional().describe("Whether the profile is a service profile or not."),
|
|
54387
|
+
type: z.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),
|
|
54388
|
+
notificationsWebhook: z.string().url().startsWith("http").optional().describe("URL to send notifications to."),
|
|
53723
54389
|
display: LCNProfileDisplayValidator.optional().describe("Display settings for the profile."),
|
|
53724
|
-
role:
|
|
53725
|
-
dob:
|
|
54390
|
+
role: z.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),
|
|
54391
|
+
dob: z.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".')
|
|
53726
54392
|
});
|
|
53727
|
-
var LCNProfileQueryValidator =
|
|
54393
|
+
var LCNProfileQueryValidator = z.object({
|
|
53728
54394
|
profileId: StringQuery,
|
|
53729
54395
|
displayName: StringQuery,
|
|
53730
54396
|
shortBio: StringQuery,
|
|
53731
54397
|
bio: StringQuery,
|
|
53732
54398
|
email: StringQuery,
|
|
53733
54399
|
websiteLink: StringQuery,
|
|
53734
|
-
isServiceProfile:
|
|
54400
|
+
isServiceProfile: z.boolean(),
|
|
53735
54401
|
type: StringQuery
|
|
53736
54402
|
}).partial();
|
|
53737
54403
|
var PaginatedLCNProfilesValidator = PaginationResponseValidator.extend({
|
|
53738
54404
|
records: LCNProfileValidator.array()
|
|
53739
54405
|
});
|
|
53740
|
-
var LCNProfileConnectionStatusEnum =
|
|
54406
|
+
var LCNProfileConnectionStatusEnum = z.enum([
|
|
53741
54407
|
"CONNECTED",
|
|
53742
54408
|
"PENDING_REQUEST_SENT",
|
|
53743
54409
|
"PENDING_REQUEST_RECEIVED",
|
|
53744
54410
|
"NOT_CONNECTED"
|
|
53745
54411
|
]);
|
|
53746
|
-
var LCNProfileManagerValidator =
|
|
53747
|
-
id:
|
|
53748
|
-
created:
|
|
53749
|
-
displayName:
|
|
53750
|
-
shortBio:
|
|
53751
|
-
bio:
|
|
53752
|
-
email:
|
|
53753
|
-
image:
|
|
53754
|
-
heroImage:
|
|
54412
|
+
var LCNProfileManagerValidator = z.object({
|
|
54413
|
+
id: z.string(),
|
|
54414
|
+
created: z.string(),
|
|
54415
|
+
displayName: z.string().default("").optional(),
|
|
54416
|
+
shortBio: z.string().default("").optional(),
|
|
54417
|
+
bio: z.string().default("").optional(),
|
|
54418
|
+
email: z.string().optional(),
|
|
54419
|
+
image: z.string().optional(),
|
|
54420
|
+
heroImage: z.string().optional()
|
|
53755
54421
|
});
|
|
53756
54422
|
var PaginatedLCNProfileManagersValidator = PaginationResponseValidator.extend({
|
|
53757
|
-
records: LCNProfileManagerValidator.extend({ did:
|
|
54423
|
+
records: LCNProfileManagerValidator.extend({ did: z.string() }).array()
|
|
53758
54424
|
});
|
|
53759
|
-
var LCNProfileManagerQueryValidator =
|
|
54425
|
+
var LCNProfileManagerQueryValidator = z.object({
|
|
53760
54426
|
id: StringQuery,
|
|
53761
54427
|
displayName: StringQuery,
|
|
53762
54428
|
shortBio: StringQuery,
|
|
@@ -53764,296 +54430,296 @@ var LCNProfileManagerQueryValidator = mod.object({
|
|
|
53764
54430
|
email: StringQuery
|
|
53765
54431
|
}).partial();
|
|
53766
54432
|
var PaginatedLCNProfilesAndManagersValidator = PaginationResponseValidator.extend({
|
|
53767
|
-
records:
|
|
54433
|
+
records: z.object({
|
|
53768
54434
|
profile: LCNProfileValidator,
|
|
53769
|
-
manager: LCNProfileManagerValidator.extend({ did:
|
|
54435
|
+
manager: LCNProfileManagerValidator.extend({ did: z.string() }).optional()
|
|
53770
54436
|
}).array()
|
|
53771
54437
|
});
|
|
53772
|
-
var SentCredentialInfoValidator =
|
|
53773
|
-
uri:
|
|
53774
|
-
to:
|
|
53775
|
-
from:
|
|
53776
|
-
sent:
|
|
53777
|
-
received:
|
|
54438
|
+
var SentCredentialInfoValidator = z.object({
|
|
54439
|
+
uri: z.string(),
|
|
54440
|
+
to: z.string(),
|
|
54441
|
+
from: z.string(),
|
|
54442
|
+
sent: z.string().datetime(),
|
|
54443
|
+
received: z.string().datetime().optional()
|
|
53778
54444
|
});
|
|
53779
|
-
var BoostPermissionsValidator =
|
|
53780
|
-
role:
|
|
53781
|
-
canEdit:
|
|
53782
|
-
canIssue:
|
|
53783
|
-
canRevoke:
|
|
53784
|
-
canManagePermissions:
|
|
53785
|
-
canIssueChildren:
|
|
53786
|
-
canCreateChildren:
|
|
53787
|
-
canEditChildren:
|
|
53788
|
-
canRevokeChildren:
|
|
53789
|
-
canManageChildrenPermissions:
|
|
53790
|
-
canManageChildrenProfiles:
|
|
53791
|
-
canViewAnalytics:
|
|
54445
|
+
var BoostPermissionsValidator = z.object({
|
|
54446
|
+
role: z.string(),
|
|
54447
|
+
canEdit: z.boolean(),
|
|
54448
|
+
canIssue: z.boolean(),
|
|
54449
|
+
canRevoke: z.boolean(),
|
|
54450
|
+
canManagePermissions: z.boolean(),
|
|
54451
|
+
canIssueChildren: z.string(),
|
|
54452
|
+
canCreateChildren: z.string(),
|
|
54453
|
+
canEditChildren: z.string(),
|
|
54454
|
+
canRevokeChildren: z.string(),
|
|
54455
|
+
canManageChildrenPermissions: z.string(),
|
|
54456
|
+
canManageChildrenProfiles: z.boolean().default(false).optional(),
|
|
54457
|
+
canViewAnalytics: z.boolean()
|
|
53792
54458
|
});
|
|
53793
|
-
var BoostPermissionsQueryValidator =
|
|
54459
|
+
var BoostPermissionsQueryValidator = z.object({
|
|
53794
54460
|
role: StringQuery,
|
|
53795
|
-
canEdit:
|
|
53796
|
-
canIssue:
|
|
53797
|
-
canRevoke:
|
|
53798
|
-
canManagePermissions:
|
|
54461
|
+
canEdit: z.boolean(),
|
|
54462
|
+
canIssue: z.boolean(),
|
|
54463
|
+
canRevoke: z.boolean(),
|
|
54464
|
+
canManagePermissions: z.boolean(),
|
|
53799
54465
|
canIssueChildren: StringQuery,
|
|
53800
54466
|
canCreateChildren: StringQuery,
|
|
53801
54467
|
canEditChildren: StringQuery,
|
|
53802
54468
|
canRevokeChildren: StringQuery,
|
|
53803
54469
|
canManageChildrenPermissions: StringQuery,
|
|
53804
|
-
canManageChildrenProfiles:
|
|
53805
|
-
canViewAnalytics:
|
|
54470
|
+
canManageChildrenProfiles: z.boolean(),
|
|
54471
|
+
canViewAnalytics: z.boolean()
|
|
53806
54472
|
}).partial();
|
|
53807
|
-
var ClaimHookTypeValidator =
|
|
53808
|
-
var ClaimHookValidator =
|
|
53809
|
-
|
|
53810
|
-
type:
|
|
53811
|
-
data:
|
|
53812
|
-
claimUri:
|
|
53813
|
-
targetUri:
|
|
54473
|
+
var ClaimHookTypeValidator = z.enum(["GRANT_PERMISSIONS", "ADD_ADMIN"]);
|
|
54474
|
+
var ClaimHookValidator = z.discriminatedUnion("type", [
|
|
54475
|
+
z.object({
|
|
54476
|
+
type: z.literal(ClaimHookTypeValidator.Values.GRANT_PERMISSIONS),
|
|
54477
|
+
data: z.object({
|
|
54478
|
+
claimUri: z.string(),
|
|
54479
|
+
targetUri: z.string(),
|
|
53814
54480
|
permissions: BoostPermissionsValidator.partial()
|
|
53815
54481
|
})
|
|
53816
54482
|
}),
|
|
53817
|
-
|
|
53818
|
-
type:
|
|
53819
|
-
data:
|
|
54483
|
+
z.object({
|
|
54484
|
+
type: z.literal(ClaimHookTypeValidator.Values.ADD_ADMIN),
|
|
54485
|
+
data: z.object({ claimUri: z.string(), targetUri: z.string() })
|
|
53820
54486
|
})
|
|
53821
54487
|
]);
|
|
53822
|
-
var ClaimHookQueryValidator =
|
|
54488
|
+
var ClaimHookQueryValidator = z.object({
|
|
53823
54489
|
type: StringQuery,
|
|
53824
|
-
data:
|
|
54490
|
+
data: z.object({
|
|
53825
54491
|
claimUri: StringQuery,
|
|
53826
54492
|
targetUri: StringQuery,
|
|
53827
54493
|
permissions: BoostPermissionsQueryValidator
|
|
53828
54494
|
})
|
|
53829
54495
|
}).deepPartial();
|
|
53830
|
-
var FullClaimHookValidator =
|
|
54496
|
+
var FullClaimHookValidator = z.object({ id: z.string(), createdAt: z.string(), updatedAt: z.string() }).and(ClaimHookValidator);
|
|
53831
54497
|
var PaginatedClaimHooksValidator = PaginationResponseValidator.extend({
|
|
53832
54498
|
records: FullClaimHookValidator.array()
|
|
53833
54499
|
});
|
|
53834
|
-
var LCNBoostStatus =
|
|
53835
|
-
var BoostValidator =
|
|
53836
|
-
uri:
|
|
53837
|
-
name:
|
|
53838
|
-
type:
|
|
53839
|
-
category:
|
|
54500
|
+
var LCNBoostStatus = z.enum(["DRAFT", "LIVE"]);
|
|
54501
|
+
var BoostValidator = z.object({
|
|
54502
|
+
uri: z.string(),
|
|
54503
|
+
name: z.string().optional(),
|
|
54504
|
+
type: z.string().optional(),
|
|
54505
|
+
category: z.string().optional(),
|
|
53840
54506
|
status: LCNBoostStatus.optional(),
|
|
53841
|
-
autoConnectRecipients:
|
|
53842
|
-
meta:
|
|
54507
|
+
autoConnectRecipients: z.boolean().optional(),
|
|
54508
|
+
meta: z.record(z.any()).optional(),
|
|
53843
54509
|
claimPermissions: BoostPermissionsValidator.optional()
|
|
53844
54510
|
});
|
|
53845
|
-
var BoostQueryValidator =
|
|
54511
|
+
var BoostQueryValidator = z.object({
|
|
53846
54512
|
uri: StringQuery,
|
|
53847
54513
|
name: StringQuery,
|
|
53848
54514
|
type: StringQuery,
|
|
53849
54515
|
category: StringQuery,
|
|
53850
|
-
meta:
|
|
53851
|
-
status: LCNBoostStatus.or(
|
|
53852
|
-
autoConnectRecipients:
|
|
54516
|
+
meta: z.record(StringQuery),
|
|
54517
|
+
status: LCNBoostStatus.or(z.object({ $in: LCNBoostStatus.array() })),
|
|
54518
|
+
autoConnectRecipients: z.boolean()
|
|
53853
54519
|
}).partial();
|
|
53854
54520
|
var PaginatedBoostsValidator = PaginationResponseValidator.extend({
|
|
53855
54521
|
records: BoostValidator.array()
|
|
53856
54522
|
});
|
|
53857
|
-
var BoostRecipientValidator =
|
|
54523
|
+
var BoostRecipientValidator = z.object({
|
|
53858
54524
|
to: LCNProfileValidator,
|
|
53859
|
-
from:
|
|
53860
|
-
received:
|
|
53861
|
-
uri:
|
|
54525
|
+
from: z.string(),
|
|
54526
|
+
received: z.string().optional(),
|
|
54527
|
+
uri: z.string().optional()
|
|
53862
54528
|
});
|
|
53863
54529
|
var PaginatedBoostRecipientsValidator = PaginationResponseValidator.extend({
|
|
53864
54530
|
records: BoostRecipientValidator.array()
|
|
53865
54531
|
});
|
|
53866
|
-
var LCNBoostClaimLinkSigningAuthorityValidator =
|
|
53867
|
-
endpoint:
|
|
53868
|
-
name:
|
|
53869
|
-
did:
|
|
54532
|
+
var LCNBoostClaimLinkSigningAuthorityValidator = z.object({
|
|
54533
|
+
endpoint: z.string(),
|
|
54534
|
+
name: z.string(),
|
|
54535
|
+
did: z.string().optional()
|
|
53870
54536
|
});
|
|
53871
|
-
var LCNBoostClaimLinkOptionsValidator =
|
|
53872
|
-
ttlSeconds:
|
|
53873
|
-
totalUses:
|
|
54537
|
+
var LCNBoostClaimLinkOptionsValidator = z.object({
|
|
54538
|
+
ttlSeconds: z.number().optional(),
|
|
54539
|
+
totalUses: z.number().optional()
|
|
53874
54540
|
});
|
|
53875
|
-
var LCNSigningAuthorityValidator =
|
|
53876
|
-
endpoint:
|
|
54541
|
+
var LCNSigningAuthorityValidator = z.object({
|
|
54542
|
+
endpoint: z.string()
|
|
53877
54543
|
});
|
|
53878
|
-
var LCNSigningAuthorityForUserValidator =
|
|
54544
|
+
var LCNSigningAuthorityForUserValidator = z.object({
|
|
53879
54545
|
signingAuthority: LCNSigningAuthorityValidator,
|
|
53880
|
-
relationship:
|
|
53881
|
-
name:
|
|
54546
|
+
relationship: z.object({
|
|
54547
|
+
name: z.string().max(15).regex(/^[a-z0-9-]+$/, {
|
|
53882
54548
|
message: "The input string must contain only lowercase letters, numbers, and hyphens."
|
|
53883
54549
|
}),
|
|
53884
|
-
did:
|
|
54550
|
+
did: z.string()
|
|
53885
54551
|
})
|
|
53886
54552
|
});
|
|
53887
|
-
var AutoBoostConfigValidator =
|
|
53888
|
-
boostUri:
|
|
53889
|
-
signingAuthority:
|
|
53890
|
-
endpoint:
|
|
53891
|
-
name:
|
|
54553
|
+
var AutoBoostConfigValidator = z.object({
|
|
54554
|
+
boostUri: z.string(),
|
|
54555
|
+
signingAuthority: z.object({
|
|
54556
|
+
endpoint: z.string(),
|
|
54557
|
+
name: z.string()
|
|
53892
54558
|
})
|
|
53893
54559
|
});
|
|
53894
|
-
var ConsentFlowTermsStatusValidator =
|
|
53895
|
-
var ConsentFlowContractValidator =
|
|
53896
|
-
read:
|
|
53897
|
-
anonymize:
|
|
53898
|
-
credentials:
|
|
53899
|
-
personal:
|
|
54560
|
+
var ConsentFlowTermsStatusValidator = z.enum(["live", "stale", "withdrawn"]);
|
|
54561
|
+
var ConsentFlowContractValidator = z.object({
|
|
54562
|
+
read: z.object({
|
|
54563
|
+
anonymize: z.boolean().optional(),
|
|
54564
|
+
credentials: z.object({ categories: z.record(z.object({ required: z.boolean() })).default({}) }).default({}),
|
|
54565
|
+
personal: z.record(z.object({ required: z.boolean() })).default({})
|
|
53900
54566
|
}).default({}),
|
|
53901
|
-
write:
|
|
53902
|
-
credentials:
|
|
53903
|
-
personal:
|
|
54567
|
+
write: z.object({
|
|
54568
|
+
credentials: z.object({ categories: z.record(z.object({ required: z.boolean() })).default({}) }).default({}),
|
|
54569
|
+
personal: z.record(z.object({ required: z.boolean() })).default({})
|
|
53904
54570
|
}).default({})
|
|
53905
54571
|
});
|
|
53906
|
-
var ConsentFlowContractDetailsValidator =
|
|
54572
|
+
var ConsentFlowContractDetailsValidator = z.object({
|
|
53907
54573
|
contract: ConsentFlowContractValidator,
|
|
53908
54574
|
owner: LCNProfileValidator,
|
|
53909
|
-
name:
|
|
53910
|
-
subtitle:
|
|
53911
|
-
description:
|
|
53912
|
-
reasonForAccessing:
|
|
53913
|
-
image:
|
|
53914
|
-
uri:
|
|
53915
|
-
needsGuardianConsent:
|
|
53916
|
-
redirectUrl:
|
|
53917
|
-
frontDoorBoostUri:
|
|
53918
|
-
createdAt:
|
|
53919
|
-
updatedAt:
|
|
53920
|
-
expiresAt:
|
|
53921
|
-
autoBoosts:
|
|
53922
|
-
writers:
|
|
54575
|
+
name: z.string(),
|
|
54576
|
+
subtitle: z.string().optional(),
|
|
54577
|
+
description: z.string().optional(),
|
|
54578
|
+
reasonForAccessing: z.string().optional(),
|
|
54579
|
+
image: z.string().optional(),
|
|
54580
|
+
uri: z.string(),
|
|
54581
|
+
needsGuardianConsent: z.boolean().optional(),
|
|
54582
|
+
redirectUrl: z.string().optional(),
|
|
54583
|
+
frontDoorBoostUri: z.string().optional(),
|
|
54584
|
+
createdAt: z.string(),
|
|
54585
|
+
updatedAt: z.string(),
|
|
54586
|
+
expiresAt: z.string().optional(),
|
|
54587
|
+
autoBoosts: z.string().array().optional(),
|
|
54588
|
+
writers: z.array(LCNProfileValidator).optional()
|
|
53923
54589
|
});
|
|
53924
54590
|
var PaginatedConsentFlowContractsValidator = PaginationResponseValidator.extend({
|
|
53925
54591
|
records: ConsentFlowContractDetailsValidator.omit({ owner: true }).array()
|
|
53926
54592
|
});
|
|
53927
|
-
var ConsentFlowContractDataValidator =
|
|
53928
|
-
credentials:
|
|
53929
|
-
personal:
|
|
53930
|
-
date:
|
|
54593
|
+
var ConsentFlowContractDataValidator = z.object({
|
|
54594
|
+
credentials: z.object({ categories: z.record(z.string().array()).default({}) }),
|
|
54595
|
+
personal: z.record(z.string()).default({}),
|
|
54596
|
+
date: z.string()
|
|
53931
54597
|
});
|
|
53932
54598
|
var PaginatedConsentFlowDataValidator = PaginationResponseValidator.extend({
|
|
53933
54599
|
records: ConsentFlowContractDataValidator.array()
|
|
53934
54600
|
});
|
|
53935
|
-
var ConsentFlowContractDataForDidValidator =
|
|
53936
|
-
credentials:
|
|
53937
|
-
personal:
|
|
53938
|
-
date:
|
|
53939
|
-
contractUri:
|
|
54601
|
+
var ConsentFlowContractDataForDidValidator = z.object({
|
|
54602
|
+
credentials: z.object({ category: z.string(), uri: z.string() }).array(),
|
|
54603
|
+
personal: z.record(z.string()).default({}),
|
|
54604
|
+
date: z.string(),
|
|
54605
|
+
contractUri: z.string()
|
|
53940
54606
|
});
|
|
53941
54607
|
var PaginatedConsentFlowDataForDidValidator = PaginationResponseValidator.extend({
|
|
53942
54608
|
records: ConsentFlowContractDataForDidValidator.array()
|
|
53943
54609
|
});
|
|
53944
|
-
var ConsentFlowTermValidator =
|
|
53945
|
-
sharing:
|
|
53946
|
-
shared:
|
|
53947
|
-
shareAll:
|
|
53948
|
-
shareUntil:
|
|
54610
|
+
var ConsentFlowTermValidator = z.object({
|
|
54611
|
+
sharing: z.boolean().optional(),
|
|
54612
|
+
shared: z.string().array().optional(),
|
|
54613
|
+
shareAll: z.boolean().optional(),
|
|
54614
|
+
shareUntil: z.string().optional()
|
|
53949
54615
|
});
|
|
53950
|
-
var ConsentFlowTermsValidator =
|
|
53951
|
-
read:
|
|
53952
|
-
anonymize:
|
|
53953
|
-
credentials:
|
|
53954
|
-
shareAll:
|
|
53955
|
-
sharing:
|
|
53956
|
-
categories:
|
|
54616
|
+
var ConsentFlowTermsValidator = z.object({
|
|
54617
|
+
read: z.object({
|
|
54618
|
+
anonymize: z.boolean().optional(),
|
|
54619
|
+
credentials: z.object({
|
|
54620
|
+
shareAll: z.boolean().optional(),
|
|
54621
|
+
sharing: z.boolean().optional(),
|
|
54622
|
+
categories: z.record(ConsentFlowTermValidator).default({})
|
|
53957
54623
|
}).default({}),
|
|
53958
|
-
personal:
|
|
54624
|
+
personal: z.record(z.string()).default({})
|
|
53959
54625
|
}).default({}),
|
|
53960
|
-
write:
|
|
53961
|
-
credentials:
|
|
53962
|
-
personal:
|
|
54626
|
+
write: z.object({
|
|
54627
|
+
credentials: z.object({ categories: z.record(z.boolean()).default({}) }).default({}),
|
|
54628
|
+
personal: z.record(z.boolean()).default({})
|
|
53963
54629
|
}).default({}),
|
|
53964
|
-
deniedWriters:
|
|
54630
|
+
deniedWriters: z.array(z.string()).optional()
|
|
53965
54631
|
});
|
|
53966
54632
|
var PaginatedConsentFlowTermsValidator = PaginationResponseValidator.extend({
|
|
53967
|
-
records:
|
|
53968
|
-
expiresAt:
|
|
53969
|
-
oneTime:
|
|
54633
|
+
records: z.object({
|
|
54634
|
+
expiresAt: z.string().optional(),
|
|
54635
|
+
oneTime: z.boolean().optional(),
|
|
53970
54636
|
terms: ConsentFlowTermsValidator,
|
|
53971
54637
|
contract: ConsentFlowContractDetailsValidator,
|
|
53972
|
-
uri:
|
|
54638
|
+
uri: z.string(),
|
|
53973
54639
|
consenter: LCNProfileValidator,
|
|
53974
54640
|
status: ConsentFlowTermsStatusValidator
|
|
53975
54641
|
}).array()
|
|
53976
54642
|
});
|
|
53977
|
-
var ConsentFlowContractQueryValidator =
|
|
53978
|
-
read:
|
|
53979
|
-
anonymize:
|
|
53980
|
-
credentials:
|
|
53981
|
-
categories:
|
|
54643
|
+
var ConsentFlowContractQueryValidator = z.object({
|
|
54644
|
+
read: z.object({
|
|
54645
|
+
anonymize: z.boolean().optional(),
|
|
54646
|
+
credentials: z.object({
|
|
54647
|
+
categories: z.record(z.object({ required: z.boolean().optional() })).optional()
|
|
53982
54648
|
}).optional(),
|
|
53983
|
-
personal:
|
|
54649
|
+
personal: z.record(z.object({ required: z.boolean().optional() })).optional()
|
|
53984
54650
|
}).optional(),
|
|
53985
|
-
write:
|
|
53986
|
-
credentials:
|
|
53987
|
-
categories:
|
|
54651
|
+
write: z.object({
|
|
54652
|
+
credentials: z.object({
|
|
54653
|
+
categories: z.record(z.object({ required: z.boolean().optional() })).optional()
|
|
53988
54654
|
}).optional(),
|
|
53989
|
-
personal:
|
|
54655
|
+
personal: z.record(z.object({ required: z.boolean().optional() })).optional()
|
|
53990
54656
|
}).optional()
|
|
53991
54657
|
});
|
|
53992
|
-
var ConsentFlowDataQueryValidator =
|
|
53993
|
-
anonymize:
|
|
53994
|
-
credentials:
|
|
53995
|
-
personal:
|
|
54658
|
+
var ConsentFlowDataQueryValidator = z.object({
|
|
54659
|
+
anonymize: z.boolean().optional(),
|
|
54660
|
+
credentials: z.object({ categories: z.record(z.boolean()).optional() }).optional(),
|
|
54661
|
+
personal: z.record(z.boolean()).optional()
|
|
53996
54662
|
});
|
|
53997
|
-
var ConsentFlowDataForDidQueryValidator =
|
|
53998
|
-
credentials:
|
|
53999
|
-
personal:
|
|
54663
|
+
var ConsentFlowDataForDidQueryValidator = z.object({
|
|
54664
|
+
credentials: z.object({ categories: z.record(z.boolean()).optional() }).optional(),
|
|
54665
|
+
personal: z.record(z.boolean()).optional(),
|
|
54000
54666
|
id: StringQuery.optional()
|
|
54001
54667
|
});
|
|
54002
|
-
var ConsentFlowTermsQueryValidator =
|
|
54003
|
-
read:
|
|
54004
|
-
anonymize:
|
|
54005
|
-
credentials:
|
|
54006
|
-
shareAll:
|
|
54007
|
-
sharing:
|
|
54008
|
-
categories:
|
|
54668
|
+
var ConsentFlowTermsQueryValidator = z.object({
|
|
54669
|
+
read: z.object({
|
|
54670
|
+
anonymize: z.boolean().optional(),
|
|
54671
|
+
credentials: z.object({
|
|
54672
|
+
shareAll: z.boolean().optional(),
|
|
54673
|
+
sharing: z.boolean().optional(),
|
|
54674
|
+
categories: z.record(ConsentFlowTermValidator.optional()).optional()
|
|
54009
54675
|
}).optional(),
|
|
54010
|
-
personal:
|
|
54676
|
+
personal: z.record(z.string()).optional()
|
|
54011
54677
|
}).optional(),
|
|
54012
|
-
write:
|
|
54013
|
-
credentials:
|
|
54014
|
-
personal:
|
|
54678
|
+
write: z.object({
|
|
54679
|
+
credentials: z.object({ categories: z.record(z.boolean()).optional() }).optional(),
|
|
54680
|
+
personal: z.record(z.boolean()).optional()
|
|
54015
54681
|
}).optional()
|
|
54016
54682
|
});
|
|
54017
|
-
var ConsentFlowTransactionActionValidator =
|
|
54683
|
+
var ConsentFlowTransactionActionValidator = z.enum([
|
|
54018
54684
|
"consent",
|
|
54019
54685
|
"update",
|
|
54020
54686
|
"sync",
|
|
54021
54687
|
"withdraw",
|
|
54022
54688
|
"write"
|
|
54023
54689
|
]);
|
|
54024
|
-
var ConsentFlowTransactionsQueryValidator =
|
|
54690
|
+
var ConsentFlowTransactionsQueryValidator = z.object({
|
|
54025
54691
|
terms: ConsentFlowTermsQueryValidator.optional(),
|
|
54026
54692
|
action: ConsentFlowTransactionActionValidator.or(
|
|
54027
54693
|
ConsentFlowTransactionActionValidator.array()
|
|
54028
54694
|
).optional(),
|
|
54029
|
-
date:
|
|
54030
|
-
expiresAt:
|
|
54031
|
-
oneTime:
|
|
54695
|
+
date: z.object({ $gt: z.string() }).or(z.object({ $lt: z.string() })).or(z.object({ $eq: z.string() })).optional(),
|
|
54696
|
+
expiresAt: z.object({ $gt: z.string() }).or(z.object({ $lt: z.string() })).or(z.object({ $eq: z.string() })).optional(),
|
|
54697
|
+
oneTime: z.boolean().optional()
|
|
54032
54698
|
});
|
|
54033
|
-
var ConsentFlowTransactionValidator =
|
|
54034
|
-
expiresAt:
|
|
54035
|
-
oneTime:
|
|
54699
|
+
var ConsentFlowTransactionValidator = z.object({
|
|
54700
|
+
expiresAt: z.string().optional(),
|
|
54701
|
+
oneTime: z.boolean().optional(),
|
|
54036
54702
|
terms: ConsentFlowTermsValidator.optional(),
|
|
54037
|
-
id:
|
|
54703
|
+
id: z.string(),
|
|
54038
54704
|
action: ConsentFlowTransactionActionValidator,
|
|
54039
|
-
date:
|
|
54040
|
-
uris:
|
|
54705
|
+
date: z.string(),
|
|
54706
|
+
uris: z.string().array().optional()
|
|
54041
54707
|
});
|
|
54042
54708
|
var PaginatedConsentFlowTransactionsValidator = PaginationResponseValidator.extend({
|
|
54043
54709
|
records: ConsentFlowTransactionValidator.array()
|
|
54044
54710
|
});
|
|
54045
|
-
var ContractCredentialValidator =
|
|
54046
|
-
credentialUri:
|
|
54047
|
-
termsUri:
|
|
54048
|
-
contractUri:
|
|
54049
|
-
boostUri:
|
|
54050
|
-
category:
|
|
54051
|
-
date:
|
|
54711
|
+
var ContractCredentialValidator = z.object({
|
|
54712
|
+
credentialUri: z.string(),
|
|
54713
|
+
termsUri: z.string(),
|
|
54714
|
+
contractUri: z.string(),
|
|
54715
|
+
boostUri: z.string(),
|
|
54716
|
+
category: z.string().optional(),
|
|
54717
|
+
date: z.string()
|
|
54052
54718
|
});
|
|
54053
54719
|
var PaginatedContractCredentialsValidator = PaginationResponseValidator.extend({
|
|
54054
54720
|
records: ContractCredentialValidator.array()
|
|
54055
54721
|
});
|
|
54056
|
-
var LCNNotificationTypeEnumValidator =
|
|
54722
|
+
var LCNNotificationTypeEnumValidator = z.enum([
|
|
54057
54723
|
"CONNECTION_REQUEST",
|
|
54058
54724
|
"CONNECTION_ACCEPTED",
|
|
54059
54725
|
"CREDENTIAL_RECEIVED",
|
|
@@ -54064,40 +54730,40 @@ var LCNNotificationTypeEnumValidator = mod.enum([
|
|
|
54064
54730
|
"PRESENTATION_RECEIVED",
|
|
54065
54731
|
"CONSENT_FLOW_TRANSACTION"
|
|
54066
54732
|
]);
|
|
54067
|
-
var LCNNotificationMessageValidator =
|
|
54068
|
-
title:
|
|
54069
|
-
body:
|
|
54733
|
+
var LCNNotificationMessageValidator = z.object({
|
|
54734
|
+
title: z.string().optional(),
|
|
54735
|
+
body: z.string().optional()
|
|
54070
54736
|
});
|
|
54071
|
-
var LCNNotificationDataValidator =
|
|
54072
|
-
vcUris:
|
|
54073
|
-
vpUris:
|
|
54737
|
+
var LCNNotificationDataValidator = z.object({
|
|
54738
|
+
vcUris: z.array(z.string()).optional(),
|
|
54739
|
+
vpUris: z.array(z.string()).optional(),
|
|
54074
54740
|
transaction: ConsentFlowTransactionValidator.optional()
|
|
54075
54741
|
});
|
|
54076
|
-
var LCNNotificationValidator =
|
|
54742
|
+
var LCNNotificationValidator = z.object({
|
|
54077
54743
|
type: LCNNotificationTypeEnumValidator,
|
|
54078
|
-
to: LCNProfileValidator.partial().and(
|
|
54079
|
-
from: LCNProfileValidator.partial().and(
|
|
54744
|
+
to: LCNProfileValidator.partial().and(z.object({ did: z.string() })),
|
|
54745
|
+
from: LCNProfileValidator.partial().and(z.object({ did: z.string() })),
|
|
54080
54746
|
message: LCNNotificationMessageValidator.optional(),
|
|
54081
54747
|
data: LCNNotificationDataValidator.optional(),
|
|
54082
|
-
sent:
|
|
54748
|
+
sent: z.string().datetime().optional()
|
|
54083
54749
|
});
|
|
54084
54750
|
var AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX = "auth-grant:";
|
|
54085
|
-
var AuthGrantValidator =
|
|
54086
|
-
id:
|
|
54087
|
-
name:
|
|
54088
|
-
description:
|
|
54089
|
-
challenge:
|
|
54090
|
-
status:
|
|
54751
|
+
var AuthGrantValidator = z.object({
|
|
54752
|
+
id: z.string(),
|
|
54753
|
+
name: z.string(),
|
|
54754
|
+
description: z.string().optional(),
|
|
54755
|
+
challenge: z.string().startsWith(AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX).min(10, { message: "Challenge is too short" }).max(100, { message: "Challenge is too long" }),
|
|
54756
|
+
status: z.enum(["revoked", "active"], {
|
|
54091
54757
|
required_error: "Status is required",
|
|
54092
54758
|
invalid_type_error: "Status must be either active or revoked"
|
|
54093
54759
|
}),
|
|
54094
|
-
scope:
|
|
54095
|
-
createdAt:
|
|
54096
|
-
expiresAt:
|
|
54760
|
+
scope: z.string(),
|
|
54761
|
+
createdAt: z.string().datetime({ message: "createdAt must be a valid ISO 8601 datetime string" }),
|
|
54762
|
+
expiresAt: z.string().datetime({ message: "expiresAt must be a valid ISO 8601 datetime string" }).nullish().optional()
|
|
54097
54763
|
});
|
|
54098
|
-
var FlatAuthGrantValidator =
|
|
54099
|
-
var AuthGrantStatusValidator =
|
|
54100
|
-
var AuthGrantQueryValidator =
|
|
54764
|
+
var FlatAuthGrantValidator = z.object({ id: z.string() }).catchall(z.any());
|
|
54765
|
+
var AuthGrantStatusValidator = z.enum(["active", "revoked"]);
|
|
54766
|
+
var AuthGrantQueryValidator = z.object({
|
|
54101
54767
|
id: StringQuery,
|
|
54102
54768
|
name: StringQuery,
|
|
54103
54769
|
description: StringQuery,
|
|
@@ -54108,7 +54774,7 @@ var AuthGrantQueryValidator = mod.object({
|
|
|
54108
54774
|
var streamIdToCeramicURI = /* @__PURE__ */ __name((id) => `lc:ceramic:${id}`, "streamIdToCeramicURI");
|
|
54109
54775
|
|
|
54110
54776
|
// src/types.ts
|
|
54111
|
-
var CeramicURIValidator =
|
|
54777
|
+
var CeramicURIValidator = z.string().refine(
|
|
54112
54778
|
(string2) => string2.split(":").length === 3 && string2.split(":")[0] === "lc",
|
|
54113
54779
|
"URI must be of the form lc:${storage}:${url}"
|
|
54114
54780
|
).refine(
|