@mostajs/setup 1.4.7 → 1.4.8

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.
@@ -393,6 +393,22 @@ export function createUploadJarHandlers() {
393
393
  error: `Aucun JAR JDBC trouve pour ${dialect}. Uploadez le JAR d'abord.`,
394
394
  });
395
395
  }
396
+ // For dialects that require a running server, check reachability first
397
+ const SERVER_DIALECTS = {
398
+ hsqldb: 9001, oracle: 1521, db2: 50000, mssql: 1433,
399
+ };
400
+ const defaultSgbdPort = SERVER_DIALECTS[dialect];
401
+ if (defaultSgbdPort) {
402
+ const sgbdPort = port || defaultSgbdPort;
403
+ const sgbdHost = host || 'localhost';
404
+ const reachable = await isPortOpen(sgbdPort, sgbdHost, 2000);
405
+ if (!reachable) {
406
+ return Response.json({
407
+ ok: false,
408
+ error: `Serveur ${dialect.toUpperCase()} non accessible sur ${sgbdHost}:${sgbdPort}. Demarrez le serveur d'abord.`,
409
+ });
410
+ }
411
+ }
396
412
  const bridge = await manager.getOrCreate(dialect, uri);
397
413
  return Response.json({ ok: true, port: bridge.port });
398
414
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mostajs/setup",
3
- "version": "1.4.7",
3
+ "version": "1.4.8",
4
4
  "description": "Reusable setup wizard module — multi-dialect DB configuration, .env.local writer, seed runner",
5
5
  "author": "Dr Hamid MADANI <drmdh@msn.com>",
6
6
  "license": "MIT",