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.js
CHANGED
@@ -35,7 +35,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
35
35
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
36
36
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
37
37
|
|
38
|
-
// ../node_modules/.pnpm/chalk@5.
|
38
|
+
// ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/ansi-styles/index.js
|
39
39
|
function assembleStyles() {
|
40
40
|
const codes = /* @__PURE__ */ new Map();
|
41
41
|
for (const [groupName, group] of Object.entries(styles)) {
|
@@ -152,7 +152,7 @@ function assembleStyles() {
|
|
152
152
|
}
|
153
153
|
var ANSI_BACKGROUND_OFFSET, wrapAnsi16, wrapAnsi256, wrapAnsi16m, styles, modifierNames, foregroundColorNames, backgroundColorNames, colorNames, ansiStyles, ansi_styles_default;
|
154
154
|
var init_ansi_styles = __esm({
|
155
|
-
"../node_modules/.pnpm/chalk@5.
|
155
|
+
"../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/ansi-styles/index.js"() {
|
156
156
|
"use strict";
|
157
157
|
ANSI_BACKGROUND_OFFSET = 10;
|
158
158
|
wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
@@ -227,7 +227,7 @@ var init_ansi_styles = __esm({
|
|
227
227
|
}
|
228
228
|
});
|
229
229
|
|
230
|
-
// ../node_modules/.pnpm/chalk@5.
|
230
|
+
// ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/supports-color/index.js
|
231
231
|
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {
|
232
232
|
const prefix2 = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
233
233
|
const position = argv.indexOf(prefix2 + flag);
|
@@ -291,10 +291,10 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
291
291
|
return 1;
|
292
292
|
}
|
293
293
|
if ("CI" in env) {
|
294
|
-
if ("GITHUB_ACTIONS"
|
294
|
+
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
|
295
295
|
return 3;
|
296
296
|
}
|
297
|
-
if (["TRAVIS", "
|
297
|
+
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
298
298
|
return 1;
|
299
299
|
}
|
300
300
|
return min2;
|
@@ -339,7 +339,7 @@ function createSupportsColor(stream, options = {}) {
|
|
339
339
|
}
|
340
340
|
var import_node_process, import_node_os, import_node_tty, env, flagForceColor, supportsColor, supports_color_default;
|
341
341
|
var init_supports_color = __esm({
|
342
|
-
"../node_modules/.pnpm/chalk@5.
|
342
|
+
"../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/supports-color/index.js"() {
|
343
343
|
"use strict";
|
344
344
|
import_node_process = __toESM(require("process"), 1);
|
345
345
|
import_node_os = __toESM(require("os"), 1);
|
@@ -358,7 +358,7 @@ var init_supports_color = __esm({
|
|
358
358
|
}
|
359
359
|
});
|
360
360
|
|
361
|
-
// ../node_modules/.pnpm/chalk@5.
|
361
|
+
// ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/utilities.js
|
362
362
|
function stringReplaceAll(string, substring, replacer) {
|
363
363
|
let index6 = string.indexOf(substring);
|
364
364
|
if (index6 === -1) {
|
@@ -388,18 +388,18 @@ function stringEncaseCRLFWithFirstIndex(string, prefix2, postfix, index6) {
|
|
388
388
|
return returnValue;
|
389
389
|
}
|
390
390
|
var init_utilities = __esm({
|
391
|
-
"../node_modules/.pnpm/chalk@5.
|
391
|
+
"../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/utilities.js"() {
|
392
392
|
"use strict";
|
393
393
|
}
|
394
394
|
});
|
395
395
|
|
396
|
-
// ../node_modules/.pnpm/chalk@5.
|
396
|
+
// ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/index.js
|
397
397
|
function createChalk(options) {
|
398
398
|
return chalkFactory(options);
|
399
399
|
}
|
400
400
|
var stdoutColor, stderrColor, GENERATOR, STYLER, IS_EMPTY, levelMapping, styles2, applyOptions, chalkFactory, getModelAnsi, usedModels, proto, createStyler, createBuilder, applyStyle, chalk, chalkStderr, source_default;
|
401
401
|
var init_source = __esm({
|
402
|
-
"../node_modules/.pnpm/chalk@5.
|
402
|
+
"../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/index.js"() {
|
403
403
|
"use strict";
|
404
404
|
init_ansi_styles();
|
405
405
|
init_supports_color();
|
@@ -3438,176 +3438,14 @@ var init_global = __esm({
|
|
3438
3438
|
}
|
3439
3439
|
});
|
3440
3440
|
|
3441
|
-
// ../node_modules/.pnpm/zod@3.
|
3442
|
-
|
3443
|
-
|
3444
|
-
|
3445
|
-
function addIssueToContext(ctx, issueData) {
|
3446
|
-
const overrideMap = getErrorMap();
|
3447
|
-
const issue = makeIssue({
|
3448
|
-
issueData,
|
3449
|
-
data: ctx.data,
|
3450
|
-
path: ctx.path,
|
3451
|
-
errorMaps: [
|
3452
|
-
ctx.common.contextualErrorMap,
|
3453
|
-
ctx.schemaErrorMap,
|
3454
|
-
overrideMap,
|
3455
|
-
overrideMap === errorMap ? void 0 : errorMap
|
3456
|
-
// then global default map
|
3457
|
-
].filter((x) => !!x)
|
3458
|
-
});
|
3459
|
-
ctx.common.issues.push(issue);
|
3460
|
-
}
|
3461
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
3462
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
3463
|
-
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");
|
3464
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
3465
|
-
}
|
3466
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
3467
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
3468
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
3469
|
-
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");
|
3470
|
-
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
3471
|
-
}
|
3472
|
-
function processCreateParams(params) {
|
3473
|
-
if (!params)
|
3474
|
-
return {};
|
3475
|
-
const { errorMap: errorMap2, invalid_type_error, required_error, description } = params;
|
3476
|
-
if (errorMap2 && (invalid_type_error || required_error)) {
|
3477
|
-
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
3478
|
-
}
|
3479
|
-
if (errorMap2)
|
3480
|
-
return { errorMap: errorMap2, description };
|
3481
|
-
const customMap = (iss, ctx) => {
|
3482
|
-
var _a437, _b326;
|
3483
|
-
const { message } = params;
|
3484
|
-
if (iss.code === "invalid_enum_value") {
|
3485
|
-
return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
|
3486
|
-
}
|
3487
|
-
if (typeof ctx.data === "undefined") {
|
3488
|
-
return { message: (_a437 = message !== null && message !== void 0 ? message : required_error) !== null && _a437 !== void 0 ? _a437 : ctx.defaultError };
|
3489
|
-
}
|
3490
|
-
if (iss.code !== "invalid_type")
|
3491
|
-
return { message: ctx.defaultError };
|
3492
|
-
return { message: (_b326 = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b326 !== void 0 ? _b326 : ctx.defaultError };
|
3493
|
-
};
|
3494
|
-
return { errorMap: customMap, description };
|
3495
|
-
}
|
3496
|
-
function timeRegexSource(args) {
|
3497
|
-
let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
|
3498
|
-
if (args.precision) {
|
3499
|
-
regex = `${regex}\\.\\d{${args.precision}}`;
|
3500
|
-
} else if (args.precision == null) {
|
3501
|
-
regex = `${regex}(\\.\\d+)?`;
|
3502
|
-
}
|
3503
|
-
return regex;
|
3504
|
-
}
|
3505
|
-
function timeRegex(args) {
|
3506
|
-
return new RegExp(`^${timeRegexSource(args)}$`);
|
3507
|
-
}
|
3508
|
-
function datetimeRegex(args) {
|
3509
|
-
let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
|
3510
|
-
const opts = [];
|
3511
|
-
opts.push(args.local ? `Z?` : `Z`);
|
3512
|
-
if (args.offset)
|
3513
|
-
opts.push(`([+-]\\d{2}:?\\d{2})`);
|
3514
|
-
regex = `${regex}(${opts.join("|")})`;
|
3515
|
-
return new RegExp(`^${regex}$`);
|
3516
|
-
}
|
3517
|
-
function isValidIP(ip, version2) {
|
3518
|
-
if ((version2 === "v4" || !version2) && ipv4Regex.test(ip)) {
|
3519
|
-
return true;
|
3520
|
-
}
|
3521
|
-
if ((version2 === "v6" || !version2) && ipv6Regex.test(ip)) {
|
3522
|
-
return true;
|
3523
|
-
}
|
3524
|
-
return false;
|
3525
|
-
}
|
3526
|
-
function floatSafeRemainder(val, step) {
|
3527
|
-
const valDecCount = (val.toString().split(".")[1] || "").length;
|
3528
|
-
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
3529
|
-
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
3530
|
-
const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
|
3531
|
-
const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
|
3532
|
-
return valInt % stepInt / Math.pow(10, decCount);
|
3533
|
-
}
|
3534
|
-
function deepPartialify(schema5) {
|
3535
|
-
if (schema5 instanceof ZodObject) {
|
3536
|
-
const newShape = {};
|
3537
|
-
for (const key in schema5.shape) {
|
3538
|
-
const fieldSchema = schema5.shape[key];
|
3539
|
-
newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
|
3540
|
-
}
|
3541
|
-
return new ZodObject({
|
3542
|
-
...schema5._def,
|
3543
|
-
shape: () => newShape
|
3544
|
-
});
|
3545
|
-
} else if (schema5 instanceof ZodArray) {
|
3546
|
-
return new ZodArray({
|
3547
|
-
...schema5._def,
|
3548
|
-
type: deepPartialify(schema5.element)
|
3549
|
-
});
|
3550
|
-
} else if (schema5 instanceof ZodOptional) {
|
3551
|
-
return ZodOptional.create(deepPartialify(schema5.unwrap()));
|
3552
|
-
} else if (schema5 instanceof ZodNullable) {
|
3553
|
-
return ZodNullable.create(deepPartialify(schema5.unwrap()));
|
3554
|
-
} else if (schema5 instanceof ZodTuple) {
|
3555
|
-
return ZodTuple.create(schema5.items.map((item) => deepPartialify(item)));
|
3556
|
-
} else {
|
3557
|
-
return schema5;
|
3558
|
-
}
|
3559
|
-
}
|
3560
|
-
function mergeValues(a, b) {
|
3561
|
-
const aType = getParsedType(a);
|
3562
|
-
const bType = getParsedType(b);
|
3563
|
-
if (a === b) {
|
3564
|
-
return { valid: true, data: a };
|
3565
|
-
} else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
|
3566
|
-
const bKeys = util.objectKeys(b);
|
3567
|
-
const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
|
3568
|
-
const newObj = { ...a, ...b };
|
3569
|
-
for (const key of sharedKeys) {
|
3570
|
-
const sharedValue = mergeValues(a[key], b[key]);
|
3571
|
-
if (!sharedValue.valid) {
|
3572
|
-
return { valid: false };
|
3573
|
-
}
|
3574
|
-
newObj[key] = sharedValue.data;
|
3575
|
-
}
|
3576
|
-
return { valid: true, data: newObj };
|
3577
|
-
} else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
|
3578
|
-
if (a.length !== b.length) {
|
3579
|
-
return { valid: false };
|
3580
|
-
}
|
3581
|
-
const newArray = [];
|
3582
|
-
for (let index6 = 0; index6 < a.length; index6++) {
|
3583
|
-
const itemA = a[index6];
|
3584
|
-
const itemB = b[index6];
|
3585
|
-
const sharedValue = mergeValues(itemA, itemB);
|
3586
|
-
if (!sharedValue.valid) {
|
3587
|
-
return { valid: false };
|
3588
|
-
}
|
3589
|
-
newArray.push(sharedValue.data);
|
3590
|
-
}
|
3591
|
-
return { valid: true, data: newArray };
|
3592
|
-
} else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
|
3593
|
-
return { valid: true, data: a };
|
3594
|
-
} else {
|
3595
|
-
return { valid: false };
|
3596
|
-
}
|
3597
|
-
}
|
3598
|
-
function createZodEnum(values, params) {
|
3599
|
-
return new ZodEnum({
|
3600
|
-
values,
|
3601
|
-
typeName: ZodFirstPartyTypeKind.ZodEnum,
|
3602
|
-
...processCreateParams(params)
|
3603
|
-
});
|
3604
|
-
}
|
3605
|
-
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;
|
3606
|
-
var init_lib = __esm({
|
3607
|
-
"../node_modules/.pnpm/zod@3.23.7/node_modules/zod/lib/index.mjs"() {
|
3441
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/util.js
|
3442
|
+
var util, objectUtil, ZodParsedType, getParsedType;
|
3443
|
+
var init_util = __esm({
|
3444
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/util.js"() {
|
3608
3445
|
"use strict";
|
3609
3446
|
(function(util2) {
|
3610
|
-
util2.assertEqual = (
|
3447
|
+
util2.assertEqual = (_2) => {
|
3448
|
+
};
|
3611
3449
|
function assertIs(_arg) {
|
3612
3450
|
}
|
3613
3451
|
util2.assertIs = assertIs;
|
@@ -3651,7 +3489,7 @@ var init_lib = __esm({
|
|
3651
3489
|
}
|
3652
3490
|
return void 0;
|
3653
3491
|
};
|
3654
|
-
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
3492
|
+
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
3655
3493
|
function joinValues(array2, separator = " | ") {
|
3656
3494
|
return array2.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
3657
3495
|
}
|
@@ -3702,7 +3540,7 @@ var init_lib = __esm({
|
|
3702
3540
|
case "string":
|
3703
3541
|
return ZodParsedType.string;
|
3704
3542
|
case "number":
|
3705
|
-
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
3543
|
+
return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
3706
3544
|
case "boolean":
|
3707
3545
|
return ZodParsedType.boolean;
|
3708
3546
|
case "function":
|
@@ -3735,6 +3573,15 @@ var init_lib = __esm({
|
|
3735
3573
|
return ZodParsedType.unknown;
|
3736
3574
|
}
|
3737
3575
|
};
|
3576
|
+
}
|
3577
|
+
});
|
3578
|
+
|
3579
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/ZodError.js
|
3580
|
+
var ZodIssueCode, ZodError;
|
3581
|
+
var init_ZodError = __esm({
|
3582
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/ZodError.js"() {
|
3583
|
+
"use strict";
|
3584
|
+
init_util();
|
3738
3585
|
ZodIssueCode = util.arrayToEnum([
|
3739
3586
|
"invalid_type",
|
3740
3587
|
"invalid_literal",
|
@@ -3754,6 +3601,9 @@ var init_lib = __esm({
|
|
3754
3601
|
"not_finite"
|
3755
3602
|
]);
|
3756
3603
|
ZodError = class _ZodError extends Error {
|
3604
|
+
get errors() {
|
3605
|
+
return this.issues;
|
3606
|
+
}
|
3757
3607
|
constructor(issues) {
|
3758
3608
|
super();
|
3759
3609
|
this.issues = [];
|
@@ -3772,9 +3622,6 @@ var init_lib = __esm({
|
|
3772
3622
|
this.name = "ZodError";
|
3773
3623
|
this.issues = issues;
|
3774
3624
|
}
|
3775
|
-
get errors() {
|
3776
|
-
return this.issues;
|
3777
|
-
}
|
3778
3625
|
format(_mapper) {
|
3779
3626
|
const mapper = _mapper || function(issue) {
|
3780
3627
|
return issue.message;
|
@@ -3846,6 +3693,16 @@ var init_lib = __esm({
|
|
3846
3693
|
const error2 = new ZodError(issues);
|
3847
3694
|
return error2;
|
3848
3695
|
};
|
3696
|
+
}
|
3697
|
+
});
|
3698
|
+
|
3699
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/locales/en.js
|
3700
|
+
var errorMap, en_default;
|
3701
|
+
var init_en = __esm({
|
3702
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/locales/en.js"() {
|
3703
|
+
"use strict";
|
3704
|
+
init_ZodError();
|
3705
|
+
init_util();
|
3849
3706
|
errorMap = (issue, _ctx) => {
|
3850
3707
|
let message;
|
3851
3708
|
switch (issue.code) {
|
@@ -3944,7 +3801,49 @@ var init_lib = __esm({
|
|
3944
3801
|
}
|
3945
3802
|
return { message };
|
3946
3803
|
};
|
3947
|
-
|
3804
|
+
en_default = errorMap;
|
3805
|
+
}
|
3806
|
+
});
|
3807
|
+
|
3808
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/errors.js
|
3809
|
+
function getErrorMap() {
|
3810
|
+
return overrideErrorMap;
|
3811
|
+
}
|
3812
|
+
var overrideErrorMap;
|
3813
|
+
var init_errors = __esm({
|
3814
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/errors.js"() {
|
3815
|
+
"use strict";
|
3816
|
+
init_en();
|
3817
|
+
overrideErrorMap = en_default;
|
3818
|
+
}
|
3819
|
+
});
|
3820
|
+
|
3821
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/parseUtil.js
|
3822
|
+
function addIssueToContext(ctx, issueData) {
|
3823
|
+
const overrideMap = getErrorMap();
|
3824
|
+
const issue = makeIssue({
|
3825
|
+
issueData,
|
3826
|
+
data: ctx.data,
|
3827
|
+
path: ctx.path,
|
3828
|
+
errorMaps: [
|
3829
|
+
ctx.common.contextualErrorMap,
|
3830
|
+
// contextual error map is first priority
|
3831
|
+
ctx.schemaErrorMap,
|
3832
|
+
// then schema-bound map if available
|
3833
|
+
overrideMap,
|
3834
|
+
// then global override map
|
3835
|
+
overrideMap === en_default ? void 0 : en_default
|
3836
|
+
// then global default map
|
3837
|
+
].filter((x) => !!x)
|
3838
|
+
});
|
3839
|
+
ctx.common.issues.push(issue);
|
3840
|
+
}
|
3841
|
+
var makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync;
|
3842
|
+
var init_parseUtil = __esm({
|
3843
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/parseUtil.js"() {
|
3844
|
+
"use strict";
|
3845
|
+
init_errors();
|
3846
|
+
init_en();
|
3948
3847
|
makeIssue = (params) => {
|
3949
3848
|
const { data, path: path2, errorMaps, issueData } = params;
|
3950
3849
|
const fullPath = [...path2, ...issueData.path || []];
|
@@ -4033,10 +3932,200 @@ var init_lib = __esm({
|
|
4033
3932
|
isDirty = (x) => x.status === "dirty";
|
4034
3933
|
isValid = (x) => x.status === "valid";
|
4035
3934
|
isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
3935
|
+
}
|
3936
|
+
});
|
3937
|
+
|
3938
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/typeAliases.js
|
3939
|
+
var init_typeAliases = __esm({
|
3940
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/typeAliases.js"() {
|
3941
|
+
"use strict";
|
3942
|
+
}
|
3943
|
+
});
|
3944
|
+
|
3945
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/errorUtil.js
|
3946
|
+
var errorUtil;
|
3947
|
+
var init_errorUtil = __esm({
|
3948
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/errorUtil.js"() {
|
3949
|
+
"use strict";
|
4036
3950
|
(function(errorUtil2) {
|
4037
3951
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
4038
|
-
errorUtil2.toString = (message) => typeof message === "string" ? message : message
|
3952
|
+
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
4039
3953
|
})(errorUtil || (errorUtil = {}));
|
3954
|
+
}
|
3955
|
+
});
|
3956
|
+
|
3957
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/types.js
|
3958
|
+
function processCreateParams(params) {
|
3959
|
+
if (!params)
|
3960
|
+
return {};
|
3961
|
+
const { errorMap: errorMap2, invalid_type_error, required_error, description } = params;
|
3962
|
+
if (errorMap2 && (invalid_type_error || required_error)) {
|
3963
|
+
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
3964
|
+
}
|
3965
|
+
if (errorMap2)
|
3966
|
+
return { errorMap: errorMap2, description };
|
3967
|
+
const customMap = (iss, ctx) => {
|
3968
|
+
const { message } = params;
|
3969
|
+
if (iss.code === "invalid_enum_value") {
|
3970
|
+
return { message: message ?? ctx.defaultError };
|
3971
|
+
}
|
3972
|
+
if (typeof ctx.data === "undefined") {
|
3973
|
+
return { message: message ?? required_error ?? ctx.defaultError };
|
3974
|
+
}
|
3975
|
+
if (iss.code !== "invalid_type")
|
3976
|
+
return { message: ctx.defaultError };
|
3977
|
+
return { message: message ?? invalid_type_error ?? ctx.defaultError };
|
3978
|
+
};
|
3979
|
+
return { errorMap: customMap, description };
|
3980
|
+
}
|
3981
|
+
function timeRegexSource(args) {
|
3982
|
+
let secondsRegexSource = `[0-5]\\d`;
|
3983
|
+
if (args.precision) {
|
3984
|
+
secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
|
3985
|
+
} else if (args.precision == null) {
|
3986
|
+
secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
|
3987
|
+
}
|
3988
|
+
const secondsQuantifier = args.precision ? "+" : "?";
|
3989
|
+
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
3990
|
+
}
|
3991
|
+
function timeRegex(args) {
|
3992
|
+
return new RegExp(`^${timeRegexSource(args)}$`);
|
3993
|
+
}
|
3994
|
+
function datetimeRegex(args) {
|
3995
|
+
let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
|
3996
|
+
const opts = [];
|
3997
|
+
opts.push(args.local ? `Z?` : `Z`);
|
3998
|
+
if (args.offset)
|
3999
|
+
opts.push(`([+-]\\d{2}:?\\d{2})`);
|
4000
|
+
regex = `${regex}(${opts.join("|")})`;
|
4001
|
+
return new RegExp(`^${regex}$`);
|
4002
|
+
}
|
4003
|
+
function isValidIP(ip, version2) {
|
4004
|
+
if ((version2 === "v4" || !version2) && ipv4Regex.test(ip)) {
|
4005
|
+
return true;
|
4006
|
+
}
|
4007
|
+
if ((version2 === "v6" || !version2) && ipv6Regex.test(ip)) {
|
4008
|
+
return true;
|
4009
|
+
}
|
4010
|
+
return false;
|
4011
|
+
}
|
4012
|
+
function isValidJWT(jwt, alg) {
|
4013
|
+
if (!jwtRegex.test(jwt))
|
4014
|
+
return false;
|
4015
|
+
try {
|
4016
|
+
const [header] = jwt.split(".");
|
4017
|
+
const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
4018
|
+
const decoded = JSON.parse(atob(base64));
|
4019
|
+
if (typeof decoded !== "object" || decoded === null)
|
4020
|
+
return false;
|
4021
|
+
if ("typ" in decoded && decoded?.typ !== "JWT")
|
4022
|
+
return false;
|
4023
|
+
if (!decoded.alg)
|
4024
|
+
return false;
|
4025
|
+
if (alg && decoded.alg !== alg)
|
4026
|
+
return false;
|
4027
|
+
return true;
|
4028
|
+
} catch {
|
4029
|
+
return false;
|
4030
|
+
}
|
4031
|
+
}
|
4032
|
+
function isValidCidr(ip, version2) {
|
4033
|
+
if ((version2 === "v4" || !version2) && ipv4CidrRegex.test(ip)) {
|
4034
|
+
return true;
|
4035
|
+
}
|
4036
|
+
if ((version2 === "v6" || !version2) && ipv6CidrRegex.test(ip)) {
|
4037
|
+
return true;
|
4038
|
+
}
|
4039
|
+
return false;
|
4040
|
+
}
|
4041
|
+
function floatSafeRemainder(val, step) {
|
4042
|
+
const valDecCount = (val.toString().split(".")[1] || "").length;
|
4043
|
+
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
4044
|
+
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
4045
|
+
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
4046
|
+
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
4047
|
+
return valInt % stepInt / 10 ** decCount;
|
4048
|
+
}
|
4049
|
+
function deepPartialify(schema5) {
|
4050
|
+
if (schema5 instanceof ZodObject) {
|
4051
|
+
const newShape = {};
|
4052
|
+
for (const key in schema5.shape) {
|
4053
|
+
const fieldSchema = schema5.shape[key];
|
4054
|
+
newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
|
4055
|
+
}
|
4056
|
+
return new ZodObject({
|
4057
|
+
...schema5._def,
|
4058
|
+
shape: () => newShape
|
4059
|
+
});
|
4060
|
+
} else if (schema5 instanceof ZodArray) {
|
4061
|
+
return new ZodArray({
|
4062
|
+
...schema5._def,
|
4063
|
+
type: deepPartialify(schema5.element)
|
4064
|
+
});
|
4065
|
+
} else if (schema5 instanceof ZodOptional) {
|
4066
|
+
return ZodOptional.create(deepPartialify(schema5.unwrap()));
|
4067
|
+
} else if (schema5 instanceof ZodNullable) {
|
4068
|
+
return ZodNullable.create(deepPartialify(schema5.unwrap()));
|
4069
|
+
} else if (schema5 instanceof ZodTuple) {
|
4070
|
+
return ZodTuple.create(schema5.items.map((item) => deepPartialify(item)));
|
4071
|
+
} else {
|
4072
|
+
return schema5;
|
4073
|
+
}
|
4074
|
+
}
|
4075
|
+
function mergeValues(a, b) {
|
4076
|
+
const aType = getParsedType(a);
|
4077
|
+
const bType = getParsedType(b);
|
4078
|
+
if (a === b) {
|
4079
|
+
return { valid: true, data: a };
|
4080
|
+
} else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
|
4081
|
+
const bKeys = util.objectKeys(b);
|
4082
|
+
const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
|
4083
|
+
const newObj = { ...a, ...b };
|
4084
|
+
for (const key of sharedKeys) {
|
4085
|
+
const sharedValue = mergeValues(a[key], b[key]);
|
4086
|
+
if (!sharedValue.valid) {
|
4087
|
+
return { valid: false };
|
4088
|
+
}
|
4089
|
+
newObj[key] = sharedValue.data;
|
4090
|
+
}
|
4091
|
+
return { valid: true, data: newObj };
|
4092
|
+
} else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
|
4093
|
+
if (a.length !== b.length) {
|
4094
|
+
return { valid: false };
|
4095
|
+
}
|
4096
|
+
const newArray = [];
|
4097
|
+
for (let index6 = 0; index6 < a.length; index6++) {
|
4098
|
+
const itemA = a[index6];
|
4099
|
+
const itemB = b[index6];
|
4100
|
+
const sharedValue = mergeValues(itemA, itemB);
|
4101
|
+
if (!sharedValue.valid) {
|
4102
|
+
return { valid: false };
|
4103
|
+
}
|
4104
|
+
newArray.push(sharedValue.data);
|
4105
|
+
}
|
4106
|
+
return { valid: true, data: newArray };
|
4107
|
+
} else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
|
4108
|
+
return { valid: true, data: a };
|
4109
|
+
} else {
|
4110
|
+
return { valid: false };
|
4111
|
+
}
|
4112
|
+
}
|
4113
|
+
function createZodEnum(values, params) {
|
4114
|
+
return new ZodEnum({
|
4115
|
+
values,
|
4116
|
+
typeName: ZodFirstPartyTypeKind.ZodEnum,
|
4117
|
+
...processCreateParams(params)
|
4118
|
+
});
|
4119
|
+
}
|
4120
|
+
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;
|
4121
|
+
var init_types = __esm({
|
4122
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/types.js"() {
|
4123
|
+
"use strict";
|
4124
|
+
init_ZodError();
|
4125
|
+
init_errors();
|
4126
|
+
init_errorUtil();
|
4127
|
+
init_parseUtil();
|
4128
|
+
init_util();
|
4040
4129
|
ParseInputLazyPath = class {
|
4041
4130
|
constructor(parent, value, path2, key) {
|
4042
4131
|
this._cachedPath = [];
|
@@ -4047,7 +4136,7 @@ var init_lib = __esm({
|
|
4047
4136
|
}
|
4048
4137
|
get path() {
|
4049
4138
|
if (!this._cachedPath.length) {
|
4050
|
-
if (this._key
|
4139
|
+
if (Array.isArray(this._key)) {
|
4051
4140
|
this._cachedPath.push(...this._path, ...this._key);
|
4052
4141
|
} else {
|
4053
4142
|
this._cachedPath.push(...this._path, this._key);
|
@@ -4076,34 +4165,6 @@ var init_lib = __esm({
|
|
4076
4165
|
}
|
4077
4166
|
};
|
4078
4167
|
ZodType = class {
|
4079
|
-
constructor(def) {
|
4080
|
-
this.spa = this.safeParseAsync;
|
4081
|
-
this._def = def;
|
4082
|
-
this.parse = this.parse.bind(this);
|
4083
|
-
this.safeParse = this.safeParse.bind(this);
|
4084
|
-
this.parseAsync = this.parseAsync.bind(this);
|
4085
|
-
this.safeParseAsync = this.safeParseAsync.bind(this);
|
4086
|
-
this.spa = this.spa.bind(this);
|
4087
|
-
this.refine = this.refine.bind(this);
|
4088
|
-
this.refinement = this.refinement.bind(this);
|
4089
|
-
this.superRefine = this.superRefine.bind(this);
|
4090
|
-
this.optional = this.optional.bind(this);
|
4091
|
-
this.nullable = this.nullable.bind(this);
|
4092
|
-
this.nullish = this.nullish.bind(this);
|
4093
|
-
this.array = this.array.bind(this);
|
4094
|
-
this.promise = this.promise.bind(this);
|
4095
|
-
this.or = this.or.bind(this);
|
4096
|
-
this.and = this.and.bind(this);
|
4097
|
-
this.transform = this.transform.bind(this);
|
4098
|
-
this.brand = this.brand.bind(this);
|
4099
|
-
this.default = this.default.bind(this);
|
4100
|
-
this.catch = this.catch.bind(this);
|
4101
|
-
this.describe = this.describe.bind(this);
|
4102
|
-
this.pipe = this.pipe.bind(this);
|
4103
|
-
this.readonly = this.readonly.bind(this);
|
4104
|
-
this.isNullable = this.isNullable.bind(this);
|
4105
|
-
this.isOptional = this.isOptional.bind(this);
|
4106
|
-
}
|
4107
4168
|
get description() {
|
4108
4169
|
return this._def.description;
|
4109
4170
|
}
|
@@ -4151,14 +4212,13 @@ var init_lib = __esm({
|
|
4151
4212
|
throw result.error;
|
4152
4213
|
}
|
4153
4214
|
safeParse(data, params) {
|
4154
|
-
var _a437;
|
4155
4215
|
const ctx = {
|
4156
4216
|
common: {
|
4157
4217
|
issues: [],
|
4158
|
-
async:
|
4159
|
-
contextualErrorMap: params
|
4218
|
+
async: params?.async ?? false,
|
4219
|
+
contextualErrorMap: params?.errorMap
|
4160
4220
|
},
|
4161
|
-
path:
|
4221
|
+
path: params?.path || [],
|
4162
4222
|
schemaErrorMap: this._def.errorMap,
|
4163
4223
|
parent: null,
|
4164
4224
|
data,
|
@@ -4167,6 +4227,42 @@ var init_lib = __esm({
|
|
4167
4227
|
const result = this._parseSync({ data, path: ctx.path, parent: ctx });
|
4168
4228
|
return handleResult(ctx, result);
|
4169
4229
|
}
|
4230
|
+
"~validate"(data) {
|
4231
|
+
const ctx = {
|
4232
|
+
common: {
|
4233
|
+
issues: [],
|
4234
|
+
async: !!this["~standard"].async
|
4235
|
+
},
|
4236
|
+
path: [],
|
4237
|
+
schemaErrorMap: this._def.errorMap,
|
4238
|
+
parent: null,
|
4239
|
+
data,
|
4240
|
+
parsedType: getParsedType(data)
|
4241
|
+
};
|
4242
|
+
if (!this["~standard"].async) {
|
4243
|
+
try {
|
4244
|
+
const result = this._parseSync({ data, path: [], parent: ctx });
|
4245
|
+
return isValid(result) ? {
|
4246
|
+
value: result.value
|
4247
|
+
} : {
|
4248
|
+
issues: ctx.common.issues
|
4249
|
+
};
|
4250
|
+
} catch (err) {
|
4251
|
+
if (err?.message?.toLowerCase()?.includes("encountered")) {
|
4252
|
+
this["~standard"].async = true;
|
4253
|
+
}
|
4254
|
+
ctx.common = {
|
4255
|
+
issues: [],
|
4256
|
+
async: true
|
4257
|
+
};
|
4258
|
+
}
|
4259
|
+
}
|
4260
|
+
return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
|
4261
|
+
value: result.value
|
4262
|
+
} : {
|
4263
|
+
issues: ctx.common.issues
|
4264
|
+
});
|
4265
|
+
}
|
4170
4266
|
async parseAsync(data, params) {
|
4171
4267
|
const result = await this.safeParseAsync(data, params);
|
4172
4268
|
if (result.success)
|
@@ -4177,10 +4273,10 @@ var init_lib = __esm({
|
|
4177
4273
|
const ctx = {
|
4178
4274
|
common: {
|
4179
4275
|
issues: [],
|
4180
|
-
contextualErrorMap: params
|
4276
|
+
contextualErrorMap: params?.errorMap,
|
4181
4277
|
async: true
|
4182
4278
|
},
|
4183
|
-
path:
|
4279
|
+
path: params?.path || [],
|
4184
4280
|
schemaErrorMap: this._def.errorMap,
|
4185
4281
|
parent: null,
|
4186
4282
|
data,
|
@@ -4244,6 +4340,39 @@ var init_lib = __esm({
|
|
4244
4340
|
superRefine(refinement) {
|
4245
4341
|
return this._refinement(refinement);
|
4246
4342
|
}
|
4343
|
+
constructor(def) {
|
4344
|
+
this.spa = this.safeParseAsync;
|
4345
|
+
this._def = def;
|
4346
|
+
this.parse = this.parse.bind(this);
|
4347
|
+
this.safeParse = this.safeParse.bind(this);
|
4348
|
+
this.parseAsync = this.parseAsync.bind(this);
|
4349
|
+
this.safeParseAsync = this.safeParseAsync.bind(this);
|
4350
|
+
this.spa = this.spa.bind(this);
|
4351
|
+
this.refine = this.refine.bind(this);
|
4352
|
+
this.refinement = this.refinement.bind(this);
|
4353
|
+
this.superRefine = this.superRefine.bind(this);
|
4354
|
+
this.optional = this.optional.bind(this);
|
4355
|
+
this.nullable = this.nullable.bind(this);
|
4356
|
+
this.nullish = this.nullish.bind(this);
|
4357
|
+
this.array = this.array.bind(this);
|
4358
|
+
this.promise = this.promise.bind(this);
|
4359
|
+
this.or = this.or.bind(this);
|
4360
|
+
this.and = this.and.bind(this);
|
4361
|
+
this.transform = this.transform.bind(this);
|
4362
|
+
this.brand = this.brand.bind(this);
|
4363
|
+
this.default = this.default.bind(this);
|
4364
|
+
this.catch = this.catch.bind(this);
|
4365
|
+
this.describe = this.describe.bind(this);
|
4366
|
+
this.pipe = this.pipe.bind(this);
|
4367
|
+
this.readonly = this.readonly.bind(this);
|
4368
|
+
this.isNullable = this.isNullable.bind(this);
|
4369
|
+
this.isOptional = this.isOptional.bind(this);
|
4370
|
+
this["~standard"] = {
|
4371
|
+
version: 1,
|
4372
|
+
vendor: "zod",
|
4373
|
+
validate: (data) => this["~validate"](data)
|
4374
|
+
};
|
4375
|
+
}
|
4247
4376
|
optional() {
|
4248
4377
|
return ZodOptional.create(this, this._def);
|
4249
4378
|
}
|
@@ -4254,7 +4383,7 @@ var init_lib = __esm({
|
|
4254
4383
|
return this.nullable().optional();
|
4255
4384
|
}
|
4256
4385
|
array() {
|
4257
|
-
return ZodArray.create(this
|
4386
|
+
return ZodArray.create(this);
|
4258
4387
|
}
|
4259
4388
|
promise() {
|
4260
4389
|
return ZodPromise.create(this, this._def);
|
@@ -4320,15 +4449,19 @@ var init_lib = __esm({
|
|
4320
4449
|
};
|
4321
4450
|
cuidRegex = /^c[^\s-]{8,}$/i;
|
4322
4451
|
cuid2Regex = /^[0-9a-z]+$/;
|
4323
|
-
ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}
|
4452
|
+
ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
|
4324
4453
|
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;
|
4325
4454
|
nanoidRegex = /^[a-z0-9_-]{21}$/i;
|
4455
|
+
jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
|
4326
4456
|
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)?)??$/;
|
4327
4457
|
emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
4328
4458
|
_emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
4329
4459
|
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])$/;
|
4330
|
-
|
4460
|
+
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])$/;
|
4461
|
+
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]))$/;
|
4462
|
+
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])$/;
|
4331
4463
|
base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
4464
|
+
base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
|
4332
4465
|
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])))`;
|
4333
4466
|
dateRegex = new RegExp(`^${dateRegexSource}$`);
|
4334
4467
|
ZodString = class _ZodString extends ZodType {
|
@@ -4477,7 +4610,7 @@ var init_lib = __esm({
|
|
4477
4610
|
} else if (check.kind === "url") {
|
4478
4611
|
try {
|
4479
4612
|
new URL(input.data);
|
4480
|
-
} catch
|
4613
|
+
} catch {
|
4481
4614
|
ctx = this._getOrReturnCtx(input, ctx);
|
4482
4615
|
addIssueToContext(ctx, {
|
4483
4616
|
validation: "url",
|
@@ -4587,6 +4720,26 @@ var init_lib = __esm({
|
|
4587
4720
|
});
|
4588
4721
|
status.dirty();
|
4589
4722
|
}
|
4723
|
+
} else if (check.kind === "jwt") {
|
4724
|
+
if (!isValidJWT(input.data, check.alg)) {
|
4725
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
4726
|
+
addIssueToContext(ctx, {
|
4727
|
+
validation: "jwt",
|
4728
|
+
code: ZodIssueCode.invalid_string,
|
4729
|
+
message: check.message
|
4730
|
+
});
|
4731
|
+
status.dirty();
|
4732
|
+
}
|
4733
|
+
} else if (check.kind === "cidr") {
|
4734
|
+
if (!isValidCidr(input.data, check.version)) {
|
4735
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
4736
|
+
addIssueToContext(ctx, {
|
4737
|
+
validation: "cidr",
|
4738
|
+
code: ZodIssueCode.invalid_string,
|
4739
|
+
message: check.message
|
4740
|
+
});
|
4741
|
+
status.dirty();
|
4742
|
+
}
|
4590
4743
|
} else if (check.kind === "base64") {
|
4591
4744
|
if (!base64Regex.test(input.data)) {
|
4592
4745
|
ctx = this._getOrReturnCtx(input, ctx);
|
@@ -4597,6 +4750,16 @@ var init_lib = __esm({
|
|
4597
4750
|
});
|
4598
4751
|
status.dirty();
|
4599
4752
|
}
|
4753
|
+
} else if (check.kind === "base64url") {
|
4754
|
+
if (!base64urlRegex.test(input.data)) {
|
4755
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
4756
|
+
addIssueToContext(ctx, {
|
4757
|
+
validation: "base64url",
|
4758
|
+
code: ZodIssueCode.invalid_string,
|
4759
|
+
message: check.message
|
4760
|
+
});
|
4761
|
+
status.dirty();
|
4762
|
+
}
|
4600
4763
|
} else {
|
4601
4764
|
util.assertNever(check);
|
4602
4765
|
}
|
@@ -4643,11 +4806,22 @@ var init_lib = __esm({
|
|
4643
4806
|
base64(message) {
|
4644
4807
|
return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
|
4645
4808
|
}
|
4809
|
+
base64url(message) {
|
4810
|
+
return this._addCheck({
|
4811
|
+
kind: "base64url",
|
4812
|
+
...errorUtil.errToObj(message)
|
4813
|
+
});
|
4814
|
+
}
|
4815
|
+
jwt(options) {
|
4816
|
+
return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
|
4817
|
+
}
|
4646
4818
|
ip(options) {
|
4647
4819
|
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
|
4648
4820
|
}
|
4821
|
+
cidr(options) {
|
4822
|
+
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
4823
|
+
}
|
4649
4824
|
datetime(options) {
|
4650
|
-
var _a437, _b326;
|
4651
4825
|
if (typeof options === "string") {
|
4652
4826
|
return this._addCheck({
|
4653
4827
|
kind: "datetime",
|
@@ -4659,10 +4833,10 @@ var init_lib = __esm({
|
|
4659
4833
|
}
|
4660
4834
|
return this._addCheck({
|
4661
4835
|
kind: "datetime",
|
4662
|
-
precision: typeof
|
4663
|
-
offset:
|
4664
|
-
local:
|
4665
|
-
...errorUtil.errToObj(options
|
4836
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
4837
|
+
offset: options?.offset ?? false,
|
4838
|
+
local: options?.local ?? false,
|
4839
|
+
...errorUtil.errToObj(options?.message)
|
4666
4840
|
});
|
4667
4841
|
}
|
4668
4842
|
date(message) {
|
@@ -4678,8 +4852,8 @@ var init_lib = __esm({
|
|
4678
4852
|
}
|
4679
4853
|
return this._addCheck({
|
4680
4854
|
kind: "time",
|
4681
|
-
precision: typeof
|
4682
|
-
...errorUtil.errToObj(options
|
4855
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
4856
|
+
...errorUtil.errToObj(options?.message)
|
4683
4857
|
});
|
4684
4858
|
}
|
4685
4859
|
duration(message) {
|
@@ -4696,8 +4870,8 @@ var init_lib = __esm({
|
|
4696
4870
|
return this._addCheck({
|
4697
4871
|
kind: "includes",
|
4698
4872
|
value,
|
4699
|
-
position: options
|
4700
|
-
...errorUtil.errToObj(options
|
4873
|
+
position: options?.position,
|
4874
|
+
...errorUtil.errToObj(options?.message)
|
4701
4875
|
});
|
4702
4876
|
}
|
4703
4877
|
startsWith(value, message) {
|
@@ -4736,8 +4910,7 @@ var init_lib = __esm({
|
|
4736
4910
|
});
|
4737
4911
|
}
|
4738
4912
|
/**
|
4739
|
-
*
|
4740
|
-
* @see {@link ZodString.min}
|
4913
|
+
* Equivalent to `.min(1)`
|
4741
4914
|
*/
|
4742
4915
|
nonempty(message) {
|
4743
4916
|
return this.min(1, errorUtil.errToObj(message));
|
@@ -4799,9 +4972,15 @@ var init_lib = __esm({
|
|
4799
4972
|
get isIP() {
|
4800
4973
|
return !!this._def.checks.find((ch) => ch.kind === "ip");
|
4801
4974
|
}
|
4975
|
+
get isCIDR() {
|
4976
|
+
return !!this._def.checks.find((ch) => ch.kind === "cidr");
|
4977
|
+
}
|
4802
4978
|
get isBase64() {
|
4803
4979
|
return !!this._def.checks.find((ch) => ch.kind === "base64");
|
4804
4980
|
}
|
4981
|
+
get isBase64url() {
|
4982
|
+
return !!this._def.checks.find((ch) => ch.kind === "base64url");
|
4983
|
+
}
|
4805
4984
|
get minLength() {
|
4806
4985
|
let min2 = null;
|
4807
4986
|
for (const ch of this._def.checks) {
|
@@ -4824,11 +5003,10 @@ var init_lib = __esm({
|
|
4824
5003
|
}
|
4825
5004
|
};
|
4826
5005
|
ZodString.create = (params) => {
|
4827
|
-
var _a437;
|
4828
5006
|
return new ZodString({
|
4829
5007
|
checks: [],
|
4830
5008
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
4831
|
-
coerce:
|
5009
|
+
coerce: params?.coerce ?? false,
|
4832
5010
|
...processCreateParams(params)
|
4833
5011
|
});
|
4834
5012
|
};
|
@@ -5040,7 +5218,8 @@ var init_lib = __esm({
|
|
5040
5218
|
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
5041
5219
|
}
|
5042
5220
|
get isFinite() {
|
5043
|
-
let max2 = null
|
5221
|
+
let max2 = null;
|
5222
|
+
let min2 = null;
|
5044
5223
|
for (const ch of this._def.checks) {
|
5045
5224
|
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
5046
5225
|
return true;
|
@@ -5059,7 +5238,7 @@ var init_lib = __esm({
|
|
5059
5238
|
return new ZodNumber({
|
5060
5239
|
checks: [],
|
5061
5240
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
5062
|
-
coerce:
|
5241
|
+
coerce: params?.coerce || false,
|
5063
5242
|
...processCreateParams(params)
|
5064
5243
|
});
|
5065
5244
|
};
|
@@ -5071,17 +5250,15 @@ var init_lib = __esm({
|
|
5071
5250
|
}
|
5072
5251
|
_parse(input) {
|
5073
5252
|
if (this._def.coerce) {
|
5074
|
-
|
5253
|
+
try {
|
5254
|
+
input.data = BigInt(input.data);
|
5255
|
+
} catch {
|
5256
|
+
return this._getInvalidInput(input);
|
5257
|
+
}
|
5075
5258
|
}
|
5076
5259
|
const parsedType = this._getType(input);
|
5077
5260
|
if (parsedType !== ZodParsedType.bigint) {
|
5078
|
-
|
5079
|
-
addIssueToContext(ctx2, {
|
5080
|
-
code: ZodIssueCode.invalid_type,
|
5081
|
-
expected: ZodParsedType.bigint,
|
5082
|
-
received: ctx2.parsedType
|
5083
|
-
});
|
5084
|
-
return INVALID;
|
5261
|
+
return this._getInvalidInput(input);
|
5085
5262
|
}
|
5086
5263
|
let ctx = void 0;
|
5087
5264
|
const status = new ParseStatus();
|
@@ -5128,6 +5305,15 @@ var init_lib = __esm({
|
|
5128
5305
|
}
|
5129
5306
|
return { status: status.value, value: input.data };
|
5130
5307
|
}
|
5308
|
+
_getInvalidInput(input) {
|
5309
|
+
const ctx = this._getOrReturnCtx(input);
|
5310
|
+
addIssueToContext(ctx, {
|
5311
|
+
code: ZodIssueCode.invalid_type,
|
5312
|
+
expected: ZodParsedType.bigint,
|
5313
|
+
received: ctx.parsedType
|
5314
|
+
});
|
5315
|
+
return INVALID;
|
5316
|
+
}
|
5131
5317
|
gte(value, message) {
|
5132
5318
|
return this.setLimit("min", value, true, errorUtil.toString(message));
|
5133
5319
|
}
|
@@ -5221,11 +5407,10 @@ var init_lib = __esm({
|
|
5221
5407
|
}
|
5222
5408
|
};
|
5223
5409
|
ZodBigInt.create = (params) => {
|
5224
|
-
var _a437;
|
5225
5410
|
return new ZodBigInt({
|
5226
5411
|
checks: [],
|
5227
5412
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
5228
|
-
coerce:
|
5413
|
+
coerce: params?.coerce ?? false,
|
5229
5414
|
...processCreateParams(params)
|
5230
5415
|
});
|
5231
5416
|
};
|
@@ -5250,7 +5435,7 @@ var init_lib = __esm({
|
|
5250
5435
|
ZodBoolean.create = (params) => {
|
5251
5436
|
return new ZodBoolean({
|
5252
5437
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
5253
|
-
coerce:
|
5438
|
+
coerce: params?.coerce || false,
|
5254
5439
|
...processCreateParams(params)
|
5255
5440
|
});
|
5256
5441
|
};
|
@@ -5269,7 +5454,7 @@ var init_lib = __esm({
|
|
5269
5454
|
});
|
5270
5455
|
return INVALID;
|
5271
5456
|
}
|
5272
|
-
if (isNaN(input.data.getTime())) {
|
5457
|
+
if (Number.isNaN(input.data.getTime())) {
|
5273
5458
|
const ctx2 = this._getOrReturnCtx(input);
|
5274
5459
|
addIssueToContext(ctx2, {
|
5275
5460
|
code: ZodIssueCode.invalid_date
|
@@ -5358,7 +5543,7 @@ var init_lib = __esm({
|
|
5358
5543
|
ZodDate.create = (params) => {
|
5359
5544
|
return new ZodDate({
|
5360
5545
|
checks: [],
|
5361
|
-
coerce:
|
5546
|
+
coerce: params?.coerce || false,
|
5362
5547
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
5363
5548
|
...processCreateParams(params)
|
5364
5549
|
});
|
@@ -5607,7 +5792,8 @@ var init_lib = __esm({
|
|
5607
5792
|
return this._cached;
|
5608
5793
|
const shape = this._def.shape();
|
5609
5794
|
const keys = util.objectKeys(shape);
|
5610
|
-
|
5795
|
+
this._cached = { shape, keys };
|
5796
|
+
return this._cached;
|
5611
5797
|
}
|
5612
5798
|
_parse(input) {
|
5613
5799
|
const parsedType = this._getType(input);
|
@@ -5657,8 +5843,8 @@ var init_lib = __esm({
|
|
5657
5843
|
});
|
5658
5844
|
status.dirty();
|
5659
5845
|
}
|
5660
|
-
} else if (unknownKeys === "strip")
|
5661
|
-
else {
|
5846
|
+
} else if (unknownKeys === "strip") {
|
5847
|
+
} else {
|
5662
5848
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
5663
5849
|
}
|
5664
5850
|
} else {
|
@@ -5705,11 +5891,10 @@ var init_lib = __esm({
|
|
5705
5891
|
unknownKeys: "strict",
|
5706
5892
|
...message !== void 0 ? {
|
5707
5893
|
errorMap: (issue, ctx) => {
|
5708
|
-
|
5709
|
-
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;
|
5894
|
+
const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
|
5710
5895
|
if (issue.code === "unrecognized_keys")
|
5711
5896
|
return {
|
5712
|
-
message:
|
5897
|
+
message: errorUtil.errToObj(message).message ?? defaultError
|
5713
5898
|
};
|
5714
5899
|
return {
|
5715
5900
|
message: defaultError
|
@@ -5840,11 +6025,11 @@ var init_lib = __esm({
|
|
5840
6025
|
}
|
5841
6026
|
pick(mask) {
|
5842
6027
|
const shape = {};
|
5843
|
-
util.objectKeys(mask)
|
6028
|
+
for (const key of util.objectKeys(mask)) {
|
5844
6029
|
if (mask[key] && this.shape[key]) {
|
5845
6030
|
shape[key] = this.shape[key];
|
5846
6031
|
}
|
5847
|
-
}
|
6032
|
+
}
|
5848
6033
|
return new _ZodObject({
|
5849
6034
|
...this._def,
|
5850
6035
|
shape: () => shape
|
@@ -5852,11 +6037,11 @@ var init_lib = __esm({
|
|
5852
6037
|
}
|
5853
6038
|
omit(mask) {
|
5854
6039
|
const shape = {};
|
5855
|
-
util.objectKeys(this.shape)
|
6040
|
+
for (const key of util.objectKeys(this.shape)) {
|
5856
6041
|
if (!mask[key]) {
|
5857
6042
|
shape[key] = this.shape[key];
|
5858
6043
|
}
|
5859
|
-
}
|
6044
|
+
}
|
5860
6045
|
return new _ZodObject({
|
5861
6046
|
...this._def,
|
5862
6047
|
shape: () => shape
|
@@ -5870,14 +6055,14 @@ var init_lib = __esm({
|
|
5870
6055
|
}
|
5871
6056
|
partial(mask) {
|
5872
6057
|
const newShape = {};
|
5873
|
-
util.objectKeys(this.shape)
|
6058
|
+
for (const key of util.objectKeys(this.shape)) {
|
5874
6059
|
const fieldSchema = this.shape[key];
|
5875
6060
|
if (mask && !mask[key]) {
|
5876
6061
|
newShape[key] = fieldSchema;
|
5877
6062
|
} else {
|
5878
6063
|
newShape[key] = fieldSchema.optional();
|
5879
6064
|
}
|
5880
|
-
}
|
6065
|
+
}
|
5881
6066
|
return new _ZodObject({
|
5882
6067
|
...this._def,
|
5883
6068
|
shape: () => newShape
|
@@ -5885,7 +6070,7 @@ var init_lib = __esm({
|
|
5885
6070
|
}
|
5886
6071
|
required(mask) {
|
5887
6072
|
const newShape = {};
|
5888
|
-
util.objectKeys(this.shape)
|
6073
|
+
for (const key of util.objectKeys(this.shape)) {
|
5889
6074
|
if (mask && !mask[key]) {
|
5890
6075
|
newShape[key] = this.shape[key];
|
5891
6076
|
} else {
|
@@ -5896,7 +6081,7 @@ var init_lib = __esm({
|
|
5896
6081
|
}
|
5897
6082
|
newShape[key] = newField;
|
5898
6083
|
}
|
5899
|
-
}
|
6084
|
+
}
|
5900
6085
|
return new _ZodObject({
|
5901
6086
|
...this._def,
|
5902
6087
|
shape: () => newShape
|
@@ -6474,12 +6659,7 @@ var init_lib = __esm({
|
|
6474
6659
|
return makeIssue({
|
6475
6660
|
data: args,
|
6476
6661
|
path: ctx.path,
|
6477
|
-
errorMaps: [
|
6478
|
-
ctx.common.contextualErrorMap,
|
6479
|
-
ctx.schemaErrorMap,
|
6480
|
-
getErrorMap(),
|
6481
|
-
errorMap
|
6482
|
-
].filter((x) => !!x),
|
6662
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
6483
6663
|
issueData: {
|
6484
6664
|
code: ZodIssueCode.invalid_arguments,
|
6485
6665
|
argumentsError: error2
|
@@ -6490,12 +6670,7 @@ var init_lib = __esm({
|
|
6490
6670
|
return makeIssue({
|
6491
6671
|
data: returns,
|
6492
6672
|
path: ctx.path,
|
6493
|
-
errorMaps: [
|
6494
|
-
ctx.common.contextualErrorMap,
|
6495
|
-
ctx.schemaErrorMap,
|
6496
|
-
getErrorMap(),
|
6497
|
-
errorMap
|
6498
|
-
].filter((x) => !!x),
|
6673
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
6499
6674
|
issueData: {
|
6500
6675
|
code: ZodIssueCode.invalid_return_type,
|
6501
6676
|
returnTypeError: error2
|
@@ -6612,10 +6787,6 @@ var init_lib = __esm({
|
|
6612
6787
|
});
|
6613
6788
|
};
|
6614
6789
|
ZodEnum = class _ZodEnum extends ZodType {
|
6615
|
-
constructor() {
|
6616
|
-
super(...arguments);
|
6617
|
-
_ZodEnum_cache.set(this, void 0);
|
6618
|
-
}
|
6619
6790
|
_parse(input) {
|
6620
6791
|
if (typeof input.data !== "string") {
|
6621
6792
|
const ctx = this._getOrReturnCtx(input);
|
@@ -6627,10 +6798,10 @@ var init_lib = __esm({
|
|
6627
6798
|
});
|
6628
6799
|
return INVALID;
|
6629
6800
|
}
|
6630
|
-
if (!
|
6631
|
-
|
6801
|
+
if (!this._cache) {
|
6802
|
+
this._cache = new Set(this._def.values);
|
6632
6803
|
}
|
6633
|
-
if (!
|
6804
|
+
if (!this._cache.has(input.data)) {
|
6634
6805
|
const ctx = this._getOrReturnCtx(input);
|
6635
6806
|
const expectedValues = this._def.values;
|
6636
6807
|
addIssueToContext(ctx, {
|
@@ -6679,13 +6850,8 @@ var init_lib = __esm({
|
|
6679
6850
|
});
|
6680
6851
|
}
|
6681
6852
|
};
|
6682
|
-
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
6683
6853
|
ZodEnum.create = createZodEnum;
|
6684
6854
|
ZodNativeEnum = class extends ZodType {
|
6685
|
-
constructor() {
|
6686
|
-
super(...arguments);
|
6687
|
-
_ZodNativeEnum_cache.set(this, void 0);
|
6688
|
-
}
|
6689
6855
|
_parse(input) {
|
6690
6856
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
6691
6857
|
const ctx = this._getOrReturnCtx(input);
|
@@ -6698,10 +6864,10 @@ var init_lib = __esm({
|
|
6698
6864
|
});
|
6699
6865
|
return INVALID;
|
6700
6866
|
}
|
6701
|
-
if (!
|
6702
|
-
|
6867
|
+
if (!this._cache) {
|
6868
|
+
this._cache = new Set(util.getValidEnumValues(this._def.values));
|
6703
6869
|
}
|
6704
|
-
if (!
|
6870
|
+
if (!this._cache.has(input.data)) {
|
6705
6871
|
const expectedValues = util.objectValues(nativeEnumValues);
|
6706
6872
|
addIssueToContext(ctx, {
|
6707
6873
|
received: ctx.data,
|
@@ -6716,7 +6882,6 @@ var init_lib = __esm({
|
|
6716
6882
|
return this._def.values;
|
6717
6883
|
}
|
6718
6884
|
};
|
6719
|
-
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
6720
6885
|
ZodNativeEnum.create = (values, params) => {
|
6721
6886
|
return new ZodNativeEnum({
|
6722
6887
|
values,
|
@@ -6857,7 +7022,7 @@ var init_lib = __esm({
|
|
6857
7022
|
parent: ctx
|
6858
7023
|
});
|
6859
7024
|
if (!isValid(base))
|
6860
|
-
return
|
7025
|
+
return INVALID;
|
6861
7026
|
const result = effect.transform(base.value, checkCtx);
|
6862
7027
|
if (result instanceof Promise) {
|
6863
7028
|
throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
|
@@ -6866,8 +7031,11 @@ var init_lib = __esm({
|
|
6866
7031
|
} else {
|
6867
7032
|
return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
|
6868
7033
|
if (!isValid(base))
|
6869
|
-
return
|
6870
|
-
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
7034
|
+
return INVALID;
|
7035
|
+
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
7036
|
+
status: status.value,
|
7037
|
+
value: result
|
7038
|
+
}));
|
6871
7039
|
});
|
6872
7040
|
}
|
6873
7041
|
}
|
@@ -7207,13 +7375,44 @@ var init_lib = __esm({
|
|
7207
7375
|
}
|
7208
7376
|
});
|
7209
7377
|
|
7378
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/external.js
|
7379
|
+
var init_external = __esm({
|
7380
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/external.js"() {
|
7381
|
+
"use strict";
|
7382
|
+
init_errors();
|
7383
|
+
init_parseUtil();
|
7384
|
+
init_typeAliases();
|
7385
|
+
init_util();
|
7386
|
+
init_types();
|
7387
|
+
init_ZodError();
|
7388
|
+
}
|
7389
|
+
});
|
7390
|
+
|
7391
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/index.js
|
7392
|
+
var init_v3 = __esm({
|
7393
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/index.js"() {
|
7394
|
+
"use strict";
|
7395
|
+
init_external();
|
7396
|
+
init_external();
|
7397
|
+
}
|
7398
|
+
});
|
7399
|
+
|
7400
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/index.js
|
7401
|
+
var init_esm = __esm({
|
7402
|
+
"../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/index.js"() {
|
7403
|
+
"use strict";
|
7404
|
+
init_v3();
|
7405
|
+
init_v3();
|
7406
|
+
}
|
7407
|
+
});
|
7408
|
+
|
7210
7409
|
// src/serializer/gelSchema.ts
|
7211
7410
|
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;
|
7212
7411
|
var init_gelSchema = __esm({
|
7213
7412
|
"src/serializer/gelSchema.ts"() {
|
7214
7413
|
"use strict";
|
7215
7414
|
init_global();
|
7216
|
-
|
7415
|
+
init_esm();
|
7217
7416
|
enumSchema = objectType({
|
7218
7417
|
name: stringType(),
|
7219
7418
|
schema: stringType(),
|
@@ -7477,7 +7676,7 @@ var index2, fk2, column2, tableV3, compositePK2, uniqueConstraint2, checkConstra
|
|
7477
7676
|
var init_mysqlSchema = __esm({
|
7478
7677
|
"src/serializer/mysqlSchema.ts"() {
|
7479
7678
|
"use strict";
|
7480
|
-
|
7679
|
+
init_esm();
|
7481
7680
|
init_global();
|
7482
7681
|
index2 = objectType({
|
7483
7682
|
name: stringType(),
|
@@ -7806,7 +8005,7 @@ var init_pgSchema = __esm({
|
|
7806
8005
|
"src/serializer/pgSchema.ts"() {
|
7807
8006
|
"use strict";
|
7808
8007
|
init_global();
|
7809
|
-
|
8008
|
+
init_esm();
|
7810
8009
|
indexV2 = objectType({
|
7811
8010
|
name: stringType(),
|
7812
8011
|
columns: recordType(
|
@@ -8556,7 +8755,7 @@ var index4, column4, compositePK4, uniqueConstraint4, table4, viewMeta2, kitInte
|
|
8556
8755
|
var init_singlestoreSchema = __esm({
|
8557
8756
|
"src/serializer/singlestoreSchema.ts"() {
|
8558
8757
|
"use strict";
|
8559
|
-
|
8758
|
+
init_esm();
|
8560
8759
|
init_global();
|
8561
8760
|
index4 = objectType({
|
8562
8761
|
name: stringType(),
|
@@ -8753,7 +8952,7 @@ var index5, fk4, compositePK5, column5, tableV33, uniqueConstraint5, checkConstr
|
|
8753
8952
|
var init_sqliteSchema = __esm({
|
8754
8953
|
"src/serializer/sqliteSchema.ts"() {
|
8755
8954
|
"use strict";
|
8756
|
-
|
8955
|
+
init_esm();
|
8757
8956
|
init_global();
|
8758
8957
|
index5 = objectType({
|
8759
8958
|
name: stringType(),
|
@@ -17254,7 +17453,7 @@ var makeChanged, makeSelfOrChanged, makePatched, makeSelfOrPatched, columnSchema
|
|
17254
17453
|
var init_snapshotsDiffer = __esm({
|
17255
17454
|
"src/snapshotsDiffer.ts"() {
|
17256
17455
|
"use strict";
|
17257
|
-
|
17456
|
+
init_esm();
|
17258
17457
|
init_jsonDiffer();
|
17259
17458
|
init_sqlgenerator();
|
17260
17459
|
init_jsonStatements();
|
@@ -20166,7 +20365,7 @@ var dialects, dialect4, commonSquashedSchema, commonSchema;
|
|
20166
20365
|
var init_schemaValidator = __esm({
|
20167
20366
|
"src/schemaValidator.ts"() {
|
20168
20367
|
"use strict";
|
20169
|
-
|
20368
|
+
init_esm();
|
20170
20369
|
init_mysqlSchema();
|
20171
20370
|
init_pgSchema();
|
20172
20371
|
init_singlestoreSchema();
|
@@ -20188,7 +20387,7 @@ var sqliteDriversLiterals, postgresqlDriversLiterals, prefixes, prefix, casingTy
|
|
20188
20387
|
var init_common = __esm({
|
20189
20388
|
"src/cli/validations/common.ts"() {
|
20190
20389
|
"use strict";
|
20191
|
-
|
20390
|
+
init_esm();
|
20192
20391
|
init_schemaValidator();
|
20193
20392
|
init_outputs();
|
20194
20393
|
sqliteDriversLiterals = [
|
@@ -22531,7 +22730,7 @@ var version;
|
|
22531
22730
|
var init_version = __esm({
|
22532
22731
|
"../drizzle-orm/dist/version.js"() {
|
22533
22732
|
"use strict";
|
22534
|
-
version = "0.
|
22733
|
+
version = "0.44.2";
|
22535
22734
|
}
|
22536
22735
|
});
|
22537
22736
|
|
@@ -23207,7 +23406,7 @@ var init_alias = __esm({
|
|
23207
23406
|
|
23208
23407
|
// ../drizzle-orm/dist/errors.js
|
23209
23408
|
var _a31, _b13, DrizzleError, _a32, _b14, TransactionRollbackError;
|
23210
|
-
var
|
23409
|
+
var init_errors2 = __esm({
|
23211
23410
|
"../drizzle-orm/dist/errors.js"() {
|
23212
23411
|
"use strict";
|
23213
23412
|
init_entity();
|
@@ -25981,7 +26180,7 @@ var init_dist = __esm({
|
|
25981
26180
|
init_column_builder();
|
25982
26181
|
init_column();
|
25983
26182
|
init_entity();
|
25984
|
-
|
26183
|
+
init_errors2();
|
25985
26184
|
init_logger();
|
25986
26185
|
init_operations();
|
25987
26186
|
init_query_promise();
|
@@ -26402,7 +26601,7 @@ var init_dialect = __esm({
|
|
26402
26601
|
init_casing();
|
26403
26602
|
init_column();
|
26404
26603
|
init_entity();
|
26405
|
-
|
26604
|
+
init_errors2();
|
26406
26605
|
init_columns();
|
26407
26606
|
init_table2();
|
26408
26607
|
init_relations();
|
@@ -30098,7 +30297,7 @@ var init_cache = __esm({
|
|
30098
30297
|
|
30099
30298
|
// ../drizzle-orm/dist/errors/index.js
|
30100
30299
|
var DrizzleQueryError;
|
30101
|
-
var
|
30300
|
+
var init_errors3 = __esm({
|
30102
30301
|
"../drizzle-orm/dist/errors/index.js"() {
|
30103
30302
|
"use strict";
|
30104
30303
|
DrizzleQueryError = class _DrizzleQueryError extends Error {
|
@@ -30122,8 +30321,8 @@ var init_session = __esm({
|
|
30122
30321
|
"use strict";
|
30123
30322
|
init_cache();
|
30124
30323
|
init_entity();
|
30125
|
-
init_errors();
|
30126
30324
|
init_errors2();
|
30325
|
+
init_errors3();
|
30127
30326
|
init_sql2();
|
30128
30327
|
init_tracing();
|
30129
30328
|
init_db();
|
@@ -33118,7 +33317,7 @@ var init_dialect2 = __esm({
|
|
33118
33317
|
init_casing();
|
33119
33318
|
init_column();
|
33120
33319
|
init_entity();
|
33121
|
-
|
33320
|
+
init_errors2();
|
33122
33321
|
init_relations();
|
33123
33322
|
init_sql2();
|
33124
33323
|
init_sql();
|
@@ -35463,8 +35662,8 @@ var init_session2 = __esm({
|
|
35463
35662
|
"use strict";
|
35464
35663
|
init_cache();
|
35465
35664
|
init_entity();
|
35466
|
-
init_errors();
|
35467
35665
|
init_errors2();
|
35666
|
+
init_errors3();
|
35468
35667
|
init_query_promise();
|
35469
35668
|
init_db2();
|
35470
35669
|
ExecuteResultSync = class extends (_b164 = QueryPromise, _a232 = entityKind, _b164) {
|
@@ -38538,7 +38737,7 @@ var init_dialect3 = __esm({
|
|
38538
38737
|
init_casing();
|
38539
38738
|
init_column();
|
38540
38739
|
init_entity();
|
38541
|
-
|
38740
|
+
init_errors2();
|
38542
38741
|
init_relations();
|
38543
38742
|
init_expressions();
|
38544
38743
|
init_sql();
|
@@ -41103,8 +41302,8 @@ var init_session3 = __esm({
|
|
41103
41302
|
"use strict";
|
41104
41303
|
init_cache();
|
41105
41304
|
init_entity();
|
41106
|
-
init_errors();
|
41107
41305
|
init_errors2();
|
41306
|
+
init_errors3();
|
41108
41307
|
init_sql();
|
41109
41308
|
init_db3();
|
41110
41309
|
_a341 = entityKind;
|
@@ -42032,7 +42231,7 @@ var cliConfigGenerate, pushParams, pullParams, configCheck, cliConfigCheck;
|
|
42032
42231
|
var init_cli = __esm({
|
42033
42232
|
"src/cli/validations/cli.ts"() {
|
42034
42233
|
"use strict";
|
42035
|
-
|
42234
|
+
init_esm();
|
42036
42235
|
init_schemaValidator();
|
42037
42236
|
init_common();
|
42038
42237
|
cliConfigGenerate = objectType({
|
@@ -42100,7 +42299,7 @@ var gelCredentials;
|
|
42100
42299
|
var init_gel = __esm({
|
42101
42300
|
"src/cli/validations/gel.ts"() {
|
42102
42301
|
"use strict";
|
42103
|
-
|
42302
|
+
init_esm();
|
42104
42303
|
init_views();
|
42105
42304
|
init_common();
|
42106
42305
|
gelCredentials = unionType([
|
@@ -42148,7 +42347,7 @@ var libSQLCredentials;
|
|
42148
42347
|
var init_libsql = __esm({
|
42149
42348
|
"src/cli/validations/libsql.ts"() {
|
42150
42349
|
"use strict";
|
42151
|
-
|
42350
|
+
init_esm();
|
42152
42351
|
init_views();
|
42153
42352
|
init_common();
|
42154
42353
|
libSQLCredentials = objectType({
|
@@ -42163,7 +42362,7 @@ var mysqlCredentials;
|
|
42163
42362
|
var init_mysql = __esm({
|
42164
42363
|
"src/cli/validations/mysql.ts"() {
|
42165
42364
|
"use strict";
|
42166
|
-
|
42365
|
+
init_esm();
|
42167
42366
|
init_views();
|
42168
42367
|
init_common();
|
42169
42368
|
init_outputs();
|
@@ -42200,7 +42399,7 @@ var postgresCredentials;
|
|
42200
42399
|
var init_postgres = __esm({
|
42201
42400
|
"src/cli/validations/postgres.ts"() {
|
42202
42401
|
"use strict";
|
42203
|
-
|
42402
|
+
init_esm();
|
42204
42403
|
init_views();
|
42205
42404
|
init_common();
|
42206
42405
|
postgresCredentials = unionType([
|
@@ -42249,7 +42448,7 @@ var singlestoreCredentials;
|
|
42249
42448
|
var init_singlestore = __esm({
|
42250
42449
|
"src/cli/validations/singlestore.ts"() {
|
42251
42450
|
"use strict";
|
42252
|
-
|
42451
|
+
init_esm();
|
42253
42452
|
init_views();
|
42254
42453
|
init_common();
|
42255
42454
|
init_outputs();
|
@@ -42287,7 +42486,7 @@ var init_sqlite = __esm({
|
|
42287
42486
|
"src/cli/validations/sqlite.ts"() {
|
42288
42487
|
"use strict";
|
42289
42488
|
init_global();
|
42290
|
-
|
42489
|
+
init_esm();
|
42291
42490
|
init_views();
|
42292
42491
|
init_common();
|
42293
42492
|
sqliteCredentials = unionType([
|
@@ -42318,7 +42517,7 @@ var credentials, studioCliParams, studioConfig;
|
|
42318
42517
|
var init_studio = __esm({
|
42319
42518
|
"src/cli/validations/studio.ts"() {
|
42320
42519
|
"use strict";
|
42321
|
-
|
42520
|
+
init_esm();
|
42322
42521
|
init_schemaValidator();
|
42323
42522
|
init_mysql();
|
42324
42523
|
init_postgres();
|
@@ -42360,7 +42559,7 @@ var init_utils9 = __esm({
|
|
42360
42559
|
"src/cli/commands/utils.ts"() {
|
42361
42560
|
"use strict";
|
42362
42561
|
import_hanji7 = __toESM(require_hanji());
|
42363
|
-
|
42562
|
+
init_esm();
|
42364
42563
|
init_getTablesFilterByExtensions();
|
42365
42564
|
init_global();
|
42366
42565
|
init_schemaValidator();
|
@@ -44510,7 +44709,7 @@ var init_dialect4 = __esm({
|
|
44510
44709
|
init_casing();
|
44511
44710
|
init_column();
|
44512
44711
|
init_entity();
|
44513
|
-
|
44712
|
+
init_errors2();
|
44514
44713
|
init_relations();
|
44515
44714
|
init_expressions();
|
44516
44715
|
init_sql();
|
@@ -46325,8 +46524,8 @@ var init_session4 = __esm({
|
|
46325
46524
|
"use strict";
|
46326
46525
|
init_cache();
|
46327
46526
|
init_entity();
|
46328
|
-
init_errors();
|
46329
46527
|
init_errors2();
|
46528
|
+
init_errors3();
|
46330
46529
|
init_sql();
|
46331
46530
|
init_db4();
|
46332
46531
|
_a434 = entityKind;
|