@useinsider/guido 3.29.0 → 3.30.0-beta.949c781
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/@types/config/schemas.js +3 -3
- package/dist/@types/email-be/html-validation.js +28 -0
- package/dist/composables/useSave.js +19 -17
- package/dist/composables/useSaveValidation.js +134 -252
- package/dist/composables/useTranslations.js +14 -9
- package/dist/enums/email-be.js +27 -0
- package/dist/enums/save-validation.js +2 -2
- package/dist/node_modules/valibot/dist/index.js +232 -154
- package/dist/package.json.js +2 -2
- package/dist/services/emailBe/errors/ApiError.js +50 -0
- package/dist/services/emailBe/errors/handleApiError.js +31 -0
- package/dist/services/emailBe/errors/toApiError.js +71 -0
- package/dist/services/emailBe/html/HtmlValidationService.js +35 -0
- package/dist/services/emailBe/html/index.js +6 -0
- package/dist/services/emailBe/http/HttpManager.js +68 -0
- package/dist/services/emailBe/http/RetryStack.js +24 -0
- package/dist/services/emailBe/http/client.js +61 -0
- package/dist/services/emailBe/http/index.js +10 -0
- package/dist/services/emailBe/http/transportErrors.js +20 -0
- package/dist/src/@types/email-be/html-validation.d.ts +51 -0
- package/dist/src/composables/useSaveValidation.d.ts +2 -2
- package/dist/src/enums/email-be.d.ts +26 -0
- package/dist/src/enums/save-validation.d.ts +3 -15
- package/dist/src/services/emailBe/errors/ApiError.d.ts +40 -0
- package/dist/src/services/emailBe/errors/handleApiError.d.ts +11 -0
- package/dist/src/services/emailBe/errors/toApiError.d.ts +2 -0
- package/dist/src/services/emailBe/html/HtmlValidationService.d.ts +8 -0
- package/dist/src/services/emailBe/html/index.d.ts +2 -0
- package/dist/src/services/emailBe/http/HttpManager.d.ts +13 -0
- package/dist/src/services/emailBe/http/RetryStack.d.ts +6 -0
- package/dist/src/services/emailBe/http/client.d.ts +3 -0
- package/dist/src/services/emailBe/http/index.d.ts +2 -0
- package/dist/src/services/emailBe/http/transportErrors.d.ts +15 -0
- package/dist/src/services/emailBe/http/types.d.ts +46 -0
- package/dist/static/stripo-runtime-manifest.json.js +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
let m;
|
|
2
2
|
// @__NO_SIDE_EFFECTS__
|
|
3
|
-
function
|
|
3
|
+
function x(n) {
|
|
4
4
|
return {
|
|
5
5
|
lang: (n == null ? void 0 : n.lang) ?? (m == null ? void 0 : m.lang),
|
|
6
6
|
message: n == null ? void 0 : n.message,
|
|
@@ -10,7 +10,7 @@ function g(n) {
|
|
|
10
10
|
}
|
|
11
11
|
let E;
|
|
12
12
|
// @__NO_SIDE_EFFECTS__
|
|
13
|
-
function
|
|
13
|
+
function I(n) {
|
|
14
14
|
return E == null ? void 0 : E.get(n);
|
|
15
15
|
}
|
|
16
16
|
let j;
|
|
@@ -25,27 +25,27 @@ function q(n, r) {
|
|
|
25
25
|
return (e = _ == null ? void 0 : _.get(n)) == null ? void 0 : e.get(r);
|
|
26
26
|
}
|
|
27
27
|
// @__NO_SIDE_EFFECTS__
|
|
28
|
-
function
|
|
28
|
+
function D(n) {
|
|
29
29
|
var e, s;
|
|
30
30
|
const r = typeof n;
|
|
31
31
|
return r === "string" ? `"${n}"` : r === "number" || r === "bigint" || r === "boolean" ? `${n}` : r === "object" || r === "function" ? (n && ((s = (e = Object.getPrototypeOf(n)) == null ? void 0 : e.constructor) == null ? void 0 : s.name)) ?? "null" : r;
|
|
32
32
|
}
|
|
33
33
|
function f(n, r, e, s, t) {
|
|
34
|
-
const l = t && "input" in t ? t.input : e.value, u = (t == null ? void 0 : t.expected) ?? n.expects ?? null,
|
|
34
|
+
const l = t && "input" in t ? t.input : e.value, u = (t == null ? void 0 : t.expected) ?? n.expects ?? null, p = (t == null ? void 0 : t.received) ?? /* @__PURE__ */ D(l), i = {
|
|
35
35
|
kind: n.kind,
|
|
36
36
|
type: n.type,
|
|
37
37
|
input: l,
|
|
38
38
|
expected: u,
|
|
39
|
-
received:
|
|
40
|
-
message: `Invalid ${r}: ${u ? `Expected ${u} but r` : "R"}eceived ${
|
|
39
|
+
received: p,
|
|
40
|
+
message: `Invalid ${r}: ${u ? `Expected ${u} but r` : "R"}eceived ${p}`,
|
|
41
41
|
requirement: n.requirement,
|
|
42
42
|
path: t == null ? void 0 : t.path,
|
|
43
43
|
issues: t == null ? void 0 : t.issues,
|
|
44
44
|
lang: s.lang,
|
|
45
45
|
abortEarly: s.abortEarly,
|
|
46
46
|
abortPipeEarly: s.abortPipeEarly
|
|
47
|
-
},
|
|
48
|
-
|
|
47
|
+
}, c = n.kind === "schema", a = (t == null ? void 0 : t.message) ?? n.message ?? /* @__PURE__ */ q(n.reference, i.lang) ?? (c ? /* @__PURE__ */ V(i.lang) : null) ?? s.message ?? /* @__PURE__ */ I(i.lang);
|
|
48
|
+
a !== void 0 && (i.message = typeof a == "function" ? a(i) : a), c && (e.typed = !1), e.issues ? e.issues.push(i) : e.issues = [i];
|
|
49
49
|
}
|
|
50
50
|
// @__NO_SIDE_EFFECTS__
|
|
51
51
|
function o(n) {
|
|
@@ -53,16 +53,16 @@ function o(n) {
|
|
|
53
53
|
version: 1,
|
|
54
54
|
vendor: "valibot",
|
|
55
55
|
validate(r) {
|
|
56
|
-
return n["~run"]({ value: r }, /* @__PURE__ */
|
|
56
|
+
return n["~run"]({ value: r }, /* @__PURE__ */ x());
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
// @__NO_SIDE_EFFECTS__
|
|
61
|
-
function
|
|
61
|
+
function S(n, r) {
|
|
62
62
|
return Object.hasOwn(n, r) && r !== "__proto__" && r !== "prototype" && r !== "constructor";
|
|
63
63
|
}
|
|
64
64
|
// @__NO_SIDE_EFFECTS__
|
|
65
|
-
function
|
|
65
|
+
function w(n, r) {
|
|
66
66
|
const e = [...new Set(n)];
|
|
67
67
|
return e.length > 1 ? `(${e.join(` ${r} `)})` : e[0] ?? "never";
|
|
68
68
|
}
|
|
@@ -82,6 +82,21 @@ function M(n, r) {
|
|
|
82
82
|
kind: "validation",
|
|
83
83
|
type: "check",
|
|
84
84
|
reference: M,
|
|
85
|
+
async: !1,
|
|
86
|
+
expects: null,
|
|
87
|
+
requirement: n,
|
|
88
|
+
message: r,
|
|
89
|
+
"~run"(e, s) {
|
|
90
|
+
return e.typed && !this.requirement(e.value) && f(this, "input", e, s), e;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
// @__NO_SIDE_EFFECTS__
|
|
95
|
+
function z(n, r) {
|
|
96
|
+
return {
|
|
97
|
+
kind: "validation",
|
|
98
|
+
type: "check",
|
|
99
|
+
reference: z,
|
|
85
100
|
async: !0,
|
|
86
101
|
expects: null,
|
|
87
102
|
requirement: n,
|
|
@@ -92,11 +107,11 @@ function M(n, r) {
|
|
|
92
107
|
};
|
|
93
108
|
}
|
|
94
109
|
// @__NO_SIDE_EFFECTS__
|
|
95
|
-
function
|
|
110
|
+
function G(n, r) {
|
|
96
111
|
return {
|
|
97
112
|
kind: "validation",
|
|
98
113
|
type: "max_length",
|
|
99
|
-
reference:
|
|
114
|
+
reference: G,
|
|
100
115
|
async: !1,
|
|
101
116
|
expects: `<=${n}`,
|
|
102
117
|
requirement: n,
|
|
@@ -107,11 +122,11 @@ function z(n, r) {
|
|
|
107
122
|
};
|
|
108
123
|
}
|
|
109
124
|
// @__NO_SIDE_EFFECTS__
|
|
110
|
-
function
|
|
125
|
+
function L(n, r) {
|
|
111
126
|
return {
|
|
112
127
|
kind: "validation",
|
|
113
128
|
type: "min_length",
|
|
114
|
-
reference:
|
|
129
|
+
reference: L,
|
|
115
130
|
async: !1,
|
|
116
131
|
expects: `>=${n}`,
|
|
117
132
|
requirement: n,
|
|
@@ -122,11 +137,11 @@ function G(n, r) {
|
|
|
122
137
|
};
|
|
123
138
|
}
|
|
124
139
|
// @__NO_SIDE_EFFECTS__
|
|
125
|
-
function
|
|
140
|
+
function N(n) {
|
|
126
141
|
return {
|
|
127
142
|
kind: "validation",
|
|
128
143
|
type: "non_empty",
|
|
129
|
-
reference:
|
|
144
|
+
reference: N,
|
|
130
145
|
async: !1,
|
|
131
146
|
expects: "!0",
|
|
132
147
|
message: n,
|
|
@@ -136,11 +151,11 @@ function L(n) {
|
|
|
136
151
|
};
|
|
137
152
|
}
|
|
138
153
|
// @__NO_SIDE_EFFECTS__
|
|
139
|
-
function
|
|
154
|
+
function C(n) {
|
|
140
155
|
return {
|
|
141
156
|
kind: "transformation",
|
|
142
157
|
type: "transform",
|
|
143
|
-
reference:
|
|
158
|
+
reference: C,
|
|
144
159
|
async: !1,
|
|
145
160
|
operation: n,
|
|
146
161
|
"~run"(r) {
|
|
@@ -149,11 +164,11 @@ function N(n) {
|
|
|
149
164
|
};
|
|
150
165
|
}
|
|
151
166
|
// @__NO_SIDE_EFFECTS__
|
|
152
|
-
function
|
|
167
|
+
function F() {
|
|
153
168
|
return {
|
|
154
169
|
kind: "transformation",
|
|
155
170
|
type: "trim",
|
|
156
|
-
reference:
|
|
171
|
+
reference: F,
|
|
157
172
|
async: !1,
|
|
158
173
|
"~run"(n) {
|
|
159
174
|
return n.value = n.value.trim(), n;
|
|
@@ -165,7 +180,7 @@ function P(n, r, e) {
|
|
|
165
180
|
return typeof n.fallback == "function" ? n.fallback(r, e) : n.fallback;
|
|
166
181
|
}
|
|
167
182
|
// @__NO_SIDE_EFFECTS__
|
|
168
|
-
function
|
|
183
|
+
function ie(n, r) {
|
|
169
184
|
return {
|
|
170
185
|
...n,
|
|
171
186
|
fallback: r,
|
|
@@ -182,15 +197,15 @@ function se(n, r) {
|
|
|
182
197
|
};
|
|
183
198
|
}
|
|
184
199
|
// @__NO_SIDE_EFFECTS__
|
|
185
|
-
function
|
|
200
|
+
function k(n, r, e) {
|
|
186
201
|
return typeof n.default == "function" ? n.default(r, e) : n.default;
|
|
187
202
|
}
|
|
188
203
|
// @__NO_SIDE_EFFECTS__
|
|
189
|
-
function
|
|
204
|
+
function R(n, r) {
|
|
190
205
|
return {
|
|
191
206
|
kind: "schema",
|
|
192
207
|
type: "array",
|
|
193
|
-
reference:
|
|
208
|
+
reference: R,
|
|
194
209
|
expects: "Array",
|
|
195
210
|
async: !1,
|
|
196
211
|
item: n,
|
|
@@ -204,17 +219,17 @@ function F(n, r) {
|
|
|
204
219
|
if (Array.isArray(t)) {
|
|
205
220
|
e.typed = !0, e.value = [];
|
|
206
221
|
for (let u = 0; u < t.length; u++) {
|
|
207
|
-
const
|
|
222
|
+
const p = t[u], i = this.item["~run"]({ value: p }, s);
|
|
208
223
|
if (i.issues) {
|
|
209
|
-
const
|
|
224
|
+
const c = {
|
|
210
225
|
type: "array",
|
|
211
226
|
origin: "value",
|
|
212
227
|
input: t,
|
|
213
228
|
key: u,
|
|
214
|
-
value:
|
|
229
|
+
value: p
|
|
215
230
|
};
|
|
216
|
-
for (const
|
|
217
|
-
|
|
231
|
+
for (const a of i.issues)
|
|
232
|
+
a.path ? a.path.unshift(c) : a.path = [c], (l = e.issues) == null || l.push(a);
|
|
218
233
|
if (e.issues || (e.issues = i.issues), s.abortEarly) {
|
|
219
234
|
e.typed = !1;
|
|
220
235
|
break;
|
|
@@ -228,11 +243,11 @@ function F(n, r) {
|
|
|
228
243
|
};
|
|
229
244
|
}
|
|
230
245
|
// @__NO_SIDE_EFFECTS__
|
|
231
|
-
function
|
|
246
|
+
function B(n) {
|
|
232
247
|
return {
|
|
233
248
|
kind: "schema",
|
|
234
249
|
type: "boolean",
|
|
235
|
-
reference:
|
|
250
|
+
reference: B,
|
|
236
251
|
expects: "boolean",
|
|
237
252
|
async: !1,
|
|
238
253
|
message: n,
|
|
@@ -245,11 +260,11 @@ function R(n) {
|
|
|
245
260
|
};
|
|
246
261
|
}
|
|
247
262
|
// @__NO_SIDE_EFFECTS__
|
|
248
|
-
function
|
|
263
|
+
function H(n, r) {
|
|
249
264
|
return {
|
|
250
265
|
kind: "schema",
|
|
251
266
|
type: "custom",
|
|
252
|
-
reference:
|
|
267
|
+
reference: H,
|
|
253
268
|
expects: "unknown",
|
|
254
269
|
async: !1,
|
|
255
270
|
check: n,
|
|
@@ -263,11 +278,11 @@ function B(n, r) {
|
|
|
263
278
|
};
|
|
264
279
|
}
|
|
265
280
|
// @__NO_SIDE_EFFECTS__
|
|
266
|
-
function
|
|
281
|
+
function J(n) {
|
|
267
282
|
return {
|
|
268
283
|
kind: "schema",
|
|
269
284
|
type: "lazy",
|
|
270
|
-
reference:
|
|
285
|
+
reference: J,
|
|
271
286
|
expects: "unknown",
|
|
272
287
|
async: !1,
|
|
273
288
|
getter: n,
|
|
@@ -280,12 +295,12 @@ function H(n) {
|
|
|
280
295
|
};
|
|
281
296
|
}
|
|
282
297
|
// @__NO_SIDE_EFFECTS__
|
|
283
|
-
function
|
|
298
|
+
function Q(n, r) {
|
|
284
299
|
return {
|
|
285
300
|
kind: "schema",
|
|
286
301
|
type: "literal",
|
|
287
|
-
reference:
|
|
288
|
-
expects: /* @__PURE__ */
|
|
302
|
+
reference: Q,
|
|
303
|
+
expects: /* @__PURE__ */ D(n),
|
|
289
304
|
async: !1,
|
|
290
305
|
literal: n,
|
|
291
306
|
message: r,
|
|
@@ -298,11 +313,11 @@ function J(n, r) {
|
|
|
298
313
|
};
|
|
299
314
|
}
|
|
300
315
|
// @__NO_SIDE_EFFECTS__
|
|
301
|
-
function
|
|
316
|
+
function T(n, r) {
|
|
302
317
|
return {
|
|
303
318
|
kind: "schema",
|
|
304
319
|
type: "loose_object",
|
|
305
|
-
reference:
|
|
320
|
+
reference: T,
|
|
306
321
|
expects: "Object",
|
|
307
322
|
async: !1,
|
|
308
323
|
entries: n,
|
|
@@ -316,27 +331,27 @@ function Q(n, r) {
|
|
|
316
331
|
if (t && typeof t == "object") {
|
|
317
332
|
e.typed = !0, e.value = {};
|
|
318
333
|
for (const u in this.entries) {
|
|
319
|
-
const
|
|
320
|
-
if (u in t || (
|
|
321
|
-
const i = u in t ? t[u] : /* @__PURE__ */
|
|
322
|
-
if (
|
|
323
|
-
const
|
|
334
|
+
const p = this.entries[u];
|
|
335
|
+
if (u in t || (p.type === "exact_optional" || p.type === "optional" || p.type === "nullish") && p.default !== void 0) {
|
|
336
|
+
const i = u in t ? t[u] : /* @__PURE__ */ k(p), c = p["~run"]({ value: i }, s);
|
|
337
|
+
if (c.issues) {
|
|
338
|
+
const a = {
|
|
324
339
|
type: "object",
|
|
325
340
|
origin: "value",
|
|
326
341
|
input: t,
|
|
327
342
|
key: u,
|
|
328
343
|
value: i
|
|
329
344
|
};
|
|
330
|
-
for (const y of
|
|
331
|
-
y.path ? y.path.unshift(
|
|
332
|
-
if (e.issues || (e.issues =
|
|
345
|
+
for (const y of c.issues)
|
|
346
|
+
y.path ? y.path.unshift(a) : y.path = [a], (l = e.issues) == null || l.push(y);
|
|
347
|
+
if (e.issues || (e.issues = c.issues), s.abortEarly) {
|
|
333
348
|
e.typed = !1;
|
|
334
349
|
break;
|
|
335
350
|
}
|
|
336
351
|
}
|
|
337
|
-
|
|
338
|
-
} else if (
|
|
339
|
-
else if (
|
|
352
|
+
c.typed || (e.typed = !1), e.value[u] = c.value;
|
|
353
|
+
} else if (p.fallback !== void 0) e.value[u] = /* @__PURE__ */ P(p);
|
|
354
|
+
else if (p.type !== "exact_optional" && p.type !== "optional" && p.type !== "nullish" && (f(this, "key", e, s, {
|
|
340
355
|
input: void 0,
|
|
341
356
|
expected: `"${u}"`,
|
|
342
357
|
path: [{
|
|
@@ -350,18 +365,36 @@ function Q(n, r) {
|
|
|
350
365
|
break;
|
|
351
366
|
}
|
|
352
367
|
if (!e.issues || !s.abortEarly)
|
|
353
|
-
for (const u in t) /* @__PURE__ */
|
|
368
|
+
for (const u in t) /* @__PURE__ */ S(t, u) && !(u in this.entries) && (e.value[u] = t[u]);
|
|
354
369
|
} else f(this, "type", e, s);
|
|
355
370
|
return e;
|
|
356
371
|
}
|
|
357
372
|
};
|
|
358
373
|
}
|
|
359
374
|
// @__NO_SIDE_EFFECTS__
|
|
360
|
-
function
|
|
375
|
+
function U(n, r) {
|
|
376
|
+
return {
|
|
377
|
+
kind: "schema",
|
|
378
|
+
type: "nullable",
|
|
379
|
+
reference: U,
|
|
380
|
+
expects: `(${n.expects} | null)`,
|
|
381
|
+
async: !1,
|
|
382
|
+
wrapped: n,
|
|
383
|
+
default: r,
|
|
384
|
+
get "~standard"() {
|
|
385
|
+
return /* @__PURE__ */ o(this);
|
|
386
|
+
},
|
|
387
|
+
"~run"(e, s) {
|
|
388
|
+
return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */ k(this, e, s)), e.value === null) ? (e.typed = !0, e) : this.wrapped["~run"](e, s);
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
// @__NO_SIDE_EFFECTS__
|
|
393
|
+
function W(n, r) {
|
|
361
394
|
return {
|
|
362
395
|
kind: "schema",
|
|
363
396
|
type: "nullish",
|
|
364
|
-
reference:
|
|
397
|
+
reference: W,
|
|
365
398
|
expects: `(${n.expects} | null | undefined)`,
|
|
366
399
|
async: !1,
|
|
367
400
|
wrapped: n,
|
|
@@ -370,16 +403,16 @@ function T(n, r) {
|
|
|
370
403
|
return /* @__PURE__ */ o(this);
|
|
371
404
|
},
|
|
372
405
|
"~run"(e, s) {
|
|
373
|
-
return (e.value === null || e.value === void 0) && (this.default !== void 0 && (e.value = /* @__PURE__ */
|
|
406
|
+
return (e.value === null || e.value === void 0) && (this.default !== void 0 && (e.value = /* @__PURE__ */ k(this, e, s)), e.value === null || e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, s);
|
|
374
407
|
}
|
|
375
408
|
};
|
|
376
409
|
}
|
|
377
410
|
// @__NO_SIDE_EFFECTS__
|
|
378
|
-
function
|
|
411
|
+
function X(n) {
|
|
379
412
|
return {
|
|
380
413
|
kind: "schema",
|
|
381
414
|
type: "number",
|
|
382
|
-
reference:
|
|
415
|
+
reference: X,
|
|
383
416
|
expects: "number",
|
|
384
417
|
async: !1,
|
|
385
418
|
message: n,
|
|
@@ -392,11 +425,11 @@ function U(n) {
|
|
|
392
425
|
};
|
|
393
426
|
}
|
|
394
427
|
// @__NO_SIDE_EFFECTS__
|
|
395
|
-
function
|
|
428
|
+
function Y(n, r) {
|
|
396
429
|
return {
|
|
397
430
|
kind: "schema",
|
|
398
431
|
type: "object",
|
|
399
|
-
reference:
|
|
432
|
+
reference: Y,
|
|
400
433
|
expects: "Object",
|
|
401
434
|
async: !1,
|
|
402
435
|
entries: n,
|
|
@@ -410,27 +443,27 @@ function W(n, r) {
|
|
|
410
443
|
if (t && typeof t == "object") {
|
|
411
444
|
e.typed = !0, e.value = {};
|
|
412
445
|
for (const u in this.entries) {
|
|
413
|
-
const
|
|
414
|
-
if (u in t || (
|
|
415
|
-
const i = u in t ? t[u] : /* @__PURE__ */
|
|
416
|
-
if (
|
|
417
|
-
const
|
|
446
|
+
const p = this.entries[u];
|
|
447
|
+
if (u in t || (p.type === "exact_optional" || p.type === "optional" || p.type === "nullish") && p.default !== void 0) {
|
|
448
|
+
const i = u in t ? t[u] : /* @__PURE__ */ k(p), c = p["~run"]({ value: i }, s);
|
|
449
|
+
if (c.issues) {
|
|
450
|
+
const a = {
|
|
418
451
|
type: "object",
|
|
419
452
|
origin: "value",
|
|
420
453
|
input: t,
|
|
421
454
|
key: u,
|
|
422
455
|
value: i
|
|
423
456
|
};
|
|
424
|
-
for (const y of
|
|
425
|
-
y.path ? y.path.unshift(
|
|
426
|
-
if (e.issues || (e.issues =
|
|
457
|
+
for (const y of c.issues)
|
|
458
|
+
y.path ? y.path.unshift(a) : y.path = [a], (l = e.issues) == null || l.push(y);
|
|
459
|
+
if (e.issues || (e.issues = c.issues), s.abortEarly) {
|
|
427
460
|
e.typed = !1;
|
|
428
461
|
break;
|
|
429
462
|
}
|
|
430
463
|
}
|
|
431
|
-
|
|
432
|
-
} else if (
|
|
433
|
-
else if (
|
|
464
|
+
c.typed || (e.typed = !1), e.value[u] = c.value;
|
|
465
|
+
} else if (p.fallback !== void 0) e.value[u] = /* @__PURE__ */ P(p);
|
|
466
|
+
else if (p.type !== "exact_optional" && p.type !== "optional" && p.type !== "nullish" && (f(this, "key", e, s, {
|
|
434
467
|
input: void 0,
|
|
435
468
|
expected: `"${u}"`,
|
|
436
469
|
path: [{
|
|
@@ -449,11 +482,11 @@ function W(n, r) {
|
|
|
449
482
|
};
|
|
450
483
|
}
|
|
451
484
|
// @__NO_SIDE_EFFECTS__
|
|
452
|
-
function
|
|
485
|
+
function Z(n, r) {
|
|
453
486
|
return {
|
|
454
487
|
kind: "schema",
|
|
455
488
|
type: "optional",
|
|
456
|
-
reference:
|
|
489
|
+
reference: Z,
|
|
457
490
|
expects: `(${n.expects} | undefined)`,
|
|
458
491
|
async: !1,
|
|
459
492
|
wrapped: n,
|
|
@@ -462,17 +495,17 @@ function X(n, r) {
|
|
|
462
495
|
return /* @__PURE__ */ o(this);
|
|
463
496
|
},
|
|
464
497
|
"~run"(e, s) {
|
|
465
|
-
return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */
|
|
498
|
+
return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ k(this, e, s)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, s);
|
|
466
499
|
}
|
|
467
500
|
};
|
|
468
501
|
}
|
|
469
502
|
// @__NO_SIDE_EFFECTS__
|
|
470
|
-
function
|
|
503
|
+
function $(n, r) {
|
|
471
504
|
return {
|
|
472
505
|
kind: "schema",
|
|
473
506
|
type: "picklist",
|
|
474
|
-
reference:
|
|
475
|
-
expects: /* @__PURE__ */
|
|
507
|
+
reference: $,
|
|
508
|
+
expects: /* @__PURE__ */ w(n.map(D), "|"),
|
|
476
509
|
async: !1,
|
|
477
510
|
options: n,
|
|
478
511
|
message: r,
|
|
@@ -485,11 +518,11 @@ function Y(n, r) {
|
|
|
485
518
|
};
|
|
486
519
|
}
|
|
487
520
|
// @__NO_SIDE_EFFECTS__
|
|
488
|
-
function
|
|
521
|
+
function ee(n, r, e) {
|
|
489
522
|
return {
|
|
490
523
|
kind: "schema",
|
|
491
524
|
type: "record",
|
|
492
|
-
reference:
|
|
525
|
+
reference: ee,
|
|
493
526
|
expects: "Object",
|
|
494
527
|
async: !1,
|
|
495
528
|
key: n,
|
|
@@ -499,44 +532,44 @@ function Z(n, r, e) {
|
|
|
499
532
|
return /* @__PURE__ */ o(this);
|
|
500
533
|
},
|
|
501
534
|
"~run"(s, t) {
|
|
502
|
-
var u,
|
|
535
|
+
var u, p;
|
|
503
536
|
const l = s.value;
|
|
504
537
|
if (l && typeof l == "object") {
|
|
505
538
|
s.typed = !0, s.value = {};
|
|
506
|
-
for (const i in l) if (/* @__PURE__ */
|
|
507
|
-
const
|
|
508
|
-
if (
|
|
539
|
+
for (const i in l) if (/* @__PURE__ */ S(l, i)) {
|
|
540
|
+
const c = l[i], a = this.key["~run"]({ value: i }, t);
|
|
541
|
+
if (a.issues) {
|
|
509
542
|
const b = {
|
|
510
543
|
type: "object",
|
|
511
544
|
origin: "key",
|
|
512
545
|
input: l,
|
|
513
546
|
key: i,
|
|
514
|
-
value:
|
|
547
|
+
value: c
|
|
515
548
|
};
|
|
516
|
-
for (const h of
|
|
549
|
+
for (const h of a.issues)
|
|
517
550
|
h.path = [b], (u = s.issues) == null || u.push(h);
|
|
518
|
-
if (s.issues || (s.issues =
|
|
551
|
+
if (s.issues || (s.issues = a.issues), t.abortEarly) {
|
|
519
552
|
s.typed = !1;
|
|
520
553
|
break;
|
|
521
554
|
}
|
|
522
555
|
}
|
|
523
|
-
const y = this.value["~run"]({ value:
|
|
556
|
+
const y = this.value["~run"]({ value: c }, t);
|
|
524
557
|
if (y.issues) {
|
|
525
558
|
const b = {
|
|
526
559
|
type: "object",
|
|
527
560
|
origin: "value",
|
|
528
561
|
input: l,
|
|
529
562
|
key: i,
|
|
530
|
-
value:
|
|
563
|
+
value: c
|
|
531
564
|
};
|
|
532
565
|
for (const h of y.issues)
|
|
533
|
-
h.path ? h.path.unshift(b) : h.path = [b], (
|
|
566
|
+
h.path ? h.path.unshift(b) : h.path = [b], (p = s.issues) == null || p.push(h);
|
|
534
567
|
if (s.issues || (s.issues = y.issues), t.abortEarly) {
|
|
535
568
|
s.typed = !1;
|
|
536
569
|
break;
|
|
537
570
|
}
|
|
538
571
|
}
|
|
539
|
-
(!
|
|
572
|
+
(!a.typed || !y.typed) && (s.typed = !1), a.typed && (s.value[a.value] = y.value);
|
|
540
573
|
}
|
|
541
574
|
} else f(this, "type", s, t);
|
|
542
575
|
return s;
|
|
@@ -544,11 +577,11 @@ function Z(n, r, e) {
|
|
|
544
577
|
};
|
|
545
578
|
}
|
|
546
579
|
// @__NO_SIDE_EFFECTS__
|
|
547
|
-
function
|
|
580
|
+
function ne(n) {
|
|
548
581
|
return {
|
|
549
582
|
kind: "schema",
|
|
550
583
|
type: "string",
|
|
551
|
-
reference:
|
|
584
|
+
reference: ne,
|
|
552
585
|
expects: "string",
|
|
553
586
|
async: !1,
|
|
554
587
|
message: n,
|
|
@@ -561,18 +594,60 @@ function $(n) {
|
|
|
561
594
|
};
|
|
562
595
|
}
|
|
563
596
|
// @__NO_SIDE_EFFECTS__
|
|
564
|
-
function
|
|
597
|
+
function re(n, r) {
|
|
598
|
+
return {
|
|
599
|
+
kind: "schema",
|
|
600
|
+
type: "tuple",
|
|
601
|
+
reference: re,
|
|
602
|
+
expects: "Array",
|
|
603
|
+
async: !1,
|
|
604
|
+
items: n,
|
|
605
|
+
message: r,
|
|
606
|
+
get "~standard"() {
|
|
607
|
+
return /* @__PURE__ */ o(this);
|
|
608
|
+
},
|
|
609
|
+
"~run"(e, s) {
|
|
610
|
+
var l;
|
|
611
|
+
const t = e.value;
|
|
612
|
+
if (Array.isArray(t)) {
|
|
613
|
+
e.typed = !0, e.value = [];
|
|
614
|
+
for (let u = 0; u < this.items.length; u++) {
|
|
615
|
+
const p = t[u], i = this.items[u]["~run"]({ value: p }, s);
|
|
616
|
+
if (i.issues) {
|
|
617
|
+
const c = {
|
|
618
|
+
type: "array",
|
|
619
|
+
origin: "value",
|
|
620
|
+
input: t,
|
|
621
|
+
key: u,
|
|
622
|
+
value: p
|
|
623
|
+
};
|
|
624
|
+
for (const a of i.issues)
|
|
625
|
+
a.path ? a.path.unshift(c) : a.path = [c], (l = e.issues) == null || l.push(a);
|
|
626
|
+
if (e.issues || (e.issues = i.issues), s.abortEarly) {
|
|
627
|
+
e.typed = !1;
|
|
628
|
+
break;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
i.typed || (e.typed = !1), e.value.push(i.value);
|
|
632
|
+
}
|
|
633
|
+
} else f(this, "type", e, s);
|
|
634
|
+
return e;
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
// @__NO_SIDE_EFFECTS__
|
|
639
|
+
function A(n) {
|
|
565
640
|
let r;
|
|
566
641
|
if (n) for (const e of n) r ? r.push(...e.issues) : r = e.issues;
|
|
567
642
|
return r;
|
|
568
643
|
}
|
|
569
644
|
// @__NO_SIDE_EFFECTS__
|
|
570
|
-
function
|
|
645
|
+
function se(n, r) {
|
|
571
646
|
return {
|
|
572
647
|
kind: "schema",
|
|
573
648
|
type: "union",
|
|
574
|
-
reference:
|
|
575
|
-
expects: /* @__PURE__ */
|
|
649
|
+
reference: se,
|
|
650
|
+
expects: /* @__PURE__ */ w(n.map((e) => e.expects), "|"),
|
|
576
651
|
async: !1,
|
|
577
652
|
options: n,
|
|
578
653
|
message: r,
|
|
@@ -581,8 +656,8 @@ function ee(n, r) {
|
|
|
581
656
|
},
|
|
582
657
|
"~run"(e, s) {
|
|
583
658
|
let t, l, u;
|
|
584
|
-
for (const
|
|
585
|
-
const i =
|
|
659
|
+
for (const p of this.options) {
|
|
660
|
+
const i = p["~run"]({ value: e.value }, s);
|
|
586
661
|
if (i.typed) if (i.issues) l ? l.push(i) : l = [i];
|
|
587
662
|
else {
|
|
588
663
|
t = i;
|
|
@@ -593,21 +668,21 @@ function ee(n, r) {
|
|
|
593
668
|
if (t) return t;
|
|
594
669
|
if (l) {
|
|
595
670
|
if (l.length === 1) return l[0];
|
|
596
|
-
f(this, "type", e, s, { issues: /* @__PURE__ */
|
|
671
|
+
f(this, "type", e, s, { issues: /* @__PURE__ */ A(l) }), e.typed = !0;
|
|
597
672
|
} else {
|
|
598
673
|
if ((u == null ? void 0 : u.length) === 1) return u[0];
|
|
599
|
-
f(this, "type", e, s, { issues: /* @__PURE__ */
|
|
674
|
+
f(this, "type", e, s, { issues: /* @__PURE__ */ A(u) });
|
|
600
675
|
}
|
|
601
676
|
return e;
|
|
602
677
|
}
|
|
603
678
|
};
|
|
604
679
|
}
|
|
605
680
|
// @__NO_SIDE_EFFECTS__
|
|
606
|
-
function
|
|
681
|
+
function te() {
|
|
607
682
|
return {
|
|
608
683
|
kind: "schema",
|
|
609
684
|
type: "unknown",
|
|
610
|
-
reference:
|
|
685
|
+
reference: te,
|
|
611
686
|
expects: "unknown",
|
|
612
687
|
async: !1,
|
|
613
688
|
get "~standard"() {
|
|
@@ -619,11 +694,11 @@ function ne() {
|
|
|
619
694
|
};
|
|
620
695
|
}
|
|
621
696
|
// @__NO_SIDE_EFFECTS__
|
|
622
|
-
function
|
|
697
|
+
function ue(n, r, e) {
|
|
623
698
|
return {
|
|
624
699
|
kind: "schema",
|
|
625
700
|
type: "variant",
|
|
626
|
-
reference:
|
|
701
|
+
reference: ue,
|
|
627
702
|
expects: "Object",
|
|
628
703
|
async: !1,
|
|
629
704
|
key: n,
|
|
@@ -635,22 +710,22 @@ function re(n, r, e) {
|
|
|
635
710
|
"~run"(s, t) {
|
|
636
711
|
const l = s.value;
|
|
637
712
|
if (l && typeof l == "object") {
|
|
638
|
-
let u,
|
|
639
|
-
const
|
|
713
|
+
let u, p = 0, i = this.key, c = [];
|
|
714
|
+
const a = (y, b) => {
|
|
640
715
|
for (const h of y.options) {
|
|
641
|
-
if (h.type === "variant")
|
|
716
|
+
if (h.type === "variant") a(h, new Set(b).add(h.key));
|
|
642
717
|
else {
|
|
643
|
-
let O = !0,
|
|
718
|
+
let O = !0, g = 0;
|
|
644
719
|
for (const v of b) {
|
|
645
720
|
const d = h.entries[v];
|
|
646
721
|
if (v in l ? d["~run"]({
|
|
647
722
|
typed: !1,
|
|
648
723
|
value: l[v]
|
|
649
724
|
}, { abortEarly: !0 }).issues : d.type !== "exact_optional" && d.type !== "optional" && d.type !== "nullish") {
|
|
650
|
-
O = !1, i !== v && (
|
|
725
|
+
O = !1, i !== v && (p < g || p === g && v in l && !(i in l)) && (p = g, i = v, c = []), i === v && c.push(h.entries[v].expects);
|
|
651
726
|
break;
|
|
652
727
|
}
|
|
653
|
-
|
|
728
|
+
g++;
|
|
654
729
|
}
|
|
655
730
|
if (O) {
|
|
656
731
|
const v = h["~run"]({ value: l }, t);
|
|
@@ -660,10 +735,10 @@ function re(n, r, e) {
|
|
|
660
735
|
if (u && !u.issues) break;
|
|
661
736
|
}
|
|
662
737
|
};
|
|
663
|
-
if (
|
|
738
|
+
if (a(this, /* @__PURE__ */ new Set([this.key])), u) return u;
|
|
664
739
|
f(this, "type", s, t, {
|
|
665
740
|
input: l[i],
|
|
666
|
-
expected: /* @__PURE__ */
|
|
741
|
+
expected: /* @__PURE__ */ w(c, "|"),
|
|
667
742
|
path: [{
|
|
668
743
|
type: "object",
|
|
669
744
|
origin: "value",
|
|
@@ -677,13 +752,13 @@ function re(n, r, e) {
|
|
|
677
752
|
}
|
|
678
753
|
};
|
|
679
754
|
}
|
|
680
|
-
function
|
|
681
|
-
const s = n["~run"]({ value: r }, /* @__PURE__ */
|
|
755
|
+
function le(n, r, e) {
|
|
756
|
+
const s = n["~run"]({ value: r }, /* @__PURE__ */ x(e));
|
|
682
757
|
if (s.issues) throw new K(s.issues);
|
|
683
758
|
return s.value;
|
|
684
759
|
}
|
|
685
760
|
// @__NO_SIDE_EFFECTS__
|
|
686
|
-
function
|
|
761
|
+
function pe(...n) {
|
|
687
762
|
return {
|
|
688
763
|
...n[0],
|
|
689
764
|
pipe: n,
|
|
@@ -703,7 +778,7 @@ function ue(...n) {
|
|
|
703
778
|
};
|
|
704
779
|
}
|
|
705
780
|
// @__NO_SIDE_EFFECTS__
|
|
706
|
-
function
|
|
781
|
+
function ae(...n) {
|
|
707
782
|
return {
|
|
708
783
|
...n[0],
|
|
709
784
|
pipe: n,
|
|
@@ -724,8 +799,8 @@ function ie(...n) {
|
|
|
724
799
|
};
|
|
725
800
|
}
|
|
726
801
|
// @__NO_SIDE_EFFECTS__
|
|
727
|
-
function
|
|
728
|
-
const s = n["~run"]({ value: r }, /* @__PURE__ */
|
|
802
|
+
function ce(n, r, e) {
|
|
803
|
+
const s = n["~run"]({ value: r }, /* @__PURE__ */ x(e));
|
|
729
804
|
return {
|
|
730
805
|
typed: s.typed,
|
|
731
806
|
success: !s.issues,
|
|
@@ -734,8 +809,8 @@ function le(n, r, e) {
|
|
|
734
809
|
};
|
|
735
810
|
}
|
|
736
811
|
// @__NO_SIDE_EFFECTS__
|
|
737
|
-
async function
|
|
738
|
-
const s = await n["~run"]({ value: r }, /* @__PURE__ */
|
|
812
|
+
async function fe(n, r, e) {
|
|
813
|
+
const s = await n["~run"]({ value: r }, /* @__PURE__ */ x(e));
|
|
739
814
|
return {
|
|
740
815
|
typed: s.typed,
|
|
741
816
|
success: !s.issues,
|
|
@@ -747,41 +822,44 @@ export {
|
|
|
747
822
|
K as ValiError,
|
|
748
823
|
f as _addIssue,
|
|
749
824
|
o as _getStandardProps,
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
M as
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
825
|
+
S as _isValidObjectKey,
|
|
826
|
+
w as _joinExpects,
|
|
827
|
+
D as _stringify,
|
|
828
|
+
R as array,
|
|
829
|
+
B as boolean,
|
|
830
|
+
M as check,
|
|
831
|
+
z as checkAsync,
|
|
832
|
+
H as custom,
|
|
833
|
+
ie as fallback,
|
|
834
|
+
k as getDefault,
|
|
759
835
|
P as getFallback,
|
|
760
|
-
|
|
761
|
-
|
|
836
|
+
x as getGlobalConfig,
|
|
837
|
+
I as getGlobalMessage,
|
|
762
838
|
V as getSchemaMessage,
|
|
763
839
|
q as getSpecificMessage,
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
C as
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
840
|
+
J as lazy,
|
|
841
|
+
Q as literal,
|
|
842
|
+
T as looseObject,
|
|
843
|
+
G as maxLength,
|
|
844
|
+
L as minLength,
|
|
845
|
+
N as nonEmpty,
|
|
846
|
+
U as nullable,
|
|
847
|
+
W as nullish,
|
|
848
|
+
X as number,
|
|
849
|
+
Y as object,
|
|
850
|
+
Z as optional,
|
|
851
|
+
le as parse,
|
|
852
|
+
$ as picklist,
|
|
853
|
+
pe as pipe,
|
|
854
|
+
ae as pipeAsync,
|
|
855
|
+
ee as record,
|
|
856
|
+
ce as safeParse,
|
|
857
|
+
fe as safeParseAsync,
|
|
858
|
+
ne as string,
|
|
859
|
+
C as transform,
|
|
860
|
+
F as trim,
|
|
861
|
+
re as tuple,
|
|
862
|
+
se as union,
|
|
863
|
+
te as unknown,
|
|
864
|
+
ue as variant
|
|
787
865
|
};
|