opticore-webapp 1.0.19 → 1.0.21

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.js CHANGED
@@ -1,5 +1,6 @@
1
1
  // src/core/webServer.core.ts
2
2
  import * as path2 from "path";
3
+ import process3 from "node:process";
3
4
  import { createRequire } from "module";
4
5
  import corsOrigin from "cors";
5
6
  import {
@@ -12,7 +13,7 @@ import {
12
13
  SystemErrors
13
14
  } from "opticore-catch-exception-error";
14
15
  import { express as express2 } from "opticore-express";
15
- import { getEnvironnementValue } from "opticore-env-access";
16
+ import { getEnvironnementValue as getEnvironnementValue3 } from "opticore-env-access";
16
17
  import { TranslationLoader as TranslationLoader4 } from "opticore-translator";
17
18
 
18
19
  // src/core/handlers/eventProcess.handler.ts
@@ -81,7 +82,9 @@ import * as path from "path";
81
82
  import * as fs from "fs";
82
83
  import colors3 from "ansi-colors";
83
84
  import { HttpStatusCode as status } from "opticore-http-response";
84
- import { StackTraceError } from "opticore-catch-exception-error";
85
+ import { TranslationLoader as TranslationLoader2 } from "opticore-translator";
86
+ import { getEnvironnementValue as getEnvironnementValue2 } from "opticore-env-access";
87
+ import { LoggerCore } from "opticore-logger";
85
88
 
86
89
  // src/core/helpers/modulesLoaded.utils.ts
87
90
  import colors2 from "ansi-colors";
@@ -124,9 +127,51 @@ function modulesLoadedUtils(allAppRoutes, dbConChecker, localeLanguage) {
124
127
  typeof dbConChecker == "function" ? console.log(`${colors2.whiteBright(` ${TranslationLoader.t("content", localeLanguage)}`)} ${colors2.green(`${TranslationLoader.t("kernel", localeLanguage)} :`)} ${colors2.cyan(`${colors2.bold(`${TranslationLoader.t("dbConnChecker", localeLanguage)}`)}`)} ${TranslationLoader.t("hasBeenLoadedSuccessfully", localeLanguage)} ${colors2.green(`\u2714`)}`) : "";
125
128
  }
126
129
 
130
+ // src/application/service/traceError.service.ts
131
+ import { StackTraceError } from "opticore-catch-exception-error";
132
+ var STraceError = (props, name, httpCode, isOperational) => {
133
+ return new StackTraceError(props, name, httpCode, isOperational);
134
+ };
135
+
136
+ // src/core/config/logger/logger.config.ts
137
+ import { getEnvironnementValue } from "opticore-env-access";
138
+ var loggerConfig = (envDir) => {
139
+ const getEnvAccess = getEnvironnementValue(envDir);
140
+ return {
141
+ logLevels: [
142
+ getEnvAccess.logLevelInfo,
143
+ getEnvAccess.logLevelWarning,
144
+ getEnvAccess.logLevelSuccess,
145
+ getEnvAccess.logLevelError,
146
+ getEnvAccess.logLevelDebug
147
+ ],
148
+ transports: {
149
+ file: {
150
+ enabled: getEnvAccess.logFileEnabled,
151
+ maxSizeMB: getEnvAccess.logFileMaxSize,
152
+ rotate: getEnvAccess.logFileRotate
153
+ },
154
+ console: {
155
+ enabled: getEnvAccess.logConsoleEnabled
156
+ },
157
+ remote: {
158
+ enabled: getEnvAccess.logRemoteEnabled,
159
+ endpoint: getEnvAccess.logRemoteEndPoint
160
+ }
161
+ }
162
+ };
163
+ };
164
+
127
165
  // src/application/service/core.service.ts
128
- import { TranslationLoader as TranslationLoader2 } from "opticore-translator";
129
166
  var CoreService = class {
167
+ loggerConfig;
168
+ localLanguage;
169
+ environnementPath;
170
+ constructor(localLang, environnementPath) {
171
+ this.loggerConfig = new LoggerCore(loggerConfig(environnementPath));
172
+ this.environnementPath = environnementPath;
173
+ this.localLanguage = localLang;
174
+ }
130
175
  /**
131
176
  *
132
177
  * @param data
@@ -162,20 +207,20 @@ var CoreService = class {
162
207
  getUsageMemory() {
163
208
  const memoryData = process2.memoryUsage();
164
209
  const data = {
165
- "Resident Set Size - total memory allocated for the process execution": this.formatMemoryUsage(memoryData.rss),
166
- "Total size of the allocated heap": this.formatMemoryUsage(memoryData.heapTotal),
167
- "Actual memory used during the execution": this.formatMemoryUsage(memoryData.heapUsed),
168
- "V8 external memory": this.formatMemoryUsage(memoryData.external),
169
- "Memory usage user": this.formatMemoryUsage(process2.cpuUsage().user),
170
- "Memory usage system": this.formatMemoryUsage(process2.cpuUsage().system)
210
+ [`${TranslationLoader2.t("totalMemoryAllocated", this.localLanguage)}}`]: this.formatMemoryUsage(memoryData.rss),
211
+ [`${TranslationLoader2.t("sizeAllocatedHeap", this.localLanguage)}`]: this.formatMemoryUsage(memoryData.heapTotal),
212
+ [`${TranslationLoader2.t("memoryUsedExecution", this.localLanguage)}`]: this.formatMemoryUsage(memoryData.heapUsed),
213
+ [`${TranslationLoader2.t("externalMemory", this.localLanguage)}`]: this.formatMemoryUsage(memoryData.external),
214
+ [`${TranslationLoader2.t("memoryUsageUser", this.localLanguage)}`]: this.formatMemoryUsage(process2.cpuUsage().user),
215
+ [`${TranslationLoader2.t("memoryUsageSystem", this.localLanguage)}`]: this.formatMemoryUsage(process2.cpuUsage().system)
171
216
  };
172
217
  return {
173
- "rss": data["Resident Set Size - total memory allocated for the process execution"],
174
- "heapTotal": data["Total size of the allocated heap"],
175
- "heapUsed": data["Actual memory used during the execution"],
176
- "external": data["V8 external memory"],
177
- "user": data["Memory usage user"],
178
- "system": data["Memory usage system"]
218
+ "rss": data[`${TranslationLoader2.t("totalMemoryAllocated", this.localLanguage)}}`],
219
+ "heapTotal": data[`${TranslationLoader2.t("sizeAllocatedHeap", this.localLanguage)}`],
220
+ "heapUsed": data[`${TranslationLoader2.t("memoryUsedExecution", this.localLanguage)}`],
221
+ "external": data[`${TranslationLoader2.t("externalMemory", this.localLanguage)}`],
222
+ "user": data[`${TranslationLoader2.t("memoryUsageUser", this.localLanguage)}`],
223
+ "system": data[`${TranslationLoader2.t("memoryUsageSystem", this.localLanguage)}`]
179
224
  };
180
225
  }
181
226
  /**
@@ -218,21 +263,22 @@ var CoreService = class {
218
263
  this.getEnvFileLoading(".env");
219
264
  const isDevelopment = process2.env.NODE_ENV === "development";
220
265
  if (isDevelopment) {
221
- return `The server is running in ${colors3.bgBlue(`${colors3.bold(`${development}`)}`)} mode`;
266
+ return `${TranslationLoader2.t("serverRunning", this.localLanguage)} ${colors3.bgBlue(`${colors3.bold(`${development}`)}`)} mode`;
222
267
  } else {
223
- return `The server is running in ${colors3.bgBlue(`${colors3.bold(`${production}`)}`)} mode`;
268
+ return `${TranslationLoader2.t("serverRunning", this.localLanguage)} ${colors3.bgBlue(`${colors3.bold(`${production}`)}`)} mode`;
224
269
  }
225
270
  }
226
- infoServer(nodeVersion, startingTime, host, port, rss, heapUsed, user, system) {
271
+ infoServer(nodeVersion, startingTime, host, port) {
227
272
  const paddingLength = 52;
273
+ const getEnvironnement = getEnvironnementValue2(this.environnementPath);
228
274
  const msg0 = " ".padEnd(paddingLength, " ");
229
- const msg1 = " [OK] Web server listening";
275
+ const msg1 = ` ${TranslationLoader2.t("webServerListening", this.localLanguage)}`;
230
276
  const msg2Value = `${colors3.bgBlue(`${colors3.bold(`${nodeVersion}`)}`)}`;
231
- const msg2 = ` The Web server is using Node.js version`;
277
+ const msg2 = ` ${TranslationLoader2.t("webServerUsingNodeVersion", this.localLanguage)}`;
232
278
  const msg3Value = `${colors3.bgBlue(`${colors3.bold(`${startingTime}`)}`)}`;
233
- const msg3 = ` Startup time:`;
234
- const msg4 = ` ${this.getServerRunningMode("development", "production")}`;
235
- const msg5 = ` ${colors3.underline(`http://${host}:${port}`)}`;
279
+ const msg3 = ` ${TranslationLoader2.t("startTime", this.localLanguage)}`;
280
+ const msg4 = ` ${this.getServerRunningMode(`${TranslationLoader2.t("runningModeDev", this.localLanguage)}`, `${TranslationLoader2.t("runningModeProd", this.localLanguage)}`)}`;
281
+ const msg5 = ` ${colors3.underline(`${getEnvironnement.protocolTransfert}://${host}:${port}`)}`;
236
282
  console.log(chalk.bgGreen.white(msg0.padEnd(paddingLength, " ")));
237
283
  console.log(chalk.bgGreen.white(msg1.padEnd(paddingLength, " ")));
238
284
  console.log(chalk.bgGreen.white(msg2, msg2Value.padEnd(30.5, " ")));
@@ -241,13 +287,8 @@ var CoreService = class {
241
287
  console.log(chalk.bgGreen.white(msg5.padEnd(61, " ")));
242
288
  console.log(chalk.bgGreen.white(msg0.padEnd(paddingLength, " ")));
243
289
  console.log(``);
244
- console.log(`${`Resident Set Size - total memory allocated for the process execution :`} ${colors3.cyan(`${colors3.bold(`${rss}`)}`)}`);
245
- console.log(`${`Actual memory used during the execution :`} ${colors3.cyan(`${colors3.bold(`${heapUsed}`)}`)}`);
246
- console.log(`${`Memory usage by user :`} ${colors3.cyan(`${colors3.bold(`${user}`)}`)}`);
247
- console.log(`${`Memory usage by system :`} ${colors3.cyan(`${colors3.bold(`${system}`)}`)}`);
248
- console.log(``);
249
290
  }
250
- coreListenerEventLoaderModuleService(kernelModule, localeLanguage, loggerConfig) {
291
+ coreListenerEventLoaderModuleService(kernelModule) {
251
292
  let router = [];
252
293
  let dbCon;
253
294
  kernelModule.forEach((module) => {
@@ -258,14 +299,14 @@ var CoreService = class {
258
299
  }
259
300
  });
260
301
  if (router && dbCon) {
261
- modulesLoadedUtils(router, dbCon);
302
+ modulesLoadedUtils(router, dbCon, this.localLanguage);
262
303
  (() => {
263
304
  dbCon();
264
305
  })();
265
306
  } else {
266
- const stackTrace = new StackTraceError(
267
- TranslationLoader2.t("loadedModulesError", localeLanguage, loggerConfig),
268
- TranslationLoader2.t("loadedModules", localeLanguage, loggerConfig),
307
+ const stackTrace = STraceError(
308
+ TranslationLoader2.t("loadedModulesError", this.localLanguage),
309
+ TranslationLoader2.t("loadedModules", this.localLanguage),
269
310
  status.NOT_ACCEPTABLE,
270
311
  true
271
312
  );
@@ -279,110 +320,115 @@ import assert from "assert";
279
320
  import { CErrorName } from "opticore-catch-exception-error";
280
321
  import { HttpStatusCode } from "opticore-http-response";
281
322
  import { TranslationLoader as TranslationLoader3 } from "opticore-translator";
282
- var SServerStartError = (err) => {
323
+ var SServerStartError = (err, javaScriptErrors, systemErrors, openSSLErrors, internalErrors, logger, localLanguage) => {
283
324
  switch (err.name) {
284
325
  case CErrorName.typeError:
285
- (void 0).javaScriptErrors.typeError(err);
326
+ javaScriptErrors.typeError(err);
286
327
  break;
287
328
  case CErrorName.error:
288
- (void 0).javaScriptErrors.allError(err);
329
+ javaScriptErrors.allError(err);
289
330
  break;
290
331
  case CErrorName.evalError:
291
- (void 0).javaScriptErrors.evalError(err);
332
+ javaScriptErrors.evalError(err);
292
333
  break;
293
334
  case CErrorName.referenceError:
294
- (void 0).javaScriptErrors.referenceError(err);
335
+ javaScriptErrors.referenceError(err);
295
336
  break;
296
337
  case CErrorName.rangeError:
297
- (void 0).javaScriptErrors.rangeError(err);
338
+ javaScriptErrors.rangeError(err);
298
339
  break;
299
340
  case CErrorName.syntaxError:
300
- (void 0).javaScriptErrors.syntaxError(err);
341
+ javaScriptErrors.syntaxError(err);
301
342
  break;
302
343
  case CErrorName.uriError:
303
- (void 0).javaScriptErrors.uRIError(err);
344
+ javaScriptErrors.uRIError(err);
304
345
  break;
305
346
  case CErrorName.eacces:
306
- (void 0).systemErrors.eAcces(err);
347
+ systemErrors.eAcces(err);
307
348
  break;
308
349
  case CErrorName.eaddrinuse:
309
- (void 0).systemErrors.eAddrInUse(err);
350
+ systemErrors.eAddrInUse(err);
310
351
  break;
311
352
  case CErrorName.econnrefused:
312
- (void 0).systemErrors.eConnRefused(err);
353
+ systemErrors.eConnRefused(err);
313
354
  break;
314
355
  case CErrorName.econnreset:
315
- (void 0).systemErrors.eConnReset(err);
356
+ systemErrors.eConnReset(err);
316
357
  break;
317
358
  case CErrorName.eexist:
318
- (void 0).systemErrors.eExist(err);
359
+ systemErrors.eExist(err);
319
360
  break;
320
361
  case CErrorName.eisdir:
321
- (void 0).systemErrors.eIsDir(err);
362
+ systemErrors.eIsDir(err);
322
363
  break;
323
364
  case CErrorName.emfile:
324
- (void 0).systemErrors.eMFile(err);
365
+ systemErrors.eMFile(err);
325
366
  break;
326
367
  case CErrorName.enoent:
327
- (void 0).systemErrors.eNoEnt(err);
368
+ systemErrors.eNoEnt(err);
328
369
  break;
329
370
  case CErrorName.enotdir:
330
- (void 0).systemErrors.eNotDir(err);
371
+ systemErrors.eNotDir(err);
331
372
  break;
332
373
  case CErrorName.enotEmpty:
333
- (void 0).systemErrors.eNotEmpty(err);
374
+ systemErrors.eNotEmpty(err);
334
375
  break;
335
376
  case CErrorName.eperm:
336
- (void 0).systemErrors.ePerm(err);
377
+ systemErrors.ePerm(err);
337
378
  break;
338
379
  case CErrorName.epipe:
339
- (void 0).systemErrors.ePipe(err);
380
+ systemErrors.ePipe(err);
340
381
  break;
341
382
  case CErrorName.etimedout:
342
- (void 0).systemErrors.eTimedOut(err);
383
+ systemErrors.eTimedOut(err);
343
384
  break;
344
385
  case CErrorName.assertionError:
345
- (void 0).stackTrace = (void 0).traceError(err.message, err.name, HttpStatusCode.NOT_ACCEPTABLE);
346
- err instanceof assert.AssertionError ? (void 0).logger.error(
347
- TranslationLoader3.t((void 0).stackTrace.name, (void 0).localLanguage),
386
+ const stackTrace = STraceError(
387
+ err.message,
388
+ err.name,
389
+ HttpStatusCode.NOT_ACCEPTABLE,
390
+ true
391
+ );
392
+ err instanceof assert.AssertionError ? logger.error(
393
+ TranslationLoader3.t(stackTrace.name, localLanguage),
348
394
  "AssertionError",
349
- (void 0).stackTrace.name,
350
- (void 0).stackTrace.stack,
395
+ stackTrace.name,
396
+ stackTrace.stack,
351
397
  HttpStatusCode.INTERNAL_SERVER_ERROR
352
- ) : (void 0).logger.error(
353
- TranslationLoader3.t((void 0).stackTrace.name, (void 0).localLanguage),
398
+ ) : logger.error(
399
+ TranslationLoader3.t(stackTrace.name, localLanguage),
354
400
  "Another Error",
355
- (void 0).stackTrace.name,
356
- (void 0).stackTrace.stack,
401
+ stackTrace.name,
402
+ stackTrace.stack,
357
403
  HttpStatusCode.INTERNAL_SERVER_ERROR
358
404
  );
359
405
  break;
360
406
  case CErrorName.errOsslEvpUnsupported:
361
- (void 0).openSSLErrors.errOsSLEvpUnsupported(err);
407
+ openSSLErrors.errOsSLEvpUnsupported(err);
362
408
  break;
363
409
  case CErrorName.errOsslBadDecrypt:
364
- (void 0).openSSLErrors.errOsSLBadDecrypt(err);
410
+ openSSLErrors.errOsSLBadDecrypt(err);
365
411
  break;
366
412
  case CErrorName.errOsslWrongFinalBlockLength:
367
- (void 0).openSSLErrors.errOsSLWrongFinalBlockLength(err);
413
+ openSSLErrors.errOsSLWrongFinalBlockLength(err);
368
414
  break;
369
415
  case CErrorName.errInvalidArgType:
370
- (void 0).internalErrors.errInvalidArgType(err);
416
+ internalErrors.errInvalidArgType(err);
371
417
  break;
372
418
  case CErrorName.errInvalidCallback:
373
- (void 0).internalErrors.errInvalidCallback(err);
419
+ internalErrors.errInvalidCallback(err);
374
420
  break;
375
421
  case CErrorName.errHttpHeadersSent:
376
- (void 0).internalErrors.errHttpHeadersSent(err);
422
+ internalErrors.errHttpHeadersSent(err);
377
423
  break;
378
424
  case CErrorName.errStreamDestroyed:
379
- (void 0).internalErrors.errStreamDestroyed(err);
425
+ internalErrors.errStreamDestroyed(err);
380
426
  break;
381
427
  case CErrorName.errTlsCertAltnameInvalid:
382
- (void 0).internalErrors.errTlsCertAltNameInvalid(err);
428
+ internalErrors.errTlsCertAltNameInvalid(err);
383
429
  break;
384
430
  case CErrorName.errUnsupportedEsmUrlScheme:
385
- (void 0).internalErrors.errUnsupportedEsmUrlScheme(err);
431
+ internalErrors.errUnsupportedEsmUrlScheme(err);
386
432
  break;
387
433
  }
388
434
  };
@@ -390,7 +436,7 @@ var SServerStartError = (err) => {
390
436
  // src/core/webServer.core.ts
391
437
  import { requestCallsEvent } from "opticore-request-call-event";
392
438
  var WebServerCore = class {
393
- serverUtility = new CoreService();
439
+ serverUtility;
394
440
  expressApp = express2();
395
441
  localLanguage;
396
442
  loggerConfig;
@@ -403,10 +449,10 @@ var WebServerCore = class {
403
449
  assertionErrors;
404
450
  openSSLErrors;
405
451
  systemErrors;
406
- constructor(app, loggerConfig, localLanguage, environnementPath, corsOriginOptions) {
407
- this.getEnvironnement = getEnvironnementValue(environnementPath);
452
+ constructor(app, loggerConfig2, localLanguage, environnementPath, corsOriginOptions) {
453
+ this.getEnvironnement = getEnvironnementValue3(environnementPath);
408
454
  this.routerExpressApp = app;
409
- this.loggerConfig = loggerConfig;
455
+ this.loggerConfig = loggerConfig2;
410
456
  this.localLanguage = localLanguage;
411
457
  this.environnementPath = environnementPath;
412
458
  this.expressApp.use(express2.json());
@@ -420,32 +466,42 @@ var WebServerCore = class {
420
466
  this.internalErrors = new InternalErrors(localLanguage);
421
467
  this.openSSLErrors = new OpenSSLErrors(localLanguage);
422
468
  this.systemErrors = new SystemErrors(localLanguage);
469
+ this.serverUtility = new CoreService(localLanguage, environnementPath);
423
470
  this.stackTraceErrorHandling(localLanguage);
424
471
  this.translationWebAppLoader();
425
472
  }
426
- onStartServer(routers) {
473
+ onStartServer(routers, dbConnexion) {
427
474
  return this.expressApp.listen(
428
- this.getEnvironnement.appHost,
429
- this.getEnvironnement.appPort,
475
+ Number(this.getEnvironnement.appPort),
430
476
  () => {
431
477
  try {
432
- if (this.getEnvironnement.appHost === "" && this.getEnvironnement.appPort === 0) {
433
- this.serverListenEvent.hostPortUndefined(this.getEnvironnement.appPort);
478
+ if (this.getEnvironnement.appHost === "" && Number(this.getEnvironnement.appPort) === 0) {
479
+ this.serverListenEvent.hostPortUndefined(Number(this.getEnvironnement.appPort));
434
480
  } else if (this.getEnvironnement.appHost === "") {
435
481
  this.serverListenEvent.hostUndefined(this.getEnvironnement.appHost);
436
- } else if (this.getEnvironnement.appPort === 0) {
482
+ } else if (Number(this.getEnvironnement.appPort) === 0) {
437
483
  this.serverListenEvent.portUndefined();
438
484
  } else {
485
+ dbConnexion();
486
+ this.expressApp.use(express2.static(path2.join(process3.cwd(), "public/template")));
439
487
  this.registerRoutes(routers);
440
488
  }
441
489
  } catch (err) {
442
- SServerStartError(err);
490
+ SServerStartError(
491
+ err,
492
+ this.javaScriptErrors,
493
+ this.systemErrors,
494
+ this.openSSLErrors,
495
+ this.internalErrors,
496
+ this.loggerConfig,
497
+ this.localLanguage
498
+ );
443
499
  }
444
500
  }
445
501
  );
446
502
  }
447
503
  //, kernelModule: KernelModuleType
448
- onListeningOnServerEvent(serverWeb, localLanguage) {
504
+ onListeningOnServerEvent(serverWeb) {
449
505
  serverWeb.on(eventName2.error, (err) => {
450
506
  this.serverListenEvent.onEventError(err);
451
507
  }).on(eventName2.close, () => {
@@ -462,7 +518,7 @@ var WebServerCore = class {
462
518
  req,
463
519
  res,
464
520
  this.getEnvironnement.appHost,
465
- this.getEnvironnement.appPort,
521
+ Number(this.getEnvironnement.appPort),
466
522
  dateTimeFormattedUtils,
467
523
  this.environnementPath,
468
524
  this.localLanguage
@@ -490,11 +546,7 @@ var WebServerCore = class {
490
546
  this.serverUtility.getVersions().nodeVersion,
491
547
  this.serverUtility.getProjectInfo().startingTime,
492
548
  this.getEnvironnement.appHost,
493
- Number(this.getEnvironnement.appPort),
494
- this.serverUtility.getUsageMemory().rss,
495
- this.serverUtility.getUsageMemory().heapUsed,
496
- this.serverUtility.getUsageMemory().user,
497
- this.serverUtility.getUsageMemory().system
549
+ Number(this.getEnvironnement.appPort)
498
550
  );
499
551
  }
500
552
  };
@@ -1,4 +1,16 @@
1
1
  {
2
+ "serverRunning": "The server is running in",
3
+ "webServerListening": "[OK] Web server listening",
4
+ "webServerUsingNodeVersion": "The Web server is using Node.js version",
5
+ "startTime": "Startup time:",
6
+ "runningModeDev": "development",
7
+ "runningModeProd": "production",
8
+ "totalMemoryAllocated": "Resident Set Size - total memory allocated for the process execution",
9
+ "sizeAllocatedHeap": "Total size of the allocated heap",
10
+ "memoryUsedExecution": "Actual memory used during the execution",
11
+ "externalMemory":"V8 external memory",
12
+ "memoryUsageUser": "Memory usage user",
13
+ "memoryUsageSystem": "Memory usage system",
2
14
  "dbConnection": "DataBase connection",
3
15
  "dbConnectionClosed": "MySQL connection is closed",
4
16
  "mysqlErrorCon": "MysqlError connection",
@@ -1,78 +1,90 @@
1
1
  {
2
- "dbConnection": "DataBase connection",
3
- "dbConnectionClosed": "MySQL connection is closed",
2
+ "serverRunning": "Le serveur est en cours d'exécution en",
3
+ "webServerListening": "[OK] Le serveur web écoute",
4
+ "webServerUsingNodeVersion": "Le serveur Web utilise la version Node.js",
5
+ "startTime": "Temps de démarrage :",
6
+ "runningModeDev": "développement",
7
+ "runningModeProd": "production",
8
+ "totalMemoryAllocated": "Taille de l'ensemble résident - mémoire totale allouée à l'exécution du processus",
9
+ "sizeAllocatedHeap": "Taille totale du segment alloué",
10
+ "memoryUsedExecution": "Mémoire réelle utilisée lors de l'exécution",
11
+ "externalMemory":"Mémoire externe V8",
12
+ "memoryUsageUser": "Utilisation de la mémoire par l'utilisateur",
13
+ "memoryUsageSystem": "Système d'usage de la mémoire",
14
+ "dbConnection": "Connexion à la base de données",
15
+ "dbConnectionClosed": "La connexion MySQL est fermée",
4
16
  "mysqlErrorCon": "MysqlError connection",
5
17
  "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",
18
+ "mySqlCloseConnection": "Connexion MySql fermée",
19
+ "verifyExistingKey": "Vérifier la clé existante",
20
+ "invalidRequest": "Demande invalide",
21
+ "tokenNotProvided": "Aucun jeton fourni.",
22
+ "ExpiresToken": "Jeton expiré. Vous n'êtes pas autorisé",
23
+ "privateKeyNotExist": "Il n'existe pas de clé privée.",
24
+ "publicKeyNotExist": "Il n'existe pas de clé public.",
25
+ "errorNamePublicKeyNotExist": "Aucune clé public.",
26
+ "errorAuthorPublicKeyNotExist": "Clé publique inexistante",
27
+ "errorDecryption": "Erreur de décryptage avec la clé privée",
28
+ "rsaKeyNotFound": "La clé RSA fournie n'est pas trouvée.",
29
+ "notVerifyingRSAKey": "Pas de vérification de la clé RSA",
30
+ "errorNameNotVerifyingRSAKey": "Erreur lors de la vérification de la clé RSA",
31
+ "errorEncryptionPublicKey": "Erreur de chiffrement avec la clé publique",
32
+ "errorEncryptionPrivateKey": "Erreur de chiffrement avec la clé privée",
33
+ "errorNameRsaVerifyExistingKey": "Vérification de la clé existante",
34
+ "signatureRSAKeyFailed": "La vérification de la signature a échoué.",
35
+ "encryptionWithPrivateKeyFailed": "Chiffrement avec clé privée",
36
+ "encryptionFailed": "Le cryptage a échoué",
37
+ "decryptionWithPublicKeyFailed": "Décryptage avec la clé publique",
38
+ "decryptionFailed": "Le décryptage a échoué",
39
+ "verifyRSAKey": "Vérification des clés RSA",
40
+ "verifyRSAKeyFailed": "Échec de la vérification des clés RSA",
41
+ "notVerifying": "La vérification a échoué",
42
+ "signatureRSAKeysError": "Erreur de clé de signature RSA",
43
+ "encryptionWithPublicKey": "Erreur de cryptage",
44
+ "errorDecryptionWithPrivateKey": "Erreur de décryptage avec la clé privée",
45
+ "verifyPublicRSAKey": "Vérifier la clé publique RSA",
46
+ "PostgresDBConnectionChecker": "Vérificateur de la connexion a la base de donnée Postgres",
35
47
  "PostgresConnection": "connection",
36
- "MongoDBConnectionChecker": "MongoDB Connection Checker",
48
+ "MongoDBConnectionChecker": "Vérificateur de la connexion a la base de donnée connexion MongoDB",
37
49
  "MongoConnection": "connection",
38
50
  "mongoDBAuthentication": "authentication",
39
- "mongoDBConnection": "MongoDB connection",
40
- "mongoDBAuthenticationFailed": "failed",
41
- "mongoDBUnableParsingUrl": "unable to parse",
51
+ "mongoDBConnection": "Connexion à la base de données Mongo",
52
+ "mongoDBAuthenticationFailed": "échoué",
53
+ "mongoDBUnableParsingUrl": "impossible d'analyser",
42
54
  "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"
55
+ "mongoDBServerSelection": "Erreur de sélection du serveur Mongo",
56
+ "mongoDBServer": "Serveur Mongo",
57
+ "mongoDBConnectionError": "Erreur de connection",
58
+ "mongoDBError": "erreur",
59
+ "loadedModules": "Chargement des modules de base",
60
+ "kernel": "Noyau",
61
+ "loadKernel": "charger le kernel",
62
+ "moduleAppLoaded": "Les modules de l'application ont été chargés avec succès",
63
+ "content": "contenu",
64
+ "serverSide": "côté serveur",
65
+ "hasBeenLoadedSuccessfully": "a été chargé avec succès",
66
+ "routerService": "Service de routeurs",
67
+ "registerRoutes": "Registre des routes",
68
+ "fail": "échec",
69
+ "loading": "Chargement",
70
+ "routers": "routes",
71
+ "registerLoadingFailed": "Le registre des routes n'a pas pu être chargé",
72
+ "dbConnChecker": "vérificateur a la connexion de base de données",
73
+ "loadedModulesError": "Les modules de base requis ne sont pas chargés correctement",
74
+ "dbConnexionSuccess": "La connexion à la base de données a réussi 🚀",
75
+ "mongoConnectionSuccess": "La connexion à la base de données est réussie.",
76
+ "PostgresConnectionSuccess": "La connexion à la base de données est réussie.",
77
+ "verifyExistingKeyError": "La clé fournie est introuvable",
78
+ "webServer": "Serveur Web",
79
+ "listening": "écoute",
80
+ "webHost": "hôte",
81
+ "badHost": "mauvais hôte",
82
+ "hostNotFound": "introuvable",
83
+ "errorHostUrl": "L'hôte et le port ne sont pas définis, veuillez les définir dans .env",
84
+ "badPort": "mauvais port",
85
+ "errorPort": "Le port est incorrect. Veuillez définir un port correct avec le numéro port.",
86
+ "errorHost": "L'hôte ne peut être vide. Veuillez définir une chaîne d'hôte dans .env.",
87
+ "accessDeniedToDBCon": "Accès refusé pour l'utilisateur {user}. Les identifiants de la base de données dans le fichier .env sont : utilisateur : {user} et le mot de passe : {password}. {user}''{password}'@'localhost'. Essayez de définir l'utilisateur et le mot de passe dans le fichier .env",
88
+ "unknownDB": "La base de données {database} est inconnue. Veuillez utiliser l'interface de ligne de commande de la base de données pour la créer, ou le faire manuellement dans votre système de gestion de bases de données.",
89
+ "errorDBHost": "L'hôte de la base de données ${host} n'autorise pas la connexion. Veuillez définir l'hôte comme suit : {localhost} dans votre fichier .env"
78
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opticore-webapp",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "wep server",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -0,0 +1,23 @@
1
+ <!DOCTYPE html>
2
+ <html lang="fr">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>OptiCore</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ background-color: #f0f0f0;
11
+ text-align: center;
12
+ padding: 50px;
13
+ }
14
+ h1 {
15
+ color: #333;
16
+ }
17
+ </style>
18
+ </head>
19
+ <body>
20
+ <h1>Bienvenue sur la vue par défaut !</h1>
21
+ <p>Ceci est une page HTML servie par Express.js.</p>
22
+ </body>
23
+ </html>