storybook 9.0.0-beta.8 → 9.0.0-rc.0
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/assets/server/base-preview-head.html +21 -0
- package/assets/server/template.ejs +4 -4
- package/dist/actions/preview.cjs +1 -1
- package/dist/actions/preview.d.ts +501 -0
- package/dist/actions/preview.js +1 -1
- package/dist/backgrounds/index.d.ts +501 -0
- package/dist/backgrounds/preview.d.ts +501 -0
- package/dist/bin/index.cjs +61 -61
- package/dist/bin/index.js +59 -59
- package/dist/builder-manager/index.cjs +208 -203
- package/dist/builder-manager/index.js +492 -487
- package/dist/channels/index.js +919 -941
- package/dist/cli/bin/index.cjs +1032 -1032
- package/dist/cli/bin/index.js +1032 -1032
- package/dist/cli/index.cjs +33709 -28783
- package/dist/cli/index.js +33641 -28711
- package/dist/common/index.cjs +2802 -2789
- package/dist/common/index.d.ts +2 -1
- package/dist/common/index.js +3250 -3237
- package/dist/components/index.cjs +711 -711
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +2266 -2272
- package/dist/controls/preview.d.ts +501 -0
- package/dist/core-events/index.cjs +55 -52
- package/dist/core-events/index.d.ts +3 -1
- package/dist/core-events/index.js +52 -49
- package/dist/core-server/index.cjs +3066 -3037
- package/dist/core-server/index.d.ts +512 -11
- package/dist/core-server/index.js +3271 -3241
- package/dist/core-server/presets/common-manager.js +4570 -5779
- package/dist/core-server/presets/common-override-preset.cjs +10 -12
- package/dist/core-server/presets/common-override-preset.js +3 -5
- package/dist/core-server/presets/common-preset.cjs +112 -116
- package/dist/core-server/presets/common-preset.js +10 -14
- package/dist/csf/index.d.ts +1 -1
- package/dist/csf-tools/index.cjs +116 -111
- package/dist/csf-tools/index.js +33 -28
- package/dist/docs-tools/index.js +596 -603
- package/dist/highlight/preview.d.ts +501 -0
- package/dist/instrumenter/index.js +1851 -3554
- package/dist/manager/globals-module-info.cjs +3 -0
- package/dist/manager/globals-module-info.js +3 -0
- package/dist/manager/globals-runtime.js +21347 -23051
- package/dist/manager/runtime.js +2510 -2498
- package/dist/manager-api/index.cjs +2302 -8594
- package/dist/manager-api/index.d.ts +501 -0
- package/dist/manager-api/index.js +2655 -2715
- package/dist/manager-errors.js +37 -41
- package/dist/measure/index.d.ts +501 -0
- package/dist/measure/preview.d.ts +501 -0
- package/dist/outline/index.d.ts +501 -0
- package/dist/outline/preview.d.ts +501 -0
- package/dist/preview/runtime.js +38393 -40149
- package/dist/preview-api/index.cjs +1546 -1459
- package/dist/preview-api/index.d.ts +8 -5
- package/dist/preview-api/index.js +1273 -1203
- package/dist/preview-errors.js +152 -173
- package/dist/router/index.cjs +5700 -2327
- package/dist/router/index.d.ts +622 -243
- package/dist/router/index.js +1297 -870
- package/dist/test/index.cjs +1810 -1811
- package/dist/test/index.d.ts +53 -5
- package/dist/test/index.js +7614 -7703
- package/dist/test/preview.cjs +51 -15860
- package/dist/test/preview.d.ts +520 -13
- package/dist/test/preview.js +44 -14491
- package/dist/theming/index.cjs +17 -0
- package/dist/theming/index.js +17 -0
- package/dist/types/index.d.ts +516 -82
- package/dist/viewport/index.d.ts +502 -3
- package/dist/viewport/preview.d.ts +501 -0
- package/package.json +3 -18
- package/dist/test/spy.cjs +0 -258
- package/dist/test/spy.d.ts +0 -62
- package/dist/test/spy.js +0 -240
package/dist/cli/bin/index.js
CHANGED
|
@@ -4,32 +4,32 @@ import { dirname as ESM_COMPAT_dirname } from 'node:path';
|
|
|
4
4
|
const __filename = ESM_COMPAT_fileURLToPath(import.meta.url);
|
|
5
5
|
const __dirname = ESM_COMPAT_dirname(__filename);
|
|
6
6
|
const require = ESM_COMPAT_Module.createRequire(import.meta.url);
|
|
7
|
-
var
|
|
7
|
+
var Sr = Object.create;
|
|
8
8
|
var Qe = Object.defineProperty;
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var d = (
|
|
13
|
-
"u" ? new Proxy(
|
|
9
|
+
var Rr = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var Zr = Object.getOwnPropertyNames;
|
|
11
|
+
var Pr = Object.getPrototypeOf, Nr = Object.prototype.hasOwnProperty;
|
|
12
|
+
var d = (s, e) => Qe(s, "name", { value: e, configurable: !0 }), me = /* @__PURE__ */ ((s) => typeof require < "u" ? require : typeof Proxy <
|
|
13
|
+
"u" ? new Proxy(s, {
|
|
14
14
|
get: (e, t) => (typeof require < "u" ? require : e)[t]
|
|
15
|
-
}) :
|
|
15
|
+
}) : s)(function(s) {
|
|
16
16
|
if (typeof require < "u") return require.apply(this, arguments);
|
|
17
|
-
throw Error('Dynamic require of "' +
|
|
17
|
+
throw Error('Dynamic require of "' + s + '" is not supported');
|
|
18
18
|
});
|
|
19
|
-
var O = (
|
|
20
|
-
var
|
|
19
|
+
var O = (s, e) => () => (e || s((e = { exports: {} }).exports, e), e.exports);
|
|
20
|
+
var Vr = (s, e, t, r) => {
|
|
21
21
|
if (e && typeof e == "object" || typeof e == "function")
|
|
22
|
-
for (let i of
|
|
23
|
-
!
|
|
24
|
-
return
|
|
22
|
+
for (let i of Zr(e))
|
|
23
|
+
!Nr.call(s, i) && i !== t && Qe(s, i, { get: () => e[i], enumerable: !(r = Rr(e, i)) || r.enumerable });
|
|
24
|
+
return s;
|
|
25
25
|
};
|
|
26
|
-
var fe = (
|
|
26
|
+
var fe = (s, e, t) => (t = s != null ? Sr(Pr(s)) : {}, Vr(
|
|
27
27
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
28
28
|
// file that has been converted to a CommonJS file using a Babel-
|
|
29
29
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
30
30
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
31
|
-
e || !
|
|
32
|
-
|
|
31
|
+
e || !s || !s.__esModule ? Qe(t, "default", { value: s, enumerable: !0 }) : t,
|
|
32
|
+
s
|
|
33
33
|
));
|
|
34
34
|
|
|
35
35
|
// ../node_modules/commander/lib/error.js
|
|
@@ -44,8 +44,8 @@ var Oe = O((tt) => {
|
|
|
44
44
|
* @param {string} code an id string representing the error
|
|
45
45
|
* @param {string} message human-readable description of the error
|
|
46
46
|
*/
|
|
47
|
-
constructor(e, t,
|
|
48
|
-
super(
|
|
47
|
+
constructor(e, t, r) {
|
|
48
|
+
super(r), Error.captureStackTrace(this, this.constructor), this.name = this.constructor.name, this.code = t, this.exitCode = e, this.nestedError =
|
|
49
49
|
void 0;
|
|
50
50
|
}
|
|
51
51
|
}, et = class extends Ve {
|
|
@@ -65,8 +65,8 @@ var Oe = O((tt) => {
|
|
|
65
65
|
});
|
|
66
66
|
|
|
67
67
|
// ../node_modules/commander/lib/argument.js
|
|
68
|
-
var De = O((
|
|
69
|
-
var { InvalidArgumentError:
|
|
68
|
+
var De = O((st) => {
|
|
69
|
+
var { InvalidArgumentError: Dr } = Oe(), rt = class {
|
|
70
70
|
static {
|
|
71
71
|
d(this, "Argument");
|
|
72
72
|
}
|
|
@@ -133,12 +133,12 @@ var De = O((rt) => {
|
|
|
133
133
|
* @return {Argument}
|
|
134
134
|
*/
|
|
135
135
|
choices(e) {
|
|
136
|
-
return this.argChoices = e.slice(), this.parseArg = (t,
|
|
136
|
+
return this.argChoices = e.slice(), this.parseArg = (t, r) => {
|
|
137
137
|
if (!this.argChoices.includes(t))
|
|
138
|
-
throw new
|
|
138
|
+
throw new Dr(
|
|
139
139
|
`Allowed choices are ${this.argChoices.join(", ")}.`
|
|
140
140
|
);
|
|
141
|
-
return this.variadic ? this._concatValue(t,
|
|
141
|
+
return this.variadic ? this._concatValue(t, r) : t;
|
|
142
142
|
}, this;
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
@@ -158,18 +158,18 @@ var De = O((rt) => {
|
|
|
158
158
|
return this.required = !1, this;
|
|
159
159
|
}
|
|
160
160
|
};
|
|
161
|
-
function $s
|
|
162
|
-
let e =
|
|
163
|
-
return
|
|
161
|
+
function $r(s) {
|
|
162
|
+
let e = s.name() + (s.variadic === !0 ? "..." : "");
|
|
163
|
+
return s.required ? "<" + e + ">" : "[" + e + "]";
|
|
164
164
|
}
|
|
165
|
-
d($
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
d($r, "humanReadableArgName");
|
|
166
|
+
st.Argument = rt;
|
|
167
|
+
st.humanReadableArgName = $r;
|
|
168
168
|
});
|
|
169
169
|
|
|
170
170
|
// ../node_modules/commander/lib/help.js
|
|
171
171
|
var nt = O((Zt) => {
|
|
172
|
-
var { humanReadableArgName:
|
|
172
|
+
var { humanReadableArgName: Mr } = De(), it = class {
|
|
173
173
|
static {
|
|
174
174
|
d(this, "Help");
|
|
175
175
|
}
|
|
@@ -183,8 +183,8 @@ var nt = O((Zt) => {
|
|
|
183
183
|
* @returns {Command[]}
|
|
184
184
|
*/
|
|
185
185
|
visibleCommands(e) {
|
|
186
|
-
let t = e.commands.filter((i) => !i._hidden),
|
|
187
|
-
return
|
|
186
|
+
let t = e.commands.filter((i) => !i._hidden), r = e._getHelpCommand();
|
|
187
|
+
return r && !r._hidden && t.push(r), this.sortSubcommands && t.sort((i, n) => i.name().localeCompare(n.name())), t;
|
|
188
188
|
}
|
|
189
189
|
/**
|
|
190
190
|
* Compare options for sort.
|
|
@@ -194,8 +194,8 @@ var nt = O((Zt) => {
|
|
|
194
194
|
* @returns {number}
|
|
195
195
|
*/
|
|
196
196
|
compareOptions(e, t) {
|
|
197
|
-
let
|
|
198
|
-
return
|
|
197
|
+
let r = /* @__PURE__ */ d((i) => i.short ? i.short.replace(/^-/, "") : i.long.replace(/^--/, ""), "getSortKey");
|
|
198
|
+
return r(e).localeCompare(r(t));
|
|
199
199
|
}
|
|
200
200
|
/**
|
|
201
201
|
* Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.
|
|
@@ -204,13 +204,13 @@ var nt = O((Zt) => {
|
|
|
204
204
|
* @returns {Option[]}
|
|
205
205
|
*/
|
|
206
206
|
visibleOptions(e) {
|
|
207
|
-
let t = e.options.filter((i) => !i.hidden),
|
|
208
|
-
if (
|
|
209
|
-
let i =
|
|
210
|
-
!i && !n ? t.push(
|
|
211
|
-
e.createOption(
|
|
212
|
-
) :
|
|
213
|
-
e.createOption(
|
|
207
|
+
let t = e.options.filter((i) => !i.hidden), r = e._getHelpOption();
|
|
208
|
+
if (r && !r.hidden) {
|
|
209
|
+
let i = r.short && e._findOption(r.short), n = r.long && e._findOption(r.long);
|
|
210
|
+
!i && !n ? t.push(r) : r.long && !n ? t.push(
|
|
211
|
+
e.createOption(r.long, r.description)
|
|
212
|
+
) : r.short && !i && t.push(
|
|
213
|
+
e.createOption(r.short, r.description)
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
216
|
return this.sortOptions && t.sort(this.compareOptions), t;
|
|
@@ -224,8 +224,8 @@ var nt = O((Zt) => {
|
|
|
224
224
|
visibleGlobalOptions(e) {
|
|
225
225
|
if (!this.showGlobalOptions) return [];
|
|
226
226
|
let t = [];
|
|
227
|
-
for (let
|
|
228
|
-
let i =
|
|
227
|
+
for (let r = e.parent; r; r = r.parent) {
|
|
228
|
+
let i = r.options.filter(
|
|
229
229
|
(n) => !n.hidden
|
|
230
230
|
);
|
|
231
231
|
t.push(...i);
|
|
@@ -250,7 +250,7 @@ var nt = O((Zt) => {
|
|
|
250
250
|
* @returns {string}
|
|
251
251
|
*/
|
|
252
252
|
subcommandTerm(e) {
|
|
253
|
-
let t = e.registeredArguments.map((
|
|
253
|
+
let t = e.registeredArguments.map((r) => Mr(r)).join(" ");
|
|
254
254
|
return e._name + (e._aliases[0] ? "|" + e._aliases[0] : "") + (e.options.length ? " [options]" : "") + // simplistic check for non-help option
|
|
255
255
|
(t ? " " + t : "");
|
|
256
256
|
}
|
|
@@ -280,7 +280,7 @@ var nt = O((Zt) => {
|
|
|
280
280
|
* @returns {number}
|
|
281
281
|
*/
|
|
282
282
|
longestSubcommandTermLength(e, t) {
|
|
283
|
-
return t.visibleCommands(e).reduce((
|
|
283
|
+
return t.visibleCommands(e).reduce((r, i) => Math.max(r, t.subcommandTerm(i).length), 0);
|
|
284
284
|
}
|
|
285
285
|
/**
|
|
286
286
|
* Get the longest option term length.
|
|
@@ -290,7 +290,7 @@ var nt = O((Zt) => {
|
|
|
290
290
|
* @returns {number}
|
|
291
291
|
*/
|
|
292
292
|
longestOptionTermLength(e, t) {
|
|
293
|
-
return t.visibleOptions(e).reduce((
|
|
293
|
+
return t.visibleOptions(e).reduce((r, i) => Math.max(r, t.optionTerm(i).length), 0);
|
|
294
294
|
}
|
|
295
295
|
/**
|
|
296
296
|
* Get the longest global option term length.
|
|
@@ -300,7 +300,7 @@ var nt = O((Zt) => {
|
|
|
300
300
|
* @returns {number}
|
|
301
301
|
*/
|
|
302
302
|
longestGlobalOptionTermLength(e, t) {
|
|
303
|
-
return t.visibleGlobalOptions(e).reduce((
|
|
303
|
+
return t.visibleGlobalOptions(e).reduce((r, i) => Math.max(r, t.optionTerm(i).length), 0);
|
|
304
304
|
}
|
|
305
305
|
/**
|
|
306
306
|
* Get the longest argument term length.
|
|
@@ -310,7 +310,7 @@ var nt = O((Zt) => {
|
|
|
310
310
|
* @returns {number}
|
|
311
311
|
*/
|
|
312
312
|
longestArgumentTermLength(e, t) {
|
|
313
|
-
return t.visibleArguments(e).reduce((
|
|
313
|
+
return t.visibleArguments(e).reduce((r, i) => Math.max(r, t.argumentTerm(i).length), 0);
|
|
314
314
|
}
|
|
315
315
|
/**
|
|
316
316
|
* Get the command usage to be displayed at the top of the built-in help.
|
|
@@ -321,10 +321,10 @@ var nt = O((Zt) => {
|
|
|
321
321
|
commandUsage(e) {
|
|
322
322
|
let t = e._name;
|
|
323
323
|
e._aliases[0] && (t = t + "|" + e._aliases[0]);
|
|
324
|
-
let
|
|
324
|
+
let r = "";
|
|
325
325
|
for (let i = e.parent; i; i = i.parent)
|
|
326
|
-
|
|
327
|
-
return
|
|
326
|
+
r = i.name() + " " + r;
|
|
327
|
+
return r + t + " " + e.usage();
|
|
328
328
|
}
|
|
329
329
|
/**
|
|
330
330
|
* Get the description for the command.
|
|
@@ -355,7 +355,7 @@ var nt = O((Zt) => {
|
|
|
355
355
|
let t = [];
|
|
356
356
|
return e.argChoices && t.push(
|
|
357
357
|
// use stringify to match the display of the default value
|
|
358
|
-
`choices: ${e.argChoices.map((
|
|
358
|
+
`choices: ${e.argChoices.map((r) => JSON.stringify(r)).join(", ")}`
|
|
359
359
|
), e.defaultValue !== void 0 && (e.required || e.optional || e.isBoolean() && typeof e.defaultValue == "boolean") && t.push(
|
|
360
360
|
`default: ${e.defaultValueDescription || JSON.stringify(e.defaultValue)}`
|
|
361
361
|
), e.presetArg !== void 0 && e.optional && t.push(`preset: ${JSON.stringify(e.presetArg)}`), e.envVar !== void 0 && t.push(`env: ${e.envVar}`),
|
|
@@ -371,12 +371,12 @@ var nt = O((Zt) => {
|
|
|
371
371
|
let t = [];
|
|
372
372
|
if (e.argChoices && t.push(
|
|
373
373
|
// use stringify to match the display of the default value
|
|
374
|
-
`choices: ${e.argChoices.map((
|
|
374
|
+
`choices: ${e.argChoices.map((r) => JSON.stringify(r)).join(", ")}`
|
|
375
375
|
), e.defaultValue !== void 0 && t.push(
|
|
376
376
|
`default: ${e.defaultValueDescription || JSON.stringify(e.defaultValue)}`
|
|
377
377
|
), t.length > 0) {
|
|
378
|
-
let
|
|
379
|
-
return e.description ? `${e.description} ${
|
|
378
|
+
let r = `(${t.join(", ")})`;
|
|
379
|
+
return e.description ? `${e.description} ${r}` : r;
|
|
380
380
|
}
|
|
381
381
|
return e.description;
|
|
382
382
|
}
|
|
@@ -388,14 +388,14 @@ var nt = O((Zt) => {
|
|
|
388
388
|
* @returns {string}
|
|
389
389
|
*/
|
|
390
390
|
formatHelp(e, t) {
|
|
391
|
-
let
|
|
391
|
+
let r = t.padWidth(e, t), i = t.helpWidth || 80, n = 2, o = 2;
|
|
392
392
|
function a(I, B) {
|
|
393
393
|
if (B) {
|
|
394
|
-
let Xe = `${I.padEnd(
|
|
394
|
+
let Xe = `${I.padEnd(r + o)}${B}`;
|
|
395
395
|
return t.wrap(
|
|
396
396
|
Xe,
|
|
397
397
|
i - n,
|
|
398
|
-
|
|
398
|
+
r + o
|
|
399
399
|
);
|
|
400
400
|
}
|
|
401
401
|
return I;
|
|
@@ -464,14 +464,14 @@ var nt = O((Zt) => {
|
|
|
464
464
|
* @return {string}
|
|
465
465
|
*
|
|
466
466
|
*/
|
|
467
|
-
wrap(e, t,
|
|
467
|
+
wrap(e, t, r, i = 40) {
|
|
468
468
|
let n = " \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF", o = new RegExp(`[\\n][${n}]+`);
|
|
469
469
|
if (e.match(o)) return e;
|
|
470
|
-
let a = t -
|
|
470
|
+
let a = t - r;
|
|
471
471
|
if (a < i) return e;
|
|
472
|
-
let l = e.slice(0,
|
|
472
|
+
let l = e.slice(0, r), p = e.slice(r).replace(`\r
|
|
473
473
|
`, `
|
|
474
|
-
`), h = " ".repeat(
|
|
474
|
+
`), h = " ".repeat(r), k = "\\s\u200B", j = new RegExp(
|
|
475
475
|
`
|
|
476
476
|
|.{1,${a - 1}}([${k}]|$)|[^${k}]+?([${k}]|$)`,
|
|
477
477
|
"g"
|
|
@@ -486,7 +486,7 @@ var nt = O((Zt) => {
|
|
|
486
486
|
|
|
487
487
|
// ../node_modules/commander/lib/option.js
|
|
488
488
|
var ct = O((dt) => {
|
|
489
|
-
var { InvalidArgumentError:
|
|
489
|
+
var { InvalidArgumentError: Lr } = Oe(), ot = class {
|
|
490
490
|
static {
|
|
491
491
|
d(this, "Option");
|
|
492
492
|
}
|
|
@@ -499,8 +499,8 @@ var ct = O((dt) => {
|
|
|
499
499
|
constructor(e, t) {
|
|
500
500
|
this.flags = e, this.description = t || "", this.required = e.includes("<"), this.optional = e.includes("["), this.variadic = /\w\.\.\.[>\]]$/.
|
|
501
501
|
test(e), this.mandatory = !1;
|
|
502
|
-
let
|
|
503
|
-
this.short =
|
|
502
|
+
let r = qr(e);
|
|
503
|
+
this.short = r.shortFlag, this.long = r.longFlag, this.negate = !1, this.long && (this.negate = this.long.startsWith("--no-")), this.defaultValue =
|
|
504
504
|
void 0, this.defaultValueDescription = void 0, this.presetArg = void 0, this.envVar = void 0, this.parseArg = void 0, this.hidden = !1,
|
|
505
505
|
this.argChoices = void 0, this.conflictsWith = [], this.implied = void 0;
|
|
506
506
|
}
|
|
@@ -611,12 +611,12 @@ var ct = O((dt) => {
|
|
|
611
611
|
* @return {Option}
|
|
612
612
|
*/
|
|
613
613
|
choices(e) {
|
|
614
|
-
return this.argChoices = e.slice(), this.parseArg = (t,
|
|
614
|
+
return this.argChoices = e.slice(), this.parseArg = (t, r) => {
|
|
615
615
|
if (!this.argChoices.includes(t))
|
|
616
|
-
throw new
|
|
616
|
+
throw new Lr(
|
|
617
617
|
`Allowed choices are ${this.argChoices.join(", ")}.`
|
|
618
618
|
);
|
|
619
|
-
return this.variadic ? this._concatValue(t,
|
|
619
|
+
return this.variadic ? this._concatValue(t, r) : t;
|
|
620
620
|
}, this;
|
|
621
621
|
}
|
|
622
622
|
/**
|
|
@@ -634,7 +634,7 @@ var ct = O((dt) => {
|
|
|
634
634
|
* @return {string}
|
|
635
635
|
*/
|
|
636
636
|
attributeName() {
|
|
637
|
-
return
|
|
637
|
+
return Ur(this.name().replace(/^no-/, ""));
|
|
638
638
|
}
|
|
639
639
|
/**
|
|
640
640
|
* Check if `arg` matches the short or long flag.
|
|
@@ -668,8 +668,8 @@ var ct = O((dt) => {
|
|
|
668
668
|
this.positiveOptions = /* @__PURE__ */ new Map(), this.negativeOptions = /* @__PURE__ */ new Map(), this.dualOptions = /* @__PURE__ */ new Set(),
|
|
669
669
|
e.forEach((t) => {
|
|
670
670
|
t.negate ? this.negativeOptions.set(t.attributeName(), t) : this.positiveOptions.set(t.attributeName(), t);
|
|
671
|
-
}), this.negativeOptions.forEach((t,
|
|
672
|
-
this.positiveOptions.has(
|
|
671
|
+
}), this.negativeOptions.forEach((t, r) => {
|
|
672
|
+
this.positiveOptions.has(r) && this.dualOptions.add(r);
|
|
673
673
|
});
|
|
674
674
|
}
|
|
675
675
|
/**
|
|
@@ -680,74 +680,74 @@ var ct = O((dt) => {
|
|
|
680
680
|
* @returns {boolean}
|
|
681
681
|
*/
|
|
682
682
|
valueFromOption(e, t) {
|
|
683
|
-
let
|
|
684
|
-
if (!this.dualOptions.has(
|
|
685
|
-
let i = this.negativeOptions.get(
|
|
683
|
+
let r = t.attributeName();
|
|
684
|
+
if (!this.dualOptions.has(r)) return !0;
|
|
685
|
+
let i = this.negativeOptions.get(r).presetArg, n = i !== void 0 ? i : !1;
|
|
686
686
|
return t.negate === (n === e);
|
|
687
687
|
}
|
|
688
688
|
};
|
|
689
|
-
function
|
|
690
|
-
return
|
|
689
|
+
function Ur(s) {
|
|
690
|
+
return s.split("-").reduce((e, t) => e + t[0].toUpperCase() + t.slice(1));
|
|
691
691
|
}
|
|
692
|
-
d(
|
|
693
|
-
function
|
|
694
|
-
let e, t,
|
|
695
|
-
return
|
|
692
|
+
d(Ur, "camelcase");
|
|
693
|
+
function qr(s) {
|
|
694
|
+
let e, t, r = s.split(/[ |,]+/);
|
|
695
|
+
return r.length > 1 && !/^[[<]/.test(r[1]) && (e = r.shift()), t = r.shift(), !e && /^-[^-]$/.test(t) && (e = t, t = void 0), { shortFlag: e,
|
|
696
696
|
longFlag: t };
|
|
697
697
|
}
|
|
698
|
-
d(
|
|
698
|
+
d(qr, "splitOptionFlags");
|
|
699
699
|
dt.Option = ot;
|
|
700
700
|
dt.DualOptions = at;
|
|
701
701
|
});
|
|
702
702
|
|
|
703
703
|
// ../node_modules/commander/lib/suggestSimilar.js
|
|
704
704
|
var Nt = O((Pt) => {
|
|
705
|
-
function
|
|
706
|
-
if (Math.abs(
|
|
707
|
-
return Math.max(
|
|
705
|
+
function Fr(s, e) {
|
|
706
|
+
if (Math.abs(s.length - e.length) > 3)
|
|
707
|
+
return Math.max(s.length, e.length);
|
|
708
708
|
let t = [];
|
|
709
|
-
for (let
|
|
710
|
-
t[
|
|
711
|
-
for (let
|
|
712
|
-
t[0][
|
|
713
|
-
for (let
|
|
714
|
-
for (let i = 1; i <=
|
|
709
|
+
for (let r = 0; r <= s.length; r++)
|
|
710
|
+
t[r] = [r];
|
|
711
|
+
for (let r = 0; r <= e.length; r++)
|
|
712
|
+
t[0][r] = r;
|
|
713
|
+
for (let r = 1; r <= e.length; r++)
|
|
714
|
+
for (let i = 1; i <= s.length; i++) {
|
|
715
715
|
let n = 1;
|
|
716
|
-
|
|
717
|
-
t[i - 1][
|
|
716
|
+
s[i - 1] === e[r - 1] ? n = 0 : n = 1, t[i][r] = Math.min(
|
|
717
|
+
t[i - 1][r] + 1,
|
|
718
718
|
// deletion
|
|
719
|
-
t[i][
|
|
719
|
+
t[i][r - 1] + 1,
|
|
720
720
|
// insertion
|
|
721
|
-
t[i - 1][
|
|
721
|
+
t[i - 1][r - 1] + n
|
|
722
722
|
// substitution
|
|
723
|
-
), i > 1 &&
|
|
723
|
+
), i > 1 && r > 1 && s[i - 1] === e[r - 2] && s[i - 2] === e[r - 1] && (t[i][r] = Math.min(t[i][r], t[i - 2][r - 2] + 1));
|
|
724
724
|
}
|
|
725
|
-
return t[
|
|
725
|
+
return t[s.length][e.length];
|
|
726
726
|
}
|
|
727
|
-
d(
|
|
728
|
-
function
|
|
727
|
+
d(Fr, "editDistance");
|
|
728
|
+
function Br(s, e) {
|
|
729
729
|
if (!e || e.length === 0) return "";
|
|
730
730
|
e = Array.from(new Set(e));
|
|
731
|
-
let t =
|
|
732
|
-
t && (
|
|
733
|
-
let
|
|
731
|
+
let t = s.startsWith("--");
|
|
732
|
+
t && (s = s.slice(2), e = e.map((o) => o.slice(2)));
|
|
733
|
+
let r = [], i = 3, n = 0.4;
|
|
734
734
|
return e.forEach((o) => {
|
|
735
735
|
if (o.length <= 1) return;
|
|
736
|
-
let a =
|
|
737
|
-
(l - a) / l > n && (a < i ? (i = a,
|
|
738
|
-
}),
|
|
739
|
-
(Did you mean one of ${
|
|
740
|
-
(Did you mean ${
|
|
736
|
+
let a = Fr(s, o), l = Math.max(s.length, o.length);
|
|
737
|
+
(l - a) / l > n && (a < i ? (i = a, r = [o]) : a === i && r.push(o));
|
|
738
|
+
}), r.sort((o, a) => o.localeCompare(a)), t && (r = r.map((o) => `--${o}`)), r.length > 1 ? `
|
|
739
|
+
(Did you mean one of ${r.join(", ")}?)` : r.length === 1 ? `
|
|
740
|
+
(Did you mean ${r[0]}?)` : "";
|
|
741
741
|
}
|
|
742
|
-
d(
|
|
743
|
-
Pt.suggestSimilar =
|
|
742
|
+
d(Br, "suggestSimilar");
|
|
743
|
+
Pt.suggestSimilar = Br;
|
|
744
744
|
});
|
|
745
745
|
|
|
746
746
|
// ../node_modules/commander/lib/command.js
|
|
747
747
|
var Lt = O((Mt) => {
|
|
748
|
-
var
|
|
749
|
-
Argument:
|
|
750
|
-
{ suggestSimilar: Dt } = Nt(), ht = class
|
|
748
|
+
var Wr = me("node:events").EventEmitter, ut = me("node:child_process"), L = me("node:path"), lt = me("node:fs"), C = me("node:process"), {
|
|
749
|
+
Argument: Hr, humanReadableArgName: Kr } = De(), { CommanderError: pt } = Oe(), { Help: zr } = nt(), { Option: Vt, DualOptions: Gr } = ct(),
|
|
750
|
+
{ suggestSimilar: Dt } = Nt(), ht = class s extends Wr {
|
|
751
751
|
static {
|
|
752
752
|
d(this, "Command");
|
|
753
753
|
}
|
|
@@ -768,7 +768,7 @@ var Lt = O((Mt) => {
|
|
|
768
768
|
writeErr: /* @__PURE__ */ d((t) => C.stderr.write(t), "writeErr"),
|
|
769
769
|
getOutHelpWidth: /* @__PURE__ */ d(() => C.stdout.isTTY ? C.stdout.columns : void 0, "getOutHelpWidth"),
|
|
770
770
|
getErrHelpWidth: /* @__PURE__ */ d(() => C.stderr.isTTY ? C.stderr.columns : void 0, "getErrHelpWidth"),
|
|
771
|
-
outputError: /* @__PURE__ */ d((t,
|
|
771
|
+
outputError: /* @__PURE__ */ d((t, r) => r(t), "outputError")
|
|
772
772
|
}, this._hidden = !1, this._helpOption = void 0, this._addImplicitHelpCommand = void 0, this._helpCommand = void 0, this._helpConfiguration =
|
|
773
773
|
{};
|
|
774
774
|
}
|
|
@@ -821,8 +821,8 @@ var Lt = O((Mt) => {
|
|
|
821
821
|
* @param {object} [execOpts] - configuration options (for executable)
|
|
822
822
|
* @return {Command} returns new command for action handler, or `this` for executable command
|
|
823
823
|
*/
|
|
824
|
-
command(e, t,
|
|
825
|
-
let i = t, n =
|
|
824
|
+
command(e, t, r) {
|
|
825
|
+
let i = t, n = r;
|
|
826
826
|
typeof i == "object" && i !== null && (n = i, i = null), n = n || {};
|
|
827
827
|
let [, o, a] = e.match(/([^ ]+) *(.*)/), l = this.createCommand(o);
|
|
828
828
|
return i && (l.description(i), l._executableHandler = !0), n.isDefault && (this._defaultCommandName = l._name), l._hidden = !!(n.noHelp ||
|
|
@@ -839,7 +839,7 @@ var Lt = O((Mt) => {
|
|
|
839
839
|
* @return {Command} new command
|
|
840
840
|
*/
|
|
841
841
|
createCommand(e) {
|
|
842
|
-
return new
|
|
842
|
+
return new s(e);
|
|
843
843
|
}
|
|
844
844
|
/**
|
|
845
845
|
* You can customise the help with a subclass of Help by overriding createHelp,
|
|
@@ -848,7 +848,7 @@ var Lt = O((Mt) => {
|
|
|
848
848
|
* @return {Help}
|
|
849
849
|
*/
|
|
850
850
|
createHelp() {
|
|
851
|
-
return Object.assign(new
|
|
851
|
+
return Object.assign(new zr(), this.configureHelp());
|
|
852
852
|
}
|
|
853
853
|
/**
|
|
854
854
|
* You can customise the help by overriding Help properties using configureHelp(),
|
|
@@ -926,7 +926,7 @@ var Lt = O((Mt) => {
|
|
|
926
926
|
* @return {Argument} new argument
|
|
927
927
|
*/
|
|
928
928
|
createArgument(e, t) {
|
|
929
|
-
return new
|
|
929
|
+
return new Hr(e, t);
|
|
930
930
|
}
|
|
931
931
|
/**
|
|
932
932
|
* Define argument syntax for command.
|
|
@@ -944,9 +944,9 @@ var Lt = O((Mt) => {
|
|
|
944
944
|
* @param {*} [defaultValue]
|
|
945
945
|
* @return {Command} `this` command for chaining
|
|
946
946
|
*/
|
|
947
|
-
argument(e, t,
|
|
947
|
+
argument(e, t, r, i) {
|
|
948
948
|
let n = this.createArgument(e, t);
|
|
949
|
-
return typeof
|
|
949
|
+
return typeof r == "function" ? n.default(i).argParser(r) : n.default(r), this.addArgument(n), this;
|
|
950
950
|
}
|
|
951
951
|
/**
|
|
952
952
|
* Define argument syntax for command, adding multiple at once (without descriptions).
|
|
@@ -999,7 +999,7 @@ var Lt = O((Mt) => {
|
|
|
999
999
|
if (typeof e == "boolean")
|
|
1000
1000
|
return this._addImplicitHelpCommand = e, this;
|
|
1001
1001
|
e = e ?? "help [command]";
|
|
1002
|
-
let [,
|
|
1002
|
+
let [, r, i] = e.match(/([^ ]+) *(.*)/), n = t ?? "display help for command", o = this.createCommand(r);
|
|
1003
1003
|
return o.helpOption(!1), i && o.arguments(i), n && o.description(n), this._addImplicitHelpCommand = !0, this._helpCommand = o, this;
|
|
1004
1004
|
}
|
|
1005
1005
|
/**
|
|
@@ -1030,10 +1030,10 @@ var Lt = O((Mt) => {
|
|
|
1030
1030
|
* @return {Command} `this` command for chaining
|
|
1031
1031
|
*/
|
|
1032
1032
|
hook(e, t) {
|
|
1033
|
-
let
|
|
1034
|
-
if (!
|
|
1033
|
+
let r = ["preSubcommand", "preAction", "postAction"];
|
|
1034
|
+
if (!r.includes(e))
|
|
1035
1035
|
throw new Error(`Unexpected value for event passed to hook : '${e}'.
|
|
1036
|
-
Expecting one of '${
|
|
1036
|
+
Expecting one of '${r.join("', '")}'`);
|
|
1037
1037
|
return this._lifeCycleHooks[e] ? this._lifeCycleHooks[e].push(t) : this._lifeCycleHooks[e] = [t], this;
|
|
1038
1038
|
}
|
|
1039
1039
|
/**
|
|
@@ -1057,8 +1057,8 @@ Expecting one of '${s.join("', '")}'`);
|
|
|
1057
1057
|
* @return never
|
|
1058
1058
|
* @private
|
|
1059
1059
|
*/
|
|
1060
|
-
_exit(e, t,
|
|
1061
|
-
this._exitCallback && this._exitCallback(new pt(e, t,
|
|
1060
|
+
_exit(e, t, r) {
|
|
1061
|
+
this._exitCallback && this._exitCallback(new pt(e, t, r)), C.exit(e);
|
|
1062
1062
|
}
|
|
1063
1063
|
/**
|
|
1064
1064
|
* Register callback `fn` for the command.
|
|
@@ -1075,8 +1075,8 @@ Expecting one of '${s.join("', '")}'`);
|
|
|
1075
1075
|
* @return {Command} `this` command for chaining
|
|
1076
1076
|
*/
|
|
1077
1077
|
action(e) {
|
|
1078
|
-
let t = /* @__PURE__ */ d((
|
|
1079
|
-
let i = this.registeredArguments.length, n =
|
|
1078
|
+
let t = /* @__PURE__ */ d((r) => {
|
|
1079
|
+
let i = this.registeredArguments.length, n = r.slice(0, i);
|
|
1080
1080
|
return this._storeOptionsAsProperties ? n[i] = this : n[i] = this.opts(), n.push(this), e.apply(this, n);
|
|
1081
1081
|
}, "listener");
|
|
1082
1082
|
return this._actionHandler = t, this;
|
|
@@ -1103,9 +1103,9 @@ Expecting one of '${s.join("', '")}'`);
|
|
|
1103
1103
|
* @param {string} invalidArgumentMessage
|
|
1104
1104
|
* @private
|
|
1105
1105
|
*/
|
|
1106
|
-
_callParseArg(e, t,
|
|
1106
|
+
_callParseArg(e, t, r, i) {
|
|
1107
1107
|
try {
|
|
1108
|
-
return e.parseArg(t,
|
|
1108
|
+
return e.parseArg(t, r);
|
|
1109
1109
|
} catch (n) {
|
|
1110
1110
|
if (n.code === "commander.invalidArgument") {
|
|
1111
1111
|
let o = `${i} ${n.message}`;
|
|
@@ -1124,8 +1124,8 @@ Expecting one of '${s.join("', '")}'`);
|
|
|
1124
1124
|
_registerOption(e) {
|
|
1125
1125
|
let t = e.short && this._findOption(e.short) || e.long && this._findOption(e.long);
|
|
1126
1126
|
if (t) {
|
|
1127
|
-
let
|
|
1128
|
-
throw new Error(`Cannot add option '${e.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${
|
|
1127
|
+
let r = e.long && this._findOption(e.long) ? e.long : e.short;
|
|
1128
|
+
throw new Error(`Cannot add option '${e.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${r}'
|
|
1129
1129
|
- already used by option '${t.flags}'`);
|
|
1130
1130
|
}
|
|
1131
1131
|
this.options.push(e);
|
|
@@ -1138,11 +1138,11 @@ Expecting one of '${s.join("', '")}'`);
|
|
|
1138
1138
|
* @private
|
|
1139
1139
|
*/
|
|
1140
1140
|
_registerCommand(e) {
|
|
1141
|
-
let t = /* @__PURE__ */ d((i) => [i.name()].concat(i.aliases()), "knownBy"),
|
|
1141
|
+
let t = /* @__PURE__ */ d((i) => [i.name()].concat(i.aliases()), "knownBy"), r = t(e).find(
|
|
1142
1142
|
(i) => this._findCommand(i)
|
|
1143
1143
|
);
|
|
1144
|
-
if (
|
|
1145
|
-
let i = t(this._findCommand(
|
|
1144
|
+
if (r) {
|
|
1145
|
+
let i = t(this._findCommand(r)).join("|"), n = t(e).join("|");
|
|
1146
1146
|
throw new Error(
|
|
1147
1147
|
`cannot add command '${n}' as already have command '${i}'`
|
|
1148
1148
|
);
|
|
@@ -1157,20 +1157,20 @@ Expecting one of '${s.join("', '")}'`);
|
|
|
1157
1157
|
*/
|
|
1158
1158
|
addOption(e) {
|
|
1159
1159
|
this._registerOption(e);
|
|
1160
|
-
let t = e.name(),
|
|
1160
|
+
let t = e.name(), r = e.attributeName();
|
|
1161
1161
|
if (e.negate) {
|
|
1162
1162
|
let n = e.long.replace(/^--no-/, "--");
|
|
1163
1163
|
this._findOption(n) || this.setOptionValueWithSource(
|
|
1164
|
-
|
|
1164
|
+
r,
|
|
1165
1165
|
e.defaultValue === void 0 ? !0 : e.defaultValue,
|
|
1166
1166
|
"default"
|
|
1167
1167
|
);
|
|
1168
|
-
} else e.defaultValue !== void 0 && this.setOptionValueWithSource(
|
|
1168
|
+
} else e.defaultValue !== void 0 && this.setOptionValueWithSource(r, e.defaultValue, "default");
|
|
1169
1169
|
let i = /* @__PURE__ */ d((n, o, a) => {
|
|
1170
1170
|
n == null && e.presetArg !== void 0 && (n = e.presetArg);
|
|
1171
|
-
let l = this.getOptionValue(
|
|
1171
|
+
let l = this.getOptionValue(r);
|
|
1172
1172
|
n !== null && e.parseArg ? n = this._callParseArg(e, n, l, o) : n !== null && e.variadic && (n = e._concatValue(n, l)), n == null &&
|
|
1173
|
-
(e.negate ? n = !1 : e.isBoolean() || e.optional ? n = !0 : n = ""), this.setOptionValueWithSource(
|
|
1173
|
+
(e.negate ? n = !1 : e.isBoolean() || e.optional ? n = !0 : n = ""), this.setOptionValueWithSource(r, n, a);
|
|
1174
1174
|
}, "handleOptionValue");
|
|
1175
1175
|
return this.on("option:" + t, (n) => {
|
|
1176
1176
|
let o = `error: option '${e.flags}' argument '${n}' is invalid.`;
|
|
@@ -1186,12 +1186,12 @@ Expecting one of '${s.join("', '")}'`);
|
|
|
1186
1186
|
* @return {Command} `this` command for chaining
|
|
1187
1187
|
* @private
|
|
1188
1188
|
*/
|
|
1189
|
-
_optionEx(e, t,
|
|
1189
|
+
_optionEx(e, t, r, i, n) {
|
|
1190
1190
|
if (typeof t == "object" && t instanceof Vt)
|
|
1191
1191
|
throw new Error(
|
|
1192
1192
|
"To add an Option object use addOption() instead of option() or requiredOption()"
|
|
1193
1193
|
);
|
|
1194
|
-
let o = this.createOption(t,
|
|
1194
|
+
let o = this.createOption(t, r);
|
|
1195
1195
|
if (o.makeOptionMandatory(!!e.mandatory), typeof i == "function")
|
|
1196
1196
|
o.default(n).argParser(i);
|
|
1197
1197
|
else if (i instanceof RegExp) {
|
|
@@ -1225,8 +1225,8 @@ Expecting one of '${s.join("', '")}'`);
|
|
|
1225
1225
|
* @param {*} [defaultValue]
|
|
1226
1226
|
* @return {Command} `this` command for chaining
|
|
1227
1227
|
*/
|
|
1228
|
-
option(e, t,
|
|
1229
|
-
return this._optionEx({}, e, t,
|
|
1228
|
+
option(e, t, r, i) {
|
|
1229
|
+
return this._optionEx({}, e, t, r, i);
|
|
1230
1230
|
}
|
|
1231
1231
|
/**
|
|
1232
1232
|
* Add a required option which must have a value after parsing. This usually means
|
|
@@ -1240,12 +1240,12 @@ Expecting one of '${s.join("', '")}'`);
|
|
|
1240
1240
|
* @param {*} [defaultValue]
|
|
1241
1241
|
* @return {Command} `this` command for chaining
|
|
1242
1242
|
*/
|
|
1243
|
-
requiredOption(e, t,
|
|
1243
|
+
requiredOption(e, t, r, i) {
|
|
1244
1244
|
return this._optionEx(
|
|
1245
1245
|
{ mandatory: !0 },
|
|
1246
1246
|
e,
|
|
1247
1247
|
t,
|
|
1248
|
-
|
|
1248
|
+
r,
|
|
1249
1249
|
i
|
|
1250
1250
|
);
|
|
1251
1251
|
}
|
|
@@ -1356,8 +1356,8 @@ Expecting one of '${s.join("', '")}'`);
|
|
|
1356
1356
|
* @param {string} source - expected values are default/config/env/cli/implied
|
|
1357
1357
|
* @return {Command} `this` command for chaining
|
|
1358
1358
|
*/
|
|
1359
|
-
setOptionValueWithSource(e, t,
|
|
1360
|
-
return this._storeOptionsAsProperties ? this[e] = t : this._optionValues[e] = t, this._optionValueSources[e] =
|
|
1359
|
+
setOptionValueWithSource(e, t, r) {
|
|
1360
|
+
return this._storeOptionsAsProperties ? this[e] = t : this._optionValues[e] = t, this._optionValueSources[e] = r, this;
|
|
1361
1361
|
}
|
|
1362
1362
|
/**
|
|
1363
1363
|
* Get source of option value.
|
|
@@ -1378,8 +1378,8 @@ Expecting one of '${s.join("', '")}'`);
|
|
|
1378
1378
|
*/
|
|
1379
1379
|
getOptionValueSourceWithGlobals(e) {
|
|
1380
1380
|
let t;
|
|
1381
|
-
return this._getCommandAndAncestors().forEach((
|
|
1382
|
-
|
|
1381
|
+
return this._getCommandAndAncestors().forEach((r) => {
|
|
1382
|
+
r.getOptionValueSource(e) !== void 0 && (t = r.getOptionValueSource(e));
|
|
1383
1383
|
}), t;
|
|
1384
1384
|
}
|
|
1385
1385
|
/**
|
|
@@ -1397,27 +1397,27 @@ Expecting one of '${s.join("', '")}'`);
|
|
|
1397
1397
|
(i.includes("-e") || i.includes("--eval") || i.includes("-p") || i.includes("--print")) && (t.from = "eval");
|
|
1398
1398
|
}
|
|
1399
1399
|
e === void 0 && (e = C.argv), this.rawArgs = e.slice();
|
|
1400
|
-
let
|
|
1400
|
+
let r;
|
|
1401
1401
|
switch (t.from) {
|
|
1402
1402
|
case void 0:
|
|
1403
1403
|
case "node":
|
|
1404
|
-
this._scriptPath = e[1],
|
|
1404
|
+
this._scriptPath = e[1], r = e.slice(2);
|
|
1405
1405
|
break;
|
|
1406
1406
|
case "electron":
|
|
1407
|
-
C.defaultApp ? (this._scriptPath = e[1],
|
|
1407
|
+
C.defaultApp ? (this._scriptPath = e[1], r = e.slice(2)) : r = e.slice(1);
|
|
1408
1408
|
break;
|
|
1409
1409
|
case "user":
|
|
1410
|
-
|
|
1410
|
+
r = e.slice(0);
|
|
1411
1411
|
break;
|
|
1412
1412
|
case "eval":
|
|
1413
|
-
|
|
1413
|
+
r = e.slice(1);
|
|
1414
1414
|
break;
|
|
1415
1415
|
default:
|
|
1416
1416
|
throw new Error(
|
|
1417
1417
|
`unexpected parse option { from: '${t.from}' }`
|
|
1418
1418
|
);
|
|
1419
1419
|
}
|
|
1420
|
-
return !this._name && this._scriptPath && this.nameFromFilename(this._scriptPath), this._name = this._name || "program",
|
|
1420
|
+
return !this._name && this._scriptPath && this.nameFromFilename(this._scriptPath), this._name = this._name || "program", r;
|
|
1421
1421
|
}
|
|
1422
1422
|
/**
|
|
1423
1423
|
* Parse `argv`, setting options and invoking commands when defined.
|
|
@@ -1442,8 +1442,8 @@ Expecting one of '${s.join("', '")}'`);
|
|
|
1442
1442
|
* @return {Command} `this` command for chaining
|
|
1443
1443
|
*/
|
|
1444
1444
|
parse(e, t) {
|
|
1445
|
-
let
|
|
1446
|
-
return this._parseCommand([],
|
|
1445
|
+
let r = this._prepareUserArgs(e, t);
|
|
1446
|
+
return this._parseCommand([], r), this;
|
|
1447
1447
|
}
|
|
1448
1448
|
/**
|
|
1449
1449
|
* Parse `argv`, setting options and invoking commands when defined.
|
|
@@ -1466,8 +1466,8 @@ Expecting one of '${s.join("', '")}'`);
|
|
|
1466
1466
|
* @return {Promise}
|
|
1467
1467
|
*/
|
|
1468
1468
|
async parseAsync(e, t) {
|
|
1469
|
-
let
|
|
1470
|
-
return await this._parseCommand([],
|
|
1469
|
+
let r = this._prepareUserArgs(e, t);
|
|
1470
|
+
return await this._parseCommand([], r), this;
|
|
1471
1471
|
}
|
|
1472
1472
|
/**
|
|
1473
1473
|
* Execute a sub-command executable.
|
|
@@ -1476,7 +1476,7 @@ Expecting one of '${s.join("', '")}'`);
|
|
|
1476
1476
|
*/
|
|
1477
1477
|
_executeSubCommand(e, t) {
|
|
1478
1478
|
t = t.slice();
|
|
1479
|
-
let
|
|
1479
|
+
let r = !1, i = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
1480
1480
|
function n(h, y) {
|
|
1481
1481
|
let k = L.resolve(h, y);
|
|
1482
1482
|
if (lt.existsSync(k)) return k;
|
|
@@ -1514,9 +1514,9 @@ Expecting one of '${s.join("', '")}'`);
|
|
|
1514
1514
|
}
|
|
1515
1515
|
o = h || o;
|
|
1516
1516
|
}
|
|
1517
|
-
|
|
1517
|
+
r = i.includes(L.extname(o));
|
|
1518
1518
|
let l;
|
|
1519
|
-
C.platform !== "win32" ?
|
|
1519
|
+
C.platform !== "win32" ? r ? (t.unshift(o), t = $t(C.execArgv).concat(t), l = ut.spawn(C.argv[0], t, { stdio: "inherit" })) : l = ut.spawn(
|
|
1520
1520
|
o, t, { stdio: "inherit" }) : (t.unshift(o), t = $t(C.execArgv).concat(t), l = ut.spawn(C.execPath, t, { stdio: "inherit" })), l.killed ||
|
|
1521
1521
|
["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"].forEach((y) => {
|
|
1522
1522
|
C.on(y, () => {
|
|
@@ -1558,7 +1558,7 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
1558
1558
|
/**
|
|
1559
1559
|
* @private
|
|
1560
1560
|
*/
|
|
1561
|
-
_dispatchSubcommand(e, t,
|
|
1561
|
+
_dispatchSubcommand(e, t, r) {
|
|
1562
1562
|
let i = this._findCommand(e);
|
|
1563
1563
|
i || this.help({ error: !0 });
|
|
1564
1564
|
let n;
|
|
@@ -1568,9 +1568,9 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
1568
1568
|
"preSubcommand"
|
|
1569
1569
|
), n = this._chainOrCall(n, () => {
|
|
1570
1570
|
if (i._executableHandler)
|
|
1571
|
-
this._executeSubCommand(i, t.concat(
|
|
1571
|
+
this._executeSubCommand(i, t.concat(r));
|
|
1572
1572
|
else
|
|
1573
|
-
return i._parseCommand(t,
|
|
1573
|
+
return i._parseCommand(t, r);
|
|
1574
1574
|
}), n;
|
|
1575
1575
|
}
|
|
1576
1576
|
/**
|
|
@@ -1605,12 +1605,12 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
1605
1605
|
* @private
|
|
1606
1606
|
*/
|
|
1607
1607
|
_processArguments() {
|
|
1608
|
-
let e = /* @__PURE__ */ d((
|
|
1608
|
+
let e = /* @__PURE__ */ d((r, i, n) => {
|
|
1609
1609
|
let o = i;
|
|
1610
|
-
if (i !== null &&
|
|
1611
|
-
let a = `error: command-argument value '${i}' is invalid for argument '${
|
|
1610
|
+
if (i !== null && r.parseArg) {
|
|
1611
|
+
let a = `error: command-argument value '${i}' is invalid for argument '${r.name()}'.`;
|
|
1612
1612
|
o = this._callParseArg(
|
|
1613
|
-
|
|
1613
|
+
r,
|
|
1614
1614
|
i,
|
|
1615
1615
|
n,
|
|
1616
1616
|
a
|
|
@@ -1620,10 +1620,10 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
1620
1620
|
}, "myParseArg");
|
|
1621
1621
|
this._checkNumberOfArguments();
|
|
1622
1622
|
let t = [];
|
|
1623
|
-
this.registeredArguments.forEach((
|
|
1624
|
-
let n =
|
|
1625
|
-
|
|
1626
|
-
void 0 && (n = []) : i < this.args.length && (n = this.args[i],
|
|
1623
|
+
this.registeredArguments.forEach((r, i) => {
|
|
1624
|
+
let n = r.defaultValue;
|
|
1625
|
+
r.variadic ? i < this.args.length ? (n = this.args.slice(i), r.parseArg && (n = n.reduce((o, a) => e(r, a, o), r.defaultValue))) : n ===
|
|
1626
|
+
void 0 && (n = []) : i < this.args.length && (n = this.args[i], r.parseArg && (n = e(r, n, r.defaultValue))), t[i] = n;
|
|
1627
1627
|
}), this.processedArgs = t;
|
|
1628
1628
|
}
|
|
1629
1629
|
/**
|
|
@@ -1645,14 +1645,14 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
1645
1645
|
* @private
|
|
1646
1646
|
*/
|
|
1647
1647
|
_chainOrCallHooks(e, t) {
|
|
1648
|
-
let
|
|
1648
|
+
let r = e, i = [];
|
|
1649
1649
|
return this._getCommandAndAncestors().reverse().filter((n) => n._lifeCycleHooks[t] !== void 0).forEach((n) => {
|
|
1650
1650
|
n._lifeCycleHooks[t].forEach((o) => {
|
|
1651
1651
|
i.push({ hookedCommand: n, callback: o });
|
|
1652
1652
|
});
|
|
1653
1653
|
}), t === "postAction" && i.reverse(), i.forEach((n) => {
|
|
1654
|
-
|
|
1655
|
-
}),
|
|
1654
|
+
r = this._chainOrCall(r, () => n.callback(n.hookedCommand, this));
|
|
1655
|
+
}), r;
|
|
1656
1656
|
}
|
|
1657
1657
|
/**
|
|
1658
1658
|
*
|
|
@@ -1662,9 +1662,9 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
1662
1662
|
* @return {(Promise|undefined)}
|
|
1663
1663
|
* @private
|
|
1664
1664
|
*/
|
|
1665
|
-
_chainOrCallSubCommandHook(e, t,
|
|
1665
|
+
_chainOrCallSubCommandHook(e, t, r) {
|
|
1666
1666
|
let i = e;
|
|
1667
|
-
return this._lifeCycleHooks[
|
|
1667
|
+
return this._lifeCycleHooks[r] !== void 0 && this._lifeCycleHooks[r].forEach((n) => {
|
|
1668
1668
|
i = this._chainOrCall(i, () => n(this, t));
|
|
1669
1669
|
}), i;
|
|
1670
1670
|
}
|
|
@@ -1675,8 +1675,8 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
1675
1675
|
* @private
|
|
1676
1676
|
*/
|
|
1677
1677
|
_parseCommand(e, t) {
|
|
1678
|
-
let
|
|
1679
|
-
if (this._parseOptionsEnv(), this._parseOptionsImplied(), e = e.concat(
|
|
1678
|
+
let r = this.parseOptions(t);
|
|
1679
|
+
if (this._parseOptionsEnv(), this._parseOptionsImplied(), e = e.concat(r.operands), t = r.unknown, this.args = e.concat(t), e && this.
|
|
1680
1680
|
_findCommand(e[0]))
|
|
1681
1681
|
return this._dispatchSubcommand(e[0], e.slice(1), t);
|
|
1682
1682
|
if (this._getHelpCommand() && e[0] === this._getHelpCommand().name())
|
|
@@ -1688,9 +1688,9 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
1688
1688
|
t
|
|
1689
1689
|
);
|
|
1690
1690
|
this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName && this.help({ error: !0 }), this.
|
|
1691
|
-
_outputHelpIfRequested(
|
|
1691
|
+
_outputHelpIfRequested(r.unknown), this._checkForMissingMandatoryOptions(), this._checkForConflictingOptions();
|
|
1692
1692
|
let i = /* @__PURE__ */ d(() => {
|
|
1693
|
-
|
|
1693
|
+
r.unknown.length > 0 && this.unknownOption(r.unknown[0]);
|
|
1694
1694
|
}, "checkForUnknownOptions"), n = `command:${this.name()}`;
|
|
1695
1695
|
if (this._actionHandler) {
|
|
1696
1696
|
i(), this._processArguments();
|
|
@@ -1751,17 +1751,17 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
1751
1751
|
* @private
|
|
1752
1752
|
*/
|
|
1753
1753
|
_checkForConflictingLocalOptions() {
|
|
1754
|
-
let e = this.options.filter((
|
|
1755
|
-
let i =
|
|
1754
|
+
let e = this.options.filter((r) => {
|
|
1755
|
+
let i = r.attributeName();
|
|
1756
1756
|
return this.getOptionValue(i) === void 0 ? !1 : this.getOptionValueSource(i) !== "default";
|
|
1757
1757
|
});
|
|
1758
1758
|
e.filter(
|
|
1759
|
-
(
|
|
1760
|
-
).forEach((
|
|
1759
|
+
(r) => r.conflictsWith.length > 0
|
|
1760
|
+
).forEach((r) => {
|
|
1761
1761
|
let i = e.find(
|
|
1762
|
-
(n) =>
|
|
1762
|
+
(n) => r.conflictsWith.includes(n.attributeName())
|
|
1763
1763
|
);
|
|
1764
|
-
i && this._conflictingOption(
|
|
1764
|
+
i && this._conflictingOption(r, i);
|
|
1765
1765
|
});
|
|
1766
1766
|
}
|
|
1767
1767
|
/**
|
|
@@ -1791,7 +1791,7 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
1791
1791
|
* @return {{operands: string[], unknown: string[]}}
|
|
1792
1792
|
*/
|
|
1793
1793
|
parseOptions(e) {
|
|
1794
|
-
let t = [],
|
|
1794
|
+
let t = [], r = [], i = t, n = e.slice();
|
|
1795
1795
|
function o(l) {
|
|
1796
1796
|
return l.length > 1 && l[0] === "-";
|
|
1797
1797
|
}
|
|
@@ -1800,7 +1800,7 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
1800
1800
|
for (; n.length; ) {
|
|
1801
1801
|
let l = n.shift();
|
|
1802
1802
|
if (l === "--") {
|
|
1803
|
-
i ===
|
|
1803
|
+
i === r && i.push(l), i.push(...n);
|
|
1804
1804
|
break;
|
|
1805
1805
|
}
|
|
1806
1806
|
if (a && !o(l)) {
|
|
@@ -1837,15 +1837,15 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
1837
1837
|
continue;
|
|
1838
1838
|
}
|
|
1839
1839
|
}
|
|
1840
|
-
if (o(l) && (i =
|
|
1840
|
+
if (o(l) && (i = r), (this._enablePositionalOptions || this._passThroughOptions) && t.length === 0 && r.length === 0) {
|
|
1841
1841
|
if (this._findCommand(l)) {
|
|
1842
|
-
t.push(l), n.length > 0 &&
|
|
1842
|
+
t.push(l), n.length > 0 && r.push(...n);
|
|
1843
1843
|
break;
|
|
1844
1844
|
} else if (this._getHelpCommand() && l === this._getHelpCommand().name()) {
|
|
1845
1845
|
t.push(l), n.length > 0 && t.push(...n);
|
|
1846
1846
|
break;
|
|
1847
1847
|
} else if (this._defaultCommandName) {
|
|
1848
|
-
|
|
1848
|
+
r.push(l), n.length > 0 && r.push(...n);
|
|
1849
1849
|
break;
|
|
1850
1850
|
}
|
|
1851
1851
|
}
|
|
@@ -1855,7 +1855,7 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
1855
1855
|
}
|
|
1856
1856
|
i.push(l);
|
|
1857
1857
|
}
|
|
1858
|
-
return { operands: t, unknown:
|
|
1858
|
+
return { operands: t, unknown: r };
|
|
1859
1859
|
}
|
|
1860
1860
|
/**
|
|
1861
1861
|
* Return an object containing local option values as key-value pairs.
|
|
@@ -1865,8 +1865,8 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
1865
1865
|
opts() {
|
|
1866
1866
|
if (this._storeOptionsAsProperties) {
|
|
1867
1867
|
let e = {}, t = this.options.length;
|
|
1868
|
-
for (let
|
|
1869
|
-
let i = this.options[
|
|
1868
|
+
for (let r = 0; r < t; r++) {
|
|
1869
|
+
let i = this.options[r].attributeName();
|
|
1870
1870
|
e[i] = i === this._versionOptionName ? this._version : this[i];
|
|
1871
1871
|
}
|
|
1872
1872
|
return e;
|
|
@@ -1900,7 +1900,7 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
1900
1900
|
), typeof this._showHelpAfterError == "string" ? this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
1901
1901
|
`) : this._showHelpAfterError && (this._outputConfiguration.writeErr(`
|
|
1902
1902
|
`), this.outputHelp({ error: !0 }));
|
|
1903
|
-
let
|
|
1903
|
+
let r = t || {}, i = r.exitCode || 1, n = r.code || "commander.error";
|
|
1904
1904
|
this._exit(i, n, e);
|
|
1905
1905
|
}
|
|
1906
1906
|
/**
|
|
@@ -1925,18 +1925,18 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
1925
1925
|
* @private
|
|
1926
1926
|
*/
|
|
1927
1927
|
_parseOptionsImplied() {
|
|
1928
|
-
let e = new
|
|
1929
|
-
getOptionValueSource(
|
|
1928
|
+
let e = new Gr(this.options), t = /* @__PURE__ */ d((r) => this.getOptionValue(r) !== void 0 && !["default", "implied"].includes(this.
|
|
1929
|
+
getOptionValueSource(r)), "hasCustomOptionValue");
|
|
1930
1930
|
this.options.filter(
|
|
1931
|
-
(
|
|
1932
|
-
this.getOptionValue(
|
|
1933
|
-
|
|
1931
|
+
(r) => r.implied !== void 0 && t(r.attributeName()) && e.valueFromOption(
|
|
1932
|
+
this.getOptionValue(r.attributeName()),
|
|
1933
|
+
r
|
|
1934
1934
|
)
|
|
1935
|
-
).forEach((
|
|
1936
|
-
Object.keys(
|
|
1935
|
+
).forEach((r) => {
|
|
1936
|
+
Object.keys(r.implied).filter((i) => !t(i)).forEach((i) => {
|
|
1937
1937
|
this.setOptionValueWithSource(
|
|
1938
1938
|
i,
|
|
1939
|
-
|
|
1939
|
+
r.implied[i],
|
|
1940
1940
|
"implied"
|
|
1941
1941
|
);
|
|
1942
1942
|
});
|
|
@@ -1980,7 +1980,7 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
1980
1980
|
* @private
|
|
1981
1981
|
*/
|
|
1982
1982
|
_conflictingOption(e, t) {
|
|
1983
|
-
let
|
|
1983
|
+
let r = /* @__PURE__ */ d((o) => {
|
|
1984
1984
|
let a = o.attributeName(), l = this.getOptionValue(a), p = this.options.find(
|
|
1985
1985
|
(y) => y.negate && a === y.attributeName()
|
|
1986
1986
|
), h = this.options.find(
|
|
@@ -1988,7 +1988,7 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
1988
1988
|
);
|
|
1989
1989
|
return p && (p.presetArg === void 0 && l === !1 || p.presetArg !== void 0 && l === p.presetArg) ? p : h || o;
|
|
1990
1990
|
}, "findBestOptionFromValue"), i = /* @__PURE__ */ d((o) => {
|
|
1991
|
-
let a =
|
|
1991
|
+
let a = r(o), l = a.attributeName();
|
|
1992
1992
|
return this.getOptionValueSource(l) === "env" ? `environment variable '${a.envVar}'` : `option '${a.flags}'`;
|
|
1993
1993
|
}, "getErrorMessage"), n = `error: ${i(e)} cannot be used with ${i(t)}`;
|
|
1994
1994
|
this.error(n, { code: "commander.conflictingOption" });
|
|
@@ -2010,8 +2010,8 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
2010
2010
|
} while (n && !n._enablePositionalOptions);
|
|
2011
2011
|
t = Dt(e, i);
|
|
2012
2012
|
}
|
|
2013
|
-
let
|
|
2014
|
-
this.error(
|
|
2013
|
+
let r = `error: unknown option '${e}'${t}`;
|
|
2014
|
+
this.error(r, { code: "commander.unknownOption" });
|
|
2015
2015
|
}
|
|
2016
2016
|
/**
|
|
2017
2017
|
* Excess arguments, more than expected.
|
|
@@ -2021,8 +2021,8 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
2021
2021
|
*/
|
|
2022
2022
|
_excessArguments(e) {
|
|
2023
2023
|
if (this._allowExcessArguments) return;
|
|
2024
|
-
let t = this.registeredArguments.length,
|
|
2025
|
-
""}. Expected ${t} argument${
|
|
2024
|
+
let t = this.registeredArguments.length, r = t === 1 ? "" : "s", n = `error: too many arguments${this.parent ? ` for '${this.name()}'` :
|
|
2025
|
+
""}. Expected ${t} argument${r} but got ${e.length}.`;
|
|
2026
2026
|
this.error(n, { code: "commander.excessArguments" });
|
|
2027
2027
|
}
|
|
2028
2028
|
/**
|
|
@@ -2038,8 +2038,8 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
2038
2038
|
i.push(n.name()), n.alias() && i.push(n.alias());
|
|
2039
2039
|
}), t = Dt(e, i);
|
|
2040
2040
|
}
|
|
2041
|
-
let
|
|
2042
|
-
this.error(
|
|
2041
|
+
let r = `error: unknown command '${e}'${t}`;
|
|
2042
|
+
this.error(r, { code: "commander.unknownCommand" });
|
|
2043
2043
|
}
|
|
2044
2044
|
/**
|
|
2045
2045
|
* Get or set the program version.
|
|
@@ -2053,10 +2053,10 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
2053
2053
|
* @param {string} [description]
|
|
2054
2054
|
* @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments
|
|
2055
2055
|
*/
|
|
2056
|
-
version(e, t,
|
|
2056
|
+
version(e, t, r) {
|
|
2057
2057
|
if (e === void 0) return this._version;
|
|
2058
|
-
this._version = e, t = t || "-V, --version",
|
|
2059
|
-
let i = this.createOption(t,
|
|
2058
|
+
this._version = e, t = t || "-V, --version", r = r || "output the version number";
|
|
2059
|
+
let i = this.createOption(t, r);
|
|
2060
2060
|
return this._versionOptionName = i.attributeName(), this._registerOption(i), this.on("option:" + i.name(), () => {
|
|
2061
2061
|
this._outputConfiguration.writeOut(`${e}
|
|
2062
2062
|
`), this._exit(0, "commander.version", e);
|
|
@@ -2095,9 +2095,9 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
2095
2095
|
if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler && (t = this.commands[this.commands.length -
|
|
2096
2096
|
1]), e === t._name)
|
|
2097
2097
|
throw new Error("Command alias can't be the same as its name");
|
|
2098
|
-
let
|
|
2099
|
-
if (
|
|
2100
|
-
let i = [
|
|
2098
|
+
let r = this.parent?._findCommand(e);
|
|
2099
|
+
if (r) {
|
|
2100
|
+
let i = [r.name()].concat(r.aliases()).join("|");
|
|
2101
2101
|
throw new Error(
|
|
2102
2102
|
`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`
|
|
2103
2103
|
);
|
|
@@ -2124,7 +2124,7 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
2124
2124
|
usage(e) {
|
|
2125
2125
|
if (e === void 0) {
|
|
2126
2126
|
if (this._usage) return this._usage;
|
|
2127
|
-
let t = this.registeredArguments.map((
|
|
2127
|
+
let t = this.registeredArguments.map((r) => Kr(r));
|
|
2128
2128
|
return [].concat(
|
|
2129
2129
|
this.options.length || this._helpOption !== null ? "[options]" : [],
|
|
2130
2130
|
this.commands.length ? "[command]" : [],
|
|
@@ -2187,9 +2187,9 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
2187
2187
|
*/
|
|
2188
2188
|
_getHelpContext(e) {
|
|
2189
2189
|
e = e || {};
|
|
2190
|
-
let t = { error: !!e.error },
|
|
2191
|
-
return t.error ?
|
|
2192
|
-
writeOut(i), "write"), t.write = e.write ||
|
|
2190
|
+
let t = { error: !!e.error }, r;
|
|
2191
|
+
return t.error ? r = /* @__PURE__ */ d((i) => this._outputConfiguration.writeErr(i), "write") : r = /* @__PURE__ */ d((i) => this._outputConfiguration.
|
|
2192
|
+
writeOut(i), "write"), t.write = e.write || r, t.command = this, t;
|
|
2193
2193
|
}
|
|
2194
2194
|
/**
|
|
2195
2195
|
* Output help information for this command.
|
|
@@ -2201,14 +2201,14 @@ cutableDir() to supply a custom directory", k = `'${o}' does not exist
|
|
|
2201
2201
|
outputHelp(e) {
|
|
2202
2202
|
let t;
|
|
2203
2203
|
typeof e == "function" && (t = e, e = void 0);
|
|
2204
|
-
let
|
|
2205
|
-
this._getCommandAndAncestors().reverse().forEach((n) => n.emit("beforeAllHelp",
|
|
2206
|
-
let i = this.helpInformation(
|
|
2204
|
+
let r = this._getHelpContext(e);
|
|
2205
|
+
this._getCommandAndAncestors().reverse().forEach((n) => n.emit("beforeAllHelp", r)), this.emit("beforeHelp", r);
|
|
2206
|
+
let i = this.helpInformation(r);
|
|
2207
2207
|
if (t && (i = t(i), typeof i != "string" && !Buffer.isBuffer(i)))
|
|
2208
2208
|
throw new Error("outputHelp callback must return a string or a Buffer");
|
|
2209
|
-
|
|
2209
|
+
r.write(i), this._getHelpOption()?.long && this.emit(this._getHelpOption().long), this.emit("afterHelp", r), this._getCommandAndAncestors().
|
|
2210
2210
|
forEach(
|
|
2211
|
-
(n) => n.emit("afterAllHelp",
|
|
2211
|
+
(n) => n.emit("afterAllHelp", r)
|
|
2212
2212
|
);
|
|
2213
2213
|
}
|
|
2214
2214
|
/**
|
|
@@ -2270,10 +2270,10 @@ help", t = t ?? "display help for command", this._helpOption = this.createOption
|
|
|
2270
2270
|
* @return {Command} `this` command for chaining
|
|
2271
2271
|
*/
|
|
2272
2272
|
addHelpText(e, t) {
|
|
2273
|
-
let
|
|
2274
|
-
if (!
|
|
2273
|
+
let r = ["beforeAll", "before", "after", "afterAll"];
|
|
2274
|
+
if (!r.includes(e))
|
|
2275
2275
|
throw new Error(`Unexpected value for position to addHelpText.
|
|
2276
|
-
Expecting one of '${
|
|
2276
|
+
Expecting one of '${r.join("', '")}'`);
|
|
2277
2277
|
let i = `${e}Help`;
|
|
2278
2278
|
return this.on(i, (n) => {
|
|
2279
2279
|
let o;
|
|
@@ -2292,14 +2292,14 @@ Expecting one of '${s.join("', '")}'`);
|
|
|
2292
2292
|
t && e.find((i) => t.is(i)) && (this.outputHelp(), this._exit(0, "commander.helpDisplayed", "(outputHelp)"));
|
|
2293
2293
|
}
|
|
2294
2294
|
};
|
|
2295
|
-
function $t(
|
|
2296
|
-
return
|
|
2295
|
+
function $t(s) {
|
|
2296
|
+
return s.map((e) => {
|
|
2297
2297
|
if (!e.startsWith("--inspect"))
|
|
2298
2298
|
return e;
|
|
2299
|
-
let t,
|
|
2299
|
+
let t, r = "127.0.0.1", i = "9229", n;
|
|
2300
2300
|
return (n = e.match(/^(--inspect(-brk)?)$/)) !== null ? t = n[1] : (n = e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null ? (t =
|
|
2301
|
-
n[1], /^\d+$/.test(n[3]) ? i = n[3] :
|
|
2302
|
-
n[3], i = n[4]), t && i !== "0" ? `${t}=${
|
|
2301
|
+
n[1], /^\d+$/.test(n[3]) ? i = n[3] : r = n[3]) : (n = e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null && (t = n[1], r =
|
|
2302
|
+
n[3], i = n[4]), t && i !== "0" ? `${t}=${r}:${parseInt(i) + 1}` : e;
|
|
2303
2303
|
});
|
|
2304
2304
|
}
|
|
2305
2305
|
d($t, "incrementNodeInspectorPort");
|
|
@@ -2308,16 +2308,16 @@ Expecting one of '${s.join("', '")}'`);
|
|
|
2308
2308
|
|
|
2309
2309
|
// ../node_modules/commander/index.js
|
|
2310
2310
|
var Bt = O((R) => {
|
|
2311
|
-
var { Argument: Ut } = De(), { Command: mt } = Lt(), { CommanderError:
|
|
2311
|
+
var { Argument: Ut } = De(), { Command: mt } = Lt(), { CommanderError: Jr, InvalidArgumentError: qt } = Oe(), { Help: Yr } = nt(), { Option: Ft } = ct();
|
|
2312
2312
|
R.program = new mt();
|
|
2313
|
-
R.createCommand = (
|
|
2314
|
-
R.createOption = (
|
|
2315
|
-
R.createArgument = (
|
|
2313
|
+
R.createCommand = (s) => new mt(s);
|
|
2314
|
+
R.createOption = (s, e) => new Ft(s, e);
|
|
2315
|
+
R.createArgument = (s, e) => new Ut(s, e);
|
|
2316
2316
|
R.Command = mt;
|
|
2317
2317
|
R.Option = Ft;
|
|
2318
2318
|
R.Argument = Ut;
|
|
2319
|
-
R.Help =
|
|
2320
|
-
R.CommanderError =
|
|
2319
|
+
R.Help = Yr;
|
|
2320
|
+
R.CommanderError = Jr;
|
|
2321
2321
|
R.InvalidArgumentError = qt;
|
|
2322
2322
|
R.InvalidOptionArgumentError = qt;
|
|
2323
2323
|
});
|
|
@@ -2327,34 +2327,34 @@ var Ht = O(($e) => {
|
|
|
2327
2327
|
"use strict";
|
|
2328
2328
|
Object.defineProperty($e, "__esModule", { value: !0 });
|
|
2329
2329
|
$e.walkUp = void 0;
|
|
2330
|
-
var Wt = me("path"),
|
|
2331
|
-
for (
|
|
2332
|
-
yield
|
|
2333
|
-
let e = (0, Wt.dirname)(
|
|
2334
|
-
if (e ===
|
|
2330
|
+
var Wt = me("path"), Xr = /* @__PURE__ */ d(function* (s) {
|
|
2331
|
+
for (s = (0, Wt.resolve)(s); s; ) {
|
|
2332
|
+
yield s;
|
|
2333
|
+
let e = (0, Wt.dirname)(s);
|
|
2334
|
+
if (e === s)
|
|
2335
2335
|
break;
|
|
2336
|
-
|
|
2336
|
+
s = e;
|
|
2337
2337
|
}
|
|
2338
2338
|
}, "walkUp");
|
|
2339
|
-
$e.walkUp =
|
|
2339
|
+
$e.walkUp = Xr;
|
|
2340
2340
|
});
|
|
2341
2341
|
|
|
2342
2342
|
// ../node_modules/picocolors/picocolors.js
|
|
2343
2343
|
var Yt = O((wn, yt) => {
|
|
2344
|
-
var Le = process || {}, Gt = Le.argv || [], Me = Le.env || {},
|
|
2345
|
-
includes("--color") || Le.platform === "win32" || (Le.stdout || {}).isTTY && Me.TERM !== "dumb" || !!Me.CI),
|
|
2346
|
-
let i = "" +
|
|
2347
|
-
return ~n ?
|
|
2348
|
-
}, "formatter"),
|
|
2344
|
+
var Le = process || {}, Gt = Le.argv || [], Me = Le.env || {}, is = !(Me.NO_COLOR || Gt.includes("--no-color")) && (!!Me.FORCE_COLOR || Gt.
|
|
2345
|
+
includes("--color") || Le.platform === "win32" || (Le.stdout || {}).isTTY && Me.TERM !== "dumb" || !!Me.CI), ns = /* @__PURE__ */ d((s, e, t = s) => (r) => {
|
|
2346
|
+
let i = "" + r, n = i.indexOf(e, s.length);
|
|
2347
|
+
return ~n ? s + os(i, e, t, n) + e : s + i + e;
|
|
2348
|
+
}, "formatter"), os = /* @__PURE__ */ d((s, e, t, r) => {
|
|
2349
2349
|
let i = "", n = 0;
|
|
2350
2350
|
do
|
|
2351
|
-
i +=
|
|
2352
|
-
while (~
|
|
2353
|
-
return i +
|
|
2354
|
-
}, "replaceClose"), Jt = /* @__PURE__ */ d((
|
|
2355
|
-
let e =
|
|
2351
|
+
i += s.substring(n, r) + t, n = r + e.length, r = s.indexOf(e, n);
|
|
2352
|
+
while (~r);
|
|
2353
|
+
return i + s.substring(n);
|
|
2354
|
+
}, "replaceClose"), Jt = /* @__PURE__ */ d((s = is) => {
|
|
2355
|
+
let e = s ? ns : () => String;
|
|
2356
2356
|
return {
|
|
2357
|
-
isColorSupported:
|
|
2357
|
+
isColorSupported: s,
|
|
2358
2358
|
reset: e("\x1B[0m", "\x1B[0m"),
|
|
2359
2359
|
bold: e("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
2360
2360
|
dim: e("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
@@ -2407,12 +2407,12 @@ var vt = O((Te) => {
|
|
|
2407
2407
|
"use strict";
|
|
2408
2408
|
Object.defineProperty(Te, "__esModule", { value: !0 });
|
|
2409
2409
|
Te.dedent = void 0;
|
|
2410
|
-
function
|
|
2410
|
+
function tr(s) {
|
|
2411
2411
|
for (var e = [], t = 1; t < arguments.length; t++)
|
|
2412
2412
|
e[t - 1] = arguments[t];
|
|
2413
|
-
var
|
|
2414
|
-
|
|
2415
|
-
var i =
|
|
2413
|
+
var r = Array.from(typeof s == "string" ? [s] : s);
|
|
2414
|
+
r[r.length - 1] = r[r.length - 1].replace(/\r?\n([\t ]*)$/, "");
|
|
2415
|
+
var i = r.reduce(function(a, l) {
|
|
2416
2416
|
var p = l.match(/\n([\t ]+|(?!\s).)/g);
|
|
2417
2417
|
return p ? a.concat(p.map(function(h) {
|
|
2418
2418
|
var y, k;
|
|
@@ -2422,13 +2422,13 @@ var vt = O((Te) => {
|
|
|
2422
2422
|
if (i.length) {
|
|
2423
2423
|
var n = new RegExp(`
|
|
2424
2424
|
[ ]{` + Math.min.apply(Math, i) + "}", "g");
|
|
2425
|
-
|
|
2425
|
+
r = r.map(function(a) {
|
|
2426
2426
|
return a.replace(n, `
|
|
2427
2427
|
`);
|
|
2428
2428
|
});
|
|
2429
2429
|
}
|
|
2430
|
-
|
|
2431
|
-
var o =
|
|
2430
|
+
r[0] = r[0].replace(/^\r?\n/, "");
|
|
2431
|
+
var o = r[0];
|
|
2432
2432
|
return e.forEach(function(a, l) {
|
|
2433
2433
|
var p = o.match(/(?:^|\n)( *)$/), h = p ? p[1] : "", y = a;
|
|
2434
2434
|
typeof a == "string" && a.includes(`
|
|
@@ -2436,12 +2436,12 @@ var vt = O((Te) => {
|
|
|
2436
2436
|
`).map(function(k, j) {
|
|
2437
2437
|
return j === 0 ? k : "" + h + k;
|
|
2438
2438
|
}).join(`
|
|
2439
|
-
`)), o += y +
|
|
2439
|
+
`)), o += y + r[l + 1];
|
|
2440
2440
|
}), o;
|
|
2441
2441
|
}
|
|
2442
|
-
d(
|
|
2443
|
-
Te.dedent =
|
|
2444
|
-
Te.default =
|
|
2442
|
+
d(tr, "dedent");
|
|
2443
|
+
Te.dedent = tr;
|
|
2444
|
+
Te.default = tr;
|
|
2445
2445
|
});
|
|
2446
2446
|
|
|
2447
2447
|
// ../node_modules/zod/lib/helpers/util.js
|
|
@@ -2450,50 +2450,50 @@ var Ee = O((w) => {
|
|
|
2450
2450
|
Object.defineProperty(w, "__esModule", { value: !0 });
|
|
2451
2451
|
w.getParsedType = w.ZodParsedType = w.objectUtil = w.util = void 0;
|
|
2452
2452
|
var xt;
|
|
2453
|
-
(function(
|
|
2454
|
-
|
|
2453
|
+
(function(s) {
|
|
2454
|
+
s.assertEqual = (i) => i;
|
|
2455
2455
|
function e(i) {
|
|
2456
2456
|
}
|
|
2457
|
-
d(e, "assertIs"),
|
|
2457
|
+
d(e, "assertIs"), s.assertIs = e;
|
|
2458
2458
|
function t(i) {
|
|
2459
2459
|
throw new Error();
|
|
2460
2460
|
}
|
|
2461
|
-
d(t, "assertNever"),
|
|
2461
|
+
d(t, "assertNever"), s.assertNever = t, s.arrayToEnum = (i) => {
|
|
2462
2462
|
let n = {};
|
|
2463
2463
|
for (let o of i)
|
|
2464
2464
|
n[o] = o;
|
|
2465
2465
|
return n;
|
|
2466
|
-
},
|
|
2467
|
-
let n =
|
|
2466
|
+
}, s.getValidEnumValues = (i) => {
|
|
2467
|
+
let n = s.objectKeys(i).filter((a) => typeof i[i[a]] != "number"), o = {};
|
|
2468
2468
|
for (let a of n)
|
|
2469
2469
|
o[a] = i[a];
|
|
2470
|
-
return
|
|
2471
|
-
},
|
|
2470
|
+
return s.objectValues(o);
|
|
2471
|
+
}, s.objectValues = (i) => s.objectKeys(i).map(function(n) {
|
|
2472
2472
|
return i[n];
|
|
2473
|
-
}),
|
|
2473
|
+
}), s.objectKeys = typeof Object.keys == "function" ? (i) => Object.keys(i) : (i) => {
|
|
2474
2474
|
let n = [];
|
|
2475
2475
|
for (let o in i)
|
|
2476
2476
|
Object.prototype.hasOwnProperty.call(i, o) && n.push(o);
|
|
2477
2477
|
return n;
|
|
2478
|
-
},
|
|
2478
|
+
}, s.find = (i, n) => {
|
|
2479
2479
|
for (let o of i)
|
|
2480
2480
|
if (n(o))
|
|
2481
2481
|
return o;
|
|
2482
|
-
},
|
|
2482
|
+
}, s.isInteger = typeof Number.isInteger == "function" ? (i) => Number.isInteger(i) : (i) => typeof i == "number" && isFinite(i) && Math.
|
|
2483
2483
|
floor(i) === i;
|
|
2484
|
-
function
|
|
2484
|
+
function r(i, n = " | ") {
|
|
2485
2485
|
return i.map((o) => typeof o == "string" ? `'${o}'` : o).join(n);
|
|
2486
2486
|
}
|
|
2487
|
-
d(
|
|
2487
|
+
d(r, "joinValues"), s.joinValues = r, s.jsonStringifyReplacer = (i, n) => typeof n == "bigint" ? n.toString() : n;
|
|
2488
2488
|
})(xt || (w.util = xt = {}));
|
|
2489
|
-
var
|
|
2490
|
-
(function(
|
|
2491
|
-
|
|
2489
|
+
var sr;
|
|
2490
|
+
(function(s) {
|
|
2491
|
+
s.mergeShapes = (e, t) => ({
|
|
2492
2492
|
...e,
|
|
2493
2493
|
...t
|
|
2494
2494
|
// second overwrites first
|
|
2495
2495
|
});
|
|
2496
|
-
})(
|
|
2496
|
+
})(sr || (w.objectUtil = sr = {}));
|
|
2497
2497
|
w.ZodParsedType = xt.arrayToEnum([
|
|
2498
2498
|
"string",
|
|
2499
2499
|
"nan",
|
|
@@ -2516,14 +2516,14 @@ var Ee = O((w) => {
|
|
|
2516
2516
|
"map",
|
|
2517
2517
|
"set"
|
|
2518
2518
|
]);
|
|
2519
|
-
var
|
|
2520
|
-
switch (typeof
|
|
2519
|
+
var bs = /* @__PURE__ */ d((s) => {
|
|
2520
|
+
switch (typeof s) {
|
|
2521
2521
|
case "undefined":
|
|
2522
2522
|
return w.ZodParsedType.undefined;
|
|
2523
2523
|
case "string":
|
|
2524
2524
|
return w.ZodParsedType.string;
|
|
2525
2525
|
case "number":
|
|
2526
|
-
return isNaN(
|
|
2526
|
+
return isNaN(s) ? w.ZodParsedType.nan : w.ZodParsedType.number;
|
|
2527
2527
|
case "boolean":
|
|
2528
2528
|
return w.ZodParsedType.boolean;
|
|
2529
2529
|
case "function":
|
|
@@ -2533,14 +2533,14 @@ var Ee = O((w) => {
|
|
|
2533
2533
|
case "symbol":
|
|
2534
2534
|
return w.ZodParsedType.symbol;
|
|
2535
2535
|
case "object":
|
|
2536
|
-
return Array.isArray(
|
|
2537
|
-
typeof
|
|
2538
|
-
u" &&
|
|
2536
|
+
return Array.isArray(s) ? w.ZodParsedType.array : s === null ? w.ZodParsedType.null : s.then && typeof s.then == "function" && s.catch &&
|
|
2537
|
+
typeof s.catch == "function" ? w.ZodParsedType.promise : typeof Map < "u" && s instanceof Map ? w.ZodParsedType.map : typeof Set < "\
|
|
2538
|
+
u" && s instanceof Set ? w.ZodParsedType.set : typeof Date < "u" && s instanceof Date ? w.ZodParsedType.date : w.ZodParsedType.object;
|
|
2539
2539
|
default:
|
|
2540
2540
|
return w.ZodParsedType.unknown;
|
|
2541
2541
|
}
|
|
2542
2542
|
}, "getParsedType");
|
|
2543
|
-
w.getParsedType =
|
|
2543
|
+
w.getParsedType = bs;
|
|
2544
2544
|
});
|
|
2545
2545
|
|
|
2546
2546
|
// ../node_modules/zod/lib/ZodError.js
|
|
@@ -2548,8 +2548,8 @@ var Ue = O((K) => {
|
|
|
2548
2548
|
"use strict";
|
|
2549
2549
|
Object.defineProperty(K, "__esModule", { value: !0 });
|
|
2550
2550
|
K.ZodError = K.quotelessJson = K.ZodIssueCode = void 0;
|
|
2551
|
-
var
|
|
2552
|
-
K.ZodIssueCode =
|
|
2551
|
+
var ir = Ee();
|
|
2552
|
+
K.ZodIssueCode = ir.util.arrayToEnum([
|
|
2553
2553
|
"invalid_type",
|
|
2554
2554
|
"invalid_literal",
|
|
2555
2555
|
"custom",
|
|
@@ -2567,9 +2567,9 @@ var Ue = O((K) => {
|
|
|
2567
2567
|
"not_multiple_of",
|
|
2568
2568
|
"not_finite"
|
|
2569
2569
|
]);
|
|
2570
|
-
var
|
|
2571
|
-
K.quotelessJson =
|
|
2572
|
-
var Ae = class
|
|
2570
|
+
var xs = /* @__PURE__ */ d((s) => JSON.stringify(s, null, 2).replace(/"([^"]+)":/g, "$1:"), "quotelessJson");
|
|
2571
|
+
K.quotelessJson = xs;
|
|
2572
|
+
var Ae = class s extends Error {
|
|
2573
2573
|
static {
|
|
2574
2574
|
d(this, "ZodError");
|
|
2575
2575
|
}
|
|
@@ -2577,10 +2577,10 @@ var Ue = O((K) => {
|
|
|
2577
2577
|
return this.issues;
|
|
2578
2578
|
}
|
|
2579
2579
|
constructor(e) {
|
|
2580
|
-
super(), this.issues = [], this.addIssue = (
|
|
2581
|
-
this.issues = [...this.issues,
|
|
2582
|
-
}, this.addIssues = (
|
|
2583
|
-
this.issues = [...this.issues, ...
|
|
2580
|
+
super(), this.issues = [], this.addIssue = (r) => {
|
|
2581
|
+
this.issues = [...this.issues, r];
|
|
2582
|
+
}, this.addIssues = (r = []) => {
|
|
2583
|
+
this.issues = [...this.issues, ...r];
|
|
2584
2584
|
};
|
|
2585
2585
|
let t = new.target.prototype;
|
|
2586
2586
|
Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
|
|
@@ -2588,7 +2588,7 @@ var Ue = O((K) => {
|
|
|
2588
2588
|
format(e) {
|
|
2589
2589
|
let t = e || function(n) {
|
|
2590
2590
|
return n.message;
|
|
2591
|
-
},
|
|
2591
|
+
}, r = { _errors: [] }, i = /* @__PURE__ */ d((n) => {
|
|
2592
2592
|
for (let o of n.issues)
|
|
2593
2593
|
if (o.code === "invalid_union")
|
|
2594
2594
|
o.unionErrors.map(i);
|
|
@@ -2597,9 +2597,9 @@ var Ue = O((K) => {
|
|
|
2597
2597
|
else if (o.code === "invalid_arguments")
|
|
2598
2598
|
i(o.argumentsError);
|
|
2599
2599
|
else if (o.path.length === 0)
|
|
2600
|
-
|
|
2600
|
+
r._errors.push(t(o));
|
|
2601
2601
|
else {
|
|
2602
|
-
let a =
|
|
2602
|
+
let a = r, l = 0;
|
|
2603
2603
|
for (; l < o.path.length; ) {
|
|
2604
2604
|
let p = o.path[l];
|
|
2605
2605
|
l === o.path.length - 1 ? (a[p] = a[p] || { _errors: [] }, a[p]._errors.push(t(o))) : a[p] = a[p] || { _errors: [] }, a = a[p],
|
|
@@ -2607,59 +2607,59 @@ var Ue = O((K) => {
|
|
|
2607
2607
|
}
|
|
2608
2608
|
}
|
|
2609
2609
|
}, "processError");
|
|
2610
|
-
return i(this),
|
|
2610
|
+
return i(this), r;
|
|
2611
2611
|
}
|
|
2612
2612
|
static assert(e) {
|
|
2613
|
-
if (!(e instanceof
|
|
2613
|
+
if (!(e instanceof s))
|
|
2614
2614
|
throw new Error(`Not a ZodError: ${e}`);
|
|
2615
2615
|
}
|
|
2616
2616
|
toString() {
|
|
2617
2617
|
return this.message;
|
|
2618
2618
|
}
|
|
2619
2619
|
get message() {
|
|
2620
|
-
return JSON.stringify(this.issues,
|
|
2620
|
+
return JSON.stringify(this.issues, ir.util.jsonStringifyReplacer, 2);
|
|
2621
2621
|
}
|
|
2622
2622
|
get isEmpty() {
|
|
2623
2623
|
return this.issues.length === 0;
|
|
2624
2624
|
}
|
|
2625
2625
|
flatten(e = (t) => t.message) {
|
|
2626
|
-
let t = {},
|
|
2626
|
+
let t = {}, r = [];
|
|
2627
2627
|
for (let i of this.issues)
|
|
2628
|
-
i.path.length > 0 ? (t[i.path[0]] = t[i.path[0]] || [], t[i.path[0]].push(e(i))) :
|
|
2629
|
-
return { formErrors:
|
|
2628
|
+
i.path.length > 0 ? (t[i.path[0]] = t[i.path[0]] || [], t[i.path[0]].push(e(i))) : r.push(e(i));
|
|
2629
|
+
return { formErrors: r, fieldErrors: t };
|
|
2630
2630
|
}
|
|
2631
2631
|
get formErrors() {
|
|
2632
2632
|
return this.flatten();
|
|
2633
2633
|
}
|
|
2634
2634
|
};
|
|
2635
2635
|
K.ZodError = Ae;
|
|
2636
|
-
Ae.create = (
|
|
2636
|
+
Ae.create = (s) => new Ae(s);
|
|
2637
2637
|
});
|
|
2638
2638
|
|
|
2639
2639
|
// ../node_modules/zod/lib/locales/en.js
|
|
2640
2640
|
var kt = O((wt) => {
|
|
2641
2641
|
"use strict";
|
|
2642
2642
|
Object.defineProperty(wt, "__esModule", { value: !0 });
|
|
2643
|
-
var X = Ee(), T = Ue(),
|
|
2643
|
+
var X = Ee(), T = Ue(), ws = /* @__PURE__ */ d((s, e) => {
|
|
2644
2644
|
let t;
|
|
2645
|
-
switch (
|
|
2645
|
+
switch (s.code) {
|
|
2646
2646
|
case T.ZodIssueCode.invalid_type:
|
|
2647
|
-
|
|
2647
|
+
s.received === X.ZodParsedType.undefined ? t = "Required" : t = `Expected ${s.expected}, received ${s.received}`;
|
|
2648
2648
|
break;
|
|
2649
2649
|
case T.ZodIssueCode.invalid_literal:
|
|
2650
|
-
t = `Invalid literal value, expected ${JSON.stringify(
|
|
2650
|
+
t = `Invalid literal value, expected ${JSON.stringify(s.expected, X.util.jsonStringifyReplacer)}`;
|
|
2651
2651
|
break;
|
|
2652
2652
|
case T.ZodIssueCode.unrecognized_keys:
|
|
2653
|
-
t = `Unrecognized key(s) in object: ${X.util.joinValues(
|
|
2653
|
+
t = `Unrecognized key(s) in object: ${X.util.joinValues(s.keys, ", ")}`;
|
|
2654
2654
|
break;
|
|
2655
2655
|
case T.ZodIssueCode.invalid_union:
|
|
2656
2656
|
t = "Invalid input";
|
|
2657
2657
|
break;
|
|
2658
2658
|
case T.ZodIssueCode.invalid_union_discriminator:
|
|
2659
|
-
t = `Invalid discriminator value. Expected ${X.util.joinValues(
|
|
2659
|
+
t = `Invalid discriminator value. Expected ${X.util.joinValues(s.options)}`;
|
|
2660
2660
|
break;
|
|
2661
2661
|
case T.ZodIssueCode.invalid_enum_value:
|
|
2662
|
-
t = `Invalid enum value. Expected ${X.util.joinValues(
|
|
2662
|
+
t = `Invalid enum value. Expected ${X.util.joinValues(s.options)}, received '${s.received}'`;
|
|
2663
2663
|
break;
|
|
2664
2664
|
case T.ZodIssueCode.invalid_arguments:
|
|
2665
2665
|
t = "Invalid function arguments";
|
|
@@ -2671,26 +2671,26 @@ var kt = O((wt) => {
|
|
|
2671
2671
|
t = "Invalid date";
|
|
2672
2672
|
break;
|
|
2673
2673
|
case T.ZodIssueCode.invalid_string:
|
|
2674
|
-
typeof
|
|
2675
|
-
validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${
|
|
2676
|
-
sWith" in
|
|
2677
|
-
: must end with "${
|
|
2674
|
+
typeof s.validation == "object" ? "includes" in s.validation ? (t = `Invalid input: must include "${s.validation.includes}"`, typeof s.
|
|
2675
|
+
validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${s.validation.position}`)) : "start\
|
|
2676
|
+
sWith" in s.validation ? t = `Invalid input: must start with "${s.validation.startsWith}"` : "endsWith" in s.validation ? t = `Invalid input\
|
|
2677
|
+
: must end with "${s.validation.endsWith}"` : X.util.assertNever(s.validation) : s.validation !== "regex" ? t = `Invalid ${s.validation}` : t =
|
|
2678
2678
|
"Invalid";
|
|
2679
2679
|
break;
|
|
2680
2680
|
case T.ZodIssueCode.too_small:
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
n "}${
|
|
2685
|
-
ater than "}${new Date(Number(
|
|
2681
|
+
s.type === "array" ? t = `Array must contain ${s.exact ? "exactly" : s.inclusive ? "at least" : "more than"} ${s.minimum} element(s)` :
|
|
2682
|
+
s.type === "string" ? t = `String must contain ${s.exact ? "exactly" : s.inclusive ? "at least" : "over"} ${s.minimum} character(s)` :
|
|
2683
|
+
s.type === "number" ? t = `Number must be ${s.exact ? "exactly equal to " : s.inclusive ? "greater than or equal to " : "greater tha\
|
|
2684
|
+
n "}${s.minimum}` : s.type === "date" ? t = `Date must be ${s.exact ? "exactly equal to " : s.inclusive ? "greater than or equal to " : "gre\
|
|
2685
|
+
ater than "}${new Date(Number(s.minimum))}` : t = "Invalid input";
|
|
2686
2686
|
break;
|
|
2687
2687
|
case T.ZodIssueCode.too_big:
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
Number(
|
|
2688
|
+
s.type === "array" ? t = `Array must contain ${s.exact ? "exactly" : s.inclusive ? "at most" : "less than"} ${s.maximum} element(s)` :
|
|
2689
|
+
s.type === "string" ? t = `String must contain ${s.exact ? "exactly" : s.inclusive ? "at most" : "under"} ${s.maximum} character(s)` :
|
|
2690
|
+
s.type === "number" ? t = `Number must be ${s.exact ? "exactly" : s.inclusive ? "less than or equal to" : "less than"} ${s.maximum}` :
|
|
2691
|
+
s.type === "bigint" ? t = `BigInt must be ${s.exact ? "exactly" : s.inclusive ? "less than or equal to" : "less than"} ${s.maximum}` :
|
|
2692
|
+
s.type === "date" ? t = `Date must be ${s.exact ? "exactly" : s.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(
|
|
2693
|
+
Number(s.maximum))}` : t = "Invalid input";
|
|
2694
2694
|
break;
|
|
2695
2695
|
case T.ZodIssueCode.custom:
|
|
2696
2696
|
t = "Invalid input";
|
|
@@ -2699,53 +2699,53 @@ ater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
|
|
|
2699
2699
|
t = "Intersection results could not be merged";
|
|
2700
2700
|
break;
|
|
2701
2701
|
case T.ZodIssueCode.not_multiple_of:
|
|
2702
|
-
t = `Number must be a multiple of ${
|
|
2702
|
+
t = `Number must be a multiple of ${s.multipleOf}`;
|
|
2703
2703
|
break;
|
|
2704
2704
|
case T.ZodIssueCode.not_finite:
|
|
2705
2705
|
t = "Number must be finite";
|
|
2706
2706
|
break;
|
|
2707
2707
|
default:
|
|
2708
|
-
t = e.defaultError, X.util.assertNever(
|
|
2708
|
+
t = e.defaultError, X.util.assertNever(s);
|
|
2709
2709
|
}
|
|
2710
2710
|
return { message: t };
|
|
2711
2711
|
}, "errorMap");
|
|
2712
|
-
wt.default =
|
|
2712
|
+
wt.default = ws;
|
|
2713
2713
|
});
|
|
2714
2714
|
|
|
2715
2715
|
// ../node_modules/zod/lib/errors.js
|
|
2716
2716
|
var qe = O((D) => {
|
|
2717
2717
|
"use strict";
|
|
2718
|
-
var
|
|
2719
|
-
return
|
|
2718
|
+
var ks = D && D.__importDefault || function(s) {
|
|
2719
|
+
return s && s.__esModule ? s : { default: s };
|
|
2720
2720
|
};
|
|
2721
2721
|
Object.defineProperty(D, "__esModule", { value: !0 });
|
|
2722
2722
|
D.getErrorMap = D.setErrorMap = D.defaultErrorMap = void 0;
|
|
2723
|
-
var
|
|
2724
|
-
D.defaultErrorMap =
|
|
2725
|
-
var
|
|
2726
|
-
function
|
|
2727
|
-
|
|
2723
|
+
var nr = ks(kt());
|
|
2724
|
+
D.defaultErrorMap = nr.default;
|
|
2725
|
+
var or = nr.default;
|
|
2726
|
+
function Cs(s) {
|
|
2727
|
+
or = s;
|
|
2728
2728
|
}
|
|
2729
|
-
d(
|
|
2730
|
-
D.setErrorMap =
|
|
2731
|
-
function
|
|
2732
|
-
return
|
|
2729
|
+
d(Cs, "setErrorMap");
|
|
2730
|
+
D.setErrorMap = Cs;
|
|
2731
|
+
function Is() {
|
|
2732
|
+
return or;
|
|
2733
2733
|
}
|
|
2734
|
-
d(
|
|
2735
|
-
D.getErrorMap =
|
|
2734
|
+
d(Is, "getErrorMap");
|
|
2735
|
+
D.getErrorMap = Is;
|
|
2736
2736
|
});
|
|
2737
2737
|
|
|
2738
2738
|
// ../node_modules/zod/lib/helpers/parseUtil.js
|
|
2739
2739
|
var It = O((x) => {
|
|
2740
2740
|
"use strict";
|
|
2741
|
-
var
|
|
2742
|
-
return
|
|
2741
|
+
var Os = x && x.__importDefault || function(s) {
|
|
2742
|
+
return s && s.__esModule ? s : { default: s };
|
|
2743
2743
|
};
|
|
2744
2744
|
Object.defineProperty(x, "__esModule", { value: !0 });
|
|
2745
2745
|
x.isAsync = x.isValid = x.isDirty = x.isAborted = x.OK = x.DIRTY = x.INVALID = x.ParseStatus = x.addIssueToContext = x.EMPTY_PATH = x.makeIssue =
|
|
2746
2746
|
void 0;
|
|
2747
|
-
var
|
|
2748
|
-
let { data: e, path: t, errorMaps:
|
|
2747
|
+
var Ts = qe(), ar = Os(kt()), Es = /* @__PURE__ */ d((s) => {
|
|
2748
|
+
let { data: e, path: t, errorMaps: r, issueData: i } = s, n = [...t, ...i.path || []], o = {
|
|
2749
2749
|
...i,
|
|
2750
2750
|
path: n
|
|
2751
2751
|
};
|
|
@@ -2755,7 +2755,7 @@ var It = O((x) => {
|
|
|
2755
2755
|
path: n,
|
|
2756
2756
|
message: i.message
|
|
2757
2757
|
};
|
|
2758
|
-
let a = "", l =
|
|
2758
|
+
let a = "", l = r.filter((p) => !!p).slice().reverse();
|
|
2759
2759
|
for (let p of l)
|
|
2760
2760
|
a = p(o, { data: e, defaultError: a }).message;
|
|
2761
2761
|
return {
|
|
@@ -2764,29 +2764,29 @@ var It = O((x) => {
|
|
|
2764
2764
|
message: a
|
|
2765
2765
|
};
|
|
2766
2766
|
}, "makeIssue");
|
|
2767
|
-
x.makeIssue =
|
|
2767
|
+
x.makeIssue = Es;
|
|
2768
2768
|
x.EMPTY_PATH = [];
|
|
2769
|
-
function
|
|
2770
|
-
let t = (0,
|
|
2769
|
+
function As(s, e) {
|
|
2770
|
+
let t = (0, Ts.getErrorMap)(), r = (0, x.makeIssue)({
|
|
2771
2771
|
issueData: e,
|
|
2772
|
-
data:
|
|
2773
|
-
path:
|
|
2772
|
+
data: s.data,
|
|
2773
|
+
path: s.path,
|
|
2774
2774
|
errorMaps: [
|
|
2775
|
-
|
|
2775
|
+
s.common.contextualErrorMap,
|
|
2776
2776
|
// contextual error map is first priority
|
|
2777
|
-
|
|
2777
|
+
s.schemaErrorMap,
|
|
2778
2778
|
// then schema-bound map if available
|
|
2779
2779
|
t,
|
|
2780
2780
|
// then global override map
|
|
2781
|
-
t ===
|
|
2781
|
+
t === ar.default ? void 0 : ar.default
|
|
2782
2782
|
// then global default map
|
|
2783
2783
|
].filter((i) => !!i)
|
|
2784
2784
|
});
|
|
2785
|
-
|
|
2785
|
+
s.common.issues.push(r);
|
|
2786
2786
|
}
|
|
2787
|
-
d(
|
|
2788
|
-
x.addIssueToContext =
|
|
2789
|
-
var Ct = class
|
|
2787
|
+
d(As, "addIssueToContext");
|
|
2788
|
+
x.addIssueToContext = As;
|
|
2789
|
+
var Ct = class s {
|
|
2790
2790
|
static {
|
|
2791
2791
|
d(this, "ParseStatus");
|
|
2792
2792
|
}
|
|
@@ -2800,86 +2800,86 @@ var It = O((x) => {
|
|
|
2800
2800
|
this.value !== "aborted" && (this.value = "aborted");
|
|
2801
2801
|
}
|
|
2802
2802
|
static mergeArray(e, t) {
|
|
2803
|
-
let
|
|
2803
|
+
let r = [];
|
|
2804
2804
|
for (let i of t) {
|
|
2805
2805
|
if (i.status === "aborted")
|
|
2806
2806
|
return x.INVALID;
|
|
2807
|
-
i.status === "dirty" && e.dirty(),
|
|
2807
|
+
i.status === "dirty" && e.dirty(), r.push(i.value);
|
|
2808
2808
|
}
|
|
2809
|
-
return { status: e.value, value:
|
|
2809
|
+
return { status: e.value, value: r };
|
|
2810
2810
|
}
|
|
2811
2811
|
static async mergeObjectAsync(e, t) {
|
|
2812
|
-
let
|
|
2812
|
+
let r = [];
|
|
2813
2813
|
for (let i of t) {
|
|
2814
2814
|
let n = await i.key, o = await i.value;
|
|
2815
|
-
|
|
2815
|
+
r.push({
|
|
2816
2816
|
key: n,
|
|
2817
2817
|
value: o
|
|
2818
2818
|
});
|
|
2819
2819
|
}
|
|
2820
|
-
return
|
|
2820
|
+
return s.mergeObjectSync(e, r);
|
|
2821
2821
|
}
|
|
2822
2822
|
static mergeObjectSync(e, t) {
|
|
2823
|
-
let
|
|
2823
|
+
let r = {};
|
|
2824
2824
|
for (let i of t) {
|
|
2825
2825
|
let { key: n, value: o } = i;
|
|
2826
2826
|
if (n.status === "aborted" || o.status === "aborted")
|
|
2827
2827
|
return x.INVALID;
|
|
2828
2828
|
n.status === "dirty" && e.dirty(), o.status === "dirty" && e.dirty(), n.value !== "__proto__" && (typeof o.value < "u" || i.alwaysSet) &&
|
|
2829
|
-
(
|
|
2829
|
+
(r[n.value] = o.value);
|
|
2830
2830
|
}
|
|
2831
|
-
return { status: e.value, value:
|
|
2831
|
+
return { status: e.value, value: r };
|
|
2832
2832
|
}
|
|
2833
2833
|
};
|
|
2834
2834
|
x.ParseStatus = Ct;
|
|
2835
2835
|
x.INVALID = Object.freeze({
|
|
2836
2836
|
status: "aborted"
|
|
2837
2837
|
});
|
|
2838
|
-
var
|
|
2839
|
-
x.DIRTY =
|
|
2840
|
-
var
|
|
2841
|
-
x.OK =
|
|
2842
|
-
var
|
|
2843
|
-
x.isAborted =
|
|
2844
|
-
var
|
|
2845
|
-
x.isDirty =
|
|
2846
|
-
var
|
|
2847
|
-
x.isValid =
|
|
2848
|
-
var
|
|
2849
|
-
x.isAsync =
|
|
2838
|
+
var js = /* @__PURE__ */ d((s) => ({ status: "dirty", value: s }), "DIRTY");
|
|
2839
|
+
x.DIRTY = js;
|
|
2840
|
+
var Ss = /* @__PURE__ */ d((s) => ({ status: "valid", value: s }), "OK");
|
|
2841
|
+
x.OK = Ss;
|
|
2842
|
+
var Rs = /* @__PURE__ */ d((s) => s.status === "aborted", "isAborted");
|
|
2843
|
+
x.isAborted = Rs;
|
|
2844
|
+
var Zs = /* @__PURE__ */ d((s) => s.status === "dirty", "isDirty");
|
|
2845
|
+
x.isDirty = Zs;
|
|
2846
|
+
var Ps = /* @__PURE__ */ d((s) => s.status === "valid", "isValid");
|
|
2847
|
+
x.isValid = Ps;
|
|
2848
|
+
var Ns = /* @__PURE__ */ d((s) => typeof Promise < "u" && s instanceof Promise, "isAsync");
|
|
2849
|
+
x.isAsync = Ns;
|
|
2850
2850
|
});
|
|
2851
2851
|
|
|
2852
2852
|
// ../node_modules/zod/lib/helpers/typeAliases.js
|
|
2853
|
-
var
|
|
2853
|
+
var cr = O((dr) => {
|
|
2854
2854
|
"use strict";
|
|
2855
|
-
Object.defineProperty(
|
|
2855
|
+
Object.defineProperty(dr, "__esModule", { value: !0 });
|
|
2856
2856
|
});
|
|
2857
2857
|
|
|
2858
2858
|
// ../node_modules/zod/lib/helpers/errorUtil.js
|
|
2859
|
-
var
|
|
2859
|
+
var lr = O((Fe) => {
|
|
2860
2860
|
"use strict";
|
|
2861
2861
|
Object.defineProperty(Fe, "__esModule", { value: !0 });
|
|
2862
2862
|
Fe.errorUtil = void 0;
|
|
2863
|
-
var
|
|
2864
|
-
(function(
|
|
2865
|
-
|
|
2866
|
-
})(
|
|
2863
|
+
var ur;
|
|
2864
|
+
(function(s) {
|
|
2865
|
+
s.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, s.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
2866
|
+
})(ur || (Fe.errorUtil = ur = {}));
|
|
2867
2867
|
});
|
|
2868
2868
|
|
|
2869
2869
|
// ../node_modules/zod/lib/types.js
|
|
2870
|
-
var
|
|
2870
|
+
var Cr = O((c) => {
|
|
2871
2871
|
"use strict";
|
|
2872
|
-
var We = c && c.__classPrivateFieldGet || function(
|
|
2873
|
-
if (t === "a" && !
|
|
2874
|
-
if (typeof e == "function" ?
|
|
2872
|
+
var We = c && c.__classPrivateFieldGet || function(s, e, t, r) {
|
|
2873
|
+
if (t === "a" && !r) throw new TypeError("Private accessor was defined without a getter");
|
|
2874
|
+
if (typeof e == "function" ? s !== e || !r : !e.has(s)) throw new TypeError("Cannot read private member from an object whose class did n\
|
|
2875
2875
|
ot declare it");
|
|
2876
|
-
return t === "m" ?
|
|
2877
|
-
},
|
|
2878
|
-
if (
|
|
2879
|
-
if (
|
|
2880
|
-
if (typeof e == "function" ?
|
|
2876
|
+
return t === "m" ? r : t === "a" ? r.call(s) : r ? r.value : e.get(s);
|
|
2877
|
+
}, mr = c && c.__classPrivateFieldSet || function(s, e, t, r, i) {
|
|
2878
|
+
if (r === "m") throw new TypeError("Private method is not writable");
|
|
2879
|
+
if (r === "a" && !i) throw new TypeError("Private accessor was defined without a setter");
|
|
2880
|
+
if (typeof e == "function" ? s !== e || !i : !e.has(s)) throw new TypeError("Cannot write private member to an object whose class did no\
|
|
2881
2881
|
t declare it");
|
|
2882
|
-
return
|
|
2882
|
+
return r === "a" ? i.call(s, t) : i ? i.value = t : e.set(s, t), t;
|
|
2883
2883
|
}, je, Se;
|
|
2884
2884
|
Object.defineProperty(c, "__esModule", { value: !0 });
|
|
2885
2885
|
c.boolean = c.bigint = c.array = c.any = c.coerce = c.ZodFirstPartyTypeKind = c.late = c.ZodSchema = c.Schema = c.custom = c.ZodReadonly =
|
|
@@ -2891,42 +2891,42 @@ t declare it");
|
|
|
2891
2891
|
c.promise = c.preprocess = c.pipeline = c.ostring = c.optional = c.onumber = c.oboolean = c.object = c.number = c.nullable = c.null = c.never =
|
|
2892
2892
|
c.nativeEnum = c.nan = c.map = c.literal = c.lazy = c.intersection = c.instanceof = c.function = c.enum = c.effect = c.discriminatedUnion =
|
|
2893
2893
|
c.date = void 0;
|
|
2894
|
-
var Be = qe(), g =
|
|
2894
|
+
var Be = qe(), g = lr(), u = It(), f = Ee(), m = Ue(), P = class {
|
|
2895
2895
|
static {
|
|
2896
2896
|
d(this, "ParseInputLazyPath");
|
|
2897
2897
|
}
|
|
2898
|
-
constructor(e, t,
|
|
2899
|
-
this._cachedPath = [], this.parent = e, this.data = t, this._path =
|
|
2898
|
+
constructor(e, t, r, i) {
|
|
2899
|
+
this._cachedPath = [], this.parent = e, this.data = t, this._path = r, this._key = i;
|
|
2900
2900
|
}
|
|
2901
2901
|
get path() {
|
|
2902
2902
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.
|
|
2903
2903
|
push(...this._path, this._key)), this._cachedPath;
|
|
2904
2904
|
}
|
|
2905
|
-
},
|
|
2905
|
+
}, pr = /* @__PURE__ */ d((s, e) => {
|
|
2906
2906
|
if ((0, u.isValid)(e))
|
|
2907
2907
|
return { success: !0, data: e.value };
|
|
2908
|
-
if (!
|
|
2908
|
+
if (!s.common.issues.length)
|
|
2909
2909
|
throw new Error("Validation failed but no issues detected.");
|
|
2910
2910
|
return {
|
|
2911
2911
|
success: !1,
|
|
2912
2912
|
get error() {
|
|
2913
2913
|
if (this._error)
|
|
2914
2914
|
return this._error;
|
|
2915
|
-
let t = new m.ZodError(
|
|
2915
|
+
let t = new m.ZodError(s.common.issues);
|
|
2916
2916
|
return this._error = t, this._error;
|
|
2917
2917
|
}
|
|
2918
2918
|
};
|
|
2919
2919
|
}, "handleResult");
|
|
2920
|
-
function v(
|
|
2921
|
-
if (!
|
|
2920
|
+
function v(s) {
|
|
2921
|
+
if (!s)
|
|
2922
2922
|
return {};
|
|
2923
|
-
let { errorMap: e, invalid_type_error: t, required_error:
|
|
2924
|
-
if (e && (t ||
|
|
2923
|
+
let { errorMap: e, invalid_type_error: t, required_error: r, description: i } = s;
|
|
2924
|
+
if (e && (t || r))
|
|
2925
2925
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
2926
2926
|
return e ? { errorMap: e, description: i } : { errorMap: /* @__PURE__ */ d((o, a) => {
|
|
2927
2927
|
var l, p;
|
|
2928
|
-
let { message: h } =
|
|
2929
|
-
return o.code === "invalid_enum_value" ? { message: h ?? a.defaultError } : typeof a.data > "u" ? { message: (l = h ??
|
|
2928
|
+
let { message: h } = s;
|
|
2929
|
+
return o.code === "invalid_enum_value" ? { message: h ?? a.defaultError } : typeof a.data > "u" ? { message: (l = h ?? r) !== null && l !==
|
|
2930
2930
|
void 0 ? l : a.defaultError } : o.code !== "invalid_type" ? { message: a.defaultError } : { message: (p = h ?? t) !== null && p !== void 0 ?
|
|
2931
2931
|
p : a.defaultError };
|
|
2932
2932
|
}, "customMap"), description: i };
|
|
@@ -2976,17 +2976,17 @@ t declare it");
|
|
|
2976
2976
|
return Promise.resolve(t);
|
|
2977
2977
|
}
|
|
2978
2978
|
parse(e, t) {
|
|
2979
|
-
let
|
|
2980
|
-
if (
|
|
2981
|
-
return
|
|
2982
|
-
throw
|
|
2979
|
+
let r = this.safeParse(e, t);
|
|
2980
|
+
if (r.success)
|
|
2981
|
+
return r.data;
|
|
2982
|
+
throw r.error;
|
|
2983
2983
|
}
|
|
2984
2984
|
safeParse(e, t) {
|
|
2985
|
-
var
|
|
2985
|
+
var r;
|
|
2986
2986
|
let i = {
|
|
2987
2987
|
common: {
|
|
2988
2988
|
issues: [],
|
|
2989
|
-
async: (
|
|
2989
|
+
async: (r = t?.async) !== null && r !== void 0 ? r : !1,
|
|
2990
2990
|
contextualErrorMap: t?.errorMap
|
|
2991
2991
|
},
|
|
2992
2992
|
path: t?.path || [],
|
|
@@ -2995,10 +2995,10 @@ t declare it");
|
|
|
2995
2995
|
data: e,
|
|
2996
2996
|
parsedType: (0, f.getParsedType)(e)
|
|
2997
2997
|
}, n = this._parseSync({ data: e, path: i.path, parent: i });
|
|
2998
|
-
return
|
|
2998
|
+
return pr(i, n);
|
|
2999
2999
|
}
|
|
3000
3000
|
"~validate"(e) {
|
|
3001
|
-
var t,
|
|
3001
|
+
var t, r;
|
|
3002
3002
|
let i = {
|
|
3003
3003
|
common: {
|
|
3004
3004
|
issues: [],
|
|
@@ -3019,7 +3019,7 @@ t declare it");
|
|
|
3019
3019
|
issues: i.common.issues
|
|
3020
3020
|
};
|
|
3021
3021
|
} catch (n) {
|
|
3022
|
-
!((
|
|
3022
|
+
!((r = (t = n?.message) === null || t === void 0 ? void 0 : t.toLowerCase()) === null || r === void 0) && r.includes("encountered") &&
|
|
3023
3023
|
(this["~standard"].async = !0), i.common = {
|
|
3024
3024
|
issues: [],
|
|
3025
3025
|
async: !0
|
|
@@ -3032,13 +3032,13 @@ t declare it");
|
|
|
3032
3032
|
});
|
|
3033
3033
|
}
|
|
3034
3034
|
async parseAsync(e, t) {
|
|
3035
|
-
let
|
|
3036
|
-
if (
|
|
3037
|
-
return
|
|
3038
|
-
throw
|
|
3035
|
+
let r = await this.safeParseAsync(e, t);
|
|
3036
|
+
if (r.success)
|
|
3037
|
+
return r.data;
|
|
3038
|
+
throw r.error;
|
|
3039
3039
|
}
|
|
3040
3040
|
async safeParseAsync(e, t) {
|
|
3041
|
-
let
|
|
3041
|
+
let r = {
|
|
3042
3042
|
common: {
|
|
3043
3043
|
issues: [],
|
|
3044
3044
|
contextualErrorMap: t?.errorMap,
|
|
@@ -3049,22 +3049,22 @@ t declare it");
|
|
|
3049
3049
|
parent: null,
|
|
3050
3050
|
data: e,
|
|
3051
3051
|
parsedType: (0, f.getParsedType)(e)
|
|
3052
|
-
}, i = this._parse({ data: e, path:
|
|
3053
|
-
return
|
|
3052
|
+
}, i = this._parse({ data: e, path: r.path, parent: r }), n = await ((0, u.isAsync)(i) ? i : Promise.resolve(i));
|
|
3053
|
+
return pr(r, n);
|
|
3054
3054
|
}
|
|
3055
3055
|
refine(e, t) {
|
|
3056
|
-
let
|
|
3056
|
+
let r = /* @__PURE__ */ d((i) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(i) : t, "getIssu\
|
|
3057
3057
|
eProperties");
|
|
3058
3058
|
return this._refinement((i, n) => {
|
|
3059
3059
|
let o = e(i), a = /* @__PURE__ */ d(() => n.addIssue({
|
|
3060
3060
|
code: m.ZodIssueCode.custom,
|
|
3061
|
-
...
|
|
3061
|
+
...r(i)
|
|
3062
3062
|
}), "setError");
|
|
3063
3063
|
return typeof Promise < "u" && o instanceof Promise ? o.then((l) => l ? !0 : (a(), !1)) : o ? !0 : (a(), !1);
|
|
3064
3064
|
});
|
|
3065
3065
|
}
|
|
3066
3066
|
refinement(e, t) {
|
|
3067
|
-
return this._refinement((
|
|
3067
|
+
return this._refinement((r, i) => e(r) ? !0 : (i.addIssue(typeof t == "function" ? t(r, i) : t), !1));
|
|
3068
3068
|
}
|
|
3069
3069
|
_refinement(e) {
|
|
3070
3070
|
return new S({
|
|
@@ -3167,51 +3167,51 @@ eProperties");
|
|
|
3167
3167
|
c.ZodType = b;
|
|
3168
3168
|
c.Schema = b;
|
|
3169
3169
|
c.ZodSchema = b;
|
|
3170
|
-
var
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
onent})+$", Ot,
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",
|
|
3179
|
-
function
|
|
3170
|
+
var Vs = /^c[^\s-]{8,}$/i, Ds = /^[0-9a-z]+$/, $s = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Ms = /^[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,
|
|
3171
|
+
Ls = /^[a-z0-9_-]{21}$/i, Us = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, qs = /^[-+]?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)?)??$/,
|
|
3172
|
+
Fs = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Bs = "^(\\p{Extended_Pictographic}|\\p{Emoji_Comp\
|
|
3173
|
+
onent})+$", Ot, Ws = /^(?:(?: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])$/, Hs = /^(?:(?: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])$/,
|
|
3174
|
+
Ks = /^(([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]))$/,
|
|
3175
|
+
zs = /^(([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])$/,
|
|
3176
|
+
Gs = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Js = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
|
|
3177
|
+
fr = "((\\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\
|
|
3178
|
+
]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Ys = new RegExp(`^${fr}$`);
|
|
3179
|
+
function gr(s) {
|
|
3180
3180
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
3181
|
-
return
|
|
3181
|
+
return s.precision ? e = `${e}\\.\\d{${s.precision}}` : s.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
3182
3182
|
}
|
|
3183
|
-
d(
|
|
3184
|
-
function
|
|
3185
|
-
return new RegExp(`^${
|
|
3183
|
+
d(gr, "timeRegexSource");
|
|
3184
|
+
function Xs(s) {
|
|
3185
|
+
return new RegExp(`^${gr(s)}$`);
|
|
3186
3186
|
}
|
|
3187
|
-
d(
|
|
3188
|
-
function
|
|
3189
|
-
let e = `${
|
|
3190
|
-
return t.push(
|
|
3187
|
+
d(Xs, "timeRegex");
|
|
3188
|
+
function yr(s) {
|
|
3189
|
+
let e = `${fr}T${gr(s)}`, t = [];
|
|
3190
|
+
return t.push(s.local ? "Z?" : "Z"), s.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
3191
3191
|
}
|
|
3192
|
-
d(
|
|
3193
|
-
c.datetimeRegex =
|
|
3194
|
-
function
|
|
3195
|
-
return !!((e === "v4" || !e) &&
|
|
3192
|
+
d(yr, "datetimeRegex");
|
|
3193
|
+
c.datetimeRegex = yr;
|
|
3194
|
+
function Qs(s, e) {
|
|
3195
|
+
return !!((e === "v4" || !e) && Ws.test(s) || (e === "v6" || !e) && Ks.test(s));
|
|
3196
3196
|
}
|
|
3197
|
-
d(
|
|
3198
|
-
function ei(
|
|
3199
|
-
if (!
|
|
3197
|
+
d(Qs, "isValidIP");
|
|
3198
|
+
function ei(s, e) {
|
|
3199
|
+
if (!Us.test(s))
|
|
3200
3200
|
return !1;
|
|
3201
3201
|
try {
|
|
3202
|
-
let [t] =
|
|
3203
|
-
|
|
3202
|
+
let [t] = s.split("."), r = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), i = JSON.parse(atob(
|
|
3203
|
+
r));
|
|
3204
3204
|
return !(typeof i != "object" || i === null || !i.typ || !i.alg || e && i.alg !== e);
|
|
3205
3205
|
} catch {
|
|
3206
3206
|
return !1;
|
|
3207
3207
|
}
|
|
3208
3208
|
}
|
|
3209
3209
|
d(ei, "isValidJWT");
|
|
3210
|
-
function ti(
|
|
3211
|
-
return !!((e === "v4" || !e) &&
|
|
3210
|
+
function ti(s, e) {
|
|
3211
|
+
return !!((e === "v4" || !e) && Hs.test(s) || (e === "v6" || !e) && zs.test(s));
|
|
3212
3212
|
}
|
|
3213
3213
|
d(ti, "isValidCidr");
|
|
3214
|
-
var z = class
|
|
3214
|
+
var z = class s extends b {
|
|
3215
3215
|
static {
|
|
3216
3216
|
d(this, "ZodString");
|
|
3217
3217
|
}
|
|
@@ -3224,7 +3224,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3224
3224
|
received: n.parsedType
|
|
3225
3225
|
}), u.INVALID;
|
|
3226
3226
|
}
|
|
3227
|
-
let
|
|
3227
|
+
let r = new u.ParseStatus(), i;
|
|
3228
3228
|
for (let n of this._def.checks)
|
|
3229
3229
|
if (n.kind === "min")
|
|
3230
3230
|
e.data.length < n.value && (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
@@ -3234,7 +3234,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3234
3234
|
inclusive: !0,
|
|
3235
3235
|
exact: !1,
|
|
3236
3236
|
message: n.message
|
|
3237
|
-
}),
|
|
3237
|
+
}), r.dirty());
|
|
3238
3238
|
else if (n.kind === "max")
|
|
3239
3239
|
e.data.length > n.value && (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3240
3240
|
code: m.ZodIssueCode.too_big,
|
|
@@ -3243,7 +3243,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3243
3243
|
inclusive: !0,
|
|
3244
3244
|
exact: !1,
|
|
3245
3245
|
message: n.message
|
|
3246
|
-
}),
|
|
3246
|
+
}), r.dirty());
|
|
3247
3247
|
else if (n.kind === "length") {
|
|
3248
3248
|
let o = e.data.length > n.value, a = e.data.length < n.value;
|
|
3249
3249
|
(o || a) && (i = this._getOrReturnCtx(e, i), o ? (0, u.addIssueToContext)(i, {
|
|
@@ -3260,49 +3260,49 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3260
3260
|
inclusive: !0,
|
|
3261
3261
|
exact: !0,
|
|
3262
3262
|
message: n.message
|
|
3263
|
-
}),
|
|
3263
|
+
}), r.dirty());
|
|
3264
3264
|
} else if (n.kind === "email")
|
|
3265
|
-
|
|
3265
|
+
Fs.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3266
3266
|
validation: "email",
|
|
3267
3267
|
code: m.ZodIssueCode.invalid_string,
|
|
3268
3268
|
message: n.message
|
|
3269
|
-
}),
|
|
3269
|
+
}), r.dirty());
|
|
3270
3270
|
else if (n.kind === "emoji")
|
|
3271
|
-
Ot || (Ot = new RegExp(
|
|
3271
|
+
Ot || (Ot = new RegExp(Bs, "u")), Ot.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3272
3272
|
validation: "emoji",
|
|
3273
3273
|
code: m.ZodIssueCode.invalid_string,
|
|
3274
3274
|
message: n.message
|
|
3275
|
-
}),
|
|
3275
|
+
}), r.dirty());
|
|
3276
3276
|
else if (n.kind === "uuid")
|
|
3277
|
-
|
|
3277
|
+
Ms.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3278
3278
|
validation: "uuid",
|
|
3279
3279
|
code: m.ZodIssueCode.invalid_string,
|
|
3280
3280
|
message: n.message
|
|
3281
|
-
}),
|
|
3281
|
+
}), r.dirty());
|
|
3282
3282
|
else if (n.kind === "nanoid")
|
|
3283
|
-
|
|
3283
|
+
Ls.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3284
3284
|
validation: "nanoid",
|
|
3285
3285
|
code: m.ZodIssueCode.invalid_string,
|
|
3286
3286
|
message: n.message
|
|
3287
|
-
}),
|
|
3287
|
+
}), r.dirty());
|
|
3288
3288
|
else if (n.kind === "cuid")
|
|
3289
|
-
|
|
3289
|
+
Vs.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3290
3290
|
validation: "cuid",
|
|
3291
3291
|
code: m.ZodIssueCode.invalid_string,
|
|
3292
3292
|
message: n.message
|
|
3293
|
-
}),
|
|
3293
|
+
}), r.dirty());
|
|
3294
3294
|
else if (n.kind === "cuid2")
|
|
3295
|
-
|
|
3295
|
+
Ds.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3296
3296
|
validation: "cuid2",
|
|
3297
3297
|
code: m.ZodIssueCode.invalid_string,
|
|
3298
3298
|
message: n.message
|
|
3299
|
-
}),
|
|
3299
|
+
}), r.dirty());
|
|
3300
3300
|
else if (n.kind === "ulid")
|
|
3301
|
-
$
|
|
3301
|
+
$s.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3302
3302
|
validation: "ulid",
|
|
3303
3303
|
code: m.ZodIssueCode.invalid_string,
|
|
3304
3304
|
message: n.message
|
|
3305
|
-
}),
|
|
3305
|
+
}), r.dirty());
|
|
3306
3306
|
else if (n.kind === "url")
|
|
3307
3307
|
try {
|
|
3308
3308
|
new URL(e.data);
|
|
@@ -3311,75 +3311,75 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3311
3311
|
validation: "url",
|
|
3312
3312
|
code: m.ZodIssueCode.invalid_string,
|
|
3313
3313
|
message: n.message
|
|
3314
|
-
}),
|
|
3314
|
+
}), r.dirty();
|
|
3315
3315
|
}
|
|
3316
3316
|
else n.kind === "regex" ? (n.regex.lastIndex = 0, n.regex.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(
|
|
3317
3317
|
i, {
|
|
3318
3318
|
validation: "regex",
|
|
3319
3319
|
code: m.ZodIssueCode.invalid_string,
|
|
3320
3320
|
message: n.message
|
|
3321
|
-
}),
|
|
3321
|
+
}), r.dirty())) : n.kind === "trim" ? e.data = e.data.trim() : n.kind === "includes" ? e.data.includes(n.value, n.position) || (i = this.
|
|
3322
3322
|
_getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3323
3323
|
code: m.ZodIssueCode.invalid_string,
|
|
3324
3324
|
validation: { includes: n.value, position: n.position },
|
|
3325
3325
|
message: n.message
|
|
3326
|
-
}),
|
|
3326
|
+
}), r.dirty()) : n.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : n.kind === "toUpperCase" ? e.data = e.data.toUpperCase() :
|
|
3327
3327
|
n.kind === "startsWith" ? e.data.startsWith(n.value) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3328
3328
|
code: m.ZodIssueCode.invalid_string,
|
|
3329
3329
|
validation: { startsWith: n.value },
|
|
3330
3330
|
message: n.message
|
|
3331
|
-
}),
|
|
3331
|
+
}), r.dirty()) : n.kind === "endsWith" ? e.data.endsWith(n.value) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3332
3332
|
code: m.ZodIssueCode.invalid_string,
|
|
3333
3333
|
validation: { endsWith: n.value },
|
|
3334
3334
|
message: n.message
|
|
3335
|
-
}),
|
|
3335
|
+
}), r.dirty()) : n.kind === "datetime" ? yr(n).test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3336
3336
|
code: m.ZodIssueCode.invalid_string,
|
|
3337
3337
|
validation: "datetime",
|
|
3338
3338
|
message: n.message
|
|
3339
|
-
}),
|
|
3339
|
+
}), r.dirty()) : n.kind === "date" ? Ys.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3340
3340
|
code: m.ZodIssueCode.invalid_string,
|
|
3341
3341
|
validation: "date",
|
|
3342
3342
|
message: n.message
|
|
3343
|
-
}),
|
|
3343
|
+
}), r.dirty()) : n.kind === "time" ? Xs(n).test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3344
3344
|
code: m.ZodIssueCode.invalid_string,
|
|
3345
3345
|
validation: "time",
|
|
3346
3346
|
message: n.message
|
|
3347
|
-
}),
|
|
3347
|
+
}), r.dirty()) : n.kind === "duration" ? qs.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3348
3348
|
validation: "duration",
|
|
3349
3349
|
code: m.ZodIssueCode.invalid_string,
|
|
3350
3350
|
message: n.message
|
|
3351
|
-
}),
|
|
3351
|
+
}), r.dirty()) : n.kind === "ip" ? Qs(e.data, n.version) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3352
3352
|
validation: "ip",
|
|
3353
3353
|
code: m.ZodIssueCode.invalid_string,
|
|
3354
3354
|
message: n.message
|
|
3355
|
-
}),
|
|
3355
|
+
}), r.dirty()) : n.kind === "jwt" ? ei(e.data, n.alg) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3356
3356
|
validation: "jwt",
|
|
3357
3357
|
code: m.ZodIssueCode.invalid_string,
|
|
3358
3358
|
message: n.message
|
|
3359
|
-
}),
|
|
3359
|
+
}), r.dirty()) : n.kind === "cidr" ? ti(e.data, n.version) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3360
3360
|
validation: "cidr",
|
|
3361
3361
|
code: m.ZodIssueCode.invalid_string,
|
|
3362
3362
|
message: n.message
|
|
3363
|
-
}),
|
|
3363
|
+
}), r.dirty()) : n.kind === "base64" ? Gs.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3364
3364
|
validation: "base64",
|
|
3365
3365
|
code: m.ZodIssueCode.invalid_string,
|
|
3366
3366
|
message: n.message
|
|
3367
|
-
}),
|
|
3367
|
+
}), r.dirty()) : n.kind === "base64url" ? Js.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3368
3368
|
validation: "base64url",
|
|
3369
3369
|
code: m.ZodIssueCode.invalid_string,
|
|
3370
3370
|
message: n.message
|
|
3371
|
-
}),
|
|
3372
|
-
return { status:
|
|
3371
|
+
}), r.dirty()) : f.util.assertNever(n);
|
|
3372
|
+
return { status: r.value, value: e.data };
|
|
3373
3373
|
}
|
|
3374
|
-
_regex(e, t,
|
|
3374
|
+
_regex(e, t, r) {
|
|
3375
3375
|
return this.refinement((i) => e.test(i), {
|
|
3376
3376
|
validation: t,
|
|
3377
3377
|
code: m.ZodIssueCode.invalid_string,
|
|
3378
|
-
...g.errorUtil.errToObj(
|
|
3378
|
+
...g.errorUtil.errToObj(r)
|
|
3379
3379
|
});
|
|
3380
3380
|
}
|
|
3381
3381
|
_addCheck(e) {
|
|
3382
|
-
return new
|
|
3382
|
+
return new s({
|
|
3383
3383
|
...this._def,
|
|
3384
3384
|
checks: [...this._def.checks, e]
|
|
3385
3385
|
});
|
|
@@ -3427,7 +3427,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3427
3427
|
return this._addCheck({ kind: "cidr", ...g.errorUtil.errToObj(e) });
|
|
3428
3428
|
}
|
|
3429
3429
|
datetime(e) {
|
|
3430
|
-
var t,
|
|
3430
|
+
var t, r;
|
|
3431
3431
|
return typeof e == "string" ? this._addCheck({
|
|
3432
3432
|
kind: "datetime",
|
|
3433
3433
|
precision: null,
|
|
@@ -3438,7 +3438,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3438
3438
|
kind: "datetime",
|
|
3439
3439
|
precision: typeof e?.precision > "u" ? null : e?.precision,
|
|
3440
3440
|
offset: (t = e?.offset) !== null && t !== void 0 ? t : !1,
|
|
3441
|
-
local: (
|
|
3441
|
+
local: (r = e?.local) !== null && r !== void 0 ? r : !1,
|
|
3442
3442
|
...g.errorUtil.errToObj(e?.message)
|
|
3443
3443
|
});
|
|
3444
3444
|
}
|
|
@@ -3516,19 +3516,19 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3516
3516
|
return this.min(1, g.errorUtil.errToObj(e));
|
|
3517
3517
|
}
|
|
3518
3518
|
trim() {
|
|
3519
|
-
return new
|
|
3519
|
+
return new s({
|
|
3520
3520
|
...this._def,
|
|
3521
3521
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
3522
3522
|
});
|
|
3523
3523
|
}
|
|
3524
3524
|
toLowerCase() {
|
|
3525
|
-
return new
|
|
3525
|
+
return new s({
|
|
3526
3526
|
...this._def,
|
|
3527
3527
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
3528
3528
|
});
|
|
3529
3529
|
}
|
|
3530
3530
|
toUpperCase() {
|
|
3531
|
-
return new
|
|
3531
|
+
return new s({
|
|
3532
3532
|
...this._def,
|
|
3533
3533
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
3534
3534
|
});
|
|
@@ -3595,22 +3595,22 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3595
3595
|
}
|
|
3596
3596
|
};
|
|
3597
3597
|
c.ZodString = z;
|
|
3598
|
-
z.create = (
|
|
3598
|
+
z.create = (s) => {
|
|
3599
3599
|
var e;
|
|
3600
3600
|
return new z({
|
|
3601
3601
|
checks: [],
|
|
3602
3602
|
typeName: _.ZodString,
|
|
3603
|
-
coerce: (e =
|
|
3604
|
-
...v(
|
|
3603
|
+
coerce: (e = s?.coerce) !== null && e !== void 0 ? e : !1,
|
|
3604
|
+
...v(s)
|
|
3605
3605
|
});
|
|
3606
3606
|
};
|
|
3607
|
-
function
|
|
3608
|
-
let t = (
|
|
3607
|
+
function ri(s, e) {
|
|
3608
|
+
let t = (s.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, i = t > r ? t : r, n = parseInt(s.toFixed(
|
|
3609
3609
|
i).replace(".", "")), o = parseInt(e.toFixed(i).replace(".", ""));
|
|
3610
3610
|
return n % o / Math.pow(10, i);
|
|
3611
3611
|
}
|
|
3612
|
-
d(
|
|
3613
|
-
var Q = class
|
|
3612
|
+
d(ri, "floatSafeRemainder");
|
|
3613
|
+
var Q = class s extends b {
|
|
3614
3614
|
static {
|
|
3615
3615
|
d(this, "ZodNumber");
|
|
3616
3616
|
}
|
|
@@ -3626,35 +3626,35 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3626
3626
|
received: n.parsedType
|
|
3627
3627
|
}), u.INVALID;
|
|
3628
3628
|
}
|
|
3629
|
-
let
|
|
3629
|
+
let r, i = new u.ParseStatus();
|
|
3630
3630
|
for (let n of this._def.checks)
|
|
3631
|
-
n.kind === "int" ? f.util.isInteger(e.data) || (
|
|
3631
|
+
n.kind === "int" ? f.util.isInteger(e.data) || (r = this._getOrReturnCtx(e, r), (0, u.addIssueToContext)(r, {
|
|
3632
3632
|
code: m.ZodIssueCode.invalid_type,
|
|
3633
3633
|
expected: "integer",
|
|
3634
3634
|
received: "float",
|
|
3635
3635
|
message: n.message
|
|
3636
|
-
}), i.dirty()) : n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (
|
|
3637
|
-
|
|
3636
|
+
}), i.dirty()) : n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (r = this._getOrReturnCtx(e, r), (0, u.addIssueToContext)(
|
|
3637
|
+
r, {
|
|
3638
3638
|
code: m.ZodIssueCode.too_small,
|
|
3639
3639
|
minimum: n.value,
|
|
3640
3640
|
type: "number",
|
|
3641
3641
|
inclusive: n.inclusive,
|
|
3642
3642
|
exact: !1,
|
|
3643
3643
|
message: n.message
|
|
3644
|
-
}), i.dirty()) : n.kind === "max" ? (n.inclusive ? e.data > n.value : e.data >= n.value) && (
|
|
3645
|
-
|
|
3644
|
+
}), i.dirty()) : n.kind === "max" ? (n.inclusive ? e.data > n.value : e.data >= n.value) && (r = this._getOrReturnCtx(e, r), (0, u.addIssueToContext)(
|
|
3645
|
+
r, {
|
|
3646
3646
|
code: m.ZodIssueCode.too_big,
|
|
3647
3647
|
maximum: n.value,
|
|
3648
3648
|
type: "number",
|
|
3649
3649
|
inclusive: n.inclusive,
|
|
3650
3650
|
exact: !1,
|
|
3651
3651
|
message: n.message
|
|
3652
|
-
}), i.dirty()) : n.kind === "multipleOf" ?
|
|
3652
|
+
}), i.dirty()) : n.kind === "multipleOf" ? ri(e.data, n.value) !== 0 && (r = this._getOrReturnCtx(e, r), (0, u.addIssueToContext)(r,
|
|
3653
3653
|
{
|
|
3654
3654
|
code: m.ZodIssueCode.not_multiple_of,
|
|
3655
3655
|
multipleOf: n.value,
|
|
3656
3656
|
message: n.message
|
|
3657
|
-
}), i.dirty()) : n.kind === "finite" ? Number.isFinite(e.data) || (
|
|
3657
|
+
}), i.dirty()) : n.kind === "finite" ? Number.isFinite(e.data) || (r = this._getOrReturnCtx(e, r), (0, u.addIssueToContext)(r, {
|
|
3658
3658
|
code: m.ZodIssueCode.not_finite,
|
|
3659
3659
|
message: n.message
|
|
3660
3660
|
}), i.dirty()) : f.util.assertNever(n);
|
|
@@ -3672,22 +3672,22 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3672
3672
|
lt(e, t) {
|
|
3673
3673
|
return this.setLimit("max", e, !1, g.errorUtil.toString(t));
|
|
3674
3674
|
}
|
|
3675
|
-
setLimit(e, t,
|
|
3676
|
-
return new
|
|
3675
|
+
setLimit(e, t, r, i) {
|
|
3676
|
+
return new s({
|
|
3677
3677
|
...this._def,
|
|
3678
3678
|
checks: [
|
|
3679
3679
|
...this._def.checks,
|
|
3680
3680
|
{
|
|
3681
3681
|
kind: e,
|
|
3682
3682
|
value: t,
|
|
3683
|
-
inclusive:
|
|
3683
|
+
inclusive: r,
|
|
3684
3684
|
message: g.errorUtil.toString(i)
|
|
3685
3685
|
}
|
|
3686
3686
|
]
|
|
3687
3687
|
});
|
|
3688
3688
|
}
|
|
3689
3689
|
_addCheck(e) {
|
|
3690
|
-
return new
|
|
3690
|
+
return new s({
|
|
3691
3691
|
...this._def,
|
|
3692
3692
|
checks: [...this._def.checks, e]
|
|
3693
3693
|
});
|
|
@@ -3773,22 +3773,22 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3773
3773
|
}
|
|
3774
3774
|
get isFinite() {
|
|
3775
3775
|
let e = null, t = null;
|
|
3776
|
-
for (let
|
|
3777
|
-
if (
|
|
3776
|
+
for (let r of this._def.checks) {
|
|
3777
|
+
if (r.kind === "finite" || r.kind === "int" || r.kind === "multipleOf")
|
|
3778
3778
|
return !0;
|
|
3779
|
-
|
|
3779
|
+
r.kind === "min" ? (t === null || r.value > t) && (t = r.value) : r.kind === "max" && (e === null || r.value < e) && (e = r.value);
|
|
3780
3780
|
}
|
|
3781
3781
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
3782
3782
|
}
|
|
3783
3783
|
};
|
|
3784
3784
|
c.ZodNumber = Q;
|
|
3785
|
-
Q.create = (
|
|
3785
|
+
Q.create = (s) => new Q({
|
|
3786
3786
|
checks: [],
|
|
3787
3787
|
typeName: _.ZodNumber,
|
|
3788
|
-
coerce:
|
|
3789
|
-
...v(
|
|
3788
|
+
coerce: s?.coerce || !1,
|
|
3789
|
+
...v(s)
|
|
3790
3790
|
});
|
|
3791
|
-
var ee = class
|
|
3791
|
+
var ee = class s extends b {
|
|
3792
3792
|
static {
|
|
3793
3793
|
d(this, "ZodBigInt");
|
|
3794
3794
|
}
|
|
@@ -3804,24 +3804,24 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3804
3804
|
}
|
|
3805
3805
|
if (this._getType(e) !== f.ZodParsedType.bigint)
|
|
3806
3806
|
return this._getInvalidInput(e);
|
|
3807
|
-
let
|
|
3807
|
+
let r, i = new u.ParseStatus();
|
|
3808
3808
|
for (let n of this._def.checks)
|
|
3809
|
-
n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (
|
|
3810
|
-
|
|
3809
|
+
n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (r = this._getOrReturnCtx(e, r), (0, u.addIssueToContext)(
|
|
3810
|
+
r, {
|
|
3811
3811
|
code: m.ZodIssueCode.too_small,
|
|
3812
3812
|
type: "bigint",
|
|
3813
3813
|
minimum: n.value,
|
|
3814
3814
|
inclusive: n.inclusive,
|
|
3815
3815
|
message: n.message
|
|
3816
|
-
}), i.dirty()) : n.kind === "max" ? (n.inclusive ? e.data > n.value : e.data >= n.value) && (
|
|
3817
|
-
|
|
3816
|
+
}), i.dirty()) : n.kind === "max" ? (n.inclusive ? e.data > n.value : e.data >= n.value) && (r = this._getOrReturnCtx(e, r), (0, u.addIssueToContext)(
|
|
3817
|
+
r, {
|
|
3818
3818
|
code: m.ZodIssueCode.too_big,
|
|
3819
3819
|
type: "bigint",
|
|
3820
3820
|
maximum: n.value,
|
|
3821
3821
|
inclusive: n.inclusive,
|
|
3822
3822
|
message: n.message
|
|
3823
|
-
}), i.dirty()) : n.kind === "multipleOf" ? e.data % n.value !== BigInt(0) && (
|
|
3824
|
-
|
|
3823
|
+
}), i.dirty()) : n.kind === "multipleOf" ? e.data % n.value !== BigInt(0) && (r = this._getOrReturnCtx(e, r), (0, u.addIssueToContext)(
|
|
3824
|
+
r, {
|
|
3825
3825
|
code: m.ZodIssueCode.not_multiple_of,
|
|
3826
3826
|
multipleOf: n.value,
|
|
3827
3827
|
message: n.message
|
|
@@ -3848,22 +3848,22 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3848
3848
|
lt(e, t) {
|
|
3849
3849
|
return this.setLimit("max", e, !1, g.errorUtil.toString(t));
|
|
3850
3850
|
}
|
|
3851
|
-
setLimit(e, t,
|
|
3852
|
-
return new
|
|
3851
|
+
setLimit(e, t, r, i) {
|
|
3852
|
+
return new s({
|
|
3853
3853
|
...this._def,
|
|
3854
3854
|
checks: [
|
|
3855
3855
|
...this._def.checks,
|
|
3856
3856
|
{
|
|
3857
3857
|
kind: e,
|
|
3858
3858
|
value: t,
|
|
3859
|
-
inclusive:
|
|
3859
|
+
inclusive: r,
|
|
3860
3860
|
message: g.errorUtil.toString(i)
|
|
3861
3861
|
}
|
|
3862
3862
|
]
|
|
3863
3863
|
});
|
|
3864
3864
|
}
|
|
3865
3865
|
_addCheck(e) {
|
|
3866
|
-
return new
|
|
3866
|
+
return new s({
|
|
3867
3867
|
...this._def,
|
|
3868
3868
|
checks: [...this._def.checks, e]
|
|
3869
3869
|
});
|
|
@@ -3921,13 +3921,13 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3921
3921
|
}
|
|
3922
3922
|
};
|
|
3923
3923
|
c.ZodBigInt = ee;
|
|
3924
|
-
ee.create = (
|
|
3924
|
+
ee.create = (s) => {
|
|
3925
3925
|
var e;
|
|
3926
3926
|
return new ee({
|
|
3927
3927
|
checks: [],
|
|
3928
3928
|
typeName: _.ZodBigInt,
|
|
3929
|
-
coerce: (e =
|
|
3930
|
-
...v(
|
|
3929
|
+
coerce: (e = s?.coerce) !== null && e !== void 0 ? e : !1,
|
|
3930
|
+
...v(s)
|
|
3931
3931
|
});
|
|
3932
3932
|
};
|
|
3933
3933
|
var te = class extends b {
|
|
@@ -3936,23 +3936,23 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3936
3936
|
}
|
|
3937
3937
|
_parse(e) {
|
|
3938
3938
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.ZodParsedType.boolean) {
|
|
3939
|
-
let
|
|
3940
|
-
return (0, u.addIssueToContext)(
|
|
3939
|
+
let r = this._getOrReturnCtx(e);
|
|
3940
|
+
return (0, u.addIssueToContext)(r, {
|
|
3941
3941
|
code: m.ZodIssueCode.invalid_type,
|
|
3942
3942
|
expected: f.ZodParsedType.boolean,
|
|
3943
|
-
received:
|
|
3943
|
+
received: r.parsedType
|
|
3944
3944
|
}), u.INVALID;
|
|
3945
3945
|
}
|
|
3946
3946
|
return (0, u.OK)(e.data);
|
|
3947
3947
|
}
|
|
3948
3948
|
};
|
|
3949
3949
|
c.ZodBoolean = te;
|
|
3950
|
-
te.create = (
|
|
3950
|
+
te.create = (s) => new te({
|
|
3951
3951
|
typeName: _.ZodBoolean,
|
|
3952
|
-
coerce:
|
|
3953
|
-
...v(
|
|
3952
|
+
coerce: s?.coerce || !1,
|
|
3953
|
+
...v(s)
|
|
3954
3954
|
});
|
|
3955
|
-
var
|
|
3955
|
+
var re = class s extends b {
|
|
3956
3956
|
static {
|
|
3957
3957
|
d(this, "ZodDate");
|
|
3958
3958
|
}
|
|
@@ -3971,7 +3971,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3971
3971
|
code: m.ZodIssueCode.invalid_date
|
|
3972
3972
|
}), u.INVALID;
|
|
3973
3973
|
}
|
|
3974
|
-
let
|
|
3974
|
+
let r = new u.ParseStatus(), i;
|
|
3975
3975
|
for (let n of this._def.checks)
|
|
3976
3976
|
n.kind === "min" ? e.data.getTime() < n.value && (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3977
3977
|
code: m.ZodIssueCode.too_small,
|
|
@@ -3980,21 +3980,21 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3980
3980
|
exact: !1,
|
|
3981
3981
|
minimum: n.value,
|
|
3982
3982
|
type: "date"
|
|
3983
|
-
}),
|
|
3983
|
+
}), r.dirty()) : n.kind === "max" ? e.data.getTime() > n.value && (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3984
3984
|
code: m.ZodIssueCode.too_big,
|
|
3985
3985
|
message: n.message,
|
|
3986
3986
|
inclusive: !0,
|
|
3987
3987
|
exact: !1,
|
|
3988
3988
|
maximum: n.value,
|
|
3989
3989
|
type: "date"
|
|
3990
|
-
}),
|
|
3990
|
+
}), r.dirty()) : f.util.assertNever(n);
|
|
3991
3991
|
return {
|
|
3992
|
-
status:
|
|
3992
|
+
status: r.value,
|
|
3993
3993
|
value: new Date(e.data.getTime())
|
|
3994
3994
|
};
|
|
3995
3995
|
}
|
|
3996
3996
|
_addCheck(e) {
|
|
3997
|
-
return new
|
|
3997
|
+
return new s({
|
|
3998
3998
|
...this._def,
|
|
3999
3999
|
checks: [...this._def.checks, e]
|
|
4000
4000
|
});
|
|
@@ -4026,12 +4026,12 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4026
4026
|
return e != null ? new Date(e) : null;
|
|
4027
4027
|
}
|
|
4028
4028
|
};
|
|
4029
|
-
c.ZodDate =
|
|
4030
|
-
|
|
4029
|
+
c.ZodDate = re;
|
|
4030
|
+
re.create = (s) => new re({
|
|
4031
4031
|
checks: [],
|
|
4032
|
-
coerce:
|
|
4032
|
+
coerce: s?.coerce || !1,
|
|
4033
4033
|
typeName: _.ZodDate,
|
|
4034
|
-
...v(
|
|
4034
|
+
...v(s)
|
|
4035
4035
|
});
|
|
4036
4036
|
var ye = class extends b {
|
|
4037
4037
|
static {
|
|
@@ -4039,41 +4039,41 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4039
4039
|
}
|
|
4040
4040
|
_parse(e) {
|
|
4041
4041
|
if (this._getType(e) !== f.ZodParsedType.symbol) {
|
|
4042
|
-
let
|
|
4043
|
-
return (0, u.addIssueToContext)(
|
|
4042
|
+
let r = this._getOrReturnCtx(e);
|
|
4043
|
+
return (0, u.addIssueToContext)(r, {
|
|
4044
4044
|
code: m.ZodIssueCode.invalid_type,
|
|
4045
4045
|
expected: f.ZodParsedType.symbol,
|
|
4046
|
-
received:
|
|
4046
|
+
received: r.parsedType
|
|
4047
4047
|
}), u.INVALID;
|
|
4048
4048
|
}
|
|
4049
4049
|
return (0, u.OK)(e.data);
|
|
4050
4050
|
}
|
|
4051
4051
|
};
|
|
4052
4052
|
c.ZodSymbol = ye;
|
|
4053
|
-
ye.create = (
|
|
4053
|
+
ye.create = (s) => new ye({
|
|
4054
4054
|
typeName: _.ZodSymbol,
|
|
4055
|
-
...v(
|
|
4055
|
+
...v(s)
|
|
4056
4056
|
});
|
|
4057
|
-
var
|
|
4057
|
+
var se = class extends b {
|
|
4058
4058
|
static {
|
|
4059
4059
|
d(this, "ZodUndefined");
|
|
4060
4060
|
}
|
|
4061
4061
|
_parse(e) {
|
|
4062
4062
|
if (this._getType(e) !== f.ZodParsedType.undefined) {
|
|
4063
|
-
let
|
|
4064
|
-
return (0, u.addIssueToContext)(
|
|
4063
|
+
let r = this._getOrReturnCtx(e);
|
|
4064
|
+
return (0, u.addIssueToContext)(r, {
|
|
4065
4065
|
code: m.ZodIssueCode.invalid_type,
|
|
4066
4066
|
expected: f.ZodParsedType.undefined,
|
|
4067
|
-
received:
|
|
4067
|
+
received: r.parsedType
|
|
4068
4068
|
}), u.INVALID;
|
|
4069
4069
|
}
|
|
4070
4070
|
return (0, u.OK)(e.data);
|
|
4071
4071
|
}
|
|
4072
4072
|
};
|
|
4073
|
-
c.ZodUndefined =
|
|
4074
|
-
|
|
4073
|
+
c.ZodUndefined = se;
|
|
4074
|
+
se.create = (s) => new se({
|
|
4075
4075
|
typeName: _.ZodUndefined,
|
|
4076
|
-
...v(
|
|
4076
|
+
...v(s)
|
|
4077
4077
|
});
|
|
4078
4078
|
var ie = class extends b {
|
|
4079
4079
|
static {
|
|
@@ -4081,20 +4081,20 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4081
4081
|
}
|
|
4082
4082
|
_parse(e) {
|
|
4083
4083
|
if (this._getType(e) !== f.ZodParsedType.null) {
|
|
4084
|
-
let
|
|
4085
|
-
return (0, u.addIssueToContext)(
|
|
4084
|
+
let r = this._getOrReturnCtx(e);
|
|
4085
|
+
return (0, u.addIssueToContext)(r, {
|
|
4086
4086
|
code: m.ZodIssueCode.invalid_type,
|
|
4087
4087
|
expected: f.ZodParsedType.null,
|
|
4088
|
-
received:
|
|
4088
|
+
received: r.parsedType
|
|
4089
4089
|
}), u.INVALID;
|
|
4090
4090
|
}
|
|
4091
4091
|
return (0, u.OK)(e.data);
|
|
4092
4092
|
}
|
|
4093
4093
|
};
|
|
4094
4094
|
c.ZodNull = ie;
|
|
4095
|
-
ie.create = (
|
|
4095
|
+
ie.create = (s) => new ie({
|
|
4096
4096
|
typeName: _.ZodNull,
|
|
4097
|
-
...v(
|
|
4097
|
+
...v(s)
|
|
4098
4098
|
});
|
|
4099
4099
|
var G = class extends b {
|
|
4100
4100
|
static {
|
|
@@ -4108,9 +4108,9 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4108
4108
|
}
|
|
4109
4109
|
};
|
|
4110
4110
|
c.ZodAny = G;
|
|
4111
|
-
G.create = (
|
|
4111
|
+
G.create = (s) => new G({
|
|
4112
4112
|
typeName: _.ZodAny,
|
|
4113
|
-
...v(
|
|
4113
|
+
...v(s)
|
|
4114
4114
|
});
|
|
4115
4115
|
var q = class extends b {
|
|
4116
4116
|
static {
|
|
@@ -4124,9 +4124,9 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4124
4124
|
}
|
|
4125
4125
|
};
|
|
4126
4126
|
c.ZodUnknown = q;
|
|
4127
|
-
q.create = (
|
|
4127
|
+
q.create = (s) => new q({
|
|
4128
4128
|
typeName: _.ZodUnknown,
|
|
4129
|
-
...v(
|
|
4129
|
+
...v(s)
|
|
4130
4130
|
});
|
|
4131
4131
|
var V = class extends b {
|
|
4132
4132
|
static {
|
|
@@ -4142,9 +4142,9 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4142
4142
|
}
|
|
4143
4143
|
};
|
|
4144
4144
|
c.ZodNever = V;
|
|
4145
|
-
V.create = (
|
|
4145
|
+
V.create = (s) => new V({
|
|
4146
4146
|
typeName: _.ZodNever,
|
|
4147
|
-
...v(
|
|
4147
|
+
...v(s)
|
|
4148
4148
|
});
|
|
4149
4149
|
var _e = class extends b {
|
|
4150
4150
|
static {
|
|
@@ -4152,27 +4152,27 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4152
4152
|
}
|
|
4153
4153
|
_parse(e) {
|
|
4154
4154
|
if (this._getType(e) !== f.ZodParsedType.undefined) {
|
|
4155
|
-
let
|
|
4156
|
-
return (0, u.addIssueToContext)(
|
|
4155
|
+
let r = this._getOrReturnCtx(e);
|
|
4156
|
+
return (0, u.addIssueToContext)(r, {
|
|
4157
4157
|
code: m.ZodIssueCode.invalid_type,
|
|
4158
4158
|
expected: f.ZodParsedType.void,
|
|
4159
|
-
received:
|
|
4159
|
+
received: r.parsedType
|
|
4160
4160
|
}), u.INVALID;
|
|
4161
4161
|
}
|
|
4162
4162
|
return (0, u.OK)(e.data);
|
|
4163
4163
|
}
|
|
4164
4164
|
};
|
|
4165
4165
|
c.ZodVoid = _e;
|
|
4166
|
-
_e.create = (
|
|
4166
|
+
_e.create = (s) => new _e({
|
|
4167
4167
|
typeName: _.ZodVoid,
|
|
4168
|
-
...v(
|
|
4168
|
+
...v(s)
|
|
4169
4169
|
});
|
|
4170
|
-
var F = class
|
|
4170
|
+
var F = class s extends b {
|
|
4171
4171
|
static {
|
|
4172
4172
|
d(this, "ZodArray");
|
|
4173
4173
|
}
|
|
4174
4174
|
_parse(e) {
|
|
4175
|
-
let { ctx: t, status:
|
|
4175
|
+
let { ctx: t, status: r } = this._processInputParams(e), i = this._def;
|
|
4176
4176
|
if (t.parsedType !== f.ZodParsedType.array)
|
|
4177
4177
|
return (0, u.addIssueToContext)(t, {
|
|
4178
4178
|
code: m.ZodIssueCode.invalid_type,
|
|
@@ -4189,7 +4189,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4189
4189
|
inclusive: !0,
|
|
4190
4190
|
exact: !0,
|
|
4191
4191
|
message: i.exactLength.message
|
|
4192
|
-
}),
|
|
4192
|
+
}), r.dirty());
|
|
4193
4193
|
}
|
|
4194
4194
|
if (i.minLength !== null && t.data.length < i.minLength.value && ((0, u.addIssueToContext)(t, {
|
|
4195
4195
|
code: m.ZodIssueCode.too_small,
|
|
@@ -4198,35 +4198,35 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4198
4198
|
inclusive: !0,
|
|
4199
4199
|
exact: !1,
|
|
4200
4200
|
message: i.minLength.message
|
|
4201
|
-
}),
|
|
4201
|
+
}), r.dirty()), i.maxLength !== null && t.data.length > i.maxLength.value && ((0, u.addIssueToContext)(t, {
|
|
4202
4202
|
code: m.ZodIssueCode.too_big,
|
|
4203
4203
|
maximum: i.maxLength.value,
|
|
4204
4204
|
type: "array",
|
|
4205
4205
|
inclusive: !0,
|
|
4206
4206
|
exact: !1,
|
|
4207
4207
|
message: i.maxLength.message
|
|
4208
|
-
}),
|
|
4209
|
-
return Promise.all([...t.data].map((o, a) => i.type._parseAsync(new P(t, o, t.path, a)))).then((o) => u.ParseStatus.mergeArray(
|
|
4208
|
+
}), r.dirty()), t.common.async)
|
|
4209
|
+
return Promise.all([...t.data].map((o, a) => i.type._parseAsync(new P(t, o, t.path, a)))).then((o) => u.ParseStatus.mergeArray(r, o));
|
|
4210
4210
|
let n = [...t.data].map((o, a) => i.type._parseSync(new P(t, o, t.path, a)));
|
|
4211
|
-
return u.ParseStatus.mergeArray(
|
|
4211
|
+
return u.ParseStatus.mergeArray(r, n);
|
|
4212
4212
|
}
|
|
4213
4213
|
get element() {
|
|
4214
4214
|
return this._def.type;
|
|
4215
4215
|
}
|
|
4216
4216
|
min(e, t) {
|
|
4217
|
-
return new
|
|
4217
|
+
return new s({
|
|
4218
4218
|
...this._def,
|
|
4219
4219
|
minLength: { value: e, message: g.errorUtil.toString(t) }
|
|
4220
4220
|
});
|
|
4221
4221
|
}
|
|
4222
4222
|
max(e, t) {
|
|
4223
|
-
return new
|
|
4223
|
+
return new s({
|
|
4224
4224
|
...this._def,
|
|
4225
4225
|
maxLength: { value: e, message: g.errorUtil.toString(t) }
|
|
4226
4226
|
});
|
|
4227
4227
|
}
|
|
4228
4228
|
length(e, t) {
|
|
4229
|
-
return new
|
|
4229
|
+
return new s({
|
|
4230
4230
|
...this._def,
|
|
4231
4231
|
exactLength: { value: e, message: g.errorUtil.toString(t) }
|
|
4232
4232
|
});
|
|
@@ -4236,33 +4236,33 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4236
4236
|
}
|
|
4237
4237
|
};
|
|
4238
4238
|
c.ZodArray = F;
|
|
4239
|
-
F.create = (
|
|
4240
|
-
type:
|
|
4239
|
+
F.create = (s, e) => new F({
|
|
4240
|
+
type: s,
|
|
4241
4241
|
minLength: null,
|
|
4242
4242
|
maxLength: null,
|
|
4243
4243
|
exactLength: null,
|
|
4244
4244
|
typeName: _.ZodArray,
|
|
4245
4245
|
...v(e)
|
|
4246
4246
|
});
|
|
4247
|
-
function ge(
|
|
4248
|
-
if (
|
|
4247
|
+
function ge(s) {
|
|
4248
|
+
if (s instanceof E) {
|
|
4249
4249
|
let e = {};
|
|
4250
|
-
for (let t in
|
|
4251
|
-
let
|
|
4252
|
-
e[t] = Z.create(ge(
|
|
4250
|
+
for (let t in s.shape) {
|
|
4251
|
+
let r = s.shape[t];
|
|
4252
|
+
e[t] = Z.create(ge(r));
|
|
4253
4253
|
}
|
|
4254
4254
|
return new E({
|
|
4255
|
-
...
|
|
4255
|
+
...s._def,
|
|
4256
4256
|
shape: /* @__PURE__ */ d(() => e, "shape")
|
|
4257
4257
|
});
|
|
4258
|
-
} else return
|
|
4259
|
-
...
|
|
4260
|
-
type: ge(
|
|
4261
|
-
}) :
|
|
4262
|
-
e))) :
|
|
4258
|
+
} else return s instanceof F ? new F({
|
|
4259
|
+
...s._def,
|
|
4260
|
+
type: ge(s.element)
|
|
4261
|
+
}) : s instanceof Z ? Z.create(ge(s.unwrap())) : s instanceof M ? M.create(ge(s.unwrap())) : s instanceof $ ? $.create(s.items.map((e) => ge(
|
|
4262
|
+
e))) : s;
|
|
4263
4263
|
}
|
|
4264
4264
|
d(ge, "deepPartialify");
|
|
4265
|
-
var E = class
|
|
4265
|
+
var E = class s extends b {
|
|
4266
4266
|
static {
|
|
4267
4267
|
d(this, "ZodObject");
|
|
4268
4268
|
}
|
|
@@ -4284,7 +4284,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4284
4284
|
received: p.parsedType
|
|
4285
4285
|
}), u.INVALID;
|
|
4286
4286
|
}
|
|
4287
|
-
let { status:
|
|
4287
|
+
let { status: r, ctx: i } = this._processInputParams(e), { shape: n, keys: o } = this._getCached(), a = [];
|
|
4288
4288
|
if (!(this._def.catchall instanceof V && this._def.unknownKeys === "strip"))
|
|
4289
4289
|
for (let p in i.data)
|
|
4290
4290
|
o.includes(p) || a.push(p);
|
|
@@ -4309,7 +4309,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4309
4309
|
a.length > 0 && ((0, u.addIssueToContext)(i, {
|
|
4310
4310
|
code: m.ZodIssueCode.unrecognized_keys,
|
|
4311
4311
|
keys: a
|
|
4312
|
-
}),
|
|
4312
|
+
}), r.dirty());
|
|
4313
4313
|
else if (p !== "strip")
|
|
4314
4314
|
throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
4315
4315
|
} else {
|
|
@@ -4337,20 +4337,20 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4337
4337
|
});
|
|
4338
4338
|
}
|
|
4339
4339
|
return p;
|
|
4340
|
-
}).then((p) => u.ParseStatus.mergeObjectSync(
|
|
4340
|
+
}).then((p) => u.ParseStatus.mergeObjectSync(r, p)) : u.ParseStatus.mergeObjectSync(r, l);
|
|
4341
4341
|
}
|
|
4342
4342
|
get shape() {
|
|
4343
4343
|
return this._def.shape();
|
|
4344
4344
|
}
|
|
4345
4345
|
strict(e) {
|
|
4346
|
-
return g.errorUtil.errToObj, new
|
|
4346
|
+
return g.errorUtil.errToObj, new s({
|
|
4347
4347
|
...this._def,
|
|
4348
4348
|
unknownKeys: "strict",
|
|
4349
4349
|
...e !== void 0 ? {
|
|
4350
|
-
errorMap: /* @__PURE__ */ d((t,
|
|
4350
|
+
errorMap: /* @__PURE__ */ d((t, r) => {
|
|
4351
4351
|
var i, n, o, a;
|
|
4352
|
-
let l = (o = (n = (i = this._def).errorMap) === null || n === void 0 ? void 0 : n.call(i, t,
|
|
4353
|
-
o :
|
|
4352
|
+
let l = (o = (n = (i = this._def).errorMap) === null || n === void 0 ? void 0 : n.call(i, t, r).message) !== null && o !== void 0 ?
|
|
4353
|
+
o : r.defaultError;
|
|
4354
4354
|
return t.code === "unrecognized_keys" ? {
|
|
4355
4355
|
message: (a = g.errorUtil.errToObj(e).message) !== null && a !== void 0 ? a : l
|
|
4356
4356
|
} : {
|
|
@@ -4361,13 +4361,13 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4361
4361
|
});
|
|
4362
4362
|
}
|
|
4363
4363
|
strip() {
|
|
4364
|
-
return new
|
|
4364
|
+
return new s({
|
|
4365
4365
|
...this._def,
|
|
4366
4366
|
unknownKeys: "strip"
|
|
4367
4367
|
});
|
|
4368
4368
|
}
|
|
4369
4369
|
passthrough() {
|
|
4370
|
-
return new
|
|
4370
|
+
return new s({
|
|
4371
4371
|
...this._def,
|
|
4372
4372
|
unknownKeys: "passthrough"
|
|
4373
4373
|
});
|
|
@@ -4390,7 +4390,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4390
4390
|
// }) as any;
|
|
4391
4391
|
// };
|
|
4392
4392
|
extend(e) {
|
|
4393
|
-
return new
|
|
4393
|
+
return new s({
|
|
4394
4394
|
...this._def,
|
|
4395
4395
|
shape: /* @__PURE__ */ d(() => ({
|
|
4396
4396
|
...this._def.shape(),
|
|
@@ -4404,7 +4404,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4404
4404
|
* upgrade if you are experiencing issues.
|
|
4405
4405
|
*/
|
|
4406
4406
|
merge(e) {
|
|
4407
|
-
return new
|
|
4407
|
+
return new s({
|
|
4408
4408
|
unknownKeys: e._def.unknownKeys,
|
|
4409
4409
|
catchall: e._def.catchall,
|
|
4410
4410
|
shape: /* @__PURE__ */ d(() => ({
|
|
@@ -4474,25 +4474,25 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4474
4474
|
// return merged;
|
|
4475
4475
|
// }
|
|
4476
4476
|
catchall(e) {
|
|
4477
|
-
return new
|
|
4477
|
+
return new s({
|
|
4478
4478
|
...this._def,
|
|
4479
4479
|
catchall: e
|
|
4480
4480
|
});
|
|
4481
4481
|
}
|
|
4482
4482
|
pick(e) {
|
|
4483
4483
|
let t = {};
|
|
4484
|
-
return f.util.objectKeys(e).forEach((
|
|
4485
|
-
e[
|
|
4486
|
-
}), new
|
|
4484
|
+
return f.util.objectKeys(e).forEach((r) => {
|
|
4485
|
+
e[r] && this.shape[r] && (t[r] = this.shape[r]);
|
|
4486
|
+
}), new s({
|
|
4487
4487
|
...this._def,
|
|
4488
4488
|
shape: /* @__PURE__ */ d(() => t, "shape")
|
|
4489
4489
|
});
|
|
4490
4490
|
}
|
|
4491
4491
|
omit(e) {
|
|
4492
4492
|
let t = {};
|
|
4493
|
-
return f.util.objectKeys(this.shape).forEach((
|
|
4494
|
-
e[
|
|
4495
|
-
}), new
|
|
4493
|
+
return f.util.objectKeys(this.shape).forEach((r) => {
|
|
4494
|
+
e[r] || (t[r] = this.shape[r]);
|
|
4495
|
+
}), new s({
|
|
4496
4496
|
...this._def,
|
|
4497
4497
|
shape: /* @__PURE__ */ d(() => t, "shape")
|
|
4498
4498
|
});
|
|
@@ -4505,51 +4505,51 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4505
4505
|
}
|
|
4506
4506
|
partial(e) {
|
|
4507
4507
|
let t = {};
|
|
4508
|
-
return f.util.objectKeys(this.shape).forEach((
|
|
4509
|
-
let i = this.shape[
|
|
4510
|
-
e && !e[
|
|
4511
|
-
}), new
|
|
4508
|
+
return f.util.objectKeys(this.shape).forEach((r) => {
|
|
4509
|
+
let i = this.shape[r];
|
|
4510
|
+
e && !e[r] ? t[r] = i : t[r] = i.optional();
|
|
4511
|
+
}), new s({
|
|
4512
4512
|
...this._def,
|
|
4513
4513
|
shape: /* @__PURE__ */ d(() => t, "shape")
|
|
4514
4514
|
});
|
|
4515
4515
|
}
|
|
4516
4516
|
required(e) {
|
|
4517
4517
|
let t = {};
|
|
4518
|
-
return f.util.objectKeys(this.shape).forEach((
|
|
4519
|
-
if (e && !e[
|
|
4520
|
-
t[
|
|
4518
|
+
return f.util.objectKeys(this.shape).forEach((r) => {
|
|
4519
|
+
if (e && !e[r])
|
|
4520
|
+
t[r] = this.shape[r];
|
|
4521
4521
|
else {
|
|
4522
|
-
let n = this.shape[
|
|
4522
|
+
let n = this.shape[r];
|
|
4523
4523
|
for (; n instanceof Z; )
|
|
4524
4524
|
n = n._def.innerType;
|
|
4525
|
-
t[
|
|
4525
|
+
t[r] = n;
|
|
4526
4526
|
}
|
|
4527
|
-
}), new
|
|
4527
|
+
}), new s({
|
|
4528
4528
|
...this._def,
|
|
4529
4529
|
shape: /* @__PURE__ */ d(() => t, "shape")
|
|
4530
4530
|
});
|
|
4531
4531
|
}
|
|
4532
4532
|
keyof() {
|
|
4533
|
-
return
|
|
4533
|
+
return _r(f.util.objectKeys(this.shape));
|
|
4534
4534
|
}
|
|
4535
4535
|
};
|
|
4536
4536
|
c.ZodObject = E;
|
|
4537
|
-
E.create = (
|
|
4538
|
-
shape: /* @__PURE__ */ d(() =>
|
|
4537
|
+
E.create = (s, e) => new E({
|
|
4538
|
+
shape: /* @__PURE__ */ d(() => s, "shape"),
|
|
4539
4539
|
unknownKeys: "strip",
|
|
4540
4540
|
catchall: V.create(),
|
|
4541
4541
|
typeName: _.ZodObject,
|
|
4542
4542
|
...v(e)
|
|
4543
4543
|
});
|
|
4544
|
-
E.strictCreate = (
|
|
4545
|
-
shape: /* @__PURE__ */ d(() =>
|
|
4544
|
+
E.strictCreate = (s, e) => new E({
|
|
4545
|
+
shape: /* @__PURE__ */ d(() => s, "shape"),
|
|
4546
4546
|
unknownKeys: "strict",
|
|
4547
4547
|
catchall: V.create(),
|
|
4548
4548
|
typeName: _.ZodObject,
|
|
4549
4549
|
...v(e)
|
|
4550
4550
|
});
|
|
4551
|
-
E.lazycreate = (
|
|
4552
|
-
shape:
|
|
4551
|
+
E.lazycreate = (s, e) => new E({
|
|
4552
|
+
shape: s,
|
|
4553
4553
|
unknownKeys: "strip",
|
|
4554
4554
|
catchall: V.create(),
|
|
4555
4555
|
typeName: _.ZodObject,
|
|
@@ -4560,7 +4560,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4560
4560
|
d(this, "ZodUnion");
|
|
4561
4561
|
}
|
|
4562
4562
|
_parse(e) {
|
|
4563
|
-
let { ctx: t } = this._processInputParams(e),
|
|
4563
|
+
let { ctx: t } = this._processInputParams(e), r = this._def.options;
|
|
4564
4564
|
function i(n) {
|
|
4565
4565
|
for (let a of n)
|
|
4566
4566
|
if (a.result.status === "valid")
|
|
@@ -4575,7 +4575,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4575
4575
|
}), u.INVALID;
|
|
4576
4576
|
}
|
|
4577
4577
|
if (d(i, "handleResults"), t.common.async)
|
|
4578
|
-
return Promise.all(
|
|
4578
|
+
return Promise.all(r.map(async (n) => {
|
|
4579
4579
|
let o = {
|
|
4580
4580
|
...t,
|
|
4581
4581
|
common: {
|
|
@@ -4595,7 +4595,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4595
4595
|
})).then(i);
|
|
4596
4596
|
{
|
|
4597
4597
|
let n, o = [];
|
|
4598
|
-
for (let l of
|
|
4598
|
+
for (let l of r) {
|
|
4599
4599
|
let p = {
|
|
4600
4600
|
...t,
|
|
4601
4601
|
common: {
|
|
@@ -4626,15 +4626,15 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4626
4626
|
}
|
|
4627
4627
|
};
|
|
4628
4628
|
c.ZodUnion = ne;
|
|
4629
|
-
ne.create = (
|
|
4630
|
-
options:
|
|
4629
|
+
ne.create = (s, e) => new ne({
|
|
4630
|
+
options: s,
|
|
4631
4631
|
typeName: _.ZodUnion,
|
|
4632
4632
|
...v(e)
|
|
4633
4633
|
});
|
|
4634
|
-
var U = /* @__PURE__ */ d((
|
|
4635
|
-
ce ?
|
|
4636
|
-
ie ? [null] :
|
|
4637
|
-
U(
|
|
4634
|
+
var U = /* @__PURE__ */ d((s) => s instanceof ae ? U(s.schema) : s instanceof S ? U(s.innerType()) : s instanceof de ? [s.value] : s instanceof
|
|
4635
|
+
ce ? s.options : s instanceof ue ? f.util.objectValues(s.enum) : s instanceof le ? U(s._def.innerType) : s instanceof se ? [void 0] : s instanceof
|
|
4636
|
+
ie ? [null] : s instanceof Z ? [void 0, ...U(s.unwrap())] : s instanceof M ? [null, ...U(s.unwrap())] : s instanceof Re || s instanceof he ?
|
|
4637
|
+
U(s.unwrap()) : s instanceof pe ? U(s._def.innerType) : [], "getDiscriminator"), He = class s extends b {
|
|
4638
4638
|
static {
|
|
4639
4639
|
d(this, "ZodDiscriminatedUnion");
|
|
4640
4640
|
}
|
|
@@ -4646,7 +4646,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4646
4646
|
expected: f.ZodParsedType.object,
|
|
4647
4647
|
received: t.parsedType
|
|
4648
4648
|
}), u.INVALID;
|
|
4649
|
-
let
|
|
4649
|
+
let r = this.discriminator, i = t.data[r], n = this.optionsMap.get(i);
|
|
4650
4650
|
return n ? t.common.async ? n._parseAsync({
|
|
4651
4651
|
data: t.data,
|
|
4652
4652
|
path: t.path,
|
|
@@ -4658,7 +4658,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4658
4658
|
}) : ((0, u.addIssueToContext)(t, {
|
|
4659
4659
|
code: m.ZodIssueCode.invalid_union_discriminator,
|
|
4660
4660
|
options: Array.from(this.optionsMap.keys()),
|
|
4661
|
-
path: [
|
|
4661
|
+
path: [r]
|
|
4662
4662
|
}), u.INVALID);
|
|
4663
4663
|
}
|
|
4664
4664
|
get discriminator() {
|
|
@@ -4678,7 +4678,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4678
4678
|
* @param types an array of object schemas
|
|
4679
4679
|
* @param params
|
|
4680
4680
|
*/
|
|
4681
|
-
static create(e, t,
|
|
4681
|
+
static create(e, t, r) {
|
|
4682
4682
|
let i = /* @__PURE__ */ new Map();
|
|
4683
4683
|
for (let n of t) {
|
|
4684
4684
|
let o = U(n.shape[e]);
|
|
@@ -4690,41 +4690,41 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4690
4690
|
i.set(a, n);
|
|
4691
4691
|
}
|
|
4692
4692
|
}
|
|
4693
|
-
return new
|
|
4693
|
+
return new s({
|
|
4694
4694
|
typeName: _.ZodDiscriminatedUnion,
|
|
4695
4695
|
discriminator: e,
|
|
4696
4696
|
options: t,
|
|
4697
4697
|
optionsMap: i,
|
|
4698
|
-
...v(
|
|
4698
|
+
...v(r)
|
|
4699
4699
|
});
|
|
4700
4700
|
}
|
|
4701
4701
|
};
|
|
4702
4702
|
c.ZodDiscriminatedUnion = He;
|
|
4703
|
-
function Tt(
|
|
4704
|
-
let t = (0, f.getParsedType)(
|
|
4705
|
-
if (
|
|
4706
|
-
return { valid: !0, data:
|
|
4707
|
-
if (t === f.ZodParsedType.object &&
|
|
4708
|
-
let i = f.util.objectKeys(e), n = f.util.objectKeys(
|
|
4703
|
+
function Tt(s, e) {
|
|
4704
|
+
let t = (0, f.getParsedType)(s), r = (0, f.getParsedType)(e);
|
|
4705
|
+
if (s === e)
|
|
4706
|
+
return { valid: !0, data: s };
|
|
4707
|
+
if (t === f.ZodParsedType.object && r === f.ZodParsedType.object) {
|
|
4708
|
+
let i = f.util.objectKeys(e), n = f.util.objectKeys(s).filter((a) => i.indexOf(a) !== -1), o = { ...s, ...e };
|
|
4709
4709
|
for (let a of n) {
|
|
4710
|
-
let l = Tt(
|
|
4710
|
+
let l = Tt(s[a], e[a]);
|
|
4711
4711
|
if (!l.valid)
|
|
4712
4712
|
return { valid: !1 };
|
|
4713
4713
|
o[a] = l.data;
|
|
4714
4714
|
}
|
|
4715
4715
|
return { valid: !0, data: o };
|
|
4716
|
-
} else if (t === f.ZodParsedType.array &&
|
|
4717
|
-
if (
|
|
4716
|
+
} else if (t === f.ZodParsedType.array && r === f.ZodParsedType.array) {
|
|
4717
|
+
if (s.length !== e.length)
|
|
4718
4718
|
return { valid: !1 };
|
|
4719
4719
|
let i = [];
|
|
4720
|
-
for (let n = 0; n <
|
|
4721
|
-
let o =
|
|
4720
|
+
for (let n = 0; n < s.length; n++) {
|
|
4721
|
+
let o = s[n], a = e[n], l = Tt(o, a);
|
|
4722
4722
|
if (!l.valid)
|
|
4723
4723
|
return { valid: !1 };
|
|
4724
4724
|
i.push(l.data);
|
|
4725
4725
|
}
|
|
4726
4726
|
return { valid: !0, data: i };
|
|
4727
|
-
} else return t === f.ZodParsedType.date &&
|
|
4727
|
+
} else return t === f.ZodParsedType.date && r === f.ZodParsedType.date && +s == +e ? { valid: !0, data: s } : { valid: !1 };
|
|
4728
4728
|
}
|
|
4729
4729
|
d(Tt, "mergeValues");
|
|
4730
4730
|
var oe = class extends b {
|
|
@@ -4732,99 +4732,99 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4732
4732
|
d(this, "ZodIntersection");
|
|
4733
4733
|
}
|
|
4734
4734
|
_parse(e) {
|
|
4735
|
-
let { status: t, ctx:
|
|
4735
|
+
let { status: t, ctx: r } = this._processInputParams(e), i = /* @__PURE__ */ d((n, o) => {
|
|
4736
4736
|
if ((0, u.isAborted)(n) || (0, u.isAborted)(o))
|
|
4737
4737
|
return u.INVALID;
|
|
4738
4738
|
let a = Tt(n.value, o.value);
|
|
4739
4739
|
return a.valid ? (((0, u.isDirty)(n) || (0, u.isDirty)(o)) && t.dirty(), { status: t.value, value: a.data }) : ((0, u.addIssueToContext)(
|
|
4740
|
-
|
|
4740
|
+
r, {
|
|
4741
4741
|
code: m.ZodIssueCode.invalid_intersection_types
|
|
4742
4742
|
}), u.INVALID);
|
|
4743
4743
|
}, "handleParsed");
|
|
4744
|
-
return
|
|
4744
|
+
return r.common.async ? Promise.all([
|
|
4745
4745
|
this._def.left._parseAsync({
|
|
4746
|
-
data:
|
|
4747
|
-
path:
|
|
4748
|
-
parent:
|
|
4746
|
+
data: r.data,
|
|
4747
|
+
path: r.path,
|
|
4748
|
+
parent: r
|
|
4749
4749
|
}),
|
|
4750
4750
|
this._def.right._parseAsync({
|
|
4751
|
-
data:
|
|
4752
|
-
path:
|
|
4753
|
-
parent:
|
|
4751
|
+
data: r.data,
|
|
4752
|
+
path: r.path,
|
|
4753
|
+
parent: r
|
|
4754
4754
|
})
|
|
4755
4755
|
]).then(([n, o]) => i(n, o)) : i(this._def.left._parseSync({
|
|
4756
|
-
data:
|
|
4757
|
-
path:
|
|
4758
|
-
parent:
|
|
4756
|
+
data: r.data,
|
|
4757
|
+
path: r.path,
|
|
4758
|
+
parent: r
|
|
4759
4759
|
}), this._def.right._parseSync({
|
|
4760
|
-
data:
|
|
4761
|
-
path:
|
|
4762
|
-
parent:
|
|
4760
|
+
data: r.data,
|
|
4761
|
+
path: r.path,
|
|
4762
|
+
parent: r
|
|
4763
4763
|
}));
|
|
4764
4764
|
}
|
|
4765
4765
|
};
|
|
4766
4766
|
c.ZodIntersection = oe;
|
|
4767
|
-
oe.create = (
|
|
4768
|
-
left:
|
|
4767
|
+
oe.create = (s, e, t) => new oe({
|
|
4768
|
+
left: s,
|
|
4769
4769
|
right: e,
|
|
4770
4770
|
typeName: _.ZodIntersection,
|
|
4771
4771
|
...v(t)
|
|
4772
4772
|
});
|
|
4773
|
-
var $ = class
|
|
4773
|
+
var $ = class s extends b {
|
|
4774
4774
|
static {
|
|
4775
4775
|
d(this, "ZodTuple");
|
|
4776
4776
|
}
|
|
4777
4777
|
_parse(e) {
|
|
4778
|
-
let { status: t, ctx:
|
|
4779
|
-
if (
|
|
4780
|
-
return (0, u.addIssueToContext)(
|
|
4778
|
+
let { status: t, ctx: r } = this._processInputParams(e);
|
|
4779
|
+
if (r.parsedType !== f.ZodParsedType.array)
|
|
4780
|
+
return (0, u.addIssueToContext)(r, {
|
|
4781
4781
|
code: m.ZodIssueCode.invalid_type,
|
|
4782
4782
|
expected: f.ZodParsedType.array,
|
|
4783
|
-
received:
|
|
4783
|
+
received: r.parsedType
|
|
4784
4784
|
}), u.INVALID;
|
|
4785
|
-
if (
|
|
4786
|
-
return (0, u.addIssueToContext)(
|
|
4785
|
+
if (r.data.length < this._def.items.length)
|
|
4786
|
+
return (0, u.addIssueToContext)(r, {
|
|
4787
4787
|
code: m.ZodIssueCode.too_small,
|
|
4788
4788
|
minimum: this._def.items.length,
|
|
4789
4789
|
inclusive: !0,
|
|
4790
4790
|
exact: !1,
|
|
4791
4791
|
type: "array"
|
|
4792
4792
|
}), u.INVALID;
|
|
4793
|
-
!this._def.rest &&
|
|
4793
|
+
!this._def.rest && r.data.length > this._def.items.length && ((0, u.addIssueToContext)(r, {
|
|
4794
4794
|
code: m.ZodIssueCode.too_big,
|
|
4795
4795
|
maximum: this._def.items.length,
|
|
4796
4796
|
inclusive: !0,
|
|
4797
4797
|
exact: !1,
|
|
4798
4798
|
type: "array"
|
|
4799
4799
|
}), t.dirty());
|
|
4800
|
-
let n = [...
|
|
4800
|
+
let n = [...r.data].map((o, a) => {
|
|
4801
4801
|
let l = this._def.items[a] || this._def.rest;
|
|
4802
|
-
return l ? l._parse(new P(
|
|
4802
|
+
return l ? l._parse(new P(r, o, r.path, a)) : null;
|
|
4803
4803
|
}).filter((o) => !!o);
|
|
4804
|
-
return
|
|
4804
|
+
return r.common.async ? Promise.all(n).then((o) => u.ParseStatus.mergeArray(t, o)) : u.ParseStatus.mergeArray(t, n);
|
|
4805
4805
|
}
|
|
4806
4806
|
get items() {
|
|
4807
4807
|
return this._def.items;
|
|
4808
4808
|
}
|
|
4809
4809
|
rest(e) {
|
|
4810
|
-
return new
|
|
4810
|
+
return new s({
|
|
4811
4811
|
...this._def,
|
|
4812
4812
|
rest: e
|
|
4813
4813
|
});
|
|
4814
4814
|
}
|
|
4815
4815
|
};
|
|
4816
4816
|
c.ZodTuple = $;
|
|
4817
|
-
$.create = (
|
|
4818
|
-
if (!Array.isArray(
|
|
4817
|
+
$.create = (s, e) => {
|
|
4818
|
+
if (!Array.isArray(s))
|
|
4819
4819
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
4820
4820
|
return new $({
|
|
4821
|
-
items:
|
|
4821
|
+
items: s,
|
|
4822
4822
|
typeName: _.ZodTuple,
|
|
4823
4823
|
rest: null,
|
|
4824
4824
|
...v(e)
|
|
4825
4825
|
});
|
|
4826
4826
|
};
|
|
4827
|
-
var Ke = class
|
|
4827
|
+
var Ke = class s extends b {
|
|
4828
4828
|
static {
|
|
4829
4829
|
d(this, "ZodRecord");
|
|
4830
4830
|
}
|
|
@@ -4835,32 +4835,32 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4835
4835
|
return this._def.valueType;
|
|
4836
4836
|
}
|
|
4837
4837
|
_parse(e) {
|
|
4838
|
-
let { status: t, ctx:
|
|
4839
|
-
if (
|
|
4840
|
-
return (0, u.addIssueToContext)(
|
|
4838
|
+
let { status: t, ctx: r } = this._processInputParams(e);
|
|
4839
|
+
if (r.parsedType !== f.ZodParsedType.object)
|
|
4840
|
+
return (0, u.addIssueToContext)(r, {
|
|
4841
4841
|
code: m.ZodIssueCode.invalid_type,
|
|
4842
4842
|
expected: f.ZodParsedType.object,
|
|
4843
|
-
received:
|
|
4843
|
+
received: r.parsedType
|
|
4844
4844
|
}), u.INVALID;
|
|
4845
4845
|
let i = [], n = this._def.keyType, o = this._def.valueType;
|
|
4846
|
-
for (let a in
|
|
4846
|
+
for (let a in r.data)
|
|
4847
4847
|
i.push({
|
|
4848
|
-
key: n._parse(new P(
|
|
4849
|
-
value: o._parse(new P(
|
|
4850
|
-
alwaysSet: a in
|
|
4848
|
+
key: n._parse(new P(r, a, r.path, a)),
|
|
4849
|
+
value: o._parse(new P(r, r.data[a], r.path, a)),
|
|
4850
|
+
alwaysSet: a in r.data
|
|
4851
4851
|
});
|
|
4852
|
-
return
|
|
4852
|
+
return r.common.async ? u.ParseStatus.mergeObjectAsync(t, i) : u.ParseStatus.mergeObjectSync(t, i);
|
|
4853
4853
|
}
|
|
4854
4854
|
get element() {
|
|
4855
4855
|
return this._def.valueType;
|
|
4856
4856
|
}
|
|
4857
|
-
static create(e, t,
|
|
4858
|
-
return t instanceof b ? new
|
|
4857
|
+
static create(e, t, r) {
|
|
4858
|
+
return t instanceof b ? new s({
|
|
4859
4859
|
keyType: e,
|
|
4860
4860
|
valueType: t,
|
|
4861
4861
|
typeName: _.ZodRecord,
|
|
4862
|
-
...v(
|
|
4863
|
-
}) : new
|
|
4862
|
+
...v(r)
|
|
4863
|
+
}) : new s({
|
|
4864
4864
|
keyType: z.create(),
|
|
4865
4865
|
valueType: e,
|
|
4866
4866
|
typeName: _.ZodRecord,
|
|
@@ -4880,18 +4880,18 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4880
4880
|
return this._def.valueType;
|
|
4881
4881
|
}
|
|
4882
4882
|
_parse(e) {
|
|
4883
|
-
let { status: t, ctx:
|
|
4884
|
-
if (
|
|
4885
|
-
return (0, u.addIssueToContext)(
|
|
4883
|
+
let { status: t, ctx: r } = this._processInputParams(e);
|
|
4884
|
+
if (r.parsedType !== f.ZodParsedType.map)
|
|
4885
|
+
return (0, u.addIssueToContext)(r, {
|
|
4886
4886
|
code: m.ZodIssueCode.invalid_type,
|
|
4887
4887
|
expected: f.ZodParsedType.map,
|
|
4888
|
-
received:
|
|
4888
|
+
received: r.parsedType
|
|
4889
4889
|
}), u.INVALID;
|
|
4890
|
-
let i = this._def.keyType, n = this._def.valueType, o = [...
|
|
4891
|
-
key: i._parse(new P(
|
|
4892
|
-
value: n._parse(new P(
|
|
4890
|
+
let i = this._def.keyType, n = this._def.valueType, o = [...r.data.entries()].map(([a, l], p) => ({
|
|
4891
|
+
key: i._parse(new P(r, a, r.path, [p, "key"])),
|
|
4892
|
+
value: n._parse(new P(r, l, r.path, [p, "value"]))
|
|
4893
4893
|
}));
|
|
4894
|
-
if (
|
|
4894
|
+
if (r.common.async) {
|
|
4895
4895
|
let a = /* @__PURE__ */ new Map();
|
|
4896
4896
|
return Promise.resolve().then(async () => {
|
|
4897
4897
|
for (let l of o) {
|
|
@@ -4915,33 +4915,33 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4915
4915
|
}
|
|
4916
4916
|
};
|
|
4917
4917
|
c.ZodMap = ve;
|
|
4918
|
-
ve.create = (
|
|
4918
|
+
ve.create = (s, e, t) => new ve({
|
|
4919
4919
|
valueType: e,
|
|
4920
|
-
keyType:
|
|
4920
|
+
keyType: s,
|
|
4921
4921
|
typeName: _.ZodMap,
|
|
4922
4922
|
...v(t)
|
|
4923
4923
|
});
|
|
4924
|
-
var be = class
|
|
4924
|
+
var be = class s extends b {
|
|
4925
4925
|
static {
|
|
4926
4926
|
d(this, "ZodSet");
|
|
4927
4927
|
}
|
|
4928
4928
|
_parse(e) {
|
|
4929
|
-
let { status: t, ctx:
|
|
4930
|
-
if (
|
|
4931
|
-
return (0, u.addIssueToContext)(
|
|
4929
|
+
let { status: t, ctx: r } = this._processInputParams(e);
|
|
4930
|
+
if (r.parsedType !== f.ZodParsedType.set)
|
|
4931
|
+
return (0, u.addIssueToContext)(r, {
|
|
4932
4932
|
code: m.ZodIssueCode.invalid_type,
|
|
4933
4933
|
expected: f.ZodParsedType.set,
|
|
4934
|
-
received:
|
|
4934
|
+
received: r.parsedType
|
|
4935
4935
|
}), u.INVALID;
|
|
4936
4936
|
let i = this._def;
|
|
4937
|
-
i.minSize !== null &&
|
|
4937
|
+
i.minSize !== null && r.data.size < i.minSize.value && ((0, u.addIssueToContext)(r, {
|
|
4938
4938
|
code: m.ZodIssueCode.too_small,
|
|
4939
4939
|
minimum: i.minSize.value,
|
|
4940
4940
|
type: "set",
|
|
4941
4941
|
inclusive: !0,
|
|
4942
4942
|
exact: !1,
|
|
4943
4943
|
message: i.minSize.message
|
|
4944
|
-
}), t.dirty()), i.maxSize !== null &&
|
|
4944
|
+
}), t.dirty()), i.maxSize !== null && r.data.size > i.maxSize.value && ((0, u.addIssueToContext)(r, {
|
|
4945
4945
|
code: m.ZodIssueCode.too_big,
|
|
4946
4946
|
maximum: i.maxSize.value,
|
|
4947
4947
|
type: "set",
|
|
@@ -4960,17 +4960,17 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4960
4960
|
return { status: t.value, value: p };
|
|
4961
4961
|
}
|
|
4962
4962
|
d(o, "finalizeSet");
|
|
4963
|
-
let a = [...
|
|
4964
|
-
return
|
|
4963
|
+
let a = [...r.data.values()].map((l, p) => n._parse(new P(r, l, r.path, p)));
|
|
4964
|
+
return r.common.async ? Promise.all(a).then((l) => o(l)) : o(a);
|
|
4965
4965
|
}
|
|
4966
4966
|
min(e, t) {
|
|
4967
|
-
return new
|
|
4967
|
+
return new s({
|
|
4968
4968
|
...this._def,
|
|
4969
4969
|
minSize: { value: e, message: g.errorUtil.toString(t) }
|
|
4970
4970
|
});
|
|
4971
4971
|
}
|
|
4972
4972
|
max(e, t) {
|
|
4973
|
-
return new
|
|
4973
|
+
return new s({
|
|
4974
4974
|
...this._def,
|
|
4975
4975
|
maxSize: { value: e, message: g.errorUtil.toString(t) }
|
|
4976
4976
|
});
|
|
@@ -4983,14 +4983,14 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4983
4983
|
}
|
|
4984
4984
|
};
|
|
4985
4985
|
c.ZodSet = be;
|
|
4986
|
-
be.create = (
|
|
4987
|
-
valueType:
|
|
4986
|
+
be.create = (s, e) => new be({
|
|
4987
|
+
valueType: s,
|
|
4988
4988
|
minSize: null,
|
|
4989
4989
|
maxSize: null,
|
|
4990
4990
|
typeName: _.ZodSet,
|
|
4991
4991
|
...v(e)
|
|
4992
4992
|
});
|
|
4993
|
-
var ze = class
|
|
4993
|
+
var ze = class s extends b {
|
|
4994
4994
|
static {
|
|
4995
4995
|
d(this, "ZodFunction");
|
|
4996
4996
|
}
|
|
@@ -5005,7 +5005,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5005
5005
|
expected: f.ZodParsedType.function,
|
|
5006
5006
|
received: t.parsedType
|
|
5007
5007
|
}), u.INVALID;
|
|
5008
|
-
function
|
|
5008
|
+
function r(a, l) {
|
|
5009
5009
|
return (0, u.makeIssue)({
|
|
5010
5010
|
data: a,
|
|
5011
5011
|
path: t.path,
|
|
@@ -5021,7 +5021,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5021
5021
|
}
|
|
5022
5022
|
});
|
|
5023
5023
|
}
|
|
5024
|
-
d(
|
|
5024
|
+
d(r, "makeArgsIssue");
|
|
5025
5025
|
function i(a, l) {
|
|
5026
5026
|
return (0, u.makeIssue)({
|
|
5027
5027
|
data: a,
|
|
@@ -5044,7 +5044,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5044
5044
|
let a = this;
|
|
5045
5045
|
return (0, u.OK)(async function(...l) {
|
|
5046
5046
|
let p = new m.ZodError([]), h = await a._def.args.parseAsync(l, n).catch((j) => {
|
|
5047
|
-
throw p.addIssue(
|
|
5047
|
+
throw p.addIssue(r(l, j)), p;
|
|
5048
5048
|
}), y = await Reflect.apply(o, this, h);
|
|
5049
5049
|
return await a._def.returns._def.type.parseAsync(y, n).catch((j) => {
|
|
5050
5050
|
throw p.addIssue(i(y, j)), p;
|
|
@@ -5055,7 +5055,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5055
5055
|
return (0, u.OK)(function(...l) {
|
|
5056
5056
|
let p = a._def.args.safeParse(l, n);
|
|
5057
5057
|
if (!p.success)
|
|
5058
|
-
throw new m.ZodError([
|
|
5058
|
+
throw new m.ZodError([r(l, p.error)]);
|
|
5059
5059
|
let h = Reflect.apply(o, this, p.data), y = a._def.returns.safeParse(h, n);
|
|
5060
5060
|
if (!y.success)
|
|
5061
5061
|
throw new m.ZodError([i(h, y.error)]);
|
|
@@ -5070,13 +5070,13 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5070
5070
|
return this._def.returns;
|
|
5071
5071
|
}
|
|
5072
5072
|
args(...e) {
|
|
5073
|
-
return new
|
|
5073
|
+
return new s({
|
|
5074
5074
|
...this._def,
|
|
5075
5075
|
args: $.create(e).rest(q.create())
|
|
5076
5076
|
});
|
|
5077
5077
|
}
|
|
5078
5078
|
returns(e) {
|
|
5079
|
-
return new
|
|
5079
|
+
return new s({
|
|
5080
5080
|
...this._def,
|
|
5081
5081
|
returns: e
|
|
5082
5082
|
});
|
|
@@ -5087,12 +5087,12 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5087
5087
|
strictImplement(e) {
|
|
5088
5088
|
return this.parse(e);
|
|
5089
5089
|
}
|
|
5090
|
-
static create(e, t,
|
|
5091
|
-
return new
|
|
5090
|
+
static create(e, t, r) {
|
|
5091
|
+
return new s({
|
|
5092
5092
|
args: e || $.create([]).rest(q.create()),
|
|
5093
5093
|
returns: t || q.create(),
|
|
5094
5094
|
typeName: _.ZodFunction,
|
|
5095
|
-
...v(
|
|
5095
|
+
...v(r)
|
|
5096
5096
|
});
|
|
5097
5097
|
}
|
|
5098
5098
|
};
|
|
@@ -5110,8 +5110,8 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5110
5110
|
}
|
|
5111
5111
|
};
|
|
5112
5112
|
c.ZodLazy = ae;
|
|
5113
|
-
ae.create = (
|
|
5114
|
-
getter:
|
|
5113
|
+
ae.create = (s, e) => new ae({
|
|
5114
|
+
getter: s,
|
|
5115
5115
|
typeName: _.ZodLazy,
|
|
5116
5116
|
...v(e)
|
|
5117
5117
|
});
|
|
@@ -5135,20 +5135,20 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5135
5135
|
}
|
|
5136
5136
|
};
|
|
5137
5137
|
c.ZodLiteral = de;
|
|
5138
|
-
de.create = (
|
|
5139
|
-
value:
|
|
5138
|
+
de.create = (s, e) => new de({
|
|
5139
|
+
value: s,
|
|
5140
5140
|
typeName: _.ZodLiteral,
|
|
5141
5141
|
...v(e)
|
|
5142
5142
|
});
|
|
5143
|
-
function
|
|
5143
|
+
function _r(s, e) {
|
|
5144
5144
|
return new ce({
|
|
5145
|
-
values:
|
|
5145
|
+
values: s,
|
|
5146
5146
|
typeName: _.ZodEnum,
|
|
5147
5147
|
...v(e)
|
|
5148
5148
|
});
|
|
5149
5149
|
}
|
|
5150
|
-
d(
|
|
5151
|
-
var ce = class
|
|
5150
|
+
d(_r, "createZodEnum");
|
|
5151
|
+
var ce = class s extends b {
|
|
5152
5152
|
static {
|
|
5153
5153
|
d(this, "ZodEnum");
|
|
5154
5154
|
}
|
|
@@ -5157,19 +5157,19 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5157
5157
|
}
|
|
5158
5158
|
_parse(e) {
|
|
5159
5159
|
if (typeof e.data != "string") {
|
|
5160
|
-
let t = this._getOrReturnCtx(e),
|
|
5160
|
+
let t = this._getOrReturnCtx(e), r = this._def.values;
|
|
5161
5161
|
return (0, u.addIssueToContext)(t, {
|
|
5162
|
-
expected: f.util.joinValues(
|
|
5162
|
+
expected: f.util.joinValues(r),
|
|
5163
5163
|
received: t.parsedType,
|
|
5164
5164
|
code: m.ZodIssueCode.invalid_type
|
|
5165
5165
|
}), u.INVALID;
|
|
5166
5166
|
}
|
|
5167
|
-
if (We(this, je, "f") ||
|
|
5168
|
-
let t = this._getOrReturnCtx(e),
|
|
5167
|
+
if (We(this, je, "f") || mr(this, je, new Set(this._def.values), "f"), !We(this, je, "f").has(e.data)) {
|
|
5168
|
+
let t = this._getOrReturnCtx(e), r = this._def.values;
|
|
5169
5169
|
return (0, u.addIssueToContext)(t, {
|
|
5170
5170
|
received: t.data,
|
|
5171
5171
|
code: m.ZodIssueCode.invalid_enum_value,
|
|
5172
|
-
options:
|
|
5172
|
+
options: r
|
|
5173
5173
|
}), u.INVALID;
|
|
5174
5174
|
}
|
|
5175
5175
|
return (0, u.OK)(e.data);
|
|
@@ -5196,13 +5196,13 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5196
5196
|
return e;
|
|
5197
5197
|
}
|
|
5198
5198
|
extract(e, t = this._def) {
|
|
5199
|
-
return
|
|
5199
|
+
return s.create(e, {
|
|
5200
5200
|
...this._def,
|
|
5201
5201
|
...t
|
|
5202
5202
|
});
|
|
5203
5203
|
}
|
|
5204
5204
|
exclude(e, t = this._def) {
|
|
5205
|
-
return
|
|
5205
|
+
return s.create(this.options.filter((r) => !e.includes(r)), {
|
|
5206
5206
|
...this._def,
|
|
5207
5207
|
...t
|
|
5208
5208
|
});
|
|
@@ -5210,7 +5210,7 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5210
5210
|
};
|
|
5211
5211
|
c.ZodEnum = ce;
|
|
5212
5212
|
je = /* @__PURE__ */ new WeakMap();
|
|
5213
|
-
ce.create =
|
|
5213
|
+
ce.create = _r;
|
|
5214
5214
|
var ue = class extends b {
|
|
5215
5215
|
static {
|
|
5216
5216
|
d(this, "ZodNativeEnum");
|
|
@@ -5219,19 +5219,19 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5219
5219
|
super(...arguments), Se.set(this, void 0);
|
|
5220
5220
|
}
|
|
5221
5221
|
_parse(e) {
|
|
5222
|
-
let t = f.util.getValidEnumValues(this._def.values),
|
|
5223
|
-
if (
|
|
5222
|
+
let t = f.util.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(e);
|
|
5223
|
+
if (r.parsedType !== f.ZodParsedType.string && r.parsedType !== f.ZodParsedType.number) {
|
|
5224
5224
|
let i = f.util.objectValues(t);
|
|
5225
|
-
return (0, u.addIssueToContext)(
|
|
5225
|
+
return (0, u.addIssueToContext)(r, {
|
|
5226
5226
|
expected: f.util.joinValues(i),
|
|
5227
|
-
received:
|
|
5227
|
+
received: r.parsedType,
|
|
5228
5228
|
code: m.ZodIssueCode.invalid_type
|
|
5229
5229
|
}), u.INVALID;
|
|
5230
5230
|
}
|
|
5231
|
-
if (We(this, Se, "f") ||
|
|
5231
|
+
if (We(this, Se, "f") || mr(this, Se, new Set(f.util.getValidEnumValues(this._def.values)), "f"), !We(this, Se, "f").has(e.data)) {
|
|
5232
5232
|
let i = f.util.objectValues(t);
|
|
5233
|
-
return (0, u.addIssueToContext)(
|
|
5234
|
-
received:
|
|
5233
|
+
return (0, u.addIssueToContext)(r, {
|
|
5234
|
+
received: r.data,
|
|
5235
5235
|
code: m.ZodIssueCode.invalid_enum_value,
|
|
5236
5236
|
options: i
|
|
5237
5237
|
}), u.INVALID;
|
|
@@ -5244,8 +5244,8 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5244
5244
|
};
|
|
5245
5245
|
c.ZodNativeEnum = ue;
|
|
5246
5246
|
Se = /* @__PURE__ */ new WeakMap();
|
|
5247
|
-
ue.create = (
|
|
5248
|
-
values:
|
|
5247
|
+
ue.create = (s, e) => new ue({
|
|
5248
|
+
values: s,
|
|
5249
5249
|
typeName: _.ZodNativeEnum,
|
|
5250
5250
|
...v(e)
|
|
5251
5251
|
});
|
|
@@ -5264,16 +5264,16 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5264
5264
|
expected: f.ZodParsedType.promise,
|
|
5265
5265
|
received: t.parsedType
|
|
5266
5266
|
}), u.INVALID;
|
|
5267
|
-
let
|
|
5268
|
-
return (0, u.OK)(
|
|
5267
|
+
let r = t.parsedType === f.ZodParsedType.promise ? t.data : Promise.resolve(t.data);
|
|
5268
|
+
return (0, u.OK)(r.then((i) => this._def.type.parseAsync(i, {
|
|
5269
5269
|
path: t.path,
|
|
5270
5270
|
errorMap: t.common.contextualErrorMap
|
|
5271
5271
|
})));
|
|
5272
5272
|
}
|
|
5273
5273
|
};
|
|
5274
5274
|
c.ZodPromise = J;
|
|
5275
|
-
J.create = (
|
|
5276
|
-
type:
|
|
5275
|
+
J.create = (s, e) => new J({
|
|
5276
|
+
type: s,
|
|
5277
5277
|
typeName: _.ZodPromise,
|
|
5278
5278
|
...v(e)
|
|
5279
5279
|
});
|
|
@@ -5288,24 +5288,24 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5288
5288
|
return this._def.schema._def.typeName === _.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
5289
5289
|
}
|
|
5290
5290
|
_parse(e) {
|
|
5291
|
-
let { status: t, ctx:
|
|
5291
|
+
let { status: t, ctx: r } = this._processInputParams(e), i = this._def.effect || null, n = {
|
|
5292
5292
|
addIssue: /* @__PURE__ */ d((o) => {
|
|
5293
|
-
(0, u.addIssueToContext)(
|
|
5293
|
+
(0, u.addIssueToContext)(r, o), o.fatal ? t.abort() : t.dirty();
|
|
5294
5294
|
}, "addIssue"),
|
|
5295
5295
|
get path() {
|
|
5296
|
-
return
|
|
5296
|
+
return r.path;
|
|
5297
5297
|
}
|
|
5298
5298
|
};
|
|
5299
5299
|
if (n.addIssue = n.addIssue.bind(n), i.type === "preprocess") {
|
|
5300
|
-
let o = i.transform(
|
|
5301
|
-
if (
|
|
5300
|
+
let o = i.transform(r.data, n);
|
|
5301
|
+
if (r.common.async)
|
|
5302
5302
|
return Promise.resolve(o).then(async (a) => {
|
|
5303
5303
|
if (t.value === "aborted")
|
|
5304
5304
|
return u.INVALID;
|
|
5305
5305
|
let l = await this._def.schema._parseAsync({
|
|
5306
5306
|
data: a,
|
|
5307
|
-
path:
|
|
5308
|
-
parent:
|
|
5307
|
+
path: r.path,
|
|
5308
|
+
parent: r
|
|
5309
5309
|
});
|
|
5310
5310
|
return l.status === "aborted" ? u.INVALID : l.status === "dirty" || t.value === "dirty" ? (0, u.DIRTY)(l.value) : l;
|
|
5311
5311
|
});
|
|
@@ -5314,8 +5314,8 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5314
5314
|
return u.INVALID;
|
|
5315
5315
|
let a = this._def.schema._parseSync({
|
|
5316
5316
|
data: o,
|
|
5317
|
-
path:
|
|
5318
|
-
parent:
|
|
5317
|
+
path: r.path,
|
|
5318
|
+
parent: r
|
|
5319
5319
|
});
|
|
5320
5320
|
return a.status === "aborted" ? u.INVALID : a.status === "dirty" || t.value === "dirty" ? (0, u.DIRTY)(a.value) : a;
|
|
5321
5321
|
}
|
|
@@ -5323,29 +5323,29 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5323
5323
|
if (i.type === "refinement") {
|
|
5324
5324
|
let o = /* @__PURE__ */ d((a) => {
|
|
5325
5325
|
let l = i.refinement(a, n);
|
|
5326
|
-
if (
|
|
5326
|
+
if (r.common.async)
|
|
5327
5327
|
return Promise.resolve(l);
|
|
5328
5328
|
if (l instanceof Promise)
|
|
5329
5329
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
5330
5330
|
return a;
|
|
5331
5331
|
}, "executeRefinement");
|
|
5332
|
-
if (
|
|
5332
|
+
if (r.common.async === !1) {
|
|
5333
5333
|
let a = this._def.schema._parseSync({
|
|
5334
|
-
data:
|
|
5335
|
-
path:
|
|
5336
|
-
parent:
|
|
5334
|
+
data: r.data,
|
|
5335
|
+
path: r.path,
|
|
5336
|
+
parent: r
|
|
5337
5337
|
});
|
|
5338
5338
|
return a.status === "aborted" ? u.INVALID : (a.status === "dirty" && t.dirty(), o(a.value), { status: t.value, value: a.value });
|
|
5339
5339
|
} else
|
|
5340
|
-
return this._def.schema._parseAsync({ data:
|
|
5340
|
+
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((a) => a.status === "aborted" ? u.INVALID : (a.
|
|
5341
5341
|
status === "dirty" && t.dirty(), o(a.value).then(() => ({ status: t.value, value: a.value }))));
|
|
5342
5342
|
}
|
|
5343
5343
|
if (i.type === "transform")
|
|
5344
|
-
if (
|
|
5344
|
+
if (r.common.async === !1) {
|
|
5345
5345
|
let o = this._def.schema._parseSync({
|
|
5346
|
-
data:
|
|
5347
|
-
path:
|
|
5348
|
-
parent:
|
|
5346
|
+
data: r.data,
|
|
5347
|
+
path: r.path,
|
|
5348
|
+
parent: r
|
|
5349
5349
|
});
|
|
5350
5350
|
if (!(0, u.isValid)(o))
|
|
5351
5351
|
return o;
|
|
@@ -5354,22 +5354,22 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5354
5354
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
5355
5355
|
return { status: t.value, value: a };
|
|
5356
5356
|
} else
|
|
5357
|
-
return this._def.schema._parseAsync({ data:
|
|
5357
|
+
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((o) => (0, u.isValid)(o) ? Promise.resolve(i.transform(
|
|
5358
5358
|
o.value, n)).then((a) => ({ status: t.value, value: a })) : o);
|
|
5359
5359
|
f.util.assertNever(i);
|
|
5360
5360
|
}
|
|
5361
5361
|
};
|
|
5362
5362
|
c.ZodEffects = S;
|
|
5363
5363
|
c.ZodTransformer = S;
|
|
5364
|
-
S.create = (
|
|
5365
|
-
schema:
|
|
5364
|
+
S.create = (s, e, t) => new S({
|
|
5365
|
+
schema: s,
|
|
5366
5366
|
typeName: _.ZodEffects,
|
|
5367
5367
|
effect: e,
|
|
5368
5368
|
...v(t)
|
|
5369
5369
|
});
|
|
5370
|
-
S.createWithPreprocess = (
|
|
5370
|
+
S.createWithPreprocess = (s, e, t) => new S({
|
|
5371
5371
|
schema: e,
|
|
5372
|
-
effect: { type: "preprocess", transform:
|
|
5372
|
+
effect: { type: "preprocess", transform: s },
|
|
5373
5373
|
typeName: _.ZodEffects,
|
|
5374
5374
|
...v(t)
|
|
5375
5375
|
});
|
|
@@ -5385,8 +5385,8 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5385
5385
|
}
|
|
5386
5386
|
};
|
|
5387
5387
|
c.ZodOptional = Z;
|
|
5388
|
-
Z.create = (
|
|
5389
|
-
innerType:
|
|
5388
|
+
Z.create = (s, e) => new Z({
|
|
5389
|
+
innerType: s,
|
|
5390
5390
|
typeName: _.ZodOptional,
|
|
5391
5391
|
...v(e)
|
|
5392
5392
|
});
|
|
@@ -5402,8 +5402,8 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5402
5402
|
}
|
|
5403
5403
|
};
|
|
5404
5404
|
c.ZodNullable = M;
|
|
5405
|
-
M.create = (
|
|
5406
|
-
innerType:
|
|
5405
|
+
M.create = (s, e) => new M({
|
|
5406
|
+
innerType: s,
|
|
5407
5407
|
typeName: _.ZodNullable,
|
|
5408
5408
|
...v(e)
|
|
5409
5409
|
});
|
|
@@ -5412,9 +5412,9 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5412
5412
|
d(this, "ZodDefault");
|
|
5413
5413
|
}
|
|
5414
5414
|
_parse(e) {
|
|
5415
|
-
let { ctx: t } = this._processInputParams(e),
|
|
5416
|
-
return t.parsedType === f.ZodParsedType.undefined && (
|
|
5417
|
-
data:
|
|
5415
|
+
let { ctx: t } = this._processInputParams(e), r = t.data;
|
|
5416
|
+
return t.parsedType === f.ZodParsedType.undefined && (r = this._def.defaultValue()), this._def.innerType._parse({
|
|
5417
|
+
data: r,
|
|
5418
5418
|
path: t.path,
|
|
5419
5419
|
parent: t
|
|
5420
5420
|
});
|
|
@@ -5424,8 +5424,8 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5424
5424
|
}
|
|
5425
5425
|
};
|
|
5426
5426
|
c.ZodDefault = le;
|
|
5427
|
-
le.create = (
|
|
5428
|
-
innerType:
|
|
5427
|
+
le.create = (s, e) => new le({
|
|
5428
|
+
innerType: s,
|
|
5429
5429
|
typeName: _.ZodDefault,
|
|
5430
5430
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
5431
5431
|
...v(e)
|
|
@@ -5435,34 +5435,34 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5435
5435
|
d(this, "ZodCatch");
|
|
5436
5436
|
}
|
|
5437
5437
|
_parse(e) {
|
|
5438
|
-
let { ctx: t } = this._processInputParams(e),
|
|
5438
|
+
let { ctx: t } = this._processInputParams(e), r = {
|
|
5439
5439
|
...t,
|
|
5440
5440
|
common: {
|
|
5441
5441
|
...t.common,
|
|
5442
5442
|
issues: []
|
|
5443
5443
|
}
|
|
5444
5444
|
}, i = this._def.innerType._parse({
|
|
5445
|
-
data:
|
|
5446
|
-
path:
|
|
5445
|
+
data: r.data,
|
|
5446
|
+
path: r.path,
|
|
5447
5447
|
parent: {
|
|
5448
|
-
...
|
|
5448
|
+
...r
|
|
5449
5449
|
}
|
|
5450
5450
|
});
|
|
5451
5451
|
return (0, u.isAsync)(i) ? i.then((n) => ({
|
|
5452
5452
|
status: "valid",
|
|
5453
5453
|
value: n.status === "valid" ? n.value : this._def.catchValue({
|
|
5454
5454
|
get error() {
|
|
5455
|
-
return new m.ZodError(
|
|
5455
|
+
return new m.ZodError(r.common.issues);
|
|
5456
5456
|
},
|
|
5457
|
-
input:
|
|
5457
|
+
input: r.data
|
|
5458
5458
|
})
|
|
5459
5459
|
})) : {
|
|
5460
5460
|
status: "valid",
|
|
5461
5461
|
value: i.status === "valid" ? i.value : this._def.catchValue({
|
|
5462
5462
|
get error() {
|
|
5463
|
-
return new m.ZodError(
|
|
5463
|
+
return new m.ZodError(r.common.issues);
|
|
5464
5464
|
},
|
|
5465
|
-
input:
|
|
5465
|
+
input: r.data
|
|
5466
5466
|
})
|
|
5467
5467
|
};
|
|
5468
5468
|
}
|
|
@@ -5471,8 +5471,8 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5471
5471
|
}
|
|
5472
5472
|
};
|
|
5473
5473
|
c.ZodCatch = pe;
|
|
5474
|
-
pe.create = (
|
|
5475
|
-
innerType:
|
|
5474
|
+
pe.create = (s, e) => new pe({
|
|
5475
|
+
innerType: s,
|
|
5476
5476
|
typeName: _.ZodCatch,
|
|
5477
5477
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
5478
5478
|
...v(e)
|
|
@@ -5483,20 +5483,20 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5483
5483
|
}
|
|
5484
5484
|
_parse(e) {
|
|
5485
5485
|
if (this._getType(e) !== f.ZodParsedType.nan) {
|
|
5486
|
-
let
|
|
5487
|
-
return (0, u.addIssueToContext)(
|
|
5486
|
+
let r = this._getOrReturnCtx(e);
|
|
5487
|
+
return (0, u.addIssueToContext)(r, {
|
|
5488
5488
|
code: m.ZodIssueCode.invalid_type,
|
|
5489
5489
|
expected: f.ZodParsedType.nan,
|
|
5490
|
-
received:
|
|
5490
|
+
received: r.parsedType
|
|
5491
5491
|
}), u.INVALID;
|
|
5492
5492
|
}
|
|
5493
5493
|
return { status: "valid", value: e.data };
|
|
5494
5494
|
}
|
|
5495
5495
|
};
|
|
5496
5496
|
c.ZodNaN = xe;
|
|
5497
|
-
xe.create = (
|
|
5497
|
+
xe.create = (s) => new xe({
|
|
5498
5498
|
typeName: _.ZodNaN,
|
|
5499
|
-
...v(
|
|
5499
|
+
...v(s)
|
|
5500
5500
|
});
|
|
5501
5501
|
c.BRAND = Symbol("zod_brand");
|
|
5502
5502
|
var Re = class extends b {
|
|
@@ -5504,9 +5504,9 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5504
5504
|
d(this, "ZodBranded");
|
|
5505
5505
|
}
|
|
5506
5506
|
_parse(e) {
|
|
5507
|
-
let { ctx: t } = this._processInputParams(e),
|
|
5507
|
+
let { ctx: t } = this._processInputParams(e), r = t.data;
|
|
5508
5508
|
return this._def.type._parse({
|
|
5509
|
-
data:
|
|
5509
|
+
data: r,
|
|
5510
5510
|
path: t.path,
|
|
5511
5511
|
parent: t
|
|
5512
5512
|
});
|
|
@@ -5516,44 +5516,44 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5516
5516
|
}
|
|
5517
5517
|
};
|
|
5518
5518
|
c.ZodBranded = Re;
|
|
5519
|
-
var Ze = class
|
|
5519
|
+
var Ze = class s extends b {
|
|
5520
5520
|
static {
|
|
5521
5521
|
d(this, "ZodPipeline");
|
|
5522
5522
|
}
|
|
5523
5523
|
_parse(e) {
|
|
5524
|
-
let { status: t, ctx:
|
|
5525
|
-
if (
|
|
5524
|
+
let { status: t, ctx: r } = this._processInputParams(e);
|
|
5525
|
+
if (r.common.async)
|
|
5526
5526
|
return (/* @__PURE__ */ d(async () => {
|
|
5527
5527
|
let n = await this._def.in._parseAsync({
|
|
5528
|
-
data:
|
|
5529
|
-
path:
|
|
5530
|
-
parent:
|
|
5528
|
+
data: r.data,
|
|
5529
|
+
path: r.path,
|
|
5530
|
+
parent: r
|
|
5531
5531
|
});
|
|
5532
5532
|
return n.status === "aborted" ? u.INVALID : n.status === "dirty" ? (t.dirty(), (0, u.DIRTY)(n.value)) : this._def.out._parseAsync(
|
|
5533
5533
|
{
|
|
5534
5534
|
data: n.value,
|
|
5535
|
-
path:
|
|
5536
|
-
parent:
|
|
5535
|
+
path: r.path,
|
|
5536
|
+
parent: r
|
|
5537
5537
|
});
|
|
5538
5538
|
}, "handleAsync"))();
|
|
5539
5539
|
{
|
|
5540
5540
|
let i = this._def.in._parseSync({
|
|
5541
|
-
data:
|
|
5542
|
-
path:
|
|
5543
|
-
parent:
|
|
5541
|
+
data: r.data,
|
|
5542
|
+
path: r.path,
|
|
5543
|
+
parent: r
|
|
5544
5544
|
});
|
|
5545
5545
|
return i.status === "aborted" ? u.INVALID : i.status === "dirty" ? (t.dirty(), {
|
|
5546
5546
|
status: "dirty",
|
|
5547
5547
|
value: i.value
|
|
5548
5548
|
}) : this._def.out._parseSync({
|
|
5549
5549
|
data: i.value,
|
|
5550
|
-
path:
|
|
5551
|
-
parent:
|
|
5550
|
+
path: r.path,
|
|
5551
|
+
parent: r
|
|
5552
5552
|
});
|
|
5553
5553
|
}
|
|
5554
5554
|
}
|
|
5555
5555
|
static create(e, t) {
|
|
5556
|
-
return new
|
|
5556
|
+
return new s({
|
|
5557
5557
|
in: e,
|
|
5558
5558
|
out: t,
|
|
5559
5559
|
typeName: _.ZodPipeline
|
|
@@ -5566,78 +5566,78 @@ onent})+$", Ot, Wr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5566
5566
|
d(this, "ZodReadonly");
|
|
5567
5567
|
}
|
|
5568
5568
|
_parse(e) {
|
|
5569
|
-
let t = this._def.innerType._parse(e),
|
|
5569
|
+
let t = this._def.innerType._parse(e), r = /* @__PURE__ */ d((i) => ((0, u.isValid)(i) && (i.value = Object.freeze(i.value)), i), "fre\
|
|
5570
5570
|
eze");
|
|
5571
|
-
return (0, u.isAsync)(t) ? t.then((i) =>
|
|
5571
|
+
return (0, u.isAsync)(t) ? t.then((i) => r(i)) : r(t);
|
|
5572
5572
|
}
|
|
5573
5573
|
unwrap() {
|
|
5574
5574
|
return this._def.innerType;
|
|
5575
5575
|
}
|
|
5576
5576
|
};
|
|
5577
5577
|
c.ZodReadonly = he;
|
|
5578
|
-
he.create = (
|
|
5579
|
-
innerType:
|
|
5578
|
+
he.create = (s, e) => new he({
|
|
5579
|
+
innerType: s,
|
|
5580
5580
|
typeName: _.ZodReadonly,
|
|
5581
5581
|
...v(e)
|
|
5582
5582
|
});
|
|
5583
|
-
function
|
|
5584
|
-
let t = typeof
|
|
5583
|
+
function hr(s, e) {
|
|
5584
|
+
let t = typeof s == "function" ? s(e) : typeof s == "string" ? { message: s } : s;
|
|
5585
5585
|
return typeof t == "string" ? { message: t } : t;
|
|
5586
5586
|
}
|
|
5587
|
-
d(
|
|
5588
|
-
function
|
|
5589
|
-
return
|
|
5587
|
+
d(hr, "cleanParams");
|
|
5588
|
+
function vr(s, e = {}, t) {
|
|
5589
|
+
return s ? G.create().superRefine((r, i) => {
|
|
5590
5590
|
var n, o;
|
|
5591
|
-
let a = r
|
|
5591
|
+
let a = s(r);
|
|
5592
5592
|
if (a instanceof Promise)
|
|
5593
5593
|
return a.then((l) => {
|
|
5594
5594
|
var p, h;
|
|
5595
5595
|
if (!l) {
|
|
5596
|
-
let y =
|
|
5596
|
+
let y = hr(e, r), k = (h = (p = y.fatal) !== null && p !== void 0 ? p : t) !== null && h !== void 0 ? h : !0;
|
|
5597
5597
|
i.addIssue({ code: "custom", ...y, fatal: k });
|
|
5598
5598
|
}
|
|
5599
5599
|
});
|
|
5600
5600
|
if (!a) {
|
|
5601
|
-
let l =
|
|
5601
|
+
let l = hr(e, r), p = (o = (n = l.fatal) !== null && n !== void 0 ? n : t) !== null && o !== void 0 ? o : !0;
|
|
5602
5602
|
i.addIssue({ code: "custom", ...l, fatal: p });
|
|
5603
5603
|
}
|
|
5604
5604
|
}) : G.create();
|
|
5605
5605
|
}
|
|
5606
|
-
d(
|
|
5607
|
-
c.custom =
|
|
5606
|
+
d(vr, "custom");
|
|
5607
|
+
c.custom = vr;
|
|
5608
5608
|
c.late = {
|
|
5609
5609
|
object: E.lazycreate
|
|
5610
5610
|
};
|
|
5611
5611
|
var _;
|
|
5612
|
-
(function(
|
|
5613
|
-
|
|
5614
|
-
"ZodDate",
|
|
5615
|
-
known",
|
|
5616
|
-
"ZodDiscriminatedUnion",
|
|
5617
|
-
|
|
5618
|
-
"ZodEffects",
|
|
5619
|
-
t",
|
|
5612
|
+
(function(s) {
|
|
5613
|
+
s.ZodString = "ZodString", s.ZodNumber = "ZodNumber", s.ZodNaN = "ZodNaN", s.ZodBigInt = "ZodBigInt", s.ZodBoolean = "ZodBoolean", s.ZodDate =
|
|
5614
|
+
"ZodDate", s.ZodSymbol = "ZodSymbol", s.ZodUndefined = "ZodUndefined", s.ZodNull = "ZodNull", s.ZodAny = "ZodAny", s.ZodUnknown = "ZodUn\
|
|
5615
|
+
known", s.ZodNever = "ZodNever", s.ZodVoid = "ZodVoid", s.ZodArray = "ZodArray", s.ZodObject = "ZodObject", s.ZodUnion = "ZodUnion", s.ZodDiscriminatedUnion =
|
|
5616
|
+
"ZodDiscriminatedUnion", s.ZodIntersection = "ZodIntersection", s.ZodTuple = "ZodTuple", s.ZodRecord = "ZodRecord", s.ZodMap = "ZodMap",
|
|
5617
|
+
s.ZodSet = "ZodSet", s.ZodFunction = "ZodFunction", s.ZodLazy = "ZodLazy", s.ZodLiteral = "ZodLiteral", s.ZodEnum = "ZodEnum", s.ZodEffects =
|
|
5618
|
+
"ZodEffects", s.ZodNativeEnum = "ZodNativeEnum", s.ZodOptional = "ZodOptional", s.ZodNullable = "ZodNullable", s.ZodDefault = "ZodDefaul\
|
|
5619
|
+
t", s.ZodCatch = "ZodCatch", s.ZodPromise = "ZodPromise", s.ZodBranded = "ZodBranded", s.ZodPipeline = "ZodPipeline", s.ZodReadonly = "ZodRe\
|
|
5620
5620
|
adonly";
|
|
5621
5621
|
})(_ || (c.ZodFirstPartyTypeKind = _ = {}));
|
|
5622
|
-
var
|
|
5623
|
-
message: `Input not instance of ${
|
|
5624
|
-
}) =>
|
|
5625
|
-
c.instanceof =
|
|
5626
|
-
var
|
|
5627
|
-
c.string =
|
|
5628
|
-
var
|
|
5629
|
-
c.number =
|
|
5622
|
+
var si = /* @__PURE__ */ d((s, e = {
|
|
5623
|
+
message: `Input not instance of ${s.name}`
|
|
5624
|
+
}) => vr((t) => t instanceof s, e), "instanceOfType");
|
|
5625
|
+
c.instanceof = si;
|
|
5626
|
+
var br = z.create;
|
|
5627
|
+
c.string = br;
|
|
5628
|
+
var xr = Q.create;
|
|
5629
|
+
c.number = xr;
|
|
5630
5630
|
var ii = xe.create;
|
|
5631
5631
|
c.nan = ii;
|
|
5632
5632
|
var ni = ee.create;
|
|
5633
5633
|
c.bigint = ni;
|
|
5634
|
-
var
|
|
5635
|
-
c.boolean =
|
|
5636
|
-
var oi =
|
|
5634
|
+
var wr = te.create;
|
|
5635
|
+
c.boolean = wr;
|
|
5636
|
+
var oi = re.create;
|
|
5637
5637
|
c.date = oi;
|
|
5638
5638
|
var ai = ye.create;
|
|
5639
5639
|
c.symbol = ai;
|
|
5640
|
-
var di =
|
|
5640
|
+
var di = se.create;
|
|
5641
5641
|
c.undefined = di;
|
|
5642
5642
|
var ci = ie.create;
|
|
5643
5643
|
c.null = ci;
|
|
@@ -5681,9 +5681,9 @@ adonly";
|
|
|
5681
5681
|
c.nativeEnum = Ei;
|
|
5682
5682
|
var Ai = J.create;
|
|
5683
5683
|
c.promise = Ai;
|
|
5684
|
-
var
|
|
5685
|
-
c.effect =
|
|
5686
|
-
c.transformer =
|
|
5684
|
+
var kr = S.create;
|
|
5685
|
+
c.effect = kr;
|
|
5686
|
+
c.transformer = kr;
|
|
5687
5687
|
var ji = Z.create;
|
|
5688
5688
|
c.optional = ji;
|
|
5689
5689
|
var Si = M.create;
|
|
@@ -5692,21 +5692,21 @@ adonly";
|
|
|
5692
5692
|
c.preprocess = Ri;
|
|
5693
5693
|
var Zi = Ze.create;
|
|
5694
5694
|
c.pipeline = Zi;
|
|
5695
|
-
var Pi = /* @__PURE__ */ d(() =>
|
|
5695
|
+
var Pi = /* @__PURE__ */ d(() => br().optional(), "ostring");
|
|
5696
5696
|
c.ostring = Pi;
|
|
5697
|
-
var Ni = /* @__PURE__ */ d(() =>
|
|
5697
|
+
var Ni = /* @__PURE__ */ d(() => xr().optional(), "onumber");
|
|
5698
5698
|
c.onumber = Ni;
|
|
5699
|
-
var Vi = /* @__PURE__ */ d(() =>
|
|
5699
|
+
var Vi = /* @__PURE__ */ d(() => wr().optional(), "oboolean");
|
|
5700
5700
|
c.oboolean = Vi;
|
|
5701
5701
|
c.coerce = {
|
|
5702
|
-
string: /* @__PURE__ */ d((
|
|
5703
|
-
number: /* @__PURE__ */ d((
|
|
5704
|
-
boolean: /* @__PURE__ */ d((
|
|
5705
|
-
...
|
|
5702
|
+
string: /* @__PURE__ */ d((s) => z.create({ ...s, coerce: !0 }), "string"),
|
|
5703
|
+
number: /* @__PURE__ */ d((s) => Q.create({ ...s, coerce: !0 }), "number"),
|
|
5704
|
+
boolean: /* @__PURE__ */ d((s) => te.create({
|
|
5705
|
+
...s,
|
|
5706
5706
|
coerce: !0
|
|
5707
5707
|
}), "boolean"),
|
|
5708
|
-
bigint: /* @__PURE__ */ d((
|
|
5709
|
-
date: /* @__PURE__ */ d((
|
|
5708
|
+
bigint: /* @__PURE__ */ d((s) => ee.create({ ...s, coerce: !0 }), "bigint"),
|
|
5709
|
+
date: /* @__PURE__ */ d((s) => re.create({ ...s, coerce: !0 }), "date")
|
|
5710
5710
|
};
|
|
5711
5711
|
c.NEVER = u.INVALID;
|
|
5712
5712
|
});
|
|
@@ -5714,55 +5714,55 @@ adonly";
|
|
|
5714
5714
|
// ../node_modules/zod/lib/external.js
|
|
5715
5715
|
var Et = O((N) => {
|
|
5716
5716
|
"use strict";
|
|
5717
|
-
var Di = N && N.__createBinding || (Object.create ? function(
|
|
5718
|
-
|
|
5717
|
+
var Di = N && N.__createBinding || (Object.create ? function(s, e, t, r) {
|
|
5718
|
+
r === void 0 && (r = t);
|
|
5719
5719
|
var i = Object.getOwnPropertyDescriptor(e, t);
|
|
5720
5720
|
(!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) && (i = { enumerable: !0, get: /* @__PURE__ */ d(function() {
|
|
5721
5721
|
return e[t];
|
|
5722
|
-
}, "get") }), Object.defineProperty(
|
|
5723
|
-
} : function(
|
|
5724
|
-
|
|
5725
|
-
}), we = N && N.__exportStar || function(
|
|
5726
|
-
for (var t in
|
|
5722
|
+
}, "get") }), Object.defineProperty(s, r, i);
|
|
5723
|
+
} : function(s, e, t, r) {
|
|
5724
|
+
r === void 0 && (r = t), s[r] = e[t];
|
|
5725
|
+
}), we = N && N.__exportStar || function(s, e) {
|
|
5726
|
+
for (var t in s) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) && Di(e, s, t);
|
|
5727
5727
|
};
|
|
5728
5728
|
Object.defineProperty(N, "__esModule", { value: !0 });
|
|
5729
5729
|
we(qe(), N);
|
|
5730
5730
|
we(It(), N);
|
|
5731
|
-
we(
|
|
5731
|
+
we(cr(), N);
|
|
5732
5732
|
we(Ee(), N);
|
|
5733
|
-
we(
|
|
5733
|
+
we(Cr(), N);
|
|
5734
5734
|
we(Ue(), N);
|
|
5735
5735
|
});
|
|
5736
5736
|
|
|
5737
5737
|
// ../node_modules/zod/lib/index.js
|
|
5738
|
-
var
|
|
5738
|
+
var Tr = O((A) => {
|
|
5739
5739
|
"use strict";
|
|
5740
|
-
var
|
|
5741
|
-
|
|
5740
|
+
var Ir = A && A.__createBinding || (Object.create ? function(s, e, t, r) {
|
|
5741
|
+
r === void 0 && (r = t);
|
|
5742
5742
|
var i = Object.getOwnPropertyDescriptor(e, t);
|
|
5743
5743
|
(!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) && (i = { enumerable: !0, get: /* @__PURE__ */ d(function() {
|
|
5744
5744
|
return e[t];
|
|
5745
|
-
}, "get") }), Object.defineProperty(
|
|
5746
|
-
} : function(
|
|
5747
|
-
|
|
5748
|
-
}), $i = A && A.__setModuleDefault || (Object.create ? function(
|
|
5749
|
-
Object.defineProperty(
|
|
5750
|
-
} : function(
|
|
5751
|
-
|
|
5752
|
-
}), Mi = A && A.__importStar || function(
|
|
5753
|
-
if (
|
|
5745
|
+
}, "get") }), Object.defineProperty(s, r, i);
|
|
5746
|
+
} : function(s, e, t, r) {
|
|
5747
|
+
r === void 0 && (r = t), s[r] = e[t];
|
|
5748
|
+
}), $i = A && A.__setModuleDefault || (Object.create ? function(s, e) {
|
|
5749
|
+
Object.defineProperty(s, "default", { enumerable: !0, value: e });
|
|
5750
|
+
} : function(s, e) {
|
|
5751
|
+
s.default = e;
|
|
5752
|
+
}), Mi = A && A.__importStar || function(s) {
|
|
5753
|
+
if (s && s.__esModule) return s;
|
|
5754
5754
|
var e = {};
|
|
5755
|
-
if (
|
|
5756
|
-
return $i(e,
|
|
5757
|
-
}, Li = A && A.__exportStar || function(
|
|
5758
|
-
for (var t in
|
|
5755
|
+
if (s != null) for (var t in s) t !== "default" && Object.prototype.hasOwnProperty.call(s, t) && Ir(e, s, t);
|
|
5756
|
+
return $i(e, s), e;
|
|
5757
|
+
}, Li = A && A.__exportStar || function(s, e) {
|
|
5758
|
+
for (var t in s) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) && Ir(e, s, t);
|
|
5759
5759
|
};
|
|
5760
5760
|
Object.defineProperty(A, "__esModule", { value: !0 });
|
|
5761
5761
|
A.z = void 0;
|
|
5762
|
-
var
|
|
5763
|
-
A.z =
|
|
5762
|
+
var Or = Mi(Et());
|
|
5763
|
+
A.z = Or;
|
|
5764
5764
|
Li(Et(), A);
|
|
5765
|
-
A.default =
|
|
5765
|
+
A.default = Or;
|
|
5766
5766
|
});
|
|
5767
5767
|
|
|
5768
5768
|
// src/cli/bin/index.ts
|
|
@@ -5773,32 +5773,32 @@ import { addToGlobalContext as Gi } from "storybook/internal/telemetry";
|
|
|
5773
5773
|
|
|
5774
5774
|
// ../node_modules/fd-package-json/dist/esm/main.js
|
|
5775
5775
|
var Kt = fe(Ht(), 1);
|
|
5776
|
-
import { resolve as
|
|
5777
|
-
import { stat as
|
|
5776
|
+
import { resolve as Qr } from "node:path";
|
|
5777
|
+
import { stat as es, readFile as ts } from "node:fs/promises";
|
|
5778
5778
|
import { statSync as gn, readFileSync as yn } from "node:fs";
|
|
5779
|
-
async function
|
|
5779
|
+
async function rs(s) {
|
|
5780
5780
|
try {
|
|
5781
|
-
return (await
|
|
5781
|
+
return (await es(s)).isFile();
|
|
5782
5782
|
} catch {
|
|
5783
5783
|
return !1;
|
|
5784
5784
|
}
|
|
5785
5785
|
}
|
|
5786
|
-
d(
|
|
5787
|
-
async function
|
|
5788
|
-
for (let e of (0, Kt.walkUp)(
|
|
5789
|
-
let t =
|
|
5790
|
-
if (await
|
|
5786
|
+
d(rs, "fileExists");
|
|
5787
|
+
async function ss(s) {
|
|
5788
|
+
for (let e of (0, Kt.walkUp)(s)) {
|
|
5789
|
+
let t = Qr(e, "package.json");
|
|
5790
|
+
if (await rs(t))
|
|
5791
5791
|
return t;
|
|
5792
5792
|
}
|
|
5793
5793
|
return null;
|
|
5794
5794
|
}
|
|
5795
|
-
d(
|
|
5796
|
-
async function W(
|
|
5797
|
-
let e = await
|
|
5795
|
+
d(ss, "findPackagePath");
|
|
5796
|
+
async function W(s) {
|
|
5797
|
+
let e = await ss(s);
|
|
5798
5798
|
if (!e)
|
|
5799
5799
|
return null;
|
|
5800
5800
|
try {
|
|
5801
|
-
let t = await
|
|
5801
|
+
let t = await ts(e, { encoding: "utf8" });
|
|
5802
5802
|
return JSON.parse(t);
|
|
5803
5803
|
} catch {
|
|
5804
5804
|
return null;
|
|
@@ -5808,24 +5808,24 @@ d(W, "findPackage");
|
|
|
5808
5808
|
|
|
5809
5809
|
// node_modules/leven/index.js
|
|
5810
5810
|
var ft = [], zt = [];
|
|
5811
|
-
function gt(
|
|
5812
|
-
if (
|
|
5811
|
+
function gt(s, e) {
|
|
5812
|
+
if (s === e)
|
|
5813
5813
|
return 0;
|
|
5814
|
-
let t =
|
|
5815
|
-
|
|
5816
|
-
let
|
|
5817
|
-
for (;
|
|
5818
|
-
|
|
5814
|
+
let t = s;
|
|
5815
|
+
s.length > e.length && (s = e, e = t);
|
|
5816
|
+
let r = s.length, i = e.length;
|
|
5817
|
+
for (; r > 0 && s.charCodeAt(~-r) === e.charCodeAt(~-i); )
|
|
5818
|
+
r--, i--;
|
|
5819
5819
|
let n = 0;
|
|
5820
|
-
for (; n <
|
|
5820
|
+
for (; n < r && s.charCodeAt(n) === e.charCodeAt(n); )
|
|
5821
5821
|
n++;
|
|
5822
|
-
if (
|
|
5822
|
+
if (r -= n, i -= n, r === 0)
|
|
5823
5823
|
return i;
|
|
5824
5824
|
let o, a, l, p, h = 0, y = 0;
|
|
5825
|
-
for (; h <
|
|
5826
|
-
zt[h] =
|
|
5825
|
+
for (; h < r; )
|
|
5826
|
+
zt[h] = s.charCodeAt(n + h), ft[h] = ++h;
|
|
5827
5827
|
for (; y < i; )
|
|
5828
|
-
for (o = e.charCodeAt(n + y), l = y++, a = y, h = 0; h <
|
|
5828
|
+
for (o = e.charCodeAt(n + y), l = y++, a = y, h = 0; h < r; h++)
|
|
5829
5829
|
p = o === zt[h] ? l : l + 1, l = ft[h], a = ft[h] = l > a ? p > a ? a + 1 : p : p > l ? l + 1 : p;
|
|
5830
5830
|
return a;
|
|
5831
5831
|
}
|
|
@@ -5835,71 +5835,71 @@ d(gt, "leven");
|
|
|
5835
5835
|
var Ne = fe(Yt(), 1);
|
|
5836
5836
|
|
|
5837
5837
|
// ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
|
|
5838
|
-
var
|
|
5839
|
-
function H(
|
|
5840
|
-
if (!
|
|
5841
|
-
if (
|
|
5838
|
+
var as = process.env.NODE_ENV === "production", _t = "Invariant failed";
|
|
5839
|
+
function H(s, e) {
|
|
5840
|
+
if (!s) {
|
|
5841
|
+
if (as)
|
|
5842
5842
|
throw new Error(_t);
|
|
5843
|
-
var t = typeof e == "function" ? e() : e,
|
|
5844
|
-
throw new Error(
|
|
5843
|
+
var t = typeof e == "function" ? e() : e, r = t ? "".concat(_t, ": ").concat(t) : _t;
|
|
5844
|
+
throw new Error(r);
|
|
5845
5845
|
}
|
|
5846
5846
|
}
|
|
5847
5847
|
d(H, "invariant");
|
|
5848
5848
|
|
|
5849
5849
|
// package.json
|
|
5850
|
-
var Xt = "9.0.0-
|
|
5850
|
+
var Xt = "9.0.0-rc.0";
|
|
5851
5851
|
|
|
5852
5852
|
// src/cli/build.ts
|
|
5853
|
-
import { cache as
|
|
5854
|
-
import { buildStaticStandalone as
|
|
5855
|
-
var Qt = /* @__PURE__ */ d(async (
|
|
5853
|
+
import { cache as cs } from "storybook/internal/common";
|
|
5854
|
+
import { buildStaticStandalone as us, withTelemetry as ls } from "storybook/internal/core-server";
|
|
5855
|
+
var Qt = /* @__PURE__ */ d(async (s) => {
|
|
5856
5856
|
let e = await W(__dirname);
|
|
5857
5857
|
H(e, "Failed to find the closest package.json file.");
|
|
5858
5858
|
let t = {
|
|
5859
|
-
...
|
|
5860
|
-
configDir:
|
|
5861
|
-
outputDir:
|
|
5862
|
-
ignorePreview: !!
|
|
5859
|
+
...s,
|
|
5860
|
+
configDir: s.configDir || "./.storybook",
|
|
5861
|
+
outputDir: s.outputDir || "./storybook-static",
|
|
5862
|
+
ignorePreview: !!s.previewUrl && !s.forceBuildPreview,
|
|
5863
5863
|
configType: "PRODUCTION",
|
|
5864
|
-
cache:
|
|
5864
|
+
cache: cs,
|
|
5865
5865
|
packageJson: e
|
|
5866
5866
|
};
|
|
5867
|
-
await
|
|
5867
|
+
await ls(
|
|
5868
5868
|
"build",
|
|
5869
|
-
{ cliOptions:
|
|
5870
|
-
() =>
|
|
5869
|
+
{ cliOptions: s, presetOptions: t },
|
|
5870
|
+
() => us(t)
|
|
5871
5871
|
);
|
|
5872
5872
|
}, "build");
|
|
5873
5873
|
|
|
5874
5874
|
// src/cli/buildIndex.ts
|
|
5875
|
-
import { cache as
|
|
5876
|
-
import { buildIndexStandalone as
|
|
5877
|
-
var
|
|
5875
|
+
import { cache as ps } from "storybook/internal/common";
|
|
5876
|
+
import { buildIndexStandalone as hs, withTelemetry as ms } from "storybook/internal/core-server";
|
|
5877
|
+
var er = /* @__PURE__ */ d(async (s) => {
|
|
5878
5878
|
let e = {
|
|
5879
|
-
...
|
|
5880
|
-
configDir:
|
|
5881
|
-
outputFile:
|
|
5879
|
+
...s,
|
|
5880
|
+
configDir: s.configDir || ".storybook",
|
|
5881
|
+
outputFile: s.outputFile || "index.json",
|
|
5882
5882
|
ignorePreview: !0,
|
|
5883
5883
|
configType: "PRODUCTION",
|
|
5884
|
-
cache:
|
|
5885
|
-
packageJson:
|
|
5884
|
+
cache: ps,
|
|
5885
|
+
packageJson: s.packageJson
|
|
5886
5886
|
}, t = {
|
|
5887
5887
|
...e,
|
|
5888
5888
|
corePresets: [],
|
|
5889
5889
|
overridePresets: []
|
|
5890
5890
|
};
|
|
5891
|
-
await
|
|
5891
|
+
await ms("index", { cliOptions: s, presetOptions: t }, () => hs(e));
|
|
5892
5892
|
}, "buildIndex");
|
|
5893
5893
|
|
|
5894
5894
|
// src/cli/dev.ts
|
|
5895
|
-
import { cache as
|
|
5896
|
-
import { buildDevStandalone as
|
|
5897
|
-
import { logger as Y, instance as
|
|
5895
|
+
import { cache as fs } from "storybook/internal/common";
|
|
5896
|
+
import { buildDevStandalone as gs, withTelemetry as ys } from "storybook/internal/core-server";
|
|
5897
|
+
import { logger as Y, instance as _s } from "storybook/internal/node-logger";
|
|
5898
5898
|
var bt = fe(vt(), 1);
|
|
5899
|
-
function
|
|
5900
|
-
|
|
5901
|
-
(e) => Y.plain(e)) : Y.error(
|
|
5902
|
-
|
|
5899
|
+
function vs(s) {
|
|
5900
|
+
_s.heading = "", s instanceof Error ? s.error ? Y.error(s.error) : s.stats && s.stats.compilation.errors ? s.stats.compilation.errors.forEach(
|
|
5901
|
+
(e) => Y.plain(e)) : Y.error(s) : s.compilation?.errors && s.compilation.errors.forEach((e) => Y.plain(e)), Y.line(), Y.warn(
|
|
5902
|
+
s.close ? bt.dedent`
|
|
5903
5903
|
FATAL broken build!, will close the process,
|
|
5904
5904
|
Fix the error below and restart storybook.
|
|
5905
5905
|
` : bt.dedent`
|
|
@@ -5908,52 +5908,52 @@ function vr(r) {
|
|
|
5908
5908
|
`
|
|
5909
5909
|
), Y.line();
|
|
5910
5910
|
}
|
|
5911
|
-
d(
|
|
5912
|
-
var
|
|
5911
|
+
d(vs, "printError");
|
|
5912
|
+
var rr = /* @__PURE__ */ d(async (s) => {
|
|
5913
5913
|
let { env: e } = process;
|
|
5914
5914
|
e.NODE_ENV = e.NODE_ENV || "development";
|
|
5915
5915
|
let t = await W(__dirname);
|
|
5916
5916
|
H(t, "Failed to find the closest package.json file.");
|
|
5917
|
-
let
|
|
5918
|
-
...
|
|
5919
|
-
configDir:
|
|
5917
|
+
let r = {
|
|
5918
|
+
...s,
|
|
5919
|
+
configDir: s.configDir || "./.storybook",
|
|
5920
5920
|
configType: "DEVELOPMENT",
|
|
5921
|
-
ignorePreview: !!
|
|
5922
|
-
cache:
|
|
5921
|
+
ignorePreview: !!s.previewUrl && !s.forceBuildPreview,
|
|
5922
|
+
cache: fs,
|
|
5923
5923
|
packageJson: t
|
|
5924
5924
|
};
|
|
5925
|
-
await
|
|
5925
|
+
await ys(
|
|
5926
5926
|
"dev",
|
|
5927
5927
|
{
|
|
5928
|
-
cliOptions:
|
|
5929
|
-
presetOptions:
|
|
5930
|
-
printError:
|
|
5928
|
+
cliOptions: s,
|
|
5929
|
+
presetOptions: r,
|
|
5930
|
+
printError: vs
|
|
5931
5931
|
},
|
|
5932
|
-
() =>
|
|
5932
|
+
() => gs(r)
|
|
5933
5933
|
);
|
|
5934
5934
|
}, "dev");
|
|
5935
5935
|
|
|
5936
5936
|
// src/cli/globalSettings.ts
|
|
5937
|
-
var Ce = fe(
|
|
5937
|
+
var Ce = fe(Tr(), 1);
|
|
5938
5938
|
import At from "node:fs/promises";
|
|
5939
5939
|
import { homedir as Ui } from "node:os";
|
|
5940
5940
|
import { dirname as qi, join as Fi } from "node:path";
|
|
5941
5941
|
|
|
5942
5942
|
// src/server-errors.ts
|
|
5943
|
-
var
|
|
5943
|
+
var Ar = fe(vt(), 1);
|
|
5944
5944
|
|
|
5945
5945
|
// src/storybook-error.ts
|
|
5946
|
-
function
|
|
5947
|
-
code:
|
|
5946
|
+
function Er({
|
|
5947
|
+
code: s,
|
|
5948
5948
|
category: e
|
|
5949
5949
|
}) {
|
|
5950
|
-
let t = String(
|
|
5950
|
+
let t = String(s).padStart(4, "0");
|
|
5951
5951
|
return `SB_${e}_${t}`;
|
|
5952
5952
|
}
|
|
5953
|
-
d(
|
|
5954
|
-
var Ge = class
|
|
5953
|
+
d(Er, "parseErrorCode");
|
|
5954
|
+
var Ge = class s extends Error {
|
|
5955
5955
|
constructor(t) {
|
|
5956
|
-
super(
|
|
5956
|
+
super(s.getFullMessage(t));
|
|
5957
5957
|
/**
|
|
5958
5958
|
* Data associated with the error. Used to provide additional information in the error message or
|
|
5959
5959
|
* to be passed to telemetry.
|
|
@@ -5967,7 +5967,7 @@ var Ge = class r extends Error {
|
|
|
5967
5967
|
d(this, "StorybookError");
|
|
5968
5968
|
}
|
|
5969
5969
|
get fullErrorCode() {
|
|
5970
|
-
return
|
|
5970
|
+
return Er({ code: this.code, category: this.category });
|
|
5971
5971
|
}
|
|
5972
5972
|
/** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
|
|
5973
5973
|
get name() {
|
|
@@ -5977,12 +5977,12 @@ var Ge = class r extends Error {
|
|
|
5977
5977
|
/** Generates the error message along with additional documentation link (if applicable). */
|
|
5978
5978
|
static getFullMessage({
|
|
5979
5979
|
documentation: t,
|
|
5980
|
-
code:
|
|
5980
|
+
code: r,
|
|
5981
5981
|
category: i,
|
|
5982
5982
|
message: n
|
|
5983
5983
|
}) {
|
|
5984
5984
|
let o;
|
|
5985
|
-
return t === !0 ? o = `https://storybook.js.org/error/${
|
|
5985
|
+
return t === !0 ? o = `https://storybook.js.org/error/${Er({ code: r, category: i })}` : typeof t == "string" ? o = t : Array.isArray(t) &&
|
|
5986
5986
|
(o = `
|
|
5987
5987
|
${t.map((a) => ` - ${a}`).join(`
|
|
5988
5988
|
`)}`), `${n}${o != null ? `
|
|
@@ -5998,7 +5998,7 @@ var Je = class extends Ge {
|
|
|
5998
5998
|
super({
|
|
5999
5999
|
category: "CORE-SERVER",
|
|
6000
6000
|
code: 1,
|
|
6001
|
-
message:
|
|
6001
|
+
message: Ar.dedent`
|
|
6002
6002
|
Unable to save global settings file to ${t.filePath}
|
|
6003
6003
|
${t.error && `Reason: ${t.error}`}`
|
|
6004
6004
|
});
|
|
@@ -6017,18 +6017,18 @@ var Bi = Fi(Ui(), ".storybook", "settings.json"), Wi = 1, Hi = Ce.z.object({
|
|
|
6017
6017
|
userSince: Ce.z.number().optional(),
|
|
6018
6018
|
init: Ce.z.object({ skipOnboarding: Ce.z.boolean().optional() }).optional()
|
|
6019
6019
|
}), ke;
|
|
6020
|
-
async function
|
|
6020
|
+
async function jr(s = Bi) {
|
|
6021
6021
|
if (ke)
|
|
6022
6022
|
return ke;
|
|
6023
6023
|
try {
|
|
6024
|
-
let e = await At.readFile(
|
|
6025
|
-
ke = new Ye(
|
|
6024
|
+
let e = await At.readFile(s, "utf8"), t = Hi.parse(JSON.parse(e));
|
|
6025
|
+
ke = new Ye(s, t);
|
|
6026
6026
|
} catch {
|
|
6027
|
-
ke = new Ye(
|
|
6027
|
+
ke = new Ye(s, { version: Wi, userSince: Date.now() }), await ke.save();
|
|
6028
6028
|
}
|
|
6029
6029
|
return ke;
|
|
6030
6030
|
}
|
|
6031
|
-
d(
|
|
6031
|
+
d(jr, "globalSettings");
|
|
6032
6032
|
var Ye = class {
|
|
6033
6033
|
static {
|
|
6034
6034
|
d(this, "Settings");
|
|
@@ -6057,7 +6057,7 @@ var Ye = class {
|
|
|
6057
6057
|
|
|
6058
6058
|
// src/cli/bin/index.ts
|
|
6059
6059
|
Gi("cliVersion", zi.storybook);
|
|
6060
|
-
var Ie = console, Rt = /* @__PURE__ */ d((
|
|
6060
|
+
var Ie = console, Rt = /* @__PURE__ */ d((s) => Pe.program.command(s).option(
|
|
6061
6061
|
"--disable-telemetry",
|
|
6062
6062
|
"Disable sending telemetry data",
|
|
6063
6063
|
// default value is false, but if the user sets STORYBOOK_DISABLE_TELEMETRY, it can be true
|
|
@@ -6065,12 +6065,12 @@ var Ie = console, Rt = /* @__PURE__ */ d((r) => Pe.program.command(r).option(
|
|
|
6065
6065
|
).option("--debug", "Get more logs in debug mode", !1).option("--enable-crash-reports", "Enable sending crash reports to telemetry data").hook(
|
|
6066
6066
|
"preAction", async () => {
|
|
6067
6067
|
try {
|
|
6068
|
-
await
|
|
6068
|
+
await jr();
|
|
6069
6069
|
} catch (e) {
|
|
6070
6070
|
Ie.error("Error loading global settings", e);
|
|
6071
6071
|
}
|
|
6072
6072
|
}), "command");
|
|
6073
|
-
Rt("dev").option("-p, --port <number>", "Port to run Storybook", (
|
|
6073
|
+
Rt("dev").option("-p, --port <number>", "Port to run Storybook", (s) => parseInt(s, 10)).option("-h, --host <string>", "Host to run Storyboo\
|
|
6074
6074
|
k").option("-c, --config-dir <dir-name>", "Directory where to load Storybook configurations from").option(
|
|
6075
6075
|
"--https",
|
|
6076
6076
|
"Serve Storybook over HTTPS. Note: You must provide your own certificate information."
|
|
@@ -6092,17 +6092,17 @@ ack", "Display final webpack configurations for debugging purposes").option(
|
|
|
6092
6092
|
ly site using addon-docs").option("--exact-port", "Exit early if the desired port is not available").option(
|
|
6093
6093
|
"--initial-path [path]",
|
|
6094
6094
|
"URL path to be appended when visiting Storybook for the first time"
|
|
6095
|
-
).option("--preview-only", "Use the preview without the manager UI").action(async (
|
|
6096
|
-
St.setLevel(
|
|
6095
|
+
).option("--preview-only", "Use the preview without the manager UI").action(async (s) => {
|
|
6096
|
+
St.setLevel(s.loglevel);
|
|
6097
6097
|
let e = await W(__dirname);
|
|
6098
6098
|
H(e, "Failed to find the closest package.json file."), Ie.log(Ne.default.bold(`${e.name} v${e.version}`) + Ne.default.reset(`
|
|
6099
|
-
`)), jt(
|
|
6099
|
+
`)), jt(s, {
|
|
6100
6100
|
port: "SBCONFIG_PORT",
|
|
6101
6101
|
host: "SBCONFIG_HOSTNAME",
|
|
6102
6102
|
staticDir: "SBCONFIG_STATIC_DIR",
|
|
6103
6103
|
configDir: "SBCONFIG_CONFIG_DIR",
|
|
6104
6104
|
ci: "CI"
|
|
6105
|
-
}), parseInt(`${
|
|
6105
|
+
}), parseInt(`${s.port}`, 10) && (s.port = parseInt(`${s.port}`, 10)), await rr({ ...s, packageJson: e }).catch(() => process.exit(1));
|
|
6106
6106
|
});
|
|
6107
6107
|
Rt("build").option("-o, --output-dir <dir-name>", "Directory where to store built files").option("-c, --config-dir <dir-name>", "Directory w\
|
|
6108
6108
|
here to load Storybook configurations from").option("--quiet", "Suppress verbose build output").option("--loglevel <level>", "Control level \
|
|
@@ -6114,43 +6114,43 @@ of logging during build").option("--debug-webpack", "Display final webpack confi
|
|
|
6114
6114
|
"Disables the default storybook preview and lets your use your own"
|
|
6115
6115
|
).option("--force-build-preview", "Build the preview iframe even if you are using --preview-url").option("--docs", "Build a documentation-on\
|
|
6116
6116
|
ly site using addon-docs").option("--test", "Build stories optimized for testing purposes.").option("--preview-only", "Use the preview witho\
|
|
6117
|
-
ut the manager UI").action(async (
|
|
6117
|
+
ut the manager UI").action(async (s) => {
|
|
6118
6118
|
let { env: e } = process;
|
|
6119
6119
|
e.NODE_ENV = e.NODE_ENV || "production";
|
|
6120
6120
|
let t = await W(__dirname);
|
|
6121
|
-
H(t, "Failed to find the closest package.json file."), St.setLevel(
|
|
6122
|
-
`)), jt(
|
|
6121
|
+
H(t, "Failed to find the closest package.json file."), St.setLevel(s.loglevel), Ie.log(Ne.default.bold(`${t.name} v${t.version}
|
|
6122
|
+
`)), jt(s, {
|
|
6123
6123
|
staticDir: "SBCONFIG_STATIC_DIR",
|
|
6124
6124
|
outputDir: "SBCONFIG_OUTPUT_DIR",
|
|
6125
6125
|
configDir: "SBCONFIG_CONFIG_DIR"
|
|
6126
6126
|
}), await Qt({
|
|
6127
|
-
...
|
|
6127
|
+
...s,
|
|
6128
6128
|
packageJson: t,
|
|
6129
|
-
test: !!
|
|
6129
|
+
test: !!s.test || process.env.SB_TESTBUILD === "true"
|
|
6130
6130
|
}).catch(() => process.exit(1));
|
|
6131
6131
|
});
|
|
6132
6132
|
Rt("index").option("-o, --output-file <file-name>", "JSON file to output index").option("-c, --config-dir <dir-name>", "Directory where to l\
|
|
6133
6133
|
oad Storybook configurations from").option("--quiet", "Suppress verbose build output").option("--loglevel <level>", "Control level of loggin\
|
|
6134
|
-
g during build").action(async (
|
|
6134
|
+
g during build").action(async (s) => {
|
|
6135
6135
|
let { env: e } = process;
|
|
6136
6136
|
e.NODE_ENV = e.NODE_ENV || "production";
|
|
6137
6137
|
let t = await W(__dirname);
|
|
6138
|
-
H(t, "Failed to find the closest package.json file."), St.setLevel(
|
|
6139
|
-
`)), jt(
|
|
6138
|
+
H(t, "Failed to find the closest package.json file."), St.setLevel(s.loglevel), Ie.log(Ne.default.bold(`${t.name} v${t.version}
|
|
6139
|
+
`)), jt(s, {
|
|
6140
6140
|
configDir: "SBCONFIG_CONFIG_DIR",
|
|
6141
6141
|
outputFile: "SBCONFIG_OUTPUT_FILE"
|
|
6142
|
-
}), await
|
|
6143
|
-
...
|
|
6142
|
+
}), await er({
|
|
6143
|
+
...s,
|
|
6144
6144
|
packageJson: t
|
|
6145
6145
|
}).catch(() => process.exit(1));
|
|
6146
6146
|
});
|
|
6147
|
-
Pe.program.on("command:*", ([
|
|
6147
|
+
Pe.program.on("command:*", ([s]) => {
|
|
6148
6148
|
Ie.error(
|
|
6149
6149
|
` Invalid command: %s.
|
|
6150
6150
|
See --help for a list of available commands.`,
|
|
6151
|
-
|
|
6151
|
+
s
|
|
6152
6152
|
);
|
|
6153
|
-
let t = Pe.program.commands.map((
|
|
6153
|
+
let t = Pe.program.commands.map((r) => r.name()).find((r) => gt(r, s) < 3);
|
|
6154
6154
|
t && Ie.info(`
|
|
6155
6155
|
Did you mean ${t}?`), process.exit(1);
|
|
6156
6156
|
});
|