@mostajs/orm 1.3.1 → 1.4.0

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.
@@ -26,7 +26,10 @@ export declare function disconnectDialect(): Promise<void>;
26
26
  * Test the connection with a given config without changing the active dialect.
27
27
  * Used by the setup wizard to validate before committing.
28
28
  */
29
- export declare function testConnection(config: ConnectionConfig): Promise<boolean>;
29
+ export declare function testConnection(config: ConnectionConfig): Promise<{
30
+ ok: boolean;
31
+ error?: string;
32
+ }>;
30
33
  /**
31
34
  * Simplified high-level API: connect to a database and optionally register schemas.
32
35
  * Returns the connected dialect instance.
@@ -117,10 +117,11 @@ export async function testConnection(config) {
117
117
  await dialect.connect(config);
118
118
  const ok = await dialect.testConnection();
119
119
  await dialect.disconnect();
120
- return ok;
120
+ return { ok };
121
121
  }
122
- catch {
123
- return false;
122
+ catch (e) {
123
+ const error = e instanceof Error ? e.message : String(e);
124
+ return { ok: false, error };
124
125
  }
125
126
  }
126
127
  /**
@@ -1231,3 +1231,118 @@ mosta-orm/
1231
1231
  - process.on('exit/SIGINT/SIGTERM') → stopAll()
1232
1232
  - Détection port occupé avec incrémentation automatique
1233
1233
 
1234
+
1235
+ Architecture JAR Upload
1236
+
1237
+ Navigateur (ReconfigPanel)
1238
+ │ upload .jar via <input type="file">
1239
+
1240
+ POST /api/setup/upload-jar (SecuAccessPro route)
1241
+ │ createUploadJarHandlers()
1242
+
1243
+ @mostajs/setup/api/upload-jar.route.ts (route factory)
1244
+ │ import('@mostajs/orm')
1245
+
1246
+ @mostajs/orm/bridge/jar-upload.ts (logique metier)
1247
+ │ saveJarFile() / deleteJarFile() / listJarFiles()
1248
+
1249
+ jar_files/hsqldb-2.7.2.jar (fichier sauvegardé)
1250
+
1251
+ Fichiers créés/modifiés
1252
+
1253
+ ┌───────────┬───────────────────────────────────┬─────────────────────┐
1254
+ │ Package │ Fichier │ Action │
1255
+ ├───────────┼───────────────────────────────────┼─────────────────────┤
1256
+ │ mosta-orm │ src/bridge/jar-upload.ts │ Logique upload/dele │
1257
+ │ │ │ te/list/detect │
1258
+ ├───────────┼───────────────────────────────────┼─────────────────────┤
1259
+ │ mosta-orm │ src/bridge/BridgeManager.ts │ Multi-bridge │
1260
+ │ │ │ singleton │
1261
+ ├───────────┼───────────────────────────────────┼─────────────────────┤
1262
+ │ mosta-orm │ src/index.ts │ Exports ajoutés │
1263
+ ├───────────┼───────────────────────────────────┼─────────────────────┤
1264
+ │ mosta-orm │ README.md │ Section JDBC Bridge │
1265
+ │ │ │ + JAR Upload │
1266
+ ├───────────┼───────────────────────────────────┼─────────────────────┤
1267
+ │ mosta-set │ api/upload-jar.route.ts │ Route factory │
1268
+ │ up │ │ GET/POST/DELETE │
1269
+ ├───────────┼───────────────────────────────────┼─────────────────────┤
1270
+ │ mosta-set │ │ 13 dialects + │
1271
+ │ up │ components/ReconfigPanel.tsx │ premium badge + │
1272
+ │ │ │ section upload JAR │
1273
+ ├───────────┼───────────────────────────────────┼─────────────────────┤
1274
+ │ mosta-set │ README.md │ Route upload-jar │
1275
+ │ up │ │ documentée │
1276
+ ├───────────┼───────────────────────────────────┼─────────────────────┤
1277
+ │ SecuAcces │ src/app/api/setup/upload-jar/rout │ Route Next.js │
1278
+ │ sPro │ e.ts │ │
1279
+ ├───────────┼───────────────────────────────────┼─────────────────────┤
1280
+ │ SecuAcces │ src/app/dashboard/settings/reconf │ Ajout jarEndpoint │
1281
+ │ sPro │ ig/page.tsx │ │
1282
+ └───────────┴───────────────────────────────────┴─────────────────────┘
1283
+
1284
+ Versions publiées
1285
+
1286
+ - @mostajs/orm@1.3.1 — avec BridgeManager, jar-upload,
1287
+ jar_files/hsqldb-2.7.2.jar
1288
+ - @mostajs/setup@1.3.1 — avec ReconfigPanel (13 dialects, premium, upload
1289
+ JAR)
1290
+
1291
+
1292
+
1293
+ Page setup alignée avec ReconfigPanel
1294
+
1295
+ ┌───────────────┬──────────────────────┬──────────────────────────────┐
1296
+ │ Modification │ ReconfigPanel │ Setup page │
1297
+ ├───────────────┼──────────────────────┼──────────────────────────────┤
1298
+ │ 13 dialects │ Oui (corrigé avant) │ Oui (déjà present) │
1299
+ ├───────────────┼──────────────────────┼──────────────────────────────┤
1300
+ │ Premium grisé │ Oui (opacity: 0.45, │ Oui (opacity-40 grayscale, │
1301
+ │ │ badge "Premium") │ badge "Premium") │
1302
+ ├───────────────┼──────────────────────┼──────────────────────────────┤
1303
+ │ Upload JAR │ Oui (section │ Oui (composant │
1304
+ │ │ complète avec table) │ JarUploadSection inline) │
1305
+ ├───────────────┼──────────────────────┼──────────────────────────────┤
1306
+ │ JDBC │ Oui (JDBC_DIALECTS) │ Oui (JDBC_DIALECTS) │
1307
+ │ indicator │ │ │
1308
+ ├───────────────┼──────────────────────┼──────────────────────────────┤
1309
+ │ Driver hint │ │ Corrigé: "Uploader │
1310
+ │ hsqldb │ N/A │ hsqldb*.jar" au lieu de "npm │
1311
+ │ │ │ install hsqldb" │
1312
+ └───────────────┴──────────────────────┴──────────────────────────────┘
1313
+
1314
+ Les deux pages (setup initial + reconfiguration) sont maintenant alignées
1315
+ avec les mêmes fonctionnalités : 13 dialects, premium grisé, upload JAR
1316
+ pour les dialects JDBC.
1317
+
1318
+ ✻ Worked for 1m 40s
1319
+
1320
+ ❯ publie sur npm et install
1321
+
1322
+ ● Read 2 files (ctrl+o to expand)
1323
+
1324
+ ● Les modifications de la page setup sont dans SecuAccessPro (pas dans les
1325
+ packages npm). Mais mosta-setup n'a pas changé depuis la dernière
1326
+ publication. Seul mosta-orm n'a pas changé non plus. Pas besoin de
1327
+ republier — les versions 1.3.1 sont déjà installées et à jour.
1328
+
1329
+ Vérifions que tout est bien installé.
1330
+
1331
+ ● Bash(npm ls @mostajs/orm @mostajs/setup 2>&1 | head -10)
1332
+ ⎿  secuaccesspro@1.0.0 /home/hmd/dev/MostaGare-Install/SecuAccessPro
1333
+ ├─┬ @mostajs/audit@1.0.3
1334
+ │ └── @mostajs/orm@1.3.1 deduped
1335
+ … +7 lines (ctrl+o to expand)
1336
+
1337
+ ● @mostajs/orm@1.3.1 et @mostajs/setup@1.3.1 sont déjà installés et à jour.
1338
+ Les packages n'ont pas changé — seule la page src/app/setup/page.tsx de
1339
+ SecuAccessPro a été modifiée (premium + JAR upload), et c'est un fichier
1340
+ local, pas un package npm.
1341
+
1342
+ Rien à publier ni à installer — tout est déjà en place.
1343
+
1344
+ ❯ la page setup devrait se trouvé dans mosta-setup
1345
+
1346
+ ● Compris — la page setup doit être un composant dans mosta-setup, comme
1347
+ ReconfigPanel. Voyons d'abord la page complète.
1348
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mostajs/orm",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "Hibernate-inspired multi-dialect ORM for Node.js/TypeScript — One API, 13 databases, zero lock-in",
5
5
  "author": "Dr Hamid MADANI <drmdh@msn.com>",
6
6
  "license": "MIT",