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.
- package/dist/index.cjs +116 -632
- package/dist/index.d.cts +6 -66
- package/dist/index.d.ts +6 -66
- package/dist/index.js +109 -613
- package/package.json +9 -6
- package/src/application/service/core.service.ts +13 -10
- package/src/core/handlers/eventProcess.handler.ts +8 -5
- package/src/core/{utils → helpers}/logMessage.utils.ts +2 -2
- package/src/core/helpers/modulesLoaded.utils.ts +22 -0
- package/src/core/webServer.core.ts +28 -23
- package/src/domains/interfaces/routeDefinition.interface.ts +2 -2
- package/src/domains/types/kernelModule.type.ts +1 -1
- package/src/index.ts +1 -8
- package/src/utils/translations/messages.exception.en.json +78 -0
- package/src/utils/translations/messages.exception.fr.json +78 -0
- package/tsup.config.ts +1 -1
- package/src/application/exceptions/messages.exception.ts +0 -67
- package/src/core/events/errors/serverListen.event.error.ts +0 -335
- package/src/core/events/requestCalls.event.ts +0 -83
- package/src/core/handlers/errors/base/stackTraceError.ts +0 -23
- package/src/core/handlers/errors/stackTraceAssertionError.ts +0 -13
- package/src/core/handlers/errors/stackTraceEvalError.ts +0 -12
- package/src/core/handlers/errors/stackTraceGeneralError.ts +0 -13
- package/src/core/handlers/errors/stackTraceOpenSSLError.ts +0 -12
- package/src/core/handlers/errors/stackTraceRangeError.ts +0 -12
- package/src/core/handlers/errors/stackTraceReferenceError.ts +0 -13
- package/src/core/handlers/errors/stackTraceSyntaxError.ts +0 -12
- package/src/core/handlers/errors/stackTraceSystemError.ts +0 -14
- package/src/core/handlers/errors/stackTraceTypeError.ts +0 -13
- package/src/core/handlers/errors/stackTraceURIError.ts +0 -13
- package/src/core/utils/modulesLoaded.utils.ts +0 -16
- package/src/domains/constants/errorName.constant.ts +0 -12
- package/src/domains/constants/event.constant.ts +0 -15
- package/src/domains/constants/eventNameError.constant.ts +0 -8
- package/src/domains/constants/httpStatusCodes.constant.ts +0 -375
- package/src/domains/constants/logLevel.constant.ts +0 -6
- package/src/domains/env/access.env.ts +0 -23
- package/src/domains/interfaces/envVariables.interface.ts +0 -16
- package/src/domains/interfaces/kernelModule.interface.ts +0 -6
- package/src/infrastructure/events/.gitkeep +0 -0
- package/src/infrastructure/handlers/.gitkeep +0 -0
- package/src/presentation/middleware/.gitkeep +0 -0
- /package/src/core/{errors → events}/.gitkeep +0 -0
- /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:
|
|
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:
|
|
20
|
+
constructor(app: Application, corsOriginOptions?: Partial<CorsOptions>);
|
|
22
21
|
onStartServer(routers: {
|
|
23
22
|
featureRoute: IRouteDefinition[];
|
|
24
|
-
}[]):
|
|
23
|
+
}[]): any;
|
|
25
24
|
onListeningOnServerEvent(serverWeb: Server, kernelModule: KernelModuleType): void;
|
|
26
25
|
onRequestOnServerEvent(serverWeb: Server): void;
|
|
27
|
-
|
|
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
|
-
|
|
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:
|
|
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:
|
|
20
|
+
constructor(app: Application, corsOriginOptions?: Partial<CorsOptions>);
|
|
22
21
|
onStartServer(routers: {
|
|
23
22
|
featureRoute: IRouteDefinition[];
|
|
24
|
-
}[]):
|
|
23
|
+
}[]): any;
|
|
25
24
|
onListeningOnServerEvent(serverWeb: Server, kernelModule: KernelModuleType): void;
|
|
26
25
|
onRequestOnServerEvent(serverWeb: Server): void;
|
|
27
|
-
|
|
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
|
-
|
|
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 };
|