opticore-webapp 1.0.8 → 1.0.10

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.
Files changed (44) hide show
  1. package/dist/index.cjs +116 -632
  2. package/dist/index.d.cts +6 -66
  3. package/dist/index.d.ts +6 -66
  4. package/dist/index.js +109 -613
  5. package/package.json +9 -6
  6. package/src/application/service/core.service.ts +13 -10
  7. package/src/core/handlers/eventProcess.handler.ts +8 -5
  8. package/src/core/{utils → helpers}/logMessage.utils.ts +2 -2
  9. package/src/core/helpers/modulesLoaded.utils.ts +22 -0
  10. package/src/core/webServer.core.ts +28 -23
  11. package/src/domains/interfaces/routeDefinition.interface.ts +2 -2
  12. package/src/domains/types/kernelModule.type.ts +1 -1
  13. package/src/index.ts +1 -8
  14. package/src/utils/translations/messages.exception.en.json +78 -0
  15. package/src/utils/translations/messages.exception.fr.json +78 -0
  16. package/tsup.config.ts +1 -1
  17. package/src/application/exceptions/messages.exception.ts +0 -67
  18. package/src/core/events/errors/serverListen.event.error.ts +0 -335
  19. package/src/core/events/requestCalls.event.ts +0 -83
  20. package/src/core/handlers/errors/base/stackTraceError.ts +0 -23
  21. package/src/core/handlers/errors/stackTraceAssertionError.ts +0 -13
  22. package/src/core/handlers/errors/stackTraceEvalError.ts +0 -12
  23. package/src/core/handlers/errors/stackTraceGeneralError.ts +0 -13
  24. package/src/core/handlers/errors/stackTraceOpenSSLError.ts +0 -12
  25. package/src/core/handlers/errors/stackTraceRangeError.ts +0 -12
  26. package/src/core/handlers/errors/stackTraceReferenceError.ts +0 -13
  27. package/src/core/handlers/errors/stackTraceSyntaxError.ts +0 -12
  28. package/src/core/handlers/errors/stackTraceSystemError.ts +0 -14
  29. package/src/core/handlers/errors/stackTraceTypeError.ts +0 -13
  30. package/src/core/handlers/errors/stackTraceURIError.ts +0 -13
  31. package/src/core/utils/modulesLoaded.utils.ts +0 -16
  32. package/src/domains/constants/errorName.constant.ts +0 -12
  33. package/src/domains/constants/event.constant.ts +0 -15
  34. package/src/domains/constants/eventNameError.constant.ts +0 -8
  35. package/src/domains/constants/httpStatusCodes.constant.ts +0 -375
  36. package/src/domains/constants/logLevel.constant.ts +0 -6
  37. package/src/domains/env/access.env.ts +0 -23
  38. package/src/domains/interfaces/envVariables.interface.ts +0 -16
  39. package/src/domains/interfaces/kernelModule.interface.ts +0 -6
  40. package/src/infrastructure/events/.gitkeep +0 -0
  41. package/src/infrastructure/handlers/.gitkeep +0 -0
  42. package/src/presentation/middleware/.gitkeep +0 -0
  43. /package/src/core/{errors → events}/.gitkeep +0 -0
  44. /package/src/core/{utils → helpers}/dateTimeFormatted.utils.ts +0 -0
package/dist/index.d.cts CHANGED
@@ -1,11 +1,10 @@
1
1
  import { Server } from 'http';
2
- import { IncomingMessage, ServerResponse } from 'node:http';
3
- import express from 'express';
4
2
  import { CorsOptions } from 'cors';
3
+ import { Router, Application } from 'opticore-express';
5
4
 
6
5
  interface IRouteDefinition {
7
6
  path: string;
8
- handler: express.Router;
7
+ handler: Router;
9
8
  }
10
9
 
11
10
  type KernelModuleType = [{
@@ -18,76 +17,17 @@ declare class WebServerCore {
18
17
  private readonly routerExpressApp;
19
18
  private readonly port;
20
19
  private readonly host;
21
- constructor(app: express.Application, corsOriginOptions?: Partial<CorsOptions>);
20
+ constructor(app: Application, corsOriginOptions?: Partial<CorsOptions>);
22
21
  onStartServer(routers: {
23
22
  featureRoute: IRouteDefinition[];
24
- }[]): Server<typeof IncomingMessage, typeof ServerResponse>;
23
+ }[]): any;
25
24
  onListeningOnServerEvent(serverWeb: Server, kernelModule: KernelModuleType): void;
26
25
  onRequestOnServerEvent(serverWeb: Server): void;
27
- kernelModules(registerRouter: {
28
- featureRoute: IRouteDefinition[];
29
- }[], dbConnection: () => void): KernelModuleType;
26
+ private translationWebAppLoader;
30
27
  private registerRoutes;
31
28
  private stackTraceErrorHandling;
32
29
  private infoWebApp;
33
30
  private traceError;
34
31
  }
35
32
 
