drizzle-kit 0.31.1-581277d → 0.31.1-8bf5193
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.d.mts +24 -24
- package/api.d.ts +24 -24
- package/api.js +525 -326
- package/api.mjs +528 -329
- package/bin.cjs +20836 -20322
- package/package.json +1 -1
- package/utils.js +266 -152
- package/utils.mjs +266 -152
package/api.mjs
CHANGED
@@ -40,7 +40,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
40
40
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
41
41
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
42
42
|
|
43
|
-
// ../node_modules/.pnpm/chalk@5.
|
43
|
+
// ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/ansi-styles/index.js
|
44
44
|
function assembleStyles() {
|
45
45
|
const codes = /* @__PURE__ */ new Map();
|
46
46
|
for (const [groupName, group] of Object.entries(styles)) {
|
@@ -157,7 +157,7 @@ function assembleStyles() {
|
|
157
157
|
}
|
158
158
|
var ANSI_BACKGROUND_OFFSET, wrapAnsi16, wrapAnsi256, wrapAnsi16m, styles, modifierNames, foregroundColorNames, backgroundColorNames, colorNames, ansiStyles, ansi_styles_default;
|
159
159
|
var init_ansi_styles = __esm({
|
160
|
-
"../node_modules/.pnpm/chalk@5.
|
160
|
+
"../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/ansi-styles/index.js"() {
|
161
161
|
"use strict";
|
162
162
|
ANSI_BACKGROUND_OFFSET = 10;
|
163
163
|
wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
@@ -232,10 +232,10 @@ var init_ansi_styles = __esm({
|
|
232
232
|
}
|
233
233
|
});
|
234
234
|
|
235
|
-
// ../node_modules/.pnpm/chalk@5.
|
236
|
-
import process2 from "
|
237
|
-
import os from "
|
238
|
-
import tty from "
|
235
|
+
// ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/supports-color/index.js
|
236
|
+
import process2 from "process";
|
237
|
+
import os from "os";
|
238
|
+
import tty from "tty";
|
239
239
|
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
|
240
240
|
const prefix2 = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
241
241
|
const position = argv.indexOf(prefix2 + flag);
|
@@ -299,10 +299,10 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
299
299
|
return 1;
|
300
300
|
}
|
301
301
|
if ("CI" in env) {
|
302
|
-
if ("GITHUB_ACTIONS"
|
302
|
+
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
|
303
303
|
return 3;
|
304
304
|
}
|
305
|
-
if (["TRAVIS", "
|
305
|
+
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
306
306
|
return 1;
|
307
307
|
}
|
308
308
|
return min2;
|
@@ -347,7 +347,7 @@ function createSupportsColor(stream, options = {}) {
|
|
347
347
|
}
|
348
348
|
var env, flagForceColor, supportsColor, supports_color_default;
|
349
349
|
var init_supports_color = __esm({
|
350
|
-
"../node_modules/.pnpm/chalk@5.
|
350
|
+
"../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/supports-color/index.js"() {
|
351
351
|
"use strict";
|
352
352
|
({ env } = process2);
|
353
353
|
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
@@ -363,7 +363,7 @@ var init_supports_color = __esm({
|
|
363
363
|
}
|
364
364
|
});
|
365
365
|
|
366
|
-
// ../node_modules/.pnpm/chalk@5.
|
366
|
+
// ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/utilities.js
|
367
367
|
function stringReplaceAll(string, substring, replacer) {
|
368
368
|
let index6 = string.indexOf(substring);
|
369
369
|
if (index6 === -1) {
|
@@ -393,18 +393,18 @@ function stringEncaseCRLFWithFirstIndex(string, prefix2, postfix, index6) {
|
|
393
393
|
return returnValue;
|
394
394
|
}
|
395
395
|
var init_utilities = __esm({
|
396
|
-
"../node_modules/.pnpm/chalk@5.
|
396
|
+
"../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/utilities.js"() {
|
397
397
|
"use strict";
|
398
398
|
}
|
399
399
|
});
|
400
400
|
|
401
|
-
// ../node_modules/.pnpm/chalk@5.
|
401
|
+
// ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/index.js
|
402
402
|
function createChalk(options) {
|
403
403
|
return chalkFactory(options);
|
404
404
|
}
|
405
405
|
var stdoutColor, stderrColor, GENERATOR, STYLER, IS_EMPTY, levelMapping, styles2, applyOptions, chalkFactory, getModelAnsi, usedModels, proto, createStyler, createBuilder, applyStyle, chalk, chalkStderr, source_default;
|
406
406
|
var init_source = __esm({
|
407
|
-
"../node_modules/.pnpm/chalk@5.
|
407
|
+
"../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/index.js"() {
|
408
408
|
"use strict";
|
409
409
|
init_ansi_styles();
|
410
410
|
init_supports_color();
|
@@ -3443,176 +3443,14 @@ var init_global = __esm({
|
|
3443
3443
|
}
|
3444
3444
|
});
|
3445
3445
|
|
3446
|
-
// ../node_modules/.pnpm/zod@3.
|
3447
|
-
|
3448
|
-
|
3449
|
-
|
3450
|
-
function addIssueToContext(ctx, issueData) {
|
3451
|
-
const overrideMap = getErrorMap();
|
3452
|
-
const issue = makeIssue({
|
3453
|
-
issueData,
|
3454
|
-
data: ctx.data,
|
3455
|
-
path: ctx.path,
|
3456
|
-
errorMaps: [
|
3457
|
-
ctx.common.contextualErrorMap,
|
3458
|
-
ctx.schemaErrorMap,
|
3459
|
-
overrideMap,
|
3460
|
-
overrideMap === errorMap ? void 0 : errorMap
|
3461
|
-
// then global default map
|
3462
|
-
].filter((x) => !!x)
|
3463
|
-
});
|
3464
|
-
ctx.common.issues.push(issue);
|
3465
|
-
}
|
3466
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
3467
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
3468
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
3469
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
3470
|
-
}
|
3471
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
3472
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
3473
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
3474
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
3475
|
-
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
3476
|
-
}
|
3477
|
-
function processCreateParams(params) {
|
3478
|
-
if (!params)
|
3479
|
-
return {};
|
3480
|
-
const { errorMap: errorMap2, invalid_type_error, required_error, description } = params;
|
3481
|
-
if (errorMap2 && (invalid_type_error || required_error)) {
|
3482
|
-
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
3483
|
-
}
|
3484
|
-
if (errorMap2)
|
3485
|
-
return { errorMap: errorMap2, description };
|
3486
|
-
const customMap = (iss, ctx) => {
|
3487
|
-
var _a437, _b326;
|
3488
|
-
const { message } = params;
|
3489
|
-
if (iss.code === "invalid_enum_value") {
|
3490
|
-
return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
|
3491
|
-
}
|
3492
|
-
if (typeof ctx.data === "undefined") {
|
3493
|
-
return { message: (_a437 = message !== null && message !== void 0 ? message : required_error) !== null && _a437 !== void 0 ? _a437 : ctx.defaultError };
|
3494
|
-
}
|
3495
|
-
if (iss.code !== "invalid_type")
|
3496
|
-
return { message: ctx.defaultError };
|
3497
|
-
return { message: (_b326 = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b326 !== void 0 ? _b326 : ctx.defaultError };
|
3498
|
-
};
|
3499
|
-
return { errorMap: customMap, description };
|
3500
|
-
}
|
3501
|
-
function timeRegexSource(args) {
|
3502
|
-
let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
|
3503
|
-
if (args.precision) {
|
3504
|
-
regex = `${regex}\\.\\d{${args.precision}}`;
|
3505
|
-
} else if (args.precision == null) {
|
3506
|
-
regex = `${regex}(\\.\\d+)?`;
|
3507
|
-
}
|
3508
|
-
return regex;
|
3509
|
-
}
|
3510
|
-
function timeRegex(args) {
|
3511
|
-
return new RegExp(`^${timeRegexSource(args)}$`);
|
3512
|
-
}
|
3513
|
-
function datetimeRegex(args) {
|
3514
|
-
let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
|
3515
|
-
const opts = [];
|
3516
|
-
opts.push(args.local ? `Z?` : `Z`);
|
3517
|
-
if (args.offset)
|
3518
|
-
opts.push(`([+-]\\d{2}:?\\d{2})`);
|
3519
|
-
regex = `${regex}(${opts.join("|")})`;
|
3520
|
-
return new RegExp(`^${regex}$`);
|
3521
|
-
}
|
3522
|
-
function isValidIP(ip, version2) {
|
3523
|
-
if ((version2 === "v4" || !version2) && ipv4Regex.test(ip)) {
|
3524
|
-
return true;
|
3525
|
-
}
|
3526
|
-
if ((version2 === "v6" || !version2) && ipv6Regex.test(ip)) {
|
3527
|
-
return true;
|
3528
|
-
}
|
3529
|
-
return false;
|
3530
|
-
}
|
3531
|
-
function floatSafeRemainder(val, step) {
|
3532
|
-
const valDecCount = (val.toString().split(".")[1] || "").length;
|
3533
|
-
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
3534
|
-
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
3535
|
-
const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
|
3536
|
-
const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
|
3537
|
-
return valInt % stepInt / Math.pow(10, decCount);
|
3538
|
-
}
|
3539
|
-
function deepPartialify(schema5) {
|
3540
|
-
if (schema5 instanceof ZodObject) {
|
3541
|
-
const newShape = {};
|
3542
|
-
for (const key in schema5.shape) {
|
3543
|
-
const fieldSchema = schema5.shape[key];
|
3544
|
-
newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
|
3545
|
-
}
|
3546
|
-
return new ZodObject({
|
3547
|
-
...schema5._def,
|
3548
|
-
shape: () => newShape
|
3549
|
-
});
|
3550
|
-
} else if (schema5 instanceof ZodArray) {
|
3551
|
-
return new ZodArray({
|
3552
|
-
...schema5._def,
|
3553
|
-
type: deepPartialify(schema5.element)
|
3554
|
-
});
|
3555
|
-
} else if (schema5 instanceof ZodOptional) {
|
3556
|
-
return ZodOptional.create(deepPartialify(schema5.unwrap()));
|
3557
|
-
} else if (schema5 instanceof ZodNullable) {
|
3558
|
-
return ZodNullable.create(deepPartialify(schema5.unwrap()));
|
3559
|
-
} else if (schema5 instanceof ZodTuple) {
|
3560
|
-
return ZodTuple.create(schema5.items.map((item) => deepPartialify(item)));
|
3561
|
-
} else {
|
3562
|
-
return schema5;
|
3563
|
-
}
|
3564
|
-
}
|
3565
|
-
function mergeValues(a, b) {
|
3566
|
-
const aType = getParsedType(a);
|
3567
|
-
const bType = getParsedType(b);
|
3568
|
-
if (a === b) {
|
3569
|
-
return { valid: true, data: a };
|
3570
|
-
} else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
|
3571
|
-
const bKeys = util.objectKeys(b);
|
3572
|
-
const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
|
3573
|
-
const newObj = { ...a, ...b };
|
3574
|
-
for (const key of sharedKeys) {
|
3575
|
-
const sharedValue = mergeValues(a[key], b[key]);
|
3576
|
-
if (!sharedValue.valid) {
|
3577
|
-
return { valid: false };
|
3578
|
-
}
|
3579
|
-
newObj[key] = sharedValue.data;
|
3580
|
-
}
|
3581
|
-
return { valid: true, data: newObj };
|
3582
|
-
} else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
|
3583
|
-
if (a.length !== b.length) {
|
3584
|
-
return { valid: false };
|
3585
|
-
}
|
3586
|
-
const newArray = [];
|
3587
|
-
for (let index6 = 0; index6 < a.length; index6++) {
|
3588
|
-
const itemA = a[index6];
|
3589
|
-
const itemB = b[index6];
|
3590
|
-
const sharedValue = mergeValues(itemA, itemB);
|
3591
|
-
if (!sharedValue.valid) {
|
3592
|
-
return { valid: false };
|
3593
|
-
}
|
3594
|
-
newArray.push(sharedValue.data);
|
3595
|
-
}
|
3596
|
-
return { valid: true, data: newArray };
|
3597
|
-
} else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
|
3598
|
-
return { valid: true, data: a };
|
3599
|
-
} else {
|
3600
|
-
return { valid: false };
|
3601
|
-
}
|
3602
|
-
}
|
3603
|
-
function createZodEnum(values, params) {
|
3604
|
-
return new ZodEnum({
|
3605
|
-
values,
|
3606
|
-
typeName: ZodFirstPartyTypeKind.ZodEnum,
|
3607
|
-
...processCreateParams(params)
|
3608
|
-
});
|
3609
|
-
}
|
3610
|
-
var util, objectUtil, ZodParsedType, getParsedType, ZodIssueCode, ZodError, errorMap, overrideErrorMap, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, errorUtil, _ZodEnum_cache, _ZodNativeEnum_cache, ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv6Regex, base64Regex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, BRAND, ZodBranded, ZodPipeline, ZodReadonly, 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, coerce;
|
3611
|
-
var init_lib = __esm({
|
3612
|
-
"../node_modules/.pnpm/zod@3.23.7/node_modules/zod/lib/index.mjs"() {
|
3446
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/util.js
|
3447
|
+
var util, objectUtil, ZodParsedType, getParsedType;
|
3448
|
+
var init_util = __esm({
|
3449
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/util.js"() {
|
3613
3450
|
"use strict";
|
3614
3451
|
(function(util2) {
|
3615
|
-
util2.assertEqual = (
|
3452
|
+
util2.assertEqual = (_2) => {
|
3453
|
+
};
|
3616
3454
|
function assertIs(_arg) {
|
3617
3455
|
}
|
3618
3456
|
util2.assertIs = assertIs;
|
@@ -3656,7 +3494,7 @@ var init_lib = __esm({
|
|
3656
3494
|
}
|
3657
3495
|
return void 0;
|
3658
3496
|
};
|
3659
|
-
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
3497
|
+
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
3660
3498
|
function joinValues(array2, separator = " | ") {
|
3661
3499
|
return array2.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
3662
3500
|
}
|
@@ -3707,7 +3545,7 @@ var init_lib = __esm({
|
|
3707
3545
|
case "string":
|
3708
3546
|
return ZodParsedType.string;
|
3709
3547
|
case "number":
|
3710
|
-
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
3548
|
+
return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
3711
3549
|
case "boolean":
|
3712
3550
|
return ZodParsedType.boolean;
|
3713
3551
|
case "function":
|
@@ -3740,6 +3578,15 @@ var init_lib = __esm({
|
|
3740
3578
|
return ZodParsedType.unknown;
|
3741
3579
|
}
|
3742
3580
|
};
|
3581
|
+
}
|
3582
|
+
});
|
3583
|
+
|
3584
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/ZodError.js
|
3585
|
+
var ZodIssueCode, ZodError;
|
3586
|
+
var init_ZodError = __esm({
|
3587
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/ZodError.js"() {
|
3588
|
+
"use strict";
|
3589
|
+
init_util();
|
3743
3590
|
ZodIssueCode = util.arrayToEnum([
|
3744
3591
|
"invalid_type",
|
3745
3592
|
"invalid_literal",
|
@@ -3759,6 +3606,9 @@ var init_lib = __esm({
|
|
3759
3606
|
"not_finite"
|
3760
3607
|
]);
|
3761
3608
|
ZodError = class _ZodError extends Error {
|
3609
|
+
get errors() {
|
3610
|
+
return this.issues;
|
3611
|
+
}
|
3762
3612
|
constructor(issues) {
|
3763
3613
|
super();
|
3764
3614
|
this.issues = [];
|
@@ -3777,9 +3627,6 @@ var init_lib = __esm({
|
|
3777
3627
|
this.name = "ZodError";
|
3778
3628
|
this.issues = issues;
|
3779
3629
|
}
|
3780
|
-
get errors() {
|
3781
|
-
return this.issues;
|
3782
|
-
}
|
3783
3630
|
format(_mapper) {
|
3784
3631
|
const mapper = _mapper || function(issue) {
|
3785
3632
|
return issue.message;
|
@@ -3851,6 +3698,16 @@ var init_lib = __esm({
|
|
3851
3698
|
const error2 = new ZodError(issues);
|
3852
3699
|
return error2;
|
3853
3700
|
};
|
3701
|
+
}
|
3702
|
+
});
|
3703
|
+
|
3704
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/locales/en.js
|
3705
|
+
var errorMap, en_default;
|
3706
|
+
var init_en = __esm({
|
3707
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/locales/en.js"() {
|
3708
|
+
"use strict";
|
3709
|
+
init_ZodError();
|
3710
|
+
init_util();
|
3854
3711
|
errorMap = (issue, _ctx) => {
|
3855
3712
|
let message;
|
3856
3713
|
switch (issue.code) {
|
@@ -3949,7 +3806,49 @@ var init_lib = __esm({
|
|
3949
3806
|
}
|
3950
3807
|
return { message };
|
3951
3808
|
};
|
3952
|
-
|
3809
|
+
en_default = errorMap;
|
3810
|
+
}
|
3811
|
+
});
|
3812
|
+
|
3813
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/errors.js
|
3814
|
+
function getErrorMap() {
|
3815
|
+
return overrideErrorMap;
|
3816
|
+
}
|
3817
|
+
var overrideErrorMap;
|
3818
|
+
var init_errors = __esm({
|
3819
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/errors.js"() {
|
3820
|
+
"use strict";
|
3821
|
+
init_en();
|
3822
|
+
overrideErrorMap = en_default;
|
3823
|
+
}
|
3824
|
+
});
|
3825
|
+
|
3826
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/parseUtil.js
|
3827
|
+
function addIssueToContext(ctx, issueData) {
|
3828
|
+
const overrideMap = getErrorMap();
|
3829
|
+
const issue = makeIssue({
|
3830
|
+
issueData,
|
3831
|
+
data: ctx.data,
|
3832
|
+
path: ctx.path,
|
3833
|
+
errorMaps: [
|
3834
|
+
ctx.common.contextualErrorMap,
|
3835
|
+
// contextual error map is first priority
|
3836
|
+
ctx.schemaErrorMap,
|
3837
|
+
// then schema-bound map if available
|
3838
|
+
overrideMap,
|
3839
|
+
// then global override map
|
3840
|
+
overrideMap === en_default ? void 0 : en_default
|
3841
|
+
// then global default map
|
3842
|
+
].filter((x) => !!x)
|
3843
|
+
});
|
3844
|
+
ctx.common.issues.push(issue);
|
3845
|
+
}
|
3846
|
+
var makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync;
|
3847
|
+
var init_parseUtil = __esm({
|
3848
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/parseUtil.js"() {
|
3849
|
+
"use strict";
|
3850
|
+
init_errors();
|
3851
|
+
init_en();
|
3953
3852
|
makeIssue = (params) => {
|
3954
3853
|
const { data, path: path2, errorMaps, issueData } = params;
|
3955
3854
|
const fullPath = [...path2, ...issueData.path || []];
|
@@ -4038,10 +3937,200 @@ var init_lib = __esm({
|
|
4038
3937
|
isDirty = (x) => x.status === "dirty";
|
4039
3938
|
isValid = (x) => x.status === "valid";
|
4040
3939
|
isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
3940
|
+
}
|
3941
|
+
});
|
3942
|
+
|
3943
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/typeAliases.js
|
3944
|
+
var init_typeAliases = __esm({
|
3945
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/typeAliases.js"() {
|
3946
|
+
"use strict";
|
3947
|
+
}
|
3948
|
+
});
|
3949
|
+
|
3950
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/errorUtil.js
|
3951
|
+
var errorUtil;
|
3952
|
+
var init_errorUtil = __esm({
|
3953
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/errorUtil.js"() {
|
3954
|
+
"use strict";
|
4041
3955
|
(function(errorUtil2) {
|
4042
3956
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
4043
|
-
errorUtil2.toString = (message) => typeof message === "string" ? message : message
|
3957
|
+
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
4044
3958
|
})(errorUtil || (errorUtil = {}));
|
3959
|
+
}
|
3960
|
+
});
|
3961
|
+
|
3962
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/types.js
|
3963
|
+
function processCreateParams(params) {
|
3964
|
+
if (!params)
|
3965
|
+
return {};
|
3966
|
+
const { errorMap: errorMap2, invalid_type_error, required_error, description } = params;
|
3967
|
+
if (errorMap2 && (invalid_type_error || required_error)) {
|
3968
|
+
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
3969
|
+
}
|
3970
|
+
if (errorMap2)
|
3971
|
+
return { errorMap: errorMap2, description };
|
3972
|
+
const customMap = (iss, ctx) => {
|
3973
|
+
const { message } = params;
|
3974
|
+
if (iss.code === "invalid_enum_value") {
|
3975
|
+
return { message: message ?? ctx.defaultError };
|
3976
|
+
}
|
3977
|
+
if (typeof ctx.data === "undefined") {
|
3978
|
+
return { message: message ?? required_error ?? ctx.defaultError };
|
3979
|
+
}
|
3980
|
+
if (iss.code !== "invalid_type")
|
3981
|
+
return { message: ctx.defaultError };
|
3982
|
+
return { message: message ?? invalid_type_error ?? ctx.defaultError };
|
3983
|
+
};
|
3984
|
+
return { errorMap: customMap, description };
|
3985
|
+
}
|
3986
|
+
function timeRegexSource(args) {
|
3987
|
+
let secondsRegexSource = `[0-5]\\d`;
|
3988
|
+
if (args.precision) {
|
3989
|
+
secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
|
3990
|
+
} else if (args.precision == null) {
|
3991
|
+
secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
|
3992
|
+
}
|
3993
|
+
const secondsQuantifier = args.precision ? "+" : "?";
|
3994
|
+
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
3995
|
+
}
|
3996
|
+
function timeRegex(args) {
|
3997
|
+
return new RegExp(`^${timeRegexSource(args)}$`);
|
3998
|
+
}
|
3999
|
+
function datetimeRegex(args) {
|
4000
|
+
let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
|
4001
|
+
const opts = [];
|
4002
|
+
opts.push(args.local ? `Z?` : `Z`);
|
4003
|
+
if (args.offset)
|
4004
|
+
opts.push(`([+-]\\d{2}:?\\d{2})`);
|
4005
|
+
regex = `${regex}(${opts.join("|")})`;
|
4006
|
+
return new RegExp(`^${regex}$`);
|
4007
|
+
}
|
4008
|
+
function isValidIP(ip, version2) {
|
4009
|
+
if ((version2 === "v4" || !version2) && ipv4Regex.test(ip)) {
|
4010
|
+
return true;
|
4011
|
+
}
|
4012
|
+
if ((version2 === "v6" || !version2) && ipv6Regex.test(ip)) {
|
4013
|
+
return true;
|
4014
|
+
}
|
4015
|
+
return false;
|
4016
|
+
}
|
4017
|
+
function isValidJWT(jwt, alg) {
|
4018
|
+
if (!jwtRegex.test(jwt))
|
4019
|
+
return false;
|
4020
|
+
try {
|
4021
|
+
const [header] = jwt.split(".");
|
4022
|
+
const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
4023
|
+
const decoded = JSON.parse(atob(base64));
|
4024
|
+
if (typeof decoded !== "object" || decoded === null)
|
4025
|
+
return false;
|
4026
|
+
if ("typ" in decoded && decoded?.typ !== "JWT")
|
4027
|
+
return false;
|
4028
|
+
if (!decoded.alg)
|
4029
|
+
return false;
|
4030
|
+
if (alg && decoded.alg !== alg)
|
4031
|
+
return false;
|
4032
|
+
return true;
|
4033
|
+
} catch {
|
4034
|
+
return false;
|
4035
|
+
}
|
4036
|
+
}
|
4037
|
+
function isValidCidr(ip, version2) {
|
4038
|
+
if ((version2 === "v4" || !version2) && ipv4CidrRegex.test(ip)) {
|
4039
|
+
return true;
|
4040
|
+
}
|
4041
|
+
if ((version2 === "v6" || !version2) && ipv6CidrRegex.test(ip)) {
|
4042
|
+
return true;
|
4043
|
+
}
|
4044
|
+
return false;
|
4045
|
+
}
|
4046
|
+
function floatSafeRemainder(val, step) {
|
4047
|
+
const valDecCount = (val.toString().split(".")[1] || "").length;
|
4048
|
+
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
4049
|
+
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
4050
|
+
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
4051
|
+
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
4052
|
+
return valInt % stepInt / 10 ** decCount;
|
4053
|
+
}
|
4054
|
+
function deepPartialify(schema5) {
|
4055
|
+
if (schema5 instanceof ZodObject) {
|
4056
|
+
const newShape = {};
|
4057
|
+
for (const key in schema5.shape) {
|
4058
|
+
const fieldSchema = schema5.shape[key];
|
4059
|
+
newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
|
4060
|
+
}
|
4061
|
+
return new ZodObject({
|
4062
|
+
...schema5._def,
|
4063
|
+
shape: () => newShape
|
4064
|
+
});
|
4065
|
+
} else if (schema5 instanceof ZodArray) {
|
4066
|
+
return new ZodArray({
|
4067
|
+
...schema5._def,
|
4068
|
+
type: deepPartialify(schema5.element)
|
4069
|
+
});
|
4070
|
+
} else if (schema5 instanceof ZodOptional) {
|
4071
|
+
return ZodOptional.create(deepPartialify(schema5.unwrap()));
|
4072
|
+
} else if (schema5 instanceof ZodNullable) {
|
4073
|
+
return ZodNullable.create(deepPartialify(schema5.unwrap()));
|
4074
|
+
} else if (schema5 instanceof ZodTuple) {
|
4075
|
+
return ZodTuple.create(schema5.items.map((item) => deepPartialify(item)));
|
4076
|
+
} else {
|
4077
|
+
return schema5;
|
4078
|
+
}
|
4079
|
+
}
|
4080
|
+
function mergeValues(a, b) {
|
4081
|
+
const aType = getParsedType(a);
|
4082
|
+
const bType = getParsedType(b);
|
4083
|
+
if (a === b) {
|
4084
|
+
return { valid: true, data: a };
|
4085
|
+
} else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
|
4086
|
+
const bKeys = util.objectKeys(b);
|
4087
|
+
const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
|
4088
|
+
const newObj = { ...a, ...b };
|
4089
|
+
for (const key of sharedKeys) {
|
4090
|
+
const sharedValue = mergeValues(a[key], b[key]);
|
4091
|
+
if (!sharedValue.valid) {
|
4092
|
+
return { valid: false };
|
4093
|
+
}
|
4094
|
+
newObj[key] = sharedValue.data;
|
4095
|
+
}
|
4096
|
+
return { valid: true, data: newObj };
|
4097
|
+
} else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
|
4098
|
+
if (a.length !== b.length) {
|
4099
|
+
return { valid: false };
|
4100
|
+
}
|
4101
|
+
const newArray = [];
|
4102
|
+
for (let index6 = 0; index6 < a.length; index6++) {
|
4103
|
+
const itemA = a[index6];
|
4104
|
+
const itemB = b[index6];
|
4105
|
+
const sharedValue = mergeValues(itemA, itemB);
|
4106
|
+
if (!sharedValue.valid) {
|
4107
|
+
return { valid: false };
|
4108
|
+
}
|
4109
|
+
newArray.push(sharedValue.data);
|
4110
|
+
}
|
4111
|
+
return { valid: true, data: newArray };
|
4112
|
+
} else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
|
4113
|
+
return { valid: true, data: a };
|
4114
|
+
} else {
|
4115
|
+
return { valid: false };
|
4116
|
+
}
|
4117
|
+
}
|
4118
|
+
function createZodEnum(values, params) {
|
4119
|
+
return new ZodEnum({
|
4120
|
+
values,
|
4121
|
+
typeName: ZodFirstPartyTypeKind.ZodEnum,
|
4122
|
+
...processCreateParams(params)
|
4123
|
+
});
|
4124
|
+
}
|
4125
|
+
var ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, jwtRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv4CidrRegex, ipv6Regex, ipv6CidrRegex, base64Regex, base64urlRegex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, BRAND, ZodBranded, ZodPipeline, ZodReadonly, 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, coerce;
|
4126
|
+
var init_types = __esm({
|
4127
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/types.js"() {
|
4128
|
+
"use strict";
|
4129
|
+
init_ZodError();
|
4130
|
+
init_errors();
|
4131
|
+
init_errorUtil();
|
4132
|
+
init_parseUtil();
|
4133
|
+
init_util();
|
4045
4134
|
ParseInputLazyPath = class {
|
4046
4135
|
constructor(parent, value, path2, key) {
|
4047
4136
|
this._cachedPath = [];
|
@@ -4052,7 +4141,7 @@ var init_lib = __esm({
|
|
4052
4141
|
}
|
4053
4142
|
get path() {
|
4054
4143
|
if (!this._cachedPath.length) {
|
4055
|
-
if (this._key
|
4144
|
+
if (Array.isArray(this._key)) {
|
4056
4145
|
this._cachedPath.push(...this._path, ...this._key);
|
4057
4146
|
} else {
|
4058
4147
|
this._cachedPath.push(...this._path, this._key);
|
@@ -4081,34 +4170,6 @@ var init_lib = __esm({
|
|
4081
4170
|
}
|
4082
4171
|
};
|
4083
4172
|
ZodType = class {
|
4084
|
-
constructor(def) {
|
4085
|
-
this.spa = this.safeParseAsync;
|
4086
|
-
this._def = def;
|
4087
|
-
this.parse = this.parse.bind(this);
|
4088
|
-
this.safeParse = this.safeParse.bind(this);
|
4089
|
-
this.parseAsync = this.parseAsync.bind(this);
|
4090
|
-
this.safeParseAsync = this.safeParseAsync.bind(this);
|
4091
|
-
this.spa = this.spa.bind(this);
|
4092
|
-
this.refine = this.refine.bind(this);
|
4093
|
-
this.refinement = this.refinement.bind(this);
|
4094
|
-
this.superRefine = this.superRefine.bind(this);
|
4095
|
-
this.optional = this.optional.bind(this);
|
4096
|
-
this.nullable = this.nullable.bind(this);
|
4097
|
-
this.nullish = this.nullish.bind(this);
|
4098
|
-
this.array = this.array.bind(this);
|
4099
|
-
this.promise = this.promise.bind(this);
|
4100
|
-
this.or = this.or.bind(this);
|
4101
|
-
this.and = this.and.bind(this);
|
4102
|
-
this.transform = this.transform.bind(this);
|
4103
|
-
this.brand = this.brand.bind(this);
|
4104
|
-
this.default = this.default.bind(this);
|
4105
|
-
this.catch = this.catch.bind(this);
|
4106
|
-
this.describe = this.describe.bind(this);
|
4107
|
-
this.pipe = this.pipe.bind(this);
|
4108
|
-
this.readonly = this.readonly.bind(this);
|
4109
|
-
this.isNullable = this.isNullable.bind(this);
|
4110
|
-
this.isOptional = this.isOptional.bind(this);
|
4111
|
-
}
|
4112
4173
|
get description() {
|
4113
4174
|
return this._def.description;
|
4114
4175
|
}
|
@@ -4156,14 +4217,13 @@ var init_lib = __esm({
|
|
4156
4217
|
throw result.error;
|
4157
4218
|
}
|
4158
4219
|
safeParse(data, params) {
|
4159
|
-
var _a437;
|
4160
4220
|
const ctx = {
|
4161
4221
|
common: {
|
4162
4222
|
issues: [],
|
4163
|
-
async:
|
4164
|
-
contextualErrorMap: params
|
4223
|
+
async: params?.async ?? false,
|
4224
|
+
contextualErrorMap: params?.errorMap
|
4165
4225
|
},
|
4166
|
-
path:
|
4226
|
+
path: params?.path || [],
|
4167
4227
|
schemaErrorMap: this._def.errorMap,
|
4168
4228
|
parent: null,
|
4169
4229
|
data,
|
@@ -4172,6 +4232,42 @@ var init_lib = __esm({
|
|
4172
4232
|
const result = this._parseSync({ data, path: ctx.path, parent: ctx });
|
4173
4233
|
return handleResult(ctx, result);
|
4174
4234
|
}
|
4235
|
+
"~validate"(data) {
|
4236
|
+
const ctx = {
|
4237
|
+
common: {
|
4238
|
+
issues: [],
|
4239
|
+
async: !!this["~standard"].async
|
4240
|
+
},
|
4241
|
+
path: [],
|
4242
|
+
schemaErrorMap: this._def.errorMap,
|
4243
|
+
parent: null,
|
4244
|
+
data,
|
4245
|
+
parsedType: getParsedType(data)
|
4246
|
+
};
|
4247
|
+
if (!this["~standard"].async) {
|
4248
|
+
try {
|
4249
|
+
const result = this._parseSync({ data, path: [], parent: ctx });
|
4250
|
+
return isValid(result) ? {
|
4251
|
+
value: result.value
|
4252
|
+
} : {
|
4253
|
+
issues: ctx.common.issues
|
4254
|
+
};
|
4255
|
+
} catch (err) {
|
4256
|
+
if (err?.message?.toLowerCase()?.includes("encountered")) {
|
4257
|
+
this["~standard"].async = true;
|
4258
|
+
}
|
4259
|
+
ctx.common = {
|
4260
|
+
issues: [],
|
4261
|
+
async: true
|
4262
|
+
};
|
4263
|
+
}
|
4264
|
+
}
|
4265
|
+
return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
|
4266
|
+
value: result.value
|
4267
|
+
} : {
|
4268
|
+
issues: ctx.common.issues
|
4269
|
+
});
|
4270
|
+
}
|
4175
4271
|
async parseAsync(data, params) {
|
4176
4272
|
const result = await this.safeParseAsync(data, params);
|
4177
4273
|
if (result.success)
|
@@ -4182,10 +4278,10 @@ var init_lib = __esm({
|
|
4182
4278
|
const ctx = {
|
4183
4279
|
common: {
|
4184
4280
|
issues: [],
|
4185
|
-
contextualErrorMap: params
|
4281
|
+
contextualErrorMap: params?.errorMap,
|
4186
4282
|
async: true
|
4187
4283
|
},
|
4188
|
-
path:
|
4284
|
+
path: params?.path || [],
|
4189
4285
|
schemaErrorMap: this._def.errorMap,
|
4190
4286
|
parent: null,
|
4191
4287
|
data,
|
@@ -4249,6 +4345,39 @@ var init_lib = __esm({
|
|
4249
4345
|
superRefine(refinement) {
|
4250
4346
|
return this._refinement(refinement);
|
4251
4347
|
}
|
4348
|
+
constructor(def) {
|
4349
|
+
this.spa = this.safeParseAsync;
|
4350
|
+
this._def = def;
|
4351
|
+
this.parse = this.parse.bind(this);
|
4352
|
+
this.safeParse = this.safeParse.bind(this);
|
4353
|
+
this.parseAsync = this.parseAsync.bind(this);
|
4354
|
+
this.safeParseAsync = this.safeParseAsync.bind(this);
|
4355
|
+
this.spa = this.spa.bind(this);
|
4356
|
+
this.refine = this.refine.bind(this);
|
4357
|
+
this.refinement = this.refinement.bind(this);
|
4358
|
+
this.superRefine = this.superRefine.bind(this);
|
4359
|
+
this.optional = this.optional.bind(this);
|
4360
|
+
this.nullable = this.nullable.bind(this);
|
4361
|
+
this.nullish = this.nullish.bind(this);
|
4362
|
+
this.array = this.array.bind(this);
|
4363
|
+
this.promise = this.promise.bind(this);
|
4364
|
+
this.or = this.or.bind(this);
|
4365
|
+
this.and = this.and.bind(this);
|
4366
|
+
this.transform = this.transform.bind(this);
|
4367
|
+
this.brand = this.brand.bind(this);
|
4368
|
+
this.default = this.default.bind(this);
|
4369
|
+
this.catch = this.catch.bind(this);
|
4370
|
+
this.describe = this.describe.bind(this);
|
4371
|
+
this.pipe = this.pipe.bind(this);
|
4372
|
+
this.readonly = this.readonly.bind(this);
|
4373
|
+
this.isNullable = this.isNullable.bind(this);
|
4374
|
+
this.isOptional = this.isOptional.bind(this);
|
4375
|
+
this["~standard"] = {
|
4376
|
+
version: 1,
|
4377
|
+
vendor: "zod",
|
4378
|
+
validate: (data) => this["~validate"](data)
|
4379
|
+
};
|
4380
|
+
}
|
4252
4381
|
optional() {
|
4253
4382
|
return ZodOptional.create(this, this._def);
|
4254
4383
|
}
|
@@ -4259,7 +4388,7 @@ var init_lib = __esm({
|
|
4259
4388
|
return this.nullable().optional();
|
4260
4389
|
}
|
4261
4390
|
array() {
|
4262
|
-
return ZodArray.create(this
|
4391
|
+
return ZodArray.create(this);
|
4263
4392
|
}
|
4264
4393
|
promise() {
|
4265
4394
|
return ZodPromise.create(this, this._def);
|
@@ -4325,15 +4454,19 @@ var init_lib = __esm({
|
|
4325
4454
|
};
|
4326
4455
|
cuidRegex = /^c[^\s-]{8,}$/i;
|
4327
4456
|
cuid2Regex = /^[0-9a-z]+$/;
|
4328
|
-
ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}
|
4457
|
+
ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
|
4329
4458
|
uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
|
4330
4459
|
nanoidRegex = /^[a-z0-9_-]{21}$/i;
|
4460
|
+
jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
|
4331
4461
|
durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
4332
4462
|
emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
4333
4463
|
_emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
4334
4464
|
ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
4335
|
-
|
4465
|
+
ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/;
|
4466
|
+
ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
|
4467
|
+
ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
4336
4468
|
base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
4469
|
+
base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
|
4337
4470
|
dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
4338
4471
|
dateRegex = new RegExp(`^${dateRegexSource}$`);
|
4339
4472
|
ZodString = class _ZodString extends ZodType {
|
@@ -4482,7 +4615,7 @@ var init_lib = __esm({
|
|
4482
4615
|
} else if (check.kind === "url") {
|
4483
4616
|
try {
|
4484
4617
|
new URL(input.data);
|
4485
|
-
} catch
|
4618
|
+
} catch {
|
4486
4619
|
ctx = this._getOrReturnCtx(input, ctx);
|
4487
4620
|
addIssueToContext(ctx, {
|
4488
4621
|
validation: "url",
|
@@ -4592,6 +4725,26 @@ var init_lib = __esm({
|
|
4592
4725
|
});
|
4593
4726
|
status.dirty();
|
4594
4727
|
}
|
4728
|
+
} else if (check.kind === "jwt") {
|
4729
|
+
if (!isValidJWT(input.data, check.alg)) {
|
4730
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
4731
|
+
addIssueToContext(ctx, {
|
4732
|
+
validation: "jwt",
|
4733
|
+
code: ZodIssueCode.invalid_string,
|
4734
|
+
message: check.message
|
4735
|
+
});
|
4736
|
+
status.dirty();
|
4737
|
+
}
|
4738
|
+
} else if (check.kind === "cidr") {
|
4739
|
+
if (!isValidCidr(input.data, check.version)) {
|
4740
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
4741
|
+
addIssueToContext(ctx, {
|
4742
|
+
validation: "cidr",
|
4743
|
+
code: ZodIssueCode.invalid_string,
|
4744
|
+
message: check.message
|
4745
|
+
});
|
4746
|
+
status.dirty();
|
4747
|
+
}
|
4595
4748
|
} else if (check.kind === "base64") {
|
4596
4749
|
if (!base64Regex.test(input.data)) {
|
4597
4750
|
ctx = this._getOrReturnCtx(input, ctx);
|
@@ -4602,6 +4755,16 @@ var init_lib = __esm({
|
|
4602
4755
|
});
|
4603
4756
|
status.dirty();
|
4604
4757
|
}
|
4758
|
+
} else if (check.kind === "base64url") {
|
4759
|
+
if (!base64urlRegex.test(input.data)) {
|
4760
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
4761
|
+
addIssueToContext(ctx, {
|
4762
|
+
validation: "base64url",
|
4763
|
+
code: ZodIssueCode.invalid_string,
|
4764
|
+
message: check.message
|
4765
|
+
});
|
4766
|
+
status.dirty();
|
4767
|
+
}
|
4605
4768
|
} else {
|
4606
4769
|
util.assertNever(check);
|
4607
4770
|
}
|
@@ -4648,11 +4811,22 @@ var init_lib = __esm({
|
|
4648
4811
|
base64(message) {
|
4649
4812
|
return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
|
4650
4813
|
}
|
4814
|
+
base64url(message) {
|
4815
|
+
return this._addCheck({
|
4816
|
+
kind: "base64url",
|
4817
|
+
...errorUtil.errToObj(message)
|
4818
|
+
});
|
4819
|
+
}
|
4820
|
+
jwt(options) {
|
4821
|
+
return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
|
4822
|
+
}
|
4651
4823
|
ip(options) {
|
4652
4824
|
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
|
4653
4825
|
}
|
4826
|
+
cidr(options) {
|
4827
|
+
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
4828
|
+
}
|
4654
4829
|
datetime(options) {
|
4655
|
-
var _a437, _b326;
|
4656
4830
|
if (typeof options === "string") {
|
4657
4831
|
return this._addCheck({
|
4658
4832
|
kind: "datetime",
|
@@ -4664,10 +4838,10 @@ var init_lib = __esm({
|
|
4664
4838
|
}
|
4665
4839
|
return this._addCheck({
|
4666
4840
|
kind: "datetime",
|
4667
|
-
precision: typeof
|
4668
|
-
offset:
|
4669
|
-
local:
|
4670
|
-
...errorUtil.errToObj(options
|
4841
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
4842
|
+
offset: options?.offset ?? false,
|
4843
|
+
local: options?.local ?? false,
|
4844
|
+
...errorUtil.errToObj(options?.message)
|
4671
4845
|
});
|
4672
4846
|
}
|
4673
4847
|
date(message) {
|
@@ -4683,8 +4857,8 @@ var init_lib = __esm({
|
|
4683
4857
|
}
|
4684
4858
|
return this._addCheck({
|
4685
4859
|
kind: "time",
|
4686
|
-
precision: typeof
|
4687
|
-
...errorUtil.errToObj(options
|
4860
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
4861
|
+
...errorUtil.errToObj(options?.message)
|
4688
4862
|
});
|
4689
4863
|
}
|
4690
4864
|
duration(message) {
|
@@ -4701,8 +4875,8 @@ var init_lib = __esm({
|
|
4701
4875
|
return this._addCheck({
|
4702
4876
|
kind: "includes",
|
4703
4877
|
value,
|
4704
|
-
position: options
|
4705
|
-
...errorUtil.errToObj(options
|
4878
|
+
position: options?.position,
|
4879
|
+
...errorUtil.errToObj(options?.message)
|
4706
4880
|
});
|
4707
4881
|
}
|
4708
4882
|
startsWith(value, message) {
|
@@ -4741,8 +4915,7 @@ var init_lib = __esm({
|
|
4741
4915
|
});
|
4742
4916
|
}
|
4743
4917
|
/**
|
4744
|
-
*
|
4745
|
-
* @see {@link ZodString.min}
|
4918
|
+
* Equivalent to `.min(1)`
|
4746
4919
|
*/
|
4747
4920
|
nonempty(message) {
|
4748
4921
|
return this.min(1, errorUtil.errToObj(message));
|
@@ -4804,9 +4977,15 @@ var init_lib = __esm({
|
|
4804
4977
|
get isIP() {
|
4805
4978
|
return !!this._def.checks.find((ch) => ch.kind === "ip");
|
4806
4979
|
}
|
4980
|
+
get isCIDR() {
|
4981
|
+
return !!this._def.checks.find((ch) => ch.kind === "cidr");
|
4982
|
+
}
|
4807
4983
|
get isBase64() {
|
4808
4984
|
return !!this._def.checks.find((ch) => ch.kind === "base64");
|
4809
4985
|
}
|
4986
|
+
get isBase64url() {
|
4987
|
+
return !!this._def.checks.find((ch) => ch.kind === "base64url");
|
4988
|
+
}
|
4810
4989
|
get minLength() {
|
4811
4990
|
let min2 = null;
|
4812
4991
|
for (const ch of this._def.checks) {
|
@@ -4829,11 +5008,10 @@ var init_lib = __esm({
|
|
4829
5008
|
}
|
4830
5009
|
};
|
4831
5010
|
ZodString.create = (params) => {
|
4832
|
-
var _a437;
|
4833
5011
|
return new ZodString({
|
4834
5012
|
checks: [],
|
4835
5013
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
4836
|
-
coerce:
|
5014
|
+
coerce: params?.coerce ?? false,
|
4837
5015
|
...processCreateParams(params)
|
4838
5016
|
});
|
4839
5017
|
};
|
@@ -5045,7 +5223,8 @@ var init_lib = __esm({
|
|
5045
5223
|
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
5046
5224
|
}
|
5047
5225
|
get isFinite() {
|
5048
|
-
let max2 = null
|
5226
|
+
let max2 = null;
|
5227
|
+
let min2 = null;
|
5049
5228
|
for (const ch of this._def.checks) {
|
5050
5229
|
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
5051
5230
|
return true;
|
@@ -5064,7 +5243,7 @@ var init_lib = __esm({
|
|
5064
5243
|
return new ZodNumber({
|
5065
5244
|
checks: [],
|
5066
5245
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
5067
|
-
coerce:
|
5246
|
+
coerce: params?.coerce || false,
|
5068
5247
|
...processCreateParams(params)
|
5069
5248
|
});
|
5070
5249
|
};
|
@@ -5076,17 +5255,15 @@ var init_lib = __esm({
|
|
5076
5255
|
}
|
5077
5256
|
_parse(input) {
|
5078
5257
|
if (this._def.coerce) {
|
5079
|
-
|
5258
|
+
try {
|
5259
|
+
input.data = BigInt(input.data);
|
5260
|
+
} catch {
|
5261
|
+
return this._getInvalidInput(input);
|
5262
|
+
}
|
5080
5263
|
}
|
5081
5264
|
const parsedType = this._getType(input);
|
5082
5265
|
if (parsedType !== ZodParsedType.bigint) {
|
5083
|
-
|
5084
|
-
addIssueToContext(ctx2, {
|
5085
|
-
code: ZodIssueCode.invalid_type,
|
5086
|
-
expected: ZodParsedType.bigint,
|
5087
|
-
received: ctx2.parsedType
|
5088
|
-
});
|
5089
|
-
return INVALID;
|
5266
|
+
return this._getInvalidInput(input);
|
5090
5267
|
}
|
5091
5268
|
let ctx = void 0;
|
5092
5269
|
const status = new ParseStatus();
|
@@ -5133,6 +5310,15 @@ var init_lib = __esm({
|
|
5133
5310
|
}
|
5134
5311
|
return { status: status.value, value: input.data };
|
5135
5312
|
}
|
5313
|
+
_getInvalidInput(input) {
|
5314
|
+
const ctx = this._getOrReturnCtx(input);
|
5315
|
+
addIssueToContext(ctx, {
|
5316
|
+
code: ZodIssueCode.invalid_type,
|
5317
|
+
expected: ZodParsedType.bigint,
|
5318
|
+
received: ctx.parsedType
|
5319
|
+
});
|
5320
|
+
return INVALID;
|
5321
|
+
}
|
5136
5322
|
gte(value, message) {
|
5137
5323
|
return this.setLimit("min", value, true, errorUtil.toString(message));
|
5138
5324
|
}
|
@@ -5226,11 +5412,10 @@ var init_lib = __esm({
|
|
5226
5412
|
}
|
5227
5413
|
};
|
5228
5414
|
ZodBigInt.create = (params) => {
|
5229
|
-
var _a437;
|
5230
5415
|
return new ZodBigInt({
|
5231
5416
|
checks: [],
|
5232
5417
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
5233
|
-
coerce:
|
5418
|
+
coerce: params?.coerce ?? false,
|
5234
5419
|
...processCreateParams(params)
|
5235
5420
|
});
|
5236
5421
|
};
|
@@ -5255,7 +5440,7 @@ var init_lib = __esm({
|
|
5255
5440
|
ZodBoolean.create = (params) => {
|
5256
5441
|
return new ZodBoolean({
|
5257
5442
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
5258
|
-
coerce:
|
5443
|
+
coerce: params?.coerce || false,
|
5259
5444
|
...processCreateParams(params)
|
5260
5445
|
});
|
5261
5446
|
};
|
@@ -5274,7 +5459,7 @@ var init_lib = __esm({
|
|
5274
5459
|
});
|
5275
5460
|
return INVALID;
|
5276
5461
|
}
|
5277
|
-
if (isNaN(input.data.getTime())) {
|
5462
|
+
if (Number.isNaN(input.data.getTime())) {
|
5278
5463
|
const ctx2 = this._getOrReturnCtx(input);
|
5279
5464
|
addIssueToContext(ctx2, {
|
5280
5465
|
code: ZodIssueCode.invalid_date
|
@@ -5363,7 +5548,7 @@ var init_lib = __esm({
|
|
5363
5548
|
ZodDate.create = (params) => {
|
5364
5549
|
return new ZodDate({
|
5365
5550
|
checks: [],
|
5366
|
-
coerce:
|
5551
|
+
coerce: params?.coerce || false,
|
5367
5552
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
5368
5553
|
...processCreateParams(params)
|
5369
5554
|
});
|
@@ -5612,7 +5797,8 @@ var init_lib = __esm({
|
|
5612
5797
|
return this._cached;
|
5613
5798
|
const shape = this._def.shape();
|
5614
5799
|
const keys = util.objectKeys(shape);
|
5615
|
-
|
5800
|
+
this._cached = { shape, keys };
|
5801
|
+
return this._cached;
|
5616
5802
|
}
|
5617
5803
|
_parse(input) {
|
5618
5804
|
const parsedType = this._getType(input);
|
@@ -5662,8 +5848,8 @@ var init_lib = __esm({
|
|
5662
5848
|
});
|
5663
5849
|
status.dirty();
|
5664
5850
|
}
|
5665
|
-
} else if (unknownKeys === "strip")
|
5666
|
-
else {
|
5851
|
+
} else if (unknownKeys === "strip") {
|
5852
|
+
} else {
|
5667
5853
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
5668
5854
|
}
|
5669
5855
|
} else {
|
@@ -5710,11 +5896,10 @@ var init_lib = __esm({
|
|
5710
5896
|
unknownKeys: "strict",
|
5711
5897
|
...message !== void 0 ? {
|
5712
5898
|
errorMap: (issue, ctx) => {
|
5713
|
-
|
5714
|
-
const defaultError = (_c14 = (_b326 = (_a437 = this._def).errorMap) === null || _b326 === void 0 ? void 0 : _b326.call(_a437, issue, ctx).message) !== null && _c14 !== void 0 ? _c14 : ctx.defaultError;
|
5899
|
+
const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
|
5715
5900
|
if (issue.code === "unrecognized_keys")
|
5716
5901
|
return {
|
5717
|
-
message:
|
5902
|
+
message: errorUtil.errToObj(message).message ?? defaultError
|
5718
5903
|
};
|
5719
5904
|
return {
|
5720
5905
|
message: defaultError
|
@@ -5845,11 +6030,11 @@ var init_lib = __esm({
|
|
5845
6030
|
}
|
5846
6031
|
pick(mask) {
|
5847
6032
|
const shape = {};
|
5848
|
-
util.objectKeys(mask)
|
6033
|
+
for (const key of util.objectKeys(mask)) {
|
5849
6034
|
if (mask[key] && this.shape[key]) {
|
5850
6035
|
shape[key] = this.shape[key];
|
5851
6036
|
}
|
5852
|
-
}
|
6037
|
+
}
|
5853
6038
|
return new _ZodObject({
|
5854
6039
|
...this._def,
|
5855
6040
|
shape: () => shape
|
@@ -5857,11 +6042,11 @@ var init_lib = __esm({
|
|
5857
6042
|
}
|
5858
6043
|
omit(mask) {
|
5859
6044
|
const shape = {};
|
5860
|
-
util.objectKeys(this.shape)
|
6045
|
+
for (const key of util.objectKeys(this.shape)) {
|
5861
6046
|
if (!mask[key]) {
|
5862
6047
|
shape[key] = this.shape[key];
|
5863
6048
|
}
|
5864
|
-
}
|
6049
|
+
}
|
5865
6050
|
return new _ZodObject({
|
5866
6051
|
...this._def,
|
5867
6052
|
shape: () => shape
|
@@ -5875,14 +6060,14 @@ var init_lib = __esm({
|
|
5875
6060
|
}
|
5876
6061
|
partial(mask) {
|
5877
6062
|
const newShape = {};
|
5878
|
-
util.objectKeys(this.shape)
|
6063
|
+
for (const key of util.objectKeys(this.shape)) {
|
5879
6064
|
const fieldSchema = this.shape[key];
|
5880
6065
|
if (mask && !mask[key]) {
|
5881
6066
|
newShape[key] = fieldSchema;
|
5882
6067
|
} else {
|
5883
6068
|
newShape[key] = fieldSchema.optional();
|
5884
6069
|
}
|
5885
|
-
}
|
6070
|
+
}
|
5886
6071
|
return new _ZodObject({
|
5887
6072
|
...this._def,
|
5888
6073
|
shape: () => newShape
|
@@ -5890,7 +6075,7 @@ var init_lib = __esm({
|
|
5890
6075
|
}
|
5891
6076
|
required(mask) {
|
5892
6077
|
const newShape = {};
|
5893
|
-
util.objectKeys(this.shape)
|
6078
|
+
for (const key of util.objectKeys(this.shape)) {
|
5894
6079
|
if (mask && !mask[key]) {
|
5895
6080
|
newShape[key] = this.shape[key];
|
5896
6081
|
} else {
|
@@ -5901,7 +6086,7 @@ var init_lib = __esm({
|
|
5901
6086
|
}
|
5902
6087
|
newShape[key] = newField;
|
5903
6088
|
}
|
5904
|
-
}
|
6089
|
+
}
|
5905
6090
|
return new _ZodObject({
|
5906
6091
|
...this._def,
|
5907
6092
|
shape: () => newShape
|
@@ -6479,12 +6664,7 @@ var init_lib = __esm({
|
|
6479
6664
|
return makeIssue({
|
6480
6665
|
data: args,
|
6481
6666
|
path: ctx.path,
|
6482
|
-
errorMaps: [
|
6483
|
-
ctx.common.contextualErrorMap,
|
6484
|
-
ctx.schemaErrorMap,
|
6485
|
-
getErrorMap(),
|
6486
|
-
errorMap
|
6487
|
-
].filter((x) => !!x),
|
6667
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
6488
6668
|
issueData: {
|
6489
6669
|
code: ZodIssueCode.invalid_arguments,
|
6490
6670
|
argumentsError: error2
|
@@ -6495,12 +6675,7 @@ var init_lib = __esm({
|
|
6495
6675
|
return makeIssue({
|
6496
6676
|
data: returns,
|
6497
6677
|
path: ctx.path,
|
6498
|
-
errorMaps: [
|
6499
|
-
ctx.common.contextualErrorMap,
|
6500
|
-
ctx.schemaErrorMap,
|
6501
|
-
getErrorMap(),
|
6502
|
-
errorMap
|
6503
|
-
].filter((x) => !!x),
|
6678
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
6504
6679
|
issueData: {
|
6505
6680
|
code: ZodIssueCode.invalid_return_type,
|
6506
6681
|
returnTypeError: error2
|
@@ -6617,10 +6792,6 @@ var init_lib = __esm({
|
|
6617
6792
|
});
|
6618
6793
|
};
|
6619
6794
|
ZodEnum = class _ZodEnum extends ZodType {
|
6620
|
-
constructor() {
|
6621
|
-
super(...arguments);
|
6622
|
-
_ZodEnum_cache.set(this, void 0);
|
6623
|
-
}
|
6624
6795
|
_parse(input) {
|
6625
6796
|
if (typeof input.data !== "string") {
|
6626
6797
|
const ctx = this._getOrReturnCtx(input);
|
@@ -6632,10 +6803,10 @@ var init_lib = __esm({
|
|
6632
6803
|
});
|
6633
6804
|
return INVALID;
|
6634
6805
|
}
|
6635
|
-
if (!
|
6636
|
-
|
6806
|
+
if (!this._cache) {
|
6807
|
+
this._cache = new Set(this._def.values);
|
6637
6808
|
}
|
6638
|
-
if (!
|
6809
|
+
if (!this._cache.has(input.data)) {
|
6639
6810
|
const ctx = this._getOrReturnCtx(input);
|
6640
6811
|
const expectedValues = this._def.values;
|
6641
6812
|
addIssueToContext(ctx, {
|
@@ -6684,13 +6855,8 @@ var init_lib = __esm({
|
|
6684
6855
|
});
|
6685
6856
|
}
|
6686
6857
|
};
|
6687
|
-
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
6688
6858
|
ZodEnum.create = createZodEnum;
|
6689
6859
|
ZodNativeEnum = class extends ZodType {
|
6690
|
-
constructor() {
|
6691
|
-
super(...arguments);
|
6692
|
-
_ZodNativeEnum_cache.set(this, void 0);
|
6693
|
-
}
|
6694
6860
|
_parse(input) {
|
6695
6861
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
6696
6862
|
const ctx = this._getOrReturnCtx(input);
|
@@ -6703,10 +6869,10 @@ var init_lib = __esm({
|
|
6703
6869
|
});
|
6704
6870
|
return INVALID;
|
6705
6871
|
}
|
6706
|
-
if (!
|
6707
|
-
|
6872
|
+
if (!this._cache) {
|
6873
|
+
this._cache = new Set(util.getValidEnumValues(this._def.values));
|
6708
6874
|
}
|
6709
|
-
if (!
|
6875
|
+
if (!this._cache.has(input.data)) {
|
6710
6876
|
const expectedValues = util.objectValues(nativeEnumValues);
|
6711
6877
|
addIssueToContext(ctx, {
|
6712
6878
|
received: ctx.data,
|
@@ -6721,7 +6887,6 @@ var init_lib = __esm({
|
|
6721
6887
|
return this._def.values;
|
6722
6888
|
}
|
6723
6889
|
};
|
6724
|
-
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
6725
6890
|
ZodNativeEnum.create = (values, params) => {
|
6726
6891
|
return new ZodNativeEnum({
|
6727
6892
|
values,
|
@@ -6862,7 +7027,7 @@ var init_lib = __esm({
|
|
6862
7027
|
parent: ctx
|
6863
7028
|
});
|
6864
7029
|
if (!isValid(base))
|
6865
|
-
return
|
7030
|
+
return INVALID;
|
6866
7031
|
const result = effect.transform(base.value, checkCtx);
|
6867
7032
|
if (result instanceof Promise) {
|
6868
7033
|
throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
|
@@ -6871,8 +7036,11 @@ var init_lib = __esm({
|
|
6871
7036
|
} else {
|
6872
7037
|
return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
|
6873
7038
|
if (!isValid(base))
|
6874
|
-
return
|
6875
|
-
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
7039
|
+
return INVALID;
|
7040
|
+
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
7041
|
+
status: status.value,
|
7042
|
+
value: result
|
7043
|
+
}));
|
6876
7044
|
});
|
6877
7045
|
}
|
6878
7046
|
}
|
@@ -7212,13 +7380,44 @@ var init_lib = __esm({
|
|
7212
7380
|
}
|
7213
7381
|
});
|
7214
7382
|
|
7383
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/external.js
|
7384
|
+
var init_external = __esm({
|
7385
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/external.js"() {
|
7386
|
+
"use strict";
|
7387
|
+
init_errors();
|
7388
|
+
init_parseUtil();
|
7389
|
+
init_typeAliases();
|
7390
|
+
init_util();
|
7391
|
+
init_types();
|
7392
|
+
init_ZodError();
|
7393
|
+
}
|
7394
|
+
});
|
7395
|
+
|
7396
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/index.js
|
7397
|
+
var init_v3 = __esm({
|
7398
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/index.js"() {
|
7399
|
+
"use strict";
|
7400
|
+
init_external();
|
7401
|
+
init_external();
|
7402
|
+
}
|
7403
|
+
});
|
7404
|
+
|
7405
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/index.js
|
7406
|
+
var init_esm = __esm({
|
7407
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/index.js"() {
|
7408
|
+
"use strict";
|
7409
|
+
init_v3();
|
7410
|
+
init_v3();
|
7411
|
+
}
|
7412
|
+
});
|
7413
|
+
|
7215
7414
|
// src/serializer/gelSchema.ts
|
7216
7415
|
var enumSchema, enumSchemaV1, indexColumn, index, fk, sequenceSchema, roleSchema, sequenceSquashed, column, checkConstraint, columnSquashed, compositePK, uniqueConstraint, policy, policySquashed, viewWithOption, matViewWithOption, mergedViewWithOption, view, table, schemaHash, kitInternals, gelSchemaExternal, gelSchemaInternal, tableSquashed, gelSchemaSquashed, gelSchema, dryGel;
|
7217
7416
|
var init_gelSchema = __esm({
|
7218
7417
|
"src/serializer/gelSchema.ts"() {
|
7219
7418
|
"use strict";
|
7220
7419
|
init_global();
|
7221
|
-
|
7420
|
+
init_esm();
|
7222
7421
|
enumSchema = objectType({
|
7223
7422
|
name: stringType(),
|
7224
7423
|
schema: stringType(),
|
@@ -7482,7 +7681,7 @@ var index2, fk2, column2, tableV3, compositePK2, uniqueConstraint2, checkConstra
|
|
7482
7681
|
var init_mysqlSchema = __esm({
|
7483
7682
|
"src/serializer/mysqlSchema.ts"() {
|
7484
7683
|
"use strict";
|
7485
|
-
|
7684
|
+
init_esm();
|
7486
7685
|
init_global();
|
7487
7686
|
index2 = objectType({
|
7488
7687
|
name: stringType(),
|
@@ -7811,7 +8010,7 @@ var init_pgSchema = __esm({
|
|
7811
8010
|
"src/serializer/pgSchema.ts"() {
|
7812
8011
|
"use strict";
|
7813
8012
|
init_global();
|
7814
|
-
|
8013
|
+
init_esm();
|
7815
8014
|
indexV2 = objectType({
|
7816
8015
|
name: stringType(),
|
7817
8016
|
columns: recordType(
|
@@ -8561,7 +8760,7 @@ var index4, column4, compositePK4, uniqueConstraint4, table4, viewMeta2, kitInte
|
|
8561
8760
|
var init_singlestoreSchema = __esm({
|
8562
8761
|
"src/serializer/singlestoreSchema.ts"() {
|
8563
8762
|
"use strict";
|
8564
|
-
|
8763
|
+
init_esm();
|
8565
8764
|
init_global();
|
8566
8765
|
index4 = objectType({
|
8567
8766
|
name: stringType(),
|
@@ -8758,7 +8957,7 @@ var index5, fk4, compositePK5, column5, tableV33, uniqueConstraint5, checkConstr
|
|
8758
8957
|
var init_sqliteSchema = __esm({
|
8759
8958
|
"src/serializer/sqliteSchema.ts"() {
|
8760
8959
|
"use strict";
|
8761
|
-
|
8960
|
+
init_esm();
|
8762
8961
|
init_global();
|
8763
8962
|
index5 = objectType({
|
8764
8963
|
name: stringType(),
|
@@ -17259,7 +17458,7 @@ var makeChanged, makeSelfOrChanged, makePatched, makeSelfOrPatched, columnSchema
|
|
17259
17458
|
var init_snapshotsDiffer = __esm({
|
17260
17459
|
"src/snapshotsDiffer.ts"() {
|
17261
17460
|
"use strict";
|
17262
|
-
|
17461
|
+
init_esm();
|
17263
17462
|
init_jsonDiffer();
|
17264
17463
|
init_sqlgenerator();
|
17265
17464
|
init_jsonStatements();
|
@@ -20171,7 +20370,7 @@ var dialects, dialect4, commonSquashedSchema, commonSchema;
|
|
20171
20370
|
var init_schemaValidator = __esm({
|
20172
20371
|
"src/schemaValidator.ts"() {
|
20173
20372
|
"use strict";
|
20174
|
-
|
20373
|
+
init_esm();
|
20175
20374
|
init_mysqlSchema();
|
20176
20375
|
init_pgSchema();
|
20177
20376
|
init_singlestoreSchema();
|
@@ -20193,7 +20392,7 @@ var sqliteDriversLiterals, postgresqlDriversLiterals, prefixes, prefix, casingTy
|
|
20193
20392
|
var init_common = __esm({
|
20194
20393
|
"src/cli/validations/common.ts"() {
|
20195
20394
|
"use strict";
|
20196
|
-
|
20395
|
+
init_esm();
|
20197
20396
|
init_schemaValidator();
|
20198
20397
|
init_outputs();
|
20199
20398
|
sqliteDriversLiterals = [
|
@@ -22536,7 +22735,7 @@ var version;
|
|
22536
22735
|
var init_version = __esm({
|
22537
22736
|
"../drizzle-orm/dist/version.js"() {
|
22538
22737
|
"use strict";
|
22539
|
-
version = "0.
|
22738
|
+
version = "0.44.2";
|
22540
22739
|
}
|
22541
22740
|
});
|
22542
22741
|
|
@@ -23212,7 +23411,7 @@ var init_alias = __esm({
|
|
23212
23411
|
|
23213
23412
|
// ../drizzle-orm/dist/errors.js
|
23214
23413
|
var _a31, _b13, DrizzleError, _a32, _b14, TransactionRollbackError;
|
23215
|
-
var
|
23414
|
+
var init_errors2 = __esm({
|
23216
23415
|
"../drizzle-orm/dist/errors.js"() {
|
23217
23416
|
"use strict";
|
23218
23417
|
init_entity();
|
@@ -25986,7 +26185,7 @@ var init_dist = __esm({
|
|
25986
26185
|
init_column_builder();
|
25987
26186
|
init_column();
|
25988
26187
|
init_entity();
|
25989
|
-
|
26188
|
+
init_errors2();
|
25990
26189
|
init_logger();
|
25991
26190
|
init_operations();
|
25992
26191
|
init_query_promise();
|
@@ -26407,7 +26606,7 @@ var init_dialect = __esm({
|
|
26407
26606
|
init_casing();
|
26408
26607
|
init_column();
|
26409
26608
|
init_entity();
|
26410
|
-
|
26609
|
+
init_errors2();
|
26411
26610
|
init_columns();
|
26412
26611
|
init_table2();
|
26413
26612
|
init_relations();
|
@@ -30103,7 +30302,7 @@ var init_cache = __esm({
|
|
30103
30302
|
|
30104
30303
|
// ../drizzle-orm/dist/errors/index.js
|
30105
30304
|
var DrizzleQueryError;
|
30106
|
-
var
|
30305
|
+
var init_errors3 = __esm({
|
30107
30306
|
"../drizzle-orm/dist/errors/index.js"() {
|
30108
30307
|
"use strict";
|
30109
30308
|
DrizzleQueryError = class _DrizzleQueryError extends Error {
|
@@ -30127,8 +30326,8 @@ var init_session = __esm({
|
|
30127
30326
|
"use strict";
|
30128
30327
|
init_cache();
|
30129
30328
|
init_entity();
|
30130
|
-
init_errors();
|
30131
30329
|
init_errors2();
|
30330
|
+
init_errors3();
|
30132
30331
|
init_sql2();
|
30133
30332
|
init_tracing();
|
30134
30333
|
init_db();
|
@@ -33123,7 +33322,7 @@ var init_dialect2 = __esm({
|
|
33123
33322
|
init_casing();
|
33124
33323
|
init_column();
|
33125
33324
|
init_entity();
|
33126
|
-
|
33325
|
+
init_errors2();
|
33127
33326
|
init_relations();
|
33128
33327
|
init_sql2();
|
33129
33328
|
init_sql();
|
@@ -35468,8 +35667,8 @@ var init_session2 = __esm({
|
|
35468
35667
|
"use strict";
|
35469
35668
|
init_cache();
|
35470
35669
|
init_entity();
|
35471
|
-
init_errors();
|
35472
35670
|
init_errors2();
|
35671
|
+
init_errors3();
|
35473
35672
|
init_query_promise();
|
35474
35673
|
init_db2();
|
35475
35674
|
ExecuteResultSync = class extends (_b164 = QueryPromise, _a232 = entityKind, _b164) {
|
@@ -38543,7 +38742,7 @@ var init_dialect3 = __esm({
|
|
38543
38742
|
init_casing();
|
38544
38743
|
init_column();
|
38545
38744
|
init_entity();
|
38546
|
-
|
38745
|
+
init_errors2();
|
38547
38746
|
init_relations();
|
38548
38747
|
init_expressions();
|
38549
38748
|
init_sql();
|
@@ -41108,8 +41307,8 @@ var init_session3 = __esm({
|
|
41108
41307
|
"use strict";
|
41109
41308
|
init_cache();
|
41110
41309
|
init_entity();
|
41111
|
-
init_errors();
|
41112
41310
|
init_errors2();
|
41311
|
+
init_errors3();
|
41113
41312
|
init_sql();
|
41114
41313
|
init_db3();
|
41115
41314
|
_a341 = entityKind;
|
@@ -42037,7 +42236,7 @@ var cliConfigGenerate, pushParams, pullParams, configCheck, cliConfigCheck;
|
|
42037
42236
|
var init_cli = __esm({
|
42038
42237
|
"src/cli/validations/cli.ts"() {
|
42039
42238
|
"use strict";
|
42040
|
-
|
42239
|
+
init_esm();
|
42041
42240
|
init_schemaValidator();
|
42042
42241
|
init_common();
|
42043
42242
|
cliConfigGenerate = objectType({
|
@@ -42105,7 +42304,7 @@ var gelCredentials;
|
|
42105
42304
|
var init_gel = __esm({
|
42106
42305
|
"src/cli/validations/gel.ts"() {
|
42107
42306
|
"use strict";
|
42108
|
-
|
42307
|
+
init_esm();
|
42109
42308
|
init_views();
|
42110
42309
|
init_common();
|
42111
42310
|
gelCredentials = unionType([
|
@@ -42153,7 +42352,7 @@ var libSQLCredentials;
|
|
42153
42352
|
var init_libsql = __esm({
|
42154
42353
|
"src/cli/validations/libsql.ts"() {
|
42155
42354
|
"use strict";
|
42156
|
-
|
42355
|
+
init_esm();
|
42157
42356
|
init_views();
|
42158
42357
|
init_common();
|
42159
42358
|
libSQLCredentials = objectType({
|
@@ -42168,7 +42367,7 @@ var mysqlCredentials;
|
|
42168
42367
|
var init_mysql = __esm({
|
42169
42368
|
"src/cli/validations/mysql.ts"() {
|
42170
42369
|
"use strict";
|
42171
|
-
|
42370
|
+
init_esm();
|
42172
42371
|
init_views();
|
42173
42372
|
init_common();
|
42174
42373
|
init_outputs();
|
@@ -42205,7 +42404,7 @@ var postgresCredentials;
|
|
42205
42404
|
var init_postgres = __esm({
|
42206
42405
|
"src/cli/validations/postgres.ts"() {
|
42207
42406
|
"use strict";
|
42208
|
-
|
42407
|
+
init_esm();
|
42209
42408
|
init_views();
|
42210
42409
|
init_common();
|
42211
42410
|
postgresCredentials = unionType([
|
@@ -42254,7 +42453,7 @@ var singlestoreCredentials;
|
|
42254
42453
|
var init_singlestore = __esm({
|
42255
42454
|
"src/cli/validations/singlestore.ts"() {
|
42256
42455
|
"use strict";
|
42257
|
-
|
42456
|
+
init_esm();
|
42258
42457
|
init_views();
|
42259
42458
|
init_common();
|
42260
42459
|
init_outputs();
|
@@ -42292,7 +42491,7 @@ var init_sqlite = __esm({
|
|
42292
42491
|
"src/cli/validations/sqlite.ts"() {
|
42293
42492
|
"use strict";
|
42294
42493
|
init_global();
|
42295
|
-
|
42494
|
+
init_esm();
|
42296
42495
|
init_views();
|
42297
42496
|
init_common();
|
42298
42497
|
sqliteCredentials = unionType([
|
@@ -42323,7 +42522,7 @@ var credentials, studioCliParams, studioConfig;
|
|
42323
42522
|
var init_studio = __esm({
|
42324
42523
|
"src/cli/validations/studio.ts"() {
|
42325
42524
|
"use strict";
|
42326
|
-
|
42525
|
+
init_esm();
|
42327
42526
|
init_schemaValidator();
|
42328
42527
|
init_mysql();
|
42329
42528
|
init_postgres();
|
@@ -42365,7 +42564,7 @@ var init_utils9 = __esm({
|
|
42365
42564
|
"src/cli/commands/utils.ts"() {
|
42366
42565
|
"use strict";
|
42367
42566
|
import_hanji7 = __toESM(require_hanji());
|
42368
|
-
|
42567
|
+
init_esm();
|
42369
42568
|
init_getTablesFilterByExtensions();
|
42370
42569
|
init_global();
|
42371
42570
|
init_schemaValidator();
|
@@ -44515,7 +44714,7 @@ var init_dialect4 = __esm({
|
|
44515
44714
|
init_casing();
|
44516
44715
|
init_column();
|
44517
44716
|
init_entity();
|
44518
|
-
|
44717
|
+
init_errors2();
|
44519
44718
|
init_relations();
|
44520
44719
|
init_expressions();
|
44521
44720
|
init_sql();
|
@@ -46330,8 +46529,8 @@ var init_session4 = __esm({
|
|
46330
46529
|
"use strict";
|
46331
46530
|
init_cache();
|
46332
46531
|
init_entity();
|
46333
|
-
init_errors();
|
46334
46532
|
init_errors2();
|
46533
|
+
init_errors3();
|
46335
46534
|
init_sql();
|
46336
46535
|
init_db4();
|
46337
46536
|
_a434 = entityKind;
|