@zenstackhq/cli 3.3.2-beta.1 → 3.3.3
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 +17 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
package/dist/index.cjs
CHANGED
|
@@ -1025,9 +1025,23 @@ async function run9(options) {
|
|
|
1025
1025
|
const dialect = createDialect(provider, databaseUrl, outputPath);
|
|
1026
1026
|
const jiti = (0, import_jiti2.createJiti)(import_meta3.url);
|
|
1027
1027
|
const schemaModule = await jiti.import(import_node_path9.default.join(outputPath, "schema"));
|
|
1028
|
-
const
|
|
1028
|
+
const schema = schemaModule.schema;
|
|
1029
|
+
const omit = {};
|
|
1030
|
+
for (const [modelName, modelDef] of Object.entries(schema.models)) {
|
|
1031
|
+
const computedFields = {};
|
|
1032
|
+
for (const [fieldName, fieldDef] of Object.entries(modelDef.fields)) {
|
|
1033
|
+
if (fieldDef.computed === true) {
|
|
1034
|
+
computedFields[fieldName] = true;
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
if (Object.keys(computedFields).length > 0) {
|
|
1038
|
+
omit[modelName] = computedFields;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
const db = new import_orm.ZenStackClient(schema, {
|
|
1029
1042
|
dialect,
|
|
1030
|
-
log: log && log.length > 0 ? log : void 0
|
|
1043
|
+
log: log && log.length > 0 ? log : void 0,
|
|
1044
|
+
omit: Object.keys(omit).length > 0 ? omit : void 0
|
|
1031
1045
|
});
|
|
1032
1046
|
try {
|
|
1033
1047
|
await db.$connect();
|
|
@@ -1158,7 +1172,7 @@ var import_node_fs13 = __toESM(require("fs"), 1);
|
|
|
1158
1172
|
var os2 = __toESM(require("os"), 1);
|
|
1159
1173
|
|
|
1160
1174
|
// src/constants.ts
|
|
1161
|
-
var TELEMETRY_TRACKING_TOKEN = "
|
|
1175
|
+
var TELEMETRY_TRACKING_TOKEN = "74944eb779d7d3b4ce185be843fde9fc";
|
|
1162
1176
|
|
|
1163
1177
|
// src/utils/is-ci.ts
|
|
1164
1178
|
var import_node_process = require("process");
|