@liorian/sdk 0.30.0-alpha.ed4249e → 0.31.0-alpha.61fe5c2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liorian/sdk",
3
- "version": "0.30.0-alpha.ed4249e",
3
+ "version": "0.31.0-alpha.61fe5c2",
4
4
  "description": "Core package for the Liorian (application shell, domain, infrastructure, UI design system).",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -16,7 +16,8 @@
16
16
  "description": "Module d'exemple pour l'onboarding des développeurs",
17
17
  "version": "1.0.0",
18
18
  "icon": "WandSparklesIcon",
19
- "type": "INTERNAL",
19
+ "type": "WEB_APP_LOCAL",
20
+ "external": false,
20
21
  "entry": "index.tsx",
21
22
  "uri": "/hello-world",
22
23
  "platforms": {
@@ -144,10 +145,16 @@
144
145
  },
145
146
  "type": {
146
147
  "type": "string",
147
- "enum": ["INTERNAL", "EXTERNAL"],
148
+ "enum": ["CONFIGURATION", "EXTERNAL_URL", "WEB_APP_REMOTE", "WEB_APP_CACHED", "WEB_APP_LOCAL", "REMOTE_FRONTEND", "SYSTEM", "SERVICE", "WIDGET", "THEME"],
148
149
  "title": "Type de module",
149
- "description": "Nature du module : `INTERNAL` pour les modules livrés avec le socle dans le monorepo, `EXTERNAL` pour les modules distribués de manière indépendante et installables via le Module Store.",
150
- "default": "INTERNAL"
150
+ "description": "Mode de distribution/exécution du module. La distribution indépendante (anciennement `EXTERNAL`) est portée par le booléen `external`.",
151
+ "default": "WEB_APP_LOCAL"
152
+ },
153
+ "external": {
154
+ "type": "boolean",
155
+ "title": "Distribution indépendante",
156
+ "description": "`true` si le module est distribué indépendamment du socle et installable via le Module Store.",
157
+ "default": false
151
158
  },
