@anthonyalayo/drizzle-kit 1.0.6 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.d.mts +986 -468
- package/api.d.ts +986 -468
- package/api.js +54678 -25936
- package/api.mjs +54800 -26012
- package/bin.cjs +59812 -46379
- package/index.d.mts +319 -2
- package/index.d.ts +319 -2
- package/index.js +3 -3
- package/package.json +20 -21
- package/utils.js +824 -442
- package/utils.mjs +824 -444
- package/index-Z-1TKnbX.d.mts +0 -308
- package/index-Z-1TKnbX.d.ts +0 -308
package/utils.mjs
CHANGED
|
@@ -8,8 +8,7 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
8
8
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
9
9
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
10
10
|
}) : x)(function(x) {
|
|
11
|
-
if (typeof require !== "undefined")
|
|
12
|
-
return require.apply(this, arguments);
|
|
11
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
13
12
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
14
13
|
});
|
|
15
14
|
var __commonJS = (cb, mod) => function __require2() {
|
|
@@ -32,28 +31,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
32
31
|
mod
|
|
33
32
|
));
|
|
34
33
|
|
|
35
|
-
// ../node_modules/.pnpm/hanji@0.0.
|
|
34
|
+
// ../node_modules/.pnpm/hanji@0.0.8/node_modules/hanji/readline.js
|
|
36
35
|
var require_readline = __commonJS({
|
|
37
|
-
"../node_modules/.pnpm/hanji@0.0.
|
|
36
|
+
"../node_modules/.pnpm/hanji@0.0.8/node_modules/hanji/readline.js"(exports) {
|
|
38
37
|
"use strict";
|
|
38
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
39
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
40
|
+
};
|
|
39
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
exports.createClosable = exports.stdout = exports.stdin = void 0;
|
|
43
|
+
var readline_1 = __importDefault(__require("readline"));
|
|
44
|
+
exports.stdin = process.stdin;
|
|
45
|
+
exports.stdout = process.stdout;
|
|
46
|
+
readline_1.default.emitKeypressEvents(exports.stdin);
|
|
47
|
+
var createClosable = () => {
|
|
48
|
+
return readline_1.default.createInterface({
|
|
49
|
+
input: exports.stdin,
|
|
47
50
|
escapeCodeTimeout: 50
|
|
48
51
|
});
|
|
49
|
-
readline.emitKeypressEvents(stdin, rl);
|
|
50
|
-
return {
|
|
51
|
-
stdin,
|
|
52
|
-
stdout,
|
|
53
|
-
closable: rl
|
|
54
|
-
};
|
|
55
52
|
};
|
|
56
|
-
exports.
|
|
53
|
+
exports.createClosable = createClosable;
|
|
57
54
|
}
|
|
58
55
|
});
|
|
59
56
|
|
|
@@ -66,20 +63,15 @@ var require_src = __commonJS({
|
|
|
66
63
|
var beep = "\x07";
|
|
67
64
|
var cursor = {
|
|
68
65
|
to(x, y) {
|
|
69
|
-
if (!y)
|
|
70
|
-
return `${CSI}${x + 1}G`;
|
|
66
|
+
if (!y) return `${CSI}${x + 1}G`;
|
|
71
67
|
return `${CSI}${y + 1};${x + 1}H`;
|
|
72
68
|
},
|
|
73
69
|
move(x, y) {
|
|
74
70
|
let ret = "";
|
|
75
|
-
if (x < 0)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if (y < 0)
|
|
80
|
-
ret += `${CSI}${-y}A`;
|
|
81
|
-
else if (y > 0)
|
|
82
|
-
ret += `${CSI}${y}B`;
|
|
71
|
+
if (x < 0) ret += `${CSI}${-x}D`;
|
|
72
|
+
else if (x > 0) ret += `${CSI}${x}C`;
|
|
73
|
+
if (y < 0) ret += `${CSI}${-y}A`;
|
|
74
|
+
else if (y > 0) ret += `${CSI}${y}B`;
|
|
83
75
|
return ret;
|
|
84
76
|
},
|
|
85
77
|
up: (count = 1) => `${CSI}${count}A`,
|
|
@@ -118,12 +110,12 @@ var require_src = __commonJS({
|
|
|
118
110
|
}
|
|
119
111
|
});
|
|
120
112
|
|
|
121
|
-
// ../node_modules/.pnpm/hanji@0.0.
|
|
113
|
+
// ../node_modules/.pnpm/hanji@0.0.8/node_modules/hanji/utils.js
|
|
122
114
|
var require_utils = __commonJS({
|
|
123
|
-
"../node_modules/.pnpm/hanji@0.0.
|
|
115
|
+
"../node_modules/.pnpm/hanji@0.0.8/node_modules/hanji/utils.js"(exports) {
|
|
124
116
|
"use strict";
|
|
125
117
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
126
|
-
exports.clear = void 0;
|
|
118
|
+
exports.clear = exports.stringWidth = exports.fallbackStringWidth = exports.stripAnsi = exports.strip = void 0;
|
|
127
119
|
var sisteransi_1 = require_src();
|
|
128
120
|
var strip = (str) => {
|
|
129
121
|
const pattern = [
|
|
@@ -133,14 +125,35 @@ var require_utils = __commonJS({
|
|
|
133
125
|
const RGX = new RegExp(pattern, "g");
|
|
134
126
|
return typeof str === "string" ? str.replace(RGX, "") : str;
|
|
135
127
|
};
|
|
136
|
-
|
|
128
|
+
exports.strip = strip;
|
|
129
|
+
var stripAnsi = (str) => {
|
|
130
|
+
if (typeof Bun !== "undefined" && Bun.stripANSI) {
|
|
131
|
+
return Bun.stripANSI(str);
|
|
132
|
+
}
|
|
133
|
+
return (0, exports.strip)(str);
|
|
134
|
+
};
|
|
135
|
+
exports.stripAnsi = stripAnsi;
|
|
136
|
+
var fallbackStringWidth = (str) => {
|
|
137
|
+
let len = 0;
|
|
138
|
+
const stripped = (0, exports.stripAnsi)(str);
|
|
139
|
+
for (const _ of stripped)
|
|
140
|
+
len++;
|
|
141
|
+
return len;
|
|
142
|
+
};
|
|
143
|
+
exports.fallbackStringWidth = fallbackStringWidth;
|
|
144
|
+
var stringWidth = (str) => {
|
|
145
|
+
if (typeof Bun !== "undefined" && Bun.stringWidth)
|
|
146
|
+
return Bun.stringWidth(str);
|
|
147
|
+
return (0, exports.fallbackStringWidth)(str);
|
|
148
|
+
};
|
|
149
|
+
exports.stringWidth = stringWidth;
|
|
137
150
|
var clear = function(prompt, perLine) {
|
|
138
151
|
if (!perLine)
|
|
139
152
|
return sisteransi_1.erase.line + sisteransi_1.cursor.to(0);
|
|
140
153
|
let rows = 0;
|
|
141
154
|
const lines = prompt.split(/\r?\n/);
|
|
142
155
|
for (let line of lines) {
|
|
143
|
-
rows += 1 + Math.floor(Math.max(stringWidth(line) - 1, 0) / perLine);
|
|
156
|
+
rows += 1 + Math.floor(Math.max((0, exports.stringWidth)(line) - 1, 0) / perLine);
|
|
144
157
|
}
|
|
145
158
|
return sisteransi_1.erase.lines(rows);
|
|
146
159
|
};
|
|
@@ -296,9 +309,9 @@ var require_lodash = __commonJS({
|
|
|
296
309
|
}
|
|
297
310
|
});
|
|
298
311
|
|
|
299
|
-
// ../node_modules/.pnpm/hanji@0.0.
|
|
312
|
+
// ../node_modules/.pnpm/hanji@0.0.8/node_modules/hanji/index.js
|
|
300
313
|
var require_hanji = __commonJS({
|
|
301
|
-
"../node_modules/.pnpm/hanji@0.0.
|
|
314
|
+
"../node_modules/.pnpm/hanji@0.0.8/node_modules/hanji/index.js"(exports) {
|
|
302
315
|
"use strict";
|
|
303
316
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
304
317
|
function adopt(value) {
|
|
@@ -331,7 +344,10 @@ var require_hanji = __commonJS({
|
|
|
331
344
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
332
345
|
};
|
|
333
346
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
334
|
-
exports.
|
|
347
|
+
exports.TaskTerminal = exports.TaskView = exports.Terminal = exports.deferred = exports.SelectState = exports.Prompt = void 0;
|
|
348
|
+
exports.render = render2;
|
|
349
|
+
exports.renderWithTask = renderWithTask;
|
|
350
|
+
exports.onTerminate = onTerminate;
|
|
335
351
|
var readline_1 = require_readline();
|
|
336
352
|
var sisteransi_1 = require_src();
|
|
337
353
|
var utils_1 = require_utils();
|
|
@@ -410,8 +426,8 @@ var require_hanji = __commonJS({
|
|
|
410
426
|
};
|
|
411
427
|
exports.deferred = deferred;
|
|
412
428
|
var Terminal = class {
|
|
413
|
-
constructor(
|
|
414
|
-
this.view =
|
|
429
|
+
constructor(view5, stdin, stdout, closable) {
|
|
430
|
+
this.view = view5;
|
|
415
431
|
this.stdin = stdin;
|
|
416
432
|
this.stdout = stdout;
|
|
417
433
|
this.closable = closable;
|
|
@@ -449,7 +465,7 @@ var require_hanji = __commonJS({
|
|
|
449
465
|
this.resolve({ status: "submitted", data: this.view.result() });
|
|
450
466
|
return;
|
|
451
467
|
}
|
|
452
|
-
|
|
468
|
+
view5.input(str, key);
|
|
453
469
|
};
|
|
454
470
|
this.stdin.on("keypress", keypress);
|
|
455
471
|
this.view.attach(this);
|
|
@@ -511,8 +527,8 @@ var require_hanji = __commonJS({
|
|
|
511
527
|
};
|
|
512
528
|
exports.TaskView = TaskView2;
|
|
513
529
|
var TaskTerminal = class {
|
|
514
|
-
constructor(
|
|
515
|
-
this.view =
|
|
530
|
+
constructor(view5, stdout) {
|
|
531
|
+
this.view = view5;
|
|
516
532
|
this.stdout = stdout;
|
|
517
533
|
this.text = "";
|
|
518
534
|
this.view.attach(this);
|
|
@@ -529,40 +545,50 @@ var require_hanji = __commonJS({
|
|
|
529
545
|
const clearPrefix = this.text ? (0, utils_1.clear)(this.text, this.stdout.columns) : "";
|
|
530
546
|
this.stdout.write(`${clearPrefix}${string}`);
|
|
531
547
|
}
|
|
548
|
+
reject(err) {
|
|
549
|
+
const string = this.view.render("rejected", err);
|
|
550
|
+
this.view.detach(this);
|
|
551
|
+
const clearPrefix = this.text ? (0, utils_1.clear)(this.text, this.stdout.columns) : "";
|
|
552
|
+
this.stdout.write(`${clearPrefix}${string}`);
|
|
553
|
+
}
|
|
532
554
|
};
|
|
533
555
|
exports.TaskTerminal = TaskTerminal;
|
|
534
|
-
function render2(
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
const terminal = new Terminal(view4, stdin, stdout, closable);
|
|
538
|
-
terminal.requestLayout();
|
|
539
|
-
return terminal.result();
|
|
540
|
-
}
|
|
541
|
-
stdout.write(`${view4}
|
|
556
|
+
function render2(view5) {
|
|
557
|
+
if (typeof view5 === "string") {
|
|
558
|
+
process.stdout.write(`${view5}
|
|
542
559
|
`);
|
|
543
|
-
|
|
544
|
-
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
563
|
+
return Promise.reject(new Error("Interactive prompts require a TTY terminal (process.stdin.isTTY or process.stdout.isTTY is false). This can happen when running in CI, piped input, or non-interactive shells."));
|
|
564
|
+
}
|
|
565
|
+
const closable = (0, readline_1.createClosable)();
|
|
566
|
+
const terminal = new Terminal(view5, readline_1.stdin, readline_1.stdout, closable);
|
|
567
|
+
terminal.requestLayout();
|
|
568
|
+
return terminal.result();
|
|
545
569
|
}
|
|
546
|
-
|
|
547
|
-
function renderWithTask(view4, task) {
|
|
570
|
+
function renderWithTask(view5, task) {
|
|
548
571
|
return __awaiter(this, void 0, void 0, function* () {
|
|
549
|
-
const terminal = new TaskTerminal(
|
|
572
|
+
const terminal = new TaskTerminal(view5, process.stdout);
|
|
550
573
|
terminal.requestLayout();
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
574
|
+
try {
|
|
575
|
+
const result = yield task;
|
|
576
|
+
terminal.clear();
|
|
577
|
+
return result;
|
|
578
|
+
} catch (err) {
|
|
579
|
+
terminal.reject(err);
|
|
580
|
+
process.exit(1);
|
|
581
|
+
}
|
|
554
582
|
});
|
|
555
583
|
}
|
|
556
|
-
exports.renderWithTask = renderWithTask;
|
|
557
584
|
var terminateHandler;
|
|
558
585
|
function onTerminate(callback) {
|
|
559
586
|
terminateHandler = callback;
|
|
560
587
|
}
|
|
561
|
-
exports.onTerminate = onTerminate;
|
|
562
588
|
}
|
|
563
589
|
});
|
|
564
590
|
|
|
565
|
-
// ../node_modules/.pnpm/chalk@5.
|
|
591
|
+
// ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
566
592
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
567
593
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
568
594
|
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
@@ -748,7 +774,7 @@ function assembleStyles() {
|
|
|
748
774
|
var ansiStyles = assembleStyles();
|
|
749
775
|
var ansi_styles_default = ansiStyles;
|
|
750
776
|
|
|
751
|
-
// ../node_modules/.pnpm/chalk@5.
|
|
777
|
+
// ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/supports-color/index.js
|
|
752
778
|
import process2 from "node:process";
|
|
753
779
|
import os from "node:os";
|
|
754
780
|
import tty from "node:tty";
|
|
@@ -822,10 +848,10 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
822
848
|
return 1;
|
|
823
849
|
}
|
|
824
850
|
if ("CI" in env) {
|
|
825
|
-
if ("GITHUB_ACTIONS"
|
|
851
|
+
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
|
|
826
852
|
return 3;
|
|
827
853
|
}
|
|
828
|
-
if (["TRAVIS", "
|
|
854
|
+
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
829
855
|
return 1;
|
|
830
856
|
}
|
|
831
857
|
return min;
|
|
@@ -874,37 +900,37 @@ var supportsColor = {
|
|
|
874
900
|
};
|
|
875
901
|
var supports_color_default = supportsColor;
|
|
876
902
|
|
|
877
|
-
// ../node_modules/.pnpm/chalk@5.
|
|
903
|
+
// ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/utilities.js
|
|
878
904
|
function stringReplaceAll(string, substring, replacer) {
|
|
879
|
-
let
|
|
880
|
-
if (
|
|
905
|
+
let index6 = string.indexOf(substring);
|
|
906
|
+
if (index6 === -1) {
|
|
881
907
|
return string;
|
|
882
908
|
}
|
|
883
909
|
const substringLength = substring.length;
|
|
884
910
|
let endIndex = 0;
|
|
885
911
|
let returnValue = "";
|
|
886
912
|
do {
|
|
887
|
-
returnValue += string.slice(endIndex,
|
|
888
|
-
endIndex =
|
|
889
|
-
|
|
890
|
-
} while (
|
|
913
|
+
returnValue += string.slice(endIndex, index6) + substring + replacer;
|
|
914
|
+
endIndex = index6 + substringLength;
|
|
915
|
+
index6 = string.indexOf(substring, endIndex);
|
|
916
|
+
} while (index6 !== -1);
|
|
891
917
|
returnValue += string.slice(endIndex);
|
|
892
918
|
return returnValue;
|
|
893
919
|
}
|
|
894
|
-
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix,
|
|
920
|
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index6) {
|
|
895
921
|
let endIndex = 0;
|
|
896
922
|
let returnValue = "";
|
|
897
923
|
do {
|
|
898
|
-
const gotCR = string[
|
|
899
|
-
returnValue += string.slice(endIndex, gotCR ?
|
|
900
|
-
endIndex =
|
|
901
|
-
|
|
902
|
-
} while (
|
|
924
|
+
const gotCR = string[index6 - 1] === "\r";
|
|
925
|
+
returnValue += string.slice(endIndex, gotCR ? index6 - 1 : index6) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
926
|
+
endIndex = index6 + 1;
|
|
927
|
+
index6 = string.indexOf("\n", endIndex);
|
|
928
|
+
} while (index6 !== -1);
|
|
903
929
|
returnValue += string.slice(endIndex);
|
|
904
930
|
return returnValue;
|
|
905
931
|
}
|
|
906
932
|
|
|
907
|
-
// ../node_modules/.pnpm/chalk@5.
|
|
933
|
+
// ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/index.js
|
|
908
934
|
var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
909
935
|
var GENERATOR = Symbol("GENERATOR");
|
|
910
936
|
var STYLER = Symbol("STYLER");
|
|
@@ -1064,15 +1090,16 @@ var info = (msg, greyMsg = "") => {
|
|
|
1064
1090
|
|
|
1065
1091
|
// src/global.ts
|
|
1066
1092
|
var originUUID = "00000000-0000-0000-0000-000000000000";
|
|
1067
|
-
var snapshotVersion = "
|
|
1093
|
+
var snapshotVersion = "7";
|
|
1068
1094
|
function assertUnreachable(x) {
|
|
1069
1095
|
throw new Error("Didn't expect to get here");
|
|
1070
1096
|
}
|
|
1071
1097
|
|
|
1072
|
-
// ../node_modules/.pnpm/zod@3.
|
|
1098
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/util.js
|
|
1073
1099
|
var util;
|
|
1074
1100
|
(function(util2) {
|
|
1075
|
-
util2.assertEqual = (
|
|
1101
|
+
util2.assertEqual = (_) => {
|
|
1102
|
+
};
|
|
1076
1103
|
function assertIs(_arg) {
|
|
1077
1104
|
}
|
|
1078
1105
|
util2.assertIs = assertIs;
|
|
@@ -1116,7 +1143,7 @@ var util;
|
|
|
1116
1143
|
}
|
|
1117
1144
|
return void 0;
|
|
1118
1145
|
};
|
|
1119
|
-
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
|
1146
|
+
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
|
1120
1147
|
function joinValues(array, separator = " | ") {
|
|
1121
1148
|
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
1122
1149
|
}
|
|
@@ -1168,7 +1195,7 @@ var getParsedType = (data) => {
|
|
|
1168
1195
|
case "string":
|
|
1169
1196
|
return ZodParsedType.string;
|
|
1170
1197
|
case "number":
|
|
1171
|
-
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
1198
|
+
return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
1172
1199
|
case "boolean":
|
|
1173
1200
|
return ZodParsedType.boolean;
|
|
1174
1201
|
case "function":
|
|
@@ -1201,6 +1228,8 @@ var getParsedType = (data) => {
|
|
|
1201
1228
|
return ZodParsedType.unknown;
|
|
1202
1229
|
}
|
|
1203
1230
|
};
|
|
1231
|
+
|
|
1232
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/ZodError.js
|
|
1204
1233
|
var ZodIssueCode = util.arrayToEnum([
|
|
1205
1234
|
"invalid_type",
|
|
1206
1235
|
"invalid_literal",
|
|
@@ -1220,6 +1249,9 @@ var ZodIssueCode = util.arrayToEnum([
|
|
|
1220
1249
|
"not_finite"
|
|
1221
1250
|
]);
|
|
1222
1251
|
var ZodError = class _ZodError extends Error {
|
|
1252
|
+
get errors() {
|
|
1253
|
+
return this.issues;
|
|
1254
|
+
}
|
|
1223
1255
|
constructor(issues) {
|
|
1224
1256
|
super();
|
|
1225
1257
|
this.issues = [];
|
|
@@ -1238,9 +1270,6 @@ var ZodError = class _ZodError extends Error {
|
|
|
1238
1270
|
this.name = "ZodError";
|
|
1239
1271
|
this.issues = issues;
|
|
1240
1272
|
}
|
|
1241
|
-
get errors() {
|
|
1242
|
-
return this.issues;
|
|
1243
|
-
}
|
|
1244
1273
|
format(_mapper) {
|
|
1245
1274
|
const mapper = _mapper || function(issue) {
|
|
1246
1275
|
return issue.message;
|
|
@@ -1312,6 +1341,8 @@ ZodError.create = (issues) => {
|
|
|
1312
1341
|
const error = new ZodError(issues);
|
|
1313
1342
|
return error;
|
|
1314
1343
|
};
|
|
1344
|
+
|
|
1345
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/locales/en.js
|
|
1315
1346
|
var errorMap = (issue, _ctx) => {
|
|
1316
1347
|
let message;
|
|
1317
1348
|
switch (issue.code) {
|
|
@@ -1410,10 +1441,15 @@ var errorMap = (issue, _ctx) => {
|
|
|
1410
1441
|
}
|
|
1411
1442
|
return { message };
|
|
1412
1443
|
};
|
|
1413
|
-
var
|
|
1444
|
+
var en_default = errorMap;
|
|
1445
|
+
|
|
1446
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/errors.js
|
|
1447
|
+
var overrideErrorMap = en_default;
|
|
1414
1448
|
function getErrorMap() {
|
|
1415
1449
|
return overrideErrorMap;
|
|
1416
1450
|
}
|
|
1451
|
+
|
|
1452
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/parseUtil.js
|
|
1417
1453
|
var makeIssue = (params) => {
|
|
1418
1454
|
const { data, path, errorMaps, issueData } = params;
|
|
1419
1455
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -1447,9 +1483,12 @@ function addIssueToContext(ctx, issueData) {
|
|
|
1447
1483
|
path: ctx.path,
|
|
1448
1484
|
errorMaps: [
|
|
1449
1485
|
ctx.common.contextualErrorMap,
|
|
1486
|
+
// contextual error map is first priority
|
|
1450
1487
|
ctx.schemaErrorMap,
|
|
1488
|
+
// then schema-bound map if available
|
|
1451
1489
|
overrideMap,
|
|
1452
|
-
|
|
1490
|
+
// then global override map
|
|
1491
|
+
overrideMap === en_default ? void 0 : en_default
|
|
1453
1492
|
// then global default map
|
|
1454
1493
|
].filter((x) => !!x)
|
|
1455
1494
|
});
|
|
@@ -1518,29 +1557,15 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
1518
1557
|
var isDirty = (x) => x.status === "dirty";
|
|
1519
1558
|
var isValid = (x) => x.status === "valid";
|
|
1520
1559
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
1524
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
1525
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1526
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
1527
|
-
}
|
|
1528
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
1529
|
-
if (kind === "m")
|
|
1530
|
-
throw new TypeError("Private method is not writable");
|
|
1531
|
-
if (kind === "a" && !f)
|
|
1532
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
1533
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
1534
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
1535
|
-
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
1536
|
-
}
|
|
1560
|
+
|
|
1561
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/errorUtil.js
|
|
1537
1562
|
var errorUtil;
|
|
1538
1563
|
(function(errorUtil2) {
|
|
1539
1564
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
1540
|
-
errorUtil2.toString = (message) => typeof message === "string" ? message : message
|
|
1565
|
+
errorUtil2.toString = (message) => typeof message === "string" ? message : message == null ? void 0 : message.message;
|
|
1541
1566
|
})(errorUtil || (errorUtil = {}));
|
|
1542
|
-
|
|
1543
|
-
|
|
1567
|
+
|
|
1568
|
+
// ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/types.js
|
|
1544
1569
|
var ParseInputLazyPath = class {
|
|
1545
1570
|
constructor(parent, value, path, key) {
|
|
1546
1571
|
this._cachedPath = [];
|
|
@@ -1551,7 +1576,7 @@ var ParseInputLazyPath = class {
|
|
|
1551
1576
|
}
|
|
1552
1577
|
get path() {
|
|
1553
1578
|
if (!this._cachedPath.length) {
|
|
1554
|
-
if (this._key
|
|
1579
|
+
if (Array.isArray(this._key)) {
|
|
1555
1580
|
this._cachedPath.push(...this._path, ...this._key);
|
|
1556
1581
|
} else {
|
|
1557
1582
|
this._cachedPath.push(...this._path, this._key);
|
|
@@ -1589,49 +1614,20 @@ function processCreateParams(params) {
|
|
|
1589
1614
|
if (errorMap2)
|
|
1590
1615
|
return { errorMap: errorMap2, description };
|
|
1591
1616
|
const customMap = (iss, ctx) => {
|
|
1592
|
-
var _a, _b;
|
|
1593
1617
|
const { message } = params;
|
|
1594
1618
|
if (iss.code === "invalid_enum_value") {
|
|
1595
|
-
return { message: message
|
|
1619
|
+
return { message: message ?? ctx.defaultError };
|
|
1596
1620
|
}
|
|
1597
1621
|
if (typeof ctx.data === "undefined") {
|
|
1598
|
-
return { message:
|
|
1622
|
+
return { message: message ?? required_error ?? ctx.defaultError };
|
|
1599
1623
|
}
|
|
1600
1624
|
if (iss.code !== "invalid_type")
|
|
1601
1625
|
return { message: ctx.defaultError };
|
|
1602
|
-
return { message:
|
|
1626
|
+
return { message: message ?? invalid_type_error ?? ctx.defaultError };
|
|
1603
1627
|
};
|
|
1604
1628
|
return { errorMap: customMap, description };
|
|
1605
1629
|
}
|
|
1606
1630
|
var ZodType = class {
|
|
1607
|
-
constructor(def) {
|
|
1608
|
-
this.spa = this.safeParseAsync;
|
|
1609
|
-
this._def = def;
|
|
1610
|
-
this.parse = this.parse.bind(this);
|
|
1611
|
-
this.safeParse = this.safeParse.bind(this);
|
|
1612
|
-
this.parseAsync = this.parseAsync.bind(this);
|
|
1613
|
-
this.safeParseAsync = this.safeParseAsync.bind(this);
|
|
1614
|
-
this.spa = this.spa.bind(this);
|
|
1615
|
-
this.refine = this.refine.bind(this);
|
|
1616
|
-
this.refinement = this.refinement.bind(this);
|
|
1617
|
-
this.superRefine = this.superRefine.bind(this);
|
|
1618
|
-
this.optional = this.optional.bind(this);
|
|
1619
|
-
this.nullable = this.nullable.bind(this);
|
|
1620
|
-
this.nullish = this.nullish.bind(this);
|
|
1621
|
-
this.array = this.array.bind(this);
|
|
1622
|
-
this.promise = this.promise.bind(this);
|
|
1623
|
-
this.or = this.or.bind(this);
|
|
1624
|
-
this.and = this.and.bind(this);
|
|
1625
|
-
this.transform = this.transform.bind(this);
|
|
1626
|
-
this.brand = this.brand.bind(this);
|
|
1627
|
-
this.default = this.default.bind(this);
|
|
1628
|
-
this.catch = this.catch.bind(this);
|
|
1629
|
-
this.describe = this.describe.bind(this);
|
|
1630
|
-
this.pipe = this.pipe.bind(this);
|
|
1631
|
-
this.readonly = this.readonly.bind(this);
|
|
1632
|
-
this.isNullable = this.isNullable.bind(this);
|
|
1633
|
-
this.isOptional = this.isOptional.bind(this);
|
|
1634
|
-
}
|
|
1635
1631
|
get description() {
|
|
1636
1632
|
return this._def.description;
|
|
1637
1633
|
}
|
|
@@ -1679,14 +1675,13 @@ var ZodType = class {
|
|
|
1679
1675
|
throw result.error;
|
|
1680
1676
|
}
|
|
1681
1677
|
safeParse(data, params) {
|
|
1682
|
-
var _a;
|
|
1683
1678
|
const ctx = {
|
|
1684
1679
|
common: {
|
|
1685
1680
|
issues: [],
|
|
1686
|
-
async: (
|
|
1687
|
-
contextualErrorMap: params
|
|
1681
|
+
async: (params == null ? void 0 : params.async) ?? false,
|
|
1682
|
+
contextualErrorMap: params == null ? void 0 : params.errorMap
|
|
1688
1683
|
},
|
|
1689
|
-
path: (params
|
|
1684
|
+
path: (params == null ? void 0 : params.path) || [],
|
|
1690
1685
|
schemaErrorMap: this._def.errorMap,
|
|
1691
1686
|
parent: null,
|
|
1692
1687
|
data,
|
|
@@ -1695,6 +1690,43 @@ var ZodType = class {
|
|
|
1695
1690
|
const result = this._parseSync({ data, path: ctx.path, parent: ctx });
|
|
1696
1691
|
return handleResult(ctx, result);
|
|
1697
1692
|
}
|
|
1693
|
+
"~validate"(data) {
|
|
1694
|
+
var _a, _b;
|
|
1695
|
+
const ctx = {
|
|
1696
|
+
common: {
|
|
1697
|
+
issues: [],
|
|
1698
|
+
async: !!this["~standard"].async
|
|
1699
|
+
},
|
|
1700
|
+
path: [],
|
|
1701
|
+
schemaErrorMap: this._def.errorMap,
|
|
1702
|
+
parent: null,
|
|
1703
|
+
data,
|
|
1704
|
+
parsedType: getParsedType(data)
|
|
1705
|
+
};
|
|
1706
|
+
if (!this["~standard"].async) {
|
|
1707
|
+
try {
|
|
1708
|
+
const result = this._parseSync({ data, path: [], parent: ctx });
|
|
1709
|
+
return isValid(result) ? {
|
|
1710
|
+
value: result.value
|
|
1711
|
+
} : {
|
|
1712
|
+
issues: ctx.common.issues
|
|
1713
|
+
};
|
|
1714
|
+
} catch (err) {
|
|
1715
|
+
if ((_b = (_a = err == null ? void 0 : err.message) == null ? void 0 : _a.toLowerCase()) == null ? void 0 : _b.includes("encountered")) {
|
|
1716
|
+
this["~standard"].async = true;
|
|
1717
|
+
}
|
|
1718
|
+
ctx.common = {
|
|
1719
|
+
issues: [],
|
|
1720
|
+
async: true
|
|
1721
|
+
};
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
|
|
1725
|
+
value: result.value
|
|
1726
|
+
} : {
|
|
1727
|
+
issues: ctx.common.issues
|
|
1728
|
+
});
|
|
1729
|
+
}
|
|
1698
1730
|
async parseAsync(data, params) {
|
|
1699
1731
|
const result = await this.safeParseAsync(data, params);
|
|
1700
1732
|
if (result.success)
|
|
@@ -1705,10 +1737,10 @@ var ZodType = class {
|
|
|
1705
1737
|
const ctx = {
|
|
1706
1738
|
common: {
|
|
1707
1739
|
issues: [],
|
|
1708
|
-
contextualErrorMap: params
|
|
1740
|
+
contextualErrorMap: params == null ? void 0 : params.errorMap,
|
|
1709
1741
|
async: true
|
|
1710
1742
|
},
|
|
1711
|
-
path: (params
|
|
1743
|
+
path: (params == null ? void 0 : params.path) || [],
|
|
1712
1744
|
schemaErrorMap: this._def.errorMap,
|
|
1713
1745
|
parent: null,
|
|
1714
1746
|
data,
|
|
@@ -1772,6 +1804,39 @@ var ZodType = class {
|
|
|
1772
1804
|
superRefine(refinement) {
|
|
1773
1805
|
return this._refinement(refinement);
|
|
1774
1806
|
}
|
|
1807
|
+
constructor(def) {
|
|
1808
|
+
this.spa = this.safeParseAsync;
|
|
1809
|
+
this._def = def;
|
|
1810
|
+
this.parse = this.parse.bind(this);
|
|
1811
|
+
this.safeParse = this.safeParse.bind(this);
|
|
1812
|
+
this.parseAsync = this.parseAsync.bind(this);
|
|
1813
|
+
this.safeParseAsync = this.safeParseAsync.bind(this);
|
|
1814
|
+
this.spa = this.spa.bind(this);
|
|
1815
|
+
this.refine = this.refine.bind(this);
|
|
1816
|
+
this.refinement = this.refinement.bind(this);
|
|
1817
|
+
this.superRefine = this.superRefine.bind(this);
|
|
1818
|
+
this.optional = this.optional.bind(this);
|
|
1819
|
+
this.nullable = this.nullable.bind(this);
|
|
1820
|
+
this.nullish = this.nullish.bind(this);
|
|
1821
|
+
this.array = this.array.bind(this);
|
|
1822
|
+
this.promise = this.promise.bind(this);
|
|
1823
|
+
this.or = this.or.bind(this);
|
|
1824
|
+
this.and = this.and.bind(this);
|
|
1825
|
+
this.transform = this.transform.bind(this);
|
|
1826
|
+
this.brand = this.brand.bind(this);
|
|
1827
|
+
this.default = this.default.bind(this);
|
|
1828
|
+
this.catch = this.catch.bind(this);
|
|
1829
|
+
this.describe = this.describe.bind(this);
|
|
1830
|
+
this.pipe = this.pipe.bind(this);
|
|
1831
|
+
this.readonly = this.readonly.bind(this);
|
|
1832
|
+
this.isNullable = this.isNullable.bind(this);
|
|
1833
|
+
this.isOptional = this.isOptional.bind(this);
|
|
1834
|
+
this["~standard"] = {
|
|
1835
|
+
version: 1,
|
|
1836
|
+
vendor: "zod",
|
|
1837
|
+
validate: (data) => this["~validate"](data)
|
|
1838
|
+
};
|
|
1839
|
+
}
|
|
1775
1840
|
optional() {
|
|
1776
1841
|
return ZodOptional.create(this, this._def);
|
|
1777
1842
|
}
|
|
@@ -1782,7 +1847,7 @@ var ZodType = class {
|
|
|
1782
1847
|
return this.nullable().optional();
|
|
1783
1848
|
}
|
|
1784
1849
|
array() {
|
|
1785
|
-
return ZodArray.create(this
|
|
1850
|
+
return ZodArray.create(this);
|
|
1786
1851
|
}
|
|
1787
1852
|
promise() {
|
|
1788
1853
|
return ZodPromise.create(this, this._def);
|
|
@@ -1848,26 +1913,31 @@ var ZodType = class {
|
|
|
1848
1913
|
};
|
|
1849
1914
|
var cuidRegex = /^c[^\s-]{8,}$/i;
|
|
1850
1915
|
var cuid2Regex = /^[0-9a-z]+$/;
|
|
1851
|
-
var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}
|
|
1916
|
+
var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
|
|
1852
1917
|
var 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;
|
|
1853
1918
|
var nanoidRegex = /^[a-z0-9_-]{21}$/i;
|
|
1919
|
+
var jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
|
|
1854
1920
|
var 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)?)??$/;
|
|
1855
1921
|
var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
|
1856
1922
|
var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
1857
1923
|
var emojiRegex;
|
|
1858
1924
|
var 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])$/;
|
|
1859
|
-
var
|
|
1925
|
+
var 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])$/;
|
|
1926
|
+
var 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]))$/;
|
|
1927
|
+
var 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])$/;
|
|
1860
1928
|
var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
1929
|
+
var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
|
|
1861
1930
|
var 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])))`;
|
|
1862
1931
|
var dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
1863
1932
|
function timeRegexSource(args) {
|
|
1864
|
-
let
|
|
1933
|
+
let secondsRegexSource = `[0-5]\\d`;
|
|
1865
1934
|
if (args.precision) {
|
|
1866
|
-
|
|
1935
|
+
secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
|
|
1867
1936
|
} else if (args.precision == null) {
|
|
1868
|
-
|
|
1937
|
+
secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
|
|
1869
1938
|
}
|
|
1870
|
-
|
|
1939
|
+
const secondsQuantifier = args.precision ? "+" : "?";
|
|
1940
|
+
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
|
1871
1941
|
}
|
|
1872
1942
|
function timeRegex(args) {
|
|
1873
1943
|
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
@@ -1890,6 +1960,35 @@ function isValidIP(ip, version) {
|
|
|
1890
1960
|
}
|
|
1891
1961
|
return false;
|
|
1892
1962
|
}
|
|
1963
|
+
function isValidJWT(jwt, alg) {
|
|
1964
|
+
if (!jwtRegex.test(jwt))
|
|
1965
|
+
return false;
|
|
1966
|
+
try {
|
|
1967
|
+
const [header] = jwt.split(".");
|
|
1968
|
+
const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
|
1969
|
+
const decoded = JSON.parse(atob(base64));
|
|
1970
|
+
if (typeof decoded !== "object" || decoded === null)
|
|
1971
|
+
return false;
|
|
1972
|
+
if ("typ" in decoded && (decoded == null ? void 0 : decoded.typ) !== "JWT")
|
|
1973
|
+
return false;
|
|
1974
|
+
if (!decoded.alg)
|
|
1975
|
+
return false;
|
|
1976
|
+
if (alg && decoded.alg !== alg)
|
|
1977
|
+
return false;
|
|
1978
|
+
return true;
|
|
1979
|
+
} catch {
|
|
1980
|
+
return false;
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
function isValidCidr(ip, version) {
|
|
1984
|
+
if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) {
|
|
1985
|
+
return true;
|
|
1986
|
+
}
|
|
1987
|
+
if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) {
|
|
1988
|
+
return true;
|
|
1989
|
+
}
|
|
1990
|
+
return false;
|
|
1991
|
+
}
|
|
1893
1992
|
var ZodString = class _ZodString extends ZodType {
|
|
1894
1993
|
_parse(input) {
|
|
1895
1994
|
if (this._def.coerce) {
|
|
@@ -2036,7 +2135,7 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2036
2135
|
} else if (check.kind === "url") {
|
|
2037
2136
|
try {
|
|
2038
2137
|
new URL(input.data);
|
|
2039
|
-
} catch
|
|
2138
|
+
} catch {
|
|
2040
2139
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2041
2140
|
addIssueToContext(ctx, {
|
|
2042
2141
|
validation: "url",
|
|
@@ -2146,6 +2245,26 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2146
2245
|
});
|
|
2147
2246
|
status.dirty();
|
|
2148
2247
|
}
|
|
2248
|
+
} else if (check.kind === "jwt") {
|
|
2249
|
+
if (!isValidJWT(input.data, check.alg)) {
|
|
2250
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2251
|
+
addIssueToContext(ctx, {
|
|
2252
|
+
validation: "jwt",
|
|
2253
|
+
code: ZodIssueCode.invalid_string,
|
|
2254
|
+
message: check.message
|
|
2255
|
+
});
|
|
2256
|
+
status.dirty();
|
|
2257
|
+
}
|
|
2258
|
+
} else if (check.kind === "cidr") {
|
|
2259
|
+
if (!isValidCidr(input.data, check.version)) {
|
|
2260
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2261
|
+
addIssueToContext(ctx, {
|
|
2262
|
+
validation: "cidr",
|
|
2263
|
+
code: ZodIssueCode.invalid_string,
|
|
2264
|
+
message: check.message
|
|
2265
|
+
});
|
|
2266
|
+
status.dirty();
|
|
2267
|
+
}
|
|
2149
2268
|
} else if (check.kind === "base64") {
|
|
2150
2269
|
if (!base64Regex.test(input.data)) {
|
|
2151
2270
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
@@ -2156,6 +2275,16 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2156
2275
|
});
|
|
2157
2276
|
status.dirty();
|
|
2158
2277
|
}
|
|
2278
|
+
} else if (check.kind === "base64url") {
|
|
2279
|
+
if (!base64urlRegex.test(input.data)) {
|
|
2280
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2281
|
+
addIssueToContext(ctx, {
|
|
2282
|
+
validation: "base64url",
|
|
2283
|
+
code: ZodIssueCode.invalid_string,
|
|
2284
|
+
message: check.message
|
|
2285
|
+
});
|
|
2286
|
+
status.dirty();
|
|
2287
|
+
}
|
|
2159
2288
|
} else {
|
|
2160
2289
|
util.assertNever(check);
|
|
2161
2290
|
}
|
|
@@ -2202,11 +2331,22 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2202
2331
|
base64(message) {
|
|
2203
2332
|
return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
|
|
2204
2333
|
}
|
|
2334
|
+
base64url(message) {
|
|
2335
|
+
return this._addCheck({
|
|
2336
|
+
kind: "base64url",
|
|
2337
|
+
...errorUtil.errToObj(message)
|
|
2338
|
+
});
|
|
2339
|
+
}
|
|
2340
|
+
jwt(options) {
|
|
2341
|
+
return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
|
|
2342
|
+
}
|
|
2205
2343
|
ip(options) {
|
|
2206
2344
|
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
|
|
2207
2345
|
}
|
|
2346
|
+
cidr(options) {
|
|
2347
|
+
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
|
2348
|
+
}
|
|
2208
2349
|
datetime(options) {
|
|
2209
|
-
var _a, _b;
|
|
2210
2350
|
if (typeof options === "string") {
|
|
2211
2351
|
return this._addCheck({
|
|
2212
2352
|
kind: "datetime",
|
|
@@ -2218,10 +2358,10 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2218
2358
|
}
|
|
2219
2359
|
return this._addCheck({
|
|
2220
2360
|
kind: "datetime",
|
|
2221
|
-
precision: typeof (options
|
|
2222
|
-
offset: (
|
|
2223
|
-
local: (
|
|
2224
|
-
...errorUtil.errToObj(options
|
|
2361
|
+
precision: typeof (options == null ? void 0 : options.precision) === "undefined" ? null : options == null ? void 0 : options.precision,
|
|
2362
|
+
offset: (options == null ? void 0 : options.offset) ?? false,
|
|
2363
|
+
local: (options == null ? void 0 : options.local) ?? false,
|
|
2364
|
+
...errorUtil.errToObj(options == null ? void 0 : options.message)
|
|
2225
2365
|
});
|
|
2226
2366
|
}
|
|
2227
2367
|
date(message) {
|
|
@@ -2237,8 +2377,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2237
2377
|
}
|
|
2238
2378
|
return this._addCheck({
|
|
2239
2379
|
kind: "time",
|
|
2240
|
-
precision: typeof (options
|
|
2241
|
-
...errorUtil.errToObj(options
|
|
2380
|
+
precision: typeof (options == null ? void 0 : options.precision) === "undefined" ? null : options == null ? void 0 : options.precision,
|
|
2381
|
+
...errorUtil.errToObj(options == null ? void 0 : options.message)
|
|
2242
2382
|
});
|
|
2243
2383
|
}
|
|
2244
2384
|
duration(message) {
|
|
@@ -2255,8 +2395,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2255
2395
|
return this._addCheck({
|
|
2256
2396
|
kind: "includes",
|
|
2257
2397
|
value,
|
|
2258
|
-
position: options
|
|
2259
|
-
...errorUtil.errToObj(options
|
|
2398
|
+
position: options == null ? void 0 : options.position,
|
|
2399
|
+
...errorUtil.errToObj(options == null ? void 0 : options.message)
|
|
2260
2400
|
});
|
|
2261
2401
|
}
|
|
2262
2402
|
startsWith(value, message) {
|
|
@@ -2295,8 +2435,7 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2295
2435
|
});
|
|
2296
2436
|
}
|
|
2297
2437
|
/**
|
|
2298
|
-
*
|
|
2299
|
-
* @see {@link ZodString.min}
|
|
2438
|
+
* Equivalent to `.min(1)`
|
|
2300
2439
|
*/
|
|
2301
2440
|
nonempty(message) {
|
|
2302
2441
|
return this.min(1, errorUtil.errToObj(message));
|
|
@@ -2358,9 +2497,15 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2358
2497
|
get isIP() {
|
|
2359
2498
|
return !!this._def.checks.find((ch) => ch.kind === "ip");
|
|
2360
2499
|
}
|
|
2500
|
+
get isCIDR() {
|
|
2501
|
+
return !!this._def.checks.find((ch) => ch.kind === "cidr");
|
|
2502
|
+
}
|
|
2361
2503
|
get isBase64() {
|
|
2362
2504
|
return !!this._def.checks.find((ch) => ch.kind === "base64");
|
|
2363
2505
|
}
|
|
2506
|
+
get isBase64url() {
|
|
2507
|
+
return !!this._def.checks.find((ch) => ch.kind === "base64url");
|
|
2508
|
+
}
|
|
2364
2509
|
get minLength() {
|
|
2365
2510
|
let min = null;
|
|
2366
2511
|
for (const ch of this._def.checks) {
|
|
@@ -2383,11 +2528,10 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2383
2528
|
}
|
|
2384
2529
|
};
|
|
2385
2530
|
ZodString.create = (params) => {
|
|
2386
|
-
var _a;
|
|
2387
2531
|
return new ZodString({
|
|
2388
2532
|
checks: [],
|
|
2389
2533
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
2390
|
-
coerce: (
|
|
2534
|
+
coerce: (params == null ? void 0 : params.coerce) ?? false,
|
|
2391
2535
|
...processCreateParams(params)
|
|
2392
2536
|
});
|
|
2393
2537
|
};
|
|
@@ -2395,9 +2539,9 @@ function floatSafeRemainder(val, step) {
|
|
|
2395
2539
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
2396
2540
|
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
|
2397
2541
|
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
2398
|
-
const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
|
|
2399
|
-
const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
|
|
2400
|
-
return valInt % stepInt /
|
|
2542
|
+
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
|
2543
|
+
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
2544
|
+
return valInt % stepInt / 10 ** decCount;
|
|
2401
2545
|
}
|
|
2402
2546
|
var ZodNumber = class _ZodNumber extends ZodType {
|
|
2403
2547
|
constructor() {
|
|
@@ -2607,7 +2751,8 @@ var ZodNumber = class _ZodNumber extends ZodType {
|
|
|
2607
2751
|
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
|
2608
2752
|
}
|
|
2609
2753
|
get isFinite() {
|
|
2610
|
-
let max = null
|
|
2754
|
+
let max = null;
|
|
2755
|
+
let min = null;
|
|
2611
2756
|
for (const ch of this._def.checks) {
|
|
2612
2757
|
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
|
2613
2758
|
return true;
|
|
@@ -2626,7 +2771,7 @@ ZodNumber.create = (params) => {
|
|
|
2626
2771
|
return new ZodNumber({
|
|
2627
2772
|
checks: [],
|
|
2628
2773
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
2629
|
-
coerce: (params
|
|
2774
|
+
coerce: (params == null ? void 0 : params.coerce) || false,
|
|
2630
2775
|
...processCreateParams(params)
|
|
2631
2776
|
});
|
|
2632
2777
|
};
|
|
@@ -2638,17 +2783,15 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
2638
2783
|
}
|
|
2639
2784
|
_parse(input) {
|
|
2640
2785
|
if (this._def.coerce) {
|
|
2641
|
-
|
|
2786
|
+
try {
|
|
2787
|
+
input.data = BigInt(input.data);
|
|
2788
|
+
} catch {
|
|
2789
|
+
return this._getInvalidInput(input);
|
|
2790
|
+
}
|
|
2642
2791
|
}
|
|
2643
2792
|
const parsedType = this._getType(input);
|
|
2644
2793
|
if (parsedType !== ZodParsedType.bigint) {
|
|
2645
|
-
|
|
2646
|
-
addIssueToContext(ctx2, {
|
|
2647
|
-
code: ZodIssueCode.invalid_type,
|
|
2648
|
-
expected: ZodParsedType.bigint,
|
|
2649
|
-
received: ctx2.parsedType
|
|
2650
|
-
});
|
|
2651
|
-
return INVALID;
|
|
2794
|
+
return this._getInvalidInput(input);
|
|
2652
2795
|
}
|
|
2653
2796
|
let ctx = void 0;
|
|
2654
2797
|
const status = new ParseStatus();
|
|
@@ -2695,6 +2838,15 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
2695
2838
|
}
|
|
2696
2839
|
return { status: status.value, value: input.data };
|
|
2697
2840
|
}
|
|
2841
|
+
_getInvalidInput(input) {
|
|
2842
|
+
const ctx = this._getOrReturnCtx(input);
|
|
2843
|
+
addIssueToContext(ctx, {
|
|
2844
|
+
code: ZodIssueCode.invalid_type,
|
|
2845
|
+
expected: ZodParsedType.bigint,
|
|
2846
|
+
received: ctx.parsedType
|
|
2847
|
+
});
|
|
2848
|
+
return INVALID;
|
|
2849
|
+
}
|
|
2698
2850
|
gte(value, message) {
|
|
2699
2851
|
return this.setLimit("min", value, true, errorUtil.toString(message));
|
|
2700
2852
|
}
|
|
@@ -2788,11 +2940,10 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
2788
2940
|
}
|
|
2789
2941
|
};
|
|
2790
2942
|
ZodBigInt.create = (params) => {
|
|
2791
|
-
var _a;
|
|
2792
2943
|
return new ZodBigInt({
|
|
2793
2944
|
checks: [],
|
|
2794
2945
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
2795
|
-
coerce: (
|
|
2946
|
+
coerce: (params == null ? void 0 : params.coerce) ?? false,
|
|
2796
2947
|
...processCreateParams(params)
|
|
2797
2948
|
});
|
|
2798
2949
|
};
|
|
@@ -2817,7 +2968,7 @@ var ZodBoolean = class extends ZodType {
|
|
|
2817
2968
|
ZodBoolean.create = (params) => {
|
|
2818
2969
|
return new ZodBoolean({
|
|
2819
2970
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
2820
|
-
coerce: (params
|
|
2971
|
+
coerce: (params == null ? void 0 : params.coerce) || false,
|
|
2821
2972
|
...processCreateParams(params)
|
|
2822
2973
|
});
|
|
2823
2974
|
};
|
|
@@ -2836,7 +2987,7 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
2836
2987
|
});
|
|
2837
2988
|
return INVALID;
|
|
2838
2989
|
}
|
|
2839
|
-
if (isNaN(input.data.getTime())) {
|
|
2990
|
+
if (Number.isNaN(input.data.getTime())) {
|
|
2840
2991
|
const ctx2 = this._getOrReturnCtx(input);
|
|
2841
2992
|
addIssueToContext(ctx2, {
|
|
2842
2993
|
code: ZodIssueCode.invalid_date
|
|
@@ -2925,7 +3076,7 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
2925
3076
|
ZodDate.create = (params) => {
|
|
2926
3077
|
return new ZodDate({
|
|
2927
3078
|
checks: [],
|
|
2928
|
-
coerce: (params
|
|
3079
|
+
coerce: (params == null ? void 0 : params.coerce) || false,
|
|
2929
3080
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
2930
3081
|
...processCreateParams(params)
|
|
2931
3082
|
});
|
|
@@ -3200,7 +3351,8 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3200
3351
|
return this._cached;
|
|
3201
3352
|
const shape = this._def.shape();
|
|
3202
3353
|
const keys = util.objectKeys(shape);
|
|
3203
|
-
|
|
3354
|
+
this._cached = { shape, keys };
|
|
3355
|
+
return this._cached;
|
|
3204
3356
|
}
|
|
3205
3357
|
_parse(input) {
|
|
3206
3358
|
const parsedType = this._getType(input);
|
|
@@ -3250,9 +3402,8 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3250
3402
|
});
|
|
3251
3403
|
status.dirty();
|
|
3252
3404
|
}
|
|
3253
|
-
} else if (unknownKeys === "strip")
|
|
3254
|
-
|
|
3255
|
-
else {
|
|
3405
|
+
} else if (unknownKeys === "strip") {
|
|
3406
|
+
} else {
|
|
3256
3407
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
3257
3408
|
}
|
|
3258
3409
|
} else {
|
|
@@ -3299,11 +3450,11 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3299
3450
|
unknownKeys: "strict",
|
|
3300
3451
|
...message !== void 0 ? {
|
|
3301
3452
|
errorMap: (issue, ctx) => {
|
|
3302
|
-
var _a, _b
|
|
3303
|
-
const defaultError = (
|
|
3453
|
+
var _a, _b;
|
|
3454
|
+
const defaultError = ((_b = (_a = this._def).errorMap) == null ? void 0 : _b.call(_a, issue, ctx).message) ?? ctx.defaultError;
|
|
3304
3455
|
if (issue.code === "unrecognized_keys")
|
|
3305
3456
|
return {
|
|
3306
|
-
message:
|
|
3457
|
+
message: errorUtil.errToObj(message).message ?? defaultError
|
|
3307
3458
|
};
|
|
3308
3459
|
return {
|
|
3309
3460
|
message: defaultError
|
|
@@ -3426,19 +3577,19 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3426
3577
|
// }) as any;
|
|
3427
3578
|
// return merged;
|
|
3428
3579
|
// }
|
|
3429
|
-
catchall(
|
|
3580
|
+
catchall(index6) {
|
|
3430
3581
|
return new _ZodObject({
|
|
3431
3582
|
...this._def,
|
|
3432
|
-
catchall:
|
|
3583
|
+
catchall: index6
|
|
3433
3584
|
});
|
|
3434
3585
|
}
|
|
3435
3586
|
pick(mask) {
|
|
3436
3587
|
const shape = {};
|
|
3437
|
-
util.objectKeys(mask)
|
|
3588
|
+
for (const key of util.objectKeys(mask)) {
|
|
3438
3589
|
if (mask[key] && this.shape[key]) {
|
|
3439
3590
|
shape[key] = this.shape[key];
|
|
3440
3591
|
}
|
|
3441
|
-
}
|
|
3592
|
+
}
|
|
3442
3593
|
return new _ZodObject({
|
|
3443
3594
|
...this._def,
|
|
3444
3595
|
shape: () => shape
|
|
@@ -3446,11 +3597,11 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3446
3597
|
}
|
|
3447
3598
|
omit(mask) {
|
|
3448
3599
|
const shape = {};
|
|
3449
|
-
util.objectKeys(this.shape)
|
|
3600
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
3450
3601
|
if (!mask[key]) {
|
|
3451
3602
|
shape[key] = this.shape[key];
|
|
3452
3603
|
}
|
|
3453
|
-
}
|
|
3604
|
+
}
|
|
3454
3605
|
return new _ZodObject({
|
|
3455
3606
|
...this._def,
|
|
3456
3607
|
shape: () => shape
|
|
@@ -3464,14 +3615,14 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3464
3615
|
}
|
|
3465
3616
|
partial(mask) {
|
|
3466
3617
|
const newShape = {};
|
|
3467
|
-
util.objectKeys(this.shape)
|
|
3618
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
3468
3619
|
const fieldSchema = this.shape[key];
|
|
3469
3620
|
if (mask && !mask[key]) {
|
|
3470
3621
|
newShape[key] = fieldSchema;
|
|
3471
3622
|
} else {
|
|
3472
3623
|
newShape[key] = fieldSchema.optional();
|
|
3473
3624
|
}
|
|
3474
|
-
}
|
|
3625
|
+
}
|
|
3475
3626
|
return new _ZodObject({
|
|
3476
3627
|
...this._def,
|
|
3477
3628
|
shape: () => newShape
|
|
@@ -3479,7 +3630,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3479
3630
|
}
|
|
3480
3631
|
required(mask) {
|
|
3481
3632
|
const newShape = {};
|
|
3482
|
-
util.objectKeys(this.shape)
|
|
3633
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
3483
3634
|
if (mask && !mask[key]) {
|
|
3484
3635
|
newShape[key] = this.shape[key];
|
|
3485
3636
|
} else {
|
|
@@ -3490,7 +3641,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3490
3641
|
}
|
|
3491
3642
|
newShape[key] = newField;
|
|
3492
3643
|
}
|
|
3493
|
-
}
|
|
3644
|
+
}
|
|
3494
3645
|
return new _ZodObject({
|
|
3495
3646
|
...this._def,
|
|
3496
3647
|
shape: () => newShape
|
|
@@ -3747,9 +3898,9 @@ function mergeValues(a, b) {
|
|
|
3747
3898
|
return { valid: false };
|
|
3748
3899
|
}
|
|
3749
3900
|
const newArray = [];
|
|
3750
|
-
for (let
|
|
3751
|
-
const itemA = a[
|
|
3752
|
-
const itemB = b[
|
|
3901
|
+
for (let index6 = 0; index6 < a.length; index6++) {
|
|
3902
|
+
const itemA = a[index6];
|
|
3903
|
+
const itemB = b[index6];
|
|
3753
3904
|
const sharedValue = mergeValues(itemA, itemB);
|
|
3754
3905
|
if (!sharedValue.valid) {
|
|
3755
3906
|
return { valid: false };
|
|
@@ -3955,10 +4106,10 @@ var ZodMap = class extends ZodType {
|
|
|
3955
4106
|
}
|
|
3956
4107
|
const keyType = this._def.keyType;
|
|
3957
4108
|
const valueType = this._def.valueType;
|
|
3958
|
-
const pairs = [...ctx.data.entries()].map(([key, value],
|
|
4109
|
+
const pairs = [...ctx.data.entries()].map(([key, value], index6) => {
|
|
3959
4110
|
return {
|
|
3960
|
-
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [
|
|
3961
|
-
value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [
|
|
4111
|
+
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index6, "key"])),
|
|
4112
|
+
value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index6, "value"]))
|
|
3962
4113
|
};
|
|
3963
4114
|
});
|
|
3964
4115
|
if (ctx.common.async) {
|
|
@@ -4106,12 +4257,7 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
4106
4257
|
return makeIssue({
|
|
4107
4258
|
data: args,
|
|
4108
4259
|
path: ctx.path,
|
|
4109
|
-
errorMaps: [
|
|
4110
|
-
ctx.common.contextualErrorMap,
|
|
4111
|
-
ctx.schemaErrorMap,
|
|
4112
|
-
getErrorMap(),
|
|
4113
|
-
errorMap
|
|
4114
|
-
].filter((x) => !!x),
|
|
4260
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
4115
4261
|
issueData: {
|
|
4116
4262
|
code: ZodIssueCode.invalid_arguments,
|
|
4117
4263
|
argumentsError: error
|
|
@@ -4122,12 +4268,7 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
4122
4268
|
return makeIssue({
|
|
4123
4269
|
data: returns,
|
|
4124
4270
|
path: ctx.path,
|
|
4125
|
-
errorMaps: [
|
|
4126
|
-
ctx.common.contextualErrorMap,
|
|
4127
|
-
ctx.schemaErrorMap,
|
|
4128
|
-
getErrorMap(),
|
|
4129
|
-
errorMap
|
|
4130
|
-
].filter((x) => !!x),
|
|
4271
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
4131
4272
|
issueData: {
|
|
4132
4273
|
code: ZodIssueCode.invalid_return_type,
|
|
4133
4274
|
returnTypeError: error
|
|
@@ -4251,10 +4392,6 @@ function createZodEnum(values, params) {
|
|
|
4251
4392
|
});
|
|
4252
4393
|
}
|
|
4253
4394
|
var ZodEnum = class _ZodEnum extends ZodType {
|
|
4254
|
-
constructor() {
|
|
4255
|
-
super(...arguments);
|
|
4256
|
-
_ZodEnum_cache.set(this, void 0);
|
|
4257
|
-
}
|
|
4258
4395
|
_parse(input) {
|
|
4259
4396
|
if (typeof input.data !== "string") {
|
|
4260
4397
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -4266,10 +4403,10 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
4266
4403
|
});
|
|
4267
4404
|
return INVALID;
|
|
4268
4405
|
}
|
|
4269
|
-
if (!
|
|
4270
|
-
|
|
4406
|
+
if (!this._cache) {
|
|
4407
|
+
this._cache = new Set(this._def.values);
|
|
4271
4408
|
}
|
|
4272
|
-
if (!
|
|
4409
|
+
if (!this._cache.has(input.data)) {
|
|
4273
4410
|
const ctx = this._getOrReturnCtx(input);
|
|
4274
4411
|
const expectedValues = this._def.values;
|
|
4275
4412
|
addIssueToContext(ctx, {
|
|
@@ -4318,13 +4455,8 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
4318
4455
|
});
|
|
4319
4456
|
}
|
|
4320
4457
|
};
|
|
4321
|
-
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
4322
4458
|
ZodEnum.create = createZodEnum;
|
|
4323
4459
|
var ZodNativeEnum = class extends ZodType {
|
|
4324
|
-
constructor() {
|
|
4325
|
-
super(...arguments);
|
|
4326
|
-
_ZodNativeEnum_cache.set(this, void 0);
|
|
4327
|
-
}
|
|
4328
4460
|
_parse(input) {
|
|
4329
4461
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
4330
4462
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -4337,10 +4469,10 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
4337
4469
|
});
|
|
4338
4470
|
return INVALID;
|
|
4339
4471
|
}
|
|
4340
|
-
if (!
|
|
4341
|
-
|
|
4472
|
+
if (!this._cache) {
|
|
4473
|
+
this._cache = new Set(util.getValidEnumValues(this._def.values));
|
|
4342
4474
|
}
|
|
4343
|
-
if (!
|
|
4475
|
+
if (!this._cache.has(input.data)) {
|
|
4344
4476
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
4345
4477
|
addIssueToContext(ctx, {
|
|
4346
4478
|
received: ctx.data,
|
|
@@ -4355,7 +4487,6 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
4355
4487
|
return this._def.values;
|
|
4356
4488
|
}
|
|
4357
4489
|
};
|
|
4358
|
-
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
4359
4490
|
ZodNativeEnum.create = (values, params) => {
|
|
4360
4491
|
return new ZodNativeEnum({
|
|
4361
4492
|
values,
|
|
@@ -4496,7 +4627,7 @@ var ZodEffects = class extends ZodType {
|
|
|
4496
4627
|
parent: ctx
|
|
4497
4628
|
});
|
|
4498
4629
|
if (!isValid(base))
|
|
4499
|
-
return
|
|
4630
|
+
return INVALID;
|
|
4500
4631
|
const result = effect.transform(base.value, checkCtx);
|
|
4501
4632
|
if (result instanceof Promise) {
|
|
4502
4633
|
throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
|
|
@@ -4505,8 +4636,11 @@ var ZodEffects = class extends ZodType {
|
|
|
4505
4636
|
} else {
|
|
4506
4637
|
return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
|
|
4507
4638
|
if (!isValid(base))
|
|
4508
|
-
return
|
|
4509
|
-
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
4639
|
+
return INVALID;
|
|
4640
|
+
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
4641
|
+
status: status.value,
|
|
4642
|
+
value: result
|
|
4643
|
+
}));
|
|
4510
4644
|
});
|
|
4511
4645
|
}
|
|
4512
4646
|
}
|
|
@@ -4835,83 +4969,341 @@ var nullableType = ZodNullable.create;
|
|
|
4835
4969
|
var preprocessType = ZodEffects.createWithPreprocess;
|
|
4836
4970
|
var pipelineType = ZodPipeline.create;
|
|
4837
4971
|
|
|
4838
|
-
// src/serializer/
|
|
4972
|
+
// src/serializer/gelSchema.ts
|
|
4973
|
+
var enumSchema = objectType({
|
|
4974
|
+
name: stringType(),
|
|
4975
|
+
schema: stringType(),
|
|
4976
|
+
values: stringType().array()
|
|
4977
|
+
}).strict();
|
|
4978
|
+
var enumSchemaV1 = objectType({
|
|
4979
|
+
name: stringType(),
|
|
4980
|
+
values: recordType(stringType(), stringType())
|
|
4981
|
+
}).strict();
|
|
4982
|
+
var indexColumn = objectType({
|
|
4983
|
+
expression: stringType(),
|
|
4984
|
+
isExpression: booleanType(),
|
|
4985
|
+
asc: booleanType(),
|
|
4986
|
+
nulls: stringType().optional(),
|
|
4987
|
+
opclass: stringType().optional()
|
|
4988
|
+
});
|
|
4839
4989
|
var index = objectType({
|
|
4840
4990
|
name: stringType(),
|
|
4841
|
-
columns:
|
|
4991
|
+
columns: indexColumn.array(),
|
|
4842
4992
|
isUnique: booleanType(),
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4993
|
+
with: recordType(stringType(), anyType()).optional(),
|
|
4994
|
+
method: stringType().default("btree"),
|
|
4995
|
+
where: stringType().optional(),
|
|
4996
|
+
concurrently: booleanType().default(false)
|
|
4846
4997
|
}).strict();
|
|
4847
4998
|
var fk = objectType({
|
|
4848
4999
|
name: stringType(),
|
|
4849
5000
|
tableFrom: stringType(),
|
|
4850
5001
|
columnsFrom: stringType().array(),
|
|
4851
5002
|
tableTo: stringType(),
|
|
5003
|
+
schemaTo: stringType().optional(),
|
|
4852
5004
|
columnsTo: stringType().array(),
|
|
4853
5005
|
onUpdate: stringType().optional(),
|
|
4854
5006
|
onDelete: stringType().optional()
|
|
4855
5007
|
}).strict();
|
|
5008
|
+
var sequenceSchema = objectType({
|
|
5009
|
+
name: stringType(),
|
|
5010
|
+
increment: stringType().optional(),
|
|
5011
|
+
minValue: stringType().optional(),
|
|
5012
|
+
maxValue: stringType().optional(),
|
|
5013
|
+
startWith: stringType().optional(),
|
|
5014
|
+
cache: stringType().optional(),
|
|
5015
|
+
cycle: booleanType().optional(),
|
|
5016
|
+
schema: stringType()
|
|
5017
|
+
}).strict();
|
|
5018
|
+
var roleSchema = objectType({
|
|
5019
|
+
name: stringType(),
|
|
5020
|
+
createDb: booleanType().optional(),
|
|
5021
|
+
createRole: booleanType().optional(),
|
|
5022
|
+
inherit: booleanType().optional()
|
|
5023
|
+
}).strict();
|
|
5024
|
+
var sequenceSquashed = objectType({
|
|
5025
|
+
name: stringType(),
|
|
5026
|
+
schema: stringType(),
|
|
5027
|
+
values: stringType()
|
|
5028
|
+
}).strict();
|
|
4856
5029
|
var column = objectType({
|
|
4857
5030
|
name: stringType(),
|
|
4858
5031
|
type: stringType(),
|
|
5032
|
+
typeSchema: stringType().optional(),
|
|
4859
5033
|
primaryKey: booleanType(),
|
|
4860
5034
|
notNull: booleanType(),
|
|
4861
|
-
autoincrement: booleanType().optional(),
|
|
4862
5035
|
default: anyType().optional(),
|
|
4863
|
-
|
|
5036
|
+
isUnique: anyType().optional(),
|
|
5037
|
+
uniqueName: stringType().optional(),
|
|
5038
|
+
nullsNotDistinct: booleanType().optional(),
|
|
4864
5039
|
generated: objectType({
|
|
4865
|
-
type:
|
|
5040
|
+
type: literalType("stored"),
|
|
4866
5041
|
as: stringType()
|
|
4867
|
-
}).optional()
|
|
5042
|
+
}).optional(),
|
|
5043
|
+
identity: sequenceSchema.merge(objectType({ type: enumType(["always", "byDefault"]) })).optional()
|
|
4868
5044
|
}).strict();
|
|
4869
|
-
var
|
|
5045
|
+
var checkConstraint = objectType({
|
|
4870
5046
|
name: stringType(),
|
|
4871
|
-
|
|
4872
|
-
indexes: recordType(stringType(), index),
|
|
4873
|
-
foreignKeys: recordType(stringType(), fk)
|
|
5047
|
+
value: stringType()
|
|
4874
5048
|
}).strict();
|
|
4875
|
-
var
|
|
5049
|
+
var columnSquashed = objectType({
|
|
5050
|
+
name: stringType(),
|
|
5051
|
+
type: stringType(),
|
|
5052
|
+
typeSchema: stringType().optional(),
|
|
5053
|
+
primaryKey: booleanType(),
|
|
5054
|
+
notNull: booleanType(),
|
|
5055
|
+
default: anyType().optional(),
|
|
5056
|
+
isUnique: anyType().optional(),
|
|
5057
|
+
uniqueName: stringType().optional(),
|
|
5058
|
+
nullsNotDistinct: booleanType().optional(),
|
|
5059
|
+
generated: objectType({
|
|
5060
|
+
type: literalType("stored"),
|
|
5061
|
+
as: stringType()
|
|
5062
|
+
}).optional(),
|
|
5063
|
+
identity: stringType().optional()
|
|
5064
|
+
}).strict();
|
|
5065
|
+
var compositePK = objectType({
|
|
4876
5066
|
name: stringType(),
|
|
4877
5067
|
columns: stringType().array()
|
|
4878
5068
|
}).strict();
|
|
4879
5069
|
var uniqueConstraint = objectType({
|
|
4880
5070
|
name: stringType(),
|
|
4881
|
-
columns: stringType().array()
|
|
5071
|
+
columns: stringType().array(),
|
|
5072
|
+
nullsNotDistinct: booleanType()
|
|
4882
5073
|
}).strict();
|
|
4883
|
-
var
|
|
5074
|
+
var policy = objectType({
|
|
4884
5075
|
name: stringType(),
|
|
4885
|
-
|
|
5076
|
+
as: enumType(["PERMISSIVE", "RESTRICTIVE"]).optional(),
|
|
5077
|
+
for: enumType(["ALL", "SELECT", "INSERT", "UPDATE", "DELETE"]).optional(),
|
|
5078
|
+
to: stringType().array().optional(),
|
|
5079
|
+
using: stringType().optional(),
|
|
5080
|
+
withCheck: stringType().optional(),
|
|
5081
|
+
on: stringType().optional(),
|
|
5082
|
+
schema: stringType().optional()
|
|
4886
5083
|
}).strict();
|
|
4887
|
-
var
|
|
5084
|
+
var policySquashed = objectType({
|
|
4888
5085
|
name: stringType(),
|
|
4889
|
-
|
|
5086
|
+
values: stringType()
|
|
5087
|
+
}).strict();
|
|
5088
|
+
var viewWithOption = objectType({
|
|
5089
|
+
checkOption: enumType(["local", "cascaded"]).optional(),
|
|
5090
|
+
securityBarrier: booleanType().optional(),
|
|
5091
|
+
securityInvoker: booleanType().optional()
|
|
5092
|
+
}).strict();
|
|
5093
|
+
var matViewWithOption = objectType({
|
|
5094
|
+
fillfactor: numberType().optional(),
|
|
5095
|
+
toastTupleTarget: numberType().optional(),
|
|
5096
|
+
parallelWorkers: numberType().optional(),
|
|
5097
|
+
autovacuumEnabled: booleanType().optional(),
|
|
5098
|
+
vacuumIndexCleanup: enumType(["auto", "off", "on"]).optional(),
|
|
5099
|
+
vacuumTruncate: booleanType().optional(),
|
|
5100
|
+
autovacuumVacuumThreshold: numberType().optional(),
|
|
5101
|
+
autovacuumVacuumScaleFactor: numberType().optional(),
|
|
5102
|
+
autovacuumVacuumCostDelay: numberType().optional(),
|
|
5103
|
+
autovacuumVacuumCostLimit: numberType().optional(),
|
|
5104
|
+
autovacuumFreezeMinAge: numberType().optional(),
|
|
5105
|
+
autovacuumFreezeMaxAge: numberType().optional(),
|
|
5106
|
+
autovacuumFreezeTableAge: numberType().optional(),
|
|
5107
|
+
autovacuumMultixactFreezeMinAge: numberType().optional(),
|
|
5108
|
+
autovacuumMultixactFreezeMaxAge: numberType().optional(),
|
|
5109
|
+
autovacuumMultixactFreezeTableAge: numberType().optional(),
|
|
5110
|
+
logAutovacuumMinDuration: numberType().optional(),
|
|
5111
|
+
userCatalogTable: booleanType().optional()
|
|
5112
|
+
}).strict();
|
|
5113
|
+
var mergedViewWithOption = viewWithOption.merge(matViewWithOption).strict();
|
|
5114
|
+
var view = objectType({
|
|
5115
|
+
name: stringType(),
|
|
5116
|
+
schema: stringType(),
|
|
4890
5117
|
columns: recordType(stringType(), column),
|
|
4891
|
-
|
|
4892
|
-
|
|
5118
|
+
definition: stringType().optional(),
|
|
5119
|
+
materialized: booleanType(),
|
|
5120
|
+
with: mergedViewWithOption.optional(),
|
|
5121
|
+
isExisting: booleanType(),
|
|
5122
|
+
withNoData: booleanType().optional(),
|
|
5123
|
+
using: stringType().optional(),
|
|
5124
|
+
tablespace: stringType().optional()
|
|
4893
5125
|
}).strict();
|
|
4894
5126
|
var table = objectType({
|
|
4895
5127
|
name: stringType(),
|
|
5128
|
+
schema: stringType(),
|
|
4896
5129
|
columns: recordType(stringType(), column),
|
|
4897
5130
|
indexes: recordType(stringType(), index),
|
|
4898
5131
|
foreignKeys: recordType(stringType(), fk),
|
|
4899
5132
|
compositePrimaryKeys: recordType(stringType(), compositePK),
|
|
4900
5133
|
uniqueConstraints: recordType(stringType(), uniqueConstraint).default({}),
|
|
4901
|
-
|
|
5134
|
+
policies: recordType(stringType(), policy).default({}),
|
|
5135
|
+
checkConstraints: recordType(stringType(), checkConstraint).default({}),
|
|
5136
|
+
isRLSEnabled: booleanType().default(false)
|
|
5137
|
+
}).strict();
|
|
5138
|
+
var schemaHash = objectType({
|
|
5139
|
+
id: stringType(),
|
|
5140
|
+
prevId: stringType()
|
|
5141
|
+
});
|
|
5142
|
+
var kitInternals = objectType({
|
|
5143
|
+
tables: recordType(
|
|
5144
|
+
stringType(),
|
|
5145
|
+
objectType({
|
|
5146
|
+
columns: recordType(
|
|
5147
|
+
stringType(),
|
|
5148
|
+
objectType({
|
|
5149
|
+
isArray: booleanType().optional(),
|
|
5150
|
+
dimensions: numberType().optional(),
|
|
5151
|
+
rawType: stringType().optional(),
|
|
5152
|
+
isDefaultAnExpression: booleanType().optional()
|
|
5153
|
+
}).optional()
|
|
5154
|
+
)
|
|
5155
|
+
}).optional()
|
|
5156
|
+
)
|
|
5157
|
+
}).optional();
|
|
5158
|
+
var gelSchemaExternal = objectType({
|
|
5159
|
+
version: literalType("1"),
|
|
5160
|
+
dialect: literalType("gel"),
|
|
5161
|
+
tables: arrayType(table),
|
|
5162
|
+
enums: arrayType(enumSchemaV1),
|
|
5163
|
+
schemas: arrayType(objectType({ name: stringType() })),
|
|
5164
|
+
_meta: objectType({
|
|
5165
|
+
schemas: recordType(stringType(), stringType()),
|
|
5166
|
+
tables: recordType(stringType(), stringType()),
|
|
5167
|
+
columns: recordType(stringType(), stringType())
|
|
5168
|
+
})
|
|
5169
|
+
}).strict();
|
|
5170
|
+
var gelSchemaInternal = objectType({
|
|
5171
|
+
version: literalType("1"),
|
|
5172
|
+
dialect: literalType("gel"),
|
|
5173
|
+
tables: recordType(stringType(), table),
|
|
5174
|
+
enums: recordType(stringType(), enumSchema),
|
|
5175
|
+
schemas: recordType(stringType(), stringType()),
|
|
5176
|
+
views: recordType(stringType(), view).default({}),
|
|
5177
|
+
sequences: recordType(stringType(), sequenceSchema).default({}),
|
|
5178
|
+
roles: recordType(stringType(), roleSchema).default({}),
|
|
5179
|
+
policies: recordType(stringType(), policy).default({}),
|
|
5180
|
+
_meta: objectType({
|
|
5181
|
+
schemas: recordType(stringType(), stringType()),
|
|
5182
|
+
tables: recordType(stringType(), stringType()),
|
|
5183
|
+
columns: recordType(stringType(), stringType())
|
|
5184
|
+
}),
|
|
5185
|
+
internal: kitInternals
|
|
5186
|
+
}).strict();
|
|
5187
|
+
var tableSquashed = objectType({
|
|
5188
|
+
name: stringType(),
|
|
5189
|
+
schema: stringType(),
|
|
5190
|
+
columns: recordType(stringType(), columnSquashed),
|
|
5191
|
+
indexes: recordType(stringType(), stringType()),
|
|
5192
|
+
foreignKeys: recordType(stringType(), stringType()),
|
|
5193
|
+
compositePrimaryKeys: recordType(stringType(), stringType()),
|
|
5194
|
+
uniqueConstraints: recordType(stringType(), stringType()),
|
|
5195
|
+
policies: recordType(stringType(), stringType()),
|
|
5196
|
+
checkConstraints: recordType(stringType(), stringType()),
|
|
5197
|
+
isRLSEnabled: booleanType().default(false)
|
|
5198
|
+
}).strict();
|
|
5199
|
+
var gelSchemaSquashed = objectType({
|
|
5200
|
+
version: literalType("1"),
|
|
5201
|
+
dialect: literalType("gel"),
|
|
5202
|
+
tables: recordType(stringType(), tableSquashed),
|
|
5203
|
+
enums: recordType(stringType(), enumSchema),
|
|
5204
|
+
schemas: recordType(stringType(), stringType()),
|
|
5205
|
+
views: recordType(stringType(), view),
|
|
5206
|
+
sequences: recordType(stringType(), sequenceSquashed),
|
|
5207
|
+
roles: recordType(stringType(), roleSchema).default({}),
|
|
5208
|
+
policies: recordType(stringType(), policySquashed).default({})
|
|
5209
|
+
}).strict();
|
|
5210
|
+
var gelSchema = gelSchemaInternal.merge(schemaHash);
|
|
5211
|
+
var backwardCompatibleGelSchema = gelSchema;
|
|
5212
|
+
var dryGel = gelSchema.parse({
|
|
5213
|
+
version: "1",
|
|
5214
|
+
dialect: "gel",
|
|
5215
|
+
id: originUUID,
|
|
5216
|
+
prevId: "",
|
|
5217
|
+
tables: {},
|
|
5218
|
+
enums: {},
|
|
5219
|
+
schemas: {},
|
|
5220
|
+
policies: {},
|
|
5221
|
+
roles: {},
|
|
5222
|
+
sequences: {},
|
|
5223
|
+
_meta: {
|
|
5224
|
+
schemas: {},
|
|
5225
|
+
tables: {},
|
|
5226
|
+
columns: {}
|
|
5227
|
+
}
|
|
5228
|
+
});
|
|
5229
|
+
|
|
5230
|
+
// src/serializer/mysqlSchema.ts
|
|
5231
|
+
var index2 = objectType({
|
|
5232
|
+
name: stringType(),
|
|
5233
|
+
columns: stringType().array(),
|
|
5234
|
+
isUnique: booleanType(),
|
|
5235
|
+
using: enumType(["btree", "hash"]).optional(),
|
|
5236
|
+
algorithm: enumType(["default", "inplace", "copy"]).optional(),
|
|
5237
|
+
lock: enumType(["default", "none", "shared", "exclusive"]).optional()
|
|
5238
|
+
}).strict();
|
|
5239
|
+
var fk2 = objectType({
|
|
5240
|
+
name: stringType(),
|
|
5241
|
+
tableFrom: stringType(),
|
|
5242
|
+
columnsFrom: stringType().array(),
|
|
5243
|
+
tableTo: stringType(),
|
|
5244
|
+
columnsTo: stringType().array(),
|
|
5245
|
+
onUpdate: stringType().optional(),
|
|
5246
|
+
onDelete: stringType().optional()
|
|
5247
|
+
}).strict();
|
|
5248
|
+
var column2 = objectType({
|
|
5249
|
+
name: stringType(),
|
|
5250
|
+
type: stringType(),
|
|
5251
|
+
primaryKey: booleanType(),
|
|
5252
|
+
notNull: booleanType(),
|
|
5253
|
+
autoincrement: booleanType().optional(),
|
|
5254
|
+
default: anyType().optional(),
|
|
5255
|
+
onUpdate: anyType().optional(),
|
|
5256
|
+
generated: objectType({
|
|
5257
|
+
type: enumType(["stored", "virtual"]),
|
|
5258
|
+
as: stringType()
|
|
5259
|
+
}).optional()
|
|
5260
|
+
}).strict();
|
|
5261
|
+
var tableV3 = objectType({
|
|
5262
|
+
name: stringType(),
|
|
5263
|
+
columns: recordType(stringType(), column2),
|
|
5264
|
+
indexes: recordType(stringType(), index2),
|
|
5265
|
+
foreignKeys: recordType(stringType(), fk2)
|
|
5266
|
+
}).strict();
|
|
5267
|
+
var compositePK2 = objectType({
|
|
5268
|
+
name: stringType(),
|
|
5269
|
+
columns: stringType().array()
|
|
5270
|
+
}).strict();
|
|
5271
|
+
var uniqueConstraint2 = objectType({
|
|
5272
|
+
name: stringType(),
|
|
5273
|
+
columns: stringType().array()
|
|
5274
|
+
}).strict();
|
|
5275
|
+
var checkConstraint2 = objectType({
|
|
5276
|
+
name: stringType(),
|
|
5277
|
+
value: stringType()
|
|
5278
|
+
}).strict();
|
|
5279
|
+
var tableV4 = objectType({
|
|
5280
|
+
name: stringType(),
|
|
5281
|
+
schema: stringType().optional(),
|
|
5282
|
+
columns: recordType(stringType(), column2),
|
|
5283
|
+
indexes: recordType(stringType(), index2),
|
|
5284
|
+
foreignKeys: recordType(stringType(), fk2)
|
|
5285
|
+
}).strict();
|
|
5286
|
+
var table2 = objectType({
|
|
5287
|
+
name: stringType(),
|
|
5288
|
+
columns: recordType(stringType(), column2),
|
|
5289
|
+
indexes: recordType(stringType(), index2),
|
|
5290
|
+
foreignKeys: recordType(stringType(), fk2),
|
|
5291
|
+
compositePrimaryKeys: recordType(stringType(), compositePK2),
|
|
5292
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({}),
|
|
5293
|
+
checkConstraint: recordType(stringType(), checkConstraint2).default({})
|
|
4902
5294
|
}).strict();
|
|
4903
5295
|
var viewMeta = objectType({
|
|
4904
5296
|
algorithm: enumType(["undefined", "merge", "temptable"]),
|
|
4905
5297
|
sqlSecurity: enumType(["definer", "invoker"]),
|
|
4906
5298
|
withCheckOption: enumType(["local", "cascaded"]).optional()
|
|
4907
5299
|
}).strict();
|
|
4908
|
-
var
|
|
5300
|
+
var view2 = objectType({
|
|
4909
5301
|
name: stringType(),
|
|
4910
|
-
columns: recordType(stringType(),
|
|
5302
|
+
columns: recordType(stringType(), column2),
|
|
4911
5303
|
definition: stringType().optional(),
|
|
4912
5304
|
isExisting: booleanType()
|
|
4913
5305
|
}).strict().merge(viewMeta);
|
|
4914
|
-
var
|
|
5306
|
+
var kitInternals2 = objectType({
|
|
4915
5307
|
tables: recordType(
|
|
4916
5308
|
stringType(),
|
|
4917
5309
|
objectType({
|
|
@@ -4932,7 +5324,7 @@ var kitInternals = objectType({
|
|
|
4932
5324
|
).optional()
|
|
4933
5325
|
}).optional();
|
|
4934
5326
|
var dialect = literalType("mysql");
|
|
4935
|
-
var
|
|
5327
|
+
var schemaHash2 = objectType({
|
|
4936
5328
|
id: stringType(),
|
|
4937
5329
|
prevId: stringType()
|
|
4938
5330
|
});
|
|
@@ -4950,47 +5342,47 @@ var schemaInternalV4 = objectType({
|
|
|
4950
5342
|
var schemaInternalV5 = objectType({
|
|
4951
5343
|
version: literalType("5"),
|
|
4952
5344
|
dialect,
|
|
4953
|
-
tables: recordType(stringType(),
|
|
5345
|
+
tables: recordType(stringType(), table2),
|
|
4954
5346
|
schemas: recordType(stringType(), stringType()),
|
|
4955
5347
|
_meta: objectType({
|
|
4956
5348
|
schemas: recordType(stringType(), stringType()),
|
|
4957
5349
|
tables: recordType(stringType(), stringType()),
|
|
4958
5350
|
columns: recordType(stringType(), stringType())
|
|
4959
5351
|
}),
|
|
4960
|
-
internal:
|
|
5352
|
+
internal: kitInternals2
|
|
4961
5353
|
}).strict();
|
|
4962
5354
|
var schemaInternal = objectType({
|
|
4963
5355
|
version: literalType("5"),
|
|
4964
5356
|
dialect,
|
|
4965
|
-
tables: recordType(stringType(),
|
|
4966
|
-
views: recordType(stringType(),
|
|
5357
|
+
tables: recordType(stringType(), table2),
|
|
5358
|
+
views: recordType(stringType(), view2).default({}),
|
|
4967
5359
|
_meta: objectType({
|
|
4968
5360
|
tables: recordType(stringType(), stringType()),
|
|
4969
5361
|
columns: recordType(stringType(), stringType())
|
|
4970
5362
|
}),
|
|
4971
|
-
internal:
|
|
5363
|
+
internal: kitInternals2
|
|
4972
5364
|
}).strict();
|
|
4973
|
-
var schemaV3 = schemaInternalV3.merge(
|
|
4974
|
-
var schemaV4 = schemaInternalV4.merge(
|
|
4975
|
-
var schemaV5 = schemaInternalV5.merge(
|
|
4976
|
-
var schema = schemaInternal.merge(
|
|
5365
|
+
var schemaV3 = schemaInternalV3.merge(schemaHash2);
|
|
5366
|
+
var schemaV4 = schemaInternalV4.merge(schemaHash2);
|
|
5367
|
+
var schemaV5 = schemaInternalV5.merge(schemaHash2);
|
|
5368
|
+
var schema = schemaInternal.merge(schemaHash2);
|
|
4977
5369
|
var tableSquashedV4 = objectType({
|
|
4978
5370
|
name: stringType(),
|
|
4979
5371
|
schema: stringType().optional(),
|
|
4980
|
-
columns: recordType(stringType(),
|
|
5372
|
+
columns: recordType(stringType(), column2),
|
|
4981
5373
|
indexes: recordType(stringType(), stringType()),
|
|
4982
5374
|
foreignKeys: recordType(stringType(), stringType())
|
|
4983
5375
|
}).strict();
|
|
4984
|
-
var
|
|
5376
|
+
var tableSquashed2 = objectType({
|
|
4985
5377
|
name: stringType(),
|
|
4986
|
-
columns: recordType(stringType(),
|
|
5378
|
+
columns: recordType(stringType(), column2),
|
|
4987
5379
|
indexes: recordType(stringType(), stringType()),
|
|
4988
5380
|
foreignKeys: recordType(stringType(), stringType()),
|
|
4989
5381
|
compositePrimaryKeys: recordType(stringType(), stringType()),
|
|
4990
5382
|
uniqueConstraints: recordType(stringType(), stringType()).default({}),
|
|
4991
5383
|
checkConstraints: recordType(stringType(), stringType()).default({})
|
|
4992
5384
|
}).strict();
|
|
4993
|
-
var viewSquashed =
|
|
5385
|
+
var viewSquashed = view2.omit({
|
|
4994
5386
|
algorithm: true,
|
|
4995
5387
|
sqlSecurity: true,
|
|
4996
5388
|
withCheckOption: true
|
|
@@ -4998,7 +5390,7 @@ var viewSquashed = view.omit({
|
|
|
4998
5390
|
var schemaSquashed = objectType({
|
|
4999
5391
|
version: literalType("5"),
|
|
5000
5392
|
dialect,
|
|
5001
|
-
tables: recordType(stringType(),
|
|
5393
|
+
tables: recordType(stringType(), tableSquashed2),
|
|
5002
5394
|
views: recordType(stringType(), viewSquashed)
|
|
5003
5395
|
}).strict();
|
|
5004
5396
|
var schemaSquashedV4 = objectType({
|
|
@@ -5049,7 +5441,7 @@ var tableV2 = objectType({
|
|
|
5049
5441
|
columns: recordType(stringType(), columnV2),
|
|
5050
5442
|
indexes: recordType(stringType(), indexV2)
|
|
5051
5443
|
}).strict();
|
|
5052
|
-
var
|
|
5444
|
+
var checkConstraint3 = objectType({
|
|
5053
5445
|
name: stringType().optional(),
|
|
5054
5446
|
value: stringType()
|
|
5055
5447
|
}).strict();
|
|
@@ -5059,13 +5451,13 @@ var domainSchema = objectType({
|
|
|
5059
5451
|
baseType: stringType(),
|
|
5060
5452
|
notNull: booleanType().optional(),
|
|
5061
5453
|
defaultValue: anyType().optional(),
|
|
5062
|
-
checkConstraints: recordType(stringType(),
|
|
5454
|
+
checkConstraints: recordType(stringType(), checkConstraint3).optional()
|
|
5063
5455
|
}).strict();
|
|
5064
|
-
var
|
|
5456
|
+
var enumSchemaV12 = objectType({
|
|
5065
5457
|
name: stringType(),
|
|
5066
5458
|
values: recordType(stringType(), stringType())
|
|
5067
5459
|
}).strict();
|
|
5068
|
-
var
|
|
5460
|
+
var enumSchema2 = objectType({
|
|
5069
5461
|
name: stringType(),
|
|
5070
5462
|
schema: stringType(),
|
|
5071
5463
|
values: stringType().array()
|
|
@@ -5073,7 +5465,7 @@ var enumSchema = objectType({
|
|
|
5073
5465
|
var pgSchemaV2 = objectType({
|
|
5074
5466
|
version: literalType("2"),
|
|
5075
5467
|
tables: recordType(stringType(), tableV2),
|
|
5076
|
-
enums: recordType(stringType(),
|
|
5468
|
+
enums: recordType(stringType(), enumSchemaV12)
|
|
5077
5469
|
}).strict();
|
|
5078
5470
|
var references = objectType({
|
|
5079
5471
|
foreignKeyName: stringType(),
|
|
@@ -5098,18 +5490,18 @@ var tableV1 = objectType({
|
|
|
5098
5490
|
var pgSchemaV1 = objectType({
|
|
5099
5491
|
version: literalType("1"),
|
|
5100
5492
|
tables: recordType(stringType(), tableV1),
|
|
5101
|
-
enums: recordType(stringType(),
|
|
5493
|
+
enums: recordType(stringType(), enumSchemaV12)
|
|
5102
5494
|
}).strict();
|
|
5103
|
-
var
|
|
5495
|
+
var indexColumn2 = objectType({
|
|
5104
5496
|
expression: stringType(),
|
|
5105
5497
|
isExpression: booleanType(),
|
|
5106
5498
|
asc: booleanType(),
|
|
5107
5499
|
nulls: stringType().optional(),
|
|
5108
5500
|
opclass: stringType().optional()
|
|
5109
5501
|
});
|
|
5110
|
-
var
|
|
5502
|
+
var index3 = objectType({
|
|
5111
5503
|
name: stringType(),
|
|
5112
|
-
columns:
|
|
5504
|
+
columns: indexColumn2.array(),
|
|
5113
5505
|
isUnique: booleanType(),
|
|
5114
5506
|
with: recordType(stringType(), anyType()).optional(),
|
|
5115
5507
|
method: stringType().default("btree"),
|
|
@@ -5143,7 +5535,7 @@ var indexV6 = objectType({
|
|
|
5143
5535
|
where: stringType().optional(),
|
|
5144
5536
|
concurrently: booleanType().default(false)
|
|
5145
5537
|
}).strict();
|
|
5146
|
-
var
|
|
5538
|
+
var fk3 = objectType({
|
|
5147
5539
|
name: stringType(),
|
|
5148
5540
|
tableFrom: stringType(),
|
|
5149
5541
|
columnsFrom: stringType().array(),
|
|
@@ -5153,7 +5545,7 @@ var fk2 = objectType({
|
|
|
5153
5545
|
onUpdate: stringType().optional(),
|
|
5154
5546
|
onDelete: stringType().optional()
|
|
5155
5547
|
}).strict();
|
|
5156
|
-
var
|
|
5548
|
+
var sequenceSchema2 = objectType({
|
|
5157
5549
|
name: stringType(),
|
|
5158
5550
|
increment: stringType().optional(),
|
|
5159
5551
|
minValue: stringType().optional(),
|
|
@@ -5163,13 +5555,13 @@ var sequenceSchema = objectType({
|
|
|
5163
5555
|
cycle: booleanType().optional(),
|
|
5164
5556
|
schema: stringType()
|
|
5165
5557
|
}).strict();
|
|
5166
|
-
var
|
|
5558
|
+
var roleSchema2 = objectType({
|
|
5167
5559
|
name: stringType(),
|
|
5168
5560
|
createDb: booleanType().optional(),
|
|
5169
5561
|
createRole: booleanType().optional(),
|
|
5170
5562
|
inherit: booleanType().optional()
|
|
5171
5563
|
}).strict();
|
|
5172
|
-
var
|
|
5564
|
+
var sequenceSquashed2 = objectType({
|
|
5173
5565
|
name: stringType(),
|
|
5174
5566
|
schema: stringType(),
|
|
5175
5567
|
values: stringType()
|
|
@@ -5178,7 +5570,6 @@ var columnV7 = objectType({
|
|
|
5178
5570
|
name: stringType(),
|
|
5179
5571
|
type: stringType(),
|
|
5180
5572
|
typeSchema: stringType().optional(),
|
|
5181
|
-
domainTypeSchema: stringType().optional(),
|
|
5182
5573
|
primaryKey: booleanType(),
|
|
5183
5574
|
notNull: booleanType(),
|
|
5184
5575
|
default: anyType().optional(),
|
|
@@ -5186,11 +5577,10 @@ var columnV7 = objectType({
|
|
|
5186
5577
|
uniqueName: stringType().optional(),
|
|
5187
5578
|
nullsNotDistinct: booleanType().optional()
|
|
5188
5579
|
}).strict();
|
|
5189
|
-
var
|
|
5580
|
+
var column3 = objectType({
|
|
5190
5581
|
name: stringType(),
|
|
5191
5582
|
type: stringType(),
|
|
5192
5583
|
typeSchema: stringType().optional(),
|
|
5193
|
-
domainTypeSchema: stringType().optional(),
|
|
5194
5584
|
primaryKey: booleanType(),
|
|
5195
5585
|
notNull: booleanType(),
|
|
5196
5586
|
default: anyType().optional(),
|
|
@@ -5201,13 +5591,12 @@ var column2 = objectType({
|
|
|
5201
5591
|
type: literalType("stored"),
|
|
5202
5592
|
as: stringType()
|
|
5203
5593
|
}).optional(),
|
|
5204
|
-
identity:
|
|
5594
|
+
identity: sequenceSchema2.merge(objectType({ type: enumType(["always", "byDefault"]) })).optional()
|
|
5205
5595
|
}).strict();
|
|
5206
|
-
var
|
|
5596
|
+
var columnSquashed2 = objectType({
|
|
5207
5597
|
name: stringType(),
|
|
5208
5598
|
type: stringType(),
|
|
5209
5599
|
typeSchema: stringType().optional(),
|
|
5210
|
-
domainTypeSchema: stringType().optional(),
|
|
5211
5600
|
primaryKey: booleanType(),
|
|
5212
5601
|
notNull: booleanType(),
|
|
5213
5602
|
default: anyType().optional(),
|
|
@@ -5222,20 +5611,20 @@ var columnSquashed = objectType({
|
|
|
5222
5611
|
}).strict();
|
|
5223
5612
|
var tableV32 = objectType({
|
|
5224
5613
|
name: stringType(),
|
|
5225
|
-
columns: recordType(stringType(),
|
|
5226
|
-
indexes: recordType(stringType(),
|
|
5227
|
-
foreignKeys: recordType(stringType(),
|
|
5614
|
+
columns: recordType(stringType(), column3),
|
|
5615
|
+
indexes: recordType(stringType(), index3),
|
|
5616
|
+
foreignKeys: recordType(stringType(), fk3)
|
|
5228
5617
|
}).strict();
|
|
5229
|
-
var
|
|
5618
|
+
var compositePK3 = objectType({
|
|
5230
5619
|
name: stringType(),
|
|
5231
5620
|
columns: stringType().array()
|
|
5232
5621
|
}).strict();
|
|
5233
|
-
var
|
|
5622
|
+
var uniqueConstraint3 = objectType({
|
|
5234
5623
|
name: stringType(),
|
|
5235
5624
|
columns: stringType().array(),
|
|
5236
5625
|
nullsNotDistinct: booleanType()
|
|
5237
5626
|
}).strict();
|
|
5238
|
-
var
|
|
5627
|
+
var policy2 = objectType({
|
|
5239
5628
|
name: stringType(),
|
|
5240
5629
|
as: enumType(["PERMISSIVE", "RESTRICTIVE"]).optional(),
|
|
5241
5630
|
for: enumType(["ALL", "SELECT", "INSERT", "UPDATE", "DELETE"]).optional(),
|
|
@@ -5245,16 +5634,16 @@ var policy = objectType({
|
|
|
5245
5634
|
on: stringType().optional(),
|
|
5246
5635
|
schema: stringType().optional()
|
|
5247
5636
|
}).strict();
|
|
5248
|
-
var
|
|
5637
|
+
var policySquashed2 = objectType({
|
|
5249
5638
|
name: stringType(),
|
|
5250
5639
|
values: stringType()
|
|
5251
5640
|
}).strict();
|
|
5252
|
-
var
|
|
5641
|
+
var viewWithOption2 = objectType({
|
|
5253
5642
|
checkOption: enumType(["local", "cascaded"]).optional(),
|
|
5254
5643
|
securityBarrier: booleanType().optional(),
|
|
5255
5644
|
securityInvoker: booleanType().optional()
|
|
5256
5645
|
}).strict();
|
|
5257
|
-
var
|
|
5646
|
+
var matViewWithOption2 = objectType({
|
|
5258
5647
|
fillfactor: numberType().optional(),
|
|
5259
5648
|
toastTupleTarget: numberType().optional(),
|
|
5260
5649
|
parallelWorkers: numberType().optional(),
|
|
@@ -5274,14 +5663,14 @@ var matViewWithOption = objectType({
|
|
|
5274
5663
|
logAutovacuumMinDuration: numberType().optional(),
|
|
5275
5664
|
userCatalogTable: booleanType().optional()
|
|
5276
5665
|
}).strict();
|
|
5277
|
-
var
|
|
5278
|
-
var
|
|
5666
|
+
var mergedViewWithOption2 = viewWithOption2.merge(matViewWithOption2).strict();
|
|
5667
|
+
var view3 = objectType({
|
|
5279
5668
|
name: stringType(),
|
|
5280
5669
|
schema: stringType(),
|
|
5281
|
-
columns: recordType(stringType(),
|
|
5670
|
+
columns: recordType(stringType(), column3),
|
|
5282
5671
|
definition: stringType().optional(),
|
|
5283
5672
|
materialized: booleanType(),
|
|
5284
|
-
with:
|
|
5673
|
+
with: mergedViewWithOption2.optional(),
|
|
5285
5674
|
isExisting: booleanType(),
|
|
5286
5675
|
withNoData: booleanType().optional(),
|
|
5287
5676
|
using: stringType().optional(),
|
|
@@ -5290,54 +5679,54 @@ var view2 = objectType({
|
|
|
5290
5679
|
var tableV42 = objectType({
|
|
5291
5680
|
name: stringType(),
|
|
5292
5681
|
schema: stringType(),
|
|
5293
|
-
columns: recordType(stringType(),
|
|
5682
|
+
columns: recordType(stringType(), column3),
|
|
5294
5683
|
indexes: recordType(stringType(), indexV4),
|
|
5295
|
-
foreignKeys: recordType(stringType(),
|
|
5684
|
+
foreignKeys: recordType(stringType(), fk3)
|
|
5296
5685
|
}).strict();
|
|
5297
5686
|
var tableV5 = objectType({
|
|
5298
5687
|
name: stringType(),
|
|
5299
5688
|
schema: stringType(),
|
|
5300
|
-
columns: recordType(stringType(),
|
|
5689
|
+
columns: recordType(stringType(), column3),
|
|
5301
5690
|
indexes: recordType(stringType(), indexV5),
|
|
5302
|
-
foreignKeys: recordType(stringType(),
|
|
5303
|
-
compositePrimaryKeys: recordType(stringType(),
|
|
5304
|
-
uniqueConstraints: recordType(stringType(),
|
|
5691
|
+
foreignKeys: recordType(stringType(), fk3),
|
|
5692
|
+
compositePrimaryKeys: recordType(stringType(), compositePK3),
|
|
5693
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({})
|
|
5305
5694
|
}).strict();
|
|
5306
5695
|
var tableV6 = objectType({
|
|
5307
5696
|
name: stringType(),
|
|
5308
5697
|
schema: stringType(),
|
|
5309
|
-
columns: recordType(stringType(),
|
|
5698
|
+
columns: recordType(stringType(), column3),
|
|
5310
5699
|
indexes: recordType(stringType(), indexV6),
|
|
5311
|
-
foreignKeys: recordType(stringType(),
|
|
5312
|
-
compositePrimaryKeys: recordType(stringType(),
|
|
5313
|
-
uniqueConstraints: recordType(stringType(),
|
|
5700
|
+
foreignKeys: recordType(stringType(), fk3),
|
|
5701
|
+
compositePrimaryKeys: recordType(stringType(), compositePK3),
|
|
5702
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({})
|
|
5314
5703
|
}).strict();
|
|
5315
5704
|
var tableV7 = objectType({
|
|
5316
5705
|
name: stringType(),
|
|
5317
5706
|
schema: stringType(),
|
|
5318
5707
|
columns: recordType(stringType(), columnV7),
|
|
5319
|
-
indexes: recordType(stringType(),
|
|
5320
|
-
foreignKeys: recordType(stringType(),
|
|
5321
|
-
compositePrimaryKeys: recordType(stringType(),
|
|
5322
|
-
uniqueConstraints: recordType(stringType(),
|
|
5708
|
+
indexes: recordType(stringType(), index3),
|
|
5709
|
+
foreignKeys: recordType(stringType(), fk3),
|
|
5710
|
+
compositePrimaryKeys: recordType(stringType(), compositePK3),
|
|
5711
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({})
|
|
5323
5712
|
}).strict();
|
|
5324
|
-
var
|
|
5713
|
+
var table3 = objectType({
|
|
5325
5714
|
name: stringType(),
|
|
5326
5715
|
schema: stringType(),
|
|
5327
|
-
columns: recordType(stringType(),
|
|
5328
|
-
indexes: recordType(stringType(),
|
|
5329
|
-
foreignKeys: recordType(stringType(),
|
|
5330
|
-
compositePrimaryKeys: recordType(stringType(),
|
|
5331
|
-
uniqueConstraints: recordType(stringType(),
|
|
5332
|
-
policies: recordType(stringType(),
|
|
5333
|
-
checkConstraints: recordType(stringType(),
|
|
5716
|
+
columns: recordType(stringType(), column3),
|
|
5717
|
+
indexes: recordType(stringType(), index3),
|
|
5718
|
+
foreignKeys: recordType(stringType(), fk3),
|
|
5719
|
+
compositePrimaryKeys: recordType(stringType(), compositePK3),
|
|
5720
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({}),
|
|
5721
|
+
policies: recordType(stringType(), policy2).default({}),
|
|
5722
|
+
checkConstraints: recordType(stringType(), checkConstraint3).default({}),
|
|
5334
5723
|
isRLSEnabled: booleanType().default(false)
|
|
5335
5724
|
}).strict();
|
|
5336
|
-
var
|
|
5725
|
+
var schemaHash3 = objectType({
|
|
5337
5726
|
id: stringType(),
|
|
5338
5727
|
prevId: stringType()
|
|
5339
5728
|
});
|
|
5340
|
-
var
|
|
5729
|
+
var kitInternals3 = objectType({
|
|
5341
5730
|
tables: recordType(
|
|
5342
5731
|
stringType(),
|
|
5343
5732
|
objectType({
|
|
@@ -5357,46 +5746,46 @@ var pgSchemaInternalV3 = objectType({
|
|
|
5357
5746
|
version: literalType("3"),
|
|
5358
5747
|
dialect: literalType("pg"),
|
|
5359
5748
|
tables: recordType(stringType(), tableV32),
|
|
5360
|
-
enums: recordType(stringType(),
|
|
5749
|
+
enums: recordType(stringType(), enumSchemaV12)
|
|
5361
5750
|
}).strict();
|
|
5362
5751
|
var pgSchemaInternalV4 = objectType({
|
|
5363
5752
|
version: literalType("4"),
|
|
5364
5753
|
dialect: literalType("pg"),
|
|
5365
5754
|
tables: recordType(stringType(), tableV42),
|
|
5366
|
-
enums: recordType(stringType(),
|
|
5755
|
+
enums: recordType(stringType(), enumSchemaV12),
|
|
5367
5756
|
schemas: recordType(stringType(), stringType())
|
|
5368
5757
|
}).strict();
|
|
5369
5758
|
var pgSchemaInternalV5 = objectType({
|
|
5370
5759
|
version: literalType("5"),
|
|
5371
5760
|
dialect: literalType("pg"),
|
|
5372
5761
|
tables: recordType(stringType(), tableV5),
|
|
5373
|
-
enums: recordType(stringType(),
|
|
5762
|
+
enums: recordType(stringType(), enumSchemaV12),
|
|
5374
5763
|
schemas: recordType(stringType(), stringType()),
|
|
5375
5764
|
_meta: objectType({
|
|
5376
5765
|
schemas: recordType(stringType(), stringType()),
|
|
5377
5766
|
tables: recordType(stringType(), stringType()),
|
|
5378
5767
|
columns: recordType(stringType(), stringType())
|
|
5379
5768
|
}),
|
|
5380
|
-
internal:
|
|
5769
|
+
internal: kitInternals3
|
|
5381
5770
|
}).strict();
|
|
5382
5771
|
var pgSchemaInternalV6 = objectType({
|
|
5383
5772
|
version: literalType("6"),
|
|
5384
5773
|
dialect: literalType("postgresql"),
|
|
5385
5774
|
tables: recordType(stringType(), tableV6),
|
|
5386
|
-
enums: recordType(stringType(),
|
|
5775
|
+
enums: recordType(stringType(), enumSchema2),
|
|
5387
5776
|
schemas: recordType(stringType(), stringType()),
|
|
5388
5777
|
_meta: objectType({
|
|
5389
5778
|
schemas: recordType(stringType(), stringType()),
|
|
5390
5779
|
tables: recordType(stringType(), stringType()),
|
|
5391
5780
|
columns: recordType(stringType(), stringType())
|
|
5392
5781
|
}),
|
|
5393
|
-
internal:
|
|
5782
|
+
internal: kitInternals3
|
|
5394
5783
|
}).strict();
|
|
5395
5784
|
var pgSchemaExternal = objectType({
|
|
5396
5785
|
version: literalType("5"),
|
|
5397
5786
|
dialect: literalType("pg"),
|
|
5398
|
-
tables: arrayType(
|
|
5399
|
-
enums: arrayType(
|
|
5787
|
+
tables: arrayType(table3),
|
|
5788
|
+
enums: arrayType(enumSchemaV12),
|
|
5400
5789
|
schemas: arrayType(objectType({ name: stringType() })),
|
|
5401
5790
|
_meta: objectType({
|
|
5402
5791
|
schemas: recordType(stringType(), stringType()),
|
|
@@ -5408,36 +5797,33 @@ var pgSchemaInternalV7 = objectType({
|
|
|
5408
5797
|
version: literalType("7"),
|
|
5409
5798
|
dialect: literalType("postgresql"),
|
|
5410
5799
|
tables: recordType(stringType(), tableV7),
|
|
5411
|
-
enums: recordType(stringType(),
|
|
5800
|
+
enums: recordType(stringType(), enumSchema2),
|
|
5412
5801
|
schemas: recordType(stringType(), stringType()),
|
|
5413
|
-
|
|
5414
|
-
sequences: recordType(stringType(), sequenceSchema).default({}),
|
|
5415
|
-
roles: recordType(stringType(), roleSchema).default({}),
|
|
5416
|
-
policies: recordType(stringType(), policy).default({}),
|
|
5802
|
+
sequences: recordType(stringType(), sequenceSchema2),
|
|
5417
5803
|
_meta: objectType({
|
|
5418
5804
|
schemas: recordType(stringType(), stringType()),
|
|
5419
5805
|
tables: recordType(stringType(), stringType()),
|
|
5420
5806
|
columns: recordType(stringType(), stringType())
|
|
5421
5807
|
}),
|
|
5422
|
-
internal:
|
|
5808
|
+
internal: kitInternals3
|
|
5423
5809
|
}).strict();
|
|
5424
5810
|
var pgSchemaInternal = objectType({
|
|
5425
|
-
version: literalType(
|
|
5811
|
+
version: literalType("7"),
|
|
5426
5812
|
dialect: literalType("postgresql"),
|
|
5427
|
-
tables: recordType(stringType(),
|
|
5428
|
-
enums: recordType(stringType(),
|
|
5813
|
+
tables: recordType(stringType(), table3),
|
|
5814
|
+
enums: recordType(stringType(), enumSchema2),
|
|
5429
5815
|
schemas: recordType(stringType(), stringType()),
|
|
5430
|
-
domains: recordType(stringType(), domainSchema),
|
|
5431
|
-
views: recordType(stringType(),
|
|
5432
|
-
sequences: recordType(stringType(),
|
|
5433
|
-
roles: recordType(stringType(),
|
|
5434
|
-
policies: recordType(stringType(),
|
|
5816
|
+
domains: recordType(stringType(), domainSchema).default({}),
|
|
5817
|
+
views: recordType(stringType(), view3).default({}),
|
|
5818
|
+
sequences: recordType(stringType(), sequenceSchema2).default({}),
|
|
5819
|
+
roles: recordType(stringType(), roleSchema2).default({}),
|
|
5820
|
+
policies: recordType(stringType(), policy2).default({}),
|
|
5435
5821
|
_meta: objectType({
|
|
5436
5822
|
schemas: recordType(stringType(), stringType()),
|
|
5437
5823
|
tables: recordType(stringType(), stringType()),
|
|
5438
5824
|
columns: recordType(stringType(), stringType())
|
|
5439
5825
|
}),
|
|
5440
|
-
internal:
|
|
5826
|
+
internal: kitInternals3
|
|
5441
5827
|
}).strict();
|
|
5442
5828
|
var domainSquashed = objectType({
|
|
5443
5829
|
name: stringType(),
|
|
@@ -5447,10 +5833,10 @@ var domainSquashed = objectType({
|
|
|
5447
5833
|
defaultValue: stringType().optional(),
|
|
5448
5834
|
checkConstraints: recordType(stringType(), stringType()).optional()
|
|
5449
5835
|
}).strict();
|
|
5450
|
-
var
|
|
5836
|
+
var tableSquashed3 = objectType({
|
|
5451
5837
|
name: stringType(),
|
|
5452
5838
|
schema: stringType(),
|
|
5453
|
-
columns: recordType(stringType(),
|
|
5839
|
+
columns: recordType(stringType(), columnSquashed2),
|
|
5454
5840
|
indexes: recordType(stringType(), stringType()),
|
|
5455
5841
|
foreignKeys: recordType(stringType(), stringType()),
|
|
5456
5842
|
compositePrimaryKeys: recordType(stringType(), stringType()),
|
|
@@ -5462,7 +5848,7 @@ var tableSquashed2 = objectType({
|
|
|
5462
5848
|
var tableSquashedV42 = objectType({
|
|
5463
5849
|
name: stringType(),
|
|
5464
5850
|
schema: stringType(),
|
|
5465
|
-
columns: recordType(stringType(),
|
|
5851
|
+
columns: recordType(stringType(), column3),
|
|
5466
5852
|
indexes: recordType(stringType(), stringType()),
|
|
5467
5853
|
foreignKeys: recordType(stringType(), stringType())
|
|
5468
5854
|
}).strict();
|
|
@@ -5470,52 +5856,41 @@ var pgSchemaSquashedV4 = objectType({
|
|
|
5470
5856
|
version: literalType("4"),
|
|
5471
5857
|
dialect: literalType("pg"),
|
|
5472
5858
|
tables: recordType(stringType(), tableSquashedV42),
|
|
5473
|
-
enums: recordType(stringType(),
|
|
5859
|
+
enums: recordType(stringType(), enumSchemaV12),
|
|
5474
5860
|
schemas: recordType(stringType(), stringType())
|
|
5475
5861
|
}).strict();
|
|
5476
5862
|
var pgSchemaSquashedV6 = objectType({
|
|
5477
5863
|
version: literalType("6"),
|
|
5478
5864
|
dialect: literalType("postgresql"),
|
|
5479
|
-
tables: recordType(stringType(),
|
|
5480
|
-
enums: recordType(stringType(),
|
|
5865
|
+
tables: recordType(stringType(), tableSquashed3),
|
|
5866
|
+
enums: recordType(stringType(), enumSchema2),
|
|
5481
5867
|
schemas: recordType(stringType(), stringType())
|
|
5482
5868
|
}).strict();
|
|
5483
|
-
var pgSchemaSquashedV7 = objectType({
|
|
5484
|
-
version: literalType("7"),
|
|
5485
|
-
dialect: literalType("postgresql"),
|
|
5486
|
-
tables: recordType(stringType(), tableSquashed2),
|
|
5487
|
-
enums: recordType(stringType(), enumSchema),
|
|
5488
|
-
schemas: recordType(stringType(), stringType()),
|
|
5489
|
-
views: recordType(stringType(), view2),
|
|
5490
|
-
sequences: recordType(stringType(), sequenceSquashed),
|
|
5491
|
-
roles: recordType(stringType(), roleSchema).default({}),
|
|
5492
|
-
policies: recordType(stringType(), policySquashed).default({})
|
|
5493
|
-
}).strict();
|
|
5494
5869
|
var pgSchemaSquashed = objectType({
|
|
5495
|
-
version: literalType(
|
|
5870
|
+
version: literalType("7"),
|
|
5496
5871
|
dialect: literalType("postgresql"),
|
|
5497
|
-
tables: recordType(stringType(),
|
|
5498
|
-
domains: recordType(stringType(), domainSquashed),
|
|
5499
|
-
enums: recordType(stringType(),
|
|
5872
|
+
tables: recordType(stringType(), tableSquashed3),
|
|
5873
|
+
domains: recordType(stringType(), domainSquashed).default({}),
|
|
5874
|
+
enums: recordType(stringType(), enumSchema2),
|
|
5500
5875
|
schemas: recordType(stringType(), stringType()),
|
|
5501
|
-
views: recordType(stringType(),
|
|
5502
|
-
sequences: recordType(stringType(),
|
|
5503
|
-
roles: recordType(stringType(),
|
|
5504
|
-
policies: recordType(stringType(),
|
|
5876
|
+
views: recordType(stringType(), view3),
|
|
5877
|
+
sequences: recordType(stringType(), sequenceSquashed2),
|
|
5878
|
+
roles: recordType(stringType(), roleSchema2).default({}),
|
|
5879
|
+
policies: recordType(stringType(), policySquashed2).default({})
|
|
5505
5880
|
}).strict();
|
|
5506
|
-
var pgSchemaV3 = pgSchemaInternalV3.merge(
|
|
5507
|
-
var pgSchemaV4 = pgSchemaInternalV4.merge(
|
|
5508
|
-
var pgSchemaV5 = pgSchemaInternalV5.merge(
|
|
5509
|
-
var pgSchemaV6 = pgSchemaInternalV6.merge(
|
|
5510
|
-
var pgSchemaV7 = pgSchemaInternalV7.merge(
|
|
5511
|
-
var pgSchema = pgSchemaInternal.merge(
|
|
5881
|
+
var pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash3);
|
|
5882
|
+
var pgSchemaV4 = pgSchemaInternalV4.merge(schemaHash3);
|
|
5883
|
+
var pgSchemaV5 = pgSchemaInternalV5.merge(schemaHash3);
|
|
5884
|
+
var pgSchemaV6 = pgSchemaInternalV6.merge(schemaHash3);
|
|
5885
|
+
var pgSchemaV7 = pgSchemaInternalV7.merge(schemaHash3);
|
|
5886
|
+
var pgSchema = pgSchemaInternal.merge(schemaHash3);
|
|
5512
5887
|
var backwardCompatiblePgSchema = unionType([
|
|
5513
5888
|
pgSchemaV5,
|
|
5514
5889
|
pgSchemaV6,
|
|
5515
5890
|
pgSchema
|
|
5516
5891
|
]);
|
|
5517
5892
|
var dryPg = pgSchema.parse({
|
|
5518
|
-
version:
|
|
5893
|
+
version: "7",
|
|
5519
5894
|
dialect: "postgresql",
|
|
5520
5895
|
id: originUUID,
|
|
5521
5896
|
prevId: "",
|
|
@@ -5534,7 +5909,7 @@ var dryPg = pgSchema.parse({
|
|
|
5534
5909
|
});
|
|
5535
5910
|
|
|
5536
5911
|
// src/serializer/singlestoreSchema.ts
|
|
5537
|
-
var
|
|
5912
|
+
var index4 = objectType({
|
|
5538
5913
|
name: stringType(),
|
|
5539
5914
|
columns: stringType().array(),
|
|
5540
5915
|
isUnique: booleanType(),
|
|
@@ -5542,7 +5917,7 @@ var index3 = objectType({
|
|
|
5542
5917
|
algorithm: enumType(["default", "inplace", "copy"]).optional(),
|
|
5543
5918
|
lock: enumType(["default", "none", "shared", "exclusive"]).optional()
|
|
5544
5919
|
}).strict();
|
|
5545
|
-
var
|
|
5920
|
+
var column4 = objectType({
|
|
5546
5921
|
name: stringType(),
|
|
5547
5922
|
type: stringType(),
|
|
5548
5923
|
primaryKey: booleanType(),
|
|
@@ -5555,27 +5930,27 @@ var column3 = objectType({
|
|
|
5555
5930
|
as: stringType()
|
|
5556
5931
|
}).optional()
|
|
5557
5932
|
}).strict();
|
|
5558
|
-
var
|
|
5933
|
+
var compositePK4 = objectType({
|
|
5559
5934
|
name: stringType(),
|
|
5560
5935
|
columns: stringType().array()
|
|
5561
5936
|
}).strict();
|
|
5562
|
-
var
|
|
5937
|
+
var uniqueConstraint4 = objectType({
|
|
5563
5938
|
name: stringType(),
|
|
5564
5939
|
columns: stringType().array()
|
|
5565
5940
|
}).strict();
|
|
5566
|
-
var
|
|
5941
|
+
var table4 = objectType({
|
|
5567
5942
|
name: stringType(),
|
|
5568
|
-
columns: recordType(stringType(),
|
|
5569
|
-
indexes: recordType(stringType(),
|
|
5570
|
-
compositePrimaryKeys: recordType(stringType(),
|
|
5571
|
-
uniqueConstraints: recordType(stringType(),
|
|
5943
|
+
columns: recordType(stringType(), column4),
|
|
5944
|
+
indexes: recordType(stringType(), index4),
|
|
5945
|
+
compositePrimaryKeys: recordType(stringType(), compositePK4),
|
|
5946
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint4).default({})
|
|
5572
5947
|
}).strict();
|
|
5573
5948
|
var viewMeta2 = objectType({
|
|
5574
5949
|
algorithm: enumType(["undefined", "merge", "temptable"]),
|
|
5575
5950
|
sqlSecurity: enumType(["definer", "invoker"]),
|
|
5576
5951
|
withCheckOption: enumType(["local", "cascaded"]).optional()
|
|
5577
5952
|
}).strict();
|
|
5578
|
-
var
|
|
5953
|
+
var kitInternals4 = objectType({
|
|
5579
5954
|
tables: recordType(
|
|
5580
5955
|
stringType(),
|
|
5581
5956
|
objectType({
|
|
@@ -5596,25 +5971,25 @@ var kitInternals3 = objectType({
|
|
|
5596
5971
|
).optional()
|
|
5597
5972
|
}).optional();
|
|
5598
5973
|
var dialect2 = literalType("singlestore");
|
|
5599
|
-
var
|
|
5974
|
+
var schemaHash4 = objectType({
|
|
5600
5975
|
id: stringType(),
|
|
5601
5976
|
prevId: stringType()
|
|
5602
5977
|
});
|
|
5603
5978
|
var schemaInternal2 = objectType({
|
|
5604
5979
|
version: literalType("1"),
|
|
5605
5980
|
dialect: dialect2,
|
|
5606
|
-
tables: recordType(stringType(),
|
|
5981
|
+
tables: recordType(stringType(), table4),
|
|
5607
5982
|
/* views: record(string(), view).default({}), */
|
|
5608
5983
|
_meta: objectType({
|
|
5609
5984
|
tables: recordType(stringType(), stringType()),
|
|
5610
5985
|
columns: recordType(stringType(), stringType())
|
|
5611
5986
|
}),
|
|
5612
|
-
internal:
|
|
5987
|
+
internal: kitInternals4
|
|
5613
5988
|
}).strict();
|
|
5614
|
-
var schema2 = schemaInternal2.merge(
|
|
5615
|
-
var
|
|
5989
|
+
var schema2 = schemaInternal2.merge(schemaHash4);
|
|
5990
|
+
var tableSquashed4 = objectType({
|
|
5616
5991
|
name: stringType(),
|
|
5617
|
-
columns: recordType(stringType(),
|
|
5992
|
+
columns: recordType(stringType(), column4),
|
|
5618
5993
|
indexes: recordType(stringType(), stringType()),
|
|
5619
5994
|
compositePrimaryKeys: recordType(stringType(), stringType()),
|
|
5620
5995
|
uniqueConstraints: recordType(stringType(), stringType()).default({})
|
|
@@ -5622,7 +5997,7 @@ var tableSquashed3 = objectType({
|
|
|
5622
5997
|
var schemaSquashed2 = objectType({
|
|
5623
5998
|
version: literalType("1"),
|
|
5624
5999
|
dialect: dialect2,
|
|
5625
|
-
tables: recordType(stringType(),
|
|
6000
|
+
tables: recordType(stringType(), tableSquashed4)
|
|
5626
6001
|
/* views: record(string(), viewSquashed), */
|
|
5627
6002
|
}).strict();
|
|
5628
6003
|
var singlestoreSchema = schema2;
|
|
@@ -5643,13 +6018,13 @@ var drySingleStore = singlestoreSchema.parse({
|
|
|
5643
6018
|
});
|
|
5644
6019
|
|
|
5645
6020
|
// src/serializer/sqliteSchema.ts
|
|
5646
|
-
var
|
|
6021
|
+
var index5 = objectType({
|
|
5647
6022
|
name: stringType(),
|
|
5648
6023
|
columns: stringType().array(),
|
|
5649
6024
|
where: stringType().optional(),
|
|
5650
6025
|
isUnique: booleanType()
|
|
5651
6026
|
}).strict();
|
|
5652
|
-
var
|
|
6027
|
+
var fk4 = objectType({
|
|
5653
6028
|
name: stringType(),
|
|
5654
6029
|
tableFrom: stringType(),
|
|
5655
6030
|
columnsFrom: stringType().array(),
|
|
@@ -5658,11 +6033,11 @@ var fk3 = objectType({
|
|
|
5658
6033
|
onUpdate: stringType().optional(),
|
|
5659
6034
|
onDelete: stringType().optional()
|
|
5660
6035
|
}).strict();
|
|
5661
|
-
var
|
|
6036
|
+
var compositePK5 = objectType({
|
|
5662
6037
|
columns: stringType().array(),
|
|
5663
6038
|
name: stringType().optional()
|
|
5664
6039
|
}).strict();
|
|
5665
|
-
var
|
|
6040
|
+
var column5 = objectType({
|
|
5666
6041
|
name: stringType(),
|
|
5667
6042
|
type: stringType(),
|
|
5668
6043
|
primaryKey: booleanType(),
|
|
@@ -5676,35 +6051,35 @@ var column4 = objectType({
|
|
|
5676
6051
|
}).strict();
|
|
5677
6052
|
var tableV33 = objectType({
|
|
5678
6053
|
name: stringType(),
|
|
5679
|
-
columns: recordType(stringType(),
|
|
5680
|
-
indexes: recordType(stringType(),
|
|
5681
|
-
foreignKeys: recordType(stringType(),
|
|
6054
|
+
columns: recordType(stringType(), column5),
|
|
6055
|
+
indexes: recordType(stringType(), index5),
|
|
6056
|
+
foreignKeys: recordType(stringType(), fk4)
|
|
5682
6057
|
}).strict();
|
|
5683
|
-
var
|
|
6058
|
+
var uniqueConstraint5 = objectType({
|
|
5684
6059
|
name: stringType(),
|
|
5685
6060
|
columns: stringType().array()
|
|
5686
6061
|
}).strict();
|
|
5687
|
-
var
|
|
6062
|
+
var checkConstraint4 = objectType({
|
|
5688
6063
|
name: stringType(),
|
|
5689
6064
|
value: stringType()
|
|
5690
6065
|
}).strict();
|
|
5691
|
-
var
|
|
6066
|
+
var table5 = objectType({
|
|
5692
6067
|
name: stringType(),
|
|
5693
|
-
columns: recordType(stringType(),
|
|
5694
|
-
indexes: recordType(stringType(),
|
|
5695
|
-
foreignKeys: recordType(stringType(),
|
|
5696
|
-
compositePrimaryKeys: recordType(stringType(),
|
|
5697
|
-
uniqueConstraints: recordType(stringType(),
|
|
5698
|
-
checkConstraints: recordType(stringType(),
|
|
6068
|
+
columns: recordType(stringType(), column5),
|
|
6069
|
+
indexes: recordType(stringType(), index5),
|
|
6070
|
+
foreignKeys: recordType(stringType(), fk4),
|
|
6071
|
+
compositePrimaryKeys: recordType(stringType(), compositePK5),
|
|
6072
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint5).default({}),
|
|
6073
|
+
checkConstraints: recordType(stringType(), checkConstraint4).default({})
|
|
5699
6074
|
}).strict();
|
|
5700
|
-
var
|
|
6075
|
+
var view4 = objectType({
|
|
5701
6076
|
name: stringType(),
|
|
5702
|
-
columns: recordType(stringType(),
|
|
6077
|
+
columns: recordType(stringType(), column5),
|
|
5703
6078
|
definition: stringType().optional(),
|
|
5704
6079
|
isExisting: booleanType()
|
|
5705
6080
|
}).strict();
|
|
5706
6081
|
var dialect3 = enumType(["sqlite"]);
|
|
5707
|
-
var
|
|
6082
|
+
var schemaHash5 = objectType({
|
|
5708
6083
|
id: stringType(),
|
|
5709
6084
|
prevId: stringType()
|
|
5710
6085
|
}).strict();
|
|
@@ -5717,21 +6092,21 @@ var schemaInternalV32 = objectType({
|
|
|
5717
6092
|
var schemaInternalV42 = objectType({
|
|
5718
6093
|
version: literalType("4"),
|
|
5719
6094
|
dialect: dialect3,
|
|
5720
|
-
tables: recordType(stringType(),
|
|
5721
|
-
views: recordType(stringType(),
|
|
6095
|
+
tables: recordType(stringType(), table5),
|
|
6096
|
+
views: recordType(stringType(), view4).default({}),
|
|
5722
6097
|
enums: objectType({})
|
|
5723
6098
|
}).strict();
|
|
5724
6099
|
var schemaInternalV52 = objectType({
|
|
5725
6100
|
version: literalType("5"),
|
|
5726
6101
|
dialect: dialect3,
|
|
5727
|
-
tables: recordType(stringType(),
|
|
6102
|
+
tables: recordType(stringType(), table5),
|
|
5728
6103
|
enums: objectType({}),
|
|
5729
6104
|
_meta: objectType({
|
|
5730
6105
|
tables: recordType(stringType(), stringType()),
|
|
5731
6106
|
columns: recordType(stringType(), stringType())
|
|
5732
6107
|
})
|
|
5733
6108
|
}).strict();
|
|
5734
|
-
var
|
|
6109
|
+
var kitInternals5 = objectType({
|
|
5735
6110
|
indexes: recordType(
|
|
5736
6111
|
stringType(),
|
|
5737
6112
|
objectType({
|
|
@@ -5746,22 +6121,22 @@ var latestVersion = literalType("6");
|
|
|
5746
6121
|
var schemaInternal3 = objectType({
|
|
5747
6122
|
version: latestVersion,
|
|
5748
6123
|
dialect: dialect3,
|
|
5749
|
-
tables: recordType(stringType(),
|
|
5750
|
-
views: recordType(stringType(),
|
|
6124
|
+
tables: recordType(stringType(), table5),
|
|
6125
|
+
views: recordType(stringType(), view4).default({}),
|
|
5751
6126
|
enums: objectType({}),
|
|
5752
6127
|
_meta: objectType({
|
|
5753
6128
|
tables: recordType(stringType(), stringType()),
|
|
5754
6129
|
columns: recordType(stringType(), stringType())
|
|
5755
6130
|
}),
|
|
5756
|
-
internal:
|
|
6131
|
+
internal: kitInternals5
|
|
5757
6132
|
}).strict();
|
|
5758
|
-
var schemaV32 = schemaInternalV32.merge(
|
|
5759
|
-
var schemaV42 = schemaInternalV42.merge(
|
|
5760
|
-
var schemaV52 = schemaInternalV52.merge(
|
|
5761
|
-
var schema3 = schemaInternal3.merge(
|
|
5762
|
-
var
|
|
6133
|
+
var schemaV32 = schemaInternalV32.merge(schemaHash5).strict();
|
|
6134
|
+
var schemaV42 = schemaInternalV42.merge(schemaHash5).strict();
|
|
6135
|
+
var schemaV52 = schemaInternalV52.merge(schemaHash5).strict();
|
|
6136
|
+
var schema3 = schemaInternal3.merge(schemaHash5).strict();
|
|
6137
|
+
var tableSquashed5 = objectType({
|
|
5763
6138
|
name: stringType(),
|
|
5764
|
-
columns: recordType(stringType(),
|
|
6139
|
+
columns: recordType(stringType(), column5),
|
|
5765
6140
|
indexes: recordType(stringType(), stringType()),
|
|
5766
6141
|
foreignKeys: recordType(stringType(), stringType()),
|
|
5767
6142
|
compositePrimaryKeys: recordType(stringType(), stringType()),
|
|
@@ -5771,8 +6146,8 @@ var tableSquashed4 = objectType({
|
|
|
5771
6146
|
var schemaSquashed3 = objectType({
|
|
5772
6147
|
version: latestVersion,
|
|
5773
6148
|
dialect: dialect3,
|
|
5774
|
-
tables: recordType(stringType(),
|
|
5775
|
-
views: recordType(stringType(),
|
|
6149
|
+
tables: recordType(stringType(), tableSquashed5),
|
|
6150
|
+
views: recordType(stringType(), view4),
|
|
5776
6151
|
enums: anyType()
|
|
5777
6152
|
}).strict();
|
|
5778
6153
|
var drySQLite = schema3.parse({
|
|
@@ -5799,8 +6174,7 @@ var objectValues = (obj) => {
|
|
|
5799
6174
|
return Object.values(obj);
|
|
5800
6175
|
};
|
|
5801
6176
|
var assertV1OutFolder = (out) => {
|
|
5802
|
-
if (!existsSync(out))
|
|
5803
|
-
return;
|
|
6177
|
+
if (!existsSync(out)) return;
|
|
5804
6178
|
const oldMigrationFolders = readdirSync(out).filter(
|
|
5805
6179
|
(it) => it.length === 14 && /^\d+$/.test(it)
|
|
5806
6180
|
);
|
|
@@ -5844,6 +6218,8 @@ var validatorForDialect = (dialect4) => {
|
|
|
5844
6218
|
return { validator: backwardCompatibleMysqlSchema, version: 5 };
|
|
5845
6219
|
case "singlestore":
|
|
5846
6220
|
return { validator: backwardCompatibleSingleStoreSchema, version: 1 };
|
|
6221
|
+
case "gel":
|
|
6222
|
+
return { validator: backwardCompatibleGelSchema, version: 1 };
|
|
5847
6223
|
}
|
|
5848
6224
|
};
|
|
5849
6225
|
var validateWithReport = (snapshots, dialect4) => {
|
|
@@ -5953,8 +6329,8 @@ var tableRenameKey = (it) => {
|
|
|
5953
6329
|
const out = it.schema ? `"${it.schema}"."${it.name}"` : `"${it.name}"`;
|
|
5954
6330
|
return out;
|
|
5955
6331
|
};
|
|
5956
|
-
var columnRenameKey = (
|
|
5957
|
-
const out = schema4 ? `"${schema4}"."${
|
|
6332
|
+
var columnRenameKey = (table6, schema4, column6) => {
|
|
6333
|
+
const out = schema4 ? `"${schema4}"."${table6}"."${column6}"` : `"${table6}"."${column6}"`;
|
|
5958
6334
|
return out;
|
|
5959
6335
|
};
|
|
5960
6336
|
var kloudMeta = () => {
|
|
@@ -6010,6 +6386,9 @@ function unescapeSingleQuotes(str, ignoreFirstAndLastChar) {
|
|
|
6010
6386
|
const regex = ignoreFirstAndLastChar ? /(?<!^)'(?!$)/g : /'/g;
|
|
6011
6387
|
return str.replace(/''/g, "'").replace(regex, "\\'");
|
|
6012
6388
|
}
|
|
6389
|
+
var stripTrailingCast = (value) => {
|
|
6390
|
+
return value.replace(/::(?:"[^"]+"|[\w ]+)(?:\(\d+(?:,\s*\d+)?\))?(?:\[\])*$/, "");
|
|
6391
|
+
};
|
|
6013
6392
|
export {
|
|
6014
6393
|
assertV1OutFolder,
|
|
6015
6394
|
columnRenameKey,
|
|
@@ -6026,6 +6405,7 @@ export {
|
|
|
6026
6405
|
prepareMigrationMeta,
|
|
6027
6406
|
prepareOutFolder,
|
|
6028
6407
|
schemaRenameKey,
|
|
6408
|
+
stripTrailingCast,
|
|
6029
6409
|
tableRenameKey,
|
|
6030
6410
|
unescapeSingleQuotes,
|
|
6031
6411
|
validateWithReport
|