emilsoftware-utilities 1.3.77 → 1.3.78

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.
@@ -16,6 +16,7 @@ const PermissionService_1 = require("./Services/PermissionService/PermissionServ
16
16
  const UserService_1 = require("./Services/UserService/UserService");
17
17
  let AccessiModule = AccessiModule_1 = class AccessiModule {
18
18
  static forRoot(options) {
19
+ console.log("AccessiModule inizializzato con opzioni:", options);
19
20
  return {
20
21
  module: AccessiModule_1,
21
22
  controllers: [AccessiController_1.AccessiController],
@@ -29,7 +30,7 @@ let AccessiModule = AccessiModule_1 = class AccessiModule {
29
30
  EmailService_1.EmailService,
30
31
  PermissionService_1.PermissionService,
31
32
  ],
32
- exports: ['ACCESSI_OPTIONS', AuthService_1.AuthService, UserService_1.UserService, EmailService_1.EmailService, PermissionService_1.PermissionService], // Esportiamo AuthService per altri moduli
33
+ exports: ['ACCESSI_OPTIONS', AuthService_1.AuthService, UserService_1.UserService, EmailService_1.EmailService, PermissionService_1.PermissionService],
33
34
  };
34
35
  }
35
36
  };
@@ -25,21 +25,24 @@ var AccessiModule_2 = require("./AccessiModule");
25
25
  Object.defineProperty(exports, "AccessiModule", { enumerable: true, get: function () { return AccessiModule_2.AccessiModule; } });
26
26
  function initializeAccessiModule(app, options) {
27
27
  return __awaiter(this, void 0, void 0, function* () {
28
- const nestExpressInstance = (0, express_1.default)(); // Istanza separata di Express per NestJS
29
- const expressAdapter = new platform_express_1.ExpressAdapter(nestExpressInstance);
30
- // Creiamo l'app NestJS con l'adapter corretto
31
- const nestApp = yield core_1.NestFactory.create(AccessiModule_1.AccessiModule.forRoot(options), expressAdapter, { bufferLogs: true });
32
- // Abilitiamo CORS per evitare problemi con richieste da browser
33
- nestApp.enableCors();
34
- // Inizializziamo NestJS
35
- yield nestApp.init();
36
- // 🛠️ Importante: Usa `nestExpressInstance` per montare le API su /api/accessi
37
- app.use('/api/accessi', nestExpressInstance);
38
- // Serviamo Swagger
39
- (0, SwaggerConfig_1.serveSwaggerDocs)(nestApp);
40
- // Debug: Verifica se le rotte di NestJS sono registrate
41
- console.log('NestJS Routes:', nestApp.getHttpServer()._events.request._router.stack
42
- .map((r) => { var _a; return (_a = r.route) === null || _a === void 0 ? void 0 : _a.path; })
43
- .filter(Boolean));
28
+ try {
29
+ const nestExpressInstance = (0, express_1.default)(); // Istanza separata di Express
30
+ const expressAdapter = new platform_express_1.ExpressAdapter(nestExpressInstance);
31
+ const nestApp = yield core_1.NestFactory.create(AccessiModule_1.AccessiModule.forRoot(options), expressAdapter, { bufferLogs: true });
32
+ nestApp.enableCors();
33
+ yield nestApp.init();
34
+ // 🛠️ Montiamo NestJS su /api/accessi
35
+ app.use('/api/accessi', nestExpressInstance);
36
+ // Serviamo Swagger
37
+ (0, SwaggerConfig_1.serveSwaggerDocs)(nestApp);
38
+ // Debug: Controlla se Nest sta registrando le rotte
39
+ console.log('NestJS Routes:', nestApp.getHttpServer()._events.request._router.stack
40
+ .map((r) => { var _a; return (_a = r.route) === null || _a === void 0 ? void 0 : _a.path; })
41
+ .filter(Boolean));
42
+ }
43
+ catch (error) {
44
+ console.error("Error occurred in initializeAccessiModule:", error);
45
+ throw error; // Rilancia l'errore per vedere lo stack completo
46
+ }
44
47
  });
45
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emilsoftware-utilities",
3
- "version": "1.3.77",
3
+ "version": "1.3.78",
4
4
  "description": "Utilities for EmilSoftware",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",