152
159
  "entry": {
153
160
  "type": "string",
@@ -1,4 +1,5 @@
1
1
  import type {ModuleCategory} from "../enums/module-category.enum";
2
+ import type {CatalogModuleType} from "../enums/module-type.enum";
2
3
 
3
4
  /**
4
5
  * Types du catalogue public (storefront).
@@ -9,7 +10,7 @@ import type {ModuleCategory} from "../enums/module-category.enum";
9
10
  * inter-service.
10
11
  */
11
12
 
12
- export type CatalogModuleType = 'INTERNAL' | 'EXTERNAL';
13
+ export type {CatalogModuleType} from "../enums/module-type.enum";
13
14
 
14
15
  export interface CatalogCategoryInterface {
15
16
  id: string;
@@ -37,6 +38,7 @@ export interface CatalogModuleInterface {
37
38
  isEnabled: boolean;
38
39
  isDefault: boolean;
39
40
  type: CatalogModuleType;
41
+ external: boolean;
40
42
  categoryId?: string | null;
41
43
  category?: keyof typeof ModuleCategory | null;
42
44
  editorId?: string | null;
@@ -55,6 +57,7 @@ export interface CreateCatalogModulePayloadInterface {
55
57
  isEnabled?: boolean;
56
58
  isDefault?: boolean;
57
59
  type?: CatalogModuleType;
60
+ external?: boolean;
58
61
  categoryId?: string | null;
59
62
  }
60
63
 
@@ -69,6 +72,7 @@ export interface UpdateCatalogModulePayloadInterface {
69
72
  isEnabled?: boolean;
70
73
  isDefault?: boolean;
71
74
  type?: CatalogModuleType;
75
+ external?: boolean;
72
76
  categoryId?: string | null;
73
77
  }
74
78
 
@@ -1,4 +1,5 @@
1
1
  import {ModuleCategory} from "../enums/module-category.enum";
2
+ import type {ModuleType} from "../enums/module-type.enum";
2
3
 
3
4
  export interface ModuleSerialKeyInterface {
4
5
  id: string;
@@ -97,7 +98,8 @@ export interface ModuleStoreSyncPayloadInterface {
97
98
  version?: string;
98
99
  enabled: boolean;
99
100
  checksum?: string;
100
- type?: string;
101
+ type?: ModuleType;
102
+ external?: boolean;
101
103
  }[];
102
104
  }
103
105
 
@@ -157,7 +159,8 @@ export interface ModuleRegistryInstalledModuleInterface {
157
159
  key?: string;
158
160
  name: string;
159
161
  version: string;
160
- type: 'INTERNAL' | 'EXTERNAL';
162
+ type: ModuleType;
163
+ external?: boolean;
161
164
  category?: keyof typeof ModuleCategory;
162
165
  enabled: boolean;
163
166
  state: ModuleStoreStateType;
@@ -5,8 +5,9 @@ import {RoutineInterface} from "../typing/routine.types";
5
5
  import {AppRouterInstance} from "next/dist/shared/lib/app-router-context.shared-runtime";
6
6
  import {ModuleStoreStateType, ModuleConfigSettingsFieldInterface} from "./module-activation.interface";
7
7
  import {ModuleCategory} from "../enums/module-category.enum";
8
+ import type {ModuleType} from "../enums/module-type.enum";
8
9
 
9
- export type ModuleType = 'INTERNAL' | 'EXTERNAL';
10
+ export type {ModuleType} from "../enums/module-type.enum";
10
11
 
11
12
  export interface ModuleWidgetsInterface {
12
13
  [K: string]: React.ComponentType<any>;
@@ -46,6 +47,7 @@ export interface ModuleDeclarationInterface {
46
47
  isEnabled?: boolean;
47
48
  isDefault?: boolean; // Si true, ne peut pas être désactivé ou déplacé
48
49
  type: ModuleType;
50
+ external: boolean; // Si true, module distribué indépendamment du socle
49
51
  menu?: ModuleNavigationMenu;
50
52
  requirements?: Record<string, string>; // Modules nécessaires pour fonctionner. Ex: 'nom-du-module' : 'version'
51
53
  optionalRequirements?: Record<string, string>; // Modules nécessaires pour fonctionner. Ex: 'nom-du-module' : 'version'
@@ -2,6 +2,7 @@
2
2
  export * from "./coloring.enum";
3
3
  export * from "./domains.enum";
4
4
  export * from "./module-category.enum";
5
+ export * from "./module-type.enum";
5
6
  export * from "./module.enum";
6
7
  export * from "./routine.enum";
7
8
  export * from "./user-profile.enum";
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Type de module (mode de distribution / d'exécution).
3
+ *
4
+ * La distribution indépendante (anciennement `EXTERNAL`) est portée par le
5
+ * booléen `external` de la déclaration de module.
6
+ */
7
+ export const ModuleType = {
8
+ CONFIGURATION: 'CONFIGURATION',
9
+ EXTERNAL_URL: 'EXTERNAL_URL',
10
+ WEB_APP_REMOTE: 'WEB_APP_REMOTE',
11
+ WEB_APP_CACHED: 'WEB_APP_CACHED',
12
+ WEB_APP_LOCAL: 'WEB_APP_LOCAL',
13
+ REMOTE_FRONTEND: 'REMOTE_FRONTEND',
14
+ SYSTEM: 'SYSTEM',
15
+ SERVICE: 'SERVICE',
16
+ WIDGET: 'WIDGET',
17
+ THEME: 'THEME',
18
+ } as const;
19
+
20
+ export type ModuleType = (typeof ModuleType)[keyof typeof ModuleType];
21
+
22
+ /** Ordre d'affichage canonique des types de module. */
23
+ export const MODULE_TYPE_ORDER: ModuleType[] = [
24
+ ModuleType.CONFIGURATION,
25
+ ModuleType.EXTERNAL_URL,
26
+ ModuleType.WEB_APP_REMOTE,
27
+ ModuleType.WEB_APP_CACHED,
28
+ ModuleType.WEB_APP_LOCAL,
29
+ ModuleType.REMOTE_FRONTEND,
30
+ ModuleType.SYSTEM,
31
+ ModuleType.SERVICE,
32
+ ModuleType.WIDGET,
33
+ ModuleType.THEME,
34
+ ];
35
+
36
+ /** Libellés français des types de module. */
37
+ export const MODULE_TYPE_LABELS: Record<ModuleType, string> = {
38
+ CONFIGURATION: 'Configuration',
39
+ EXTERNAL_URL: 'URL externe',
40
+ WEB_APP_REMOTE: 'Application web distante',
41
+ WEB_APP_CACHED: 'Application web mise en cache',
42
+ WEB_APP_LOCAL: 'Application web locale',
43
+ REMOTE_FRONTEND: 'Frontend distant',
44
+ SYSTEM: 'Système',
45
+ SERVICE: 'Service',
46
+ WIDGET: 'Widget',
47
+ THEME: 'Thème',
48
+ };
49
+
50
+ /** Alias conservé pour le catalogue public (`CatalogModuleType`). */
51
+ export type CatalogModuleType = ModuleType;