36
- interface EnvVariablesInterface {
37
- appHost: string;
38
- appPort: string;
39
- prodEnv: string;
40
- devEnv: string;
41
- dataBaseHost: string;
42
- dataBasePort: string;
43
- dataBaseUser: string;
44
- dataBasePassword: string;
45
- dataBaseName: string;
46
- apiVersion: string;
47
- usernameField: string;
48
- passwordField: string;
49
- argumentsDatabaseConnection: string;
50
- logEnv: any;
51
- }
52
-
53
- declare const getEnvVariable: EnvVariablesInterface;
54
-
55
- declare const CErrorName: {
56
- evalError: string;
57
- syntaxError: string;
58
- rangeError: string;
59
- referenceError: string;
60
- typeError: string;
61
- uriError: string;
62
- systemError: string;
63
- assertionError: string;
64
- openSSLError: string;
65
- generalError: string;
66
- };
67
-
68
- declare const CEvent: {
69
- beforeExit: string;
70
- disconnect: string;
71
- exit: string;
72
- rejectionHandled: string;
73
- uncaughtException: string;
74
- uncaughtExceptionMonitor: string;
75
- unhandledRejection: string;
76
- warning: string;
77
- message: string;
78
- multipleResolves: string;
79
- worker: string;
80
- sigint: string;
81
- sigterm: string;
82
- };
83
-
84
- declare const CEventNameError: {
85
- error: string;
86
- listening: string;
87
- close: string;
88
- connection: string;
89
- drop: string;
90
- request: string;
91
- };
92
-
93
- export { type IRouteDefinition, type KernelModuleType, WebServerCore as WebServer, CErrorName as errorName, CEvent as event, CEventNameError as eventName, getEnvVariable };
33
+ export { type IRouteDefinition, type KernelModuleType, WebServerCore as WebServer };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  import { Server } from 'http';
2
- import { IncomingMessage, ServerResponse } from 'node:http';
3
- import express from 'express';
4
2
  import { CorsOptions } from 'cors';
3
+ import { Router, Application } from 'opticore-express';
5
4
 
6
5
  interface IRouteDefinition {
7
6
  path: string;
8
- handler: express.Router;
7
+ handler: Router;
9
8
  }
10
9
 
11
10
  type KernelModuleType = [{
@@ -18,76 +17,17 @@ declare class WebServerCore {
18
17
  private readonly routerExpressApp;
19
18
  private readonly port;
20
19
  private readonly host;
21
- constructor(app: express.Application, corsOriginOptions?: Partial<CorsOptions>);
20
+ constructor(app: Application, corsOriginOptions?: Partial<CorsOptions>);
22
21
  onStartServer(routers: {
23
22
  featureRoute: IRouteDefinition[];
24
- }[]): Server<typeof IncomingMessage, typeof ServerResponse>;
23
+ }[]): any;
25
24
  onListeningOnServerEvent(serverWeb: Server, kernelModule: KernelModuleType): void;
26
25
  onRequestOnServerEvent(serverWeb: Server): void;
27
- kernelModules(registerRouter: {
28
- featureRoute: IRouteDefinition[];
29
- }[], dbConnection: () => void): KernelModuleType;
26
+ private translationWebAppLoader;
30
27
  private registerRoutes;
31
28
  private stackTraceErrorHandling;
32
29
  private infoWebApp;
33
30
  private traceError;
34
31
  }
35
32
 
36
- interface EnvVariablesInterface {
37
- appHost: string;
38
- appPort: string;
39
- prodEnv: string;
40
- devEnv: string;
41
- dataBaseHost: string;
42
- dataBasePort: string;
43
- dataBaseUser: string;
44
- dataBasePassword: string;
45
- dataBaseName: string;
46
- apiVersion: string;
47
- usernameField: string;
48
- passwordField: string;
49
- argumentsDatabaseConnection: string;
50
- logEnv: any;
51
- }
52
-
53
- declare const getEnvVariable: EnvVariablesInterface;
54
-
55
- declare const CErrorName: {
56
- evalError: string;
57
- syntaxError: string;
58
- rangeError: string;
59
- referenceError: string;
60
- typeError: string;
61
- uriError: string;
62
- systemError: string;
63
- assertionError: string;
64
- openSSLError: string;
65
- generalError: string;
66
- };
67
-
68
- declare const CEvent: {
69
- beforeExit: string;
70
- disconnect: string;
71
- exit: string;
72
- rejectionHandled: string;
73
- uncaughtException: string;
74
- uncaughtExceptionMonitor: string;
75
- unhandledRejection: string;
76
- warning: string;
77
- message: string;
78
- multipleResolves: string;
79
- worker: string;
80
- sigint: string;
81
- sigterm: string;
82
- };
83
-
84
- declare const CEventNameError: {
85
- error: string;
86
- listening: string;
87
- close: string;
88
- connection: string;
89
- drop: string;
90
- request: string;
91
- };
92
-
93
- export { type IRouteDefinition, type KernelModuleType, WebServerCore as WebServer, CErrorName as errorName, CEvent as event, CEventNameError as eventName, getEnvVariable };
33
+ export { type IRouteDefinition, type KernelModuleType, WebServerCore as WebServer };