drizzle-kit 0.20.17-c8aaf94 → 0.20.17-d1b2821
Sign up to get free protection for your applications and to get access to all the features.
- package/bin.cjs +16 -10
- package/package.json +1 -1
package/bin.cjs
CHANGED
@@ -54999,7 +54999,7 @@ var require_dist_cjs42 = __commonJS({
|
|
54999
54999
|
calculateBodyLength: () => calculateBodyLength
|
55000
55000
|
});
|
55001
55001
|
module2.exports = __toCommonJS2(src_exports2);
|
55002
|
-
var
|
55002
|
+
var import_fs13 = require("fs");
|
55003
55003
|
var calculateBodyLength = /* @__PURE__ */ __name((body) => {
|
55004
55004
|
if (!body) {
|
55005
55005
|
return 0;
|
@@ -55013,9 +55013,9 @@ var require_dist_cjs42 = __commonJS({
|
|
55013
55013
|
} else if (typeof body.start === "number" && typeof body.end === "number") {
|
55014
55014
|
return body.end + 1 - body.start;
|
55015
55015
|
} else if (typeof body.path === "string" || Buffer.isBuffer(body.path)) {
|
55016
|
-
return (0,
|
55016
|
+
return (0, import_fs13.lstatSync)(body.path).size;
|
55017
55017
|
} else if (typeof body.fd === "number") {
|
55018
|
-
return (0,
|
55018
|
+
return (0, import_fs13.fstatSync)(body.fd).size;
|
55019
55019
|
}
|
55020
55020
|
throw new Error(`Body Length computation failed for ${body}`);
|
55021
55021
|
}, "calculateBodyLength");
|
@@ -57322,8 +57322,8 @@ var require_dist_cjs47 = __commonJS({
|
|
57322
57322
|
}
|
57323
57323
|
}, "validateTokenKey");
|
57324
57324
|
var import_shared_ini_file_loader = require_dist_cjs13();
|
57325
|
-
var
|
57326
|
-
var { writeFile } =
|
57325
|
+
var import_fs13 = require("fs");
|
57326
|
+
var { writeFile } = import_fs13.promises;
|
57327
57327
|
var writeSSOTokenToFile = /* @__PURE__ */ __name((id, ssoToken) => {
|
57328
57328
|
const tokenFilepath = (0, import_shared_ini_file_loader.getSSOTokenFilepath)(id);
|
57329
57329
|
const tokenString = JSON.stringify(ssoToken, null, 2);
|
@@ -100195,6 +100195,10 @@ var init_studio = __esm({
|
|
100195
100195
|
prepareServer = async ({ dialect: dialect7, proxy, customDefaults }, app) => {
|
100196
100196
|
app = app !== void 0 ? app : new Hono2();
|
100197
100197
|
app.use(cors());
|
100198
|
+
app.use(async (ctx, next) => {
|
100199
|
+
await next();
|
100200
|
+
ctx.header("Access-Control-Allow-Private-Network", "true");
|
100201
|
+
});
|
100198
100202
|
app.onError((err2, ctx) => {
|
100199
100203
|
console.error(err2);
|
100200
100204
|
return ctx.json({
|
@@ -104669,7 +104673,6 @@ var init_introspect = __esm({
|
|
104669
104673
|
const relationsTs = relationsToTypeScript(schema5, casing2);
|
104670
104674
|
const { internal, ...schemaWithoutInternals } = schema5;
|
104671
104675
|
const schemaFile = (0, import_path7.join)(out, "schema.ts");
|
104672
|
-
(0, import_fs11.mkdirSync)(out, { recursive: true });
|
104673
104676
|
(0, import_fs11.writeFileSync)(schemaFile, ts2.file);
|
104674
104677
|
const relationsFile = (0, import_path7.join)(out, "relations.ts");
|
104675
104678
|
(0, import_fs11.writeFileSync)(relationsFile, relationsTs.file);
|
@@ -104916,17 +104919,17 @@ import { ${uniqueImports.join(
|
|
104916
104919
|
const hasOne = relations4.some((it) => it.type === "one");
|
104917
104920
|
const hasMany = relations4.some((it) => it.type === "many");
|
104918
104921
|
const preparedRelations = relations4.map(
|
104919
|
-
(relation,
|
104922
|
+
(relation, relationIndex, originArray) => {
|
104920
104923
|
let name = relation.name;
|
104921
104924
|
let relationName;
|
104922
|
-
const hasMultipleRelations =
|
104923
|
-
(it) =>
|
104925
|
+
const hasMultipleRelations = originArray.some(
|
104926
|
+
(it, originIndex) => relationIndex !== originIndex && it.tableTo === relation.tableTo
|
104924
104927
|
);
|
104925
104928
|
if (hasMultipleRelations) {
|
104926
104929
|
relationName = relation.type === "one" ? `${relation.tableFrom}_${relation.columnFrom}_${relation.tableTo}_${relation.columnTo}` : `${relation.tableTo}_${relation.columnTo}_${relation.tableFrom}_${relation.columnFrom}`;
|
104927
104930
|
}
|
104928
104931
|
const hasDuplicatedRelation = originArray.some(
|
104929
|
-
(it, originIndex) => it.name === relation.name
|
104932
|
+
(it, originIndex) => relationIndex !== originIndex && it.name === relation.name
|
104930
104933
|
);
|
104931
104934
|
if (hasDuplicatedRelation) {
|
104932
104935
|
name = `${relation.name}_${relation.type === "one" ? relation.columnFrom : relation.columnTo}`;
|
@@ -106284,6 +106287,7 @@ certs();
|
|
106284
106287
|
init_cli();
|
106285
106288
|
init_studio();
|
106286
106289
|
init_views();
|
106290
|
+
var import_fs12 = require("fs");
|
106287
106291
|
var printVersions = async () => {
|
106288
106292
|
const v6 = await versions();
|
106289
106293
|
console.log(`${source_default.gray(v6)}
|
@@ -106416,11 +106420,13 @@ var pullCommand = new import_commander.Command("introspect").option("--config <c
|
|
106416
106420
|
tablesFilter,
|
106417
106421
|
schemasFilter
|
106418
106422
|
} = await preparePullConfig(options);
|
106423
|
+
(0, import_fs12.mkdirSync)(out, { recursive: true });
|
106419
106424
|
console.log(
|
106420
106425
|
grey(
|
106421
106426
|
`Pulling from [${schemasFilter.map((it) => `'${it}'`).join(", ")}] list of schemas`
|
106422
106427
|
)
|
106423
106428
|
);
|
106429
|
+
console.log();
|
106424
106430
|
try {
|
106425
106431
|
if (dialect7 === "postgresql") {
|
106426
106432
|
const { introspectPostgres: introspectPostgres2 } = await Promise.resolve().then(() => (init_introspect(), introspect_exports));
|