@zenstackhq/cli 3.4.1 → 3.4.2
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/dist/index.cjs +10 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -3661,7 +3661,8 @@ async function run9(options) {
|
|
|
3661
3661
|
}
|
|
3662
3662
|
const provider = getStringLiteral2(dataSource?.fields.find((f) => f.name === "provider")?.value);
|
|
3663
3663
|
const dialect = await createDialect(provider, databaseUrl, outputPath);
|
|
3664
|
-
const
|
|
3664
|
+
const fileUrl = typeof __filename !== "undefined" ? __filename : import.meta.url;
|
|
3665
|
+
const jiti = createJiti2(fileUrl);
|
|
3665
3666
|
const schemaModule = await jiti.import(path9.join(outputPath, "schema"));
|
|
3666
3667
|
const schema = schemaModule.schema;
|
|
3667
3668
|
const omit = {};
|
|
@@ -3679,7 +3680,8 @@ async function run9(options) {
|
|
|
3679
3680
|
const db = new ZenStackClient(schema, {
|
|
3680
3681
|
dialect,
|
|
3681
3682
|
log: log && log.length > 0 ? log : void 0,
|
|
3682
|
-
omit: Object.keys(omit).length > 0 ? omit : void 0
|
|
3683
|
+
omit: Object.keys(omit).length > 0 ? omit : void 0,
|
|
3684
|
+
skipValidationForComputedFields: true
|
|
3683
3685
|
});
|
|
3684
3686
|
try {
|
|
3685
3687
|
await db.$connect();
|
|
@@ -3772,7 +3774,7 @@ async function createDialect(provider, databaseUrl, outputPath) {
|
|
|
3772
3774
|
}
|
|
3773
3775
|
}
|
|
3774
3776
|
__name(createDialect, "createDialect");
|
|
3775
|
-
function
|
|
3777
|
+
function createProxyApp(client, schema) {
|
|
3776
3778
|
const app = express();
|
|
3777
3779
|
app.use(cors());
|
|
3778
3780
|
app.use(express.json({
|
|
@@ -3794,6 +3796,11 @@ function startServer(client, schema, options) {
|
|
|
3794
3796
|
zenstackVersion: getVersion()
|
|
3795
3797
|
});
|
|
3796
3798
|
});
|
|
3799
|
+
return app;
|
|
3800
|
+
}
|
|
3801
|
+
__name(createProxyApp, "createProxyApp");
|
|
3802
|
+
function startServer(client, schema, options) {
|
|
3803
|
+
const app = createProxyApp(client, schema);
|
|
3797
3804
|
const server = app.listen(options.port, () => {
|
|
3798
3805
|
console.log(`ZenStack proxy server is running on port: ${options.port}`);
|
|
3799
3806
|
console.log(`You can visit ZenStack Studio at: ${colors11.blue("https://studio.zenstack.dev")}`);
|