opticore-webapp 1.0.32 → 1.0.33
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 +17 -8
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +19 -10
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -47,7 +47,7 @@ var import_module2 = require("module");
|
|
|
47
47
|
var import_cors = __toESM(require("cors"), 1);
|
|
48
48
|
var import_opticore_catch_exception_error4 = require("opticore-catch-exception-error");
|
|
49
49
|
var import_opticore_express2 = require("opticore-express");
|
|
50
|
-
var
|
|
50
|
+
var import_opticore_env_access4 = require("opticore-env-access");
|
|
51
51
|
var import_opticore_translator5 = require("opticore-translator");
|
|
52
52
|
|
|
53
53
|
// src/core/handlers/eventProcess.handler.ts
|
|
@@ -489,6 +489,19 @@ var SLogger = () => {
|
|
|
489
489
|
return new import_opticore_logger2.LoggerCore();
|
|
490
490
|
};
|
|
491
491
|
|
|
492
|
+
// src/application/service/dependenciesContainer.service.ts
|
|
493
|
+
var import_opticore_inject_dependency = require("opticore-inject-dependency");
|
|
494
|
+
var import_opticore_env_access3 = require("opticore-env-access");
|
|
495
|
+
|
|
496
|
+
// src/utils/envPath.utils.ts
|
|
497
|
+
var import_process = __toESM(require("process"), 1);
|
|
498
|
+
var envPath = import_process.default.cwd() + "/config/env/.env";
|
|
499
|
+
|
|
500
|
+
// src/application/service/dependenciesContainer.service.ts
|
|
501
|
+
var SDependenciesContainer = (dependenciesProvider) => {
|
|
502
|
+
return new import_opticore_inject_dependency.SContainer(dependenciesProvider, (0, import_opticore_env_access3.getEnvironnementValue)(envPath).defaultLocal);
|
|
503
|
+
};
|
|
504
|
+
|
|
492
505
|
// src/core/webServer.core.ts
|
|
493
506
|
var WebServerCore = class {
|
|
494
507
|
serverUtility;
|
|
@@ -505,7 +518,7 @@ var WebServerCore = class {
|
|
|
505
518
|
openSSLErrors;
|
|
506
519
|
systemErrors;
|
|
507
520
|
constructor(app, loggerConfig2, localLanguage, environnementPath, corsOriginOptions) {
|
|
508
|
-
this.getEnvironnement = (0,
|
|
521
|
+
this.getEnvironnement = (0, import_opticore_env_access4.getEnvironnementValue)(environnementPath);
|
|
509
522
|
this.routerExpressApp = app;
|
|
510
523
|
this.loggerConfig = loggerConfig2;
|
|
511
524
|
this.localLanguage = localLanguage;
|
|
@@ -525,7 +538,7 @@ var WebServerCore = class {
|
|
|
525
538
|
this.stackTraceErrorHandling(localLanguage);
|
|
526
539
|
this.translationWebAppLoader();
|
|
527
540
|
}
|
|
528
|
-
onStartServer(routers, dbConnexion,
|
|
541
|
+
onStartServer(routers, dbConnexion, dependenciesProvider) {
|
|
529
542
|
if (this.getEnvironnement.appHost === "" && Number(this.getEnvironnement.appPort) === 0) {
|
|
530
543
|
this.serverListenEvent.hostPortUndefined(Number(this.getEnvironnement.appPort));
|
|
531
544
|
} else if (this.getEnvironnement.appHost === "") {
|
|
@@ -542,7 +555,7 @@ var WebServerCore = class {
|
|
|
542
555
|
() => {
|
|
543
556
|
try {
|
|
544
557
|
dbConnexion;
|
|
545
|
-
|
|
558
|
+
SDependenciesContainer(dependenciesProvider);
|
|
546
559
|
this.expressApp.use(import_opticore_express2.express.static(path3.join(import_node_process3.default.cwd(), "public/template")));
|
|
547
560
|
this.registerRoutes(routers);
|
|
548
561
|
} catch (err) {
|
|
@@ -610,10 +623,6 @@ var WebServerCore = class {
|
|
|
610
623
|
}
|
|
611
624
|
};
|
|
612
625
|
|
|
613
|
-
// src/utils/envPath.utils.ts
|
|
614
|
-
var import_process = __toESM(require("process"), 1);
|
|
615
|
-
var envPath = import_process.default.cwd() + "/config/env/.env";
|
|
616
|
-
|
|
617
626
|
// src/utils/stopServer.utils.ts
|
|
618
627
|
var import_dotenv = __toESM(require("dotenv"), 1);
|
|
619
628
|
var import_child_process = require("child_process");
|
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { CorsOptions } from 'cors';
|
|
|
2
2
|
import { Server } from 'http';
|
|
3
3
|
import { Router, express } from 'opticore-express';
|
|
4
4
|
import { LoggerCore } from 'opticore-logger';
|
|
5
|
-
import {
|
|
5
|
+
import { TDependency } from 'opticore-inject-dependency';
|
|
6
6
|
|
|
7
7
|
interface IRouteDefinition {
|
|
8
8
|
path: string;
|
|
@@ -28,7 +28,7 @@ declare class WebServerCore {
|
|
|
28
28
|
private readonly openSSLErrors;
|
|
29
29
|
private readonly systemErrors;
|
|
30
30
|
constructor(app: express.Application, loggerConfig: LoggerCore, localLanguage: string, environnementPath: any, corsOriginOptions?: Partial<CorsOptions>);
|
|
31
|
-
onStartServer(routers: TFeatureRoutes[], dbConnexion: (envPath: any, optionalArgumentConnection?: string | any) => void,
|
|
31
|
+
onStartServer(routers: TFeatureRoutes[], dbConnexion: (envPath: any, optionalArgumentConnection?: string | any) => void, dependenciesProvider?: TDependency[]): any;
|
|
32
32
|
onListeningOnServerEvent(serverWeb: Server): void;
|
|
33
33
|
onRequestOnServerEvent(serverWeb: Server): void;
|
|
34
34
|
private translationWebAppLoader;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { CorsOptions } from 'cors';
|
|
|
2
2
|
import { Server } from 'http';
|
|
3
3
|
import { Router, express } from 'opticore-express';
|
|
4
4
|
import { LoggerCore } from 'opticore-logger';
|
|
5
|
-
import {
|
|
5
|
+
import { TDependency } from 'opticore-inject-dependency';
|
|
6
6
|
|
|
7
7
|
interface IRouteDefinition {
|
|
8
8
|
path: string;
|
|
@@ -28,7 +28,7 @@ declare class WebServerCore {
|
|
|
28
28
|
private readonly openSSLErrors;
|
|
29
29
|
private readonly systemErrors;
|
|
30
30
|
constructor(app: express.Application, loggerConfig: LoggerCore, localLanguage: string, environnementPath: any, corsOriginOptions?: Partial<CorsOptions>);
|
|
31
|
-
onStartServer(routers: TFeatureRoutes[], dbConnexion: (envPath: any, optionalArgumentConnection?: string | any) => void,
|
|
31
|
+
onStartServer(routers: TFeatureRoutes[], dbConnexion: (envPath: any, optionalArgumentConnection?: string | any) => void, dependenciesProvider?: TDependency[]): any;
|
|
32
32
|
onListeningOnServerEvent(serverWeb: Server): void;
|
|
33
33
|
onRequestOnServerEvent(serverWeb: Server): void;
|
|
34
34
|
private translationWebAppLoader;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/core/webServer.core.ts
|
|
2
2
|
import * as path3 from "path";
|
|
3
|
-
import
|
|
3
|
+
import process5 from "node:process";
|
|
4
4
|
import { createRequire as createRequire2 } from "module";
|
|
5
5
|
import corsOrigin from "cors";
|
|
6
6
|
import {
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
SystemErrors
|
|
14
14
|
} from "opticore-catch-exception-error";
|
|
15
15
|
import { express as express2 } from "opticore-express";
|
|
16
|
-
import { getEnvironnementValue as
|
|
16
|
+
import { getEnvironnementValue as getEnvironnementValue4 } from "opticore-env-access";
|
|
17
17
|
import { TranslationLoader as TranslationLoader5 } from "opticore-translator";
|
|
18
18
|
|
|
19
19
|
// src/core/handlers/eventProcess.handler.ts
|
|
@@ -459,6 +459,19 @@ var SLogger = () => {
|
|
|
459
459
|
return new LoggerCore2();
|
|
460
460
|
};
|
|
461
461
|
|
|
462
|
+
// src/application/service/dependenciesContainer.service.ts
|
|
463
|
+
import { SContainer } from "opticore-inject-dependency";
|
|
464
|
+
import { getEnvironnementValue as getEnvironnementValue3 } from "opticore-env-access";
|
|
465
|
+
|
|
466
|
+
// src/utils/envPath.utils.ts
|
|
467
|
+
import process4 from "process";
|
|
468
|
+
var envPath = process4.cwd() + "/config/env/.env";
|
|
469
|
+
|
|
470
|
+
// src/application/service/dependenciesContainer.service.ts
|
|
471
|
+
var SDependenciesContainer = (dependenciesProvider) => {
|
|
472
|
+
return new SContainer(dependenciesProvider, getEnvironnementValue3(envPath).defaultLocal);
|
|
473
|
+
};
|
|
474
|
+
|
|
462
475
|
// src/core/webServer.core.ts
|
|
463
476
|
var WebServerCore = class {
|
|
464
477
|
serverUtility;
|
|
@@ -475,7 +488,7 @@ var WebServerCore = class {
|
|
|
475
488
|
openSSLErrors;
|
|
476
489
|
systemErrors;
|
|
477
490
|
constructor(app, loggerConfig2, localLanguage, environnementPath, corsOriginOptions) {
|
|
478
|
-
this.getEnvironnement =
|
|
491
|
+
this.getEnvironnement = getEnvironnementValue4(environnementPath);
|
|
479
492
|
this.routerExpressApp = app;
|
|
480
493
|
this.loggerConfig = loggerConfig2;
|
|
481
494
|
this.localLanguage = localLanguage;
|
|
@@ -495,7 +508,7 @@ var WebServerCore = class {
|
|
|
495
508
|
this.stackTraceErrorHandling(localLanguage);
|
|
496
509
|
this.translationWebAppLoader();
|
|
497
510
|
}
|
|
498
|
-
onStartServer(routers, dbConnexion,
|
|
511
|
+
onStartServer(routers, dbConnexion, dependenciesProvider) {
|
|
499
512
|
if (this.getEnvironnement.appHost === "" && Number(this.getEnvironnement.appPort) === 0) {
|
|
500
513
|
this.serverListenEvent.hostPortUndefined(Number(this.getEnvironnement.appPort));
|
|
501
514
|
} else if (this.getEnvironnement.appHost === "") {
|
|
@@ -512,8 +525,8 @@ var WebServerCore = class {
|
|
|
512
525
|
() => {
|
|
513
526
|
try {
|
|
514
527
|
dbConnexion;
|
|
515
|
-
|
|
516
|
-
this.expressApp.use(express2.static(path3.join(
|
|
528
|
+
SDependenciesContainer(dependenciesProvider);
|
|
529
|
+
this.expressApp.use(express2.static(path3.join(process5.cwd(), "public/template")));
|
|
517
530
|
this.registerRoutes(routers);
|
|
518
531
|
} catch (err) {
|
|
519
532
|
SServerStartError(
|
|
@@ -580,10 +593,6 @@ var WebServerCore = class {
|
|
|
580
593
|
}
|
|
581
594
|
};
|
|
582
595
|
|
|
583
|
-
// src/utils/envPath.utils.ts
|
|
584
|
-
import process5 from "process";
|
|
585
|
-
var envPath = process5.cwd() + "/config/env/.env";
|
|
586
|
-
|
|
587
596
|
// src/utils/stopServer.utils.ts
|
|
588
597
|
import dotenv from "dotenv";
|
|
589
598
|
import { execSync } from "child_process";
|