@nodefony/drizzle 10.0.0-alpha.3 → 10.0.0-alpha.4
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/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/decorate.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/decorateMetadata.js +1 -1
- package/dist/index.js +2 -2
- package/dist/nodefony/registerStores.js +1 -1
- package/dist/nodefony/service/DrizzleService.js +1 -4
- package/dist/nodefony/src/orm-core/DrizzleOrm.js +2 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/nodefony/config/config.d.ts +2 -2
- package/package.json +14 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.
|
|
1
|
+
//#region \0@oxc-project+runtime@0.149.0/helpers/esm/decorate.js
|
|
2
2
|
function __decorate(decorators, target, key, desc) {
|
|
3
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.
|
|
1
|
+
//#region \0@oxc-project+runtime@0.149.0/helpers/esm/decorateMetadata.js
|
|
2
2
|
function __decorateMetadata(k, v) {
|
|
3
3
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
4
4
|
}
|
package/dist/index.js
CHANGED
|
@@ -36,8 +36,8 @@ import OrmMigrateStatus from "./nodefony/command/orm-migrate-status.js";
|
|
|
36
36
|
import OrmMigrateBaseline from "./nodefony/command/orm-migrate-baseline.js";
|
|
37
37
|
import OrmMigrateRepair from "./nodefony/command/orm-migrate-repair.js";
|
|
38
38
|
import OrmReset from "./nodefony/command/orm-reset.js";
|
|
39
|
-
import __decorateMetadata from "./_virtual/_@oxc-project_runtime@0.
|
|
40
|
-
import __decorate from "./_virtual/_@oxc-project_runtime@0.
|
|
39
|
+
import __decorateMetadata from "./_virtual/_@oxc-project_runtime@0.149.0/helpers/esm/decorateMetadata.js";
|
|
40
|
+
import __decorate from "./_virtual/_@oxc-project_runtime@0.149.0/helpers/esm/decorate.js";
|
|
41
41
|
import SessionStorage from "./nodefony/src/SessionStorage.js";
|
|
42
42
|
import "./nodefony/src/migrator/index.js";
|
|
43
43
|
import { DrizzleUserRepository } from "./nodefony/src/DrizzleUserRepository.js";
|
|
@@ -95,7 +95,7 @@ function resolveConnectedOrm(store, dialect) {
|
|
|
95
95
|
throw new Error(`${store} : ORM "${FRAMEWORK_CONNECTOR}" introuvable — charger @nodefony/drizzle AVANT @nodefony/security dans le manifeste "modules".`);
|
|
96
96
|
}
|
|
97
97
|
if (!(orm instanceof DrizzleOrm)) throw new Error(`${store} : l'ORM "${FRAMEWORK_CONNECTOR}" n'est pas un DrizzleOrm (connecteur homonyme d'un autre driver ?).`);
|
|
98
|
-
if (!orm.isConnected()) throw new Error(`${store} : ORM "${FRAMEWORK_CONNECTOR}"
|
|
98
|
+
if (!orm.isConnected()) throw new Error(`${store} : ORM "${FRAMEWORK_CONNECTOR}" enregistré mais NON CONNECTÉ. Deux causes constatables : soit ce run n'a pas déclaré \`externalServices\` (une commande qui lit ou écrit des données le déclare via CONSOLE_DATA_RUN_PROFILE), soit le store a été demandé avant la connexion (ordre de boot). Un store "auto" n'atteint jamais ce point : seule une demande EXPLICITE le fait.`);
|
|
99
99
|
if (orm.dialect !== dialect) throw new Error(`${store} : ORM "${FRAMEWORK_CONNECTOR}" en "${orm.dialect}" mais le schéma framework a été déclaré en "${dialect}" (incohérence de config).`);
|
|
100
100
|
return orm;
|
|
101
101
|
}
|
|
@@ -84,10 +84,7 @@ var DrizzleService = class extends Service {
|
|
|
84
84
|
this.module = module;
|
|
85
85
|
this.module.hookKernel("onBoot", async () => {
|
|
86
86
|
queryFlowMonitor.setEnabled(resolveOrmFlowEnabled(this.kernel));
|
|
87
|
-
await this.connectAll(runNeedsExternalServices(this.kernel))
|
|
88
|
-
this.log(e, "ERROR");
|
|
89
|
-
throw e;
|
|
90
|
-
});
|
|
87
|
+
await this.connectAll(runNeedsExternalServices(this.kernel));
|
|
91
88
|
});
|
|
92
89
|
this.kernel?.once("onTerminate", async () => {
|
|
93
90
|
this.#stopWatchers();
|
|
@@ -874,7 +874,8 @@ var DrizzleOrm = class DrizzleOrm extends Orm {
|
|
|
874
874
|
}
|
|
875
875
|
getRepository(name) {
|
|
876
876
|
const table = this.#tables?.[name];
|
|
877
|
-
if (!
|
|
877
|
+
if (!this.#db) throw new Error(`DrizzleOrm "${this.name}": non connecté — impossible de rendre un dépôt pour "${name}". Les tables ne sont résolues qu'à la connexion. Si ce run est une commande en ligne, elle n'a pas déclaré \`externalServices\` (CONSOLE_DATA_RUN_PROFILE).`);
|
|
878
|
+
if (!table) throw new Error(`DrizzleOrm "${this.name}": no entity table registered under "${name}".`);
|
|
878
879
|
if (this.#repositories === null) this.#repositories = Object.create(null);
|
|
879
880
|
let repository = this.#repositories[name];
|
|
880
881
|
if (repository === void 0) {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ declare class Drizzle extends Module<IDrizzleConfig> {
|
|
|
39
39
|
export default Drizzle;
|
|
40
40
|
export { DrizzleService };
|
|
41
41
|
export { defineDrizzleConfig, drizzleConfigJsonSchema };
|
|
42
|
-
export { drizzleConfigSchema
|
|
42
|
+
export { drizzleConfigSchema } from "./nodefony/config/config.js";
|
|
43
43
|
export type { IDrizzleConfig, IDrizzleConfigInput, IDrizzleConnectorConfig, } from "./nodefony/interfaces/IDrizzleConfig.js";
|
|
44
44
|
export { default as SessionStorage } from "./nodefony/src/SessionStorage.js";
|
|
45
45
|
export { sessionTable, createSessionTable, createSessionEntity, registerSessionEntity, SESSION_CONNECTOR, SESSION_ENTITY_NAME, } from "./nodefony/entity/sessionEntity.js";
|
|
@@ -101,10 +101,10 @@ export declare const drizzleConfigSchema: z.ZodObject<{
|
|
|
101
101
|
frameworkEntities: z.ZodDefault<z.ZodBoolean>;
|
|
102
102
|
}, z.core.$strict>;
|
|
103
103
|
/** Type de sortie (config normalisée + défauts appliqués). */
|
|
104
|
-
export type
|
|
104
|
+
export type IDrizzleConfig = z.infer<typeof drizzleConfigSchema>;
|
|
105
105
|
/**
|
|
106
106
|
* Défauts du module, matérialisés depuis le schéma (source unique). Toujours
|
|
107
107
|
* valides par construction ; passés au `super(..., config)` du Module class.
|
|
108
108
|
*/
|
|
109
|
-
declare const config:
|
|
109
|
+
declare const config: IDrizzleConfig;
|
|
110
110
|
export default config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nodefony/drizzle",
|
|
3
|
-
"version": "10.0.0-alpha.
|
|
3
|
+
"version": "10.0.0-alpha.4",
|
|
4
4
|
"description": "Moteur SQL de Nodefony sur Drizzle ORM (SQLite, PostgreSQL, MySQL) : dépôts typés, migrations de schéma et adoption d'une base existante",
|
|
5
5
|
"nodefony": {
|
|
6
6
|
"storeKind": "durable",
|
|
@@ -60,30 +60,30 @@
|
|
|
60
60
|
"zod": "^4.4.3"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@nodefony/framework": "^10.0.0-alpha.
|
|
64
|
-
"@nodefony/http": "^10.0.0-alpha.
|
|
65
|
-
"@nodefony/orm-core": "^10.0.0-alpha.
|
|
66
|
-
"@nodefony/security": "^10.0.0-alpha.
|
|
67
|
-
"@nodefony/user": "^10.0.0-alpha.
|
|
63
|
+
"@nodefony/framework": "^10.0.0-alpha.4",
|
|
64
|
+
"@nodefony/http": "^10.0.0-alpha.4",
|
|
65
|
+
"@nodefony/orm-core": "^10.0.0-alpha.4",
|
|
66
|
+
"@nodefony/security": "^10.0.0-alpha.4",
|
|
67
|
+
"@nodefony/user": "^10.0.0-alpha.4",
|
|
68
68
|
"@types/better-sqlite3": "9.6.0",
|
|
69
69
|
"@types/node": "26.4.1",
|
|
70
70
|
"@types/pg": "8.23.1",
|
|
71
71
|
"better-sqlite3": "13.0.3",
|
|
72
72
|
"drizzle-kit": "0.31.10",
|
|
73
|
-
"mysql2": "3.24.
|
|
74
|
-
"nodefony": "^10.0.0-alpha.
|
|
73
|
+
"mysql2": "3.24.4",
|
|
74
|
+
"nodefony": "^10.0.0-alpha.4",
|
|
75
75
|
"pg": "8.23.0",
|
|
76
76
|
"rimraf": "6.1.3"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
|
-
"@nodefony/framework": "^10.0.0-alpha.
|
|
80
|
-
"@nodefony/http": "^10.0.0-alpha.
|
|
81
|
-
"@nodefony/orm-core": "^10.0.0-alpha.
|
|
82
|
-
"@nodefony/security": "^10.0.0-alpha.
|
|
83
|
-
"@nodefony/user": "^10.0.0-alpha.
|
|
79
|
+
"@nodefony/framework": "^10.0.0-alpha.4",
|
|
80
|
+
"@nodefony/http": "^10.0.0-alpha.4",
|
|
81
|
+
"@nodefony/orm-core": "^10.0.0-alpha.4",
|
|
82
|
+
"@nodefony/security": "^10.0.0-alpha.4",
|
|
83
|
+
"@nodefony/user": "^10.0.0-alpha.4",
|
|
84
84
|
"better-sqlite3": "^13.0.0",
|
|
85
85
|
"mysql2": "^3.24.0",
|
|
86
|
-
"nodefony": "^10.0.0-alpha.
|
|
86
|
+
"nodefony": "^10.0.0-alpha.4",
|
|
87
87
|
"pg": "^8.23.0"
|
|
88
88
|
},
|
|
89
89
|
"repository": {
|