opticore-webapp 1.0.65 → 1.0.67
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 +529 -229
- package/dist/index.d.cts +52 -40
- package/dist/index.d.ts +52 -40
- package/dist/index.js +539 -232
- package/dist/utils/translations/message.translation.en.json +32 -1
- package/dist/utils/translations/message.translation.fr.json +26 -1
- package/package.json +8 -8
package/dist/index.d.cts
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
import { CorsOptions } from 'cors';
|
|
2
1
|
import { Server } from 'http';
|
|
2
|
+
import { TDependency } from 'opticore-dependency-inject';
|
|
3
3
|
import { express } from 'opticore-express';
|
|
4
4
|
import { LoggerCore } from 'opticore-logger';
|
|
5
|
-
import {
|
|
5
|
+
import { CorsOptions } from 'cors';
|
|
6
|
+
import { TFeatureRoutes } from 'opticore-router';
|
|
6
7
|
|
|
7
|
-
interface
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
interface WebServerConstructorInterface {
|
|
9
|
+
app: express.Application;
|
|
10
|
+
loggerConfig: LoggerCore;
|
|
11
|
+
localLanguage: string;
|
|
12
|
+
environmentPath: any;
|
|
13
|
+
corsOriginOptions?: Partial<CorsOptions>;
|
|
10
14
|
}
|
|
11
15
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
/**
|
|
17
|
+
* WebServerCore - Architecture Serveur-Autorité
|
|
18
|
+
*
|
|
19
|
+
* Le serveur gère strictement ses états :
|
|
20
|
+
* - READY : Prêt à recevoir des demandes de hot reload
|
|
21
|
+
* - RELOADING : En cours de hot reload
|
|
22
|
+
* - BLOCKED : Bloqué par une erreur, refuse les nouveaux reloads
|
|
23
|
+
*/
|
|
16
24
|
declare class WebServerCore {
|
|
17
25
|
private serverUtility;
|
|
18
26
|
private expressApp;
|
|
@@ -22,54 +30,58 @@ declare class WebServerCore {
|
|
|
22
30
|
private readonly getEnvironment;
|
|
23
31
|
private readonly environmentPath;
|
|
24
32
|
private serverListenEvent;
|
|
25
|
-
|
|
33
|
+
private currentRoutes;
|
|
34
|
+
private currentDependencies;
|
|
35
|
+
private server;
|
|
36
|
+
private errorEmitter;
|
|
37
|
+
private serverState;
|
|
38
|
+
private lastError;
|
|
39
|
+
private hotReloadAttempts;
|
|
40
|
+
private hotReloadSuccesses;
|
|
41
|
+
private hotReloadFailures;
|
|
42
|
+
constructor(paramsConstructor: WebServerConstructorInterface);
|
|
43
|
+
onStartServer(routers: TFeatureRoutes[], databaseCallback?: (env: any) => void, dependenciesProvider?: TDependency[]): Server | undefined;
|
|
26
44
|
/**
|
|
27
|
-
*
|
|
28
|
-
* @param dependencies
|
|
45
|
+
* ✅✅✅ Configuration de la gestion d'erreurs
|
|
29
46
|
*/
|
|
30
|
-
|
|
47
|
+
private setupErrorHandling;
|
|
48
|
+
private setupServerEvents;
|
|
49
|
+
private notifyServerReady;
|
|
50
|
+
private setupSignalHandlers;
|
|
51
|
+
private setupIPCHandlers;
|
|
31
52
|
/**
|
|
32
|
-
*
|
|
33
|
-
* @param routers
|
|
34
|
-
* @param databaseCallback
|
|
35
|
-
* @param dependenciesProvider
|
|
53
|
+
* ✅✅✅ HOT RELOAD avec gestion d'état stricte
|
|
36
54
|
*/
|
|
37
|
-
|
|
55
|
+
private performTrueHotReload;
|
|
38
56
|
/**
|
|
39
|
-
*
|
|
40
|
-
* @param serverWeb
|
|
57
|
+
* Nettoie le cache des modules applicatifs
|
|
41
58
|
*/
|
|
42
|
-
|
|
59
|
+
private clearApplicationModulesCache;
|
|
60
|
+
private reloadConfigurations;
|
|
61
|
+
private reloadDependencies;
|
|
43
62
|
/**
|
|
44
|
-
*
|
|
45
|
-
* @param serverWeb
|
|
63
|
+
* ✅✅✅ Notifier le watcher : SUCCÈS
|
|
46
64
|
*/
|
|
47
|
-
|
|
65
|
+
private notifyWatcherReloadSuccess;
|
|
48
66
|
/**
|
|
49
|
-
*
|
|
50
|
-
* @param allFeatureRoutes
|
|
51
|
-
* @private
|
|
67
|
+
* ✅✅✅ Notifier le watcher : BLOQUÉ PAR ERREUR TRANSFORM
|
|
52
68
|
*/
|
|
53
|
-
private
|
|
69
|
+
private notifyWatcherBlockedByError;
|
|
54
70
|
/**
|
|
55
|
-
*
|
|
56
|
-
* @param localLanguage
|
|
57
|
-
* @private
|
|
71
|
+
* ✅✅✅ Notifier le watcher : ERREUR GÉNÉRIQUE
|
|
58
72
|
*/
|
|
59
|
-
private
|
|
73
|
+
private notifyWatcherReloadError;
|
|
60
74
|
/**
|
|
61
|
-
*
|
|
62
|
-
* @private
|
|
75
|
+
* ✅✅✅ Parser les détails d'une TransformError
|
|
63
76
|
*/
|
|
77
|
+
private parseTransformError;
|
|
78
|
+
private registerRoutes;
|
|
64
79
|
private infoWebApp;
|
|
80
|
+
private shutdown;
|
|
65
81
|
}
|
|
66
82
|
|
|
67
83
|
declare const envPath: string;
|
|
68
84
|
|
|
69
|
-
type
|
|
70
|
-
featureRoute: IRouteDefinition[];
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
type KernelModuleType = [TFeatureRouteDefinition[], () => void];
|
|
85
|
+
type KernelModuleType = [any[], () => void];
|
|
74
86
|
|
|
75
|
-
export { type
|
|
87
|
+
export { type KernelModuleType, WebServerCore as WebServer, envPath };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
import { CorsOptions } from 'cors';
|
|
2
1
|
import { Server } from 'http';
|
|
2
|
+
import { TDependency } from 'opticore-dependency-inject';
|
|
3
3
|
import { express } from 'opticore-express';
|
|
4
4
|
import { LoggerCore } from 'opticore-logger';
|
|
5
|
-
import {
|
|
5
|
+
import { CorsOptions } from 'cors';
|
|
6
|
+
import { TFeatureRoutes } from 'opticore-router';
|
|
6
7
|
|
|
7
|
-
interface
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
interface WebServerConstructorInterface {
|
|
9
|
+
app: express.Application;
|
|
10
|
+
loggerConfig: LoggerCore;
|
|
11
|
+
localLanguage: string;
|
|
12
|
+
environmentPath: any;
|
|
13
|
+
corsOriginOptions?: Partial<CorsOptions>;
|
|
10
14
|
}
|
|
11
15
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
/**
|
|
17
|
+
* WebServerCore - Architecture Serveur-Autorité
|
|
18
|
+
*
|
|
19
|
+
* Le serveur gère strictement ses états :
|
|
20
|
+
* - READY : Prêt à recevoir des demandes de hot reload
|
|
21
|
+
* - RELOADING : En cours de hot reload
|
|
22
|
+
* - BLOCKED : Bloqué par une erreur, refuse les nouveaux reloads
|
|
23
|
+
*/
|
|
16
24
|
declare class WebServerCore {
|
|
17
25
|
private serverUtility;
|
|
18
26
|
private expressApp;
|
|
@@ -22,54 +30,58 @@ declare class WebServerCore {
|
|
|
22
30
|
private readonly getEnvironment;
|
|
23
31
|
private readonly environmentPath;
|
|
24
32
|
private serverListenEvent;
|
|
25
|
-
|
|
33
|
+
private currentRoutes;
|
|
34
|
+
private currentDependencies;
|
|
35
|
+
private server;
|
|
36
|
+
private errorEmitter;
|
|
37
|
+
private serverState;
|
|
38
|
+
private lastError;
|
|
39
|
+
private hotReloadAttempts;
|
|
40
|
+
private hotReloadSuccesses;
|
|
41
|
+
private hotReloadFailures;
|
|
42
|
+
constructor(paramsConstructor: WebServerConstructorInterface);
|
|
43
|
+
onStartServer(routers: TFeatureRoutes[], databaseCallback?: (env: any) => void, dependenciesProvider?: TDependency[]): Server | undefined;
|
|
26
44
|
/**
|
|
27
|
-
*
|
|
28
|
-
* @param dependencies
|
|
45
|
+
* ✅✅✅ Configuration de la gestion d'erreurs
|
|
29
46
|
*/
|
|
30
|
-
|
|
47
|
+
private setupErrorHandling;
|
|
48
|
+
private setupServerEvents;
|
|
49
|
+
private notifyServerReady;
|
|
50
|
+
private setupSignalHandlers;
|
|
51
|
+
private setupIPCHandlers;
|
|
31
52
|
/**
|
|
32
|
-
*
|
|
33
|
-
* @param routers
|
|
34
|
-
* @param databaseCallback
|
|
35
|
-
* @param dependenciesProvider
|
|
53
|
+
* ✅✅✅ HOT RELOAD avec gestion d'état stricte
|
|
36
54
|
*/
|
|
37
|
-
|
|
55
|
+
private performTrueHotReload;
|
|
38
56
|
/**
|
|
39
|
-
*
|
|
40
|
-
* @param serverWeb
|
|
57
|
+
* Nettoie le cache des modules applicatifs
|
|
41
58
|
*/
|
|
42
|
-
|
|
59
|
+
private clearApplicationModulesCache;
|
|
60
|
+
private reloadConfigurations;
|
|
61
|
+
private reloadDependencies;
|
|
43
62
|
/**
|
|
44
|
-
*
|
|
45
|
-
* @param serverWeb
|
|
63
|
+
* ✅✅✅ Notifier le watcher : SUCCÈS
|
|
46
64
|
*/
|
|
47
|
-
|
|
65
|
+
private notifyWatcherReloadSuccess;
|
|
48
66
|
/**
|
|
49
|
-
*
|
|
50
|
-
* @param allFeatureRoutes
|
|
51
|
-
* @private
|
|
67
|
+
* ✅✅✅ Notifier le watcher : BLOQUÉ PAR ERREUR TRANSFORM
|
|
52
68
|
*/
|
|
53
|
-
private
|
|
69
|
+
private notifyWatcherBlockedByError;
|
|
54
70
|
/**
|
|
55
|
-
*
|
|
56
|
-
* @param localLanguage
|
|
57
|
-
* @private
|
|
71
|
+
* ✅✅✅ Notifier le watcher : ERREUR GÉNÉRIQUE
|
|
58
72
|
*/
|
|
59
|
-
private
|
|
73
|
+
private notifyWatcherReloadError;
|
|
60
74
|
/**
|
|
61
|
-
*
|
|
62
|
-
* @private
|
|
75
|
+
* ✅✅✅ Parser les détails d'une TransformError
|
|
63
76
|
*/
|
|
77
|
+
private parseTransformError;
|
|
78
|
+
private registerRoutes;
|
|
64
79
|
private infoWebApp;
|
|
80
|
+
private shutdown;
|
|
65
81
|
}
|
|
66
82
|
|
|
67
83
|
declare const envPath: string;
|
|
68
84
|
|
|
69
|
-
type
|
|
70
|
-
featureRoute: IRouteDefinition[];
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
type KernelModuleType = [TFeatureRouteDefinition[], () => void];
|
|
85
|
+
type KernelModuleType = [any[], () => void];
|
|
74
86
|
|
|
75
|
-
export { type
|
|
87
|
+
export { type KernelModuleType, WebServerCore as WebServer, envPath };
|