fiberx-backend-toolkit 0.0.32 → 0.0.33
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.
|
@@ -373,7 +373,7 @@ const SEQUELIZE_MODELS_INDEX_CODE_TEMPLATE = (model_names, imports) => {
|
|
|
373
373
|
return `
|
|
374
374
|
const initialize${model_name}Model = (): typeof ${model_name} => {
|
|
375
375
|
const connection_name = ${model_name}.schema_def?.connection_name || "default";
|
|
376
|
-
const sequelize = seqelize_connector.
|
|
376
|
+
const sequelize = seqelize_connector.connectNamedSync(connection_name);
|
|
377
377
|
|
|
378
378
|
if (!sequelize) {
|
|
379
379
|
throw new Error("Sequelize connection not available for ${model_name} model.");
|
|
@@ -391,16 +391,13 @@ const initialize${model_name}Model = (): typeof ${model_name} => {
|
|
|
391
391
|
const ${model_name}Model = initialize${model_name}Model();
|
|
392
392
|
`;
|
|
393
393
|
}).join("\n");
|
|
394
|
-
const model_exports = model_names.map((model_name) => {
|
|
395
|
-
|
|
396
|
-
${model_name},
|
|
397
|
-
${model_name}Model
|
|
398
|
-
`;
|
|
399
|
-
}).join(",\n");
|
|
394
|
+
const model_exports = model_names.map((model_name) => ` ${model_name},
|
|
395
|
+
${model_name}Model`).join(",\n");
|
|
400
396
|
return `
|
|
401
397
|
import { SequelizeConnector } from "fiberx-backend-toolkit/dist/database/main";
|
|
402
398
|
${imports}
|
|
403
399
|
|
|
400
|
+
|
|
404
401
|
const seqelize_connector = SequelizeConnector.getInstance();
|
|
405
402
|
|
|
406
403
|
${model_initializers}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fiberx-backend-toolkit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33",
|
|
4
4
|
"description": "A TypeScript backend toolkit providing shared domain logic, infrastructure helpers, and utilities for FiberX server-side applications and services.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./dist/index.js",
|