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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opticore-webapp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "wep server",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -25,21 +25,24 @@
|
|
|
25
25
|
"homepage": "https://github.com/guyzoum77/opticore-webApp#readme",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"ansi-colors": "^4.1.3",
|
|
28
|
+
"chalk": "^5.4.1",
|
|
28
29
|
"cors": "^2.8.5",
|
|
29
30
|
"dotenv": "^16.4.7",
|
|
30
|
-
"express": "^4.21.0",
|
|
31
|
-
"express-rate-limit": "^5.5.1",
|
|
32
|
-
"express-session": "^1.0.0",
|
|
33
|
-
"express-useragent": "^1.0.15",
|
|
34
31
|
"gradient-string": "^2.0.2",
|
|
32
|
+
"opticore-catch-exception-error": "^1.0.1",
|
|
33
|
+
"opticore-env-access": "^1.0.2",
|
|
34
|
+
"opticore-express": "^1.0.3",
|
|
35
|
+
"opticore-http-response": "^1.0.3",
|
|
35
36
|
"opticore-logger": "^1.0.10",
|
|
37
|
+
"opticore-requests-called-events": "^1.0.0",
|
|
36
38
|
"opticore-router": "^1.0.7",
|
|
39
|
+
"opticore-translator": "^1.0.1",
|
|
37
40
|
"opticore-validator": "^1.0.3",
|
|
41
|
+
"tslib": "^2.8.1",
|
|
38
42
|
"typescript": "^5.4.5"
|
|
39
43
|
},
|
|
40
44
|
"devDependencies": {
|
|
41
45
|
"@types/cors": "^2.8.17",
|
|
42
|
-
"@types/express": "^4.17.21",
|
|
43
46
|
"@types/gradient-string": "^1.1.6",
|
|
44
47
|
"tsup": "^8.3.5"
|
|
45
48
|
}
|
|
@@ -3,12 +3,15 @@ import chalk from 'chalk';
|
|
|
3
3
|
import * as path from "path";
|
|
4
4
|
import * as fs from "fs";
|
|
5
5
|
import colors from "ansi-colors";
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
import StackTraceError from "
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
import {
|
|
6
|
+
|
|
7
|
+
import { HttpStatusCode as status } from "opticore-http-response";
|
|
8
|
+
import { StackTraceError } from "opticore-catch-exception-error";
|
|
9
|
+
import { Router } from "opticore-express";
|
|
10
|
+
|
|
11
|
+
import { KernelModuleType } from "@webApp/domains/types/kernelModule.type";
|
|
12
|
+
import { modulesLoadedUtils as loadedModules } from "@webApp/core/helpers/modulesLoaded.utils";
|
|
13
|
+
import {CLocal, TranslationLoader} from "opticore-translator";
|
|
14
|
+
|
|
12
15
|
|
|
13
16
|
|
|
14
17
|
export class CoreService {
|
|
@@ -153,12 +156,12 @@ export class CoreService {
|
|
|
153
156
|
}
|
|
154
157
|
|
|
155
158
|
public coreListenerEventLoaderModuleService<T extends KernelModuleType>(kernelModule: T) {
|
|
156
|
-
let router:
|
|
159
|
+
let router: Router[] = [];
|
|
157
160
|
let dbCon: (() => void) | undefined;
|
|
158
161
|
|
|
159
162
|
kernelModule.forEach((module): void => {
|
|
160
163
|
if (Array.isArray(module)) {
|
|
161
|
-
router = module as
|
|
164
|
+
router = module as Router[];
|
|
162
165
|
} else if (typeof module === "function") {
|
|
163
166
|
dbCon = module as () => void;
|
|
164
167
|
}
|
|
@@ -169,8 +172,8 @@ export class CoreService {
|
|
|
169
172
|
((): void => { dbCon(); })();
|
|
170
173
|
} else {
|
|
171
174
|
const stackTrace: StackTraceError = new StackTraceError(
|
|
172
|
-
|
|
173
|
-
|
|
175
|
+
TranslationLoader.t("loadedModulesError", CLocal),
|
|
176
|
+
TranslationLoader.t("loadedModules", CLocal),
|
|
174
177
|
status.NOT_ACCEPTABLE,
|
|
175
178
|
true
|
|
176
179
|
);
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import express, {Express} from "express";
|
|
2
1
|
import process from 'node:process';
|
|
3
2
|
import EventEmitter from "node:events";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { express, NextFunction } from "opticore-express";
|
|
4
|
+
import {
|
|
5
|
+
ServerListenEventError,
|
|
6
|
+
CEventNameError as eventName,
|
|
7
|
+
CEvent as event
|
|
8
|
+
} from "opticore-catch-exception-error";
|
|
6
9
|
|
|
7
10
|
/**
|
|
8
11
|
*
|
|
9
12
|
*/
|
|
10
13
|
export function eventProcessHandler(): void {
|
|
11
14
|
const errorEmitter = new EventEmitter();
|
|
12
|
-
const app
|
|
15
|
+
const app = express();
|
|
13
16
|
|
|
14
17
|
/**
|
|
15
18
|
* Listener for error events
|
|
@@ -100,7 +103,7 @@ export function eventProcessHandler(): void {
|
|
|
100
103
|
/**
|
|
101
104
|
* Express error-handling middleware
|
|
102
105
|
*/
|
|
103
|
-
app.use((err: Error, req:
|
|
106
|
+
app.use((err: Error, req: Request, res: Response, next: NextFunction): void => {
|
|
104
107
|
ServerListenEventError.expressErrorHandlingMiddleware(errorEmitter, err, req, res, next);
|
|
105
108
|
});
|
|
106
109
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import {dateTimeFormattedUtils} from "
|
|
1
|
+
import colors from "ansi-colors";
|
|
2
|
+
import {dateTimeFormattedUtils} from "@webApp/core/helpers/dateTimeFormatted.utils";
|
|
3
3
|
|
|
4
4
|
export class LogMessageUtils {
|
|
5
5
|
static success(title: string, action: string, contentAction: string): void {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import colors from "ansi-colors";
|
|
2
|
+
import { Router } from "opticore-express";
|
|
3
|
+
import { LogMessageUtils } from "@webApp/core/helpers/logMessage.utils";
|
|
4
|
+
import { dateTimeFormattedUtils } from "@webApp/core/helpers/dateTimeFormatted.utils";
|
|
5
|
+
import {CLocal, TranslationLoader} from "opticore-translator";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export function modulesLoadedUtils(allAppRoutes: Router[], dbConChecker: () => void): void {
|
|
10
|
+
LogMessageUtils.success(
|
|
11
|
+
`${TranslationLoader.t("kernel", CLocal)}`,
|
|
12
|
+
`${TranslationLoader.t("loadKernel", CLocal)}`,
|
|
13
|
+
`${TranslationLoader.t("moduleAppLoaded", CLocal)}`
|
|
14
|
+
);
|
|
15
|
+
console.log(`${colors.whiteBright(` ${TranslationLoader.t("content", CLocal)}`)} ${colors.green(`${TranslationLoader.t("kernel", CLocal)} :`)} ${colors.cyan(`${colors.bold(`${TranslationLoader.t("serverSide", CLocal)}`)}`)} ${TranslationLoader.t("hasBeenLoadedSuccessfully", CLocal)} ${colors.green(`✔`)}`);
|
|
16
|
+
allAppRoutes
|
|
17
|
+
? console.log(`${colors.whiteBright(` ${TranslationLoader.t("content", CLocal)}`)} ${colors.green(`${TranslationLoader.t("kernel", CLocal)} :`)} ${colors.cyan(`${colors.bold(`${TranslationLoader.t("routerService", CLocal)}`)} `)} ${colors.green(`✔`)}`)
|
|
18
|
+
: console.log(`${colors.red(`✘`)} ${colors.bgRed(` ${colors.bold(`${colors.white(` ${TranslationLoader.t("registerRoutes", CLocal)} `)}`)} `)} | ${dateTimeFormattedUtils} | [ ${colors.red(`${colors.bold(` ${TranslationLoader.t("fail", CLocal)} `)}`)} ] | [ ${colors.bold(` ${TranslationLoader.t("loading", CLocal)} `)} ] - ${colors.red(` ${TranslationLoader.t("routers", CLocal)} `)} - ${TranslationLoader.t("registerLoadingFailed", CLocal)} `);
|
|
19
|
+
typeof dbConChecker == "function"
|
|
20
|
+
? console.log(`${colors.whiteBright(` ${TranslationLoader.t("content", CLocal)}`)} ${colors.green(`${TranslationLoader.t("kernel", CLocal)} :`)} ${colors.cyan(`${colors.bold(`${TranslationLoader.t("dbConnChecker", CLocal)}`)}`)} ${TranslationLoader.t("hasBeenLoadedSuccessfully", CLocal)} ${colors.green(`✔`)}`)
|
|
21
|
+
: "";
|
|
22
|
+
}
|
|
@@ -1,28 +1,34 @@
|
|
|
1
|
-
import {Server as serverWebApp} from "http";
|
|
2
|
-
import {IncomingMessage, ServerResponse} from "node:http";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {requestCallsEvent} from "
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
1
|
+
import { Server as serverWebApp } from "http";
|
|
2
|
+
import { IncomingMessage, ServerResponse } from "node:http";
|
|
3
|
+
import corsOrigin, { CorsOptions } from "cors";
|
|
4
|
+
import {
|
|
5
|
+
CEventNameError as eventName,
|
|
6
|
+
StackTraceError,
|
|
7
|
+
ServerListenEventError as eventErrorOnListeningServer
|
|
8
|
+
} from "opticore-catch-exception-error";
|
|
9
|
+
import { Application, express, Express } from "opticore-express";
|
|
10
|
+
import { getEnvVariable } from "opticore-env-access";
|
|
11
|
+
import { requestCallsEvent } from "opticore-requests-called-events";
|
|
12
|
+
import { HttpStatusCode } from "opticore-http-response";
|
|
13
|
+
|
|
14
|
+
import { IRouteDefinition } from "@webApp/domains/interfaces/routeDefinition.interface";
|
|
15
|
+
import { KernelModuleType } from "@webApp/domains/types/kernelModule.type";
|
|
16
|
+
import { eventProcessHandler } from "@webApp/core/handlers/eventProcess.handler";
|
|
17
|
+
import { CoreService } from "@webApp/application/service/core.service";
|
|
18
|
+
import { dateTimeFormattedUtils as currentDate } from "@webApp/core/helpers/dateTimeFormatted.utils";
|
|
19
|
+
import {TranslationLoader} from "opticore-translator";
|
|
20
|
+
import * as path from "path";
|
|
21
|
+
import process from "node:process";
|
|
16
22
|
|
|
17
23
|
|
|
18
24
|
export class WebServerCore {
|
|
19
25
|
private serverUtility: CoreService = new CoreService();
|
|
20
|
-
private expressApp
|
|
21
|
-
private readonly routerExpressApp:
|
|
26
|
+
private expressApp = express();
|
|
27
|
+
private readonly routerExpressApp: Application;
|
|
22
28
|
private readonly port: number;
|
|
23
29
|
private readonly host: string;
|
|
24
30
|
|
|
25
|
-
constructor(app:
|
|
31
|
+
constructor(app: Application, corsOriginOptions?: Partial<CorsOptions>) {
|
|
26
32
|
this.port = Number(getEnvVariable.appPort);
|
|
27
33
|
this.host = getEnvVariable.appHost;
|
|
28
34
|
this.routerExpressApp = app;
|
|
@@ -34,6 +40,7 @@ export class WebServerCore {
|
|
|
34
40
|
this.expressApp.use(corsOrigin(corsOriginOptions));
|
|
35
41
|
|
|
36
42
|
this.stackTraceErrorHandling();
|
|
43
|
+
this.translationWebAppLoader();
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
public onStartServer(routers: { featureRoute: IRouteDefinition[] }[]) {
|
|
@@ -52,7 +59,7 @@ export class WebServerCore {
|
|
|
52
59
|
this.registerRoutes(routers);
|
|
53
60
|
}
|
|
54
61
|
} catch (err: any) {
|
|
55
|
-
this.traceError(err.message, "Error",
|
|
62
|
+
this.traceError(err.message, "Error", HttpStatusCode.NOT_ACCEPTABLE);
|
|
56
63
|
}
|
|
57
64
|
}
|
|
58
65
|
);
|
|
@@ -77,11 +84,9 @@ export class WebServerCore {
|
|
|
77
84
|
});
|
|
78
85
|
}
|
|
79
86
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return [registerRouter, dbConnection] as KernelModuleType
|
|
87
|
+
private translationWebAppLoader(): void {
|
|
88
|
+
TranslationLoader.loadTranslations(path.join(process.cwd(), 'src', 'utils', 'translations'), getEnvVariable.defaultLocal);
|
|
83
89
|
}
|
|
84
|
-
|
|
85
90
|
private registerRoutes(allFeatureRoutes: { featureRoute: IRouteDefinition[] }[]): void {
|
|
86
91
|
allFeatureRoutes.map((router: {featureRoute: IRouteDefinition[]} ): void => {
|
|
87
92
|
router.featureRoute.map((route: IRouteDefinition): void => {
|
package/src/index.ts
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { WebServerCore as WebServer } from "@webApp/core/webServer.core";
|
|
2
|
-
|
|
3
|
-
import { CErrorName as errorName } from "@webApp/domains/constants/errorName.constant";
|
|
4
|
-
import { CEvent as event } from "@webApp/domains/constants/event.constant";
|
|
5
|
-
import { CEventNameError as eventName } from "@webApp/domains/constants/eventNameError.constant";
|
|
2
|
+
|
|
6
3
|
|
|
7
4
|
import { type IRouteDefinition } from "@webApp/domains/interfaces/routeDefinition.interface";
|
|
8
5
|
import { type KernelModuleType } from "@webApp/domains/types/kernelModule.type";
|
|
9
6
|
|
|
10
7
|
export {
|
|
11
|
-
errorName,
|
|
12
|
-
eventName,
|
|
13
|
-
event,
|
|
14
|
-
getEnvVariable,
|
|
15
8
|
IRouteDefinition,
|
|
16
9
|
KernelModuleType,
|
|
17
10
|
WebServer,
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dbConnection": "DataBase connection",
|
|
3
|
+
"dbConnectionClosed": "MySQL connection is closed",
|
|
4
|
+
"mysqlErrorCon": "MysqlError connection",
|
|
5
|
+
"mySQLError": "MysqlError",
|
|
6
|
+
"mySqlCloseConnection": "MySql close connection",
|
|
7
|
+
"verifyExistingKey": "Verify Existing Key",
|
|
8
|
+
"invalidRequest": "Invalid request",
|
|
9
|
+
"tokenNotProvided": "No token provided.",
|
|
10
|
+
"ExpiresToken": "Expires Token. You're not authorize",
|
|
11
|
+
"privateKeyNotExist": "A private key doesn't exist.",
|
|
12
|
+
"publicKeyNotExist": "A public key doesn't exist.",
|
|
13
|
+
"errorNamePublicKeyNotExist": "No public key",
|
|
14
|
+
"errorAuthorPublicKeyNotExist": "PublicKey not existing",
|
|
15
|
+
"errorDecryption": "Error decryption with private key",
|
|
16
|
+
"rsaKeyNotFound": "RSA key provided is not found.",
|
|
17
|
+
"notVerifyingRSAKey": "Not verify RSA Key",
|
|
18
|
+
"errorNameNotVerifyingRSAKey": "Error Verify RSA Key",
|
|
19
|
+
"errorEncryptionPublicKey": "Error encryption with public key",
|
|
20
|
+
"errorEncryptionPrivateKey": "Error encryption with private key",
|
|
21
|
+
"errorNameRsaVerifyExistingKey": "Verify existing key",
|
|
22
|
+
"signatureRSAKeyFailed": "Signature verification failed.",
|
|
23
|
+
"encryptionWithPrivateKeyFailed": "Encryption With PrivateKey",
|
|
24
|
+
"encryptionFailed": "Encryption failed",
|
|
25
|
+
"decryptionWithPublicKeyFailed": "Decryption With PublicKey",
|
|
26
|
+
"decryptionFailed": "Decryption failed",
|
|
27
|
+
"verifyRSAKey": "Verify RSA Keys",
|
|
28
|
+
"verifyRSAKeyFailed": "Verify RSA Keys Failed",
|
|
29
|
+
"notVerifying": "Verification failed",
|
|
30
|
+
"signatureRSAKeysError": "Signature RSA Keys Error",
|
|
31
|
+
"encryptionWithPublicKey": "Encryption error",
|
|
32
|
+
"errorDecryptionWithPrivateKey": "Error Decryption With PrivateKey",
|
|
33
|
+
"verifyPublicRSAKey": "Verify Public RSA Key",
|
|
34
|
+
"PostgresDBConnectionChecker": "PostgresDB Connection Checker",
|
|
35
|
+
"PostgresConnection": "connection",
|
|
36
|
+
"MongoDBConnectionChecker": "MongoDB Connection Checker",
|
|
37
|
+
"MongoConnection": "connection",
|
|
38
|
+
"mongoDBAuthentication": "authentication",
|
|
39
|
+
"mongoDBConnection": "MongoDB connection",
|
|
40
|
+
"mongoDBAuthenticationFailed": "failed",
|
|
41
|
+
"mongoDBUnableParsingUrl": "unable to parse",
|
|
42
|
+
"mongoDBConnectionUrl": "url",
|
|
43
|
+
"mongoDBServerSelection": "MongoServer selection error",
|
|
44
|
+
"mongoDBServer": "MongoServer",
|
|
45
|
+
"mongoDBConnectionError": "connection error",
|
|
46
|
+
"mongoDBError": "error",
|
|
47
|
+
"loadedModules": "Loading core modules",
|
|
48
|
+
"kernel": "Kernel",
|
|
49
|
+
"loadKernel": "load kernel",
|
|
50
|
+
"moduleAppLoaded": "Modules app have been successfully loaded",
|
|
51
|
+
"content": "content",
|
|
52
|
+
"serverSide": "server side",
|
|
53
|
+
"hasBeenLoadedSuccessfully": "has been loaded successfully",
|
|
54
|
+
"routerService": "Routers service",
|
|
55
|
+
"registerRoutes": "Register routes",
|
|
56
|
+
"fail": "fail",
|
|
57
|
+
"loading": "loading",
|
|
58
|
+
"routers": "routers",
|
|
59
|
+
"registerLoadingFailed": "The route register failed to load",
|
|
60
|
+
"dbConnChecker": "database checker connection",
|
|
61
|
+
"loadedModulesError": "Required core modules are not loaded properly",
|
|
62
|
+
"dbConnexionSuccess": "The database connection was successful 🚀",
|
|
63
|
+
"mongoConnectionSuccess": "Connection to database is successfully.",
|
|
64
|
+
"PostgresConnectionSuccess": "Connection to database is successfully.",
|
|
65
|
+
"verifyExistingKeyError": "The provided key is not found",
|
|
66
|
+
"webServer": "Web server",
|
|
67
|
+
"listening": "listening",
|
|
68
|
+
"webHost": "host",
|
|
69
|
+
"badHost": "bad host",
|
|
70
|
+
"hostNotFound": "not found",
|
|
71
|
+
"errorHostUrl": "The host and port are not define, please define them in .env",
|
|
72
|
+
"badPort": "bad port",
|
|
73
|
+
"errorPort": "The port is not correct. Please define a right port with number port.",
|
|
74
|
+
"errorHost": "The host can't be empty or blank. Please define a string host in .env",
|
|
75
|
+
"accessDeniedToDBCon": "Access denied for user {user}. Database credentials in .env file are User: {user} and Password: {password}. {user}''{password}'@'localhost'. Try to set user and password in .env file",
|
|
76
|
+
"unknownDB": "Database {database} is unknown. Please try to use Database CLI to create your database, or do it manually in your Database Management System",
|
|
77
|
+
"errorDBHost": "A database host ${host} does not allow connection. Please either set the host like this: {localhost} in your .env file"
|
|
78
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dbConnection": "DataBase connection",
|
|
3
|
+
"dbConnectionClosed": "MySQL connection is closed",
|
|
4
|
+
"mysqlErrorCon": "MysqlError connection",
|
|
5
|
+
"mySQLError": "MysqlError",
|
|
6
|
+
"mySqlCloseConnection": "MySql close connection",
|
|
7
|
+
"verifyExistingKey": "Verify Existing Key",
|
|
8
|
+
"invalidRequest": "Invalid request",
|
|
9
|
+
"tokenNotProvided": "No token provided.",
|
|
10
|
+
"ExpiresToken": "Expires Token. You're not authorize",
|
|
11
|
+
"privateKeyNotExist": "A private key doesn't exist.",
|
|
12
|
+
"publicKeyNotExist": "A public key doesn't exist.",
|
|
13
|
+
"errorNamePublicKeyNotExist": "No public key",
|
|
14
|
+
"errorAuthorPublicKeyNotExist": "PublicKey not existing",
|
|
15
|
+
"errorDecryption": "Error decryption with private key",
|
|
16
|
+
"rsaKeyNotFound": "RSA key provided is not found.",
|
|
17
|
+
"notVerifyingRSAKey": "Not verify RSA Key",
|
|
18
|
+
"errorNameNotVerifyingRSAKey": "Error Verify RSA Key",
|
|
19
|
+
"errorEncryptionPublicKey": "Error encryption with public key",
|
|
20
|
+
"errorEncryptionPrivateKey": "Error encryption with private key",
|
|
21
|
+
"errorNameRsaVerifyExistingKey": "Verify existing key",
|
|
22
|
+
"signatureRSAKeyFailed": "Signature verification failed.",
|
|
23
|
+
"encryptionWithPrivateKeyFailed": "Encryption With PrivateKey",
|
|
24
|
+
"encryptionFailed": "Encryption failed",
|
|
25
|
+
"decryptionWithPublicKeyFailed": "Decryption With PublicKey",
|
|
26
|
+
"decryptionFailed": "Decryption failed",
|
|
27
|
+
"verifyRSAKey": "Verify RSA Keys",
|
|
28
|
+
"verifyRSAKeyFailed": "Verify RSA Keys Failed",
|
|
29
|
+
"notVerifying": "Verification failed",
|
|
30
|
+
"signatureRSAKeysError": "Signature RSA Keys Error",
|
|
31
|
+
"encryptionWithPublicKey": "Encryption error",
|
|
32
|
+
"errorDecryptionWithPrivateKey": "Error Decryption With PrivateKey",
|
|
33
|
+
"verifyPublicRSAKey": "Verify Public RSA Key",
|
|
34
|
+
"PostgresDBConnectionChecker": "PostgresDB Connection Checker",
|
|
35
|
+
"PostgresConnection": "connection",
|
|
36
|
+
"MongoDBConnectionChecker": "MongoDB Connection Checker",
|
|
37
|
+
"MongoConnection": "connection",
|
|
38
|
+
"mongoDBAuthentication": "authentication",
|
|
39
|
+
"mongoDBConnection": "MongoDB connection",
|
|
40
|
+
"mongoDBAuthenticationFailed": "failed",
|
|
41
|
+
"mongoDBUnableParsingUrl": "unable to parse",
|
|
42
|
+
"mongoDBConnectionUrl": "url",
|
|
43
|
+
"mongoDBServerSelection": "MongoServer selection error",
|
|
44
|
+
"mongoDBServer": "MongoServer",
|
|
45
|
+
"mongoDBConnectionError": "connection error",
|
|
46
|
+
"mongoDBError": "error",
|
|
47
|
+
"loadedModules": "Loading core modules",
|
|
48
|
+
"kernel": "Kernel",
|
|
49
|
+
"loadKernel": "load kernel",
|
|
50
|
+
"moduleAppLoaded": "Modules app have been successfully loaded",
|
|
51
|
+
"content": "content",
|
|
52
|
+
"serverSide": "server side",
|
|
53
|
+
"hasBeenLoadedSuccessfully": "has been loaded successfully",
|
|
54
|
+
"routerService": "Routers service",
|
|
55
|
+
"registerRoutes": "Register routes",
|
|
56
|
+
"fail": "fail",
|
|
57
|
+
"loading": "loading",
|
|
58
|
+
"routers": "routers",
|
|
59
|
+
"registerLoadingFailed": "The route register failed to load",
|
|
60
|
+
"dbConnChecker": "database checker connection",
|
|
61
|
+
"loadedModulesError": "Required core modules are not loaded properly",
|
|
62
|
+
"dbConnexionSuccess": "The database connection was successful 🚀",
|
|
63
|
+
"mongoConnectionSuccess": "Connection to database is successfully.",
|
|
64
|
+
"PostgresConnectionSuccess": "Connection to database is successfully.",
|
|
65
|
+
"verifyExistingKeyError": "The provided key is not found",
|
|
66
|
+
"webServer": "Web server",
|
|
67
|
+
"listening": "listening",
|
|
68
|
+
"webHost": "host",
|
|
69
|
+
"badHost": "bad host",
|
|
70
|
+
"hostNotFound": "not found",
|
|
71
|
+
"errorHostUrl": "The host and port are not define, please define them in .env",
|
|
72
|
+
"badPort": "bad port",
|
|
73
|
+
"errorPort": "The port is not correct. Please define a right port with number port.",
|
|
74
|
+
"errorHost": "The host can't be empty or blank. Please define a string host in .env",
|
|
75
|
+
"accessDeniedToDBCon": "Access denied for user {user}. Database credentials in .env file are User: {user} and Password: {password}. {user}''{password}'@'localhost'. Try to set user and password in .env file",
|
|
76
|
+
"unknownDB": "Database {database} is unknown. Please try to use Database CLI to create your database, or do it manually in your Database Management System",
|
|
77
|
+
"errorDBHost": "A database host ${host} does not allow connection. Please either set the host like this: {localhost} in your .env file"
|
|
78
|
+
}
|
package/tsup.config.ts
CHANGED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import colors from "ansi-colors";
|
|
2
|
-
|
|
3
|
-
export const messageException = {
|
|
4
|
-
dbConnection: "DataBase connection",
|
|
5
|
-
dbConnectionClosed: "MySQL connection is closed",
|
|
6
|
-
mysqlErrorCon: "MysqlError connection",
|
|
7
|
-
mySQLError: "MysqlError",
|
|
8
|
-
mySqlCloseConnection: "MySql close connection",
|
|
9
|
-
verifyExistingKey: "Verify Existing Key",
|
|
10
|
-
invalidRequest: "Invalid request",
|
|
11
|
-
tokenNotProvided: "No token provided.",
|
|
12
|
-
ExpiresToken: "Expires Token. You're not authorize",
|
|
13
|
-
privateKeyNotExist: "A private key doesn't exist.",
|
|
14
|
-
publicKeyNotExist: "A public key doesn't exist.",
|
|
15
|
-
errorNamePublicKeyNotExist: "No public key",
|
|
16
|
-
errorAuthorPublicKeyNotExist: "PublicKey not existing",
|
|
17
|
-
errorDecryption: "Error decryption with private key",
|
|
18
|
-
rsaKeyNotFound: "RSA key provided is not found.",
|
|
19
|
-
notVerifyingRSAKey: "Not verify RSA Key",
|
|
20
|
-
errorNameNotVerifyingRSAKey: "Error Verify RSA Key",
|
|
21
|
-
errorEncryptionPublicKey: "Error encryption with public key",
|
|
22
|
-
errorEncryptionPrivateKey: "Error encryption with private key",
|
|
23
|
-
errorNameRsaVerifyExistingKey: "Verify existing key",
|
|
24
|
-
signatureRSAKeyFailed: "Signature verification failed.",
|
|
25
|
-
encryptionWithPrivateKeyFailed: "Encryption With PrivateKey",
|
|
26
|
-
encryptionFailed: "Encryption failed",
|
|
27
|
-
decryptionWithPublicKeyFailed: "Decryption With PublicKey",
|
|
28
|
-
decryptionFailed: "Decryption failed",
|
|
29
|
-
verifyRSAKey: "Verify RSA Keys",
|
|
30
|
-
verifyRSAKeyFailed: "Verify RSA Keys Failed",
|
|
31
|
-
notVerifying: "Verification failed",
|
|
32
|
-
signatureRSAKeysError: "Signature RSA Keys Error",
|
|
33
|
-
encryptionWithPublicKey: "Encryption error",
|
|
34
|
-
errorDecryptionWithPrivateKey: "Error Decryption With PrivateKey",
|
|
35
|
-
verifyPublicRSAKey: "Verify Public RSA Key",
|
|
36
|
-
PostgresDBConnectionChecker: "PostgresDB Connection Checker",
|
|
37
|
-
PostgresConnection: "connection",
|
|
38
|
-
MongoDBConnectionChecker: "MongoDB Connection Checker",
|
|
39
|
-
MongoConnection: "connection",
|
|
40
|
-
mongoDBAuthentication: "authentication",
|
|
41
|
-
mongoDBConnection: "MongoDB connection",
|
|
42
|
-
mongoDBAuthenticationFailed: "failed",
|
|
43
|
-
mongoDBUnableParsingUrl: "unable to parse",
|
|
44
|
-
mongoDBConnectionUrl: "url",
|
|
45
|
-
mongoDBServerSelection: "MongoServer selection error",
|
|
46
|
-
mongoDBServer: "MongoServer",
|
|
47
|
-
mongoDBConnectionError: "connection error",
|
|
48
|
-
mongoDBError: "error",
|
|
49
|
-
loadedModules: "Loading core modules",
|
|
50
|
-
loadedModulesError: "Required core modules are not loaded properly",
|
|
51
|
-
dbConnexionSuccess: "The database connection was successful 🚀",
|
|
52
|
-
mongoConnectionSuccess: "Connection to database is successfully.",
|
|
53
|
-
PostgresConnectionSuccess: "Connection to database is successfully.",
|
|
54
|
-
verifyExistingKeyError: "The provided key is not found",
|
|
55
|
-
webServer: "Web server",
|
|
56
|
-
listening: "listening",
|
|
57
|
-
webHost: "host",
|
|
58
|
-
badHost: "bad host",
|
|
59
|
-
hostNotFound: "not found",
|
|
60
|
-
errorHostUrl: "The host and port are not define, please define them in .env",
|
|
61
|
-
badPort: "bad port",
|
|
62
|
-
errorPort: "The port is not correct. Please define a right port with number port.",
|
|
63
|
-
errorHost: "The host can't be empty or blank. Please define a string host in .env",
|
|
64
|
-
accessDeniedToDBCon: (user: string, password: string): string => `Access denied for user ${user}. Database credentials in .env file are User: ${user} and Password: ${password}. '${user}''${password}'@'localhost'. Try to set user and password in .env file`,
|
|
65
|
-
unknownDB: (database: string): string => `Database ${database} is unknown. Please try to use Database CLI to create your database, or do it manually in your Database Management System`,
|
|
66
|
-
errorDBHost: (host: string): string => `A database host ${host} does not allow connection. Please either set the host like this: ${colors.bgRed(`${colors.white(`localhost`)}`)} in your .env file`
|
|
67
|
-
}
|