@animaapp/anima-sdk 0.3.4 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +13 -13
- package/dist/index.js +973 -944
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1,168 +1,181 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var vr = Object.defineProperty, _r = Object.defineProperties;
|
|
2
|
+
var br = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var Rt = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var Pt = (
|
|
6
|
-
throw TypeError(
|
|
4
|
+
var wr = Object.prototype.hasOwnProperty, xr = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Pt = (r) => {
|
|
6
|
+
throw TypeError(r);
|
|
7
7
|
};
|
|
8
|
-
var Mt = (
|
|
8
|
+
var Mt = (r, e, t) => e in r ? vr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, d = (r, e) => {
|
|
9
9
|
for (var t in e || (e = {}))
|
|
10
|
-
|
|
10
|
+
wr.call(e, t) && Mt(r, t, e[t]);
|
|
11
11
|
if (Rt)
|
|
12
12
|
for (var t of Rt(e))
|
|
13
|
-
|
|
14
|
-
return
|
|
15
|
-
}, y = (
|
|
16
|
-
var lt = (
|
|
17
|
-
var H = (
|
|
18
|
-
var M = (
|
|
13
|
+
xr.call(e, t) && Mt(r, t, e[t]);
|
|
14
|
+
return r;
|
|
15
|
+
}, y = (r, e) => _r(r, br(e));
|
|
16
|
+
var lt = (r, e, t) => e.has(r) || Pt("Cannot " + t);
|
|
17
|
+
var H = (r, e, t) => (lt(r, e, "read from private field"), t ? t.call(r) : e.get(r)), Xe = (r, e, t) => e.has(r) ? Pt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), ft = (r, e, t, s) => (lt(r, e, "write to private field"), s ? s.call(r, t) : e.set(r, t), t), $t = (r, e, t) => (lt(r, e, "access private method"), t);
|
|
18
|
+
var M = (r, e, t) => new Promise((s, n) => {
|
|
19
19
|
var a = (c) => {
|
|
20
20
|
try {
|
|
21
21
|
o(t.next(c));
|
|
22
22
|
} catch (u) {
|
|
23
|
-
|
|
23
|
+
n(u);
|
|
24
24
|
}
|
|
25
25
|
}, i = (c) => {
|
|
26
26
|
try {
|
|
27
27
|
o(t.throw(c));
|
|
28
28
|
} catch (u) {
|
|
29
|
-
|
|
29
|
+
n(u);
|
|
30
30
|
}
|
|
31
31
|
}, o = (c) => c.done ? s(c.value) : Promise.resolve(c.value).then(a, i);
|
|
32
|
-
o((t = t.apply(
|
|
32
|
+
o((t = t.apply(r, e)).next());
|
|
33
33
|
});
|
|
34
34
|
class ue extends Error {
|
|
35
35
|
constructor({
|
|
36
36
|
name: e,
|
|
37
37
|
reason: t,
|
|
38
38
|
status: s,
|
|
39
|
-
detail:
|
|
39
|
+
detail: n
|
|
40
40
|
}) {
|
|
41
|
-
super(), this.name = e, this.message = t, this.detail =
|
|
41
|
+
super(), this.name = e, this.message = t, this.detail = n, this.status = s;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
const
|
|
45
|
-
class
|
|
46
|
-
constructor({
|
|
47
|
-
|
|
44
|
+
const Kt = "Figma Token Issue";
|
|
45
|
+
class kr extends Error {
|
|
46
|
+
constructor({
|
|
47
|
+
fileKey: e,
|
|
48
|
+
reason: t,
|
|
49
|
+
cause: s
|
|
50
|
+
}) {
|
|
51
|
+
super(Kt), this.fileKey = e, this.reason = t, this.cause = s;
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
|
-
const
|
|
51
|
-
class
|
|
52
|
-
constructor({ fileKey: e }) {
|
|
53
|
-
super(
|
|
54
|
+
const Xt = "Rate Limit Exceeded";
|
|
55
|
+
class Tr extends Error {
|
|
56
|
+
constructor({ fileKey: e, cause: t }) {
|
|
57
|
+
super(Xt), this.fileKey = e, this.cause = t;
|
|
54
58
|
}
|
|
55
59
|
}
|
|
56
|
-
const
|
|
57
|
-
class
|
|
58
|
-
constructor({ fileKey: e }) {
|
|
59
|
-
super(
|
|
60
|
+
const Yt = "Not Found";
|
|
61
|
+
class Sr extends Error {
|
|
62
|
+
constructor({ fileKey: e, cause: t }) {
|
|
63
|
+
super(Yt), this.fileKey = e, this.cause = t;
|
|
60
64
|
}
|
|
61
65
|
}
|
|
62
|
-
const
|
|
63
|
-
class
|
|
66
|
+
const Er = (r) => r.message === Yt, Qt = "Unknown Figma API Exception";
|
|
67
|
+
class Ar extends Error {
|
|
64
68
|
constructor({ fileKey: e, cause: t }) {
|
|
65
|
-
super(
|
|
69
|
+
super(Qt), this.name = "UnknownFigmaApiException", this.fileKey = e, this.cause = t;
|
|
66
70
|
}
|
|
67
71
|
}
|
|
68
|
-
const
|
|
72
|
+
const Un = (r) => r.message === Qt, Or = (r) => r.message === Xt, Cr = (r) => [Kt, ...[
|
|
69
73
|
"Invalid Figma token",
|
|
70
74
|
"Figma token expired"
|
|
71
75
|
]].includes(
|
|
72
|
-
|
|
73
|
-
),
|
|
74
|
-
var s
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
76
|
+
r.message
|
|
77
|
+
), er = (r, e) => {
|
|
78
|
+
var s;
|
|
79
|
+
if (((s = r == null ? void 0 : r.cause) == null ? void 0 : s.message) === "Fetch Error") {
|
|
80
|
+
const { err: n, status: a } = r.cause.body;
|
|
81
|
+
if (a === 403)
|
|
82
|
+
return new kr({
|
|
83
|
+
fileKey: e,
|
|
84
|
+
reason: n,
|
|
85
|
+
cause: r
|
|
86
|
+
});
|
|
87
|
+
if (a === 429)
|
|
88
|
+
return new Tr({ fileKey: e, cause: r });
|
|
89
|
+
if (a === 404)
|
|
90
|
+
return new Sr({ fileKey: e, cause: r });
|
|
91
|
+
}
|
|
92
|
+
return new Ar({ fileKey: e, cause: r });
|
|
93
|
+
}, zn = (r) => Er(r) ? "NotFound" : Or(r) ? "RateLimitExceeded" : Cr(r) ? "FigmaTokenIssue" : "UnknownFigmaApiException";
|
|
94
|
+
var Nr = Object.defineProperty, Ir = Object.defineProperties, jr = Object.getOwnPropertyDescriptors, Ft = Object.getOwnPropertySymbols, Zr = Object.prototype.hasOwnProperty, Rr = Object.prototype.propertyIsEnumerable, Vt = (r, e) => (e = Symbol[r]) ? e : Symbol.for("Symbol." + r), tr = (r) => {
|
|
95
|
+
throw TypeError(r);
|
|
96
|
+
}, Dt = (r, e, t) => e in r ? Nr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, U = (r, e) => {
|
|
84
97
|
for (var t in e || (e = {}))
|
|
85
|
-
|
|
86
|
-
if (
|
|
87
|
-
for (var t of
|
|
88
|
-
|
|
89
|
-
return
|
|
90
|
-
}, Nt = (
|
|
98
|
+
Zr.call(e, t) && Dt(r, t, e[t]);
|
|
99
|
+
if (Ft)
|
|
100
|
+
for (var t of Ft(e))
|
|
101
|
+
Rr.call(e, t) && Dt(r, t, e[t]);
|
|
102
|
+
return r;
|
|
103
|
+
}, Nt = (r, e) => Ir(r, jr(e)), It = (r, e, t) => e.has(r) || tr("Cannot " + t), T = (r, e, t) => (It(r, e, "read from private field"), t ? t.call(r) : e.get(r)), W = (r, e, t) => e.has(r) ? tr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), j = (r, e, t, s) => (It(r, e, "write to private field"), e.set(r, t), t), ee = (r, e, t) => (It(r, e, "access private method"), t), A = (r, e, t) => new Promise((s, n) => {
|
|
91
104
|
var a = (c) => {
|
|
92
105
|
try {
|
|
93
106
|
o(t.next(c));
|
|
94
107
|
} catch (u) {
|
|
95
|
-
|
|
108
|
+
n(u);
|
|
96
109
|
}
|
|
97
110
|
}, i = (c) => {
|
|
98
111
|
try {
|
|
99
112
|
o(t.throw(c));
|
|
100
113
|
} catch (u) {
|
|
101
|
-
|
|
114
|
+
n(u);
|
|
102
115
|
}
|
|
103
116
|
}, o = (c) => c.done ? s(c.value) : Promise.resolve(c.value).then(a, i);
|
|
104
|
-
o((t = t.apply(
|
|
105
|
-
}),
|
|
106
|
-
function $
|
|
107
|
-
return
|
|
117
|
+
o((t = t.apply(r, e)).next());
|
|
118
|
+
}), Mr = (r, e, t) => (e = r[Vt("asyncIterator")]) ? e.call(r) : (r = r[Vt("iterator")](), e = {}, t = (s, n) => (n = r[s]) && (e[s] = (a) => new Promise((i, o, c) => (a = n.call(r, a), c = a.done, Promise.resolve(a.value).then((u) => i({ value: u, done: c }), o)))), t("next"), t("return"), e), Pr = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
|
|
119
|
+
function $r(r) {
|
|
120
|
+
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
108
121
|
}
|
|
109
|
-
var gt = { exports: {} },
|
|
110
|
-
function
|
|
111
|
-
return Lt || (Lt = 1, function(
|
|
122
|
+
var gt = { exports: {} }, Fr = gt.exports, Lt;
|
|
123
|
+
function Vr() {
|
|
124
|
+
return Lt || (Lt = 1, function(r, e) {
|
|
112
125
|
(function(t, s) {
|
|
113
|
-
|
|
114
|
-
})(
|
|
115
|
-
var t = typeof Promise == "function", s = typeof self == "object" ? self :
|
|
116
|
-
function Ce(
|
|
117
|
-
var k = typeof
|
|
126
|
+
r.exports = s();
|
|
127
|
+
})(Fr, function() {
|
|
128
|
+
var t = typeof Promise == "function", s = typeof self == "object" ? self : Pr, n = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", u = typeof DataView != "undefined", f = n && typeof Symbol.iterator != "undefined", g = n && typeof Symbol.toStringTag != "undefined", O = i && typeof Set.prototype.entries == "function", C = a && typeof Map.prototype.entries == "function", N = O && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), R = C && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), B = f && typeof Array.prototype[Symbol.iterator] == "function", ne = B && Object.getPrototypeOf([][Symbol.iterator]()), de = f && typeof String.prototype[Symbol.iterator] == "function", V = de && Object.getPrototypeOf(""[Symbol.iterator]()), X = 8, q = -1;
|
|
129
|
+
function Ce(E) {
|
|
130
|
+
var k = typeof E;
|
|
118
131
|
if (k !== "object")
|
|
119
132
|
return k;
|
|
120
|
-
if (
|
|
133
|
+
if (E === null)
|
|
121
134
|
return "null";
|
|
122
|
-
if (
|
|
135
|
+
if (E === s)
|
|
123
136
|
return "global";
|
|
124
|
-
if (Array.isArray(
|
|
137
|
+
if (Array.isArray(E) && (g === !1 || !(Symbol.toStringTag in E)))
|
|
125
138
|
return "Array";
|
|
126
139
|
if (typeof window == "object" && window !== null) {
|
|
127
|
-
if (typeof window.location == "object" &&
|
|
140
|
+
if (typeof window.location == "object" && E === window.location)
|
|
128
141
|
return "Location";
|
|
129
|
-
if (typeof window.document == "object" &&
|
|
142
|
+
if (typeof window.document == "object" && E === window.document)
|
|
130
143
|
return "Document";
|
|
131
144
|
if (typeof window.navigator == "object") {
|
|
132
|
-
if (typeof window.navigator.mimeTypes == "object" &&
|
|
145
|
+
if (typeof window.navigator.mimeTypes == "object" && E === window.navigator.mimeTypes)
|
|
133
146
|
return "MimeTypeArray";
|
|
134
|
-
if (typeof window.navigator.plugins == "object" &&
|
|
147
|
+
if (typeof window.navigator.plugins == "object" && E === window.navigator.plugins)
|
|
135
148
|
return "PluginArray";
|
|
136
149
|
}
|
|
137
|
-
if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") &&
|
|
138
|
-
if (
|
|
150
|
+
if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") && E instanceof window.HTMLElement) {
|
|
151
|
+
if (E.tagName === "BLOCKQUOTE")
|
|
139
152
|
return "HTMLQuoteElement";
|
|
140
|
-
if (
|
|
153
|
+
if (E.tagName === "TD")
|
|
141
154
|
return "HTMLTableDataCellElement";
|
|
142
|
-
if (
|
|
155
|
+
if (E.tagName === "TH")
|
|
143
156
|
return "HTMLTableHeaderCellElement";
|
|
144
157
|
}
|
|
145
158
|
}
|
|
146
|
-
var ut =
|
|
159
|
+
var ut = g && E[Symbol.toStringTag];
|
|
147
160
|
if (typeof ut == "string")
|
|
148
161
|
return ut;
|
|
149
|
-
var D = Object.getPrototypeOf(
|
|
150
|
-
return D === RegExp.prototype ? "RegExp" : D === Date.prototype ? "Date" : t && D === Promise.prototype ? "Promise" : i && D === Set.prototype ? "Set" : a && D === Map.prototype ? "Map" : c && D === WeakSet.prototype ? "WeakSet" : o && D === WeakMap.prototype ? "WeakMap" : u && D === DataView.prototype ? "DataView" : a && D === R ? "Map Iterator" : i && D ===
|
|
162
|
+
var D = Object.getPrototypeOf(E);
|
|
163
|
+
return D === RegExp.prototype ? "RegExp" : D === Date.prototype ? "Date" : t && D === Promise.prototype ? "Promise" : i && D === Set.prototype ? "Set" : a && D === Map.prototype ? "Map" : c && D === WeakSet.prototype ? "WeakSet" : o && D === WeakMap.prototype ? "WeakMap" : u && D === DataView.prototype ? "DataView" : a && D === R ? "Map Iterator" : i && D === N ? "Set Iterator" : B && D === ne ? "Array Iterator" : de && D === V ? "String Iterator" : D === null ? "Object" : Object.prototype.toString.call(E).slice(X, q);
|
|
151
164
|
}
|
|
152
165
|
return Ce;
|
|
153
166
|
});
|
|
154
167
|
}(gt)), gt.exports;
|
|
155
168
|
}
|
|
156
|
-
var
|
|
157
|
-
const
|
|
169
|
+
var Dr = Vr();
|
|
170
|
+
const Lr = /* @__PURE__ */ $r(Dr), jt = typeof Buffer != "undefined", Ur = jt && typeof Buffer.from != "undefined", zr = jt ? (
|
|
158
171
|
/**
|
|
159
172
|
* is value is Buffer?
|
|
160
173
|
*
|
|
161
174
|
* @param {*} value
|
|
162
175
|
* @return {boolean}
|
|
163
176
|
*/
|
|
164
|
-
function(
|
|
165
|
-
return Buffer.isBuffer(
|
|
177
|
+
function(r) {
|
|
178
|
+
return Buffer.isBuffer(r);
|
|
166
179
|
}
|
|
167
180
|
) : (
|
|
168
181
|
/**
|
|
@@ -175,15 +188,15 @@ const Ln = /* @__PURE__ */ $n(Dn), jt = typeof Buffer != "undefined", Un = jt &&
|
|
|
175
188
|
function() {
|
|
176
189
|
return !1;
|
|
177
190
|
}
|
|
178
|
-
),
|
|
191
|
+
), Wr = Ur ? (
|
|
179
192
|
/**
|
|
180
193
|
* copy Buffer
|
|
181
194
|
*
|
|
182
195
|
* @param {Buffer} value
|
|
183
196
|
* @return {Buffer}
|
|
184
197
|
*/
|
|
185
|
-
function(
|
|
186
|
-
return Buffer.from(
|
|
198
|
+
function(r) {
|
|
199
|
+
return Buffer.from(r);
|
|
187
200
|
}
|
|
188
201
|
) : jt ? (
|
|
189
202
|
/**
|
|
@@ -194,8 +207,8 @@ const Ln = /* @__PURE__ */ $n(Dn), jt = typeof Buffer != "undefined", Un = jt &&
|
|
|
194
207
|
* @param {Buffer} value
|
|
195
208
|
* @return {Buffer}
|
|
196
209
|
*/
|
|
197
|
-
function(
|
|
198
|
-
return new Buffer(
|
|
210
|
+
function(r) {
|
|
211
|
+
return new Buffer(r);
|
|
199
212
|
}
|
|
200
213
|
) : (
|
|
201
214
|
/**
|
|
@@ -206,86 +219,86 @@ const Ln = /* @__PURE__ */ $n(Dn), jt = typeof Buffer != "undefined", Un = jt &&
|
|
|
206
219
|
* @param {*}
|
|
207
220
|
* @return {*}
|
|
208
221
|
*/
|
|
209
|
-
function(
|
|
210
|
-
return
|
|
222
|
+
function(r) {
|
|
223
|
+
return r;
|
|
211
224
|
}
|
|
212
225
|
);
|
|
213
|
-
function Se(
|
|
214
|
-
return
|
|
226
|
+
function Se(r) {
|
|
227
|
+
return zr(r) ? "Buffer" : Lr(r);
|
|
215
228
|
}
|
|
216
|
-
const
|
|
229
|
+
const Br = /* @__PURE__ */ new Set([
|
|
217
230
|
"Arguments",
|
|
218
231
|
"Array",
|
|
219
232
|
"Map",
|
|
220
233
|
"Object",
|
|
221
234
|
"Set"
|
|
222
235
|
]);
|
|
223
|
-
function
|
|
224
|
-
switch (t || Se(
|
|
236
|
+
function qr(r, e, t = null) {
|
|
237
|
+
switch (t || Se(r)) {
|
|
225
238
|
case "Arguments":
|
|
226
239
|
case "Array":
|
|
227
240
|
case "Object":
|
|
228
|
-
return
|
|
241
|
+
return r[e];
|
|
229
242
|
case "Map":
|
|
230
|
-
return
|
|
243
|
+
return r.get(e);
|
|
231
244
|
case "Set":
|
|
232
245
|
return e;
|
|
233
246
|
}
|
|
234
247
|
}
|
|
235
|
-
function vt(
|
|
236
|
-
return
|
|
248
|
+
function vt(r) {
|
|
249
|
+
return Br.has(r);
|
|
237
250
|
}
|
|
238
|
-
function Ut(
|
|
239
|
-
switch (s || Se(
|
|
251
|
+
function Ut(r, e, t, s = null) {
|
|
252
|
+
switch (s || Se(r)) {
|
|
240
253
|
case "Arguments":
|
|
241
254
|
case "Array":
|
|
242
255
|
case "Object":
|
|
243
|
-
|
|
256
|
+
r[e] = t;
|
|
244
257
|
break;
|
|
245
258
|
case "Map":
|
|
246
|
-
|
|
259
|
+
r.set(e, t);
|
|
247
260
|
break;
|
|
248
261
|
case "Set":
|
|
249
|
-
|
|
262
|
+
r.add(t);
|
|
250
263
|
break;
|
|
251
264
|
}
|
|
252
|
-
return
|
|
265
|
+
return r;
|
|
253
266
|
}
|
|
254
|
-
const
|
|
255
|
-
function
|
|
256
|
-
return
|
|
267
|
+
const Hr = typeof globalThis != "undefined" && globalThis !== null && globalThis.Object === Object && globalThis, Jr = typeof global != "undefined" && global !== null && global.Object === Object && global, Gr = typeof self != "undefined" && self !== null && self.Object === Object && self, ht = Hr || Jr || Gr || Function("return this")();
|
|
268
|
+
function Kr(r) {
|
|
269
|
+
return r.slice(0);
|
|
257
270
|
}
|
|
258
|
-
function
|
|
259
|
-
return new Boolean(
|
|
271
|
+
function Xr(r) {
|
|
272
|
+
return new Boolean(r.valueOf());
|
|
260
273
|
}
|
|
261
|
-
function
|
|
262
|
-
return new DataView(
|
|
274
|
+
function Yr(r) {
|
|
275
|
+
return new DataView(r.buffer);
|
|
263
276
|
}
|
|
264
|
-
function
|
|
265
|
-
return
|
|
277
|
+
function Qr(r) {
|
|
278
|
+
return Wr(r);
|
|
266
279
|
}
|
|
267
|
-
function es(
|
|
268
|
-
return new Date(
|
|
280
|
+
function es(r) {
|
|
281
|
+
return new Date(r.getTime());
|
|
269
282
|
}
|
|
270
|
-
function ts(
|
|
271
|
-
return new Number(
|
|
283
|
+
function ts(r) {
|
|
284
|
+
return new Number(r);
|
|
272
285
|
}
|
|
273
|
-
function
|
|
274
|
-
return new RegExp(
|
|
286
|
+
function rs(r) {
|
|
287
|
+
return new RegExp(r.source, r.flags);
|
|
275
288
|
}
|
|
276
|
-
function ss(
|
|
277
|
-
return new String(
|
|
289
|
+
function ss(r) {
|
|
290
|
+
return new String(r);
|
|
278
291
|
}
|
|
279
|
-
function ae(
|
|
280
|
-
return ht[e].from ? ht[e].from(
|
|
292
|
+
function ae(r, e) {
|
|
293
|
+
return ht[e].from ? ht[e].from(r) : new ht[e](r);
|
|
281
294
|
}
|
|
282
|
-
function P(
|
|
283
|
-
return
|
|
295
|
+
function P(r) {
|
|
296
|
+
return r;
|
|
284
297
|
}
|
|
285
298
|
function zt() {
|
|
286
299
|
return [];
|
|
287
300
|
}
|
|
288
|
-
function
|
|
301
|
+
function ns() {
|
|
289
302
|
return /* @__PURE__ */ new Map();
|
|
290
303
|
}
|
|
291
304
|
function as() {
|
|
@@ -296,13 +309,13 @@ function is() {
|
|
|
296
309
|
}
|
|
297
310
|
const os = /* @__PURE__ */ new Map([
|
|
298
311
|
// deep copy
|
|
299
|
-
["ArrayBuffer",
|
|
300
|
-
["Boolean",
|
|
301
|
-
["Buffer",
|
|
302
|
-
["DataView",
|
|
312
|
+
["ArrayBuffer", Kr],
|
|
313
|
+
["Boolean", Xr],
|
|
314
|
+
["Buffer", Qr],
|
|
315
|
+
["DataView", Yr],
|
|
303
316
|
["Date", es],
|
|
304
317
|
["Number", ts],
|
|
305
|
-
["RegExp",
|
|
318
|
+
["RegExp", rs],
|
|
306
319
|
["String", ss],
|
|
307
320
|
// typed arrays
|
|
308
321
|
// TODO: pass bound function
|
|
@@ -337,7 +350,7 @@ const os = /* @__PURE__ */ new Map([
|
|
|
337
350
|
// NOTE: return empty value, because recursively copy later.
|
|
338
351
|
["Arguments", zt],
|
|
339
352
|
["Array", zt],
|
|
340
|
-
["Map",
|
|
353
|
+
["Map", ns],
|
|
341
354
|
["Object", as],
|
|
342
355
|
["Set", is]
|
|
343
356
|
// NOTE: type-detect returns following types
|
|
@@ -353,17 +366,17 @@ const os = /* @__PURE__ */ new Map([
|
|
|
353
366
|
]);
|
|
354
367
|
function cs() {
|
|
355
368
|
}
|
|
356
|
-
function _t(
|
|
369
|
+
function _t(r, e = null, t = cs) {
|
|
357
370
|
arguments.length === 2 && typeof e == "function" && (t = e, e = null);
|
|
358
|
-
const s = e || Se(
|
|
371
|
+
const s = e || Se(r), n = os.get(s);
|
|
359
372
|
if (s === "Object") {
|
|
360
|
-
const a = t(
|
|
373
|
+
const a = t(r, s);
|
|
361
374
|
if (a !== void 0)
|
|
362
375
|
return a;
|
|
363
376
|
}
|
|
364
|
-
return
|
|
377
|
+
return n ? n(r, s) : r;
|
|
365
378
|
}
|
|
366
|
-
function Ne(
|
|
379
|
+
function Ne(r, e = {}) {
|
|
367
380
|
typeof e == "function" && (e = {
|
|
368
381
|
customizer: e
|
|
369
382
|
});
|
|
@@ -372,42 +385,42 @@ function Ne(n, e = {}) {
|
|
|
372
385
|
customizer: t
|
|
373
386
|
// TODO: max depth
|
|
374
387
|
// depth = Infinity,
|
|
375
|
-
} = e, s = Se(
|
|
388
|
+
} = e, s = Se(r);
|
|
376
389
|
if (!vt(s))
|
|
377
|
-
return bt(
|
|
378
|
-
const
|
|
379
|
-
return bt(
|
|
390
|
+
return bt(r, null, null, null);
|
|
391
|
+
const n = _t(r, s, t), a = new WeakMap([[r, n]]), i = new WeakSet([r]);
|
|
392
|
+
return bt(r, n, a, i);
|
|
380
393
|
}
|
|
381
|
-
function bt(
|
|
382
|
-
const a = Se(
|
|
394
|
+
function bt(r, e, t, s, n) {
|
|
395
|
+
const a = Se(r), i = _t(r, a);
|
|
383
396
|
if (!vt(a))
|
|
384
397
|
return i;
|
|
385
398
|
let o;
|
|
386
399
|
switch (a) {
|
|
387
400
|
case "Arguments":
|
|
388
401
|
case "Array":
|
|
389
|
-
o = Object.keys(
|
|
402
|
+
o = Object.keys(r);
|
|
390
403
|
break;
|
|
391
404
|
case "Object":
|
|
392
|
-
o = Object.keys(
|
|
405
|
+
o = Object.keys(r), o.push(...Object.getOwnPropertySymbols(r));
|
|
393
406
|
break;
|
|
394
407
|
case "Map":
|
|
395
408
|
case "Set":
|
|
396
|
-
o =
|
|
409
|
+
o = r.keys();
|
|
397
410
|
break;
|
|
398
411
|
}
|
|
399
412
|
for (let c of o) {
|
|
400
|
-
const u =
|
|
413
|
+
const u = qr(r, c, a);
|
|
401
414
|
if (s.has(u))
|
|
402
415
|
Ut(e, c, t.get(u), a);
|
|
403
416
|
else {
|
|
404
|
-
const f = Se(u),
|
|
405
|
-
vt(f) && (t.set(u,
|
|
417
|
+
const f = Se(u), g = _t(u, f);
|
|
418
|
+
vt(f) && (t.set(u, g), s.add(u)), Ut(
|
|
406
419
|
e,
|
|
407
420
|
c,
|
|
408
421
|
bt(
|
|
409
422
|
u,
|
|
410
|
-
|
|
423
|
+
g,
|
|
411
424
|
t,
|
|
412
425
|
s
|
|
413
426
|
),
|
|
@@ -417,36 +430,36 @@ function bt(n, e, t, s, r) {
|
|
|
417
430
|
}
|
|
418
431
|
return e;
|
|
419
432
|
}
|
|
420
|
-
const ds = (
|
|
421
|
-
var Ye, ye, Qe, wt,
|
|
433
|
+
const ds = (r) => new Promise((e) => setTimeout(e, r));
|
|
434
|
+
var Ye, ye, Qe, wt, rr;
|
|
422
435
|
class us {
|
|
423
436
|
constructor({ maxAttempts: e = 3, func: t }) {
|
|
424
437
|
W(this, wt), W(this, Ye), W(this, ye), W(this, Qe), j(this, Ye, e), j(this, Qe, t), j(this, ye, 0);
|
|
425
438
|
}
|
|
426
439
|
run() {
|
|
427
|
-
return
|
|
440
|
+
return A(this, null, function* () {
|
|
428
441
|
try {
|
|
429
442
|
return yield T(this, Qe).call(this);
|
|
430
443
|
} catch (e) {
|
|
431
444
|
if (j(this, ye, T(this, ye) + 1), T(this, ye) > T(this, Ye))
|
|
432
445
|
throw console.error("Max attempts reached"), e;
|
|
433
|
-
const t = ee(this, wt,
|
|
446
|
+
const t = ee(this, wt, rr).call(this);
|
|
434
447
|
return yield ds(t), yield this.run();
|
|
435
448
|
}
|
|
436
449
|
});
|
|
437
450
|
}
|
|
438
451
|
}
|
|
439
|
-
Ye = /* @__PURE__ */ new WeakMap(), ye = /* @__PURE__ */ new WeakMap(), Qe = /* @__PURE__ */ new WeakMap(), wt = /* @__PURE__ */ new WeakSet(),
|
|
452
|
+
Ye = /* @__PURE__ */ new WeakMap(), ye = /* @__PURE__ */ new WeakMap(), Qe = /* @__PURE__ */ new WeakMap(), wt = /* @__PURE__ */ new WeakSet(), rr = function() {
|
|
440
453
|
return T(this, ye) * 1e3 * 1.5;
|
|
441
454
|
};
|
|
442
455
|
function ls() {
|
|
443
456
|
return typeof CompressionStream != "undefined";
|
|
444
457
|
}
|
|
445
|
-
function fs(
|
|
446
|
-
return
|
|
447
|
-
const e = new Blob([
|
|
458
|
+
function fs(r) {
|
|
459
|
+
return A(this, null, function* () {
|
|
460
|
+
const e = new Blob([r]).stream().pipeThrough(new CompressionStream("gzip")), t = [];
|
|
448
461
|
try {
|
|
449
|
-
for (var s =
|
|
462
|
+
for (var s = Mr(e), n, a, i; n = !(a = yield s.next()).done; n = !1) {
|
|
450
463
|
const o = a.value;
|
|
451
464
|
t.push(o);
|
|
452
465
|
}
|
|
@@ -454,7 +467,7 @@ function fs(n) {
|
|
|
454
467
|
i = [o];
|
|
455
468
|
} finally {
|
|
456
469
|
try {
|
|
457
|
-
|
|
470
|
+
n && (a = s.return) && (yield a.call(s));
|
|
458
471
|
} finally {
|
|
459
472
|
if (i)
|
|
460
473
|
throw i[0];
|
|
@@ -463,16 +476,16 @@ function fs(n) {
|
|
|
463
476
|
return yield hs(t);
|
|
464
477
|
});
|
|
465
478
|
}
|
|
466
|
-
function hs(
|
|
467
|
-
return
|
|
468
|
-
const e = yield new Blob(
|
|
479
|
+
function hs(r) {
|
|
480
|
+
return A(this, null, function* () {
|
|
481
|
+
const e = yield new Blob(r).arrayBuffer();
|
|
469
482
|
return new Uint8Array(e);
|
|
470
483
|
});
|
|
471
484
|
}
|
|
472
485
|
class ps extends Error {
|
|
473
|
-
constructor({ resource: e, api: t, args: s, cause:
|
|
474
|
-
if (super(`API Error on resource "${e}" at api "${t}"`), this.causeProperties = {}, this.name = "API Error", this.resource = e, this.api = t, this.cause =
|
|
475
|
-
for (const [i, o] of Object.entries(
|
|
486
|
+
constructor({ resource: e, api: t, args: s, cause: n }) {
|
|
487
|
+
if (super(`API Error on resource "${e}" at api "${t}"`), this.causeProperties = {}, this.name = "API Error", this.resource = e, this.api = t, this.cause = n, this.args = s, n instanceof Error)
|
|
488
|
+
for (const [i, o] of Object.entries(n))
|
|
476
489
|
if (typeof Headers != "undefined" && o instanceof Headers) {
|
|
477
490
|
const c = {};
|
|
478
491
|
o.forEach((u, f) => {
|
|
@@ -489,11 +502,11 @@ class Wt extends Error {
|
|
|
489
502
|
url: e,
|
|
490
503
|
method: t,
|
|
491
504
|
statusCode: s,
|
|
492
|
-
requestHeaders:
|
|
505
|
+
requestHeaders: n,
|
|
493
506
|
responseHeaders: a,
|
|
494
507
|
body: i
|
|
495
508
|
}) {
|
|
496
|
-
if (super("Fetch Error"), this.name = "Fetch Error", this.url = e, this.method = t, this.statusNumber = s, this.requestHeaders =
|
|
509
|
+
if (super("Fetch Error"), this.name = "Fetch Error", this.url = e, this.method = t, this.statusNumber = s, this.requestHeaders = n, this.responseHeaders = a, i)
|
|
497
510
|
try {
|
|
498
511
|
const o = JSON.parse(i);
|
|
499
512
|
this.body = o;
|
|
@@ -518,7 +531,7 @@ class pt extends Error {
|
|
|
518
531
|
super(e), this.name = "Request Validation Error";
|
|
519
532
|
}
|
|
520
533
|
}
|
|
521
|
-
function
|
|
534
|
+
function sr() {
|
|
522
535
|
return Array.from(
|
|
523
536
|
{ length: 32 },
|
|
524
537
|
() => Math.floor(Math.random() * 256).toString(16).padStart(2, "0")
|
|
@@ -528,10 +541,10 @@ function xt() {
|
|
|
528
541
|
return Math.floor(Date.now() / 1e3).toString();
|
|
529
542
|
}
|
|
530
543
|
const ys = 5 * 60 * 1e3, gs = 1 * 1e3;
|
|
531
|
-
var ge,
|
|
544
|
+
var ge, F, Y, kt, Tt, je;
|
|
532
545
|
class vs {
|
|
533
546
|
constructor({ fetch: e = globalThis.fetch.bind(globalThis), baseAddress: t }) {
|
|
534
|
-
W(this, Y), W(this, ge), W(this,
|
|
547
|
+
W(this, Y), W(this, ge), W(this, F), this.baseAddress = t, j(this, ge, e), j(this, F, {}), this.plugins = [];
|
|
535
548
|
}
|
|
536
549
|
get headers() {
|
|
537
550
|
throw new Error("Missing implementation");
|
|
@@ -543,82 +556,82 @@ class vs {
|
|
|
543
556
|
this.plugins = this.plugins.filter((t) => t.name !== e);
|
|
544
557
|
}
|
|
545
558
|
withOptions(e = {}) {
|
|
546
|
-
return j(this,
|
|
559
|
+
return j(this, F, e), this;
|
|
547
560
|
}
|
|
548
561
|
get(e) {
|
|
549
|
-
return
|
|
550
|
-
const { overrideBaseAddress:
|
|
562
|
+
return A(this, arguments, function* (t, s = {}) {
|
|
563
|
+
const { overrideBaseAddress: n, overrideDefaultHeaders: a } = s, i = n != null ? n : this.baseAddress;
|
|
551
564
|
let o = a != null ? a : this.headers;
|
|
552
|
-
const c = Ne(T(this,
|
|
553
|
-
return j(this,
|
|
565
|
+
const c = Ne(T(this, F));
|
|
566
|
+
return j(this, F, {}), c.extraHeaders && (o = U(U({}, o), c.extraHeaders)), c.requestValidation && (o = Nt(U({}, o), { "X-Request-Nonce": sr(), "X-Request-Timestamp": xt() })), c.async ? yield ee(this, Y, Tt).call(this, `${i}${t}`, c.async, { headers: o }) : yield ee(this, Y, kt).call(this, `${i}${t}`, c, { headers: o });
|
|
554
567
|
});
|
|
555
568
|
}
|
|
556
569
|
post(e, t) {
|
|
557
|
-
return
|
|
558
|
-
const i = Ne(T(this,
|
|
559
|
-
return j(this,
|
|
570
|
+
return A(this, arguments, function* (s, n, a = {}) {
|
|
571
|
+
const i = Ne(T(this, F));
|
|
572
|
+
return j(this, F, {}), ee(this, Y, je).call(this, s, "POST", n, a, i);
|
|
560
573
|
});
|
|
561
574
|
}
|
|
562
575
|
put(e, t) {
|
|
563
|
-
return
|
|
564
|
-
const i = Ne(T(this,
|
|
565
|
-
return j(this,
|
|
576
|
+
return A(this, arguments, function* (s, n, a = {}) {
|
|
577
|
+
const i = Ne(T(this, F));
|
|
578
|
+
return j(this, F, {}), ee(this, Y, je).call(this, s, "PUT", n, a, i);
|
|
566
579
|
});
|
|
567
580
|
}
|
|
568
581
|
delete(e, t) {
|
|
569
|
-
return
|
|
570
|
-
const i = Ne(T(this,
|
|
571
|
-
return j(this,
|
|
582
|
+
return A(this, arguments, function* (s, n, a = {}) {
|
|
583
|
+
const i = Ne(T(this, F));
|
|
584
|
+
return j(this, F, {}), ee(this, Y, je).call(this, s, "DELETE", n, a, i);
|
|
572
585
|
});
|
|
573
586
|
}
|
|
574
587
|
patch(e, t) {
|
|
575
|
-
return
|
|
576
|
-
const i = Ne(T(this,
|
|
577
|
-
return j(this,
|
|
588
|
+
return A(this, arguments, function* (s, n, a = {}) {
|
|
589
|
+
const i = Ne(T(this, F));
|
|
590
|
+
return j(this, F, {}), ee(this, Y, je).call(this, s, "PATCH", n, a, i);
|
|
578
591
|
});
|
|
579
592
|
}
|
|
580
593
|
}
|
|
581
|
-
ge = /* @__PURE__ */ new WeakMap(),
|
|
582
|
-
return
|
|
583
|
-
const s = () =>
|
|
594
|
+
ge = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakSet(), kt = function(r, e, t) {
|
|
595
|
+
return A(this, null, function* () {
|
|
596
|
+
const s = () => A(this, null, function* () {
|
|
584
597
|
var c, u;
|
|
585
598
|
try {
|
|
586
|
-
return yield T(this, ge).call(this,
|
|
599
|
+
return yield T(this, ge).call(this, r, U(U({}, t), e.abortSignal && { signal: e.abortSignal }));
|
|
587
600
|
} catch (f) {
|
|
588
601
|
throw f instanceof Error && f.name === "AbortError" ? new Ie({ canceled: (u = (c = e.abortSignal) == null ? void 0 : c.aborted) != null ? u : !1 }) : f;
|
|
589
602
|
}
|
|
590
|
-
}), { headers:
|
|
591
|
-
var f,
|
|
592
|
-
return ((f = c == null ? void 0 : c.headers) == null ? void 0 : f.get(u)) || ((
|
|
593
|
-
}, i = (c) =>
|
|
603
|
+
}), { headers: n } = t != null ? t : {}, a = (c, u) => {
|
|
604
|
+
var f, g;
|
|
605
|
+
return ((f = c == null ? void 0 : c.headers) == null ? void 0 : f.get(u)) || ((g = c == null ? void 0 : c.headersObject) == null ? void 0 : g[u]) || "";
|
|
606
|
+
}, i = (c) => A(this, null, function* () {
|
|
594
607
|
var u;
|
|
595
608
|
if (!c.ok) {
|
|
596
|
-
const
|
|
609
|
+
const g = yield c.text().catch();
|
|
597
610
|
throw new Wt({
|
|
598
|
-
url:
|
|
611
|
+
url: r,
|
|
599
612
|
method: (u = t == null ? void 0 : t.method) != null ? u : "GET",
|
|
600
613
|
statusCode: c.status,
|
|
601
|
-
requestHeaders:
|
|
614
|
+
requestHeaders: n,
|
|
602
615
|
responseHeaders: c.headers,
|
|
603
|
-
body:
|
|
616
|
+
body: g
|
|
604
617
|
});
|
|
605
618
|
}
|
|
606
619
|
if (e.requestValidation && process.env.UI_TESTS !== !0)
|
|
607
620
|
try {
|
|
608
|
-
const
|
|
609
|
-
if (!
|
|
621
|
+
const g = a(c, "x-response-nonce"), O = n == null ? void 0 : n["X-Request-Nonce"];
|
|
622
|
+
if (!g || g !== O)
|
|
610
623
|
throw new pt("Response nonce mismatch");
|
|
611
|
-
const
|
|
612
|
-
if (isNaN(
|
|
624
|
+
const C = Number(a(c, "x-response-timestamp")), N = Number(xt()), R = 60 * 60 * 24;
|
|
625
|
+
if (isNaN(C) || Math.abs(N - C) > R)
|
|
613
626
|
throw new pt("Invalid response timestamp");
|
|
614
|
-
} catch (
|
|
615
|
-
const
|
|
616
|
-
throw new pt(
|
|
627
|
+
} catch (g) {
|
|
628
|
+
const O = g instanceof Error ? g.message : "Request validation failed";
|
|
629
|
+
throw new pt(O);
|
|
617
630
|
}
|
|
618
631
|
let f = yield c.text();
|
|
619
632
|
try {
|
|
620
633
|
f = JSON.parse(f);
|
|
621
|
-
} catch (
|
|
634
|
+
} catch (g) {
|
|
622
635
|
}
|
|
623
636
|
return f;
|
|
624
637
|
});
|
|
@@ -632,97 +645,97 @@ ge = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), Y = /* @_
|
|
|
632
645
|
const o = yield s();
|
|
633
646
|
return yield i(o);
|
|
634
647
|
});
|
|
635
|
-
}, Tt = function(
|
|
636
|
-
return
|
|
637
|
-
var s,
|
|
648
|
+
}, Tt = function(r, e, t) {
|
|
649
|
+
return A(this, null, function* () {
|
|
650
|
+
var s, n;
|
|
638
651
|
const {
|
|
639
652
|
onProgress: a,
|
|
640
653
|
abortSignal: i,
|
|
641
654
|
pollingInterval: o = () => gs,
|
|
642
655
|
maxTimeout: c = ys
|
|
643
|
-
} = e, u = `${
|
|
644
|
-
let
|
|
656
|
+
} = e, u = `${r}/async`, f = `${r}/async/job`;
|
|
657
|
+
let g;
|
|
645
658
|
try {
|
|
646
|
-
|
|
647
|
-
} catch (
|
|
648
|
-
throw
|
|
659
|
+
g = yield T(this, ge).call(this, u, U(U({}, t), i && { signal: i }));
|
|
660
|
+
} catch (N) {
|
|
661
|
+
throw N instanceof Error && N.name === "AbortError" ? new Ie({ canceled: (s = i == null ? void 0 : i.aborted) != null ? s : !1 }) : N;
|
|
649
662
|
}
|
|
650
|
-
if (!
|
|
651
|
-
const
|
|
663
|
+
if (!g.ok) {
|
|
664
|
+
const N = yield g.text().catch();
|
|
652
665
|
throw new Wt({
|
|
653
|
-
url:
|
|
654
|
-
method: (
|
|
655
|
-
statusCode:
|
|
666
|
+
url: r,
|
|
667
|
+
method: (n = t == null ? void 0 : t.method) != null ? n : "GET",
|
|
668
|
+
statusCode: g.status,
|
|
656
669
|
requestHeaders: this.headers,
|
|
657
|
-
responseHeaders:
|
|
658
|
-
body:
|
|
670
|
+
responseHeaders: g.headers,
|
|
671
|
+
body: N
|
|
659
672
|
});
|
|
660
673
|
}
|
|
661
|
-
const
|
|
662
|
-
if (!
|
|
674
|
+
const O = yield g.json(), { job_id: C } = O;
|
|
675
|
+
if (!C)
|
|
663
676
|
throw new Error("Job ID not found in response");
|
|
664
|
-
return new Promise((
|
|
677
|
+
return new Promise((N, R) => A(this, null, function* () {
|
|
665
678
|
const B = setTimeout(() => {
|
|
666
679
|
R(new Error("Job timed out"));
|
|
667
|
-
}, c),
|
|
680
|
+
}, c), ne = (de = 0) => A(this, null, function* () {
|
|
668
681
|
if (i != null && i.aborted) {
|
|
669
|
-
clearTimeout(B), T(this, ge).call(this, `${f}/${
|
|
682
|
+
clearTimeout(B), T(this, ge).call(this, `${f}/${C}/cancel`, { method: "POST", headers: this.headers }).then(() => {
|
|
670
683
|
R(new Ie({ canceled: !0 }));
|
|
671
|
-
}).catch((
|
|
684
|
+
}).catch((V) => {
|
|
672
685
|
R(new Ie({ canceled: !1 }));
|
|
673
686
|
});
|
|
674
687
|
return;
|
|
675
688
|
}
|
|
676
689
|
try {
|
|
677
|
-
const
|
|
678
|
-
if (
|
|
690
|
+
const V = yield (yield T(this, ge).call(this, `${f}/${C}`, { headers: this.headers })).json();
|
|
691
|
+
if (V.status === "success") {
|
|
679
692
|
clearTimeout(B);
|
|
680
|
-
const X =
|
|
681
|
-
|
|
682
|
-
} else if (
|
|
683
|
-
clearTimeout(B), R(new ms(
|
|
693
|
+
const X = V.response_json;
|
|
694
|
+
N(X);
|
|
695
|
+
} else if (V.status === "failed")
|
|
696
|
+
clearTimeout(B), R(new ms(V.response_json));
|
|
684
697
|
else {
|
|
685
|
-
a && a(
|
|
698
|
+
a && a(V.response_json);
|
|
686
699
|
const X = o(de);
|
|
687
|
-
setTimeout(() =>
|
|
700
|
+
setTimeout(() => ne(de + 1), X);
|
|
688
701
|
}
|
|
689
|
-
} catch (
|
|
690
|
-
R(
|
|
702
|
+
} catch (V) {
|
|
703
|
+
R(V);
|
|
691
704
|
}
|
|
692
705
|
});
|
|
693
|
-
|
|
706
|
+
ne();
|
|
694
707
|
}));
|
|
695
708
|
});
|
|
696
|
-
}, je = function(
|
|
697
|
-
return
|
|
709
|
+
}, je = function(r, e, t, s, n) {
|
|
710
|
+
return A(this, null, function* () {
|
|
698
711
|
const { overrideBaseAddress: a, overrideDefaultHeaders: i } = s, o = a != null ? a : this.baseAddress;
|
|
699
712
|
let c = i != null ? i : this.headers;
|
|
700
|
-
|
|
701
|
-
let u =
|
|
702
|
-
return
|
|
713
|
+
n.extraHeaders && (c = U(U({}, c), n.extraHeaders)), n.requestValidation && (c = Nt(U({}, c), { "X-Request-Nonce": sr(), "X-Request-Timestamp": xt() }));
|
|
714
|
+
let u = t;
|
|
715
|
+
return typeof FormData != "undefined" && t instanceof FormData ? delete c["Content-Type"] : (u = s.skipBodyJsonStringify ? t : JSON.stringify(t), n.compress && ls() && (c["Content-Encoding"] = "gzip", u = yield fs(u))), n.async ? yield ee(this, Y, Tt).call(this, `${o}${r}`, n.async, {
|
|
703
716
|
method: e,
|
|
704
717
|
headers: c,
|
|
705
718
|
body: u
|
|
706
|
-
}) : yield ee(this, Y, kt).call(this, `${o}${
|
|
719
|
+
}) : yield ee(this, Y, kt).call(this, `${o}${r}`, n, { method: e, headers: c, body: u });
|
|
707
720
|
});
|
|
708
721
|
};
|
|
709
|
-
const Bt = (
|
|
722
|
+
const Bt = (r, e, t, s) => r instanceof Ie ? r : new ps({ resource: e, api: String(t), args: s, cause: r }), mt = (r, e) => new Proxy(e, {
|
|
710
723
|
get(t, s) {
|
|
711
|
-
return (...
|
|
724
|
+
return (...n) => {
|
|
712
725
|
var a;
|
|
713
|
-
for (const o of
|
|
714
|
-
const c = (a = o.beforeApi) == null ? void 0 : a.call(o, { resource: t.resourceName, api: s, args:
|
|
726
|
+
for (const o of r.plugins) {
|
|
727
|
+
const c = (a = o.beforeApi) == null ? void 0 : a.call(o, { resource: t.resourceName, api: s, args: n });
|
|
715
728
|
if (c !== void 0)
|
|
716
729
|
return c;
|
|
717
730
|
}
|
|
718
731
|
let i;
|
|
719
732
|
try {
|
|
720
|
-
i = t[s](...
|
|
733
|
+
i = t[s](...n);
|
|
721
734
|
} catch (o) {
|
|
722
|
-
throw Bt(o, t.resourceName, s,
|
|
735
|
+
throw Bt(o, t.resourceName, s, n);
|
|
723
736
|
}
|
|
724
737
|
return i instanceof Promise ? i.catch((o) => {
|
|
725
|
-
throw Bt(o, t.resourceName, s,
|
|
738
|
+
throw Bt(o, t.resourceName, s, n);
|
|
726
739
|
}) : i;
|
|
727
740
|
};
|
|
728
741
|
}
|
|
@@ -733,27 +746,27 @@ class _s {
|
|
|
733
746
|
W(this, Ze), this.resourceName = "Files", j(this, Ze, e);
|
|
734
747
|
}
|
|
735
748
|
get(e) {
|
|
736
|
-
return
|
|
737
|
-
const
|
|
749
|
+
return A(this, arguments, function* ({ fileKey: t, params: s = {} }) {
|
|
750
|
+
const n = new URLSearchParams(U({
|
|
738
751
|
plugin_data: "857346721138427857"
|
|
739
|
-
}, s)).toString(), a = `v1/files/${t}?${
|
|
752
|
+
}, s)).toString(), a = `v1/files/${t}?${n}`;
|
|
740
753
|
return yield T(this, Ze).get(a);
|
|
741
754
|
});
|
|
742
755
|
}
|
|
743
756
|
getImageFills(e) {
|
|
744
|
-
return
|
|
745
|
-
var s,
|
|
757
|
+
return A(this, arguments, function* ({ fileKey: t }) {
|
|
758
|
+
var s, n;
|
|
746
759
|
const a = `v1/files/${t}/images`;
|
|
747
|
-
return (
|
|
760
|
+
return (n = (s = (yield T(this, Ze).get(a)).meta) == null ? void 0 : s.images) != null ? n : {};
|
|
748
761
|
});
|
|
749
762
|
}
|
|
750
763
|
}
|
|
751
764
|
Ze = /* @__PURE__ */ new WeakMap();
|
|
752
|
-
const bs = (
|
|
765
|
+
const bs = (r, e, t) => {
|
|
753
766
|
const s = e.sort();
|
|
754
|
-
return `${
|
|
755
|
-
}, ws = (
|
|
756
|
-
var Q, St,
|
|
767
|
+
return `${r}-${s.join("-")}-${t}`;
|
|
768
|
+
}, ws = (r) => r ? r.ts > Date.now() - 1e3 * 30 : !1;
|
|
769
|
+
var Q, St, nr;
|
|
757
770
|
class xs {
|
|
758
771
|
constructor(e) {
|
|
759
772
|
W(this, St), W(this, Q), this.resourceName = "Images", j(this, Q, e);
|
|
@@ -763,15 +776,15 @@ class xs {
|
|
|
763
776
|
* Note: Use the `file.images` API to get the _source_ images used on the node fills, which has better quality.
|
|
764
777
|
*/
|
|
765
778
|
get(e) {
|
|
766
|
-
return
|
|
767
|
-
const i = bs(t, s,
|
|
779
|
+
return A(this, arguments, function* ({ fileKey: t, nodeIds: s, format: n = "jpg", scale: a }) {
|
|
780
|
+
const i = bs(t, s, n), o = T(this, Q).cache.images.entries.get(i);
|
|
768
781
|
if (ws(o))
|
|
769
782
|
return o.result;
|
|
770
783
|
o && T(this, Q).cache.images.entries.delete(i);
|
|
771
784
|
const c = T(this, Q).cache.images.pendingRequests.get(i);
|
|
772
785
|
if (c)
|
|
773
786
|
return c;
|
|
774
|
-
const u = ee(this, St,
|
|
787
|
+
const u = ee(this, St, nr).call(this, i, t, s, n, a);
|
|
775
788
|
T(this, Q).cache.images.pendingRequests.set(i, u);
|
|
776
789
|
try {
|
|
777
790
|
return yield u;
|
|
@@ -781,12 +794,12 @@ class xs {
|
|
|
781
794
|
});
|
|
782
795
|
}
|
|
783
796
|
}
|
|
784
|
-
Q = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakSet(),
|
|
785
|
-
return
|
|
797
|
+
Q = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakSet(), nr = function(r, e, t, s, n) {
|
|
798
|
+
return A(this, null, function* () {
|
|
786
799
|
const a = yield T(this, Q).get(
|
|
787
|
-
`v1/images/${e}?ids=${t}&format=${s}${
|
|
800
|
+
`v1/images/${e}?ids=${t}&format=${s}${n ? `&scale=${n}` : ""}`
|
|
788
801
|
);
|
|
789
|
-
return T(this, Q).cache.images.entries.set(
|
|
802
|
+
return T(this, Q).cache.images.entries.set(r, {
|
|
790
803
|
result: a,
|
|
791
804
|
ts: Date.now()
|
|
792
805
|
}), a;
|
|
@@ -798,8 +811,8 @@ class ks {
|
|
|
798
811
|
W(this, et), this.resourceName = "Nodes", j(this, et, e);
|
|
799
812
|
}
|
|
800
813
|
get(e) {
|
|
801
|
-
return
|
|
802
|
-
const a = Nt(U({},
|
|
814
|
+
return A(this, arguments, function* ({ fileKey: t, nodeIds: s, params: n = {} }) {
|
|
815
|
+
const a = Nt(U({}, n), {
|
|
803
816
|
ids: s.join(",")
|
|
804
817
|
}), i = new URLSearchParams(U({
|
|
805
818
|
plugin_data: "857346721138427857"
|
|
@@ -810,7 +823,7 @@ class ks {
|
|
|
810
823
|
}
|
|
811
824
|
et = /* @__PURE__ */ new WeakMap();
|
|
812
825
|
var le;
|
|
813
|
-
class
|
|
826
|
+
class ar extends vs {
|
|
814
827
|
constructor({
|
|
815
828
|
baseAddress: e = "https://api.figma.com/",
|
|
816
829
|
fetch: t = globalThis.fetch.bind(globalThis)
|
|
@@ -838,89 +851,89 @@ class sn extends vs {
|
|
|
838
851
|
}
|
|
839
852
|
}
|
|
840
853
|
le = /* @__PURE__ */ new WeakMap();
|
|
841
|
-
const Ts = (
|
|
842
|
-
fileKey:
|
|
854
|
+
const Ts = (n) => M(void 0, [n], function* ({
|
|
855
|
+
fileKey: r,
|
|
843
856
|
authToken: e,
|
|
844
|
-
figmaRestApi: t = new
|
|
857
|
+
figmaRestApi: t = new ar(),
|
|
845
858
|
params: s = {}
|
|
846
859
|
}) {
|
|
847
860
|
e && (t.token = e);
|
|
848
861
|
try {
|
|
849
862
|
return yield t.files.get({
|
|
850
|
-
fileKey:
|
|
863
|
+
fileKey: r,
|
|
851
864
|
params: s
|
|
852
865
|
});
|
|
853
866
|
} catch (a) {
|
|
854
|
-
throw console.error(a), a;
|
|
867
|
+
throw console.error(a), er(a, r);
|
|
855
868
|
}
|
|
856
|
-
}),
|
|
857
|
-
fileKey:
|
|
869
|
+
}), Wn = (a) => M(void 0, [a], function* ({
|
|
870
|
+
fileKey: r,
|
|
858
871
|
authToken: e,
|
|
859
872
|
nodeIds: t,
|
|
860
|
-
figmaRestApi: s = new
|
|
861
|
-
params:
|
|
873
|
+
figmaRestApi: s = new ar(),
|
|
874
|
+
params: n = {}
|
|
862
875
|
}) {
|
|
863
876
|
e && (s.token = e);
|
|
864
877
|
try {
|
|
865
878
|
return (yield s.nodes.get({
|
|
866
|
-
fileKey:
|
|
879
|
+
fileKey: r,
|
|
867
880
|
nodeIds: t,
|
|
868
|
-
params: d({},
|
|
881
|
+
params: d({}, n)
|
|
869
882
|
})).nodes;
|
|
870
883
|
} catch (i) {
|
|
871
|
-
|
|
872
|
-
}
|
|
873
|
-
}),
|
|
874
|
-
if (
|
|
875
|
-
return
|
|
876
|
-
if ("children" in
|
|
877
|
-
for (const t of
|
|
878
|
-
const s =
|
|
884
|
+
throw er(i, r);
|
|
885
|
+
}
|
|
886
|
+
}), ir = (r, e) => {
|
|
887
|
+
if (r.id === e)
|
|
888
|
+
return r;
|
|
889
|
+
if ("children" in r)
|
|
890
|
+
for (const t of r.children) {
|
|
891
|
+
const s = ir(t, e);
|
|
879
892
|
if (s)
|
|
880
893
|
return s;
|
|
881
894
|
}
|
|
882
895
|
return null;
|
|
883
896
|
};
|
|
884
897
|
var x;
|
|
885
|
-
(function(
|
|
886
|
-
|
|
887
|
-
function e(
|
|
898
|
+
(function(r) {
|
|
899
|
+
r.assertEqual = (n) => n;
|
|
900
|
+
function e(n) {
|
|
888
901
|
}
|
|
889
|
-
|
|
890
|
-
function t(
|
|
902
|
+
r.assertIs = e;
|
|
903
|
+
function t(n) {
|
|
891
904
|
throw new Error();
|
|
892
905
|
}
|
|
893
|
-
|
|
906
|
+
r.assertNever = t, r.arrayToEnum = (n) => {
|
|
894
907
|
const a = {};
|
|
895
|
-
for (const i of
|
|
908
|
+
for (const i of n)
|
|
896
909
|
a[i] = i;
|
|
897
910
|
return a;
|
|
898
|
-
},
|
|
899
|
-
const a =
|
|
911
|
+
}, r.getValidEnumValues = (n) => {
|
|
912
|
+
const a = r.objectKeys(n).filter((o) => typeof n[n[o]] != "number"), i = {};
|
|
900
913
|
for (const o of a)
|
|
901
|
-
i[o] =
|
|
902
|
-
return
|
|
903
|
-
},
|
|
904
|
-
return
|
|
905
|
-
}),
|
|
914
|
+
i[o] = n[o];
|
|
915
|
+
return r.objectValues(i);
|
|
916
|
+
}, r.objectValues = (n) => r.objectKeys(n).map(function(a) {
|
|
917
|
+
return n[a];
|
|
918
|
+
}), r.objectKeys = typeof Object.keys == "function" ? (n) => Object.keys(n) : (n) => {
|
|
906
919
|
const a = [];
|
|
907
|
-
for (const i in
|
|
908
|
-
Object.prototype.hasOwnProperty.call(
|
|
920
|
+
for (const i in n)
|
|
921
|
+
Object.prototype.hasOwnProperty.call(n, i) && a.push(i);
|
|
909
922
|
return a;
|
|
910
|
-
},
|
|
911
|
-
for (const i of
|
|
923
|
+
}, r.find = (n, a) => {
|
|
924
|
+
for (const i of n)
|
|
912
925
|
if (a(i))
|
|
913
926
|
return i;
|
|
914
|
-
},
|
|
915
|
-
function s(
|
|
916
|
-
return
|
|
927
|
+
}, r.isInteger = typeof Number.isInteger == "function" ? (n) => Number.isInteger(n) : (n) => typeof n == "number" && isFinite(n) && Math.floor(n) === n;
|
|
928
|
+
function s(n, a = " | ") {
|
|
929
|
+
return n.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
|
|
917
930
|
}
|
|
918
|
-
|
|
931
|
+
r.joinValues = s, r.jsonStringifyReplacer = (n, a) => typeof a == "bigint" ? a.toString() : a;
|
|
919
932
|
})(x || (x = {}));
|
|
920
|
-
var
|
|
921
|
-
(function(
|
|
922
|
-
|
|
923
|
-
})(
|
|
933
|
+
var Et;
|
|
934
|
+
(function(r) {
|
|
935
|
+
r.mergeShapes = (e, t) => d(d({}, e), t);
|
|
936
|
+
})(Et || (Et = {}));
|
|
924
937
|
const p = x.arrayToEnum([
|
|
925
938
|
"string",
|
|
926
939
|
"nan",
|
|
@@ -942,14 +955,14 @@ const p = x.arrayToEnum([
|
|
|
942
955
|
"never",
|
|
943
956
|
"map",
|
|
944
957
|
"set"
|
|
945
|
-
]), oe = (
|
|
946
|
-
switch (typeof
|
|
958
|
+
]), oe = (r) => {
|
|
959
|
+
switch (typeof r) {
|
|
947
960
|
case "undefined":
|
|
948
961
|
return p.undefined;
|
|
949
962
|
case "string":
|
|
950
963
|
return p.string;
|
|
951
964
|
case "number":
|
|
952
|
-
return isNaN(
|
|
965
|
+
return isNaN(r) ? p.nan : p.number;
|
|
953
966
|
case "boolean":
|
|
954
967
|
return p.boolean;
|
|
955
968
|
case "function":
|
|
@@ -959,7 +972,7 @@ const p = x.arrayToEnum([
|
|
|
959
972
|
case "symbol":
|
|
960
973
|
return p.symbol;
|
|
961
974
|
case "object":
|
|
962
|
-
return Array.isArray(
|
|
975
|
+
return Array.isArray(r) ? p.array : r === null ? p.null : r.then && typeof r.then == "function" && r.catch && typeof r.catch == "function" ? p.promise : typeof Map != "undefined" && r instanceof Map ? p.map : typeof Set != "undefined" && r instanceof Set ? p.set : typeof Date != "undefined" && r instanceof Date ? p.date : p.object;
|
|
963
976
|
default:
|
|
964
977
|
return p.unknown;
|
|
965
978
|
}
|
|
@@ -980,7 +993,7 @@ const p = x.arrayToEnum([
|
|
|
980
993
|
"invalid_intersection_types",
|
|
981
994
|
"not_multiple_of",
|
|
982
995
|
"not_finite"
|
|
983
|
-
]), Ss = (
|
|
996
|
+
]), Ss = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
984
997
|
class z extends Error {
|
|
985
998
|
get errors() {
|
|
986
999
|
return this.issues;
|
|
@@ -997,14 +1010,14 @@ class z extends Error {
|
|
|
997
1010
|
format(e) {
|
|
998
1011
|
const t = e || function(a) {
|
|
999
1012
|
return a.message;
|
|
1000
|
-
}, s = { _errors: [] },
|
|
1013
|
+
}, s = { _errors: [] }, n = (a) => {
|
|
1001
1014
|
for (const i of a.issues)
|
|
1002
1015
|
if (i.code === "invalid_union")
|
|
1003
|
-
i.unionErrors.map(
|
|
1016
|
+
i.unionErrors.map(n);
|
|
1004
1017
|
else if (i.code === "invalid_return_type")
|
|
1005
|
-
|
|
1018
|
+
n(i.returnTypeError);
|
|
1006
1019
|
else if (i.code === "invalid_arguments")
|
|
1007
|
-
|
|
1020
|
+
n(i.argumentsError);
|
|
1008
1021
|
else if (i.path.length === 0)
|
|
1009
1022
|
s._errors.push(t(i));
|
|
1010
1023
|
else {
|
|
@@ -1015,7 +1028,7 @@ class z extends Error {
|
|
|
1015
1028
|
}
|
|
1016
1029
|
}
|
|
1017
1030
|
};
|
|
1018
|
-
return
|
|
1031
|
+
return n(this), s;
|
|
1019
1032
|
}
|
|
1020
1033
|
static assert(e) {
|
|
1021
1034
|
if (!(e instanceof z))
|
|
@@ -1032,35 +1045,35 @@ class z extends Error {
|
|
|
1032
1045
|
}
|
|
1033
1046
|
flatten(e = (t) => t.message) {
|
|
1034
1047
|
const t = {}, s = [];
|
|
1035
|
-
for (const
|
|
1036
|
-
|
|
1048
|
+
for (const n of this.issues)
|
|
1049
|
+
n.path.length > 0 ? (t[n.path[0]] = t[n.path[0]] || [], t[n.path[0]].push(e(n))) : s.push(e(n));
|
|
1037
1050
|
return { formErrors: s, fieldErrors: t };
|
|
1038
1051
|
}
|
|
1039
1052
|
get formErrors() {
|
|
1040
1053
|
return this.flatten();
|
|
1041
1054
|
}
|
|
1042
1055
|
}
|
|
1043
|
-
z.create = (
|
|
1044
|
-
const
|
|
1056
|
+
z.create = (r) => new z(r);
|
|
1057
|
+
const Ee = (r, e) => {
|
|
1045
1058
|
let t;
|
|
1046
|
-
switch (
|
|
1059
|
+
switch (r.code) {
|
|
1047
1060
|
case l.invalid_type:
|
|
1048
|
-
|
|
1061
|
+
r.received === p.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
|
|
1049
1062
|
break;
|
|
1050
1063
|
case l.invalid_literal:
|
|
1051
|
-
t = `Invalid literal value, expected ${JSON.stringify(
|
|
1064
|
+
t = `Invalid literal value, expected ${JSON.stringify(r.expected, x.jsonStringifyReplacer)}`;
|
|
1052
1065
|
break;
|
|
1053
1066
|
case l.unrecognized_keys:
|
|
1054
|
-
t = `Unrecognized key(s) in object: ${x.joinValues(
|
|
1067
|
+
t = `Unrecognized key(s) in object: ${x.joinValues(r.keys, ", ")}`;
|
|
1055
1068
|
break;
|
|
1056
1069
|
case l.invalid_union:
|
|
1057
1070
|
t = "Invalid input";
|
|
1058
1071
|
break;
|
|
1059
1072
|
case l.invalid_union_discriminator:
|
|
1060
|
-
t = `Invalid discriminator value. Expected ${x.joinValues(
|
|
1073
|
+
t = `Invalid discriminator value. Expected ${x.joinValues(r.options)}`;
|
|
1061
1074
|
break;
|
|
1062
1075
|
case l.invalid_enum_value:
|
|
1063
|
-
t = `Invalid enum value. Expected ${x.joinValues(
|
|
1076
|
+
t = `Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;
|
|
1064
1077
|
break;
|
|
1065
1078
|
case l.invalid_arguments:
|
|
1066
1079
|
t = "Invalid function arguments";
|
|
@@ -1072,13 +1085,13 @@ const Ae = (n, e) => {
|
|
|
1072
1085
|
t = "Invalid date";
|
|
1073
1086
|
break;
|
|
1074
1087
|
case l.invalid_string:
|
|
1075
|
-
typeof
|
|
1088
|
+
typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : x.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
|
|
1076
1089
|
break;
|
|
1077
1090
|
case l.too_small:
|
|
1078
|
-
|
|
1091
|
+
r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
|
|
1079
1092
|
break;
|
|
1080
1093
|
case l.too_big:
|
|
1081
|
-
|
|
1094
|
+
r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "less than"} ${r.maximum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "under"} ${r.maximum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "bigint" ? t = `BigInt must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly" : r.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(r.maximum))}` : t = "Invalid input";
|
|
1082
1095
|
break;
|
|
1083
1096
|
case l.custom:
|
|
1084
1097
|
t = "Invalid input";
|
|
@@ -1087,58 +1100,58 @@ const Ae = (n, e) => {
|
|
|
1087
1100
|
t = "Intersection results could not be merged";
|
|
1088
1101
|
break;
|
|
1089
1102
|
case l.not_multiple_of:
|
|
1090
|
-
t = `Number must be a multiple of ${
|
|
1103
|
+
t = `Number must be a multiple of ${r.multipleOf}`;
|
|
1091
1104
|
break;
|
|
1092
1105
|
case l.not_finite:
|
|
1093
1106
|
t = "Number must be finite";
|
|
1094
1107
|
break;
|
|
1095
1108
|
default:
|
|
1096
|
-
t = e.defaultError, x.assertNever(
|
|
1109
|
+
t = e.defaultError, x.assertNever(r);
|
|
1097
1110
|
}
|
|
1098
1111
|
return { message: t };
|
|
1099
1112
|
};
|
|
1100
|
-
let
|
|
1101
|
-
function
|
|
1102
|
-
|
|
1113
|
+
let or = Ee;
|
|
1114
|
+
function Es(r) {
|
|
1115
|
+
or = r;
|
|
1103
1116
|
}
|
|
1104
1117
|
function tt() {
|
|
1105
|
-
return
|
|
1118
|
+
return or;
|
|
1106
1119
|
}
|
|
1107
|
-
const
|
|
1108
|
-
const { data: e, path: t, errorMaps: s, issueData:
|
|
1120
|
+
const rt = (r) => {
|
|
1121
|
+
const { data: e, path: t, errorMaps: s, issueData: n } = r, a = [...t, ...n.path || []], i = y(d({}, n), {
|
|
1109
1122
|
path: a
|
|
1110
1123
|
});
|
|
1111
|
-
if (
|
|
1112
|
-
return y(d({},
|
|
1124
|
+
if (n.message !== void 0)
|
|
1125
|
+
return y(d({}, n), {
|
|
1113
1126
|
path: a,
|
|
1114
|
-
message:
|
|
1127
|
+
message: n.message
|
|
1115
1128
|
});
|
|
1116
1129
|
let o = "";
|
|
1117
1130
|
const c = s.filter((u) => !!u).slice().reverse();
|
|
1118
1131
|
for (const u of c)
|
|
1119
1132
|
o = u(i, { data: e, defaultError: o }).message;
|
|
1120
|
-
return y(d({},
|
|
1133
|
+
return y(d({}, n), {
|
|
1121
1134
|
path: a,
|
|
1122
1135
|
message: o
|
|
1123
1136
|
});
|
|
1124
|
-
},
|
|
1125
|
-
function h(
|
|
1126
|
-
const t = tt(), s =
|
|
1137
|
+
}, As = [];
|
|
1138
|
+
function h(r, e) {
|
|
1139
|
+
const t = tt(), s = rt({
|
|
1127
1140
|
issueData: e,
|
|
1128
|
-
data:
|
|
1129
|
-
path:
|
|
1141
|
+
data: r.data,
|
|
1142
|
+
path: r.path,
|
|
1130
1143
|
errorMaps: [
|
|
1131
|
-
|
|
1144
|
+
r.common.contextualErrorMap,
|
|
1132
1145
|
// contextual error map is first priority
|
|
1133
|
-
|
|
1146
|
+
r.schemaErrorMap,
|
|
1134
1147
|
// then schema-bound map if available
|
|
1135
1148
|
t,
|
|
1136
1149
|
// then global override map
|
|
1137
|
-
t ===
|
|
1150
|
+
t === Ee ? void 0 : Ee
|
|
1138
1151
|
// then global default map
|
|
1139
|
-
].filter((
|
|
1152
|
+
].filter((n) => !!n)
|
|
1140
1153
|
});
|
|
1141
|
-
|
|
1154
|
+
r.common.issues.push(s);
|
|
1142
1155
|
}
|
|
1143
1156
|
class Z {
|
|
1144
1157
|
constructor() {
|
|
@@ -1152,18 +1165,18 @@ class Z {
|
|
|
1152
1165
|
}
|
|
1153
1166
|
static mergeArray(e, t) {
|
|
1154
1167
|
const s = [];
|
|
1155
|
-
for (const
|
|
1156
|
-
if (
|
|
1157
|
-
return
|
|
1158
|
-
|
|
1168
|
+
for (const n of t) {
|
|
1169
|
+
if (n.status === "aborted")
|
|
1170
|
+
return _;
|
|
1171
|
+
n.status === "dirty" && e.dirty(), s.push(n.value);
|
|
1159
1172
|
}
|
|
1160
1173
|
return { status: e.value, value: s };
|
|
1161
1174
|
}
|
|
1162
1175
|
static mergeObjectAsync(e, t) {
|
|
1163
1176
|
return M(this, null, function* () {
|
|
1164
1177
|
const s = [];
|
|
1165
|
-
for (const
|
|
1166
|
-
const a = yield
|
|
1178
|
+
for (const n of t) {
|
|
1179
|
+
const a = yield n.key, i = yield n.value;
|
|
1167
1180
|
s.push({
|
|
1168
1181
|
key: a,
|
|
1169
1182
|
value: i
|
|
@@ -1174,65 +1187,65 @@ class Z {
|
|
|
1174
1187
|
}
|
|
1175
1188
|
static mergeObjectSync(e, t) {
|
|
1176
1189
|
const s = {};
|
|
1177
|
-
for (const
|
|
1178
|
-
const { key: a, value: i } =
|
|
1190
|
+
for (const n of t) {
|
|
1191
|
+
const { key: a, value: i } = n;
|
|
1179
1192
|
if (a.status === "aborted" || i.status === "aborted")
|
|
1180
|
-
return
|
|
1181
|
-
a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value != "undefined" ||
|
|
1193
|
+
return _;
|
|
1194
|
+
a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value != "undefined" || n.alwaysSet) && (s[a.value] = i.value);
|
|
1182
1195
|
}
|
|
1183
1196
|
return { status: e.value, value: s };
|
|
1184
1197
|
}
|
|
1185
1198
|
}
|
|
1186
|
-
const
|
|
1199
|
+
const _ = Object.freeze({
|
|
1187
1200
|
status: "aborted"
|
|
1188
|
-
}), ke = (
|
|
1189
|
-
function st(
|
|
1190
|
-
if (typeof e == "function" ?
|
|
1191
|
-
return e.get(
|
|
1201
|
+
}), ke = (r) => ({ status: "dirty", value: r }), $ = (r) => ({ status: "valid", value: r }), At = (r) => r.status === "aborted", Ot = (r) => r.status === "dirty", _e = (r) => r.status === "valid", Pe = (r) => typeof Promise != "undefined" && r instanceof Promise;
|
|
1202
|
+
function st(r, e, t, s) {
|
|
1203
|
+
if (typeof e == "function" ? r !== e || !0 : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1204
|
+
return e.get(r);
|
|
1192
1205
|
}
|
|
1193
|
-
function
|
|
1194
|
-
if (typeof e == "function" ?
|
|
1195
|
-
return e.set(
|
|
1206
|
+
function cr(r, e, t, s, n) {
|
|
1207
|
+
if (typeof e == "function" ? r !== e || !0 : !e.has(r)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
1208
|
+
return e.set(r, t), t;
|
|
1196
1209
|
}
|
|
1197
1210
|
var m;
|
|
1198
|
-
(function(
|
|
1199
|
-
|
|
1211
|
+
(function(r) {
|
|
1212
|
+
r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
1200
1213
|
})(m || (m = {}));
|
|
1201
1214
|
var Re, Me;
|
|
1202
|
-
class
|
|
1203
|
-
constructor(e, t, s,
|
|
1204
|
-
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key =
|
|
1215
|
+
class re {
|
|
1216
|
+
constructor(e, t, s, n) {
|
|
1217
|
+
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = n;
|
|
1205
1218
|
}
|
|
1206
1219
|
get path() {
|
|
1207
1220
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
1208
1221
|
}
|
|
1209
1222
|
}
|
|
1210
|
-
const qt = (
|
|
1223
|
+
const qt = (r, e) => {
|
|
1211
1224
|
if (_e(e))
|
|
1212
1225
|
return { success: !0, data: e.value };
|
|
1213
|
-
if (!
|
|
1226
|
+
if (!r.common.issues.length)
|
|
1214
1227
|
throw new Error("Validation failed but no issues detected.");
|
|
1215
1228
|
return {
|
|
1216
1229
|
success: !1,
|
|
1217
1230
|
get error() {
|
|
1218
1231
|
if (this._error)
|
|
1219
1232
|
return this._error;
|
|
1220
|
-
const t = new z(
|
|
1233
|
+
const t = new z(r.common.issues);
|
|
1221
1234
|
return this._error = t, this._error;
|
|
1222
1235
|
}
|
|
1223
1236
|
};
|
|
1224
1237
|
};
|
|
1225
|
-
function b(
|
|
1226
|
-
if (!
|
|
1238
|
+
function b(r) {
|
|
1239
|
+
if (!r)
|
|
1227
1240
|
return {};
|
|
1228
|
-
const { errorMap: e, invalid_type_error: t, required_error: s, description:
|
|
1241
|
+
const { errorMap: e, invalid_type_error: t, required_error: s, description: n } = r;
|
|
1229
1242
|
if (e && (t || s))
|
|
1230
1243
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
1231
|
-
return e ? { errorMap: e, description:
|
|
1244
|
+
return e ? { errorMap: e, description: n } : { errorMap: (i, o) => {
|
|
1232
1245
|
var c, u;
|
|
1233
|
-
const { message: f } =
|
|
1246
|
+
const { message: f } = r;
|
|
1234
1247
|
return i.code === "invalid_enum_value" ? { message: f != null ? f : o.defaultError } : typeof o.data == "undefined" ? { message: (c = f != null ? f : s) !== null && c !== void 0 ? c : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (u = f != null ? f : t) !== null && u !== void 0 ? u : o.defaultError };
|
|
1235
|
-
}, description:
|
|
1248
|
+
}, description: n };
|
|
1236
1249
|
}
|
|
1237
1250
|
class w {
|
|
1238
1251
|
get description() {
|
|
@@ -1282,7 +1295,7 @@ class w {
|
|
|
1282
1295
|
}
|
|
1283
1296
|
safeParse(e, t) {
|
|
1284
1297
|
var s;
|
|
1285
|
-
const
|
|
1298
|
+
const n = {
|
|
1286
1299
|
common: {
|
|
1287
1300
|
issues: [],
|
|
1288
1301
|
async: (s = t == null ? void 0 : t.async) !== null && s !== void 0 ? s : !1,
|
|
@@ -1293,12 +1306,12 @@ class w {
|
|
|
1293
1306
|
parent: null,
|
|
1294
1307
|
data: e,
|
|
1295
1308
|
parsedType: oe(e)
|
|
1296
|
-
}, a = this._parseSync({ data: e, path:
|
|
1297
|
-
return qt(
|
|
1309
|
+
}, a = this._parseSync({ data: e, path: n.path, parent: n });
|
|
1310
|
+
return qt(n, a);
|
|
1298
1311
|
}
|
|
1299
1312
|
"~validate"(e) {
|
|
1300
1313
|
var t, s;
|
|
1301
|
-
const
|
|
1314
|
+
const n = {
|
|
1302
1315
|
common: {
|
|
1303
1316
|
issues: [],
|
|
1304
1317
|
async: !!this["~standard"].async
|
|
@@ -1311,22 +1324,22 @@ class w {
|
|
|
1311
1324
|
};
|
|
1312
1325
|
if (!this["~standard"].async)
|
|
1313
1326
|
try {
|
|
1314
|
-
const a = this._parseSync({ data: e, path: [], parent:
|
|
1327
|
+
const a = this._parseSync({ data: e, path: [], parent: n });
|
|
1315
1328
|
return _e(a) ? {
|
|
1316
1329
|
value: a.value
|
|
1317
1330
|
} : {
|
|
1318
|
-
issues:
|
|
1331
|
+
issues: n.common.issues
|
|
1319
1332
|
};
|
|
1320
1333
|
} catch (a) {
|
|
1321
|
-
!((s = (t = a == null ? void 0 : a.message) === null || t === void 0 ? void 0 : t.toLowerCase()) === null || s === void 0) && s.includes("encountered") && (this["~standard"].async = !0),
|
|
1334
|
+
!((s = (t = a == null ? void 0 : a.message) === null || t === void 0 ? void 0 : t.toLowerCase()) === null || s === void 0) && s.includes("encountered") && (this["~standard"].async = !0), n.common = {
|
|
1322
1335
|
issues: [],
|
|
1323
1336
|
async: !0
|
|
1324
1337
|
};
|
|
1325
1338
|
}
|
|
1326
|
-
return this._parseAsync({ data: e, path: [], parent:
|
|
1339
|
+
return this._parseAsync({ data: e, path: [], parent: n }).then((a) => _e(a) ? {
|
|
1327
1340
|
value: a.value
|
|
1328
1341
|
} : {
|
|
1329
|
-
issues:
|
|
1342
|
+
issues: n.common.issues
|
|
1330
1343
|
});
|
|
1331
1344
|
}
|
|
1332
1345
|
parseAsync(e, t) {
|
|
@@ -1350,26 +1363,26 @@ class w {
|
|
|
1350
1363
|
parent: null,
|
|
1351
1364
|
data: e,
|
|
1352
1365
|
parsedType: oe(e)
|
|
1353
|
-
},
|
|
1366
|
+
}, n = this._parse({ data: e, path: s.path, parent: s }), a = yield Pe(n) ? n : Promise.resolve(n);
|
|
1354
1367
|
return qt(s, a);
|
|
1355
1368
|
});
|
|
1356
1369
|
}
|
|
1357
1370
|
refine(e, t) {
|
|
1358
|
-
const s = (
|
|
1359
|
-
return this._refinement((
|
|
1360
|
-
const i = e(
|
|
1371
|
+
const s = (n) => typeof t == "string" || typeof t == "undefined" ? { message: t } : typeof t == "function" ? t(n) : t;
|
|
1372
|
+
return this._refinement((n, a) => {
|
|
1373
|
+
const i = e(n), o = () => a.addIssue(d({
|
|
1361
1374
|
code: l.custom
|
|
1362
|
-
}, s(
|
|
1375
|
+
}, s(n)));
|
|
1363
1376
|
return typeof Promise != "undefined" && i instanceof Promise ? i.then((c) => c ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
|
|
1364
1377
|
});
|
|
1365
1378
|
}
|
|
1366
1379
|
refinement(e, t) {
|
|
1367
|
-
return this._refinement((s,
|
|
1380
|
+
return this._refinement((s, n) => e(s) ? !0 : (n.addIssue(typeof t == "function" ? t(s, n) : t), !1));
|
|
1368
1381
|
}
|
|
1369
1382
|
_refinement(e) {
|
|
1370
1383
|
return new K({
|
|
1371
1384
|
schema: this,
|
|
1372
|
-
typeName:
|
|
1385
|
+
typeName: v.ZodEffects,
|
|
1373
1386
|
effect: { type: "refinement", refinement: e }
|
|
1374
1387
|
});
|
|
1375
1388
|
}
|
|
@@ -1407,7 +1420,7 @@ class w {
|
|
|
1407
1420
|
transform(e) {
|
|
1408
1421
|
return new K(y(d({}, b(this._def)), {
|
|
1409
1422
|
schema: this,
|
|
1410
|
-
typeName:
|
|
1423
|
+
typeName: v.ZodEffects,
|
|
1411
1424
|
effect: { type: "transform", transform: e }
|
|
1412
1425
|
}));
|
|
1413
1426
|
}
|
|
@@ -1416,12 +1429,12 @@ class w {
|
|
|
1416
1429
|
return new qe(y(d({}, b(this._def)), {
|
|
1417
1430
|
innerType: this,
|
|
1418
1431
|
defaultValue: t,
|
|
1419
|
-
typeName:
|
|
1432
|
+
typeName: v.ZodDefault
|
|
1420
1433
|
}));
|
|
1421
1434
|
}
|
|
1422
1435
|
brand() {
|
|
1423
1436
|
return new Zt(d({
|
|
1424
|
-
typeName:
|
|
1437
|
+
typeName: v.ZodBranded,
|
|
1425
1438
|
type: this
|
|
1426
1439
|
}, b(this._def)));
|
|
1427
1440
|
}
|
|
@@ -1430,7 +1443,7 @@ class w {
|
|
|
1430
1443
|
return new He(y(d({}, b(this._def)), {
|
|
1431
1444
|
innerType: this,
|
|
1432
1445
|
catchValue: t,
|
|
1433
|
-
typeName:
|
|
1446
|
+
typeName: v.ZodCatch
|
|
1434
1447
|
}));
|
|
1435
1448
|
}
|
|
1436
1449
|
describe(e) {
|
|
@@ -1454,34 +1467,34 @@ class w {
|
|
|
1454
1467
|
}
|
|
1455
1468
|
const Os = /^c[^\s-]{8,}$/i, Cs = /^[0-9a-z]+$/, Ns = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Is = /^[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, js = /^[a-z0-9_-]{21}$/i, Zs = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Rs = /^[-+]?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)?)??$/, Ms = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ps = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
1456
1469
|
let yt;
|
|
1457
|
-
const $s = /^(?:(?: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])$/,
|
|
1458
|
-
function
|
|
1470
|
+
const $s = /^(?:(?: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])$/, Fs = /^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/, Vs = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Ds = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ls = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Us = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, dr = "((\\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])))", zs = new RegExp(`^${dr}$`);
|
|
1471
|
+
function ur(r) {
|
|
1459
1472
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
1460
|
-
return
|
|
1473
|
+
return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
1461
1474
|
}
|
|
1462
|
-
function Ws(
|
|
1463
|
-
return new RegExp(`^${
|
|
1475
|
+
function Ws(r) {
|
|
1476
|
+
return new RegExp(`^${ur(r)}$`);
|
|
1464
1477
|
}
|
|
1465
|
-
function
|
|
1466
|
-
let e = `${
|
|
1478
|
+
function lr(r) {
|
|
1479
|
+
let e = `${dr}T${ur(r)}`;
|
|
1467
1480
|
const t = [];
|
|
1468
|
-
return t.push(
|
|
1481
|
+
return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
1469
1482
|
}
|
|
1470
|
-
function Bs(
|
|
1471
|
-
return !!((e === "v4" || !e) && $s.test(
|
|
1483
|
+
function Bs(r, e) {
|
|
1484
|
+
return !!((e === "v4" || !e) && $s.test(r) || (e === "v6" || !e) && Vs.test(r));
|
|
1472
1485
|
}
|
|
1473
|
-
function qs(
|
|
1474
|
-
if (!Zs.test(
|
|
1486
|
+
function qs(r, e) {
|
|
1487
|
+
if (!Zs.test(r))
|
|
1475
1488
|
return !1;
|
|
1476
1489
|
try {
|
|
1477
|
-
const [t] =
|
|
1478
|
-
return !(typeof
|
|
1490
|
+
const [t] = r.split("."), s = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), n = JSON.parse(atob(s));
|
|
1491
|
+
return !(typeof n != "object" || n === null || !n.typ || !n.alg || e && n.alg !== e);
|
|
1479
1492
|
} catch (t) {
|
|
1480
1493
|
return !1;
|
|
1481
1494
|
}
|
|
1482
1495
|
}
|
|
1483
|
-
function Hs(
|
|
1484
|
-
return !!((e === "v4" || !e) &&
|
|
1496
|
+
function Hs(r, e) {
|
|
1497
|
+
return !!((e === "v4" || !e) && Fs.test(r) || (e === "v6" || !e) && Ds.test(r));
|
|
1485
1498
|
}
|
|
1486
1499
|
class J extends w {
|
|
1487
1500
|
_parse(e) {
|
|
@@ -1491,13 +1504,13 @@ class J extends w {
|
|
|
1491
1504
|
code: l.invalid_type,
|
|
1492
1505
|
expected: p.string,
|
|
1493
1506
|
received: a.parsedType
|
|
1494
|
-
}),
|
|
1507
|
+
}), _;
|
|
1495
1508
|
}
|
|
1496
1509
|
const s = new Z();
|
|
1497
|
-
let
|
|
1510
|
+
let n;
|
|
1498
1511
|
for (const a of this._def.checks)
|
|
1499
1512
|
if (a.kind === "min")
|
|
1500
|
-
e.data.length < a.value && (
|
|
1513
|
+
e.data.length < a.value && (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1501
1514
|
code: l.too_small,
|
|
1502
1515
|
minimum: a.value,
|
|
1503
1516
|
type: "string",
|
|
@@ -1506,7 +1519,7 @@ class J extends w {
|
|
|
1506
1519
|
message: a.message
|
|
1507
1520
|
}), s.dirty());
|
|
1508
1521
|
else if (a.kind === "max")
|
|
1509
|
-
e.data.length > a.value && (
|
|
1522
|
+
e.data.length > a.value && (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1510
1523
|
code: l.too_big,
|
|
1511
1524
|
maximum: a.value,
|
|
1512
1525
|
type: "string",
|
|
@@ -1516,14 +1529,14 @@ class J extends w {
|
|
|
1516
1529
|
}), s.dirty());
|
|
1517
1530
|
else if (a.kind === "length") {
|
|
1518
1531
|
const i = e.data.length > a.value, o = e.data.length < a.value;
|
|
1519
|
-
(i || o) && (
|
|
1532
|
+
(i || o) && (n = this._getOrReturnCtx(e, n), i ? h(n, {
|
|
1520
1533
|
code: l.too_big,
|
|
1521
1534
|
maximum: a.value,
|
|
1522
1535
|
type: "string",
|
|
1523
1536
|
inclusive: !0,
|
|
1524
1537
|
exact: !0,
|
|
1525
1538
|
message: a.message
|
|
1526
|
-
}) : o && h(
|
|
1539
|
+
}) : o && h(n, {
|
|
1527
1540
|
code: l.too_small,
|
|
1528
1541
|
minimum: a.value,
|
|
1529
1542
|
type: "string",
|
|
@@ -1532,43 +1545,43 @@ class J extends w {
|
|
|
1532
1545
|
message: a.message
|
|
1533
1546
|
}), s.dirty());
|
|
1534
1547
|
} else if (a.kind === "email")
|
|
1535
|
-
Ms.test(e.data) || (
|
|
1548
|
+
Ms.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1536
1549
|
validation: "email",
|
|
1537
1550
|
code: l.invalid_string,
|
|
1538
1551
|
message: a.message
|
|
1539
1552
|
}), s.dirty());
|
|
1540
1553
|
else if (a.kind === "emoji")
|
|
1541
|
-
yt || (yt = new RegExp(Ps, "u")), yt.test(e.data) || (
|
|
1554
|
+
yt || (yt = new RegExp(Ps, "u")), yt.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1542
1555
|
validation: "emoji",
|
|
1543
1556
|
code: l.invalid_string,
|
|
1544
1557
|
message: a.message
|
|
1545
1558
|
}), s.dirty());
|
|
1546
1559
|
else if (a.kind === "uuid")
|
|
1547
|
-
Is.test(e.data) || (
|
|
1560
|
+
Is.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1548
1561
|
validation: "uuid",
|
|
1549
1562
|
code: l.invalid_string,
|
|
1550
1563
|
message: a.message
|
|
1551
1564
|
}), s.dirty());
|
|
1552
1565
|
else if (a.kind === "nanoid")
|
|
1553
|
-
js.test(e.data) || (
|
|
1566
|
+
js.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1554
1567
|
validation: "nanoid",
|
|
1555
1568
|
code: l.invalid_string,
|
|
1556
1569
|
message: a.message
|
|
1557
1570
|
}), s.dirty());
|
|
1558
1571
|
else if (a.kind === "cuid")
|
|
1559
|
-
Os.test(e.data) || (
|
|
1572
|
+
Os.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1560
1573
|
validation: "cuid",
|
|
1561
1574
|
code: l.invalid_string,
|
|
1562
1575
|
message: a.message
|
|
1563
1576
|
}), s.dirty());
|
|
1564
1577
|
else if (a.kind === "cuid2")
|
|
1565
|
-
Cs.test(e.data) || (
|
|
1578
|
+
Cs.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1566
1579
|
validation: "cuid2",
|
|
1567
1580
|
code: l.invalid_string,
|
|
1568
1581
|
message: a.message
|
|
1569
1582
|
}), s.dirty());
|
|
1570
1583
|
else if (a.kind === "ulid")
|
|
1571
|
-
Ns.test(e.data) || (
|
|
1584
|
+
Ns.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1572
1585
|
validation: "ulid",
|
|
1573
1586
|
code: l.invalid_string,
|
|
1574
1587
|
message: a.message
|
|
@@ -1577,61 +1590,61 @@ class J extends w {
|
|
|
1577
1590
|
try {
|
|
1578
1591
|
new URL(e.data);
|
|
1579
1592
|
} catch (i) {
|
|
1580
|
-
|
|
1593
|
+
n = this._getOrReturnCtx(e, n), h(n, {
|
|
1581
1594
|
validation: "url",
|
|
1582
1595
|
code: l.invalid_string,
|
|
1583
1596
|
message: a.message
|
|
1584
1597
|
}), s.dirty();
|
|
1585
1598
|
}
|
|
1586
|
-
else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (
|
|
1599
|
+
else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1587
1600
|
validation: "regex",
|
|
1588
1601
|
code: l.invalid_string,
|
|
1589
1602
|
message: a.message
|
|
1590
|
-
}), s.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (
|
|
1603
|
+
}), s.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1591
1604
|
code: l.invalid_string,
|
|
1592
1605
|
validation: { includes: a.value, position: a.position },
|
|
1593
1606
|
message: a.message
|
|
1594
|
-
}), s.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (
|
|
1607
|
+
}), s.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1595
1608
|
code: l.invalid_string,
|
|
1596
1609
|
validation: { startsWith: a.value },
|
|
1597
1610
|
message: a.message
|
|
1598
|
-
}), s.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (
|
|
1611
|
+
}), s.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1599
1612
|
code: l.invalid_string,
|
|
1600
1613
|
validation: { endsWith: a.value },
|
|
1601
1614
|
message: a.message
|
|
1602
|
-
}), s.dirty()) : a.kind === "datetime" ?
|
|
1615
|
+
}), s.dirty()) : a.kind === "datetime" ? lr(a).test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1603
1616
|
code: l.invalid_string,
|
|
1604
1617
|
validation: "datetime",
|
|
1605
1618
|
message: a.message
|
|
1606
|
-
}), s.dirty()) : a.kind === "date" ? zs.test(e.data) || (
|
|
1619
|
+
}), s.dirty()) : a.kind === "date" ? zs.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1607
1620
|
code: l.invalid_string,
|
|
1608
1621
|
validation: "date",
|
|
1609
1622
|
message: a.message
|
|
1610
|
-
}), s.dirty()) : a.kind === "time" ? Ws(a).test(e.data) || (
|
|
1623
|
+
}), s.dirty()) : a.kind === "time" ? Ws(a).test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1611
1624
|
code: l.invalid_string,
|
|
1612
1625
|
validation: "time",
|
|
1613
1626
|
message: a.message
|
|
1614
|
-
}), s.dirty()) : a.kind === "duration" ? Rs.test(e.data) || (
|
|
1627
|
+
}), s.dirty()) : a.kind === "duration" ? Rs.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1615
1628
|
validation: "duration",
|
|
1616
1629
|
code: l.invalid_string,
|
|
1617
1630
|
message: a.message
|
|
1618
|
-
}), s.dirty()) : a.kind === "ip" ? Bs(e.data, a.version) || (
|
|
1631
|
+
}), s.dirty()) : a.kind === "ip" ? Bs(e.data, a.version) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1619
1632
|
validation: "ip",
|
|
1620
1633
|
code: l.invalid_string,
|
|
1621
1634
|
message: a.message
|
|
1622
|
-
}), s.dirty()) : a.kind === "jwt" ? qs(e.data, a.alg) || (
|
|
1635
|
+
}), s.dirty()) : a.kind === "jwt" ? qs(e.data, a.alg) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1623
1636
|
validation: "jwt",
|
|
1624
1637
|
code: l.invalid_string,
|
|
1625
1638
|
message: a.message
|
|
1626
|
-
}), s.dirty()) : a.kind === "cidr" ? Hs(e.data, a.version) || (
|
|
1639
|
+
}), s.dirty()) : a.kind === "cidr" ? Hs(e.data, a.version) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1627
1640
|
validation: "cidr",
|
|
1628
1641
|
code: l.invalid_string,
|
|
1629
1642
|
message: a.message
|
|
1630
|
-
}), s.dirty()) : a.kind === "base64" ? Ls.test(e.data) || (
|
|
1643
|
+
}), s.dirty()) : a.kind === "base64" ? Ls.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1631
1644
|
validation: "base64",
|
|
1632
1645
|
code: l.invalid_string,
|
|
1633
1646
|
message: a.message
|
|
1634
|
-
}), s.dirty()) : a.kind === "base64url" ? Us.test(e.data) || (
|
|
1647
|
+
}), s.dirty()) : a.kind === "base64url" ? Us.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1635
1648
|
validation: "base64url",
|
|
1636
1649
|
code: l.invalid_string,
|
|
1637
1650
|
message: a.message
|
|
@@ -1639,7 +1652,7 @@ class J extends w {
|
|
|
1639
1652
|
return { status: s.value, value: e.data };
|
|
1640
1653
|
}
|
|
1641
1654
|
_regex(e, t, s) {
|
|
1642
|
-
return this.refinement((
|
|
1655
|
+
return this.refinement((n) => e.test(n), d({
|
|
1643
1656
|
validation: t,
|
|
1644
1657
|
code: l.invalid_string
|
|
1645
1658
|
}, m.errToObj(s)));
|
|
@@ -1846,17 +1859,17 @@ class J extends w {
|
|
|
1846
1859
|
return e;
|
|
1847
1860
|
}
|
|
1848
1861
|
}
|
|
1849
|
-
J.create = (
|
|
1862
|
+
J.create = (r) => {
|
|
1850
1863
|
var e;
|
|
1851
1864
|
return new J(d({
|
|
1852
1865
|
checks: [],
|
|
1853
|
-
typeName:
|
|
1854
|
-
coerce: (e =
|
|
1855
|
-
}, b(
|
|
1866
|
+
typeName: v.ZodString,
|
|
1867
|
+
coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1
|
|
1868
|
+
}, b(r)));
|
|
1856
1869
|
};
|
|
1857
|
-
function Js(
|
|
1858
|
-
const t = (
|
|
1859
|
-
return a % i / Math.pow(10,
|
|
1870
|
+
function Js(r, e) {
|
|
1871
|
+
const t = (r.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s, a = parseInt(r.toFixed(n).replace(".", "")), i = parseInt(e.toFixed(n).replace(".", ""));
|
|
1872
|
+
return a % i / Math.pow(10, n);
|
|
1860
1873
|
}
|
|
1861
1874
|
class fe extends w {
|
|
1862
1875
|
constructor() {
|
|
@@ -1869,39 +1882,39 @@ class fe extends w {
|
|
|
1869
1882
|
code: l.invalid_type,
|
|
1870
1883
|
expected: p.number,
|
|
1871
1884
|
received: a.parsedType
|
|
1872
|
-
}),
|
|
1885
|
+
}), _;
|
|
1873
1886
|
}
|
|
1874
1887
|
let s;
|
|
1875
|
-
const
|
|
1888
|
+
const n = new Z();
|
|
1876
1889
|
for (const a of this._def.checks)
|
|
1877
1890
|
a.kind === "int" ? x.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
1878
1891
|
code: l.invalid_type,
|
|
1879
1892
|
expected: "integer",
|
|
1880
1893
|
received: "float",
|
|
1881
1894
|
message: a.message
|
|
1882
|
-
}),
|
|
1895
|
+
}), n.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
|
|
1883
1896
|
code: l.too_small,
|
|
1884
1897
|
minimum: a.value,
|
|
1885
1898
|
type: "number",
|
|
1886
1899
|
inclusive: a.inclusive,
|
|
1887
1900
|
exact: !1,
|
|
1888
1901
|
message: a.message
|
|
1889
|
-
}),
|
|
1902
|
+
}), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
|
|
1890
1903
|
code: l.too_big,
|
|
1891
1904
|
maximum: a.value,
|
|
1892
1905
|
type: "number",
|
|
1893
1906
|
inclusive: a.inclusive,
|
|
1894
1907
|
exact: !1,
|
|
1895
1908
|
message: a.message
|
|
1896
|
-
}),
|
|
1909
|
+
}), n.dirty()) : a.kind === "multipleOf" ? Js(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), h(s, {
|
|
1897
1910
|
code: l.not_multiple_of,
|
|
1898
1911
|
multipleOf: a.value,
|
|
1899
1912
|
message: a.message
|
|
1900
|
-
}),
|
|
1913
|
+
}), n.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
1901
1914
|
code: l.not_finite,
|
|
1902
1915
|
message: a.message
|
|
1903
|
-
}),
|
|
1904
|
-
return { status:
|
|
1916
|
+
}), n.dirty()) : x.assertNever(a);
|
|
1917
|
+
return { status: n.value, value: e.data };
|
|
1905
1918
|
}
|
|
1906
1919
|
gte(e, t) {
|
|
1907
1920
|
return this.setLimit("min", e, !0, m.toString(t));
|
|
@@ -1915,7 +1928,7 @@ class fe extends w {
|
|
|
1915
1928
|
lt(e, t) {
|
|
1916
1929
|
return this.setLimit("max", e, !1, m.toString(t));
|
|
1917
1930
|
}
|
|
1918
|
-
setLimit(e, t, s,
|
|
1931
|
+
setLimit(e, t, s, n) {
|
|
1919
1932
|
return new fe(y(d({}, this._def), {
|
|
1920
1933
|
checks: [
|
|
1921
1934
|
...this._def.checks,
|
|
@@ -1923,7 +1936,7 @@ class fe extends w {
|
|
|
1923
1936
|
kind: e,
|
|
1924
1937
|
value: t,
|
|
1925
1938
|
inclusive: s,
|
|
1926
|
-
message: m.toString(
|
|
1939
|
+
message: m.toString(n)
|
|
1927
1940
|
}
|
|
1928
1941
|
]
|
|
1929
1942
|
}));
|
|
@@ -2022,11 +2035,11 @@ class fe extends w {
|
|
|
2022
2035
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
2023
2036
|
}
|
|
2024
2037
|
}
|
|
2025
|
-
fe.create = (
|
|
2038
|
+
fe.create = (r) => new fe(d({
|
|
2026
2039
|
checks: [],
|
|
2027
|
-
typeName:
|
|
2028
|
-
coerce: (
|
|
2029
|
-
}, b(
|
|
2040
|
+
typeName: v.ZodNumber,
|
|
2041
|
+
coerce: (r == null ? void 0 : r.coerce) || !1
|
|
2042
|
+
}, b(r)));
|
|
2030
2043
|
class he extends w {
|
|
2031
2044
|
constructor() {
|
|
2032
2045
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
@@ -2041,7 +2054,7 @@ class he extends w {
|
|
|
2041
2054
|
if (this._getType(e) !== p.bigint)
|
|
2042
2055
|
return this._getInvalidInput(e);
|
|
2043
2056
|
let s;
|
|
2044
|
-
const
|
|
2057
|
+
const n = new Z();
|
|
2045
2058
|
for (const a of this._def.checks)
|
|
2046
2059
|
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2047
2060
|
code: l.too_small,
|
|
@@ -2049,18 +2062,18 @@ class he extends w {
|
|
|
2049
2062
|
minimum: a.value,
|
|
2050
2063
|
inclusive: a.inclusive,
|
|
2051
2064
|
message: a.message
|
|
2052
|
-
}),
|
|
2065
|
+
}), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2053
2066
|
code: l.too_big,
|
|
2054
2067
|
type: "bigint",
|
|
2055
2068
|
maximum: a.value,
|
|
2056
2069
|
inclusive: a.inclusive,
|
|
2057
2070
|
message: a.message
|
|
2058
|
-
}),
|
|
2071
|
+
}), n.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2059
2072
|
code: l.not_multiple_of,
|
|
2060
2073
|
multipleOf: a.value,
|
|
2061
2074
|
message: a.message
|
|
2062
|
-
}),
|
|
2063
|
-
return { status:
|
|
2075
|
+
}), n.dirty()) : x.assertNever(a);
|
|
2076
|
+
return { status: n.value, value: e.data };
|
|
2064
2077
|
}
|
|
2065
2078
|
_getInvalidInput(e) {
|
|
2066
2079
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2068,7 +2081,7 @@ class he extends w {
|
|
|
2068
2081
|
code: l.invalid_type,
|
|
2069
2082
|
expected: p.bigint,
|
|
2070
2083
|
received: t.parsedType
|
|
2071
|
-
}),
|
|
2084
|
+
}), _;
|
|
2072
2085
|
}
|
|
2073
2086
|
gte(e, t) {
|
|
2074
2087
|
return this.setLimit("min", e, !0, m.toString(t));
|
|
@@ -2082,7 +2095,7 @@ class he extends w {
|
|
|
2082
2095
|
lt(e, t) {
|
|
2083
2096
|
return this.setLimit("max", e, !1, m.toString(t));
|
|
2084
2097
|
}
|
|
2085
|
-
setLimit(e, t, s,
|
|
2098
|
+
setLimit(e, t, s, n) {
|
|
2086
2099
|
return new he(y(d({}, this._def), {
|
|
2087
2100
|
checks: [
|
|
2088
2101
|
...this._def.checks,
|
|
@@ -2090,7 +2103,7 @@ class he extends w {
|
|
|
2090
2103
|
kind: e,
|
|
2091
2104
|
value: t,
|
|
2092
2105
|
inclusive: s,
|
|
2093
|
-
message: m.toString(
|
|
2106
|
+
message: m.toString(n)
|
|
2094
2107
|
}
|
|
2095
2108
|
]
|
|
2096
2109
|
}));
|
|
@@ -2152,13 +2165,13 @@ class he extends w {
|
|
|
2152
2165
|
return e;
|
|
2153
2166
|
}
|
|
2154
2167
|
}
|
|
2155
|
-
he.create = (
|
|
2168
|
+
he.create = (r) => {
|
|
2156
2169
|
var e;
|
|
2157
2170
|
return new he(d({
|
|
2158
2171
|
checks: [],
|
|
2159
|
-
typeName:
|
|
2160
|
-
coerce: (e =
|
|
2161
|
-
}, b(
|
|
2172
|
+
typeName: v.ZodBigInt,
|
|
2173
|
+
coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1
|
|
2174
|
+
}, b(r)));
|
|
2162
2175
|
};
|
|
2163
2176
|
class $e extends w {
|
|
2164
2177
|
_parse(e) {
|
|
@@ -2168,15 +2181,15 @@ class $e extends w {
|
|
|
2168
2181
|
code: l.invalid_type,
|
|
2169
2182
|
expected: p.boolean,
|
|
2170
2183
|
received: s.parsedType
|
|
2171
|
-
}),
|
|
2184
|
+
}), _;
|
|
2172
2185
|
}
|
|
2173
2186
|
return $(e.data);
|
|
2174
2187
|
}
|
|
2175
2188
|
}
|
|
2176
|
-
$e.create = (
|
|
2177
|
-
typeName:
|
|
2178
|
-
coerce: (
|
|
2179
|
-
}, b(
|
|
2189
|
+
$e.create = (r) => new $e(d({
|
|
2190
|
+
typeName: v.ZodBoolean,
|
|
2191
|
+
coerce: (r == null ? void 0 : r.coerce) || !1
|
|
2192
|
+
}, b(r)));
|
|
2180
2193
|
class be extends w {
|
|
2181
2194
|
_parse(e) {
|
|
2182
2195
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== p.date) {
|
|
@@ -2185,25 +2198,25 @@ class be extends w {
|
|
|
2185
2198
|
code: l.invalid_type,
|
|
2186
2199
|
expected: p.date,
|
|
2187
2200
|
received: a.parsedType
|
|
2188
|
-
}),
|
|
2201
|
+
}), _;
|
|
2189
2202
|
}
|
|
2190
2203
|
if (isNaN(e.data.getTime())) {
|
|
2191
2204
|
const a = this._getOrReturnCtx(e);
|
|
2192
2205
|
return h(a, {
|
|
2193
2206
|
code: l.invalid_date
|
|
2194
|
-
}),
|
|
2207
|
+
}), _;
|
|
2195
2208
|
}
|
|
2196
2209
|
const s = new Z();
|
|
2197
|
-
let
|
|
2210
|
+
let n;
|
|
2198
2211
|
for (const a of this._def.checks)
|
|
2199
|
-
a.kind === "min" ? e.data.getTime() < a.value && (
|
|
2212
|
+
a.kind === "min" ? e.data.getTime() < a.value && (n = this._getOrReturnCtx(e, n), h(n, {
|
|
2200
2213
|
code: l.too_small,
|
|
2201
2214
|
message: a.message,
|
|
2202
2215
|
inclusive: !0,
|
|
2203
2216
|
exact: !1,
|
|
2204
2217
|
minimum: a.value,
|
|
2205
2218
|
type: "date"
|
|
2206
|
-
}), s.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (
|
|
2219
|
+
}), s.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (n = this._getOrReturnCtx(e, n), h(n, {
|
|
2207
2220
|
code: l.too_big,
|
|
2208
2221
|
message: a.message,
|
|
2209
2222
|
inclusive: !0,
|
|
@@ -2248,12 +2261,12 @@ class be extends w {
|
|
|
2248
2261
|
return e != null ? new Date(e) : null;
|
|
2249
2262
|
}
|
|
2250
2263
|
}
|
|
2251
|
-
be.create = (
|
|
2264
|
+
be.create = (r) => new be(d({
|
|
2252
2265
|
checks: [],
|
|
2253
|
-
coerce: (
|
|
2254
|
-
typeName:
|
|
2255
|
-
}, b(
|
|
2256
|
-
class
|
|
2266
|
+
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
2267
|
+
typeName: v.ZodDate
|
|
2268
|
+
}, b(r)));
|
|
2269
|
+
class nt extends w {
|
|
2257
2270
|
_parse(e) {
|
|
2258
2271
|
if (this._getType(e) !== p.symbol) {
|
|
2259
2272
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2261,15 +2274,15 @@ class rt extends w {
|
|
|
2261
2274
|
code: l.invalid_type,
|
|
2262
2275
|
expected: p.symbol,
|
|
2263
2276
|
received: s.parsedType
|
|
2264
|
-
}),
|
|
2277
|
+
}), _;
|
|
2265
2278
|
}
|
|
2266
2279
|
return $(e.data);
|
|
2267
2280
|
}
|
|
2268
2281
|
}
|
|
2269
|
-
|
|
2270
|
-
typeName:
|
|
2271
|
-
}, b(
|
|
2272
|
-
class
|
|
2282
|
+
nt.create = (r) => new nt(d({
|
|
2283
|
+
typeName: v.ZodSymbol
|
|
2284
|
+
}, b(r)));
|
|
2285
|
+
class Fe extends w {
|
|
2273
2286
|
_parse(e) {
|
|
2274
2287
|
if (this._getType(e) !== p.undefined) {
|
|
2275
2288
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2277,15 +2290,15 @@ class Ve extends w {
|
|
|
2277
2290
|
code: l.invalid_type,
|
|
2278
2291
|
expected: p.undefined,
|
|
2279
2292
|
received: s.parsedType
|
|
2280
|
-
}),
|
|
2293
|
+
}), _;
|
|
2281
2294
|
}
|
|
2282
2295
|
return $(e.data);
|
|
2283
2296
|
}
|
|
2284
2297
|
}
|
|
2285
|
-
|
|
2286
|
-
typeName:
|
|
2287
|
-
}, b(
|
|
2288
|
-
class
|
|
2298
|
+
Fe.create = (r) => new Fe(d({
|
|
2299
|
+
typeName: v.ZodUndefined
|
|
2300
|
+
}, b(r)));
|
|
2301
|
+
class Ve extends w {
|
|
2289
2302
|
_parse(e) {
|
|
2290
2303
|
if (this._getType(e) !== p.null) {
|
|
2291
2304
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2293,15 +2306,15 @@ class Fe extends w {
|
|
|
2293
2306
|
code: l.invalid_type,
|
|
2294
2307
|
expected: p.null,
|
|
2295
2308
|
received: s.parsedType
|
|
2296
|
-
}),
|
|
2309
|
+
}), _;
|
|
2297
2310
|
}
|
|
2298
2311
|
return $(e.data);
|
|
2299
2312
|
}
|
|
2300
2313
|
}
|
|
2301
|
-
|
|
2302
|
-
typeName:
|
|
2303
|
-
}, b(
|
|
2304
|
-
class
|
|
2314
|
+
Ve.create = (r) => new Ve(d({
|
|
2315
|
+
typeName: v.ZodNull
|
|
2316
|
+
}, b(r)));
|
|
2317
|
+
class Ae extends w {
|
|
2305
2318
|
constructor() {
|
|
2306
2319
|
super(...arguments), this._any = !0;
|
|
2307
2320
|
}
|
|
@@ -2309,9 +2322,9 @@ class Ee extends w {
|
|
|
2309
2322
|
return $(e.data);
|
|
2310
2323
|
}
|
|
2311
2324
|
}
|
|
2312
|
-
|
|
2313
|
-
typeName:
|
|
2314
|
-
}, b(
|
|
2325
|
+
Ae.create = (r) => new Ae(d({
|
|
2326
|
+
typeName: v.ZodAny
|
|
2327
|
+
}, b(r)));
|
|
2315
2328
|
class ve extends w {
|
|
2316
2329
|
constructor() {
|
|
2317
2330
|
super(...arguments), this._unknown = !0;
|
|
@@ -2320,9 +2333,9 @@ class ve extends w {
|
|
|
2320
2333
|
return $(e.data);
|
|
2321
2334
|
}
|
|
2322
2335
|
}
|
|
2323
|
-
ve.create = (
|
|
2324
|
-
typeName:
|
|
2325
|
-
}, b(
|
|
2336
|
+
ve.create = (r) => new ve(d({
|
|
2337
|
+
typeName: v.ZodUnknown
|
|
2338
|
+
}, b(r)));
|
|
2326
2339
|
class ce extends w {
|
|
2327
2340
|
_parse(e) {
|
|
2328
2341
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2330,12 +2343,12 @@ class ce extends w {
|
|
|
2330
2343
|
code: l.invalid_type,
|
|
2331
2344
|
expected: p.never,
|
|
2332
2345
|
received: t.parsedType
|
|
2333
|
-
}),
|
|
2346
|
+
}), _;
|
|
2334
2347
|
}
|
|
2335
2348
|
}
|
|
2336
|
-
ce.create = (
|
|
2337
|
-
typeName:
|
|
2338
|
-
}, b(
|
|
2349
|
+
ce.create = (r) => new ce(d({
|
|
2350
|
+
typeName: v.ZodNever
|
|
2351
|
+
}, b(r)));
|
|
2339
2352
|
class at extends w {
|
|
2340
2353
|
_parse(e) {
|
|
2341
2354
|
if (this._getType(e) !== p.undefined) {
|
|
@@ -2344,52 +2357,52 @@ class at extends w {
|
|
|
2344
2357
|
code: l.invalid_type,
|
|
2345
2358
|
expected: p.void,
|
|
2346
2359
|
received: s.parsedType
|
|
2347
|
-
}),
|
|
2360
|
+
}), _;
|
|
2348
2361
|
}
|
|
2349
2362
|
return $(e.data);
|
|
2350
2363
|
}
|
|
2351
2364
|
}
|
|
2352
|
-
at.create = (
|
|
2353
|
-
typeName:
|
|
2354
|
-
}, b(
|
|
2365
|
+
at.create = (r) => new at(d({
|
|
2366
|
+
typeName: v.ZodVoid
|
|
2367
|
+
}, b(r)));
|
|
2355
2368
|
class G extends w {
|
|
2356
2369
|
_parse(e) {
|
|
2357
|
-
const { ctx: t, status: s } = this._processInputParams(e),
|
|
2370
|
+
const { ctx: t, status: s } = this._processInputParams(e), n = this._def;
|
|
2358
2371
|
if (t.parsedType !== p.array)
|
|
2359
2372
|
return h(t, {
|
|
2360
2373
|
code: l.invalid_type,
|
|
2361
2374
|
expected: p.array,
|
|
2362
2375
|
received: t.parsedType
|
|
2363
|
-
}),
|
|
2364
|
-
if (
|
|
2365
|
-
const i = t.data.length >
|
|
2376
|
+
}), _;
|
|
2377
|
+
if (n.exactLength !== null) {
|
|
2378
|
+
const i = t.data.length > n.exactLength.value, o = t.data.length < n.exactLength.value;
|
|
2366
2379
|
(i || o) && (h(t, {
|
|
2367
2380
|
code: i ? l.too_big : l.too_small,
|
|
2368
|
-
minimum: o ?
|
|
2369
|
-
maximum: i ?
|
|
2381
|
+
minimum: o ? n.exactLength.value : void 0,
|
|
2382
|
+
maximum: i ? n.exactLength.value : void 0,
|
|
2370
2383
|
type: "array",
|
|
2371
2384
|
inclusive: !0,
|
|
2372
2385
|
exact: !0,
|
|
2373
|
-
message:
|
|
2386
|
+
message: n.exactLength.message
|
|
2374
2387
|
}), s.dirty());
|
|
2375
2388
|
}
|
|
2376
|
-
if (
|
|
2389
|
+
if (n.minLength !== null && t.data.length < n.minLength.value && (h(t, {
|
|
2377
2390
|
code: l.too_small,
|
|
2378
|
-
minimum:
|
|
2391
|
+
minimum: n.minLength.value,
|
|
2379
2392
|
type: "array",
|
|
2380
2393
|
inclusive: !0,
|
|
2381
2394
|
exact: !1,
|
|
2382
|
-
message:
|
|
2383
|
-
}), s.dirty()),
|
|
2395
|
+
message: n.minLength.message
|
|
2396
|
+
}), s.dirty()), n.maxLength !== null && t.data.length > n.maxLength.value && (h(t, {
|
|
2384
2397
|
code: l.too_big,
|
|
2385
|
-
maximum:
|
|
2398
|
+
maximum: n.maxLength.value,
|
|
2386
2399
|
type: "array",
|
|
2387
2400
|
inclusive: !0,
|
|
2388
2401
|
exact: !1,
|
|
2389
|
-
message:
|
|
2402
|
+
message: n.maxLength.message
|
|
2390
2403
|
}), s.dirty()), t.common.async)
|
|
2391
|
-
return Promise.all([...t.data].map((i, o) =>
|
|
2392
|
-
const a = [...t.data].map((i, o) =>
|
|
2404
|
+
return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new re(t, i, t.path, o)))).then((i) => Z.mergeArray(s, i));
|
|
2405
|
+
const a = [...t.data].map((i, o) => n.type._parseSync(new re(t, i, t.path, o)));
|
|
2393
2406
|
return Z.mergeArray(s, a);
|
|
2394
2407
|
}
|
|
2395
2408
|
get element() {
|
|
@@ -2414,26 +2427,26 @@ class G extends w {
|
|
|
2414
2427
|
return this.min(1, e);
|
|
2415
2428
|
}
|
|
2416
2429
|
}
|
|
2417
|
-
G.create = (
|
|
2418
|
-
type:
|
|
2430
|
+
G.create = (r, e) => new G(d({
|
|
2431
|
+
type: r,
|
|
2419
2432
|
minLength: null,
|
|
2420
2433
|
maxLength: null,
|
|
2421
2434
|
exactLength: null,
|
|
2422
|
-
typeName:
|
|
2435
|
+
typeName: v.ZodArray
|
|
2423
2436
|
}, b(e)));
|
|
2424
|
-
function xe(
|
|
2425
|
-
if (
|
|
2437
|
+
function xe(r) {
|
|
2438
|
+
if (r instanceof S) {
|
|
2426
2439
|
const e = {};
|
|
2427
|
-
for (const t in
|
|
2428
|
-
const s =
|
|
2440
|
+
for (const t in r.shape) {
|
|
2441
|
+
const s = r.shape[t];
|
|
2429
2442
|
e[t] = te.create(xe(s));
|
|
2430
2443
|
}
|
|
2431
|
-
return new S(y(d({},
|
|
2444
|
+
return new S(y(d({}, r._def), {
|
|
2432
2445
|
shape: () => e
|
|
2433
2446
|
}));
|
|
2434
|
-
} else return
|
|
2435
|
-
type: xe(
|
|
2436
|
-
})) :
|
|
2447
|
+
} else return r instanceof G ? new G(y(d({}, r._def), {
|
|
2448
|
+
type: xe(r.element)
|
|
2449
|
+
})) : r instanceof te ? te.create(xe(r.unwrap())) : r instanceof me ? me.create(xe(r.unwrap())) : r instanceof se ? se.create(r.items.map((e) => xe(e))) : r;
|
|
2437
2450
|
}
|
|
2438
2451
|
class S extends w {
|
|
2439
2452
|
constructor() {
|
|
@@ -2452,19 +2465,19 @@ class S extends w {
|
|
|
2452
2465
|
code: l.invalid_type,
|
|
2453
2466
|
expected: p.object,
|
|
2454
2467
|
received: u.parsedType
|
|
2455
|
-
}),
|
|
2468
|
+
}), _;
|
|
2456
2469
|
}
|
|
2457
|
-
const { status: s, ctx:
|
|
2470
|
+
const { status: s, ctx: n } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
|
|
2458
2471
|
if (!(this._def.catchall instanceof ce && this._def.unknownKeys === "strip"))
|
|
2459
|
-
for (const u in
|
|
2472
|
+
for (const u in n.data)
|
|
2460
2473
|
i.includes(u) || o.push(u);
|
|
2461
2474
|
const c = [];
|
|
2462
2475
|
for (const u of i) {
|
|
2463
|
-
const f = a[u],
|
|
2476
|
+
const f = a[u], g = n.data[u];
|
|
2464
2477
|
c.push({
|
|
2465
2478
|
key: { status: "valid", value: u },
|
|
2466
|
-
value: f._parse(new
|
|
2467
|
-
alwaysSet: u in
|
|
2479
|
+
value: f._parse(new re(n, g, n.path, u)),
|
|
2480
|
+
alwaysSet: u in n.data
|
|
2468
2481
|
});
|
|
2469
2482
|
}
|
|
2470
2483
|
if (this._def.catchall instanceof ce) {
|
|
@@ -2473,10 +2486,10 @@ class S extends w {
|
|
|
2473
2486
|
for (const f of o)
|
|
2474
2487
|
c.push({
|
|
2475
2488
|
key: { status: "valid", value: f },
|
|
2476
|
-
value: { status: "valid", value:
|
|
2489
|
+
value: { status: "valid", value: n.data[f] }
|
|
2477
2490
|
});
|
|
2478
2491
|
else if (u === "strict")
|
|
2479
|
-
o.length > 0 && (h(
|
|
2492
|
+
o.length > 0 && (h(n, {
|
|
2480
2493
|
code: l.unrecognized_keys,
|
|
2481
2494
|
keys: o
|
|
2482
2495
|
}), s.dirty());
|
|
@@ -2484,24 +2497,24 @@ class S extends w {
|
|
|
2484
2497
|
} else {
|
|
2485
2498
|
const u = this._def.catchall;
|
|
2486
2499
|
for (const f of o) {
|
|
2487
|
-
const
|
|
2500
|
+
const g = n.data[f];
|
|
2488
2501
|
c.push({
|
|
2489
2502
|
key: { status: "valid", value: f },
|
|
2490
2503
|
value: u._parse(
|
|
2491
|
-
new
|
|
2504
|
+
new re(n, g, n.path, f)
|
|
2492
2505
|
//, ctx.child(key), value, getParsedType(value)
|
|
2493
2506
|
),
|
|
2494
|
-
alwaysSet: f in
|
|
2507
|
+
alwaysSet: f in n.data
|
|
2495
2508
|
});
|
|
2496
2509
|
}
|
|
2497
2510
|
}
|
|
2498
|
-
return
|
|
2511
|
+
return n.common.async ? Promise.resolve().then(() => M(this, null, function* () {
|
|
2499
2512
|
const u = [];
|
|
2500
2513
|
for (const f of c) {
|
|
2501
|
-
const
|
|
2514
|
+
const g = yield f.key, O = yield f.value;
|
|
2502
2515
|
u.push({
|
|
2503
|
-
key:
|
|
2504
|
-
value:
|
|
2516
|
+
key: g,
|
|
2517
|
+
value: O,
|
|
2505
2518
|
alwaysSet: f.alwaysSet
|
|
2506
2519
|
});
|
|
2507
2520
|
}
|
|
@@ -2516,8 +2529,8 @@ class S extends w {
|
|
|
2516
2529
|
unknownKeys: "strict"
|
|
2517
2530
|
}), e !== void 0 ? {
|
|
2518
2531
|
errorMap: (t, s) => {
|
|
2519
|
-
var
|
|
2520
|
-
const c = (i = (a = (
|
|
2532
|
+
var n, a, i, o;
|
|
2533
|
+
const c = (i = (a = (n = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(n, t, s).message) !== null && i !== void 0 ? i : s.defaultError;
|
|
2521
2534
|
return t.code === "unrecognized_keys" ? {
|
|
2522
2535
|
message: (o = m.errToObj(e).message) !== null && o !== void 0 ? o : c
|
|
2523
2536
|
} : {
|
|
@@ -2568,7 +2581,7 @@ class S extends w {
|
|
|
2568
2581
|
unknownKeys: e._def.unknownKeys,
|
|
2569
2582
|
catchall: e._def.catchall,
|
|
2570
2583
|
shape: () => d(d({}, this._def.shape()), e._def.shape()),
|
|
2571
|
-
typeName:
|
|
2584
|
+
typeName: v.ZodObject
|
|
2572
2585
|
});
|
|
2573
2586
|
}
|
|
2574
2587
|
// merge<
|
|
@@ -2660,8 +2673,8 @@ class S extends w {
|
|
|
2660
2673
|
partial(e) {
|
|
2661
2674
|
const t = {};
|
|
2662
2675
|
return x.objectKeys(this.shape).forEach((s) => {
|
|
2663
|
-
const
|
|
2664
|
-
e && !e[s] ? t[s] =
|
|
2676
|
+
const n = this.shape[s];
|
|
2677
|
+
e && !e[s] ? t[s] = n : t[s] = n.optional();
|
|
2665
2678
|
}), new S(y(d({}, this._def), {
|
|
2666
2679
|
shape: () => t
|
|
2667
2680
|
}));
|
|
@@ -2682,31 +2695,31 @@ class S extends w {
|
|
|
2682
2695
|
}));
|
|
2683
2696
|
}
|
|
2684
2697
|
keyof() {
|
|
2685
|
-
return
|
|
2698
|
+
return fr(x.objectKeys(this.shape));
|
|
2686
2699
|
}
|
|
2687
2700
|
}
|
|
2688
|
-
S.create = (
|
|
2689
|
-
shape: () =>
|
|
2701
|
+
S.create = (r, e) => new S(d({
|
|
2702
|
+
shape: () => r,
|
|
2690
2703
|
unknownKeys: "strip",
|
|
2691
2704
|
catchall: ce.create(),
|
|
2692
|
-
typeName:
|
|
2705
|
+
typeName: v.ZodObject
|
|
2693
2706
|
}, b(e)));
|
|
2694
|
-
S.strictCreate = (
|
|
2695
|
-
shape: () =>
|
|
2707
|
+
S.strictCreate = (r, e) => new S(d({
|
|
2708
|
+
shape: () => r,
|
|
2696
2709
|
unknownKeys: "strict",
|
|
2697
2710
|
catchall: ce.create(),
|
|
2698
|
-
typeName:
|
|
2711
|
+
typeName: v.ZodObject
|
|
2699
2712
|
}, b(e)));
|
|
2700
|
-
S.lazycreate = (
|
|
2701
|
-
shape:
|
|
2713
|
+
S.lazycreate = (r, e) => new S(d({
|
|
2714
|
+
shape: r,
|
|
2702
2715
|
unknownKeys: "strip",
|
|
2703
2716
|
catchall: ce.create(),
|
|
2704
|
-
typeName:
|
|
2717
|
+
typeName: v.ZodObject
|
|
2705
2718
|
}, b(e)));
|
|
2706
2719
|
class De extends w {
|
|
2707
2720
|
_parse(e) {
|
|
2708
2721
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
2709
|
-
function
|
|
2722
|
+
function n(a) {
|
|
2710
2723
|
for (const o of a)
|
|
2711
2724
|
if (o.result.status === "valid")
|
|
2712
2725
|
return o.result;
|
|
@@ -2717,7 +2730,7 @@ class De extends w {
|
|
|
2717
2730
|
return h(t, {
|
|
2718
2731
|
code: l.invalid_union,
|
|
2719
2732
|
unionErrors: i
|
|
2720
|
-
}),
|
|
2733
|
+
}), _;
|
|
2721
2734
|
}
|
|
2722
2735
|
if (t.common.async)
|
|
2723
2736
|
return Promise.all(s.map((a) => M(this, null, function* () {
|
|
@@ -2735,7 +2748,7 @@ class De extends w {
|
|
|
2735
2748
|
}),
|
|
2736
2749
|
ctx: i
|
|
2737
2750
|
};
|
|
2738
|
-
}))).then(
|
|
2751
|
+
}))).then(n);
|
|
2739
2752
|
{
|
|
2740
2753
|
let a;
|
|
2741
2754
|
const i = [];
|
|
@@ -2760,18 +2773,18 @@ class De extends w {
|
|
|
2760
2773
|
return h(t, {
|
|
2761
2774
|
code: l.invalid_union,
|
|
2762
2775
|
unionErrors: o
|
|
2763
|
-
}),
|
|
2776
|
+
}), _;
|
|
2764
2777
|
}
|
|
2765
2778
|
}
|
|
2766
2779
|
get options() {
|
|
2767
2780
|
return this._def.options;
|
|
2768
2781
|
}
|
|
2769
2782
|
}
|
|
2770
|
-
De.create = (
|
|
2771
|
-
options:
|
|
2772
|
-
typeName:
|
|
2783
|
+
De.create = (r, e) => new De(d({
|
|
2784
|
+
options: r,
|
|
2785
|
+
typeName: v.ZodUnion
|
|
2773
2786
|
}, b(e)));
|
|
2774
|
-
const ie = (
|
|
2787
|
+
const ie = (r) => r instanceof ze ? ie(r.schema) : r instanceof K ? ie(r.innerType()) : r instanceof We ? [r.value] : r instanceof pe ? r.options : r instanceof Be ? x.objectValues(r.enum) : r instanceof qe ? ie(r._def.innerType) : r instanceof Fe ? [void 0] : r instanceof Ve ? [null] : r instanceof te ? [void 0, ...ie(r.unwrap())] : r instanceof me ? [null, ...ie(r.unwrap())] : r instanceof Zt || r instanceof Je ? ie(r.unwrap()) : r instanceof He ? ie(r._def.innerType) : [];
|
|
2775
2788
|
class dt extends w {
|
|
2776
2789
|
_parse(e) {
|
|
2777
2790
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -2780,8 +2793,8 @@ class dt extends w {
|
|
|
2780
2793
|
code: l.invalid_type,
|
|
2781
2794
|
expected: p.object,
|
|
2782
2795
|
received: t.parsedType
|
|
2783
|
-
}),
|
|
2784
|
-
const s = this.discriminator,
|
|
2796
|
+
}), _;
|
|
2797
|
+
const s = this.discriminator, n = t.data[s], a = this.optionsMap.get(n);
|
|
2785
2798
|
return a ? t.common.async ? a._parseAsync({
|
|
2786
2799
|
data: t.data,
|
|
2787
2800
|
path: t.path,
|
|
@@ -2794,7 +2807,7 @@ class dt extends w {
|
|
|
2794
2807
|
code: l.invalid_union_discriminator,
|
|
2795
2808
|
options: Array.from(this.optionsMap.keys()),
|
|
2796
2809
|
path: [s]
|
|
2797
|
-
}),
|
|
2810
|
+
}), _);
|
|
2798
2811
|
}
|
|
2799
2812
|
get discriminator() {
|
|
2800
2813
|
return this._def.discriminator;
|
|
@@ -2814,60 +2827,60 @@ class dt extends w {
|
|
|
2814
2827
|
* @param params
|
|
2815
2828
|
*/
|
|
2816
2829
|
static create(e, t, s) {
|
|
2817
|
-
const
|
|
2830
|
+
const n = /* @__PURE__ */ new Map();
|
|
2818
2831
|
for (const a of t) {
|
|
2819
2832
|
const i = ie(a.shape[e]);
|
|
2820
2833
|
if (!i.length)
|
|
2821
2834
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
2822
2835
|
for (const o of i) {
|
|
2823
|
-
if (
|
|
2836
|
+
if (n.has(o))
|
|
2824
2837
|
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
|
|
2825
|
-
|
|
2838
|
+
n.set(o, a);
|
|
2826
2839
|
}
|
|
2827
2840
|
}
|
|
2828
2841
|
return new dt(d({
|
|
2829
|
-
typeName:
|
|
2842
|
+
typeName: v.ZodDiscriminatedUnion,
|
|
2830
2843
|
discriminator: e,
|
|
2831
2844
|
options: t,
|
|
2832
|
-
optionsMap:
|
|
2845
|
+
optionsMap: n
|
|
2833
2846
|
}, b(s)));
|
|
2834
2847
|
}
|
|
2835
2848
|
}
|
|
2836
|
-
function Ct(
|
|
2837
|
-
const t = oe(
|
|
2838
|
-
if (
|
|
2839
|
-
return { valid: !0, data:
|
|
2849
|
+
function Ct(r, e) {
|
|
2850
|
+
const t = oe(r), s = oe(e);
|
|
2851
|
+
if (r === e)
|
|
2852
|
+
return { valid: !0, data: r };
|
|
2840
2853
|
if (t === p.object && s === p.object) {
|
|
2841
|
-
const
|
|
2854
|
+
const n = x.objectKeys(e), a = x.objectKeys(r).filter((o) => n.indexOf(o) !== -1), i = d(d({}, r), e);
|
|
2842
2855
|
for (const o of a) {
|
|
2843
|
-
const c = Ct(
|
|
2856
|
+
const c = Ct(r[o], e[o]);
|
|
2844
2857
|
if (!c.valid)
|
|
2845
2858
|
return { valid: !1 };
|
|
2846
2859
|
i[o] = c.data;
|
|
2847
2860
|
}
|
|
2848
2861
|
return { valid: !0, data: i };
|
|
2849
2862
|
} else if (t === p.array && s === p.array) {
|
|
2850
|
-
if (
|
|
2863
|
+
if (r.length !== e.length)
|
|
2851
2864
|
return { valid: !1 };
|
|
2852
|
-
const
|
|
2853
|
-
for (let a = 0; a <
|
|
2854
|
-
const i =
|
|
2865
|
+
const n = [];
|
|
2866
|
+
for (let a = 0; a < r.length; a++) {
|
|
2867
|
+
const i = r[a], o = e[a], c = Ct(i, o);
|
|
2855
2868
|
if (!c.valid)
|
|
2856
2869
|
return { valid: !1 };
|
|
2857
|
-
|
|
2870
|
+
n.push(c.data);
|
|
2858
2871
|
}
|
|
2859
|
-
return { valid: !0, data:
|
|
2860
|
-
} else return t === p.date && s === p.date && +
|
|
2872
|
+
return { valid: !0, data: n };
|
|
2873
|
+
} else return t === p.date && s === p.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
|
|
2861
2874
|
}
|
|
2862
2875
|
class Le extends w {
|
|
2863
2876
|
_parse(e) {
|
|
2864
|
-
const { status: t, ctx: s } = this._processInputParams(e),
|
|
2865
|
-
if (
|
|
2866
|
-
return
|
|
2877
|
+
const { status: t, ctx: s } = this._processInputParams(e), n = (a, i) => {
|
|
2878
|
+
if (At(a) || At(i))
|
|
2879
|
+
return _;
|
|
2867
2880
|
const o = Ct(a.value, i.value);
|
|
2868
2881
|
return o.valid ? ((Ot(a) || Ot(i)) && t.dirty(), { status: t.value, value: o.data }) : (h(s, {
|
|
2869
2882
|
code: l.invalid_intersection_types
|
|
2870
|
-
}),
|
|
2883
|
+
}), _);
|
|
2871
2884
|
};
|
|
2872
2885
|
return s.common.async ? Promise.all([
|
|
2873
2886
|
this._def.left._parseAsync({
|
|
@@ -2880,7 +2893,7 @@ class Le extends w {
|
|
|
2880
2893
|
path: s.path,
|
|
2881
2894
|
parent: s
|
|
2882
2895
|
})
|
|
2883
|
-
]).then(([a, i]) =>
|
|
2896
|
+
]).then(([a, i]) => n(a, i)) : n(this._def.left._parseSync({
|
|
2884
2897
|
data: s.data,
|
|
2885
2898
|
path: s.path,
|
|
2886
2899
|
parent: s
|
|
@@ -2891,10 +2904,10 @@ class Le extends w {
|
|
|
2891
2904
|
}));
|
|
2892
2905
|
}
|
|
2893
2906
|
}
|
|
2894
|
-
Le.create = (
|
|
2895
|
-
left:
|
|
2907
|
+
Le.create = (r, e, t) => new Le(d({
|
|
2908
|
+
left: r,
|
|
2896
2909
|
right: e,
|
|
2897
|
-
typeName:
|
|
2910
|
+
typeName: v.ZodIntersection
|
|
2898
2911
|
}, b(t)));
|
|
2899
2912
|
class se extends w {
|
|
2900
2913
|
_parse(e) {
|
|
@@ -2904,7 +2917,7 @@ class se extends w {
|
|
|
2904
2917
|
code: l.invalid_type,
|
|
2905
2918
|
expected: p.array,
|
|
2906
2919
|
received: s.parsedType
|
|
2907
|
-
}),
|
|
2920
|
+
}), _;
|
|
2908
2921
|
if (s.data.length < this._def.items.length)
|
|
2909
2922
|
return h(s, {
|
|
2910
2923
|
code: l.too_small,
|
|
@@ -2912,7 +2925,7 @@ class se extends w {
|
|
|
2912
2925
|
inclusive: !0,
|
|
2913
2926
|
exact: !1,
|
|
2914
2927
|
type: "array"
|
|
2915
|
-
}),
|
|
2928
|
+
}), _;
|
|
2916
2929
|
!this._def.rest && s.data.length > this._def.items.length && (h(s, {
|
|
2917
2930
|
code: l.too_big,
|
|
2918
2931
|
maximum: this._def.items.length,
|
|
@@ -2922,7 +2935,7 @@ class se extends w {
|
|
|
2922
2935
|
}), t.dirty());
|
|
2923
2936
|
const a = [...s.data].map((i, o) => {
|
|
2924
2937
|
const c = this._def.items[o] || this._def.rest;
|
|
2925
|
-
return c ? c._parse(new
|
|
2938
|
+
return c ? c._parse(new re(s, i, s.path, o)) : null;
|
|
2926
2939
|
}).filter((i) => !!i);
|
|
2927
2940
|
return s.common.async ? Promise.all(a).then((i) => Z.mergeArray(t, i)) : Z.mergeArray(t, a);
|
|
2928
2941
|
}
|
|
@@ -2935,12 +2948,12 @@ class se extends w {
|
|
|
2935
2948
|
}));
|
|
2936
2949
|
}
|
|
2937
2950
|
}
|
|
2938
|
-
se.create = (
|
|
2939
|
-
if (!Array.isArray(
|
|
2951
|
+
se.create = (r, e) => {
|
|
2952
|
+
if (!Array.isArray(r))
|
|
2940
2953
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2941
2954
|
return new se(d({
|
|
2942
|
-
items:
|
|
2943
|
-
typeName:
|
|
2955
|
+
items: r,
|
|
2956
|
+
typeName: v.ZodTuple,
|
|
2944
2957
|
rest: null
|
|
2945
2958
|
}, b(e)));
|
|
2946
2959
|
};
|
|
@@ -2958,15 +2971,15 @@ class Ue extends w {
|
|
|
2958
2971
|
code: l.invalid_type,
|
|
2959
2972
|
expected: p.object,
|
|
2960
2973
|
received: s.parsedType
|
|
2961
|
-
}),
|
|
2962
|
-
const
|
|
2974
|
+
}), _;
|
|
2975
|
+
const n = [], a = this._def.keyType, i = this._def.valueType;
|
|
2963
2976
|
for (const o in s.data)
|
|
2964
|
-
|
|
2965
|
-
key: a._parse(new
|
|
2966
|
-
value: i._parse(new
|
|
2977
|
+
n.push({
|
|
2978
|
+
key: a._parse(new re(s, o, s.path, o)),
|
|
2979
|
+
value: i._parse(new re(s, s.data[o], s.path, o)),
|
|
2967
2980
|
alwaysSet: o in s.data
|
|
2968
2981
|
});
|
|
2969
|
-
return s.common.async ? Z.mergeObjectAsync(t,
|
|
2982
|
+
return s.common.async ? Z.mergeObjectAsync(t, n) : Z.mergeObjectSync(t, n);
|
|
2970
2983
|
}
|
|
2971
2984
|
get element() {
|
|
2972
2985
|
return this._def.valueType;
|
|
@@ -2975,11 +2988,11 @@ class Ue extends w {
|
|
|
2975
2988
|
return t instanceof w ? new Ue(d({
|
|
2976
2989
|
keyType: e,
|
|
2977
2990
|
valueType: t,
|
|
2978
|
-
typeName:
|
|
2991
|
+
typeName: v.ZodRecord
|
|
2979
2992
|
}, b(s))) : new Ue(d({
|
|
2980
2993
|
keyType: J.create(),
|
|
2981
2994
|
valueType: e,
|
|
2982
|
-
typeName:
|
|
2995
|
+
typeName: v.ZodRecord
|
|
2983
2996
|
}, b(t)));
|
|
2984
2997
|
}
|
|
2985
2998
|
}
|
|
@@ -2997,10 +3010,10 @@ class it extends w {
|
|
|
2997
3010
|
code: l.invalid_type,
|
|
2998
3011
|
expected: p.map,
|
|
2999
3012
|
received: s.parsedType
|
|
3000
|
-
}),
|
|
3001
|
-
const
|
|
3002
|
-
key:
|
|
3003
|
-
value: a._parse(new
|
|
3013
|
+
}), _;
|
|
3014
|
+
const n = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], u) => ({
|
|
3015
|
+
key: n._parse(new re(s, o, s.path, [u, "key"])),
|
|
3016
|
+
value: a._parse(new re(s, c, s.path, [u, "value"]))
|
|
3004
3017
|
}));
|
|
3005
3018
|
if (s.common.async) {
|
|
3006
3019
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -3008,7 +3021,7 @@ class it extends w {
|
|
|
3008
3021
|
for (const c of i) {
|
|
3009
3022
|
const u = yield c.key, f = yield c.value;
|
|
3010
3023
|
if (u.status === "aborted" || f.status === "aborted")
|
|
3011
|
-
return
|
|
3024
|
+
return _;
|
|
3012
3025
|
(u.status === "dirty" || f.status === "dirty") && t.dirty(), o.set(u.value, f.value);
|
|
3013
3026
|
}
|
|
3014
3027
|
return { status: t.value, value: o };
|
|
@@ -3018,17 +3031,17 @@ class it extends w {
|
|
|
3018
3031
|
for (const c of i) {
|
|
3019
3032
|
const u = c.key, f = c.value;
|
|
3020
3033
|
if (u.status === "aborted" || f.status === "aborted")
|
|
3021
|
-
return
|
|
3034
|
+
return _;
|
|
3022
3035
|
(u.status === "dirty" || f.status === "dirty") && t.dirty(), o.set(u.value, f.value);
|
|
3023
3036
|
}
|
|
3024
3037
|
return { status: t.value, value: o };
|
|
3025
3038
|
}
|
|
3026
3039
|
}
|
|
3027
3040
|
}
|
|
3028
|
-
it.create = (
|
|
3041
|
+
it.create = (r, e, t) => new it(d({
|
|
3029
3042
|
valueType: e,
|
|
3030
|
-
keyType:
|
|
3031
|
-
typeName:
|
|
3043
|
+
keyType: r,
|
|
3044
|
+
typeName: v.ZodMap
|
|
3032
3045
|
}, b(t)));
|
|
3033
3046
|
class we extends w {
|
|
3034
3047
|
_parse(e) {
|
|
@@ -3038,34 +3051,34 @@ class we extends w {
|
|
|
3038
3051
|
code: l.invalid_type,
|
|
3039
3052
|
expected: p.set,
|
|
3040
3053
|
received: s.parsedType
|
|
3041
|
-
}),
|
|
3042
|
-
const
|
|
3043
|
-
|
|
3054
|
+
}), _;
|
|
3055
|
+
const n = this._def;
|
|
3056
|
+
n.minSize !== null && s.data.size < n.minSize.value && (h(s, {
|
|
3044
3057
|
code: l.too_small,
|
|
3045
|
-
minimum:
|
|
3058
|
+
minimum: n.minSize.value,
|
|
3046
3059
|
type: "set",
|
|
3047
3060
|
inclusive: !0,
|
|
3048
3061
|
exact: !1,
|
|
3049
|
-
message:
|
|
3050
|
-
}), t.dirty()),
|
|
3062
|
+
message: n.minSize.message
|
|
3063
|
+
}), t.dirty()), n.maxSize !== null && s.data.size > n.maxSize.value && (h(s, {
|
|
3051
3064
|
code: l.too_big,
|
|
3052
|
-
maximum:
|
|
3065
|
+
maximum: n.maxSize.value,
|
|
3053
3066
|
type: "set",
|
|
3054
3067
|
inclusive: !0,
|
|
3055
3068
|
exact: !1,
|
|
3056
|
-
message:
|
|
3069
|
+
message: n.maxSize.message
|
|
3057
3070
|
}), t.dirty());
|
|
3058
3071
|
const a = this._def.valueType;
|
|
3059
3072
|
function i(c) {
|
|
3060
3073
|
const u = /* @__PURE__ */ new Set();
|
|
3061
3074
|
for (const f of c) {
|
|
3062
3075
|
if (f.status === "aborted")
|
|
3063
|
-
return
|
|
3076
|
+
return _;
|
|
3064
3077
|
f.status === "dirty" && t.dirty(), u.add(f.value);
|
|
3065
3078
|
}
|
|
3066
3079
|
return { status: t.value, value: u };
|
|
3067
3080
|
}
|
|
3068
|
-
const o = [...s.data.values()].map((c, u) => a._parse(new
|
|
3081
|
+
const o = [...s.data.values()].map((c, u) => a._parse(new re(s, c, s.path, u)));
|
|
3069
3082
|
return s.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
|
|
3070
3083
|
}
|
|
3071
3084
|
min(e, t) {
|
|
@@ -3085,11 +3098,11 @@ class we extends w {
|
|
|
3085
3098
|
return this.min(1, e);
|
|
3086
3099
|
}
|
|
3087
3100
|
}
|
|
3088
|
-
we.create = (
|
|
3089
|
-
valueType:
|
|
3101
|
+
we.create = (r, e) => new we(d({
|
|
3102
|
+
valueType: r,
|
|
3090
3103
|
minSize: null,
|
|
3091
3104
|
maxSize: null,
|
|
3092
|
-
typeName:
|
|
3105
|
+
typeName: v.ZodSet
|
|
3093
3106
|
}, b(e)));
|
|
3094
3107
|
class Te extends w {
|
|
3095
3108
|
constructor() {
|
|
@@ -3102,16 +3115,16 @@ class Te extends w {
|
|
|
3102
3115
|
code: l.invalid_type,
|
|
3103
3116
|
expected: p.function,
|
|
3104
3117
|
received: t.parsedType
|
|
3105
|
-
}),
|
|
3118
|
+
}), _;
|
|
3106
3119
|
function s(o, c) {
|
|
3107
|
-
return
|
|
3120
|
+
return rt({
|
|
3108
3121
|
data: o,
|
|
3109
3122
|
path: t.path,
|
|
3110
3123
|
errorMaps: [
|
|
3111
3124
|
t.common.contextualErrorMap,
|
|
3112
3125
|
t.schemaErrorMap,
|
|
3113
3126
|
tt(),
|
|
3114
|
-
|
|
3127
|
+
Ee
|
|
3115
3128
|
].filter((u) => !!u),
|
|
3116
3129
|
issueData: {
|
|
3117
3130
|
code: l.invalid_arguments,
|
|
@@ -3119,15 +3132,15 @@ class Te extends w {
|
|
|
3119
3132
|
}
|
|
3120
3133
|
});
|
|
3121
3134
|
}
|
|
3122
|
-
function
|
|
3123
|
-
return
|
|
3135
|
+
function n(o, c) {
|
|
3136
|
+
return rt({
|
|
3124
3137
|
data: o,
|
|
3125
3138
|
path: t.path,
|
|
3126
3139
|
errorMaps: [
|
|
3127
3140
|
t.common.contextualErrorMap,
|
|
3128
3141
|
t.schemaErrorMap,
|
|
3129
3142
|
tt(),
|
|
3130
|
-
|
|
3143
|
+
Ee
|
|
3131
3144
|
].filter((u) => !!u),
|
|
3132
3145
|
issueData: {
|
|
3133
3146
|
code: l.invalid_return_type,
|
|
@@ -3140,11 +3153,11 @@ class Te extends w {
|
|
|
3140
3153
|
const o = this;
|
|
3141
3154
|
return $(function(...c) {
|
|
3142
3155
|
return M(this, null, function* () {
|
|
3143
|
-
const u = new z([]), f = yield o._def.args.parseAsync(c, a).catch((
|
|
3144
|
-
throw u.addIssue(s(c,
|
|
3145
|
-
}),
|
|
3146
|
-
return yield o._def.returns._def.type.parseAsync(
|
|
3147
|
-
throw u.addIssue(
|
|
3156
|
+
const u = new z([]), f = yield o._def.args.parseAsync(c, a).catch((C) => {
|
|
3157
|
+
throw u.addIssue(s(c, C)), u;
|
|
3158
|
+
}), g = yield Reflect.apply(i, this, f);
|
|
3159
|
+
return yield o._def.returns._def.type.parseAsync(g, a).catch((C) => {
|
|
3160
|
+
throw u.addIssue(n(g, C)), u;
|
|
3148
3161
|
});
|
|
3149
3162
|
});
|
|
3150
3163
|
});
|
|
@@ -3154,10 +3167,10 @@ class Te extends w {
|
|
|
3154
3167
|
const u = o._def.args.safeParse(c, a);
|
|
3155
3168
|
if (!u.success)
|
|
3156
3169
|
throw new z([s(c, u.error)]);
|
|
3157
|
-
const f = Reflect.apply(i, this, u.data),
|
|
3158
|
-
if (!
|
|
3159
|
-
throw new z([
|
|
3160
|
-
return
|
|
3170
|
+
const f = Reflect.apply(i, this, u.data), g = o._def.returns.safeParse(f, a);
|
|
3171
|
+
if (!g.success)
|
|
3172
|
+
throw new z([n(f, g.error)]);
|
|
3173
|
+
return g.data;
|
|
3161
3174
|
});
|
|
3162
3175
|
}
|
|
3163
3176
|
}
|
|
@@ -3187,7 +3200,7 @@ class Te extends w {
|
|
|
3187
3200
|
return new Te(d({
|
|
3188
3201
|
args: e || se.create([]).rest(ve.create()),
|
|
3189
3202
|
returns: t || ve.create(),
|
|
3190
|
-
typeName:
|
|
3203
|
+
typeName: v.ZodFunction
|
|
3191
3204
|
}, b(s)));
|
|
3192
3205
|
}
|
|
3193
3206
|
}
|
|
@@ -3200,9 +3213,9 @@ class ze extends w {
|
|
|
3200
3213
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
3201
3214
|
}
|
|
3202
3215
|
}
|
|
3203
|
-
ze.create = (
|
|
3204
|
-
getter:
|
|
3205
|
-
typeName:
|
|
3216
|
+
ze.create = (r, e) => new ze(d({
|
|
3217
|
+
getter: r,
|
|
3218
|
+
typeName: v.ZodLazy
|
|
3206
3219
|
}, b(e)));
|
|
3207
3220
|
class We extends w {
|
|
3208
3221
|
_parse(e) {
|
|
@@ -3212,7 +3225,7 @@ class We extends w {
|
|
|
3212
3225
|
received: t.data,
|
|
3213
3226
|
code: l.invalid_literal,
|
|
3214
3227
|
expected: this._def.value
|
|
3215
|
-
}),
|
|
3228
|
+
}), _;
|
|
3216
3229
|
}
|
|
3217
3230
|
return { status: "valid", value: e.data };
|
|
3218
3231
|
}
|
|
@@ -3220,14 +3233,14 @@ class We extends w {
|
|
|
3220
3233
|
return this._def.value;
|
|
3221
3234
|
}
|
|
3222
3235
|
}
|
|
3223
|
-
We.create = (
|
|
3224
|
-
value:
|
|
3225
|
-
typeName:
|
|
3236
|
+
We.create = (r, e) => new We(d({
|
|
3237
|
+
value: r,
|
|
3238
|
+
typeName: v.ZodLiteral
|
|
3226
3239
|
}, b(e)));
|
|
3227
|
-
function
|
|
3240
|
+
function fr(r, e) {
|
|
3228
3241
|
return new pe(d({
|
|
3229
|
-
values:
|
|
3230
|
-
typeName:
|
|
3242
|
+
values: r,
|
|
3243
|
+
typeName: v.ZodEnum
|
|
3231
3244
|
}, b(e)));
|
|
3232
3245
|
}
|
|
3233
3246
|
class pe extends w {
|
|
@@ -3241,15 +3254,15 @@ class pe extends w {
|
|
|
3241
3254
|
expected: x.joinValues(s),
|
|
3242
3255
|
received: t.parsedType,
|
|
3243
3256
|
code: l.invalid_type
|
|
3244
|
-
}),
|
|
3257
|
+
}), _;
|
|
3245
3258
|
}
|
|
3246
|
-
if (st(this, Re) ||
|
|
3259
|
+
if (st(this, Re) || cr(this, Re, new Set(this._def.values)), !st(this, Re).has(e.data)) {
|
|
3247
3260
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
3248
3261
|
return h(t, {
|
|
3249
3262
|
received: t.data,
|
|
3250
3263
|
code: l.invalid_enum_value,
|
|
3251
3264
|
options: s
|
|
3252
|
-
}),
|
|
3265
|
+
}), _;
|
|
3253
3266
|
}
|
|
3254
3267
|
return $(e.data);
|
|
3255
3268
|
}
|
|
@@ -3282,7 +3295,7 @@ class pe extends w {
|
|
|
3282
3295
|
}
|
|
3283
3296
|
}
|
|
3284
3297
|
Re = /* @__PURE__ */ new WeakMap();
|
|
3285
|
-
pe.create =
|
|
3298
|
+
pe.create = fr;
|
|
3286
3299
|
class Be extends w {
|
|
3287
3300
|
constructor() {
|
|
3288
3301
|
super(...arguments), Me.set(this, void 0);
|
|
@@ -3290,20 +3303,20 @@ class Be extends w {
|
|
|
3290
3303
|
_parse(e) {
|
|
3291
3304
|
const t = x.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
3292
3305
|
if (s.parsedType !== p.string && s.parsedType !== p.number) {
|
|
3293
|
-
const
|
|
3306
|
+
const n = x.objectValues(t);
|
|
3294
3307
|
return h(s, {
|
|
3295
|
-
expected: x.joinValues(
|
|
3308
|
+
expected: x.joinValues(n),
|
|
3296
3309
|
received: s.parsedType,
|
|
3297
3310
|
code: l.invalid_type
|
|
3298
|
-
}),
|
|
3311
|
+
}), _;
|
|
3299
3312
|
}
|
|
3300
|
-
if (st(this, Me) ||
|
|
3301
|
-
const
|
|
3313
|
+
if (st(this, Me) || cr(this, Me, new Set(x.getValidEnumValues(this._def.values))), !st(this, Me).has(e.data)) {
|
|
3314
|
+
const n = x.objectValues(t);
|
|
3302
3315
|
return h(s, {
|
|
3303
3316
|
received: s.data,
|
|
3304
3317
|
code: l.invalid_enum_value,
|
|
3305
|
-
options:
|
|
3306
|
-
}),
|
|
3318
|
+
options: n
|
|
3319
|
+
}), _;
|
|
3307
3320
|
}
|
|
3308
3321
|
return $(e.data);
|
|
3309
3322
|
}
|
|
@@ -3312,9 +3325,9 @@ class Be extends w {
|
|
|
3312
3325
|
}
|
|
3313
3326
|
}
|
|
3314
3327
|
Me = /* @__PURE__ */ new WeakMap();
|
|
3315
|
-
Be.create = (
|
|
3316
|
-
values:
|
|
3317
|
-
typeName:
|
|
3328
|
+
Be.create = (r, e) => new Be(d({
|
|
3329
|
+
values: r,
|
|
3330
|
+
typeName: v.ZodNativeEnum
|
|
3318
3331
|
}, b(e)));
|
|
3319
3332
|
class Oe extends w {
|
|
3320
3333
|
unwrap() {
|
|
@@ -3327,27 +3340,27 @@ class Oe extends w {
|
|
|
3327
3340
|
code: l.invalid_type,
|
|
3328
3341
|
expected: p.promise,
|
|
3329
3342
|
received: t.parsedType
|
|
3330
|
-
}),
|
|
3343
|
+
}), _;
|
|
3331
3344
|
const s = t.parsedType === p.promise ? t.data : Promise.resolve(t.data);
|
|
3332
|
-
return $(s.then((
|
|
3345
|
+
return $(s.then((n) => this._def.type.parseAsync(n, {
|
|
3333
3346
|
path: t.path,
|
|
3334
3347
|
errorMap: t.common.contextualErrorMap
|
|
3335
3348
|
})));
|
|
3336
3349
|
}
|
|
3337
3350
|
}
|
|
3338
|
-
Oe.create = (
|
|
3339
|
-
type:
|
|
3340
|
-
typeName:
|
|
3351
|
+
Oe.create = (r, e) => new Oe(d({
|
|
3352
|
+
type: r,
|
|
3353
|
+
typeName: v.ZodPromise
|
|
3341
3354
|
}, b(e)));
|
|
3342
3355
|
class K extends w {
|
|
3343
3356
|
innerType() {
|
|
3344
3357
|
return this._def.schema;
|
|
3345
3358
|
}
|
|
3346
3359
|
sourceType() {
|
|
3347
|
-
return this._def.schema._def.typeName ===
|
|
3360
|
+
return this._def.schema._def.typeName === v.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
3348
3361
|
}
|
|
3349
3362
|
_parse(e) {
|
|
3350
|
-
const { status: t, ctx: s } = this._processInputParams(e),
|
|
3363
|
+
const { status: t, ctx: s } = this._processInputParams(e), n = this._def.effect || null, a = {
|
|
3351
3364
|
addIssue: (i) => {
|
|
3352
3365
|
h(s, i), i.fatal ? t.abort() : t.dirty();
|
|
3353
3366
|
},
|
|
@@ -3355,33 +3368,33 @@ class K extends w {
|
|
|
3355
3368
|
return s.path;
|
|
3356
3369
|
}
|
|
3357
3370
|
};
|
|
3358
|
-
if (a.addIssue = a.addIssue.bind(a),
|
|
3359
|
-
const i =
|
|
3371
|
+
if (a.addIssue = a.addIssue.bind(a), n.type === "preprocess") {
|
|
3372
|
+
const i = n.transform(s.data, a);
|
|
3360
3373
|
if (s.common.async)
|
|
3361
3374
|
return Promise.resolve(i).then((o) => M(this, null, function* () {
|
|
3362
3375
|
if (t.value === "aborted")
|
|
3363
|
-
return
|
|
3376
|
+
return _;
|
|
3364
3377
|
const c = yield this._def.schema._parseAsync({
|
|
3365
3378
|
data: o,
|
|
3366
3379
|
path: s.path,
|
|
3367
3380
|
parent: s
|
|
3368
3381
|
});
|
|
3369
|
-
return c.status === "aborted" ?
|
|
3382
|
+
return c.status === "aborted" ? _ : c.status === "dirty" || t.value === "dirty" ? ke(c.value) : c;
|
|
3370
3383
|
}));
|
|
3371
3384
|
{
|
|
3372
3385
|
if (t.value === "aborted")
|
|
3373
|
-
return
|
|
3386
|
+
return _;
|
|
3374
3387
|
const o = this._def.schema._parseSync({
|
|
3375
3388
|
data: i,
|
|
3376
3389
|
path: s.path,
|
|
3377
3390
|
parent: s
|
|
3378
3391
|
});
|
|
3379
|
-
return o.status === "aborted" ?
|
|
3392
|
+
return o.status === "aborted" ? _ : o.status === "dirty" || t.value === "dirty" ? ke(o.value) : o;
|
|
3380
3393
|
}
|
|
3381
3394
|
}
|
|
3382
|
-
if (
|
|
3395
|
+
if (n.type === "refinement") {
|
|
3383
3396
|
const i = (o) => {
|
|
3384
|
-
const c =
|
|
3397
|
+
const c = n.refinement(o, a);
|
|
3385
3398
|
if (s.common.async)
|
|
3386
3399
|
return Promise.resolve(c);
|
|
3387
3400
|
if (c instanceof Promise)
|
|
@@ -3394,11 +3407,11 @@ class K extends w {
|
|
|
3394
3407
|
path: s.path,
|
|
3395
3408
|
parent: s
|
|
3396
3409
|
});
|
|
3397
|
-
return o.status === "aborted" ?
|
|
3410
|
+
return o.status === "aborted" ? _ : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
|
|
3398
3411
|
} else
|
|
3399
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => o.status === "aborted" ?
|
|
3412
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => o.status === "aborted" ? _ : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
|
|
3400
3413
|
}
|
|
3401
|
-
if (
|
|
3414
|
+
if (n.type === "transform")
|
|
3402
3415
|
if (s.common.async === !1) {
|
|
3403
3416
|
const i = this._def.schema._parseSync({
|
|
3404
3417
|
data: s.data,
|
|
@@ -3407,24 +3420,24 @@ class K extends w {
|
|
|
3407
3420
|
});
|
|
3408
3421
|
if (!_e(i))
|
|
3409
3422
|
return i;
|
|
3410
|
-
const o =
|
|
3423
|
+
const o = n.transform(i.value, a);
|
|
3411
3424
|
if (o instanceof Promise)
|
|
3412
3425
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
3413
3426
|
return { status: t.value, value: o };
|
|
3414
3427
|
} else
|
|
3415
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => _e(i) ? Promise.resolve(
|
|
3416
|
-
x.assertNever(
|
|
3428
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => _e(i) ? Promise.resolve(n.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
|
|
3429
|
+
x.assertNever(n);
|
|
3417
3430
|
}
|
|
3418
3431
|
}
|
|
3419
|
-
K.create = (
|
|
3420
|
-
schema:
|
|
3421
|
-
typeName:
|
|
3432
|
+
K.create = (r, e, t) => new K(d({
|
|
3433
|
+
schema: r,
|
|
3434
|
+
typeName: v.ZodEffects,
|
|
3422
3435
|
effect: e
|
|
3423
3436
|
}, b(t)));
|
|
3424
|
-
K.createWithPreprocess = (
|
|
3437
|
+
K.createWithPreprocess = (r, e, t) => new K(d({
|
|
3425
3438
|
schema: e,
|
|
3426
|
-
effect: { type: "preprocess", transform:
|
|
3427
|
-
typeName:
|
|
3439
|
+
effect: { type: "preprocess", transform: r },
|
|
3440
|
+
typeName: v.ZodEffects
|
|
3428
3441
|
}, b(t)));
|
|
3429
3442
|
class te extends w {
|
|
3430
3443
|
_parse(e) {
|
|
@@ -3434,9 +3447,9 @@ class te extends w {
|
|
|
3434
3447
|
return this._def.innerType;
|
|
3435
3448
|
}
|
|
3436
3449
|
}
|
|
3437
|
-
te.create = (
|
|
3438
|
-
innerType:
|
|
3439
|
-
typeName:
|
|
3450
|
+
te.create = (r, e) => new te(d({
|
|
3451
|
+
innerType: r,
|
|
3452
|
+
typeName: v.ZodOptional
|
|
3440
3453
|
}, b(e)));
|
|
3441
3454
|
class me extends w {
|
|
3442
3455
|
_parse(e) {
|
|
@@ -3446,9 +3459,9 @@ class me extends w {
|
|
|
3446
3459
|
return this._def.innerType;
|
|
3447
3460
|
}
|
|
3448
3461
|
}
|
|
3449
|
-
me.create = (
|
|
3450
|
-
innerType:
|
|
3451
|
-
typeName:
|
|
3462
|
+
me.create = (r, e) => new me(d({
|
|
3463
|
+
innerType: r,
|
|
3464
|
+
typeName: v.ZodNullable
|
|
3452
3465
|
}, b(e)));
|
|
3453
3466
|
class qe extends w {
|
|
3454
3467
|
_parse(e) {
|
|
@@ -3464,9 +3477,9 @@ class qe extends w {
|
|
|
3464
3477
|
return this._def.innerType;
|
|
3465
3478
|
}
|
|
3466
3479
|
}
|
|
3467
|
-
qe.create = (
|
|
3468
|
-
innerType:
|
|
3469
|
-
typeName:
|
|
3480
|
+
qe.create = (r, e) => new qe(d({
|
|
3481
|
+
innerType: r,
|
|
3482
|
+
typeName: v.ZodDefault,
|
|
3470
3483
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default
|
|
3471
3484
|
}, b(e)));
|
|
3472
3485
|
class He extends w {
|
|
@@ -3475,12 +3488,12 @@ class He extends w {
|
|
|
3475
3488
|
common: y(d({}, t.common), {
|
|
3476
3489
|
issues: []
|
|
3477
3490
|
})
|
|
3478
|
-
}),
|
|
3491
|
+
}), n = this._def.innerType._parse({
|
|
3479
3492
|
data: s.data,
|
|
3480
3493
|
path: s.path,
|
|
3481
3494
|
parent: d({}, s)
|
|
3482
3495
|
});
|
|
3483
|
-
return Pe(
|
|
3496
|
+
return Pe(n) ? n.then((a) => ({
|
|
3484
3497
|
status: "valid",
|
|
3485
3498
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
3486
3499
|
get error() {
|
|
@@ -3490,7 +3503,7 @@ class He extends w {
|
|
|
3490
3503
|
})
|
|
3491
3504
|
})) : {
|
|
3492
3505
|
status: "valid",
|
|
3493
|
-
value:
|
|
3506
|
+
value: n.status === "valid" ? n.value : this._def.catchValue({
|
|
3494
3507
|
get error() {
|
|
3495
3508
|
return new z(s.common.issues);
|
|
3496
3509
|
},
|
|
@@ -3502,9 +3515,9 @@ class He extends w {
|
|
|
3502
3515
|
return this._def.innerType;
|
|
3503
3516
|
}
|
|
3504
3517
|
}
|
|
3505
|
-
He.create = (
|
|
3506
|
-
innerType:
|
|
3507
|
-
typeName:
|
|
3518
|
+
He.create = (r, e) => new He(d({
|
|
3519
|
+
innerType: r,
|
|
3520
|
+
typeName: v.ZodCatch,
|
|
3508
3521
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch
|
|
3509
3522
|
}, b(e)));
|
|
3510
3523
|
class ot extends w {
|
|
@@ -3515,14 +3528,14 @@ class ot extends w {
|
|
|
3515
3528
|
code: l.invalid_type,
|
|
3516
3529
|
expected: p.nan,
|
|
3517
3530
|
received: s.parsedType
|
|
3518
|
-
}),
|
|
3531
|
+
}), _;
|
|
3519
3532
|
}
|
|
3520
3533
|
return { status: "valid", value: e.data };
|
|
3521
3534
|
}
|
|
3522
3535
|
}
|
|
3523
|
-
ot.create = (
|
|
3524
|
-
typeName:
|
|
3525
|
-
}, b(
|
|
3536
|
+
ot.create = (r) => new ot(d({
|
|
3537
|
+
typeName: v.ZodNaN
|
|
3538
|
+
}, b(r)));
|
|
3526
3539
|
const Gs = Symbol("zod_brand");
|
|
3527
3540
|
class Zt extends w {
|
|
3528
3541
|
_parse(e) {
|
|
@@ -3547,23 +3560,23 @@ class Ke extends w {
|
|
|
3547
3560
|
path: s.path,
|
|
3548
3561
|
parent: s
|
|
3549
3562
|
});
|
|
3550
|
-
return a.status === "aborted" ?
|
|
3563
|
+
return a.status === "aborted" ? _ : a.status === "dirty" ? (t.dirty(), ke(a.value)) : this._def.out._parseAsync({
|
|
3551
3564
|
data: a.value,
|
|
3552
3565
|
path: s.path,
|
|
3553
3566
|
parent: s
|
|
3554
3567
|
});
|
|
3555
3568
|
});
|
|
3556
3569
|
{
|
|
3557
|
-
const
|
|
3570
|
+
const n = this._def.in._parseSync({
|
|
3558
3571
|
data: s.data,
|
|
3559
3572
|
path: s.path,
|
|
3560
3573
|
parent: s
|
|
3561
3574
|
});
|
|
3562
|
-
return
|
|
3575
|
+
return n.status === "aborted" ? _ : n.status === "dirty" ? (t.dirty(), {
|
|
3563
3576
|
status: "dirty",
|
|
3564
|
-
value:
|
|
3577
|
+
value: n.value
|
|
3565
3578
|
}) : this._def.out._parseSync({
|
|
3566
|
-
data:
|
|
3579
|
+
data: n.value,
|
|
3567
3580
|
path: s.path,
|
|
3568
3581
|
parent: s
|
|
3569
3582
|
});
|
|
@@ -3573,63 +3586,76 @@ class Ke extends w {
|
|
|
3573
3586
|
return new Ke({
|
|
3574
3587
|
in: e,
|
|
3575
3588
|
out: t,
|
|
3576
|
-
typeName:
|
|
3589
|
+
typeName: v.ZodPipeline
|
|
3577
3590
|
});
|
|
3578
3591
|
}
|
|
3579
3592
|
}
|
|
3580
3593
|
class Je extends w {
|
|
3581
3594
|
_parse(e) {
|
|
3582
|
-
const t = this._def.innerType._parse(e), s = (
|
|
3583
|
-
return Pe(t) ? t.then((
|
|
3595
|
+
const t = this._def.innerType._parse(e), s = (n) => (_e(n) && (n.value = Object.freeze(n.value)), n);
|
|
3596
|
+
return Pe(t) ? t.then((n) => s(n)) : s(t);
|
|
3584
3597
|
}
|
|
3585
3598
|
unwrap() {
|
|
3586
3599
|
return this._def.innerType;
|
|
3587
3600
|
}
|
|
3588
3601
|
}
|
|
3589
|
-
Je.create = (
|
|
3590
|
-
innerType:
|
|
3591
|
-
typeName:
|
|
3602
|
+
Je.create = (r, e) => new Je(d({
|
|
3603
|
+
innerType: r,
|
|
3604
|
+
typeName: v.ZodReadonly
|
|
3592
3605
|
}, b(e)));
|
|
3593
|
-
function
|
|
3594
|
-
|
|
3606
|
+
function Ht(r, e) {
|
|
3607
|
+
const t = typeof r == "function" ? r(e) : typeof r == "string" ? { message: r } : r;
|
|
3608
|
+
return typeof t == "string" ? { message: t } : t;
|
|
3609
|
+
}
|
|
3610
|
+
function hr(r, e = {}, t) {
|
|
3611
|
+
return r ? Ae.create().superRefine((s, n) => {
|
|
3595
3612
|
var a, i;
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3613
|
+
const o = r(s);
|
|
3614
|
+
if (o instanceof Promise)
|
|
3615
|
+
return o.then((c) => {
|
|
3616
|
+
var u, f;
|
|
3617
|
+
if (!c) {
|
|
3618
|
+
const g = Ht(e, s), O = (f = (u = g.fatal) !== null && u !== void 0 ? u : t) !== null && f !== void 0 ? f : !0;
|
|
3619
|
+
n.addIssue(y(d({ code: "custom" }, g), { fatal: O }));
|
|
3620
|
+
}
|
|
3621
|
+
});
|
|
3622
|
+
if (!o) {
|
|
3623
|
+
const c = Ht(e, s), u = (i = (a = c.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0;
|
|
3624
|
+
n.addIssue(y(d({ code: "custom" }, c), { fatal: u }));
|
|
3599
3625
|
}
|
|
3600
|
-
}) :
|
|
3626
|
+
}) : Ae.create();
|
|
3601
3627
|
}
|
|
3602
3628
|
const Ks = {
|
|
3603
3629
|
object: S.lazycreate
|
|
3604
3630
|
};
|
|
3605
|
-
var
|
|
3606
|
-
(function(
|
|
3607
|
-
|
|
3608
|
-
})(
|
|
3609
|
-
const Xs = (
|
|
3610
|
-
message: `Input not instance of ${
|
|
3611
|
-
}) =>
|
|
3612
|
-
string: (
|
|
3613
|
-
number: (
|
|
3614
|
-
boolean: (
|
|
3631
|
+
var v;
|
|
3632
|
+
(function(r) {
|
|
3633
|
+
r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
|
|
3634
|
+
})(v || (v = {}));
|
|
3635
|
+
const Xs = (r, e = {
|
|
3636
|
+
message: `Input not instance of ${r.name}`
|
|
3637
|
+
}) => hr((t) => t instanceof r, e), pr = J.create, mr = fe.create, Ys = ot.create, Qs = he.create, yr = $e.create, en = be.create, tn = nt.create, rn = Fe.create, sn = Ve.create, nn = Ae.create, an = ve.create, on = ce.create, cn = at.create, dn = G.create, un = S.create, ln = S.strictCreate, fn = De.create, hn = dt.create, pn = Le.create, mn = se.create, yn = Ue.create, gn = it.create, vn = we.create, _n = Te.create, bn = ze.create, wn = We.create, xn = pe.create, kn = Be.create, Tn = Oe.create, Jt = K.create, Sn = te.create, En = me.create, An = K.createWithPreprocess, On = Ke.create, Cn = () => pr().optional(), Nn = () => mr().optional(), In = () => yr().optional(), jn = {
|
|
3638
|
+
string: (r) => J.create(y(d({}, r), { coerce: !0 })),
|
|
3639
|
+
number: (r) => fe.create(y(d({}, r), { coerce: !0 })),
|
|
3640
|
+
boolean: (r) => $e.create(y(d({}, r), {
|
|
3615
3641
|
coerce: !0
|
|
3616
3642
|
})),
|
|
3617
|
-
bigint: (
|
|
3618
|
-
date: (
|
|
3619
|
-
},
|
|
3620
|
-
var
|
|
3643
|
+
bigint: (r) => he.create(y(d({}, r), { coerce: !0 })),
|
|
3644
|
+
date: (r) => be.create(y(d({}, r), { coerce: !0 }))
|
|
3645
|
+
}, Zn = _;
|
|
3646
|
+
var I = /* @__PURE__ */ Object.freeze({
|
|
3621
3647
|
__proto__: null,
|
|
3622
|
-
defaultErrorMap:
|
|
3623
|
-
setErrorMap:
|
|
3648
|
+
defaultErrorMap: Ee,
|
|
3649
|
+
setErrorMap: Es,
|
|
3624
3650
|
getErrorMap: tt,
|
|
3625
|
-
makeIssue:
|
|
3626
|
-
EMPTY_PATH:
|
|
3651
|
+
makeIssue: rt,
|
|
3652
|
+
EMPTY_PATH: As,
|
|
3627
3653
|
addIssueToContext: h,
|
|
3628
3654
|
ParseStatus: Z,
|
|
3629
|
-
INVALID:
|
|
3655
|
+
INVALID: _,
|
|
3630
3656
|
DIRTY: ke,
|
|
3631
3657
|
OK: $,
|
|
3632
|
-
isAborted:
|
|
3658
|
+
isAborted: At,
|
|
3633
3659
|
isDirty: Ot,
|
|
3634
3660
|
isValid: _e,
|
|
3635
3661
|
isAsync: Pe,
|
|
@@ -3637,21 +3663,21 @@ var N = /* @__PURE__ */ Object.freeze({
|
|
|
3637
3663
|
return x;
|
|
3638
3664
|
},
|
|
3639
3665
|
get objectUtil() {
|
|
3640
|
-
return
|
|
3666
|
+
return Et;
|
|
3641
3667
|
},
|
|
3642
3668
|
ZodParsedType: p,
|
|
3643
3669
|
getParsedType: oe,
|
|
3644
3670
|
ZodType: w,
|
|
3645
|
-
datetimeRegex:
|
|
3671
|
+
datetimeRegex: lr,
|
|
3646
3672
|
ZodString: J,
|
|
3647
3673
|
ZodNumber: fe,
|
|
3648
3674
|
ZodBigInt: he,
|
|
3649
3675
|
ZodBoolean: $e,
|
|
3650
3676
|
ZodDate: be,
|
|
3651
|
-
ZodSymbol:
|
|
3652
|
-
ZodUndefined:
|
|
3653
|
-
ZodNull:
|
|
3654
|
-
ZodAny:
|
|
3677
|
+
ZodSymbol: nt,
|
|
3678
|
+
ZodUndefined: Fe,
|
|
3679
|
+
ZodNull: Ve,
|
|
3680
|
+
ZodAny: Ae,
|
|
3655
3681
|
ZodUnknown: ve,
|
|
3656
3682
|
ZodNever: ce,
|
|
3657
3683
|
ZodVoid: at,
|
|
@@ -3681,67 +3707,67 @@ var N = /* @__PURE__ */ Object.freeze({
|
|
|
3681
3707
|
ZodBranded: Zt,
|
|
3682
3708
|
ZodPipeline: Ke,
|
|
3683
3709
|
ZodReadonly: Je,
|
|
3684
|
-
custom:
|
|
3710
|
+
custom: hr,
|
|
3685
3711
|
Schema: w,
|
|
3686
3712
|
ZodSchema: w,
|
|
3687
3713
|
late: Ks,
|
|
3688
3714
|
get ZodFirstPartyTypeKind() {
|
|
3689
|
-
return
|
|
3715
|
+
return v;
|
|
3690
3716
|
},
|
|
3691
|
-
coerce:
|
|
3692
|
-
any:
|
|
3693
|
-
array:
|
|
3717
|
+
coerce: jn,
|
|
3718
|
+
any: nn,
|
|
3719
|
+
array: dn,
|
|
3694
3720
|
bigint: Qs,
|
|
3695
|
-
boolean:
|
|
3696
|
-
date:
|
|
3697
|
-
discriminatedUnion:
|
|
3698
|
-
effect:
|
|
3699
|
-
enum:
|
|
3700
|
-
function:
|
|
3721
|
+
boolean: yr,
|
|
3722
|
+
date: en,
|
|
3723
|
+
discriminatedUnion: hn,
|
|
3724
|
+
effect: Jt,
|
|
3725
|
+
enum: xn,
|
|
3726
|
+
function: _n,
|
|
3701
3727
|
instanceof: Xs,
|
|
3702
|
-
intersection:
|
|
3703
|
-
lazy:
|
|
3704
|
-
literal:
|
|
3705
|
-
map:
|
|
3728
|
+
intersection: pn,
|
|
3729
|
+
lazy: bn,
|
|
3730
|
+
literal: wn,
|
|
3731
|
+
map: gn,
|
|
3706
3732
|
nan: Ys,
|
|
3707
|
-
nativeEnum:
|
|
3708
|
-
never:
|
|
3709
|
-
null:
|
|
3710
|
-
nullable:
|
|
3711
|
-
number:
|
|
3712
|
-
object:
|
|
3713
|
-
oboolean:
|
|
3714
|
-
onumber:
|
|
3715
|
-
optional:
|
|
3716
|
-
ostring:
|
|
3717
|
-
pipeline:
|
|
3718
|
-
preprocess:
|
|
3719
|
-
promise:
|
|
3720
|
-
record:
|
|
3721
|
-
set:
|
|
3722
|
-
strictObject:
|
|
3723
|
-
string:
|
|
3724
|
-
symbol:
|
|
3725
|
-
transformer:
|
|
3726
|
-
tuple:
|
|
3727
|
-
undefined:
|
|
3728
|
-
union:
|
|
3729
|
-
unknown:
|
|
3730
|
-
void:
|
|
3731
|
-
NEVER:
|
|
3733
|
+
nativeEnum: kn,
|
|
3734
|
+
never: on,
|
|
3735
|
+
null: sn,
|
|
3736
|
+
nullable: En,
|
|
3737
|
+
number: mr,
|
|
3738
|
+
object: un,
|
|
3739
|
+
oboolean: In,
|
|
3740
|
+
onumber: Nn,
|
|
3741
|
+
optional: Sn,
|
|
3742
|
+
ostring: Cn,
|
|
3743
|
+
pipeline: On,
|
|
3744
|
+
preprocess: An,
|
|
3745
|
+
promise: Tn,
|
|
3746
|
+
record: yn,
|
|
3747
|
+
set: vn,
|
|
3748
|
+
strictObject: ln,
|
|
3749
|
+
string: pr,
|
|
3750
|
+
symbol: tn,
|
|
3751
|
+
transformer: Jt,
|
|
3752
|
+
tuple: mn,
|
|
3753
|
+
undefined: rn,
|
|
3754
|
+
union: fn,
|
|
3755
|
+
unknown: an,
|
|
3756
|
+
void: cn,
|
|
3757
|
+
NEVER: Zn,
|
|
3732
3758
|
ZodIssueCode: l,
|
|
3733
3759
|
quotelessJson: Ss,
|
|
3734
3760
|
ZodError: z
|
|
3735
3761
|
});
|
|
3736
|
-
const
|
|
3737
|
-
language:
|
|
3738
|
-
disableMarkedForExport:
|
|
3762
|
+
const Rn = I.object({
|
|
3763
|
+
language: I.enum(["typescript", "javascript"]).optional(),
|
|
3764
|
+
disableMarkedForExport: I.boolean().optional()
|
|
3739
3765
|
}).and(
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
framework:
|
|
3743
|
-
model:
|
|
3744
|
-
styling:
|
|
3766
|
+
I.union([
|
|
3767
|
+
I.object({
|
|
3768
|
+
framework: I.literal("react"),
|
|
3769
|
+
model: I.string().optional(),
|
|
3770
|
+
styling: I.enum([
|
|
3745
3771
|
"plain_css",
|
|
3746
3772
|
"css_modules",
|
|
3747
3773
|
"styled_components",
|
|
@@ -3750,33 +3776,33 @@ const Zr = N.object({
|
|
|
3750
3776
|
"scss",
|
|
3751
3777
|
"inline_styles"
|
|
3752
3778
|
]),
|
|
3753
|
-
uiLibrary:
|
|
3754
|
-
enableUILibraryTheming:
|
|
3755
|
-
enableCompactStructure:
|
|
3756
|
-
enableAutoSplit:
|
|
3757
|
-
autoSplitThreshold:
|
|
3779
|
+
uiLibrary: I.enum(["mui", "antd", "radix", "shadcn"]).optional(),
|
|
3780
|
+
enableUILibraryTheming: I.boolean().optional(),
|
|
3781
|
+
enableCompactStructure: I.boolean().optional(),
|
|
3782
|
+
enableAutoSplit: I.boolean().optional(),
|
|
3783
|
+
autoSplitThreshold: I.number().optional()
|
|
3758
3784
|
}),
|
|
3759
|
-
|
|
3760
|
-
framework:
|
|
3761
|
-
styling:
|
|
3762
|
-
enableTranslation:
|
|
3785
|
+
I.object({
|
|
3786
|
+
framework: I.literal("html"),
|
|
3787
|
+
styling: I.enum(["plain_css", "inline_styles"]),
|
|
3788
|
+
enableTranslation: I.boolean().optional()
|
|
3763
3789
|
})
|
|
3764
3790
|
])
|
|
3765
|
-
),
|
|
3766
|
-
const e =
|
|
3791
|
+
), Mn = (r) => {
|
|
3792
|
+
const e = Rn.safeParse(r);
|
|
3767
3793
|
if (e.success === !1) {
|
|
3768
3794
|
const t = new Error("Invalid codegen settings");
|
|
3769
3795
|
throw t.cause = e.error, t;
|
|
3770
3796
|
}
|
|
3771
3797
|
return e.data;
|
|
3772
|
-
},
|
|
3798
|
+
}, Gt = /* @__PURE__ */ new Set([
|
|
3773
3799
|
"FRAME",
|
|
3774
3800
|
"INSTANCE",
|
|
3775
3801
|
"COMPONENT",
|
|
3776
3802
|
"COMPONENT_SET",
|
|
3777
3803
|
"GROUP"
|
|
3778
|
-
]),
|
|
3779
|
-
const t =
|
|
3804
|
+
]), Pn = (r, e) => {
|
|
3805
|
+
const t = ir(r.document, e);
|
|
3780
3806
|
if (!t)
|
|
3781
3807
|
return {
|
|
3782
3808
|
isValid: !1,
|
|
@@ -3784,7 +3810,7 @@ const Zr = N.object({
|
|
|
3784
3810
|
};
|
|
3785
3811
|
if (t.type === "CANVAS") {
|
|
3786
3812
|
const s = t.children.filter(
|
|
3787
|
-
(
|
|
3813
|
+
(n) => Gt.has(n.type)
|
|
3788
3814
|
);
|
|
3789
3815
|
return s.length === 1 ? {
|
|
3790
3816
|
isValid: !0,
|
|
@@ -3795,13 +3821,13 @@ const Zr = N.object({
|
|
|
3795
3821
|
reason: "Selected node is a page with multiple children"
|
|
3796
3822
|
};
|
|
3797
3823
|
}
|
|
3798
|
-
return
|
|
3824
|
+
return Gt.has(t.type) ? { isValid: !0, node: t } : {
|
|
3799
3825
|
isValid: !1,
|
|
3800
3826
|
reason: "Selected node type is not supported"
|
|
3801
3827
|
};
|
|
3802
3828
|
};
|
|
3803
|
-
var L, Ge, ct,
|
|
3804
|
-
class
|
|
3829
|
+
var L, Ge, ct, gr;
|
|
3830
|
+
class Bn {
|
|
3805
3831
|
constructor({
|
|
3806
3832
|
auth: e,
|
|
3807
3833
|
apiBaseAddress: t = "https://public-api.animaapp.com"
|
|
@@ -3825,11 +3851,11 @@ class Wr {
|
|
|
3825
3851
|
}
|
|
3826
3852
|
generateCode(s) {
|
|
3827
3853
|
return M(this, arguments, function* (e, t = {}) {
|
|
3828
|
-
var
|
|
3854
|
+
var g, O, C, N, R, B, ne, de, V;
|
|
3829
3855
|
if (this.hasAuth() === !1)
|
|
3830
3856
|
throw new Error('It needs to set "auth" before calling this method.');
|
|
3831
|
-
e.figmaToken && (yield $t(this, ct,
|
|
3832
|
-
const
|
|
3857
|
+
e.figmaToken && (yield $t(this, ct, gr).call(this, e.fileKey, e.figmaToken, e.nodesId));
|
|
3858
|
+
const n = {}, a = Mn(e.settings);
|
|
3833
3859
|
let i = e.tracking;
|
|
3834
3860
|
H(this, L) && "userId" in H(this, L) && H(this, L).userId && (i != null && i.externalId || (i = { externalId: H(this, L).userId }));
|
|
3835
3861
|
const o = yield fetch(`${H(this, Ge)}/v1/codegen`, {
|
|
@@ -3863,7 +3889,7 @@ class Wr {
|
|
|
3863
3889
|
q = JSON.parse(X);
|
|
3864
3890
|
} catch (Ce) {
|
|
3865
3891
|
}
|
|
3866
|
-
throw ((
|
|
3892
|
+
throw ((g = q == null ? void 0 : q.error) == null ? void 0 : g.name) === "ZodError" ? new ue({
|
|
3867
3893
|
name: "HTTP error from Anima API",
|
|
3868
3894
|
reason: "Invalid body payload",
|
|
3869
3895
|
detail: q.error.issues,
|
|
@@ -3895,25 +3921,25 @@ class Wr {
|
|
|
3895
3921
|
const Ce = f.split(`
|
|
3896
3922
|
`);
|
|
3897
3923
|
f = Ce.pop() || "";
|
|
3898
|
-
for (const
|
|
3899
|
-
if (!(!
|
|
3924
|
+
for (const E of Ce)
|
|
3925
|
+
if (!(!E.trim() || E.startsWith(":")) && E.startsWith("data: ")) {
|
|
3900
3926
|
let k;
|
|
3901
3927
|
try {
|
|
3902
|
-
k = JSON.parse(
|
|
3928
|
+
k = JSON.parse(E.slice(6));
|
|
3903
3929
|
} catch (ut) {
|
|
3904
3930
|
continue;
|
|
3905
3931
|
}
|
|
3906
3932
|
switch (k.type) {
|
|
3907
3933
|
case "queueing": {
|
|
3908
|
-
typeof t == "function" ? t(k) : (
|
|
3934
|
+
typeof t == "function" ? t(k) : (O = t.onQueueing) == null || O.call(t);
|
|
3909
3935
|
break;
|
|
3910
3936
|
}
|
|
3911
3937
|
case "start": {
|
|
3912
|
-
|
|
3938
|
+
n.sessionId = k.sessionId, typeof t == "function" ? t(k) : (C = t.onStart) == null || C.call(t, { sessionId: k.sessionId });
|
|
3913
3939
|
break;
|
|
3914
3940
|
}
|
|
3915
3941
|
case "pre_codegen": {
|
|
3916
|
-
typeof t == "function" ? t(k) : (
|
|
3942
|
+
typeof t == "function" ? t(k) : (N = t.onPreCodegen) == null || N.call(t, { message: k.message });
|
|
3917
3943
|
break;
|
|
3918
3944
|
}
|
|
3919
3945
|
case "assets_uploaded": {
|
|
@@ -3921,18 +3947,18 @@ class Wr {
|
|
|
3921
3947
|
break;
|
|
3922
3948
|
}
|
|
3923
3949
|
case "assets_list": {
|
|
3924
|
-
|
|
3950
|
+
n.assets = k.payload.assets, typeof t == "function" ? t(k) : (B = t.onAssetsList) == null || B.call(t, k.payload);
|
|
3925
3951
|
break;
|
|
3926
3952
|
}
|
|
3927
3953
|
case "figma_metadata": {
|
|
3928
|
-
|
|
3954
|
+
n.figmaFileName = k.figmaFileName, n.figmaSelectedFrameName = k.figmaSelectedFrameName, typeof t == "function" ? t(k) : (ne = t.onFigmaMetadata) == null || ne.call(t, {
|
|
3929
3955
|
figmaFileName: k.figmaFileName,
|
|
3930
3956
|
figmaSelectedFrameName: k.figmaSelectedFrameName
|
|
3931
3957
|
});
|
|
3932
3958
|
break;
|
|
3933
3959
|
}
|
|
3934
3960
|
case "generating_code": {
|
|
3935
|
-
k.payload.status === "success" && (
|
|
3961
|
+
k.payload.status === "success" && (n.files = k.payload.files), typeof t == "function" ? t(k) : (de = t.onGeneratingCode) == null || de.call(t, {
|
|
3936
3962
|
status: k.payload.status,
|
|
3937
3963
|
progress: k.payload.progress,
|
|
3938
3964
|
files: k.payload.files
|
|
@@ -3940,7 +3966,7 @@ class Wr {
|
|
|
3940
3966
|
break;
|
|
3941
3967
|
}
|
|
3942
3968
|
case "codegen_completed": {
|
|
3943
|
-
typeof t == "function" ? t(k) : (
|
|
3969
|
+
typeof t == "function" ? t(k) : (V = t.onCodegenCompleted) == null || V.call(t);
|
|
3944
3970
|
break;
|
|
3945
3971
|
}
|
|
3946
3972
|
case "error":
|
|
@@ -3949,12 +3975,12 @@ class Wr {
|
|
|
3949
3975
|
reason: k.payload.reason
|
|
3950
3976
|
});
|
|
3951
3977
|
case "done": {
|
|
3952
|
-
if (!
|
|
3978
|
+
if (!n.files)
|
|
3953
3979
|
throw new ue({
|
|
3954
3980
|
name: "Invalid response",
|
|
3955
3981
|
reason: "No code generated"
|
|
3956
3982
|
});
|
|
3957
|
-
return
|
|
3983
|
+
return n.tokenUsage = k.payload.tokenUsage, n;
|
|
3958
3984
|
}
|
|
3959
3985
|
}
|
|
3960
3986
|
}
|
|
@@ -3970,11 +3996,11 @@ class Wr {
|
|
|
3970
3996
|
});
|
|
3971
3997
|
}
|
|
3972
3998
|
}
|
|
3973
|
-
L = new WeakMap(), Ge = new WeakMap(), ct = new WeakSet(),
|
|
3999
|
+
L = new WeakMap(), Ge = new WeakMap(), ct = new WeakSet(), gr = function(e, t, s) {
|
|
3974
4000
|
return M(this, null, function* () {
|
|
3975
|
-
let
|
|
4001
|
+
let n;
|
|
3976
4002
|
try {
|
|
3977
|
-
|
|
4003
|
+
n = yield Ts({
|
|
3978
4004
|
fileKey: e,
|
|
3979
4005
|
authToken: t,
|
|
3980
4006
|
params: {
|
|
@@ -3985,7 +4011,7 @@ L = new WeakMap(), Ge = new WeakMap(), ct = new WeakSet(), yn = function(e, t, s
|
|
|
3985
4011
|
return;
|
|
3986
4012
|
}
|
|
3987
4013
|
const i = s.map(
|
|
3988
|
-
(o) =>
|
|
4014
|
+
(o) => Pn(n, o)
|
|
3989
4015
|
).find(
|
|
3990
4016
|
(o) => !o.isValid
|
|
3991
4017
|
);
|
|
@@ -3996,47 +4022,50 @@ L = new WeakMap(), Ge = new WeakMap(), ct = new WeakSet(), yn = function(e, t, s
|
|
|
3996
4022
|
});
|
|
3997
4023
|
});
|
|
3998
4024
|
};
|
|
3999
|
-
const
|
|
4025
|
+
const qn = (r) => {
|
|
4000
4026
|
var e;
|
|
4001
|
-
if (!
|
|
4027
|
+
if (!r)
|
|
4002
4028
|
return [!1, "", ""];
|
|
4003
4029
|
try {
|
|
4004
|
-
const t = new URL(
|
|
4030
|
+
const t = new URL(r), s = t.pathname;
|
|
4005
4031
|
if (t.origin !== "https://www.figma.com")
|
|
4006
4032
|
return [!1, "", ""];
|
|
4007
|
-
const
|
|
4008
|
-
|
|
4033
|
+
const n = t.toString();
|
|
4034
|
+
if (r !== n)
|
|
4035
|
+
return [!1, "", ""];
|
|
4036
|
+
const a = ((e = t.searchParams.get("node-id")) != null ? e : "").replace(/-/g, ":"), i = s.split("/")[2];
|
|
4037
|
+
return [(s.startsWith("/file/") && t.searchParams.get("type") !== "whiteboard" || s.startsWith("/design/")) && i.length === 22, i, a];
|
|
4009
4038
|
} catch (t) {
|
|
4010
4039
|
return [!1, "", ""];
|
|
4011
4040
|
}
|
|
4012
|
-
},
|
|
4013
|
-
fileKey:
|
|
4041
|
+
}, Hn = ({
|
|
4042
|
+
fileKey: r,
|
|
4014
4043
|
nodeId: e,
|
|
4015
4044
|
duplicate: t
|
|
4016
4045
|
}) => {
|
|
4017
4046
|
const s = new URL("https://www.figma.com");
|
|
4018
|
-
return s.pathname = `design/${
|
|
4047
|
+
return s.pathname = `design/${r}`, t && (s.pathname = `${s.pathname}/duplicate`), e && s.searchParams.set("node-id", e.replace(":", "-")), s;
|
|
4019
4048
|
};
|
|
4020
|
-
class
|
|
4049
|
+
class Jn extends Error {
|
|
4021
4050
|
constructor(e, t) {
|
|
4022
4051
|
super(e), this.response = t;
|
|
4023
4052
|
}
|
|
4024
4053
|
}
|
|
4025
|
-
const
|
|
4026
|
-
files:
|
|
4054
|
+
const Gn = ({
|
|
4055
|
+
files: r,
|
|
4027
4056
|
screenPath: e = "src/screens"
|
|
4028
4057
|
}) => {
|
|
4029
4058
|
const t = {}, s = /* @__PURE__ */ new Set();
|
|
4030
|
-
function
|
|
4031
|
-
if (s.has(a) || !
|
|
4059
|
+
function n(a) {
|
|
4060
|
+
if (s.has(a) || !r[a])
|
|
4032
4061
|
return;
|
|
4033
|
-
s.add(a), t[a] =
|
|
4062
|
+
s.add(a), t[a] = r[a], $n(r[a].content).forEach((o) => {
|
|
4034
4063
|
try {
|
|
4035
|
-
const c =
|
|
4064
|
+
const c = Fn(a, o);
|
|
4036
4065
|
if (c.startsWith("src/")) {
|
|
4037
4066
|
const u = c.split("/").slice(0, -1).join("/");
|
|
4038
|
-
|
|
4039
|
-
s.has(
|
|
4067
|
+
Vn(r, u).forEach((g) => {
|
|
4068
|
+
s.has(g) || n(g);
|
|
4040
4069
|
});
|
|
4041
4070
|
}
|
|
4042
4071
|
} catch (c) {
|
|
@@ -4047,33 +4076,33 @@ const Jr = ({
|
|
|
4047
4076
|
}
|
|
4048
4077
|
});
|
|
4049
4078
|
}
|
|
4050
|
-
return Object.entries(
|
|
4051
|
-
a.startsWith(e) ?
|
|
4079
|
+
return Object.entries(r).forEach(([a, i]) => {
|
|
4080
|
+
a.startsWith(e) ? n(a) : a.startsWith("src/") || (t[a] = i);
|
|
4052
4081
|
}), t;
|
|
4053
4082
|
};
|
|
4054
|
-
function
|
|
4083
|
+
function $n(r) {
|
|
4055
4084
|
const e = /import.*?["']([^"']+)["']/g, t = /export.*from\s+["']([^"']+)["']/g, s = [];
|
|
4056
|
-
let
|
|
4057
|
-
for (; (
|
|
4058
|
-
s.push(
|
|
4059
|
-
for (; (
|
|
4060
|
-
s.push(
|
|
4085
|
+
let n;
|
|
4086
|
+
for (; (n = e.exec(r)) !== null; )
|
|
4087
|
+
s.push(n[1]);
|
|
4088
|
+
for (; (n = t.exec(r)) !== null; )
|
|
4089
|
+
s.push(n[1]);
|
|
4061
4090
|
return [...new Set(s)];
|
|
4062
4091
|
}
|
|
4063
|
-
function
|
|
4092
|
+
function Fn(r, e) {
|
|
4064
4093
|
if (!e.startsWith("."))
|
|
4065
4094
|
return e;
|
|
4066
|
-
const t =
|
|
4095
|
+
const t = r.split("/").slice(0, -1), s = e.split("/"), n = [...t];
|
|
4067
4096
|
for (const a of s)
|
|
4068
|
-
a === ".." ?
|
|
4069
|
-
return
|
|
4097
|
+
a === ".." ? n.pop() : a !== "." && n.push(a);
|
|
4098
|
+
return n.join("/");
|
|
4070
4099
|
}
|
|
4071
|
-
function
|
|
4072
|
-
return Object.keys(
|
|
4100
|
+
function Vn(r, e) {
|
|
4101
|
+
return Object.keys(r).filter((t) => t.startsWith(e));
|
|
4073
4102
|
}
|
|
4074
|
-
const
|
|
4103
|
+
const Dn = (r, e) => new ReadableStream({
|
|
4075
4104
|
start(t) {
|
|
4076
|
-
|
|
4105
|
+
r.generateCode(e, (s) => {
|
|
4077
4106
|
s.type === "error" || t.enqueue(s), (s.type === "aborted" || s.type === "error") && t.close();
|
|
4078
4107
|
}).then((s) => {
|
|
4079
4108
|
t.enqueue({
|
|
@@ -4095,26 +4124,26 @@ const Fr = (n, e) => new ReadableStream({
|
|
|
4095
4124
|
}), t.close();
|
|
4096
4125
|
});
|
|
4097
4126
|
}
|
|
4098
|
-
}),
|
|
4099
|
-
var c, u, f,
|
|
4100
|
-
const t =
|
|
4127
|
+
}), Kn = (r, e) => M(void 0, null, function* () {
|
|
4128
|
+
var c, u, f, g, O, C, N;
|
|
4129
|
+
const t = Dn(r, e), [s, n] = t.tee(), a = yield s.getReader().read();
|
|
4101
4130
|
if (a.done || !a.value || ((c = a.value) == null ? void 0 : c.type) === "error" && ((f = (u = a.value) == null ? void 0 : u.payload) != null && f.status))
|
|
4102
4131
|
return new Response(JSON.stringify(a.value), {
|
|
4103
|
-
status: ((
|
|
4132
|
+
status: ((g = a.value) == null ? void 0 : g.type) === "error" && (N = (C = (O = a.value) == null ? void 0 : O.payload) == null ? void 0 : C.status) != null ? N : 500,
|
|
4104
4133
|
headers: {
|
|
4105
4134
|
"Content-Type": "application/json"
|
|
4106
4135
|
}
|
|
4107
4136
|
});
|
|
4108
|
-
const i = new TextEncoder(), o =
|
|
4137
|
+
const i = new TextEncoder(), o = n.pipeThrough(
|
|
4109
4138
|
new TransformStream({
|
|
4110
4139
|
transform(R, B) {
|
|
4111
|
-
const
|
|
4140
|
+
const ne = `event: ${R.type}
|
|
4112
4141
|
data: ${JSON.stringify(
|
|
4113
4142
|
R
|
|
4114
4143
|
)}
|
|
4115
4144
|
|
|
4116
4145
|
`;
|
|
4117
|
-
B.enqueue(i.encode(
|
|
4146
|
+
B.enqueue(i.encode(ne));
|
|
4118
4147
|
}
|
|
4119
4148
|
})
|
|
4120
4149
|
);
|
|
@@ -4128,28 +4157,28 @@ data: ${JSON.stringify(
|
|
|
4128
4157
|
});
|
|
4129
4158
|
});
|
|
4130
4159
|
export {
|
|
4131
|
-
|
|
4160
|
+
Bn as Anima,
|
|
4132
4161
|
ue as CodegenError,
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4162
|
+
kr as FigmaTokenIssue,
|
|
4163
|
+
Sr as NotFound,
|
|
4164
|
+
Tr as RateLimitExceeded,
|
|
4165
|
+
Jn as ResponseError,
|
|
4166
|
+
Ar as UnknownFigmaApiException,
|
|
4167
|
+
Kn as createCodegenResponseEventStream,
|
|
4168
|
+
Dn as createCodegenStream,
|
|
4169
|
+
ir as findChildrenNode,
|
|
4170
|
+
Hn as formatToFigmaLink,
|
|
4171
|
+
zn as getFigmaApiErrorType,
|
|
4143
4172
|
Ts as getFigmaFile,
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4173
|
+
Wn as getFileNodes,
|
|
4174
|
+
Gn as getRelatedScreenFiles,
|
|
4175
|
+
Cr as isFigmaTokenIssue,
|
|
4176
|
+
Pn as isNodeCodegenCompatible,
|
|
4177
|
+
Er as isNotFound,
|
|
4178
|
+
Or as isRateLimitExceeded,
|
|
4179
|
+
Un as isUnknownFigmaApiException,
|
|
4180
|
+
qn as isValidFigmaUrl,
|
|
4181
|
+
Mn as validateSettings,
|
|
4182
|
+
er as wrapFigmaApiError
|
|
4154
4183
|
};
|
|
4155
4184
|
//# sourceMappingURL=index.js.map
|