drizzle-kit 0.20.17-7f33638 → 0.20.17-9f0ea64
Sign up to get free protection for your applications and to get access to all the features.
- package/bin.cjs +18025 -7432
- package/cli/commands/migrate.d.ts +41 -41
- package/cli/commands/mysqlIntrospect.d.ts +9 -9
- package/cli/commands/pgIntrospect.d.ts +7 -7
- package/cli/commands/sqliteIntrospect.d.ts +12 -12
- package/cli/utils.d.ts +1 -0
- package/cli/validations/cli.d.ts +13 -13
- package/cli/validations/common.d.ts +27 -27
- package/cli/validations/mysql.d.ts +4 -4
- package/cli/validations/pg.d.ts +4 -10
- package/index.d.mts +16 -10
- package/index.d.ts +16 -10
- package/package.json +9 -6
- package/payload.js +3147 -3789
- package/payload.mjs +324 -966
- package/schemaValidator.d.ts +221 -221
- package/serializer/mysqlSchema.d.ts +910 -1224
- package/serializer/pgSchema.d.ts +734 -734
- package/serializer/sqliteSchema.d.ts +457 -457
- package/snapshotsDiffer.d.ts +314 -314
- package/utils-studio.js +926 -1051
- package/utils-studio.mjs +888 -1013
- package/utils.js +218 -853
- package/utils.mjs +193 -828
package/utils-studio.mjs
CHANGED
@@ -34,6 +34,516 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
34
34
|
mod
|
35
35
|
));
|
36
36
|
|
37
|
+
// node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/vendor/ansi-styles/index.js
|
38
|
+
function assembleStyles() {
|
39
|
+
const codes = /* @__PURE__ */ new Map();
|
40
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
41
|
+
for (const [styleName, style] of Object.entries(group)) {
|
42
|
+
styles[styleName] = {
|
43
|
+
open: `\x1B[${style[0]}m`,
|
44
|
+
close: `\x1B[${style[1]}m`
|
45
|
+
};
|
46
|
+
group[styleName] = styles[styleName];
|
47
|
+
codes.set(style[0], style[1]);
|
48
|
+
}
|
49
|
+
Object.defineProperty(styles, groupName, {
|
50
|
+
value: group,
|
51
|
+
enumerable: false
|
52
|
+
});
|
53
|
+
}
|
54
|
+
Object.defineProperty(styles, "codes", {
|
55
|
+
value: codes,
|
56
|
+
enumerable: false
|
57
|
+
});
|
58
|
+
styles.color.close = "\x1B[39m";
|
59
|
+
styles.bgColor.close = "\x1B[49m";
|
60
|
+
styles.color.ansi = wrapAnsi16();
|
61
|
+
styles.color.ansi256 = wrapAnsi256();
|
62
|
+
styles.color.ansi16m = wrapAnsi16m();
|
63
|
+
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
64
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
65
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
66
|
+
Object.defineProperties(styles, {
|
67
|
+
rgbToAnsi256: {
|
68
|
+
value(red, green, blue) {
|
69
|
+
if (red === green && green === blue) {
|
70
|
+
if (red < 8) {
|
71
|
+
return 16;
|
72
|
+
}
|
73
|
+
if (red > 248) {
|
74
|
+
return 231;
|
75
|
+
}
|
76
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
77
|
+
}
|
78
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
79
|
+
},
|
80
|
+
enumerable: false
|
81
|
+
},
|
82
|
+
hexToRgb: {
|
83
|
+
value(hex) {
|
84
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
85
|
+
if (!matches) {
|
86
|
+
return [0, 0, 0];
|
87
|
+
}
|
88
|
+
let [colorString] = matches;
|
89
|
+
if (colorString.length === 3) {
|
90
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
91
|
+
}
|
92
|
+
const integer = Number.parseInt(colorString, 16);
|
93
|
+
return [
|
94
|
+
/* eslint-disable no-bitwise */
|
95
|
+
integer >> 16 & 255,
|
96
|
+
integer >> 8 & 255,
|
97
|
+
integer & 255
|
98
|
+
/* eslint-enable no-bitwise */
|
99
|
+
];
|
100
|
+
},
|
101
|
+
enumerable: false
|
102
|
+
},
|
103
|
+
hexToAnsi256: {
|
104
|
+
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
105
|
+
enumerable: false
|
106
|
+
},
|
107
|
+
ansi256ToAnsi: {
|
108
|
+
value(code) {
|
109
|
+
if (code < 8) {
|
110
|
+
return 30 + code;
|
111
|
+
}
|
112
|
+
if (code < 16) {
|
113
|
+
return 90 + (code - 8);
|
114
|
+
}
|
115
|
+
let red;
|
116
|
+
let green;
|
117
|
+
let blue;
|
118
|
+
if (code >= 232) {
|
119
|
+
red = ((code - 232) * 10 + 8) / 255;
|
120
|
+
green = red;
|
121
|
+
blue = red;
|
122
|
+
} else {
|
123
|
+
code -= 16;
|
124
|
+
const remainder = code % 36;
|
125
|
+
red = Math.floor(code / 36) / 5;
|
126
|
+
green = Math.floor(remainder / 6) / 5;
|
127
|
+
blue = remainder % 6 / 5;
|
128
|
+
}
|
129
|
+
const value = Math.max(red, green, blue) * 2;
|
130
|
+
if (value === 0) {
|
131
|
+
return 30;
|
132
|
+
}
|
133
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
134
|
+
if (value === 2) {
|
135
|
+
result += 60;
|
136
|
+
}
|
137
|
+
return result;
|
138
|
+
},
|
139
|
+
enumerable: false
|
140
|
+
},
|
141
|
+
rgbToAnsi: {
|
142
|
+
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
143
|
+
enumerable: false
|
144
|
+
},
|
145
|
+
hexToAnsi: {
|
146
|
+
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
147
|
+
enumerable: false
|
148
|
+
}
|
149
|
+
});
|
150
|
+
return styles;
|
151
|
+
}
|
152
|
+
var ANSI_BACKGROUND_OFFSET, wrapAnsi16, wrapAnsi256, wrapAnsi16m, styles, modifierNames, foregroundColorNames, backgroundColorNames, colorNames, ansiStyles, ansi_styles_default;
|
153
|
+
var init_ansi_styles = __esm({
|
154
|
+
"node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/vendor/ansi-styles/index.js"() {
|
155
|
+
ANSI_BACKGROUND_OFFSET = 10;
|
156
|
+
wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
157
|
+
wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
158
|
+
wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
159
|
+
styles = {
|
160
|
+
modifier: {
|
161
|
+
reset: [0, 0],
|
162
|
+
// 21 isn't widely supported and 22 does the same thing
|
163
|
+
bold: [1, 22],
|
164
|
+
dim: [2, 22],
|
165
|
+
italic: [3, 23],
|
166
|
+
underline: [4, 24],
|
167
|
+
overline: [53, 55],
|
168
|
+
inverse: [7, 27],
|
169
|
+
hidden: [8, 28],
|
170
|
+
strikethrough: [9, 29]
|
171
|
+
},
|
172
|
+
color: {
|
173
|
+
black: [30, 39],
|
174
|
+
red: [31, 39],
|
175
|
+
green: [32, 39],
|
176
|
+
yellow: [33, 39],
|
177
|
+
blue: [34, 39],
|
178
|
+
magenta: [35, 39],
|
179
|
+
cyan: [36, 39],
|
180
|
+
white: [37, 39],
|
181
|
+
// Bright color
|
182
|
+
blackBright: [90, 39],
|
183
|
+
gray: [90, 39],
|
184
|
+
// Alias of `blackBright`
|
185
|
+
grey: [90, 39],
|
186
|
+
// Alias of `blackBright`
|
187
|
+
redBright: [91, 39],
|
188
|
+
greenBright: [92, 39],
|
189
|
+
yellowBright: [93, 39],
|
190
|
+
blueBright: [94, 39],
|
191
|
+
magentaBright: [95, 39],
|
192
|
+
cyanBright: [96, 39],
|
193
|
+
whiteBright: [97, 39]
|
194
|
+
},
|
195
|
+
bgColor: {
|
196
|
+
bgBlack: [40, 49],
|
197
|
+
bgRed: [41, 49],
|
198
|
+
bgGreen: [42, 49],
|
199
|
+
bgYellow: [43, 49],
|
200
|
+
bgBlue: [44, 49],
|
201
|
+
bgMagenta: [45, 49],
|
202
|
+
bgCyan: [46, 49],
|
203
|
+
bgWhite: [47, 49],
|
204
|
+
// Bright color
|
205
|
+
bgBlackBright: [100, 49],
|
206
|
+
bgGray: [100, 49],
|
207
|
+
// Alias of `bgBlackBright`
|
208
|
+
bgGrey: [100, 49],
|
209
|
+
// Alias of `bgBlackBright`
|
210
|
+
bgRedBright: [101, 49],
|
211
|
+
bgGreenBright: [102, 49],
|
212
|
+
bgYellowBright: [103, 49],
|
213
|
+
bgBlueBright: [104, 49],
|
214
|
+
bgMagentaBright: [105, 49],
|
215
|
+
bgCyanBright: [106, 49],
|
216
|
+
bgWhiteBright: [107, 49]
|
217
|
+
}
|
218
|
+
};
|
219
|
+
modifierNames = Object.keys(styles.modifier);
|
220
|
+
foregroundColorNames = Object.keys(styles.color);
|
221
|
+
backgroundColorNames = Object.keys(styles.bgColor);
|
222
|
+
colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
223
|
+
ansiStyles = assembleStyles();
|
224
|
+
ansi_styles_default = ansiStyles;
|
225
|
+
}
|
226
|
+
});
|
227
|
+
|
228
|
+
// node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/vendor/supports-color/index.js
|
229
|
+
import process2 from "node:process";
|
230
|
+
import os from "node:os";
|
231
|
+
import tty from "node:tty";
|
232
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
|
233
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
234
|
+
const position = argv.indexOf(prefix + flag);
|
235
|
+
const terminatorPosition = argv.indexOf("--");
|
236
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
237
|
+
}
|
238
|
+
function envForceColor() {
|
239
|
+
if ("FORCE_COLOR" in env) {
|
240
|
+
if (env.FORCE_COLOR === "true") {
|
241
|
+
return 1;
|
242
|
+
}
|
243
|
+
if (env.FORCE_COLOR === "false") {
|
244
|
+
return 0;
|
245
|
+
}
|
246
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
247
|
+
}
|
248
|
+
}
|
249
|
+
function translateLevel(level) {
|
250
|
+
if (level === 0) {
|
251
|
+
return false;
|
252
|
+
}
|
253
|
+
return {
|
254
|
+
level,
|
255
|
+
hasBasic: true,
|
256
|
+
has256: level >= 2,
|
257
|
+
has16m: level >= 3
|
258
|
+
};
|
259
|
+
}
|
260
|
+
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
261
|
+
const noFlagForceColor = envForceColor();
|
262
|
+
if (noFlagForceColor !== void 0) {
|
263
|
+
flagForceColor = noFlagForceColor;
|
264
|
+
}
|
265
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
266
|
+
if (forceColor === 0) {
|
267
|
+
return 0;
|
268
|
+
}
|
269
|
+
if (sniffFlags) {
|
270
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
271
|
+
return 3;
|
272
|
+
}
|
273
|
+
if (hasFlag("color=256")) {
|
274
|
+
return 2;
|
275
|
+
}
|
276
|
+
}
|
277
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
278
|
+
return 1;
|
279
|
+
}
|
280
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
281
|
+
return 0;
|
282
|
+
}
|
283
|
+
const min = forceColor || 0;
|
284
|
+
if (env.TERM === "dumb") {
|
285
|
+
return min;
|
286
|
+
}
|
287
|
+
if (process2.platform === "win32") {
|
288
|
+
const osRelease = os.release().split(".");
|
289
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
290
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
291
|
+
}
|
292
|
+
return 1;
|
293
|
+
}
|
294
|
+
if ("CI" in env) {
|
295
|
+
if ("GITHUB_ACTIONS" in env) {
|
296
|
+
return 3;
|
297
|
+
}
|
298
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
299
|
+
return 1;
|
300
|
+
}
|
301
|
+
return min;
|
302
|
+
}
|
303
|
+
if ("TEAMCITY_VERSION" in env) {
|
304
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
305
|
+
}
|
306
|
+
if (env.COLORTERM === "truecolor") {
|
307
|
+
return 3;
|
308
|
+
}
|
309
|
+
if (env.TERM === "xterm-kitty") {
|
310
|
+
return 3;
|
311
|
+
}
|
312
|
+
if ("TERM_PROGRAM" in env) {
|
313
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
314
|
+
switch (env.TERM_PROGRAM) {
|
315
|
+
case "iTerm.app": {
|
316
|
+
return version >= 3 ? 3 : 2;
|
317
|
+
}
|
318
|
+
case "Apple_Terminal": {
|
319
|
+
return 2;
|
320
|
+
}
|
321
|
+
}
|
322
|
+
}
|
323
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
324
|
+
return 2;
|
325
|
+
}
|
326
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
327
|
+
return 1;
|
328
|
+
}
|
329
|
+
if ("COLORTERM" in env) {
|
330
|
+
return 1;
|
331
|
+
}
|
332
|
+
return min;
|
333
|
+
}
|
334
|
+
function createSupportsColor(stream, options = {}) {
|
335
|
+
const level = _supportsColor(stream, {
|
336
|
+
streamIsTTY: stream && stream.isTTY,
|
337
|
+
...options
|
338
|
+
});
|
339
|
+
return translateLevel(level);
|
340
|
+
}
|
341
|
+
var env, flagForceColor, supportsColor, supports_color_default;
|
342
|
+
var init_supports_color = __esm({
|
343
|
+
"node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/vendor/supports-color/index.js"() {
|
344
|
+
({ env } = process2);
|
345
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
346
|
+
flagForceColor = 0;
|
347
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
348
|
+
flagForceColor = 1;
|
349
|
+
}
|
350
|
+
supportsColor = {
|
351
|
+
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
352
|
+
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
353
|
+
};
|
354
|
+
supports_color_default = supportsColor;
|
355
|
+
}
|
356
|
+
});
|
357
|
+
|
358
|
+
// node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/utilities.js
|
359
|
+
function stringReplaceAll(string, substring, replacer) {
|
360
|
+
let index4 = string.indexOf(substring);
|
361
|
+
if (index4 === -1) {
|
362
|
+
return string;
|
363
|
+
}
|
364
|
+
const substringLength = substring.length;
|
365
|
+
let endIndex = 0;
|
366
|
+
let returnValue = "";
|
367
|
+
do {
|
368
|
+
returnValue += string.slice(endIndex, index4) + substring + replacer;
|
369
|
+
endIndex = index4 + substringLength;
|
370
|
+
index4 = string.indexOf(substring, endIndex);
|
371
|
+
} while (index4 !== -1);
|
372
|
+
returnValue += string.slice(endIndex);
|
373
|
+
return returnValue;
|
374
|
+
}
|
375
|
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index4) {
|
376
|
+
let endIndex = 0;
|
377
|
+
let returnValue = "";
|
378
|
+
do {
|
379
|
+
const gotCR = string[index4 - 1] === "\r";
|
380
|
+
returnValue += string.slice(endIndex, gotCR ? index4 - 1 : index4) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
381
|
+
endIndex = index4 + 1;
|
382
|
+
index4 = string.indexOf("\n", endIndex);
|
383
|
+
} while (index4 !== -1);
|
384
|
+
returnValue += string.slice(endIndex);
|
385
|
+
return returnValue;
|
386
|
+
}
|
387
|
+
var init_utilities = __esm({
|
388
|
+
"node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/utilities.js"() {
|
389
|
+
}
|
390
|
+
});
|
391
|
+
|
392
|
+
// node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/index.js
|
393
|
+
function createChalk(options) {
|
394
|
+
return chalkFactory(options);
|
395
|
+
}
|
396
|
+
var stdoutColor, stderrColor, GENERATOR, STYLER, IS_EMPTY, levelMapping, styles2, applyOptions, chalkFactory, getModelAnsi, usedModels, proto, createStyler, createBuilder, applyStyle, chalk, chalkStderr;
|
397
|
+
var init_source = __esm({
|
398
|
+
"node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/index.js"() {
|
399
|
+
init_ansi_styles();
|
400
|
+
init_supports_color();
|
401
|
+
init_utilities();
|
402
|
+
init_ansi_styles();
|
403
|
+
({ stdout: stdoutColor, stderr: stderrColor } = supports_color_default);
|
404
|
+
GENERATOR = Symbol("GENERATOR");
|
405
|
+
STYLER = Symbol("STYLER");
|
406
|
+
IS_EMPTY = Symbol("IS_EMPTY");
|
407
|
+
levelMapping = [
|
408
|
+
"ansi",
|
409
|
+
"ansi",
|
410
|
+
"ansi256",
|
411
|
+
"ansi16m"
|
412
|
+
];
|
413
|
+
styles2 = /* @__PURE__ */ Object.create(null);
|
414
|
+
applyOptions = (object, options = {}) => {
|
415
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
416
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
417
|
+
}
|
418
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
419
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
420
|
+
};
|
421
|
+
chalkFactory = (options) => {
|
422
|
+
const chalk2 = (...strings) => strings.join(" ");
|
423
|
+
applyOptions(chalk2, options);
|
424
|
+
Object.setPrototypeOf(chalk2, createChalk.prototype);
|
425
|
+
return chalk2;
|
426
|
+
};
|
427
|
+
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
428
|
+
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
429
|
+
styles2[styleName] = {
|
430
|
+
get() {
|
431
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
432
|
+
Object.defineProperty(this, styleName, { value: builder });
|
433
|
+
return builder;
|
434
|
+
}
|
435
|
+
};
|
436
|
+
}
|
437
|
+
styles2.visible = {
|
438
|
+
get() {
|
439
|
+
const builder = createBuilder(this, this[STYLER], true);
|
440
|
+
Object.defineProperty(this, "visible", { value: builder });
|
441
|
+
return builder;
|
442
|
+
}
|
443
|
+
};
|
444
|
+
getModelAnsi = (model, level, type, ...arguments_) => {
|
445
|
+
if (model === "rgb") {
|
446
|
+
if (level === "ansi16m") {
|
447
|
+
return ansi_styles_default[type].ansi16m(...arguments_);
|
448
|
+
}
|
449
|
+
if (level === "ansi256") {
|
450
|
+
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
451
|
+
}
|
452
|
+
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
453
|
+
}
|
454
|
+
if (model === "hex") {
|
455
|
+
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
456
|
+
}
|
457
|
+
return ansi_styles_default[type][model](...arguments_);
|
458
|
+
};
|
459
|
+
usedModels = ["rgb", "hex", "ansi256"];
|
460
|
+
for (const model of usedModels) {
|
461
|
+
styles2[model] = {
|
462
|
+
get() {
|
463
|
+
const { level } = this;
|
464
|
+
return function(...arguments_) {
|
465
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
466
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
467
|
+
};
|
468
|
+
}
|
469
|
+
};
|
470
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
471
|
+
styles2[bgModel] = {
|
472
|
+
get() {
|
473
|
+
const { level } = this;
|
474
|
+
return function(...arguments_) {
|
475
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
476
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
477
|
+
};
|
478
|
+
}
|
479
|
+
};
|
480
|
+
}
|
481
|
+
proto = Object.defineProperties(() => {
|
482
|
+
}, {
|
483
|
+
...styles2,
|
484
|
+
level: {
|
485
|
+
enumerable: true,
|
486
|
+
get() {
|
487
|
+
return this[GENERATOR].level;
|
488
|
+
},
|
489
|
+
set(level) {
|
490
|
+
this[GENERATOR].level = level;
|
491
|
+
}
|
492
|
+
}
|
493
|
+
});
|
494
|
+
createStyler = (open, close, parent) => {
|
495
|
+
let openAll;
|
496
|
+
let closeAll;
|
497
|
+
if (parent === void 0) {
|
498
|
+
openAll = open;
|
499
|
+
closeAll = close;
|
500
|
+
} else {
|
501
|
+
openAll = parent.openAll + open;
|
502
|
+
closeAll = close + parent.closeAll;
|
503
|
+
}
|
504
|
+
return {
|
505
|
+
open,
|
506
|
+
close,
|
507
|
+
openAll,
|
508
|
+
closeAll,
|
509
|
+
parent
|
510
|
+
};
|
511
|
+
};
|
512
|
+
createBuilder = (self2, _styler, _isEmpty) => {
|
513
|
+
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
514
|
+
Object.setPrototypeOf(builder, proto);
|
515
|
+
builder[GENERATOR] = self2;
|
516
|
+
builder[STYLER] = _styler;
|
517
|
+
builder[IS_EMPTY] = _isEmpty;
|
518
|
+
return builder;
|
519
|
+
};
|
520
|
+
applyStyle = (self2, string) => {
|
521
|
+
if (self2.level <= 0 || !string) {
|
522
|
+
return self2[IS_EMPTY] ? "" : string;
|
523
|
+
}
|
524
|
+
let styler = self2[STYLER];
|
525
|
+
if (styler === void 0) {
|
526
|
+
return string;
|
527
|
+
}
|
528
|
+
const { openAll, closeAll } = styler;
|
529
|
+
if (string.includes("\x1B")) {
|
530
|
+
while (styler !== void 0) {
|
531
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
532
|
+
styler = styler.parent;
|
533
|
+
}
|
534
|
+
}
|
535
|
+
const lfIndex = string.indexOf("\n");
|
536
|
+
if (lfIndex !== -1) {
|
537
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
538
|
+
}
|
539
|
+
return openAll + string + closeAll;
|
540
|
+
};
|
541
|
+
Object.defineProperties(createChalk.prototype, styles2);
|
542
|
+
chalk = createChalk();
|
543
|
+
chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
544
|
+
}
|
545
|
+
});
|
546
|
+
|
37
547
|
// node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/readline.js
|
38
548
|
var require_readline = __commonJS({
|
39
549
|
"node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/readline.js"(exports) {
|
@@ -574,12 +1084,11 @@ var init_global = __esm({
|
|
574
1084
|
}
|
575
1085
|
});
|
576
1086
|
|
577
|
-
// node_modules/.pnpm/zod@3.
|
1087
|
+
// node_modules/.pnpm/zod@3.20.2/node_modules/zod/lib/index.mjs
|
578
1088
|
function getErrorMap() {
|
579
1089
|
return overrideErrorMap;
|
580
1090
|
}
|
581
1091
|
function addIssueToContext(ctx, issueData) {
|
582
|
-
const overrideMap = getErrorMap();
|
583
1092
|
const issue = makeIssue({
|
584
1093
|
issueData,
|
585
1094
|
data: ctx.data,
|
@@ -587,29 +1096,13 @@ function addIssueToContext(ctx, issueData) {
|
|
587
1096
|
errorMaps: [
|
588
1097
|
ctx.common.contextualErrorMap,
|
589
1098
|
ctx.schemaErrorMap,
|
590
|
-
|
591
|
-
|
1099
|
+
getErrorMap(),
|
1100
|
+
errorMap
|
592
1101
|
// then global default map
|
593
1102
|
].filter((x) => !!x)
|
594
1103
|
});
|
595
1104
|
ctx.common.issues.push(issue);
|
596
1105
|
}
|
597
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
598
|
-
if (kind === "a" && !f)
|
599
|
-
throw new TypeError("Private accessor was defined without a getter");
|
600
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
601
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
602
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
603
|
-
}
|
604
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
605
|
-
if (kind === "m")
|
606
|
-
throw new TypeError("Private method is not writable");
|
607
|
-
if (kind === "a" && !f)
|
608
|
-
throw new TypeError("Private accessor was defined without a setter");
|
609
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
610
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
611
|
-
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
612
|
-
}
|
613
1106
|
function processCreateParams(params) {
|
614
1107
|
if (!params)
|
615
1108
|
return {};
|
@@ -620,50 +1113,15 @@ function processCreateParams(params) {
|
|
620
1113
|
if (errorMap2)
|
621
1114
|
return { errorMap: errorMap2, description };
|
622
1115
|
const customMap = (iss, ctx) => {
|
623
|
-
var _a, _b;
|
624
|
-
const { message } = params;
|
625
|
-
if (iss.code === "invalid_enum_value") {
|
626
|
-
return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
|
627
|
-
}
|
628
|
-
if (typeof ctx.data === "undefined") {
|
629
|
-
return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
|
630
|
-
}
|
631
1116
|
if (iss.code !== "invalid_type")
|
632
1117
|
return { message: ctx.defaultError };
|
633
|
-
|
1118
|
+
if (typeof ctx.data === "undefined") {
|
1119
|
+
return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError };
|
1120
|
+
}
|
1121
|
+
return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError };
|
634
1122
|
};
|
635
1123
|
return { errorMap: customMap, description };
|
636
1124
|
}
|
637
|
-
function timeRegexSource(args) {
|
638
|
-
let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
|
639
|
-
if (args.precision) {
|
640
|
-
regex = `${regex}\\.\\d{${args.precision}}`;
|
641
|
-
} else if (args.precision == null) {
|
642
|
-
regex = `${regex}(\\.\\d+)?`;
|
643
|
-
}
|
644
|
-
return regex;
|
645
|
-
}
|
646
|
-
function timeRegex(args) {
|
647
|
-
return new RegExp(`^${timeRegexSource(args)}$`);
|
648
|
-
}
|
649
|
-
function datetimeRegex(args) {
|
650
|
-
let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
|
651
|
-
const opts = [];
|
652
|
-
opts.push(args.local ? `Z?` : `Z`);
|
653
|
-
if (args.offset)
|
654
|
-
opts.push(`([+-]\\d{2}:?\\d{2})`);
|
655
|
-
regex = `${regex}(${opts.join("|")})`;
|
656
|
-
return new RegExp(`^${regex}$`);
|
657
|
-
}
|
658
|
-
function isValidIP(ip, version) {
|
659
|
-
if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
|
660
|
-
return true;
|
661
|
-
}
|
662
|
-
if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
|
663
|
-
return true;
|
664
|
-
}
|
665
|
-
return false;
|
666
|
-
}
|
667
1125
|
function floatSafeRemainder(val, step) {
|
668
1126
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
669
1127
|
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
@@ -684,10 +1142,7 @@ function deepPartialify(schema3) {
|
|
684
1142
|
shape: () => newShape
|
685
1143
|
});
|
686
1144
|
} else if (schema3 instanceof ZodArray) {
|
687
|
-
return
|
688
|
-
...schema3._def,
|
689
|
-
type: deepPartialify(schema3.element)
|
690
|
-
});
|
1145
|
+
return ZodArray.create(deepPartialify(schema3.element));
|
691
1146
|
} else if (schema3 instanceof ZodOptional) {
|
692
1147
|
return ZodOptional.create(deepPartialify(schema3.unwrap()));
|
693
1148
|
} else if (schema3 instanceof ZodNullable) {
|
@@ -743,9 +1198,9 @@ function createZodEnum(values, params) {
|
|
743
1198
|
...processCreateParams(params)
|
744
1199
|
});
|
745
1200
|
}
|
746
|
-
var util,
|
1201
|
+
var util, ZodParsedType, getParsedType, ZodIssueCode, ZodError, errorMap, overrideErrorMap, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, errorUtil, ParseInputLazyPath, handleResult, ZodType, cuidRegex, uuidRegex, emailRegex, datetimeRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, objectUtil, AugmentFactory, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, BRAND, ZodBranded, ZodPipeline, late, ZodFirstPartyTypeKind, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType;
|
747
1202
|
var init_lib = __esm({
|
748
|
-
"node_modules/.pnpm/zod@3.
|
1203
|
+
"node_modules/.pnpm/zod@3.20.2/node_modules/zod/lib/index.mjs"() {
|
749
1204
|
(function(util2) {
|
750
1205
|
util2.assertEqual = (val) => val;
|
751
1206
|
function assertIs(_arg) {
|
@@ -803,15 +1258,6 @@ var init_lib = __esm({
|
|
803
1258
|
return value;
|
804
1259
|
};
|
805
1260
|
})(util || (util = {}));
|
806
|
-
(function(objectUtil2) {
|
807
|
-
objectUtil2.mergeShapes = (first, second) => {
|
808
|
-
return {
|
809
|
-
...first,
|
810
|
-
...second
|
811
|
-
// second overwrites first
|
812
|
-
};
|
813
|
-
};
|
814
|
-
})(objectUtil || (objectUtil = {}));
|
815
1261
|
ZodParsedType = util.arrayToEnum([
|
816
1262
|
"string",
|
817
1263
|
"nan",
|
@@ -893,7 +1339,7 @@ var init_lib = __esm({
|
|
893
1339
|
"not_multiple_of",
|
894
1340
|
"not_finite"
|
895
1341
|
]);
|
896
|
-
ZodError = class
|
1342
|
+
ZodError = class extends Error {
|
897
1343
|
constructor(issues) {
|
898
1344
|
super();
|
899
1345
|
this.issues = [];
|
@@ -951,11 +1397,6 @@ var init_lib = __esm({
|
|
951
1397
|
processError(this);
|
952
1398
|
return fieldErrors;
|
953
1399
|
}
|
954
|
-
static assert(value) {
|
955
|
-
if (!(value instanceof _ZodError)) {
|
956
|
-
throw new Error(`Not a ZodError: ${value}`);
|
957
|
-
}
|
958
|
-
}
|
959
1400
|
toString() {
|
960
1401
|
return this.message;
|
961
1402
|
}
|
@@ -1022,12 +1463,7 @@ var init_lib = __esm({
|
|
1022
1463
|
break;
|
1023
1464
|
case ZodIssueCode.invalid_string:
|
1024
1465
|
if (typeof issue.validation === "object") {
|
1025
|
-
if ("
|
1026
|
-
message = `Invalid input: must include "${issue.validation.includes}"`;
|
1027
|
-
if (typeof issue.validation.position === "number") {
|
1028
|
-
message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
|
1029
|
-
}
|
1030
|
-
} else if ("startsWith" in issue.validation) {
|
1466
|
+
if ("startsWith" in issue.validation) {
|
1031
1467
|
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
|
1032
1468
|
} else if ("endsWith" in issue.validation) {
|
1033
1469
|
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
@@ -1048,7 +1484,7 @@ var init_lib = __esm({
|
|
1048
1484
|
else if (issue.type === "number")
|
1049
1485
|
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
1050
1486
|
else if (issue.type === "date")
|
1051
|
-
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(
|
1487
|
+
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(issue.minimum)}`;
|
1052
1488
|
else
|
1053
1489
|
message = "Invalid input";
|
1054
1490
|
break;
|
@@ -1059,10 +1495,8 @@ var init_lib = __esm({
|
|
1059
1495
|
message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
1060
1496
|
else if (issue.type === "number")
|
1061
1497
|
message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
1062
|
-
else if (issue.type === "bigint")
|
1063
|
-
message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
1064
1498
|
else if (issue.type === "date")
|
1065
|
-
message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(
|
1499
|
+
message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(issue.maximum)}`;
|
1066
1500
|
else
|
1067
1501
|
message = "Invalid input";
|
1068
1502
|
break;
|
@@ -1092,13 +1526,6 @@ var init_lib = __esm({
|
|
1092
1526
|
...issueData,
|
1093
1527
|
path: fullPath
|
1094
1528
|
};
|
1095
|
-
if (issueData.message !== void 0) {
|
1096
|
-
return {
|
1097
|
-
...issueData,
|
1098
|
-
path: fullPath,
|
1099
|
-
message: issueData.message
|
1100
|
-
};
|
1101
|
-
}
|
1102
1529
|
let errorMessage = "";
|
1103
1530
|
const maps = errorMaps.filter((m) => !!m).slice().reverse();
|
1104
1531
|
for (const map of maps) {
|
@@ -1107,7 +1534,7 @@ var init_lib = __esm({
|
|
1107
1534
|
return {
|
1108
1535
|
...issueData,
|
1109
1536
|
path: fullPath,
|
1110
|
-
message: errorMessage
|
1537
|
+
message: issueData.message || errorMessage
|
1111
1538
|
};
|
1112
1539
|
};
|
1113
1540
|
ParseStatus = class _ParseStatus {
|
@@ -1136,11 +1563,9 @@ var init_lib = __esm({
|
|
1136
1563
|
static async mergeObjectAsync(status, pairs) {
|
1137
1564
|
const syncPairs = [];
|
1138
1565
|
for (const pair of pairs) {
|
1139
|
-
const key = await pair.key;
|
1140
|
-
const value = await pair.value;
|
1141
1566
|
syncPairs.push({
|
1142
|
-
key,
|
1143
|
-
value
|
1567
|
+
key: await pair.key,
|
1568
|
+
value: await pair.value
|
1144
1569
|
});
|
1145
1570
|
}
|
1146
1571
|
return _ParseStatus.mergeObjectSync(status, syncPairs);
|
@@ -1157,7 +1582,7 @@ var init_lib = __esm({
|
|
1157
1582
|
status.dirty();
|
1158
1583
|
if (value.status === "dirty")
|
1159
1584
|
status.dirty();
|
1160
|
-
if (
|
1585
|
+
if (typeof value.value !== "undefined" || pair.alwaysSet) {
|
1161
1586
|
finalObject[key.value] = value.value;
|
1162
1587
|
}
|
1163
1588
|
}
|
@@ -1172,28 +1597,20 @@ var init_lib = __esm({
|
|
1172
1597
|
isAborted = (x) => x.status === "aborted";
|
1173
1598
|
isDirty = (x) => x.status === "dirty";
|
1174
1599
|
isValid = (x) => x.status === "valid";
|
1175
|
-
isAsync = (x) => typeof Promise !==
|
1600
|
+
isAsync = (x) => typeof Promise !== void 0 && x instanceof Promise;
|
1176
1601
|
(function(errorUtil2) {
|
1177
1602
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
1178
1603
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
|
1179
1604
|
})(errorUtil || (errorUtil = {}));
|
1180
1605
|
ParseInputLazyPath = class {
|
1181
1606
|
constructor(parent, value, path2, key) {
|
1182
|
-
this._cachedPath = [];
|
1183
1607
|
this.parent = parent;
|
1184
1608
|
this.data = value;
|
1185
1609
|
this._path = path2;
|
1186
1610
|
this._key = key;
|
1187
1611
|
}
|
1188
1612
|
get path() {
|
1189
|
-
|
1190
|
-
if (this._key instanceof Array) {
|
1191
|
-
this._cachedPath.push(...this._path, ...this._key);
|
1192
|
-
} else {
|
1193
|
-
this._cachedPath.push(...this._path, this._key);
|
1194
|
-
}
|
1195
|
-
}
|
1196
|
-
return this._cachedPath;
|
1613
|
+
return this._path.concat(this._key);
|
1197
1614
|
}
|
1198
1615
|
};
|
1199
1616
|
handleResult = (ctx, result) => {
|
@@ -1203,16 +1620,8 @@ var init_lib = __esm({
|
|
1203
1620
|
if (!ctx.common.issues.length) {
|
1204
1621
|
throw new Error("Validation failed but no issues detected.");
|
1205
1622
|
}
|
1206
|
-
|
1207
|
-
|
1208
|
-
get error() {
|
1209
|
-
if (this._error)
|
1210
|
-
return this._error;
|
1211
|
-
const error2 = new ZodError(ctx.common.issues);
|
1212
|
-
this._error = error2;
|
1213
|
-
return this._error;
|
1214
|
-
}
|
1215
|
-
};
|
1623
|
+
const error2 = new ZodError(ctx.common.issues);
|
1624
|
+
return { success: false, error: error2 };
|
1216
1625
|
}
|
1217
1626
|
};
|
1218
1627
|
ZodType = class {
|
@@ -1240,7 +1649,6 @@ var init_lib = __esm({
|
|
1240
1649
|
this.catch = this.catch.bind(this);
|
1241
1650
|
this.describe = this.describe.bind(this);
|
1242
1651
|
this.pipe = this.pipe.bind(this);
|
1243
|
-
this.readonly = this.readonly.bind(this);
|
1244
1652
|
this.isNullable = this.isNullable.bind(this);
|
1245
1653
|
this.isOptional = this.isOptional.bind(this);
|
1246
1654
|
}
|
@@ -1385,29 +1793,28 @@ var init_lib = __esm({
|
|
1385
1793
|
return this._refinement(refinement);
|
1386
1794
|
}
|
1387
1795
|
optional() {
|
1388
|
-
return ZodOptional.create(this
|
1796
|
+
return ZodOptional.create(this);
|
1389
1797
|
}
|
1390
1798
|
nullable() {
|
1391
|
-
return ZodNullable.create(this
|
1799
|
+
return ZodNullable.create(this);
|
1392
1800
|
}
|
1393
1801
|
nullish() {
|
1394
|
-
return this.
|
1802
|
+
return this.optional().nullable();
|
1395
1803
|
}
|
1396
1804
|
array() {
|
1397
|
-
return ZodArray.create(this
|
1805
|
+
return ZodArray.create(this);
|
1398
1806
|
}
|
1399
1807
|
promise() {
|
1400
|
-
return ZodPromise.create(this
|
1808
|
+
return ZodPromise.create(this);
|
1401
1809
|
}
|
1402
1810
|
or(option) {
|
1403
|
-
return ZodUnion.create([this, option]
|
1811
|
+
return ZodUnion.create([this, option]);
|
1404
1812
|
}
|
1405
1813
|
and(incoming) {
|
1406
|
-
return ZodIntersection.create(this, incoming
|
1814
|
+
return ZodIntersection.create(this, incoming);
|
1407
1815
|
}
|
1408
1816
|
transform(transform) {
|
1409
1817
|
return new ZodEffects({
|
1410
|
-
...processCreateParams(this._def),
|
1411
1818
|
schema: this,
|
1412
1819
|
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
1413
1820
|
effect: { type: "transform", transform }
|
@@ -1416,7 +1823,6 @@ var init_lib = __esm({
|
|
1416
1823
|
default(def) {
|
1417
1824
|
const defaultValueFunc = typeof def === "function" ? def : () => def;
|
1418
1825
|
return new ZodDefault({
|
1419
|
-
...processCreateParams(this._def),
|
1420
1826
|
innerType: this,
|
1421
1827
|
defaultValue: defaultValueFunc,
|
1422
1828
|
typeName: ZodFirstPartyTypeKind.ZodDefault
|
@@ -1426,15 +1832,14 @@ var init_lib = __esm({
|
|
1426
1832
|
return new ZodBranded({
|
1427
1833
|
typeName: ZodFirstPartyTypeKind.ZodBranded,
|
1428
1834
|
type: this,
|
1429
|
-
...processCreateParams(
|
1835
|
+
...processCreateParams(void 0)
|
1430
1836
|
});
|
1431
1837
|
}
|
1432
1838
|
catch(def) {
|
1433
|
-
const
|
1839
|
+
const defaultValueFunc = typeof def === "function" ? def : () => def;
|
1434
1840
|
return new ZodCatch({
|
1435
|
-
...processCreateParams(this._def),
|
1436
1841
|
innerType: this,
|
1437
|
-
|
1842
|
+
defaultValue: defaultValueFunc,
|
1438
1843
|
typeName: ZodFirstPartyTypeKind.ZodCatch
|
1439
1844
|
});
|
1440
1845
|
}
|
@@ -1448,9 +1853,6 @@ var init_lib = __esm({
|
|
1448
1853
|
pipe(target) {
|
1449
1854
|
return ZodPipeline.create(this, target);
|
1450
1855
|
}
|
1451
|
-
readonly() {
|
1452
|
-
return ZodReadonly.create(this);
|
1453
|
-
}
|
1454
1856
|
isOptional() {
|
1455
1857
|
return this.safeParse(void 0).success;
|
1456
1858
|
}
|
@@ -1459,19 +1861,43 @@ var init_lib = __esm({
|
|
1459
1861
|
}
|
1460
1862
|
};
|
1461
1863
|
cuidRegex = /^c[^\s-]{8,}$/i;
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1864
|
+
uuidRegex = /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
1865
|
+
emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
|
1866
|
+
datetimeRegex = (args) => {
|
1867
|
+
if (args.precision) {
|
1868
|
+
if (args.offset) {
|
1869
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
|
1870
|
+
} else {
|
1871
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
|
1872
|
+
}
|
1873
|
+
} else if (args.precision === 0) {
|
1874
|
+
if (args.offset) {
|
1875
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
|
1876
|
+
} else {
|
1877
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
|
1878
|
+
}
|
1879
|
+
} else {
|
1880
|
+
if (args.offset) {
|
1881
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
|
1882
|
+
} else {
|
1883
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
|
1884
|
+
}
|
1885
|
+
}
|
1886
|
+
};
|
1474
1887
|
ZodString = class _ZodString extends ZodType {
|
1888
|
+
constructor() {
|
1889
|
+
super(...arguments);
|
1890
|
+
this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {
|
1891
|
+
validation,
|
1892
|
+
code: ZodIssueCode.invalid_string,
|
1893
|
+
...errorUtil.errToObj(message)
|
1894
|
+
});
|
1895
|
+
this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));
|
1896
|
+
this.trim = () => new _ZodString({
|
1897
|
+
...this._def,
|
1898
|
+
checks: [...this._def.checks, { kind: "trim" }]
|
1899
|
+
});
|
1900
|
+
}
|
1475
1901
|
_parse(input) {
|
1476
1902
|
if (this._def.coerce) {
|
1477
1903
|
input.data = String(input.data);
|
@@ -1479,11 +1905,15 @@ var init_lib = __esm({
|
|
1479
1905
|
const parsedType = this._getType(input);
|
1480
1906
|
if (parsedType !== ZodParsedType.string) {
|
1481
1907
|
const ctx2 = this._getOrReturnCtx(input);
|
1482
|
-
addIssueToContext(
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1908
|
+
addIssueToContext(
|
1909
|
+
ctx2,
|
1910
|
+
{
|
1911
|
+
code: ZodIssueCode.invalid_type,
|
1912
|
+
expected: ZodParsedType.string,
|
1913
|
+
received: ctx2.parsedType
|
1914
|
+
}
|
1915
|
+
//
|
1916
|
+
);
|
1487
1917
|
return INVALID;
|
1488
1918
|
}
|
1489
1919
|
const status = new ParseStatus();
|
@@ -1551,19 +1981,6 @@ var init_lib = __esm({
|
|
1551
1981
|
});
|
1552
1982
|
status.dirty();
|
1553
1983
|
}
|
1554
|
-
} else if (check.kind === "emoji") {
|
1555
|
-
if (!emojiRegex) {
|
1556
|
-
emojiRegex = new RegExp(_emojiRegex, "u");
|
1557
|
-
}
|
1558
|
-
if (!emojiRegex.test(input.data)) {
|
1559
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1560
|
-
addIssueToContext(ctx, {
|
1561
|
-
validation: "emoji",
|
1562
|
-
code: ZodIssueCode.invalid_string,
|
1563
|
-
message: check.message
|
1564
|
-
});
|
1565
|
-
status.dirty();
|
1566
|
-
}
|
1567
1984
|
} else if (check.kind === "uuid") {
|
1568
1985
|
if (!uuidRegex.test(input.data)) {
|
1569
1986
|
ctx = this._getOrReturnCtx(input, ctx);
|
@@ -1574,16 +1991,6 @@ var init_lib = __esm({
|
|
1574
1991
|
});
|
1575
1992
|
status.dirty();
|
1576
1993
|
}
|
1577
|
-
} else if (check.kind === "nanoid") {
|
1578
|
-
if (!nanoidRegex.test(input.data)) {
|
1579
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1580
|
-
addIssueToContext(ctx, {
|
1581
|
-
validation: "nanoid",
|
1582
|
-
code: ZodIssueCode.invalid_string,
|
1583
|
-
message: check.message
|
1584
|
-
});
|
1585
|
-
status.dirty();
|
1586
|
-
}
|
1587
1994
|
} else if (check.kind === "cuid") {
|
1588
1995
|
if (!cuidRegex.test(input.data)) {
|
1589
1996
|
ctx = this._getOrReturnCtx(input, ctx);
|
@@ -1594,26 +2001,6 @@ var init_lib = __esm({
|
|
1594
2001
|
});
|
1595
2002
|
status.dirty();
|
1596
2003
|
}
|
1597
|
-
} else if (check.kind === "cuid2") {
|
1598
|
-
if (!cuid2Regex.test(input.data)) {
|
1599
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1600
|
-
addIssueToContext(ctx, {
|
1601
|
-
validation: "cuid2",
|
1602
|
-
code: ZodIssueCode.invalid_string,
|
1603
|
-
message: check.message
|
1604
|
-
});
|
1605
|
-
status.dirty();
|
1606
|
-
}
|
1607
|
-
} else if (check.kind === "ulid") {
|
1608
|
-
if (!ulidRegex.test(input.data)) {
|
1609
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1610
|
-
addIssueToContext(ctx, {
|
1611
|
-
validation: "ulid",
|
1612
|
-
code: ZodIssueCode.invalid_string,
|
1613
|
-
message: check.message
|
1614
|
-
});
|
1615
|
-
status.dirty();
|
1616
|
-
}
|
1617
2004
|
} else if (check.kind === "url") {
|
1618
2005
|
try {
|
1619
2006
|
new URL(input.data);
|
@@ -1640,20 +2027,6 @@ var init_lib = __esm({
|
|
1640
2027
|
}
|
1641
2028
|
} else if (check.kind === "trim") {
|
1642
2029
|
input.data = input.data.trim();
|
1643
|
-
} else if (check.kind === "includes") {
|
1644
|
-
if (!input.data.includes(check.value, check.position)) {
|
1645
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1646
|
-
addIssueToContext(ctx, {
|
1647
|
-
code: ZodIssueCode.invalid_string,
|
1648
|
-
validation: { includes: check.value, position: check.position },
|
1649
|
-
message: check.message
|
1650
|
-
});
|
1651
|
-
status.dirty();
|
1652
|
-
}
|
1653
|
-
} else if (check.kind === "toLowerCase") {
|
1654
|
-
input.data = input.data.toLowerCase();
|
1655
|
-
} else if (check.kind === "toUpperCase") {
|
1656
|
-
input.data = input.data.toUpperCase();
|
1657
2030
|
} else if (check.kind === "startsWith") {
|
1658
2031
|
if (!input.data.startsWith(check.value)) {
|
1659
2032
|
ctx = this._getOrReturnCtx(input, ctx);
|
@@ -1685,71 +2058,12 @@ var init_lib = __esm({
|
|
1685
2058
|
});
|
1686
2059
|
status.dirty();
|
1687
2060
|
}
|
1688
|
-
} else if (check.kind === "date") {
|
1689
|
-
const regex = dateRegex;
|
1690
|
-
if (!regex.test(input.data)) {
|
1691
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1692
|
-
addIssueToContext(ctx, {
|
1693
|
-
code: ZodIssueCode.invalid_string,
|
1694
|
-
validation: "date",
|
1695
|
-
message: check.message
|
1696
|
-
});
|
1697
|
-
status.dirty();
|
1698
|
-
}
|
1699
|
-
} else if (check.kind === "time") {
|
1700
|
-
const regex = timeRegex(check);
|
1701
|
-
if (!regex.test(input.data)) {
|
1702
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1703
|
-
addIssueToContext(ctx, {
|
1704
|
-
code: ZodIssueCode.invalid_string,
|
1705
|
-
validation: "time",
|
1706
|
-
message: check.message
|
1707
|
-
});
|
1708
|
-
status.dirty();
|
1709
|
-
}
|
1710
|
-
} else if (check.kind === "duration") {
|
1711
|
-
if (!durationRegex.test(input.data)) {
|
1712
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1713
|
-
addIssueToContext(ctx, {
|
1714
|
-
validation: "duration",
|
1715
|
-
code: ZodIssueCode.invalid_string,
|
1716
|
-
message: check.message
|
1717
|
-
});
|
1718
|
-
status.dirty();
|
1719
|
-
}
|
1720
|
-
} else if (check.kind === "ip") {
|
1721
|
-
if (!isValidIP(input.data, check.version)) {
|
1722
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1723
|
-
addIssueToContext(ctx, {
|
1724
|
-
validation: "ip",
|
1725
|
-
code: ZodIssueCode.invalid_string,
|
1726
|
-
message: check.message
|
1727
|
-
});
|
1728
|
-
status.dirty();
|
1729
|
-
}
|
1730
|
-
} else if (check.kind === "base64") {
|
1731
|
-
if (!base64Regex.test(input.data)) {
|
1732
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1733
|
-
addIssueToContext(ctx, {
|
1734
|
-
validation: "base64",
|
1735
|
-
code: ZodIssueCode.invalid_string,
|
1736
|
-
message: check.message
|
1737
|
-
});
|
1738
|
-
status.dirty();
|
1739
|
-
}
|
1740
2061
|
} else {
|
1741
2062
|
util.assertNever(check);
|
1742
2063
|
}
|
1743
2064
|
}
|
1744
2065
|
return { status: status.value, value: input.data };
|
1745
2066
|
}
|
1746
|
-
_regex(regex, validation, message) {
|
1747
|
-
return this.refinement((data) => regex.test(data), {
|
1748
|
-
validation,
|
1749
|
-
code: ZodIssueCode.invalid_string,
|
1750
|
-
...errorUtil.errToObj(message)
|
1751
|
-
});
|
1752
|
-
}
|
1753
2067
|
_addCheck(check) {
|
1754
2068
|
return new _ZodString({
|
1755
2069
|
...this._def,
|
@@ -1762,38 +2076,19 @@ var init_lib = __esm({
|
|
1762
2076
|
url(message) {
|
1763
2077
|
return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) });
|
1764
2078
|
}
|
1765
|
-
emoji(message) {
|
1766
|
-
return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) });
|
1767
|
-
}
|
1768
2079
|
uuid(message) {
|
1769
2080
|
return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
|
1770
2081
|
}
|
1771
|
-
nanoid(message) {
|
1772
|
-
return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
|
1773
|
-
}
|
1774
2082
|
cuid(message) {
|
1775
2083
|
return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
|
1776
2084
|
}
|
1777
|
-
cuid2(message) {
|
1778
|
-
return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
|
1779
|
-
}
|
1780
|
-
ulid(message) {
|
1781
|
-
return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
|
1782
|
-
}
|
1783
|
-
base64(message) {
|
1784
|
-
return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
|
1785
|
-
}
|
1786
|
-
ip(options) {
|
1787
|
-
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
|
1788
|
-
}
|
1789
2085
|
datetime(options) {
|
1790
|
-
var _a
|
2086
|
+
var _a;
|
1791
2087
|
if (typeof options === "string") {
|
1792
2088
|
return this._addCheck({
|
1793
2089
|
kind: "datetime",
|
1794
2090
|
precision: null,
|
1795
2091
|
offset: false,
|
1796
|
-
local: false,
|
1797
2092
|
message: options
|
1798
2093
|
});
|
1799
2094
|
}
|
@@ -1801,30 +2096,9 @@ var init_lib = __esm({
|
|
1801
2096
|
kind: "datetime",
|
1802
2097
|
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
1803
2098
|
offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
|
1804
|
-
local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
|
1805
|
-
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
1806
|
-
});
|
1807
|
-
}
|
1808
|
-
date(message) {
|
1809
|
-
return this._addCheck({ kind: "date", message });
|
1810
|
-
}
|
1811
|
-
time(options) {
|
1812
|
-
if (typeof options === "string") {
|
1813
|
-
return this._addCheck({
|
1814
|
-
kind: "time",
|
1815
|
-
precision: null,
|
1816
|
-
message: options
|
1817
|
-
});
|
1818
|
-
}
|
1819
|
-
return this._addCheck({
|
1820
|
-
kind: "time",
|
1821
|
-
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
1822
2099
|
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
1823
2100
|
});
|
1824
2101
|
}
|
1825
|
-
duration(message) {
|
1826
|
-
return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
|
1827
|
-
}
|
1828
2102
|
regex(regex, message) {
|
1829
2103
|
return this._addCheck({
|
1830
2104
|
kind: "regex",
|
@@ -1832,14 +2106,6 @@ var init_lib = __esm({
|
|
1832
2106
|
...errorUtil.errToObj(message)
|
1833
2107
|
});
|
1834
2108
|
}
|
1835
|
-
includes(value, options) {
|
1836
|
-
return this._addCheck({
|
1837
|
-
kind: "includes",
|
1838
|
-
value,
|
1839
|
-
position: options === null || options === void 0 ? void 0 : options.position,
|
1840
|
-
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
1841
|
-
});
|
1842
|
-
}
|
1843
2109
|
startsWith(value, message) {
|
1844
2110
|
return this._addCheck({
|
1845
2111
|
kind: "startsWith",
|
@@ -1875,288 +2141,22 @@ var init_lib = __esm({
|
|
1875
2141
|
...errorUtil.errToObj(message)
|
1876
2142
|
});
|
1877
2143
|
}
|
1878
|
-
/**
|
1879
|
-
* @deprecated Use z.string().min(1) instead.
|
1880
|
-
* @see {@link ZodString.min}
|
1881
|
-
*/
|
1882
|
-
nonempty(message) {
|
1883
|
-
return this.min(1, errorUtil.errToObj(message));
|
1884
|
-
}
|
1885
|
-
trim() {
|
1886
|
-
return new _ZodString({
|
1887
|
-
...this._def,
|
1888
|
-
checks: [...this._def.checks, { kind: "trim" }]
|
1889
|
-
});
|
1890
|
-
}
|
1891
|
-
toLowerCase() {
|
1892
|
-
return new _ZodString({
|
1893
|
-
...this._def,
|
1894
|
-
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
1895
|
-
});
|
1896
|
-
}
|
1897
|
-
toUpperCase() {
|
1898
|
-
return new _ZodString({
|
1899
|
-
...this._def,
|
1900
|
-
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
1901
|
-
});
|
1902
|
-
}
|
1903
2144
|
get isDatetime() {
|
1904
2145
|
return !!this._def.checks.find((ch) => ch.kind === "datetime");
|
1905
2146
|
}
|
1906
|
-
get isDate() {
|
1907
|
-
return !!this._def.checks.find((ch) => ch.kind === "date");
|
1908
|
-
}
|
1909
|
-
get isTime() {
|
1910
|
-
return !!this._def.checks.find((ch) => ch.kind === "time");
|
1911
|
-
}
|
1912
|
-
get isDuration() {
|
1913
|
-
return !!this._def.checks.find((ch) => ch.kind === "duration");
|
1914
|
-
}
|
1915
2147
|
get isEmail() {
|
1916
2148
|
return !!this._def.checks.find((ch) => ch.kind === "email");
|
1917
2149
|
}
|
1918
2150
|
get isURL() {
|
1919
2151
|
return !!this._def.checks.find((ch) => ch.kind === "url");
|
1920
2152
|
}
|
1921
|
-
get isEmoji() {
|
1922
|
-
return !!this._def.checks.find((ch) => ch.kind === "emoji");
|
1923
|
-
}
|
1924
2153
|
get isUUID() {
|
1925
|
-
return !!this._def.checks.find((ch) => ch.kind === "uuid");
|
1926
|
-
}
|
1927
|
-
get isNANOID() {
|
1928
|
-
return !!this._def.checks.find((ch) => ch.kind === "nanoid");
|
1929
|
-
}
|
1930
|
-
get isCUID() {
|
1931
|
-
return !!this._def.checks.find((ch) => ch.kind === "cuid");
|
1932
|
-
}
|
1933
|
-
get isCUID2() {
|
1934
|
-
return !!this._def.checks.find((ch) => ch.kind === "cuid2");
|
1935
|
-
}
|
1936
|
-
get isULID() {
|
1937
|
-
return !!this._def.checks.find((ch) => ch.kind === "ulid");
|
1938
|
-
}
|
1939
|
-
get isIP() {
|
1940
|
-
return !!this._def.checks.find((ch) => ch.kind === "ip");
|
1941
|
-
}
|
1942
|
-
get isBase64() {
|
1943
|
-
return !!this._def.checks.find((ch) => ch.kind === "base64");
|
1944
|
-
}
|
1945
|
-
get minLength() {
|
1946
|
-
let min = null;
|
1947
|
-
for (const ch of this._def.checks) {
|
1948
|
-
if (ch.kind === "min") {
|
1949
|
-
if (min === null || ch.value > min)
|
1950
|
-
min = ch.value;
|
1951
|
-
}
|
1952
|
-
}
|
1953
|
-
return min;
|
1954
|
-
}
|
1955
|
-
get maxLength() {
|
1956
|
-
let max = null;
|
1957
|
-
for (const ch of this._def.checks) {
|
1958
|
-
if (ch.kind === "max") {
|
1959
|
-
if (max === null || ch.value < max)
|
1960
|
-
max = ch.value;
|
1961
|
-
}
|
1962
|
-
}
|
1963
|
-
return max;
|
1964
|
-
}
|
1965
|
-
};
|
1966
|
-
ZodString.create = (params) => {
|
1967
|
-
var _a;
|
1968
|
-
return new ZodString({
|
1969
|
-
checks: [],
|
1970
|
-
typeName: ZodFirstPartyTypeKind.ZodString,
|
1971
|
-
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
1972
|
-
...processCreateParams(params)
|
1973
|
-
});
|
1974
|
-
};
|
1975
|
-
ZodNumber = class _ZodNumber extends ZodType {
|
1976
|
-
constructor() {
|
1977
|
-
super(...arguments);
|
1978
|
-
this.min = this.gte;
|
1979
|
-
this.max = this.lte;
|
1980
|
-
this.step = this.multipleOf;
|
1981
|
-
}
|
1982
|
-
_parse(input) {
|
1983
|
-
if (this._def.coerce) {
|
1984
|
-
input.data = Number(input.data);
|
1985
|
-
}
|
1986
|
-
const parsedType = this._getType(input);
|
1987
|
-
if (parsedType !== ZodParsedType.number) {
|
1988
|
-
const ctx2 = this._getOrReturnCtx(input);
|
1989
|
-
addIssueToContext(ctx2, {
|
1990
|
-
code: ZodIssueCode.invalid_type,
|
1991
|
-
expected: ZodParsedType.number,
|
1992
|
-
received: ctx2.parsedType
|
1993
|
-
});
|
1994
|
-
return INVALID;
|
1995
|
-
}
|
1996
|
-
let ctx = void 0;
|
1997
|
-
const status = new ParseStatus();
|
1998
|
-
for (const check of this._def.checks) {
|
1999
|
-
if (check.kind === "int") {
|
2000
|
-
if (!util.isInteger(input.data)) {
|
2001
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
2002
|
-
addIssueToContext(ctx, {
|
2003
|
-
code: ZodIssueCode.invalid_type,
|
2004
|
-
expected: "integer",
|
2005
|
-
received: "float",
|
2006
|
-
message: check.message
|
2007
|
-
});
|
2008
|
-
status.dirty();
|
2009
|
-
}
|
2010
|
-
} else if (check.kind === "min") {
|
2011
|
-
const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
|
2012
|
-
if (tooSmall) {
|
2013
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
2014
|
-
addIssueToContext(ctx, {
|
2015
|
-
code: ZodIssueCode.too_small,
|
2016
|
-
minimum: check.value,
|
2017
|
-
type: "number",
|
2018
|
-
inclusive: check.inclusive,
|
2019
|
-
exact: false,
|
2020
|
-
message: check.message
|
2021
|
-
});
|
2022
|
-
status.dirty();
|
2023
|
-
}
|
2024
|
-
} else if (check.kind === "max") {
|
2025
|
-
const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
|
2026
|
-
if (tooBig) {
|
2027
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
2028
|
-
addIssueToContext(ctx, {
|
2029
|
-
code: ZodIssueCode.too_big,
|
2030
|
-
maximum: check.value,
|
2031
|
-
type: "number",
|
2032
|
-
inclusive: check.inclusive,
|
2033
|
-
exact: false,
|
2034
|
-
message: check.message
|
2035
|
-
});
|
2036
|
-
status.dirty();
|
2037
|
-
}
|
2038
|
-
} else if (check.kind === "multipleOf") {
|
2039
|
-
if (floatSafeRemainder(input.data, check.value) !== 0) {
|
2040
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
2041
|
-
addIssueToContext(ctx, {
|
2042
|
-
code: ZodIssueCode.not_multiple_of,
|
2043
|
-
multipleOf: check.value,
|
2044
|
-
message: check.message
|
2045
|
-
});
|
2046
|
-
status.dirty();
|
2047
|
-
}
|
2048
|
-
} else if (check.kind === "finite") {
|
2049
|
-
if (!Number.isFinite(input.data)) {
|
2050
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
2051
|
-
addIssueToContext(ctx, {
|
2052
|
-
code: ZodIssueCode.not_finite,
|
2053
|
-
message: check.message
|
2054
|
-
});
|
2055
|
-
status.dirty();
|
2056
|
-
}
|
2057
|
-
} else {
|
2058
|
-
util.assertNever(check);
|
2059
|
-
}
|
2060
|
-
}
|
2061
|
-
return { status: status.value, value: input.data };
|
2062
|
-
}
|
2063
|
-
gte(value, message) {
|
2064
|
-
return this.setLimit("min", value, true, errorUtil.toString(message));
|
2065
|
-
}
|
2066
|
-
gt(value, message) {
|
2067
|
-
return this.setLimit("min", value, false, errorUtil.toString(message));
|
2068
|
-
}
|
2069
|
-
lte(value, message) {
|
2070
|
-
return this.setLimit("max", value, true, errorUtil.toString(message));
|
2071
|
-
}
|
2072
|
-
lt(value, message) {
|
2073
|
-
return this.setLimit("max", value, false, errorUtil.toString(message));
|
2074
|
-
}
|
2075
|
-
setLimit(kind, value, inclusive, message) {
|
2076
|
-
return new _ZodNumber({
|
2077
|
-
...this._def,
|
2078
|
-
checks: [
|
2079
|
-
...this._def.checks,
|
2080
|
-
{
|
2081
|
-
kind,
|
2082
|
-
value,
|
2083
|
-
inclusive,
|
2084
|
-
message: errorUtil.toString(message)
|
2085
|
-
}
|
2086
|
-
]
|
2087
|
-
});
|
2088
|
-
}
|
2089
|
-
_addCheck(check) {
|
2090
|
-
return new _ZodNumber({
|
2091
|
-
...this._def,
|
2092
|
-
checks: [...this._def.checks, check]
|
2093
|
-
});
|
2094
|
-
}
|
2095
|
-
int(message) {
|
2096
|
-
return this._addCheck({
|
2097
|
-
kind: "int",
|
2098
|
-
message: errorUtil.toString(message)
|
2099
|
-
});
|
2100
|
-
}
|
2101
|
-
positive(message) {
|
2102
|
-
return this._addCheck({
|
2103
|
-
kind: "min",
|
2104
|
-
value: 0,
|
2105
|
-
inclusive: false,
|
2106
|
-
message: errorUtil.toString(message)
|
2107
|
-
});
|
2108
|
-
}
|
2109
|
-
negative(message) {
|
2110
|
-
return this._addCheck({
|
2111
|
-
kind: "max",
|
2112
|
-
value: 0,
|
2113
|
-
inclusive: false,
|
2114
|
-
message: errorUtil.toString(message)
|
2115
|
-
});
|
2116
|
-
}
|
2117
|
-
nonpositive(message) {
|
2118
|
-
return this._addCheck({
|
2119
|
-
kind: "max",
|
2120
|
-
value: 0,
|
2121
|
-
inclusive: true,
|
2122
|
-
message: errorUtil.toString(message)
|
2123
|
-
});
|
2124
|
-
}
|
2125
|
-
nonnegative(message) {
|
2126
|
-
return this._addCheck({
|
2127
|
-
kind: "min",
|
2128
|
-
value: 0,
|
2129
|
-
inclusive: true,
|
2130
|
-
message: errorUtil.toString(message)
|
2131
|
-
});
|
2132
|
-
}
|
2133
|
-
multipleOf(value, message) {
|
2134
|
-
return this._addCheck({
|
2135
|
-
kind: "multipleOf",
|
2136
|
-
value,
|
2137
|
-
message: errorUtil.toString(message)
|
2138
|
-
});
|
2139
|
-
}
|
2140
|
-
finite(message) {
|
2141
|
-
return this._addCheck({
|
2142
|
-
kind: "finite",
|
2143
|
-
message: errorUtil.toString(message)
|
2144
|
-
});
|
2154
|
+
return !!this._def.checks.find((ch) => ch.kind === "uuid");
|
2145
2155
|
}
|
2146
|
-
|
2147
|
-
return this.
|
2148
|
-
kind: "min",
|
2149
|
-
inclusive: true,
|
2150
|
-
value: Number.MIN_SAFE_INTEGER,
|
2151
|
-
message: errorUtil.toString(message)
|
2152
|
-
})._addCheck({
|
2153
|
-
kind: "max",
|
2154
|
-
inclusive: true,
|
2155
|
-
value: Number.MAX_SAFE_INTEGER,
|
2156
|
-
message: errorUtil.toString(message)
|
2157
|
-
});
|
2156
|
+
get isCUID() {
|
2157
|
+
return !!this._def.checks.find((ch) => ch.kind === "cuid");
|
2158
2158
|
}
|
2159
|
-
get
|
2159
|
+
get minLength() {
|
2160
2160
|
let min = null;
|
2161
2161
|
for (const ch of this._def.checks) {
|
2162
2162
|
if (ch.kind === "min") {
|
@@ -2166,7 +2166,7 @@ var init_lib = __esm({
|
|
2166
2166
|
}
|
2167
2167
|
return min;
|
2168
2168
|
}
|
2169
|
-
get
|
2169
|
+
get maxLength() {
|
2170
2170
|
let max = null;
|
2171
2171
|
for (const ch of this._def.checks) {
|
2172
2172
|
if (ch.kind === "max") {
|
@@ -2176,49 +2176,33 @@ var init_lib = __esm({
|
|
2176
2176
|
}
|
2177
2177
|
return max;
|
2178
2178
|
}
|
2179
|
-
get isInt() {
|
2180
|
-
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
2181
|
-
}
|
2182
|
-
get isFinite() {
|
2183
|
-
let max = null, min = null;
|
2184
|
-
for (const ch of this._def.checks) {
|
2185
|
-
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
2186
|
-
return true;
|
2187
|
-
} else if (ch.kind === "min") {
|
2188
|
-
if (min === null || ch.value > min)
|
2189
|
-
min = ch.value;
|
2190
|
-
} else if (ch.kind === "max") {
|
2191
|
-
if (max === null || ch.value < max)
|
2192
|
-
max = ch.value;
|
2193
|
-
}
|
2194
|
-
}
|
2195
|
-
return Number.isFinite(min) && Number.isFinite(max);
|
2196
|
-
}
|
2197
2179
|
};
|
2198
|
-
|
2199
|
-
|
2180
|
+
ZodString.create = (params) => {
|
2181
|
+
var _a;
|
2182
|
+
return new ZodString({
|
2200
2183
|
checks: [],
|
2201
|
-
typeName: ZodFirstPartyTypeKind.
|
2202
|
-
coerce: (params === null || params === void 0 ? void 0 : params.coerce)
|
2184
|
+
typeName: ZodFirstPartyTypeKind.ZodString,
|
2185
|
+
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
2203
2186
|
...processCreateParams(params)
|
2204
2187
|
});
|
2205
2188
|
};
|
2206
|
-
|
2189
|
+
ZodNumber = class _ZodNumber extends ZodType {
|
2207
2190
|
constructor() {
|
2208
2191
|
super(...arguments);
|
2209
2192
|
this.min = this.gte;
|
2210
2193
|
this.max = this.lte;
|
2194
|
+
this.step = this.multipleOf;
|
2211
2195
|
}
|
2212
2196
|
_parse(input) {
|
2213
2197
|
if (this._def.coerce) {
|
2214
|
-
input.data =
|
2198
|
+
input.data = Number(input.data);
|
2215
2199
|
}
|
2216
2200
|
const parsedType = this._getType(input);
|
2217
|
-
if (parsedType !== ZodParsedType.
|
2201
|
+
if (parsedType !== ZodParsedType.number) {
|
2218
2202
|
const ctx2 = this._getOrReturnCtx(input);
|
2219
2203
|
addIssueToContext(ctx2, {
|
2220
2204
|
code: ZodIssueCode.invalid_type,
|
2221
|
-
expected: ZodParsedType.
|
2205
|
+
expected: ZodParsedType.number,
|
2222
2206
|
received: ctx2.parsedType
|
2223
2207
|
});
|
2224
2208
|
return INVALID;
|
@@ -2226,15 +2210,27 @@ var init_lib = __esm({
|
|
2226
2210
|
let ctx = void 0;
|
2227
2211
|
const status = new ParseStatus();
|
2228
2212
|
for (const check of this._def.checks) {
|
2229
|
-
if (check.kind === "
|
2213
|
+
if (check.kind === "int") {
|
2214
|
+
if (!util.isInteger(input.data)) {
|
2215
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
2216
|
+
addIssueToContext(ctx, {
|
2217
|
+
code: ZodIssueCode.invalid_type,
|
2218
|
+
expected: "integer",
|
2219
|
+
received: "float",
|
2220
|
+
message: check.message
|
2221
|
+
});
|
2222
|
+
status.dirty();
|
2223
|
+
}
|
2224
|
+
} else if (check.kind === "min") {
|
2230
2225
|
const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
|
2231
2226
|
if (tooSmall) {
|
2232
2227
|
ctx = this._getOrReturnCtx(input, ctx);
|
2233
2228
|
addIssueToContext(ctx, {
|
2234
2229
|
code: ZodIssueCode.too_small,
|
2235
|
-
type: "bigint",
|
2236
2230
|
minimum: check.value,
|
2231
|
+
type: "number",
|
2237
2232
|
inclusive: check.inclusive,
|
2233
|
+
exact: false,
|
2238
2234
|
message: check.message
|
2239
2235
|
});
|
2240
2236
|
status.dirty();
|
@@ -2245,15 +2241,16 @@ var init_lib = __esm({
|
|
2245
2241
|
ctx = this._getOrReturnCtx(input, ctx);
|
2246
2242
|
addIssueToContext(ctx, {
|
2247
2243
|
code: ZodIssueCode.too_big,
|
2248
|
-
type: "bigint",
|
2249
2244
|
maximum: check.value,
|
2245
|
+
type: "number",
|
2250
2246
|
inclusive: check.inclusive,
|
2247
|
+
exact: false,
|
2251
2248
|
message: check.message
|
2252
2249
|
});
|
2253
2250
|
status.dirty();
|
2254
2251
|
}
|
2255
2252
|
} else if (check.kind === "multipleOf") {
|
2256
|
-
if (input.data
|
2253
|
+
if (floatSafeRemainder(input.data, check.value) !== 0) {
|
2257
2254
|
ctx = this._getOrReturnCtx(input, ctx);
|
2258
2255
|
addIssueToContext(ctx, {
|
2259
2256
|
code: ZodIssueCode.not_multiple_of,
|
@@ -2262,6 +2259,15 @@ var init_lib = __esm({
|
|
2262
2259
|
});
|
2263
2260
|
status.dirty();
|
2264
2261
|
}
|
2262
|
+
} else if (check.kind === "finite") {
|
2263
|
+
if (!Number.isFinite(input.data)) {
|
2264
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
2265
|
+
addIssueToContext(ctx, {
|
2266
|
+
code: ZodIssueCode.not_finite,
|
2267
|
+
message: check.message
|
2268
|
+
});
|
2269
|
+
status.dirty();
|
2270
|
+
}
|
2265
2271
|
} else {
|
2266
2272
|
util.assertNever(check);
|
2267
2273
|
}
|
@@ -2281,7 +2287,7 @@ var init_lib = __esm({
|
|
2281
2287
|
return this.setLimit("max", value, false, errorUtil.toString(message));
|
2282
2288
|
}
|
2283
2289
|
setLimit(kind, value, inclusive, message) {
|
2284
|
-
return new
|
2290
|
+
return new _ZodNumber({
|
2285
2291
|
...this._def,
|
2286
2292
|
checks: [
|
2287
2293
|
...this._def.checks,
|
@@ -2295,15 +2301,21 @@ var init_lib = __esm({
|
|
2295
2301
|
});
|
2296
2302
|
}
|
2297
2303
|
_addCheck(check) {
|
2298
|
-
return new
|
2304
|
+
return new _ZodNumber({
|
2299
2305
|
...this._def,
|
2300
2306
|
checks: [...this._def.checks, check]
|
2301
2307
|
});
|
2302
2308
|
}
|
2309
|
+
int(message) {
|
2310
|
+
return this._addCheck({
|
2311
|
+
kind: "int",
|
2312
|
+
message: errorUtil.toString(message)
|
2313
|
+
});
|
2314
|
+
}
|
2303
2315
|
positive(message) {
|
2304
2316
|
return this._addCheck({
|
2305
2317
|
kind: "min",
|
2306
|
-
value:
|
2318
|
+
value: 0,
|
2307
2319
|
inclusive: false,
|
2308
2320
|
message: errorUtil.toString(message)
|
2309
2321
|
});
|
@@ -2311,7 +2323,7 @@ var init_lib = __esm({
|
|
2311
2323
|
negative(message) {
|
2312
2324
|
return this._addCheck({
|
2313
2325
|
kind: "max",
|
2314
|
-
value:
|
2326
|
+
value: 0,
|
2315
2327
|
inclusive: false,
|
2316
2328
|
message: errorUtil.toString(message)
|
2317
2329
|
});
|
@@ -2319,7 +2331,7 @@ var init_lib = __esm({
|
|
2319
2331
|
nonpositive(message) {
|
2320
2332
|
return this._addCheck({
|
2321
2333
|
kind: "max",
|
2322
|
-
value:
|
2334
|
+
value: 0,
|
2323
2335
|
inclusive: true,
|
2324
2336
|
message: errorUtil.toString(message)
|
2325
2337
|
});
|
@@ -2327,7 +2339,7 @@ var init_lib = __esm({
|
|
2327
2339
|
nonnegative(message) {
|
2328
2340
|
return this._addCheck({
|
2329
2341
|
kind: "min",
|
2330
|
-
value:
|
2342
|
+
value: 0,
|
2331
2343
|
inclusive: true,
|
2332
2344
|
message: errorUtil.toString(message)
|
2333
2345
|
});
|
@@ -2339,6 +2351,12 @@ var init_lib = __esm({
|
|
2339
2351
|
message: errorUtil.toString(message)
|
2340
2352
|
});
|
2341
2353
|
}
|
2354
|
+
finite(message) {
|
2355
|
+
return this._addCheck({
|
2356
|
+
kind: "finite",
|
2357
|
+
message: errorUtil.toString(message)
|
2358
|
+
});
|
2359
|
+
}
|
2342
2360
|
get minValue() {
|
2343
2361
|
let min = null;
|
2344
2362
|
for (const ch of this._def.checks) {
|
@@ -2359,11 +2377,39 @@ var init_lib = __esm({
|
|
2359
2377
|
}
|
2360
2378
|
return max;
|
2361
2379
|
}
|
2380
|
+
get isInt() {
|
2381
|
+
return !!this._def.checks.find((ch) => ch.kind === "int");
|
2382
|
+
}
|
2383
|
+
};
|
2384
|
+
ZodNumber.create = (params) => {
|
2385
|
+
return new ZodNumber({
|
2386
|
+
checks: [],
|
2387
|
+
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
2388
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
2389
|
+
...processCreateParams(params)
|
2390
|
+
});
|
2391
|
+
};
|
2392
|
+
ZodBigInt = class extends ZodType {
|
2393
|
+
_parse(input) {
|
2394
|
+
if (this._def.coerce) {
|
2395
|
+
input.data = BigInt(input.data);
|
2396
|
+
}
|
2397
|
+
const parsedType = this._getType(input);
|
2398
|
+
if (parsedType !== ZodParsedType.bigint) {
|
2399
|
+
const ctx = this._getOrReturnCtx(input);
|
2400
|
+
addIssueToContext(ctx, {
|
2401
|
+
code: ZodIssueCode.invalid_type,
|
2402
|
+
expected: ZodParsedType.bigint,
|
2403
|
+
received: ctx.parsedType
|
2404
|
+
});
|
2405
|
+
return INVALID;
|
2406
|
+
}
|
2407
|
+
return OK(input.data);
|
2408
|
+
}
|
2362
2409
|
};
|
2363
2410
|
ZodBigInt.create = (params) => {
|
2364
2411
|
var _a;
|
2365
2412
|
return new ZodBigInt({
|
2366
|
-
checks: [],
|
2367
2413
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
2368
2414
|
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
2369
2415
|
...processCreateParams(params)
|
@@ -2689,13 +2735,13 @@ var init_lib = __esm({
|
|
2689
2735
|
}
|
2690
2736
|
}
|
2691
2737
|
if (ctx.common.async) {
|
2692
|
-
return Promise.all(
|
2738
|
+
return Promise.all(ctx.data.map((item, i) => {
|
2693
2739
|
return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
2694
2740
|
})).then((result2) => {
|
2695
2741
|
return ParseStatus.mergeArray(status, result2);
|
2696
2742
|
});
|
2697
2743
|
}
|
2698
|
-
const result =
|
2744
|
+
const result = ctx.data.map((item, i) => {
|
2699
2745
|
return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
2700
2746
|
});
|
2701
2747
|
return ParseStatus.mergeArray(status, result);
|
@@ -2735,12 +2781,31 @@ var init_lib = __esm({
|
|
2735
2781
|
...processCreateParams(params)
|
2736
2782
|
});
|
2737
2783
|
};
|
2784
|
+
(function(objectUtil2) {
|
2785
|
+
objectUtil2.mergeShapes = (first, second) => {
|
2786
|
+
return {
|
2787
|
+
...first,
|
2788
|
+
...second
|
2789
|
+
// second overwrites first
|
2790
|
+
};
|
2791
|
+
};
|
2792
|
+
})(objectUtil || (objectUtil = {}));
|
2793
|
+
AugmentFactory = (def) => (augmentation) => {
|
2794
|
+
return new ZodObject({
|
2795
|
+
...def,
|
2796
|
+
shape: () => ({
|
2797
|
+
...def.shape(),
|
2798
|
+
...augmentation
|
2799
|
+
})
|
2800
|
+
});
|
2801
|
+
};
|
2738
2802
|
ZodObject = class _ZodObject extends ZodType {
|
2739
2803
|
constructor() {
|
2740
2804
|
super(...arguments);
|
2741
2805
|
this._cached = null;
|
2742
2806
|
this.nonstrict = this.passthrough;
|
2743
|
-
this.augment = this.
|
2807
|
+
this.augment = AugmentFactory(this._def);
|
2808
|
+
this.extend = AugmentFactory(this._def);
|
2744
2809
|
}
|
2745
2810
|
_getCached() {
|
2746
2811
|
if (this._cached !== null)
|
@@ -2821,10 +2886,9 @@ var init_lib = __esm({
|
|
2821
2886
|
const syncPairs = [];
|
2822
2887
|
for (const pair of pairs) {
|
2823
2888
|
const key = await pair.key;
|
2824
|
-
const value = await pair.value;
|
2825
2889
|
syncPairs.push({
|
2826
2890
|
key,
|
2827
|
-
value,
|
2891
|
+
value: await pair.value,
|
2828
2892
|
alwaysSet: pair.alwaysSet
|
2829
2893
|
});
|
2830
2894
|
}
|
@@ -2871,31 +2935,8 @@ var init_lib = __esm({
|
|
2871
2935
|
unknownKeys: "passthrough"
|
2872
2936
|
});
|
2873
2937
|
}
|
2874
|
-
|
2875
|
-
|
2876
|
-
// <Augmentation extends ZodRawShape>(
|
2877
|
-
// augmentation: Augmentation
|
2878
|
-
// ): ZodObject<
|
2879
|
-
// extendShape<ReturnType<Def["shape"]>, Augmentation>,
|
2880
|
-
// Def["unknownKeys"],
|
2881
|
-
// Def["catchall"]
|
2882
|
-
// > => {
|
2883
|
-
// return new ZodObject({
|
2884
|
-
// ...def,
|
2885
|
-
// shape: () => ({
|
2886
|
-
// ...def.shape(),
|
2887
|
-
// ...augmentation,
|
2888
|
-
// }),
|
2889
|
-
// }) as any;
|
2890
|
-
// };
|
2891
|
-
extend(augmentation) {
|
2892
|
-
return new _ZodObject({
|
2893
|
-
...this._def,
|
2894
|
-
shape: () => ({
|
2895
|
-
...this._def.shape(),
|
2896
|
-
...augmentation
|
2897
|
-
})
|
2898
|
-
});
|
2938
|
+
setKey(key, schema3) {
|
2939
|
+
return this.augment({ [key]: schema3 });
|
2899
2940
|
}
|
2900
2941
|
/**
|
2901
2942
|
* Prior to zod@1.0.12 there was a bug in the
|
@@ -2906,73 +2947,11 @@ var init_lib = __esm({
|
|
2906
2947
|
const merged = new _ZodObject({
|
2907
2948
|
unknownKeys: merging._def.unknownKeys,
|
2908
2949
|
catchall: merging._def.catchall,
|
2909
|
-
shape: () => (
|
2910
|
-
...this._def.shape(),
|
2911
|
-
...merging._def.shape()
|
2912
|
-
}),
|
2950
|
+
shape: () => objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
|
2913
2951
|
typeName: ZodFirstPartyTypeKind.ZodObject
|
2914
2952
|
});
|
2915
2953
|
return merged;
|
2916
2954
|
}
|
2917
|
-
// merge<
|
2918
|
-
// Incoming extends AnyZodObject,
|
2919
|
-
// Augmentation extends Incoming["shape"],
|
2920
|
-
// NewOutput extends {
|
2921
|
-
// [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
|
2922
|
-
// ? Augmentation[k]["_output"]
|
2923
|
-
// : k extends keyof Output
|
2924
|
-
// ? Output[k]
|
2925
|
-
// : never;
|
2926
|
-
// },
|
2927
|
-
// NewInput extends {
|
2928
|
-
// [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
|
2929
|
-
// ? Augmentation[k]["_input"]
|
2930
|
-
// : k extends keyof Input
|
2931
|
-
// ? Input[k]
|
2932
|
-
// : never;
|
2933
|
-
// }
|
2934
|
-
// >(
|
2935
|
-
// merging: Incoming
|
2936
|
-
// ): ZodObject<
|
2937
|
-
// extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
|
2938
|
-
// Incoming["_def"]["unknownKeys"],
|
2939
|
-
// Incoming["_def"]["catchall"],
|
2940
|
-
// NewOutput,
|
2941
|
-
// NewInput
|
2942
|
-
// > {
|
2943
|
-
// const merged: any = new ZodObject({
|
2944
|
-
// unknownKeys: merging._def.unknownKeys,
|
2945
|
-
// catchall: merging._def.catchall,
|
2946
|
-
// shape: () =>
|
2947
|
-
// objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
|
2948
|
-
// typeName: ZodFirstPartyTypeKind.ZodObject,
|
2949
|
-
// }) as any;
|
2950
|
-
// return merged;
|
2951
|
-
// }
|
2952
|
-
setKey(key, schema3) {
|
2953
|
-
return this.augment({ [key]: schema3 });
|
2954
|
-
}
|
2955
|
-
// merge<Incoming extends AnyZodObject>(
|
2956
|
-
// merging: Incoming
|
2957
|
-
// ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
|
2958
|
-
// ZodObject<
|
2959
|
-
// extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
|
2960
|
-
// Incoming["_def"]["unknownKeys"],
|
2961
|
-
// Incoming["_def"]["catchall"]
|
2962
|
-
// > {
|
2963
|
-
// // const mergedShape = objectUtil.mergeShapes(
|
2964
|
-
// // this._def.shape(),
|
2965
|
-
// // merging._def.shape()
|
2966
|
-
// // );
|
2967
|
-
// const merged: any = new ZodObject({
|
2968
|
-
// unknownKeys: merging._def.unknownKeys,
|
2969
|
-
// catchall: merging._def.catchall,
|
2970
|
-
// shape: () =>
|
2971
|
-
// objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
|
2972
|
-
// typeName: ZodFirstPartyTypeKind.ZodObject,
|
2973
|
-
// }) as any;
|
2974
|
-
// return merged;
|
2975
|
-
// }
|
2976
2955
|
catchall(index4) {
|
2977
2956
|
return new _ZodObject({
|
2978
2957
|
...this._def,
|
@@ -2981,10 +2960,9 @@ var init_lib = __esm({
|
|
2981
2960
|
}
|
2982
2961
|
pick(mask) {
|
2983
2962
|
const shape = {};
|
2984
|
-
util.objectKeys(mask).
|
2985
|
-
if (
|
2963
|
+
util.objectKeys(mask).map((key) => {
|
2964
|
+
if (this.shape[key])
|
2986
2965
|
shape[key] = this.shape[key];
|
2987
|
-
}
|
2988
2966
|
});
|
2989
2967
|
return new _ZodObject({
|
2990
2968
|
...this._def,
|
@@ -2993,8 +2971,8 @@ var init_lib = __esm({
|
|
2993
2971
|
}
|
2994
2972
|
omit(mask) {
|
2995
2973
|
const shape = {};
|
2996
|
-
util.objectKeys(this.shape).
|
2997
|
-
if (
|
2974
|
+
util.objectKeys(this.shape).map((key) => {
|
2975
|
+
if (util.objectKeys(mask).indexOf(key) === -1) {
|
2998
2976
|
shape[key] = this.shape[key];
|
2999
2977
|
}
|
3000
2978
|
});
|
@@ -3003,22 +2981,29 @@ var init_lib = __esm({
|
|
3003
2981
|
shape: () => shape
|
3004
2982
|
});
|
3005
2983
|
}
|
3006
|
-
/**
|
3007
|
-
* @deprecated
|
3008
|
-
*/
|
3009
2984
|
deepPartial() {
|
3010
2985
|
return deepPartialify(this);
|
3011
2986
|
}
|
3012
2987
|
partial(mask) {
|
3013
2988
|
const newShape = {};
|
3014
|
-
|
3015
|
-
|
3016
|
-
|
3017
|
-
|
3018
|
-
|
2989
|
+
if (mask) {
|
2990
|
+
util.objectKeys(this.shape).map((key) => {
|
2991
|
+
if (util.objectKeys(mask).indexOf(key) === -1) {
|
2992
|
+
newShape[key] = this.shape[key];
|
2993
|
+
} else {
|
2994
|
+
newShape[key] = this.shape[key].optional();
|
2995
|
+
}
|
2996
|
+
});
|
2997
|
+
return new _ZodObject({
|
2998
|
+
...this._def,
|
2999
|
+
shape: () => newShape
|
3000
|
+
});
|
3001
|
+
} else {
|
3002
|
+
for (const key in this.shape) {
|
3003
|
+
const fieldSchema = this.shape[key];
|
3019
3004
|
newShape[key] = fieldSchema.optional();
|
3020
3005
|
}
|
3021
|
-
}
|
3006
|
+
}
|
3022
3007
|
return new _ZodObject({
|
3023
3008
|
...this._def,
|
3024
3009
|
shape: () => newShape
|
@@ -3026,10 +3011,21 @@ var init_lib = __esm({
|
|
3026
3011
|
}
|
3027
3012
|
required(mask) {
|
3028
3013
|
const newShape = {};
|
3029
|
-
|
3030
|
-
|
3031
|
-
|
3032
|
-
|
3014
|
+
if (mask) {
|
3015
|
+
util.objectKeys(this.shape).map((key) => {
|
3016
|
+
if (util.objectKeys(mask).indexOf(key) === -1) {
|
3017
|
+
newShape[key] = this.shape[key];
|
3018
|
+
} else {
|
3019
|
+
const fieldSchema = this.shape[key];
|
3020
|
+
let newField = fieldSchema;
|
3021
|
+
while (newField instanceof ZodOptional) {
|
3022
|
+
newField = newField._def.innerType;
|
3023
|
+
}
|
3024
|
+
newShape[key] = newField;
|
3025
|
+
}
|
3026
|
+
});
|
3027
|
+
} else {
|
3028
|
+
for (const key in this.shape) {
|
3033
3029
|
const fieldSchema = this.shape[key];
|
3034
3030
|
let newField = fieldSchema;
|
3035
3031
|
while (newField instanceof ZodOptional) {
|
@@ -3037,7 +3033,7 @@ var init_lib = __esm({
|
|
3037
3033
|
}
|
3038
3034
|
newShape[key] = newField;
|
3039
3035
|
}
|
3040
|
-
}
|
3036
|
+
}
|
3041
3037
|
return new _ZodObject({
|
3042
3038
|
...this._def,
|
3043
3039
|
shape: () => newShape
|
@@ -3175,25 +3171,15 @@ var init_lib = __esm({
|
|
3175
3171
|
} else if (type instanceof ZodEnum) {
|
3176
3172
|
return type.options;
|
3177
3173
|
} else if (type instanceof ZodNativeEnum) {
|
3178
|
-
return
|
3174
|
+
return Object.keys(type.enum);
|
3179
3175
|
} else if (type instanceof ZodDefault) {
|
3180
3176
|
return getDiscriminator(type._def.innerType);
|
3181
3177
|
} else if (type instanceof ZodUndefined) {
|
3182
3178
|
return [void 0];
|
3183
3179
|
} else if (type instanceof ZodNull) {
|
3184
3180
|
return [null];
|
3185
|
-
} else if (type instanceof ZodOptional) {
|
3186
|
-
return [void 0, ...getDiscriminator(type.unwrap())];
|
3187
|
-
} else if (type instanceof ZodNullable) {
|
3188
|
-
return [null, ...getDiscriminator(type.unwrap())];
|
3189
|
-
} else if (type instanceof ZodBranded) {
|
3190
|
-
return getDiscriminator(type.unwrap());
|
3191
|
-
} else if (type instanceof ZodReadonly) {
|
3192
|
-
return getDiscriminator(type.unwrap());
|
3193
|
-
} else if (type instanceof ZodCatch) {
|
3194
|
-
return getDiscriminator(type._def.innerType);
|
3195
3181
|
} else {
|
3196
|
-
return
|
3182
|
+
return null;
|
3197
3183
|
}
|
3198
3184
|
};
|
3199
3185
|
ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
|
@@ -3253,7 +3239,7 @@ var init_lib = __esm({
|
|
3253
3239
|
const optionsMap = /* @__PURE__ */ new Map();
|
3254
3240
|
for (const type of options) {
|
3255
3241
|
const discriminatorValues = getDiscriminator(type.shape[discriminator]);
|
3256
|
-
if (!discriminatorValues
|
3242
|
+
if (!discriminatorValues) {
|
3257
3243
|
throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
|
3258
3244
|
}
|
3259
3245
|
for (const value of discriminatorValues) {
|
@@ -3357,7 +3343,7 @@ var init_lib = __esm({
|
|
3357
3343
|
});
|
3358
3344
|
status.dirty();
|
3359
3345
|
}
|
3360
|
-
const items =
|
3346
|
+
const items = ctx.data.map((item, itemIndex) => {
|
3361
3347
|
const schema3 = this._def.items[itemIndex] || this._def.rest;
|
3362
3348
|
if (!schema3)
|
3363
3349
|
return null;
|
@@ -3415,8 +3401,7 @@ var init_lib = __esm({
|
|
3415
3401
|
for (const key in ctx.data) {
|
3416
3402
|
pairs.push({
|
3417
3403
|
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
|
3418
|
-
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key))
|
3419
|
-
alwaysSet: key in ctx.data
|
3404
|
+
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key))
|
3420
3405
|
});
|
3421
3406
|
}
|
3422
3407
|
if (ctx.common.async) {
|
@@ -3446,12 +3431,6 @@ var init_lib = __esm({
|
|
3446
3431
|
}
|
3447
3432
|
};
|
3448
3433
|
ZodMap = class extends ZodType {
|
3449
|
-
get keySchema() {
|
3450
|
-
return this._def.keyType;
|
3451
|
-
}
|
3452
|
-
get valueSchema() {
|
3453
|
-
return this._def.valueType;
|
3454
|
-
}
|
3455
3434
|
_parse(input) {
|
3456
3435
|
const { status, ctx } = this._processInputParams(input);
|
3457
3436
|
if (ctx.parsedType !== ZodParsedType.map) {
|
@@ -3646,29 +3625,27 @@ var init_lib = __esm({
|
|
3646
3625
|
const params = { errorMap: ctx.common.contextualErrorMap };
|
3647
3626
|
const fn = ctx.data;
|
3648
3627
|
if (this._def.returns instanceof ZodPromise) {
|
3649
|
-
|
3650
|
-
return OK(async function(...args) {
|
3628
|
+
return OK(async (...args) => {
|
3651
3629
|
const error2 = new ZodError([]);
|
3652
|
-
const parsedArgs = await
|
3630
|
+
const parsedArgs = await this._def.args.parseAsync(args, params).catch((e) => {
|
3653
3631
|
error2.addIssue(makeArgsIssue(args, e));
|
3654
3632
|
throw error2;
|
3655
3633
|
});
|
3656
|
-
const result = await
|
3657
|
-
const parsedReturns = await
|
3634
|
+
const result = await fn(...parsedArgs);
|
3635
|
+
const parsedReturns = await this._def.returns._def.type.parseAsync(result, params).catch((e) => {
|
3658
3636
|
error2.addIssue(makeReturnsIssue(result, e));
|
3659
3637
|
throw error2;
|
3660
3638
|
});
|
3661
3639
|
return parsedReturns;
|
3662
3640
|
});
|
3663
3641
|
} else {
|
3664
|
-
|
3665
|
-
|
3666
|
-
const parsedArgs = me._def.args.safeParse(args, params);
|
3642
|
+
return OK((...args) => {
|
3643
|
+
const parsedArgs = this._def.args.safeParse(args, params);
|
3667
3644
|
if (!parsedArgs.success) {
|
3668
3645
|
throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
3669
3646
|
}
|
3670
|
-
const result =
|
3671
|
-
const parsedReturns =
|
3647
|
+
const result = fn(...parsedArgs.data);
|
3648
|
+
const parsedReturns = this._def.returns.safeParse(result, params);
|
3672
3649
|
if (!parsedReturns.success) {
|
3673
3650
|
throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
|
3674
3651
|
}
|
@@ -3733,7 +3710,6 @@ var init_lib = __esm({
|
|
3733
3710
|
if (input.data !== this._def.value) {
|
3734
3711
|
const ctx = this._getOrReturnCtx(input);
|
3735
3712
|
addIssueToContext(ctx, {
|
3736
|
-
received: ctx.data,
|
3737
3713
|
code: ZodIssueCode.invalid_literal,
|
3738
3714
|
expected: this._def.value
|
3739
3715
|
});
|
@@ -3752,11 +3728,7 @@ var init_lib = __esm({
|
|
3752
3728
|
...processCreateParams(params)
|
3753
3729
|
});
|
3754
3730
|
};
|
3755
|
-
ZodEnum = class
|
3756
|
-
constructor() {
|
3757
|
-
super(...arguments);
|
3758
|
-
_ZodEnum_cache.set(this, void 0);
|
3759
|
-
}
|
3731
|
+
ZodEnum = class extends ZodType {
|
3760
3732
|
_parse(input) {
|
3761
3733
|
if (typeof input.data !== "string") {
|
3762
3734
|
const ctx = this._getOrReturnCtx(input);
|
@@ -3768,10 +3740,7 @@ var init_lib = __esm({
|
|
3768
3740
|
});
|
3769
3741
|
return INVALID;
|
3770
3742
|
}
|
3771
|
-
if (
|
3772
|
-
__classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
|
3773
|
-
}
|
3774
|
-
if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
|
3743
|
+
if (this._def.values.indexOf(input.data) === -1) {
|
3775
3744
|
const ctx = this._getOrReturnCtx(input);
|
3776
3745
|
const expectedValues = this._def.values;
|
3777
3746
|
addIssueToContext(ctx, {
|
@@ -3807,26 +3776,9 @@ var init_lib = __esm({
|
|
3807
3776
|
}
|
3808
3777
|
return enumValues;
|
3809
3778
|
}
|
3810
|
-
extract(values, newDef = this._def) {
|
3811
|
-
return _ZodEnum.create(values, {
|
3812
|
-
...this._def,
|
3813
|
-
...newDef
|
3814
|
-
});
|
3815
|
-
}
|
3816
|
-
exclude(values, newDef = this._def) {
|
3817
|
-
return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
|
3818
|
-
...this._def,
|
3819
|
-
...newDef
|
3820
|
-
});
|
3821
|
-
}
|
3822
3779
|
};
|
3823
|
-
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
3824
3780
|
ZodEnum.create = createZodEnum;
|
3825
3781
|
ZodNativeEnum = class extends ZodType {
|
3826
|
-
constructor() {
|
3827
|
-
super(...arguments);
|
3828
|
-
_ZodNativeEnum_cache.set(this, void 0);
|
3829
|
-
}
|
3830
3782
|
_parse(input) {
|
3831
3783
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
3832
3784
|
const ctx = this._getOrReturnCtx(input);
|
@@ -3839,10 +3791,7 @@ var init_lib = __esm({
|
|
3839
3791
|
});
|
3840
3792
|
return INVALID;
|
3841
3793
|
}
|
3842
|
-
if (
|
3843
|
-
__classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
|
3844
|
-
}
|
3845
|
-
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
|
3794
|
+
if (nativeEnumValues.indexOf(input.data) === -1) {
|
3846
3795
|
const expectedValues = util.objectValues(nativeEnumValues);
|
3847
3796
|
addIssueToContext(ctx, {
|
3848
3797
|
received: ctx.data,
|
@@ -3857,7 +3806,6 @@ var init_lib = __esm({
|
|
3857
3806
|
return this._def.values;
|
3858
3807
|
}
|
3859
3808
|
};
|
3860
|
-
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
3861
3809
|
ZodNativeEnum.create = (values, params) => {
|
3862
3810
|
return new ZodNativeEnum({
|
3863
3811
|
values,
|
@@ -3866,9 +3814,6 @@ var init_lib = __esm({
|
|
3866
3814
|
});
|
3867
3815
|
};
|
3868
3816
|
ZodPromise = class extends ZodType {
|
3869
|
-
unwrap() {
|
3870
|
-
return this._def.type;
|
3871
|
-
}
|
3872
3817
|
_parse(input) {
|
3873
3818
|
const { ctx } = this._processInputParams(input);
|
3874
3819
|
if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
|
@@ -3905,56 +3850,38 @@ var init_lib = __esm({
|
|
3905
3850
|
_parse(input) {
|
3906
3851
|
const { status, ctx } = this._processInputParams(input);
|
3907
3852
|
const effect = this._def.effect || null;
|
3908
|
-
const checkCtx = {
|
3909
|
-
addIssue: (arg) => {
|
3910
|
-
addIssueToContext(ctx, arg);
|
3911
|
-
if (arg.fatal) {
|
3912
|
-
status.abort();
|
3913
|
-
} else {
|
3914
|
-
status.dirty();
|
3915
|
-
}
|
3916
|
-
},
|
3917
|
-
get path() {
|
3918
|
-
return ctx.path;
|
3919
|
-
}
|
3920
|
-
};
|
3921
|
-
checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
|
3922
3853
|
if (effect.type === "preprocess") {
|
3923
|
-
const processed = effect.transform(ctx.data
|
3854
|
+
const processed = effect.transform(ctx.data);
|
3924
3855
|
if (ctx.common.async) {
|
3925
|
-
return Promise.resolve(processed).then(
|
3926
|
-
|
3927
|
-
return INVALID;
|
3928
|
-
const result = await this._def.schema._parseAsync({
|
3856
|
+
return Promise.resolve(processed).then((processed2) => {
|
3857
|
+
return this._def.schema._parseAsync({
|
3929
3858
|
data: processed2,
|
3930
3859
|
path: ctx.path,
|
3931
3860
|
parent: ctx
|
3932
3861
|
});
|
3933
|
-
if (result.status === "aborted")
|
3934
|
-
return INVALID;
|
3935
|
-
if (result.status === "dirty")
|
3936
|
-
return DIRTY(result.value);
|
3937
|
-
if (status.value === "dirty")
|
3938
|
-
return DIRTY(result.value);
|
3939
|
-
return result;
|
3940
3862
|
});
|
3941
3863
|
} else {
|
3942
|
-
|
3943
|
-
return INVALID;
|
3944
|
-
const result = this._def.schema._parseSync({
|
3864
|
+
return this._def.schema._parseSync({
|
3945
3865
|
data: processed,
|
3946
3866
|
path: ctx.path,
|
3947
3867
|
parent: ctx
|
3948
3868
|
});
|
3949
|
-
if (result.status === "aborted")
|
3950
|
-
return INVALID;
|
3951
|
-
if (result.status === "dirty")
|
3952
|
-
return DIRTY(result.value);
|
3953
|
-
if (status.value === "dirty")
|
3954
|
-
return DIRTY(result.value);
|
3955
|
-
return result;
|
3956
3869
|
}
|
3957
3870
|
}
|
3871
|
+
const checkCtx = {
|
3872
|
+
addIssue: (arg) => {
|
3873
|
+
addIssueToContext(ctx, arg);
|
3874
|
+
if (arg.fatal) {
|
3875
|
+
status.abort();
|
3876
|
+
} else {
|
3877
|
+
status.dirty();
|
3878
|
+
}
|
3879
|
+
},
|
3880
|
+
get path() {
|
3881
|
+
return ctx.path;
|
3882
|
+
}
|
3883
|
+
};
|
3884
|
+
checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
|
3958
3885
|
if (effect.type === "refinement") {
|
3959
3886
|
const executeRefinement = (acc) => {
|
3960
3887
|
const result = effect.refinement(acc, checkCtx);
|
@@ -4097,45 +4024,26 @@ var init_lib = __esm({
|
|
4097
4024
|
ZodCatch = class extends ZodType {
|
4098
4025
|
_parse(input) {
|
4099
4026
|
const { ctx } = this._processInputParams(input);
|
4100
|
-
const newCtx = {
|
4101
|
-
...ctx,
|
4102
|
-
common: {
|
4103
|
-
...ctx.common,
|
4104
|
-
issues: []
|
4105
|
-
}
|
4106
|
-
};
|
4107
4027
|
const result = this._def.innerType._parse({
|
4108
|
-
data:
|
4109
|
-
path:
|
4110
|
-
parent:
|
4111
|
-
...newCtx
|
4112
|
-
}
|
4028
|
+
data: ctx.data,
|
4029
|
+
path: ctx.path,
|
4030
|
+
parent: ctx
|
4113
4031
|
});
|
4114
4032
|
if (isAsync(result)) {
|
4115
4033
|
return result.then((result2) => {
|
4116
4034
|
return {
|
4117
4035
|
status: "valid",
|
4118
|
-
value: result2.status === "valid" ? result2.value : this._def.
|
4119
|
-
get error() {
|
4120
|
-
return new ZodError(newCtx.common.issues);
|
4121
|
-
},
|
4122
|
-
input: newCtx.data
|
4123
|
-
})
|
4036
|
+
value: result2.status === "valid" ? result2.value : this._def.defaultValue()
|
4124
4037
|
};
|
4125
4038
|
});
|
4126
4039
|
} else {
|
4127
4040
|
return {
|
4128
4041
|
status: "valid",
|
4129
|
-
value: result.status === "valid" ? result.value : this._def.
|
4130
|
-
get error() {
|
4131
|
-
return new ZodError(newCtx.common.issues);
|
4132
|
-
},
|
4133
|
-
input: newCtx.data
|
4134
|
-
})
|
4042
|
+
value: result.status === "valid" ? result.value : this._def.defaultValue()
|
4135
4043
|
};
|
4136
4044
|
}
|
4137
4045
|
}
|
4138
|
-
|
4046
|
+
removeDefault() {
|
4139
4047
|
return this._def.innerType;
|
4140
4048
|
}
|
4141
4049
|
};
|
@@ -4143,7 +4051,7 @@ var init_lib = __esm({
|
|
4143
4051
|
return new ZodCatch({
|
4144
4052
|
innerType: type,
|
4145
4053
|
typeName: ZodFirstPartyTypeKind.ZodCatch,
|
4146
|
-
|
4054
|
+
defaultValue: typeof params.default === "function" ? params.default : () => params.default,
|
4147
4055
|
...processCreateParams(params)
|
4148
4056
|
});
|
4149
4057
|
};
|
@@ -4238,25 +4146,6 @@ var init_lib = __esm({
|
|
4238
4146
|
});
|
4239
4147
|
}
|
4240
4148
|
};
|
4241
|
-
ZodReadonly = class extends ZodType {
|
4242
|
-
_parse(input) {
|
4243
|
-
const result = this._def.innerType._parse(input);
|
4244
|
-
if (isValid(result)) {
|
4245
|
-
result.value = Object.freeze(result.value);
|
4246
|
-
}
|
4247
|
-
return result;
|
4248
|
-
}
|
4249
|
-
unwrap() {
|
4250
|
-
return this._def.innerType;
|
4251
|
-
}
|
4252
|
-
};
|
4253
|
-
ZodReadonly.create = (type, params) => {
|
4254
|
-
return new ZodReadonly({
|
4255
|
-
innerType: type,
|
4256
|
-
typeName: ZodFirstPartyTypeKind.ZodReadonly,
|
4257
|
-
...processCreateParams(params)
|
4258
|
-
});
|
4259
|
-
};
|
4260
4149
|
late = {
|
4261
4150
|
object: ZodObject.lazycreate
|
4262
4151
|
};
|
@@ -4296,7 +4185,6 @@ var init_lib = __esm({
|
|
4296
4185
|
ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise";
|
4297
4186
|
ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded";
|
4298
4187
|
ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
|
4299
|
-
ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
|
4300
4188
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
4301
4189
|
stringType = ZodString.create;
|
4302
4190
|
numberType = ZodNumber.create;
|
@@ -4336,7 +4224,7 @@ var init_lib = __esm({
|
|
4336
4224
|
});
|
4337
4225
|
|
4338
4226
|
// src/serializer/mysqlSchema.ts
|
4339
|
-
var index, fk, column, tableV3, compositePK, uniqueConstraint, tableV4, table, kitInternals, dialect, schemaHash, schemaInternalV3, schemaInternalV4, schemaInternalV5,
|
4227
|
+
var index, fk, column, tableV3, compositePK, uniqueConstraint, tableV4, table, kitInternals, dialect, schemaHash, schemaInternalV3, schemaInternalV4, schemaInternalV5, schemaInternal, schemaV3, schemaV4, schemaV5, schema, tableSquashedV4, tableSquashed, schemaSquashed, schemaSquashedV4, mysqlSchema, mysqlSchemaV5, backwardCompatibleMysqlSchema, dryMySql;
|
4340
4228
|
var init_mysqlSchema = __esm({
|
4341
4229
|
"src/serializer/mysqlSchema.ts"() {
|
4342
4230
|
"use strict";
|
@@ -4436,18 +4324,8 @@ var init_mysqlSchema = __esm({
|
|
4436
4324
|
}),
|
4437
4325
|
internal: kitInternals
|
4438
4326
|
}).strict();
|
4439
|
-
schemaInternalV6 = objectType({
|
4440
|
-
version: literalType("6"),
|
4441
|
-
dialect,
|
4442
|
-
tables: recordType(stringType(), table),
|
4443
|
-
_meta: objectType({
|
4444
|
-
tables: recordType(stringType(), stringType()),
|
4445
|
-
columns: recordType(stringType(), stringType())
|
4446
|
-
}),
|
4447
|
-
internal: kitInternals
|
4448
|
-
}).strict();
|
4449
4327
|
schemaInternal = objectType({
|
4450
|
-
version: literalType("
|
4328
|
+
version: literalType("5"),
|
4451
4329
|
dialect,
|
4452
4330
|
tables: recordType(stringType(), table),
|
4453
4331
|
_meta: objectType({
|
@@ -4476,7 +4354,7 @@ var init_mysqlSchema = __esm({
|
|
4476
4354
|
uniqueConstraints: recordType(stringType(), stringType()).default({})
|
4477
4355
|
}).strict();
|
4478
4356
|
schemaSquashed = objectType({
|
4479
|
-
version: literalType("
|
4357
|
+
version: literalType("5"),
|
4480
4358
|
dialect,
|
4481
4359
|
tables: recordType(stringType(), tableSquashed)
|
4482
4360
|
}).strict();
|
@@ -4490,7 +4368,7 @@ var init_mysqlSchema = __esm({
|
|
4490
4368
|
mysqlSchemaV5 = schemaV5;
|
4491
4369
|
backwardCompatibleMysqlSchema = unionType([mysqlSchemaV5, schema]);
|
4492
4370
|
dryMySql = mysqlSchema.parse({
|
4493
|
-
version:
|
4371
|
+
version: "5",
|
4494
4372
|
dialect: "mysql",
|
4495
4373
|
id: originUUID,
|
4496
4374
|
prevId: "",
|
@@ -4873,6 +4751,7 @@ var init_utils = __esm({
|
|
4873
4751
|
init_mysqlSchema();
|
4874
4752
|
init_pgSchema();
|
4875
4753
|
init_sqliteSchema();
|
4754
|
+
init_source();
|
4876
4755
|
init_global();
|
4877
4756
|
}
|
4878
4757
|
});
|
@@ -4882,14 +4761,15 @@ var import_hanji;
|
|
4882
4761
|
var init_views = __esm({
|
4883
4762
|
"src/cli/views.ts"() {
|
4884
4763
|
"use strict";
|
4764
|
+
init_source();
|
4885
4765
|
import_hanji = __toESM(require_hanji());
|
4886
4766
|
init_utils();
|
4887
4767
|
}
|
4888
4768
|
});
|
4889
4769
|
|
4890
|
-
// node_modules/.pnpm/semver@7.
|
4770
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/constants.js
|
4891
4771
|
var require_constants = __commonJS({
|
4892
|
-
"node_modules/.pnpm/semver@7.
|
4772
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/constants.js"(exports, module) {
|
4893
4773
|
var SEMVER_SPEC_VERSION = "2.0.0";
|
4894
4774
|
var MAX_LENGTH = 256;
|
4895
4775
|
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
@@ -4918,18 +4798,18 @@ var require_constants = __commonJS({
|
|
4918
4798
|
}
|
4919
4799
|
});
|
4920
4800
|
|
4921
|
-
// node_modules/.pnpm/semver@7.
|
4801
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/debug.js
|
4922
4802
|
var require_debug = __commonJS({
|
4923
|
-
"node_modules/.pnpm/semver@7.
|
4803
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/debug.js"(exports, module) {
|
4924
4804
|
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
4925
4805
|
};
|
4926
4806
|
module.exports = debug;
|
4927
4807
|
}
|
4928
4808
|
});
|
4929
4809
|
|
4930
|
-
// node_modules/.pnpm/semver@7.
|
4810
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/re.js
|
4931
4811
|
var require_re = __commonJS({
|
4932
|
-
"node_modules/.pnpm/semver@7.
|
4812
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/re.js"(exports, module) {
|
4933
4813
|
var {
|
4934
4814
|
MAX_SAFE_COMPONENT_LENGTH,
|
4935
4815
|
MAX_SAFE_BUILD_LENGTH,
|
@@ -4985,11 +4865,8 @@ var require_re = __commonJS({
|
|
4985
4865
|
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
4986
4866
|
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
4987
4867
|
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
4988
|
-
createToken("
|
4989
|
-
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
4990
|
-
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
4868
|
+
createToken("COERCE", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:$|[^\\d])`);
|
4991
4869
|
createToken("COERCERTL", src[t.COERCE], true);
|
4992
|
-
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
4993
4870
|
createToken("LONETILDE", "(?:~>?)");
|
4994
4871
|
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
4995
4872
|
exports.tildeTrimReplace = "$1~";
|
@@ -5012,9 +4889,9 @@ var require_re = __commonJS({
|
|
5012
4889
|
}
|
5013
4890
|
});
|
5014
4891
|
|
5015
|
-
// node_modules/.pnpm/semver@7.
|
4892
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/parse-options.js
|
5016
4893
|
var require_parse_options = __commonJS({
|
5017
|
-
"node_modules/.pnpm/semver@7.
|
4894
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/parse-options.js"(exports, module) {
|
5018
4895
|
var looseOption = Object.freeze({ loose: true });
|
5019
4896
|
var emptyOpts = Object.freeze({});
|
5020
4897
|
var parseOptions = (options) => {
|
@@ -5030,9 +4907,9 @@ var require_parse_options = __commonJS({
|
|
5030
4907
|
}
|
5031
4908
|
});
|
5032
4909
|
|
5033
|
-
// node_modules/.pnpm/semver@7.
|
4910
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/identifiers.js
|
5034
4911
|
var require_identifiers = __commonJS({
|
5035
|
-
"node_modules/.pnpm/semver@7.
|
4912
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/identifiers.js"(exports, module) {
|
5036
4913
|
var numeric = /^[0-9]+$/;
|
5037
4914
|
var compareIdentifiers = (a, b) => {
|
5038
4915
|
const anum = numeric.test(a);
|
@@ -5051,9 +4928,9 @@ var require_identifiers = __commonJS({
|
|
5051
4928
|
}
|
5052
4929
|
});
|
5053
4930
|
|
5054
|
-
// node_modules/.pnpm/semver@7.
|
4931
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/semver.js
|
5055
4932
|
var require_semver = __commonJS({
|
5056
|
-
"node_modules/.pnpm/semver@7.
|
4933
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/semver.js"(exports, module) {
|
5057
4934
|
var debug = require_debug();
|
5058
4935
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
5059
4936
|
var { safeRe: re, t } = require_re();
|
@@ -5293,9 +5170,9 @@ var require_semver = __commonJS({
|
|
5293
5170
|
}
|
5294
5171
|
});
|
5295
5172
|
|
5296
|
-
// node_modules/.pnpm/semver@7.
|
5173
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/parse.js
|
5297
5174
|
var require_parse = __commonJS({
|
5298
|
-
"node_modules/.pnpm/semver@7.
|
5175
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/parse.js"(exports, module) {
|
5299
5176
|
var SemVer = require_semver();
|
5300
5177
|
var parse = (version, options, throwErrors = false) => {
|
5301
5178
|
if (version instanceof SemVer) {
|
@@ -5314,9 +5191,9 @@ var require_parse = __commonJS({
|
|
5314
5191
|
}
|
5315
5192
|
});
|
5316
5193
|
|
5317
|
-
// node_modules/.pnpm/semver@7.
|
5194
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/valid.js
|
5318
5195
|
var require_valid = __commonJS({
|
5319
|
-
"node_modules/.pnpm/semver@7.
|
5196
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/valid.js"(exports, module) {
|
5320
5197
|
var parse = require_parse();
|
5321
5198
|
var valid = (version, options) => {
|
5322
5199
|
const v = parse(version, options);
|
@@ -5326,9 +5203,9 @@ var require_valid = __commonJS({
|
|
5326
5203
|
}
|
5327
5204
|
});
|
5328
5205
|
|
5329
|
-
// node_modules/.pnpm/semver@7.
|
5206
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/clean.js
|
5330
5207
|
var require_clean = __commonJS({
|
5331
|
-
"node_modules/.pnpm/semver@7.
|
5208
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/clean.js"(exports, module) {
|
5332
5209
|
var parse = require_parse();
|
5333
5210
|
var clean = (version, options) => {
|
5334
5211
|
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
@@ -5338,9 +5215,9 @@ var require_clean = __commonJS({
|
|
5338
5215
|
}
|
5339
5216
|
});
|
5340
5217
|
|
5341
|
-
// node_modules/.pnpm/semver@7.
|
5218
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/inc.js
|
5342
5219
|
var require_inc = __commonJS({
|
5343
|
-
"node_modules/.pnpm/semver@7.
|
5220
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/inc.js"(exports, module) {
|
5344
5221
|
var SemVer = require_semver();
|
5345
5222
|
var inc = (version, release, options, identifier, identifierBase) => {
|
5346
5223
|
if (typeof options === "string") {
|
@@ -5361,9 +5238,9 @@ var require_inc = __commonJS({
|
|
5361
5238
|
}
|
5362
5239
|
});
|
5363
5240
|
|
5364
|
-
// node_modules/.pnpm/semver@7.
|
5241
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/diff.js
|
5365
5242
|
var require_diff = __commonJS({
|
5366
|
-
"node_modules/.pnpm/semver@7.
|
5243
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/diff.js"(exports, module) {
|
5367
5244
|
var parse = require_parse();
|
5368
5245
|
var diff = (version1, version2) => {
|
5369
5246
|
const v1 = parse(version1, null, true);
|
@@ -5405,36 +5282,36 @@ var require_diff = __commonJS({
|
|
5405
5282
|
}
|
5406
5283
|
});
|
5407
5284
|
|
5408
|
-
// node_modules/.pnpm/semver@7.
|
5285
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/major.js
|
5409
5286
|
var require_major = __commonJS({
|
5410
|
-
"node_modules/.pnpm/semver@7.
|
5287
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/major.js"(exports, module) {
|
5411
5288
|
var SemVer = require_semver();
|
5412
5289
|
var major = (a, loose) => new SemVer(a, loose).major;
|
5413
5290
|
module.exports = major;
|
5414
5291
|
}
|
5415
5292
|
});
|
5416
5293
|
|
5417
|
-
// node_modules/.pnpm/semver@7.
|
5294
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/minor.js
|
5418
5295
|
var require_minor = __commonJS({
|
5419
|
-
"node_modules/.pnpm/semver@7.
|
5296
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/minor.js"(exports, module) {
|
5420
5297
|
var SemVer = require_semver();
|
5421
5298
|
var minor = (a, loose) => new SemVer(a, loose).minor;
|
5422
5299
|
module.exports = minor;
|
5423
5300
|
}
|
5424
5301
|
});
|
5425
5302
|
|
5426
|
-
// node_modules/.pnpm/semver@7.
|
5303
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/patch.js
|
5427
5304
|
var require_patch = __commonJS({
|
5428
|
-
"node_modules/.pnpm/semver@7.
|
5305
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/patch.js"(exports, module) {
|
5429
5306
|
var SemVer = require_semver();
|
5430
5307
|
var patch = (a, loose) => new SemVer(a, loose).patch;
|
5431
5308
|
module.exports = patch;
|
5432
5309
|
}
|
5433
5310
|
});
|
5434
5311
|
|
5435
|
-
// node_modules/.pnpm/semver@7.
|
5312
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/prerelease.js
|
5436
5313
|
var require_prerelease = __commonJS({
|
5437
|
-
"node_modules/.pnpm/semver@7.
|
5314
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/prerelease.js"(exports, module) {
|
5438
5315
|
var parse = require_parse();
|
5439
5316
|
var prerelease = (version, options) => {
|
5440
5317
|
const parsed = parse(version, options);
|
@@ -5444,36 +5321,36 @@ var require_prerelease = __commonJS({
|
|
5444
5321
|
}
|
5445
5322
|
});
|
5446
5323
|
|
5447
|
-
// node_modules/.pnpm/semver@7.
|
5324
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare.js
|
5448
5325
|
var require_compare = __commonJS({
|
5449
|
-
"node_modules/.pnpm/semver@7.
|
5326
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare.js"(exports, module) {
|
5450
5327
|
var SemVer = require_semver();
|
5451
5328
|
var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
5452
5329
|
module.exports = compare;
|
5453
5330
|
}
|
5454
5331
|
});
|
5455
5332
|
|
5456
|
-
// node_modules/.pnpm/semver@7.
|
5333
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/rcompare.js
|
5457
5334
|
var require_rcompare = __commonJS({
|
5458
|
-
"node_modules/.pnpm/semver@7.
|
5335
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/rcompare.js"(exports, module) {
|
5459
5336
|
var compare = require_compare();
|
5460
5337
|
var rcompare = (a, b, loose) => compare(b, a, loose);
|
5461
5338
|
module.exports = rcompare;
|
5462
5339
|
}
|
5463
5340
|
});
|
5464
5341
|
|
5465
|
-
// node_modules/.pnpm/semver@7.
|
5342
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare-loose.js
|
5466
5343
|
var require_compare_loose = __commonJS({
|
5467
|
-
"node_modules/.pnpm/semver@7.
|
5344
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare-loose.js"(exports, module) {
|
5468
5345
|
var compare = require_compare();
|
5469
5346
|
var compareLoose = (a, b) => compare(a, b, true);
|
5470
5347
|
module.exports = compareLoose;
|
5471
5348
|
}
|
5472
5349
|
});
|
5473
5350
|
|
5474
|
-
// node_modules/.pnpm/semver@7.
|
5351
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare-build.js
|
5475
5352
|
var require_compare_build = __commonJS({
|
5476
|
-
"node_modules/.pnpm/semver@7.
|
5353
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare-build.js"(exports, module) {
|
5477
5354
|
var SemVer = require_semver();
|
5478
5355
|
var compareBuild = (a, b, loose) => {
|
5479
5356
|
const versionA = new SemVer(a, loose);
|
@@ -5484,81 +5361,81 @@ var require_compare_build = __commonJS({
|
|
5484
5361
|
}
|
5485
5362
|
});
|
5486
5363
|
|
5487
|
-
// node_modules/.pnpm/semver@7.
|
5364
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/sort.js
|
5488
5365
|
var require_sort = __commonJS({
|
5489
|
-
"node_modules/.pnpm/semver@7.
|
5366
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/sort.js"(exports, module) {
|
5490
5367
|
var compareBuild = require_compare_build();
|
5491
5368
|
var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
5492
5369
|
module.exports = sort;
|
5493
5370
|
}
|
5494
5371
|
});
|
5495
5372
|
|
5496
|
-
// node_modules/.pnpm/semver@7.
|
5373
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/rsort.js
|
5497
5374
|
var require_rsort = __commonJS({
|
5498
|
-
"node_modules/.pnpm/semver@7.
|
5375
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/rsort.js"(exports, module) {
|
5499
5376
|
var compareBuild = require_compare_build();
|
5500
5377
|
var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
5501
5378
|
module.exports = rsort;
|
5502
5379
|
}
|
5503
5380
|
});
|
5504
5381
|
|
5505
|
-
// node_modules/.pnpm/semver@7.
|
5382
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/gt.js
|
5506
5383
|
var require_gt = __commonJS({
|
5507
|
-
"node_modules/.pnpm/semver@7.
|
5384
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/gt.js"(exports, module) {
|
5508
5385
|
var compare = require_compare();
|
5509
5386
|
var gt = (a, b, loose) => compare(a, b, loose) > 0;
|
5510
5387
|
module.exports = gt;
|
5511
5388
|
}
|
5512
5389
|
});
|
5513
5390
|
|
5514
|
-
// node_modules/.pnpm/semver@7.
|
5391
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/lt.js
|
5515
5392
|
var require_lt = __commonJS({
|
5516
|
-
"node_modules/.pnpm/semver@7.
|
5393
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/lt.js"(exports, module) {
|
5517
5394
|
var compare = require_compare();
|
5518
5395
|
var lt = (a, b, loose) => compare(a, b, loose) < 0;
|
5519
5396
|
module.exports = lt;
|
5520
5397
|
}
|
5521
5398
|
});
|
5522
5399
|
|
5523
|
-
// node_modules/.pnpm/semver@7.
|
5400
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/eq.js
|
5524
5401
|
var require_eq = __commonJS({
|
5525
|
-
"node_modules/.pnpm/semver@7.
|
5402
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/eq.js"(exports, module) {
|
5526
5403
|
var compare = require_compare();
|
5527
5404
|
var eq = (a, b, loose) => compare(a, b, loose) === 0;
|
5528
5405
|
module.exports = eq;
|
5529
5406
|
}
|
5530
5407
|
});
|
5531
5408
|
|
5532
|
-
// node_modules/.pnpm/semver@7.
|
5409
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/neq.js
|
5533
5410
|
var require_neq = __commonJS({
|
5534
|
-
"node_modules/.pnpm/semver@7.
|
5411
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/neq.js"(exports, module) {
|
5535
5412
|
var compare = require_compare();
|
5536
5413
|
var neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
5537
5414
|
module.exports = neq;
|
5538
5415
|
}
|
5539
5416
|
});
|
5540
5417
|
|
5541
|
-
// node_modules/.pnpm/semver@7.
|
5418
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/gte.js
|
5542
5419
|
var require_gte = __commonJS({
|
5543
|
-
"node_modules/.pnpm/semver@7.
|
5420
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/gte.js"(exports, module) {
|
5544
5421
|
var compare = require_compare();
|
5545
5422
|
var gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
5546
5423
|
module.exports = gte;
|
5547
5424
|
}
|
5548
5425
|
});
|
5549
5426
|
|
5550
|
-
// node_modules/.pnpm/semver@7.
|
5427
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/lte.js
|
5551
5428
|
var require_lte = __commonJS({
|
5552
|
-
"node_modules/.pnpm/semver@7.
|
5429
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/lte.js"(exports, module) {
|
5553
5430
|
var compare = require_compare();
|
5554
5431
|
var lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
5555
5432
|
module.exports = lte;
|
5556
5433
|
}
|
5557
5434
|
});
|
5558
5435
|
|
5559
|
-
// node_modules/.pnpm/semver@7.
|
5436
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/cmp.js
|
5560
5437
|
var require_cmp = __commonJS({
|
5561
|
-
"node_modules/.pnpm/semver@7.
|
5438
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/cmp.js"(exports, module) {
|
5562
5439
|
var eq = require_eq();
|
5563
5440
|
var neq = require_neq();
|
5564
5441
|
var gt = require_gt();
|
@@ -5605,9 +5482,9 @@ var require_cmp = __commonJS({
|
|
5605
5482
|
}
|
5606
5483
|
});
|
5607
5484
|
|
5608
|
-
// node_modules/.pnpm/semver@7.
|
5485
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/coerce.js
|
5609
5486
|
var require_coerce = __commonJS({
|
5610
|
-
"node_modules/.pnpm/semver@7.
|
5487
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/coerce.js"(exports, module) {
|
5611
5488
|
var SemVer = require_semver();
|
5612
5489
|
var parse = require_parse();
|
5613
5490
|
var { safeRe: re, t } = require_re();
|
@@ -5624,27 +5501,21 @@ var require_coerce = __commonJS({
|
|
5624
5501
|
options = options || {};
|
5625
5502
|
let match2 = null;
|
5626
5503
|
if (!options.rtl) {
|
5627
|
-
match2 = version.match(
|
5504
|
+
match2 = version.match(re[t.COERCE]);
|
5628
5505
|
} else {
|
5629
|
-
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
5630
5506
|
let next;
|
5631
|
-
while ((next =
|
5507
|
+
while ((next = re[t.COERCERTL].exec(version)) && (!match2 || match2.index + match2[0].length !== version.length)) {
|
5632
5508
|
if (!match2 || next.index + next[0].length !== match2.index + match2[0].length) {
|
5633
5509
|
match2 = next;
|
5634
5510
|
}
|
5635
|
-
|
5511
|
+
re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
|
5636
5512
|
}
|
5637
|
-
|
5513
|
+
re[t.COERCERTL].lastIndex = -1;
|
5638
5514
|
}
|
5639
5515
|
if (match2 === null) {
|
5640
5516
|
return null;
|
5641
5517
|
}
|
5642
|
-
|
5643
|
-
const minor = match2[3] || "0";
|
5644
|
-
const patch = match2[4] || "0";
|
5645
|
-
const prerelease = options.includePrerelease && match2[5] ? `-${match2[5]}` : "";
|
5646
|
-
const build = options.includePrerelease && match2[6] ? `+${match2[6]}` : "";
|
5647
|
-
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
5518
|
+
return parse(`${match2[2]}.${match2[3] || "0"}.${match2[4] || "0"}`, options);
|
5648
5519
|
};
|
5649
5520
|
module.exports = coerce;
|
5650
5521
|
}
|
@@ -6303,9 +6174,9 @@ var require_lru_cache = __commonJS({
|
|
6303
6174
|
}
|
6304
6175
|
});
|
6305
6176
|
|
6306
|
-
// node_modules/.pnpm/semver@7.
|
6177
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/range.js
|
6307
6178
|
var require_range = __commonJS({
|
6308
|
-
"node_modules/.pnpm/semver@7.
|
6179
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/range.js"(exports, module) {
|
6309
6180
|
var Range = class _Range {
|
6310
6181
|
constructor(range, options) {
|
6311
6182
|
options = parseOptions(options);
|
@@ -6660,9 +6531,9 @@ var require_range = __commonJS({
|
|
6660
6531
|
}
|
6661
6532
|
});
|
6662
6533
|
|
6663
|
-
// node_modules/.pnpm/semver@7.
|
6534
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/comparator.js
|
6664
6535
|
var require_comparator = __commonJS({
|
6665
|
-
"node_modules/.pnpm/semver@7.
|
6536
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/comparator.js"(exports, module) {
|
6666
6537
|
var ANY = Symbol("SemVer ANY");
|
6667
6538
|
var Comparator = class _Comparator {
|
6668
6539
|
static get ANY() {
|
@@ -6772,9 +6643,9 @@ var require_comparator = __commonJS({
|
|
6772
6643
|
}
|
6773
6644
|
});
|
6774
6645
|
|
6775
|
-
// node_modules/.pnpm/semver@7.
|
6646
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/satisfies.js
|
6776
6647
|
var require_satisfies = __commonJS({
|
6777
|
-
"node_modules/.pnpm/semver@7.
|
6648
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/satisfies.js"(exports, module) {
|
6778
6649
|
var Range = require_range();
|
6779
6650
|
var satisfies = (version, range, options) => {
|
6780
6651
|
try {
|
@@ -6788,18 +6659,18 @@ var require_satisfies = __commonJS({
|
|
6788
6659
|
}
|
6789
6660
|
});
|
6790
6661
|
|
6791
|
-
// node_modules/.pnpm/semver@7.
|
6662
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/to-comparators.js
|
6792
6663
|
var require_to_comparators = __commonJS({
|
6793
|
-
"node_modules/.pnpm/semver@7.
|
6664
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/to-comparators.js"(exports, module) {
|
6794
6665
|
var Range = require_range();
|
6795
6666
|
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
6796
6667
|
module.exports = toComparators;
|
6797
6668
|
}
|
6798
6669
|
});
|
6799
6670
|
|
6800
|
-
// node_modules/.pnpm/semver@7.
|
6671
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/max-satisfying.js
|
6801
6672
|
var require_max_satisfying = __commonJS({
|
6802
|
-
"node_modules/.pnpm/semver@7.
|
6673
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
|
6803
6674
|
var SemVer = require_semver();
|
6804
6675
|
var Range = require_range();
|
6805
6676
|
var maxSatisfying = (versions, range, options) => {
|
@@ -6825,9 +6696,9 @@ var require_max_satisfying = __commonJS({
|
|
6825
6696
|
}
|
6826
6697
|
});
|
6827
6698
|
|
6828
|
-
// node_modules/.pnpm/semver@7.
|
6699
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/min-satisfying.js
|
6829
6700
|
var require_min_satisfying = __commonJS({
|
6830
|
-
"node_modules/.pnpm/semver@7.
|
6701
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
|
6831
6702
|
var SemVer = require_semver();
|
6832
6703
|
var Range = require_range();
|
6833
6704
|
var minSatisfying = (versions, range, options) => {
|
@@ -6853,9 +6724,9 @@ var require_min_satisfying = __commonJS({
|
|
6853
6724
|
}
|
6854
6725
|
});
|
6855
6726
|
|
6856
|
-
// node_modules/.pnpm/semver@7.
|
6727
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/min-version.js
|
6857
6728
|
var require_min_version = __commonJS({
|
6858
|
-
"node_modules/.pnpm/semver@7.
|
6729
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/min-version.js"(exports, module) {
|
6859
6730
|
var SemVer = require_semver();
|
6860
6731
|
var Range = require_range();
|
6861
6732
|
var gt = require_gt();
|
@@ -6909,9 +6780,9 @@ var require_min_version = __commonJS({
|
|
6909
6780
|
}
|
6910
6781
|
});
|
6911
6782
|
|
6912
|
-
// node_modules/.pnpm/semver@7.
|
6783
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/valid.js
|
6913
6784
|
var require_valid2 = __commonJS({
|
6914
|
-
"node_modules/.pnpm/semver@7.
|
6785
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/valid.js"(exports, module) {
|
6915
6786
|
var Range = require_range();
|
6916
6787
|
var validRange = (range, options) => {
|
6917
6788
|
try {
|
@@ -6924,9 +6795,9 @@ var require_valid2 = __commonJS({
|
|
6924
6795
|
}
|
6925
6796
|
});
|
6926
6797
|
|
6927
|
-
// node_modules/.pnpm/semver@7.
|
6798
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/outside.js
|
6928
6799
|
var require_outside = __commonJS({
|
6929
|
-
"node_modules/.pnpm/semver@7.
|
6800
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/outside.js"(exports, module) {
|
6930
6801
|
var SemVer = require_semver();
|
6931
6802
|
var Comparator = require_comparator();
|
6932
6803
|
var { ANY } = Comparator;
|
@@ -6992,27 +6863,27 @@ var require_outside = __commonJS({
|
|
6992
6863
|
}
|
6993
6864
|
});
|
6994
6865
|
|
6995
|
-
// node_modules/.pnpm/semver@7.
|
6866
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/gtr.js
|
6996
6867
|
var require_gtr = __commonJS({
|
6997
|
-
"node_modules/.pnpm/semver@7.
|
6868
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/gtr.js"(exports, module) {
|
6998
6869
|
var outside = require_outside();
|
6999
6870
|
var gtr = (version, range, options) => outside(version, range, ">", options);
|
7000
6871
|
module.exports = gtr;
|
7001
6872
|
}
|
7002
6873
|
});
|
7003
6874
|
|
7004
|
-
// node_modules/.pnpm/semver@7.
|
6875
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/ltr.js
|
7005
6876
|
var require_ltr = __commonJS({
|
7006
|
-
"node_modules/.pnpm/semver@7.
|
6877
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/ltr.js"(exports, module) {
|
7007
6878
|
var outside = require_outside();
|
7008
6879
|
var ltr = (version, range, options) => outside(version, range, "<", options);
|
7009
6880
|
module.exports = ltr;
|
7010
6881
|
}
|
7011
6882
|
});
|
7012
6883
|
|
7013
|
-
// node_modules/.pnpm/semver@7.
|
6884
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/intersects.js
|
7014
6885
|
var require_intersects = __commonJS({
|
7015
|
-
"node_modules/.pnpm/semver@7.
|
6886
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/intersects.js"(exports, module) {
|
7016
6887
|
var Range = require_range();
|
7017
6888
|
var intersects = (r1, r2, options) => {
|
7018
6889
|
r1 = new Range(r1, options);
|
@@ -7023,9 +6894,9 @@ var require_intersects = __commonJS({
|
|
7023
6894
|
}
|
7024
6895
|
});
|
7025
6896
|
|
7026
|
-
// node_modules/.pnpm/semver@7.
|
6897
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/simplify.js
|
7027
6898
|
var require_simplify = __commonJS({
|
7028
|
-
"node_modules/.pnpm/semver@7.
|
6899
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/simplify.js"(exports, module) {
|
7029
6900
|
var satisfies = require_satisfies();
|
7030
6901
|
var compare = require_compare();
|
7031
6902
|
module.exports = (versions, range, options) => {
|
@@ -7072,9 +6943,9 @@ var require_simplify = __commonJS({
|
|
7072
6943
|
}
|
7073
6944
|
});
|
7074
6945
|
|
7075
|
-
// node_modules/.pnpm/semver@7.
|
6946
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/subset.js
|
7076
6947
|
var require_subset = __commonJS({
|
7077
|
-
"node_modules/.pnpm/semver@7.
|
6948
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/subset.js"(exports, module) {
|
7078
6949
|
var Range = require_range();
|
7079
6950
|
var Comparator = require_comparator();
|
7080
6951
|
var { ANY } = Comparator;
|
@@ -7234,9 +7105,9 @@ var require_subset = __commonJS({
|
|
7234
7105
|
}
|
7235
7106
|
});
|
7236
7107
|
|
7237
|
-
// node_modules/.pnpm/semver@7.
|
7108
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/index.js
|
7238
7109
|
var require_semver2 = __commonJS({
|
7239
|
-
"node_modules/.pnpm/semver@7.
|
7110
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/index.js"(exports, module) {
|
7240
7111
|
var internalRe = require_re();
|
7241
7112
|
var constants = require_constants();
|
7242
7113
|
var SemVer = require_semver();
|
@@ -7333,6 +7204,7 @@ import * as glob from "glob";
|
|
7333
7204
|
var init_serializer = __esm({
|
7334
7205
|
"src/serializer/index.ts"() {
|
7335
7206
|
"use strict";
|
7207
|
+
init_source();
|
7336
7208
|
init_views();
|
7337
7209
|
}
|
7338
7210
|
});
|
@@ -7341,6 +7213,7 @@ var init_serializer = __esm({
|
|
7341
7213
|
var init_outputs = __esm({
|
7342
7214
|
"src/cli/validations/outputs.ts"() {
|
7343
7215
|
"use strict";
|
7216
|
+
init_source();
|
7344
7217
|
}
|
7345
7218
|
});
|
7346
7219
|
|
@@ -7397,6 +7270,7 @@ var init_sqliteSerializer = __esm({
|
|
7397
7270
|
"use strict";
|
7398
7271
|
init_serializer();
|
7399
7272
|
init_outputs();
|
7273
|
+
init_source();
|
7400
7274
|
dialect3 = new SQLiteSyncDialect();
|
7401
7275
|
fromDatabase = async (db, tablesFilter = (table4) => true, progressCallback) => {
|
7402
7276
|
const result = {};
|
@@ -7819,6 +7693,7 @@ var init_pgSerializer = __esm({
|
|
7819
7693
|
"src/serializer/pgSerializer.ts"() {
|
7820
7694
|
"use strict";
|
7821
7695
|
init_serializer();
|
7696
|
+
init_source();
|
7822
7697
|
init_outputs();
|
7823
7698
|
dialect4 = new PgDialect();
|
7824
7699
|
trimChar = (str, char) => {
|
@@ -8537,10 +8412,10 @@ Array.prototype.random = function() {
|
|
8537
8412
|
return this[~~(Math.random() * this.length)];
|
8538
8413
|
};
|
8539
8414
|
|
8540
|
-
// node_modules/.pnpm/minimatch@7.4.
|
8415
|
+
// node_modules/.pnpm/minimatch@7.4.3/node_modules/minimatch/dist/mjs/index.js
|
8541
8416
|
var import_brace_expansion = __toESM(require_brace_expansion(), 1);
|
8542
8417
|
|
8543
|
-
// node_modules/.pnpm/minimatch@7.4.
|
8418
|
+
// node_modules/.pnpm/minimatch@7.4.3/node_modules/minimatch/dist/mjs/brace-expressions.js
|
8544
8419
|
var posixClasses = {
|
8545
8420
|
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
|
8546
8421
|
"[:alpha:]": ["\\p{L}\\p{Nl}", true],
|
@@ -8650,17 +8525,17 @@ var parseClass = (glob2, position) => {
|
|
8650
8525
|
return [comb, uflag, endPos - pos, true];
|
8651
8526
|
};
|
8652
8527
|
|
8653
|
-
// node_modules/.pnpm/minimatch@7.4.
|
8528
|
+
// node_modules/.pnpm/minimatch@7.4.3/node_modules/minimatch/dist/mjs/escape.js
|
8654
8529
|
var escape = (s, { windowsPathsNoEscape = false } = {}) => {
|
8655
8530
|
return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
|
8656
8531
|
};
|
8657
8532
|
|
8658
|
-
// node_modules/.pnpm/minimatch@7.4.
|
8533
|
+
// node_modules/.pnpm/minimatch@7.4.3/node_modules/minimatch/dist/mjs/unescape.js
|
8659
8534
|
var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
|
8660
8535
|
return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
|
8661
8536
|
};
|
8662
8537
|
|
8663
|
-
// node_modules/.pnpm/minimatch@7.4.
|
8538
|
+
// node_modules/.pnpm/minimatch@7.4.3/node_modules/minimatch/dist/mjs/index.js
|
8664
8539
|
var minimatch = (p, pattern, options = {}) => {
|
8665
8540
|
assertValidPattern(pattern);
|
8666
8541
|
if (!options.nocomment && pattern.charAt(0) === "#") {
|