@fidusia/question-engine-dynamic 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/README.md +6 -0
- package/dist/config-loader.d.ts +16 -8
- package/dist/config-loader.d.ts.map +1 -1
- package/dist/config-loader.js +130 -34
- package/dist/engine.d.ts +2 -2
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +8 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/types.d.ts +35 -13
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -94
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/config-loader.d.ts
CHANGED
|
@@ -66,7 +66,8 @@ export interface ChatbotConfig {
|
|
|
66
66
|
}>;
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
|
-
* Obtient les IDs système
|
|
69
|
+
* Obtient les IDs système depuis la configuration
|
|
70
|
+
* ⚠️ AUCUN FALLBACK - Les IDs système doivent être chargés depuis la base de données
|
|
70
71
|
*/
|
|
71
72
|
export declare function getSystemIds(config: ChatbotConfig): {
|
|
72
73
|
budgetPriorityQuestionId: string;
|
|
@@ -77,40 +78,47 @@ export declare function getSystemIds(config: ChatbotConfig): {
|
|
|
77
78
|
continueOtherSectorsModuleId: string;
|
|
78
79
|
};
|
|
79
80
|
/**
|
|
80
|
-
* Obtient les mappings de priorité
|
|
81
|
+
* Obtient les mappings de priorité depuis la configuration
|
|
82
|
+
* ⚠️ AUCUN FALLBACK - La configuration doit être chargée depuis la base de données
|
|
81
83
|
*/
|
|
82
84
|
export declare function getPriorityMappings(config: ChatbotConfig): Record<string, string[]>;
|
|
83
85
|
/**
|
|
84
|
-
* Obtient les mappings de prestataires
|
|
86
|
+
* Obtient les mappings de prestataires depuis la configuration
|
|
87
|
+
* ⚠️ AUCUN FALLBACK - La configuration doit être chargée depuis la base de données
|
|
85
88
|
*/
|
|
86
89
|
export declare function getBookedProviderMappings(config: ChatbotConfig): Record<string, {
|
|
87
90
|
moduleId: string;
|
|
88
91
|
skipQuestion: string;
|
|
89
92
|
}>;
|
|
90
93
|
/**
|
|
91
|
-
* Obtient les priorités de base
|
|
94
|
+
* Obtient les priorités de base depuis la configuration
|
|
95
|
+
* ⚠️ AUCUN FALLBACK - La configuration doit être chargée depuis la base de données
|
|
92
96
|
*/
|
|
93
97
|
export declare function getBasePriorities(config: ChatbotConfig): Record<string, number>;
|
|
94
98
|
/**
|
|
95
|
-
* Obtient les boosts de priorité
|
|
99
|
+
* Obtient les boosts de priorité depuis la configuration
|
|
100
|
+
* ⚠️ AUCUN FALLBACK - La configuration doit être chargée depuis la base de données
|
|
96
101
|
*/
|
|
97
102
|
export declare function getPriorityBoosts(config: ChatbotConfig): Record<string, Array<{
|
|
98
103
|
moduleId: string;
|
|
99
104
|
boost: number;
|
|
100
105
|
}>>;
|
|
101
106
|
/**
|
|
102
|
-
* Obtient le mapping priorité -> prestataires
|
|
107
|
+
* Obtient le mapping priorité -> prestataires depuis la configuration
|
|
108
|
+
* ⚠️ AUCUN FALLBACK - La configuration doit être chargée depuis la base de données
|
|
103
109
|
*/
|
|
104
110
|
export declare function getPriorityToBookedProviders(config: ChatbotConfig): Record<string, string[]>;
|
|
105
111
|
/**
|
|
106
|
-
* Obtient la configuration du calcul de priorité
|
|
112
|
+
* Obtient la configuration du calcul de priorité depuis la configuration
|
|
113
|
+
* ⚠️ AUCUN FALLBACK - La configuration doit être chargée depuis la base de données
|
|
107
114
|
*/
|
|
108
115
|
export declare function getPriorityCalculation(config: ChatbotConfig): {
|
|
109
116
|
base: number;
|
|
110
117
|
step: number;
|
|
111
118
|
};
|
|
112
119
|
/**
|
|
113
|
-
* Obtient les comportements spéciaux
|
|
120
|
+
* Obtient les comportements spéciaux depuis la configuration
|
|
121
|
+
* ⚠️ AUCUN FALLBACK - La configuration doit être chargée depuis la base de données
|
|
114
122
|
*/
|
|
115
123
|
export declare function getSpecialBehaviors(config: ChatbotConfig): {
|
|
116
124
|
budgetPriority: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../src/config-loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../src/config-loader.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,aAAa;IAI5B,SAAS,CAAC,EAAE;QACV,wBAAwB,CAAC,EAAE,MAAM,CAAC;QAClC,2BAA2B,CAAC,EAAE,MAAM,CAAC;QACrC,8BAA8B,CAAC,EAAE,MAAM,CAAC;QACxC,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,4BAA4B,CAAC,EAAE,MAAM,CAAC;KACvC,CAAC;IAKF,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAK5C,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IAK5E,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAKxC,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAKpF,yBAAyB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAKrD,mBAAmB,CAAC,EAAE;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IAKF,gBAAgB,CAAC,EAAE;QAEjB,cAAc,CAAC,EAAE;YACf,OAAO,CAAC,EAAE,OAAO,CAAC;YAClB,8BAA8B,CA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ACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,CAK3H;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAK/E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAKnH;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAK5F;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa;;;EAc3D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa;;;;;;;;;;;;;;;;;;EAmExD"}
|
package/dist/config-loader.js
CHANGED
|
@@ -1,80 +1,176 @@
|
|
|
1
|
-
|
|
1
|
+
// ⚠️ SUPPRIMÉ : Imports des constantes hardcodées
|
|
2
|
+
// Toutes les configurations doivent venir de la base de données via ChatbotConfig
|
|
2
3
|
/**
|
|
3
|
-
* Obtient les IDs système
|
|
4
|
+
* Obtient les IDs système depuis la configuration
|
|
5
|
+
* ⚠️ AUCUN FALLBACK - Les IDs système doivent être chargés depuis la base de données
|
|
4
6
|
*/
|
|
5
7
|
export function getSystemIds(config) {
|
|
6
|
-
|
|
8
|
+
if (!config.systemIds) {
|
|
9
|
+
throw new Error('systemIds is required in ChatbotConfig. Configuration must be loaded from database via loadChatbotConfig().');
|
|
10
|
+
}
|
|
11
|
+
// ⚠️ Tous les IDs système doivent être présents - pas de fallback
|
|
12
|
+
if (!config.systemIds.budgetPriorityQuestionId) {
|
|
13
|
+
throw new Error('systemIds.budgetPriorityQuestionId is required in ChatbotConfig.');
|
|
14
|
+
}
|
|
15
|
+
if (!config.systemIds.contactCorrectionQuestionId) {
|
|
16
|
+
throw new Error('systemIds.contactCorrectionQuestionId is required in ChatbotConfig.');
|
|
17
|
+
}
|
|
18
|
+
if (!config.systemIds.continueOtherSectorsQuestionId) {
|
|
19
|
+
throw new Error('systemIds.continueOtherSectorsQuestionId is required in ChatbotConfig.');
|
|
20
|
+
}
|
|
21
|
+
if (!config.systemIds.finalModuleId) {
|
|
22
|
+
throw new Error('systemIds.finalModuleId is required in ChatbotConfig.');
|
|
23
|
+
}
|
|
24
|
+
if (!config.systemIds.introModuleId) {
|
|
25
|
+
throw new Error('systemIds.introModuleId is required in ChatbotConfig.');
|
|
26
|
+
}
|
|
27
|
+
if (!config.systemIds.continueOtherSectorsModuleId) {
|
|
28
|
+
throw new Error('systemIds.continueOtherSectorsModuleId is required in ChatbotConfig.');
|
|
29
|
+
}
|
|
7
30
|
return {
|
|
8
|
-
budgetPriorityQuestionId:
|
|
9
|
-
contactCorrectionQuestionId:
|
|
10
|
-
continueOtherSectorsQuestionId:
|
|
11
|
-
finalModuleId:
|
|
12
|
-
introModuleId:
|
|
13
|
-
continueOtherSectorsModuleId:
|
|
31
|
+
budgetPriorityQuestionId: config.systemIds.budgetPriorityQuestionId,
|
|
32
|
+
contactCorrectionQuestionId: config.systemIds.contactCorrectionQuestionId,
|
|
33
|
+
continueOtherSectorsQuestionId: config.systemIds.continueOtherSectorsQuestionId,
|
|
34
|
+
finalModuleId: config.systemIds.finalModuleId,
|
|
35
|
+
introModuleId: config.systemIds.introModuleId,
|
|
36
|
+
continueOtherSectorsModuleId: config.systemIds.continueOtherSectorsModuleId,
|
|
14
37
|
};
|
|
15
38
|
}
|
|
16
39
|
/**
|
|
17
|
-
* Obtient les mappings de priorité
|
|
40
|
+
* Obtient les mappings de priorité depuis la configuration
|
|
41
|
+
* ⚠️ AUCUN FALLBACK - La configuration doit être chargée depuis la base de données
|
|
18
42
|
*/
|
|
19
43
|
export function getPriorityMappings(config) {
|
|
20
|
-
|
|
44
|
+
if (!config.priorityMappings) {
|
|
45
|
+
throw new Error('priorityMappings is required in ChatbotConfig. Configuration must be loaded from database via loadChatbotConfig().');
|
|
46
|
+
}
|
|
47
|
+
return config.priorityMappings;
|
|
21
48
|
}
|
|
22
49
|
/**
|
|
23
|
-
* Obtient les mappings de prestataires
|
|
50
|
+
* Obtient les mappings de prestataires depuis la configuration
|
|
51
|
+
* ⚠️ AUCUN FALLBACK - La configuration doit être chargée depuis la base de données
|
|
24
52
|
*/
|
|
25
53
|
export function getBookedProviderMappings(config) {
|
|
26
|
-
|
|
54
|
+
if (!config.bookedProviderMappings) {
|
|
55
|
+
throw new Error('bookedProviderMappings is required in ChatbotConfig. Configuration must be loaded from database via loadChatbotConfig().');
|
|
56
|
+
}
|
|
57
|
+
return config.bookedProviderMappings;
|
|
27
58
|
}
|
|
28
59
|
/**
|
|
29
|
-
* Obtient les priorités de base
|
|
60
|
+
* Obtient les priorités de base depuis la configuration
|
|
61
|
+
* ⚠️ AUCUN FALLBACK - La configuration doit être chargée depuis la base de données
|
|
30
62
|
*/
|
|
31
63
|
export function getBasePriorities(config) {
|
|
32
|
-
|
|
64
|
+
if (!config.basePriorities) {
|
|
65
|
+
throw new Error('basePriorities is required in ChatbotConfig. Configuration must be loaded from database via loadChatbotConfig().');
|
|
66
|
+
}
|
|
67
|
+
return config.basePriorities;
|
|
33
68
|
}
|
|
34
69
|
/**
|
|
35
|
-
* Obtient les boosts de priorité
|
|
70
|
+
* Obtient les boosts de priorité depuis la configuration
|
|
71
|
+
* ⚠️ AUCUN FALLBACK - La configuration doit être chargée depuis la base de données
|
|
36
72
|
*/
|
|
37
73
|
export function getPriorityBoosts(config) {
|
|
38
|
-
|
|
74
|
+
if (!config.priorityBoosts) {
|
|
75
|
+
throw new Error('priorityBoosts is required in ChatbotConfig. Configuration must be loaded from database via loadChatbotConfig().');
|
|
76
|
+
}
|
|
77
|
+
return config.priorityBoosts;
|
|
39
78
|
}
|
|
40
79
|
/**
|
|
41
|
-
* Obtient le mapping priorité -> prestataires
|
|
80
|
+
* Obtient le mapping priorité -> prestataires depuis la configuration
|
|
81
|
+
* ⚠️ AUCUN FALLBACK - La configuration doit être chargée depuis la base de données
|
|
42
82
|
*/
|
|
43
83
|
export function getPriorityToBookedProviders(config) {
|
|
44
|
-
|
|
84
|
+
if (!config.priorityToBookedProviders) {
|
|
85
|
+
throw new Error('priorityToBookedProviders is required in ChatbotConfig. Configuration must be loaded from database via loadChatbotConfig().');
|
|
86
|
+
}
|
|
87
|
+
return config.priorityToBookedProviders;
|
|
45
88
|
}
|
|
46
89
|
/**
|
|
47
|
-
* Obtient la configuration du calcul de priorité
|
|
90
|
+
* Obtient la configuration du calcul de priorité depuis la configuration
|
|
91
|
+
* ⚠️ AUCUN FALLBACK - La configuration doit être chargée depuis la base de données
|
|
48
92
|
*/
|
|
49
93
|
export function getPriorityCalculation(config) {
|
|
50
|
-
|
|
94
|
+
if (!config.priorityCalculation) {
|
|
95
|
+
throw new Error('priorityCalculation is required in ChatbotConfig. Configuration must be loaded from database via loadChatbotConfig().');
|
|
96
|
+
}
|
|
97
|
+
if (config.priorityCalculation.base === undefined) {
|
|
98
|
+
throw new Error('priorityCalculation.base is required in ChatbotConfig.');
|
|
99
|
+
}
|
|
100
|
+
if (config.priorityCalculation.step === undefined) {
|
|
101
|
+
throw new Error('priorityCalculation.step is required in ChatbotConfig.');
|
|
102
|
+
}
|
|
51
103
|
return {
|
|
52
|
-
base:
|
|
53
|
-
step:
|
|
104
|
+
base: config.priorityCalculation.base,
|
|
105
|
+
step: config.priorityCalculation.step,
|
|
54
106
|
};
|
|
55
107
|
}
|
|
56
108
|
/**
|
|
57
|
-
* Obtient les comportements spéciaux
|
|
109
|
+
* Obtient les comportements spéciaux depuis la configuration
|
|
110
|
+
* ⚠️ AUCUN FALLBACK - La configuration doit être chargée depuis la base de données
|
|
58
111
|
*/
|
|
59
112
|
export function getSpecialBehaviors(config) {
|
|
60
|
-
|
|
113
|
+
if (!config.specialBehaviors) {
|
|
114
|
+
throw new Error('specialBehaviors is required in ChatbotConfig. Configuration must be loaded from database via loadChatbotConfig().');
|
|
115
|
+
}
|
|
116
|
+
// ⚠️ Tous les comportements doivent être présents - pas de fallback
|
|
117
|
+
if (config.specialBehaviors.budgetPriority === undefined) {
|
|
118
|
+
throw new Error('specialBehaviors.budgetPriority is required in ChatbotConfig.');
|
|
119
|
+
}
|
|
120
|
+
if (config.specialBehaviors.contactCorrection === undefined) {
|
|
121
|
+
throw new Error('specialBehaviors.contactCorrection is required in ChatbotConfig.');
|
|
122
|
+
}
|
|
123
|
+
if (config.specialBehaviors.continueOtherSectors === undefined) {
|
|
124
|
+
throw new Error('specialBehaviors.continueOtherSectors is required in ChatbotConfig.');
|
|
125
|
+
}
|
|
126
|
+
if (config.specialBehaviors.transitions === undefined) {
|
|
127
|
+
throw new Error('specialBehaviors.transitions is required in ChatbotConfig.');
|
|
128
|
+
}
|
|
129
|
+
// Vérifier que les propriétés requises sont présentes
|
|
130
|
+
if (config.specialBehaviors.budgetPriority.enabled === undefined) {
|
|
131
|
+
throw new Error('specialBehaviors.budgetPriority.enabled is required in ChatbotConfig.');
|
|
132
|
+
}
|
|
133
|
+
if (config.specialBehaviors.budgetPriority.filterOptionsByBookedProviders === undefined) {
|
|
134
|
+
throw new Error('specialBehaviors.budgetPriority.filterOptionsByBookedProviders is required in ChatbotConfig.');
|
|
135
|
+
}
|
|
136
|
+
if (config.specialBehaviors.contactCorrection.enabled === undefined) {
|
|
137
|
+
throw new Error('specialBehaviors.contactCorrection.enabled is required in ChatbotConfig.');
|
|
138
|
+
}
|
|
139
|
+
if (config.specialBehaviors.contactCorrection.detectEmailFrom === undefined) {
|
|
140
|
+
throw new Error('specialBehaviors.contactCorrection.detectEmailFrom is required in ChatbotConfig.');
|
|
141
|
+
}
|
|
142
|
+
if (config.specialBehaviors.continueOtherSectors.enabled === undefined) {
|
|
143
|
+
throw new Error('specialBehaviors.continueOtherSectors.enabled is required in ChatbotConfig.');
|
|
144
|
+
}
|
|
145
|
+
if (config.specialBehaviors.continueOtherSectors.skipToFinalOnNo === undefined) {
|
|
146
|
+
throw new Error('specialBehaviors.continueOtherSectors.skipToFinalOnNo is required in ChatbotConfig.');
|
|
147
|
+
}
|
|
148
|
+
if (config.specialBehaviors.continueOtherSectors.skipModulesWithPriority === undefined) {
|
|
149
|
+
throw new Error('specialBehaviors.continueOtherSectors.skipModulesWithPriority is required in ChatbotConfig.');
|
|
150
|
+
}
|
|
151
|
+
if (config.specialBehaviors.continueOtherSectors.insertBetweenPriorityAndNonPriority === undefined) {
|
|
152
|
+
throw new Error('specialBehaviors.continueOtherSectors.insertBetweenPriorityAndNonPriority is required in ChatbotConfig.');
|
|
153
|
+
}
|
|
154
|
+
if (config.specialBehaviors.transitions.excludeModules === undefined) {
|
|
155
|
+
throw new Error('specialBehaviors.transitions.excludeModules is required in ChatbotConfig.');
|
|
156
|
+
}
|
|
61
157
|
return {
|
|
62
158
|
budgetPriority: {
|
|
63
|
-
enabled:
|
|
64
|
-
filterOptionsByBookedProviders:
|
|
159
|
+
enabled: config.specialBehaviors.budgetPriority.enabled,
|
|
160
|
+
filterOptionsByBookedProviders: config.specialBehaviors.budgetPriority.filterOptionsByBookedProviders,
|
|
65
161
|
},
|
|
66
162
|
contactCorrection: {
|
|
67
|
-
enabled:
|
|
68
|
-
detectEmailFrom:
|
|
163
|
+
enabled: config.specialBehaviors.contactCorrection.enabled,
|
|
164
|
+
detectEmailFrom: config.specialBehaviors.contactCorrection.detectEmailFrom,
|
|
69
165
|
},
|
|
70
166
|
continueOtherSectors: {
|
|
71
|
-
enabled:
|
|
72
|
-
skipToFinalOnNo:
|
|
73
|
-
skipModulesWithPriority:
|
|
74
|
-
insertBetweenPriorityAndNonPriority:
|
|
167
|
+
enabled: config.specialBehaviors.continueOtherSectors.enabled,
|
|
168
|
+
skipToFinalOnNo: config.specialBehaviors.continueOtherSectors.skipToFinalOnNo,
|
|
169
|
+
skipModulesWithPriority: config.specialBehaviors.continueOtherSectors.skipModulesWithPriority,
|
|
170
|
+
insertBetweenPriorityAndNonPriority: config.specialBehaviors.continueOtherSectors.insertBetweenPriorityAndNonPriority,
|
|
75
171
|
},
|
|
76
172
|
transitions: {
|
|
77
|
-
excludeModules:
|
|
173
|
+
excludeModules: config.specialBehaviors.transitions.excludeModules,
|
|
78
174
|
},
|
|
79
175
|
};
|
|
80
176
|
}
|
package/dist/engine.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { QuestionModule, ModuleQuestion, QueueState, AnsweredQuestion,
|
|
1
|
+
import type { QuestionModule, ModuleQuestion, QueueState, AnsweredQuestion, I18nFunctions } from "./types";
|
|
2
2
|
import type { ChatbotConfig } from './config-loader';
|
|
3
3
|
import type { EngineType, EngineConfig } from './engine-types';
|
|
4
4
|
export declare class QuestionEngine {
|
|
@@ -77,7 +77,7 @@ export declare class QuestionEngine {
|
|
|
77
77
|
private executeQuestionTriggers;
|
|
78
78
|
private evaluateQuestionTrigger;
|
|
79
79
|
private executeAction;
|
|
80
|
-
applyUserPriority(priority:
|
|
80
|
+
applyUserPriority(priority: string): void;
|
|
81
81
|
private recalculateQueue;
|
|
82
82
|
getState(): QueueState;
|
|
83
83
|
getFormData(): Record<string, any>;
|
package/dist/engine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,UAAU,EAGV,gBAAgB,
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,UAAU,EAGV,gBAAgB,EAKhB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,aAAa,GAAG,cAAc,CAGvE"}
|
package/dist/engine.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
// Gère la queue, la navigation et les triggers
|
|
4
4
|
// Version avec configuration dynamique complète
|
|
5
5
|
// =====================================================
|
|
6
|
+
// ⚠️ SUPPRIMÉ : Import des constantes hardcodées
|
|
7
|
+
// Les configurations sont maintenant chargées depuis la DB via ChatbotConfig
|
|
6
8
|
import { loadAllAIQuestionsForSector, convertAIQuestionToModuleQuestion, checkConditions } from "./ai-questions-loader";
|
|
7
9
|
import { getPriorityMappings, getBookedProviderMappings, getPriorityBoosts, getSystemIds, getPriorityToBookedProviders, getPriorityCalculation, getSpecialBehaviors } from './config-loader';
|
|
8
10
|
// Import conditionnel pour la version serveur (si disponible)
|
|
@@ -550,9 +552,12 @@ export class QuestionEngine {
|
|
|
550
552
|
// (Uniquement pour le moteur avancé)
|
|
551
553
|
if (!this.isSimpleEngine() && question.id === systemIds.budgetPriorityQuestionId && behaviors.budgetPriority.enabled) {
|
|
552
554
|
// Les options du module sont maintenant des clés i18n (ex: "intro_options.budget_priority_venue")
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
555
|
+
// ⚠️ PAS DE FALLBACK - Les options doivent être chargées depuis la DB
|
|
556
|
+
// Si question.options est vide, c'est une erreur de configuration
|
|
557
|
+
if (!question.options || question.options.length === 0) {
|
|
558
|
+
console.error(`[QuestionEngine] Question ${question.id} has no options - options must be loaded from database`);
|
|
559
|
+
}
|
|
560
|
+
const loadedOptions = question.options || [];
|
|
556
561
|
// Traduire les options pour le filtrage
|
|
557
562
|
const translatedOptions = loadedOptions.map(opt => {
|
|
558
563
|
if (opt.includes('.') && !opt.includes(' ')) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { QuestionEngine, getQuestionEngine, resetQuestionEngine } from './engine';
|
|
2
2
|
export type { I18nFunctions } from './types';
|
|
3
3
|
export type { QuestionType, ModuleCategory, ModuleQuestion, SubQuestionTemplate, QuestionTrigger, TriggerCondition, TriggerAction, ModuleTrigger, ModuleTriggerCondition, QuestionModule, QueuedModule, QueuedQuestion, QueueState, AnsweredQuestion, UserPriority, PriorityBoost, } from './types';
|
|
4
|
-
export { PRIORITY_TO_MODULES, PRIORITY_BOOSTS, BOOKED_PROVIDER_TO_MODULE, PRIORITY_TO_BOOKED_PROVIDERS, BASE_PRIORITIES, } from './types';
|
|
5
4
|
export type { ChatbotConfig } from './config-loader';
|
|
6
5
|
export { getPriorityMappings, getBookedProviderMappings, getBasePriorities, getPriorityBoosts, getSystemIds, getPriorityToBookedProviders, getPriorityCalculation, getSpecialBehaviors, } from './config-loader';
|
|
7
6
|
export type { EngineType, EngineConfig, SimpleEngineConfig, AdvancedEngineConfig, CustomEngineConfig } from './engine-types';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AACjF,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC5C,YAAY,EACV,YAAY,EACZ,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,cAAc,EACd,YAAY,EACZ,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,aAAa,GACd,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AACjF,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC5C,YAAY,EACV,YAAY,EACZ,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,cAAc,EACd,YAAY,EACZ,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,aAAa,GACd,MAAM,SAAS,CAAA;AAKhB,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,4BAA4B,EAC5B,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,iBAAiB,CAAA;AAExB,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAC5H,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAE1E,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EACL,2BAA2B,EAC3B,iCAAiC,EACjC,yBAAyB,EACzB,eAAe,GAChB,MAAM,uBAAuB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// QUESTION ENGINE - EXPORTS PRINCIPAUX
|
|
3
3
|
// =====================================================
|
|
4
4
|
export { QuestionEngine, getQuestionEngine, resetQuestionEngine } from './engine';
|
|
5
|
-
export { PRIORITY_TO_MODULES, PRIORITY_BOOSTS, BOOKED_PROVIDER_TO_MODULE, PRIORITY_TO_BOOKED_PROVIDERS, BASE_PRIORITIES, } from './types';
|
|
6
5
|
export { getPriorityMappings, getBookedProviderMappings, getBasePriorities, getPriorityBoosts, getSystemIds, getPriorityToBookedProviders, getPriorityCalculation, getSpecialBehaviors, } from './config-loader';
|
|
7
6
|
export { isValidEngineType, getDefaultEngineConfig } from './engine-types';
|
|
8
7
|
export { loadAllAIQuestionsForSector, convertAIQuestionToModuleQuestion, findQuestionIndexInModule, checkConditions, } from './ai-questions-loader';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export type QuestionType = "text" | "email" | "phone" | "number" | "date" | "select" | "multiselect" | "yesno" | "priority_order" | "info";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* ⚠️ SUPPRIMÉ : ModuleCategory type hardcodé
|
|
4
|
+
*
|
|
5
|
+
* Les catégories sont maintenant chargées dynamiquement depuis la base de données
|
|
6
|
+
* via l'enum PostgreSQL `module_category`. Utiliser `string` directement.
|
|
7
|
+
*/
|
|
8
|
+
export type ModuleCategory = string;
|
|
3
9
|
export interface ModuleQuestion {
|
|
4
10
|
id: string;
|
|
5
11
|
text: string;
|
|
@@ -107,19 +113,29 @@ export interface AnsweredQuestion {
|
|
|
107
113
|
answer: string | string[] | number | boolean;
|
|
108
114
|
answeredAt: Date;
|
|
109
115
|
}
|
|
110
|
-
|
|
116
|
+
/**
|
|
117
|
+
* ⚠️ SUPPRIMÉ : UserPriority type hardcodé
|
|
118
|
+
*
|
|
119
|
+
* Ce type contenait des valeurs hardcodées spécifiques à "wedding-planner" :
|
|
120
|
+
* - "Le lieu de réception"
|
|
121
|
+
* - "La gastronomie et le repas"
|
|
122
|
+
* - "La robe de mariée"
|
|
123
|
+
* - etc.
|
|
124
|
+
*
|
|
125
|
+
* Ces valeurs ne fonctionnent que pour "wedding-planner" et ne sont pas scalables
|
|
126
|
+
* pour d'autres types de chatbots (ex: "digital" a des priorités différentes).
|
|
127
|
+
*
|
|
128
|
+
* Les priorités sont maintenant chargées dynamiquement depuis la base de données
|
|
129
|
+
* via `priorityMappings` dans `ChatbotConfig`. Les clés sont des strings arbitraires
|
|
130
|
+
* définies en DB pour chaque type de chatbot.
|
|
131
|
+
*
|
|
132
|
+
* Utiliser `string` directement pour les priorités utilisateur.
|
|
133
|
+
*/
|
|
134
|
+
export type UserPriority = string;
|
|
111
135
|
export interface PriorityBoost {
|
|
112
136
|
moduleId: string;
|
|
113
137
|
boost: number;
|
|
114
138
|
}
|
|
115
|
-
export declare const PRIORITY_TO_MODULES: Record<string, string[]>;
|
|
116
|
-
export declare const PRIORITY_BOOSTS: Record<UserPriority, PriorityBoost[]>;
|
|
117
|
-
export declare const BOOKED_PROVIDER_TO_MODULE: Record<string, {
|
|
118
|
-
moduleId: string;
|
|
119
|
-
skipQuestion: string;
|
|
120
|
-
}>;
|
|
121
|
-
export declare const PRIORITY_TO_BOOKED_PROVIDERS: Record<string, string[]>;
|
|
122
|
-
export declare const BASE_PRIORITIES: Record<string, number>;
|
|
123
139
|
/**
|
|
124
140
|
* Interface pour les fonctions i18n nécessaires au QuestionEngine
|
|
125
141
|
* Ces fonctions doivent être fournies par le projet consommateur
|
|
@@ -134,10 +150,16 @@ export interface I18nFunctions {
|
|
|
134
150
|
*/
|
|
135
151
|
t: (key: string, params?: Record<string, any>, lang?: string) => string;
|
|
136
152
|
/**
|
|
137
|
-
*
|
|
153
|
+
* ⚠️ DÉPRÉCIÉ : getQuestionOptions()
|
|
154
|
+
*
|
|
155
|
+
* Cette fonction ne devrait plus être utilisée. Les options doivent être chargées
|
|
156
|
+
* depuis la base de données et passées directement dans question.options.
|
|
157
|
+
*
|
|
158
|
+
* Conservée uniquement pour compatibilité avec le code existant, mais retourne toujours [].
|
|
159
|
+
*
|
|
138
160
|
* @param questionId - ID de la question
|
|
139
|
-
* @param lang - Langue optionnelle (
|
|
140
|
-
* @returns Tableau
|
|
161
|
+
* @param lang - Langue optionnelle (ignorée)
|
|
162
|
+
* @returns Tableau vide (les options doivent être en DB)
|
|
141
163
|
*/
|
|
142
164
|
getQuestionOptions: (questionId: string, lang?: string) => string[];
|
|
143
165
|
}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,OAAO,GACP,OAAO,GACP,QAAQ,GACR,MA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,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,iBAAiB,EAAE,gBAAgB,EAAE,CAAA;IACrC,UAAU,EAAE,OAAO,CAAA;IACnB,cAAc,CAAC,EAAE;QACf,iBAAiB,EAAE,MAAM,CAAA;QACzB,gBAAgB,EAAE,MAAM,CAAA;KACzB,GAAG,IAAI,CAAA;CACT;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,OAAO,CAAA;IAC5C,UAAU,EAAE,IAAI,CAAA;CACjB;AAMD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd;AAUD;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IAEvE;;;;;;;;;;;OAWG;IACH,kBAAkB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,MAAM,EAAE,CAAA;CACpE"}
|
package/dist/types.js
CHANGED
|
@@ -2,97 +2,4 @@
|
|
|
2
2
|
// QUESTION ENGINE - TYPES & INTERFACES
|
|
3
3
|
// Architecture modulaire pour le questionnaire Aimi
|
|
4
4
|
// =====================================================
|
|
5
|
-
|
|
6
|
-
export const PRIORITY_TO_MODULES = {
|
|
7
|
-
"Le lieu de réception": ["venue"],
|
|
8
|
-
"La gastronomie et le repas": ["catering", "cake"],
|
|
9
|
-
"Les photos et vidéos": ["photography", "videography"],
|
|
10
|
-
"La musique et l'animation": ["music"],
|
|
11
|
-
"L'ambiance et la décoration": ["decoration", "flowers"], // Les fleurs font partie de l'ambiance
|
|
12
|
-
"La robe de mariée": ["dress"],
|
|
13
|
-
"Le costume": ["suit"],
|
|
14
|
-
};
|
|
15
|
-
export const PRIORITY_BOOSTS = {
|
|
16
|
-
"Le lieu de réception": [
|
|
17
|
-
{ moduleId: "venue", boost: -100 },
|
|
18
|
-
],
|
|
19
|
-
"La gastronomie et le repas": [
|
|
20
|
-
{ moduleId: "catering", boost: -350 },
|
|
21
|
-
{ moduleId: "cake", boost: -200 },
|
|
22
|
-
],
|
|
23
|
-
"Les photos et vidéos": [
|
|
24
|
-
{ moduleId: "photography", boost: -350 },
|
|
25
|
-
{ moduleId: "videography", boost: -300 },
|
|
26
|
-
],
|
|
27
|
-
"La musique et l'animation": [
|
|
28
|
-
{ moduleId: "music", boost: -350 },
|
|
29
|
-
],
|
|
30
|
-
"L'ambiance et la décoration": [
|
|
31
|
-
{ moduleId: "decoration", boost: -400 },
|
|
32
|
-
{ moduleId: "flowers", boost: -350 }, // Les fleurs font partie de l'ambiance et décoration
|
|
33
|
-
],
|
|
34
|
-
"La robe de mariée": [
|
|
35
|
-
{ moduleId: "dress", boost: -350 },
|
|
36
|
-
],
|
|
37
|
-
"Le costume": [
|
|
38
|
-
{ moduleId: "suit", boost: -350 },
|
|
39
|
-
],
|
|
40
|
-
};
|
|
41
|
-
// =====================================================
|
|
42
|
-
// MAPPING PRESTATAIRES RÉSERVÉS -> MODULES
|
|
43
|
-
// =====================================================
|
|
44
|
-
// Mapping entre les options de booked_providers et les modules correspondants
|
|
45
|
-
// Quand un prestataire est réservé, le module entier est skippé
|
|
46
|
-
// skipQuestion = entryQuestionId du module (première question)
|
|
47
|
-
export const BOOKED_PROVIDER_TO_MODULE = {
|
|
48
|
-
"Lieu de réception": { moduleId: "venue", skipQuestion: "venue_type_preference" },
|
|
49
|
-
"Traiteur": { moduleId: "catering", skipQuestion: "meal_style" },
|
|
50
|
-
"Photographe": { moduleId: "photography", skipQuestion: "photo_style" },
|
|
51
|
-
"Vidéaste": { moduleId: "videography", skipQuestion: "video_style" },
|
|
52
|
-
"DJ / Musicien": { moduleId: "music", skipQuestion: "music_preference" },
|
|
53
|
-
"Fleuriste": { moduleId: "flowers", skipQuestion: "flower_style" },
|
|
54
|
-
"Décorateur": { moduleId: "decoration", skipQuestion: "wedding_theme" },
|
|
55
|
-
"Pâtissier (gâteau)": { moduleId: "cake", skipQuestion: "cake_style" },
|
|
56
|
-
"Officiant de cérémonie": { moduleId: "ceremony", skipQuestion: "ceremony_type" },
|
|
57
|
-
// Note: Coiffeur/Maquilleur n'est pas mappé car c'est indépendant des tenues
|
|
58
|
-
// Note: Wedding planner n'est pas dans la liste car Aimi EST le wedding planner
|
|
59
|
-
};
|
|
60
|
-
// Mapping inverse : option de priorité -> options de booked_providers correspondantes
|
|
61
|
-
// Note: "Les tenues" n'a pas de mapping car il n'y a pas de prestataire "Robe" ou "Costume"
|
|
62
|
-
// dans la liste des prestataires réservables (c'est une recherche personnelle)
|
|
63
|
-
export const PRIORITY_TO_BOOKED_PROVIDERS = {
|
|
64
|
-
"Le lieu de réception": ["Lieu de réception"],
|
|
65
|
-
"La gastronomie et le repas": ["Traiteur", "Pâtissier (gâteau)"],
|
|
66
|
-
"Les photos et vidéos": ["Photographe", "Vidéaste"],
|
|
67
|
-
"La musique et l'animation": ["DJ / Musicien"],
|
|
68
|
-
"L'ambiance et la décoration": ["Décorateur", "Fleuriste"], // Inclut les fleurs
|
|
69
|
-
"La robe de mariée": [], // Pas de prestataire associé
|
|
70
|
-
"Le costume": [], // Pas de prestataire associé
|
|
71
|
-
};
|
|
72
|
-
// =====================================================
|
|
73
|
-
// CONSTANTES DE PRIORITÉ DE BASE
|
|
74
|
-
// =====================================================
|
|
75
|
-
export const BASE_PRIORITIES = {
|
|
76
|
-
// Module fixe (toujours au début)
|
|
77
|
-
intro: 0, // Date, invités, budget, coordonnées, priorité
|
|
78
|
-
// Modules réorganisables selon priorité utilisateur (200-599)
|
|
79
|
-
venue: 200,
|
|
80
|
-
catering: 250,
|
|
81
|
-
photography: 300,
|
|
82
|
-
videography: 350,
|
|
83
|
-
music: 400,
|
|
84
|
-
flowers: 450,
|
|
85
|
-
decoration: 500,
|
|
86
|
-
dress: 550, // Secteur : robe de mariée
|
|
87
|
-
suit: 560, // Secteur : costume
|
|
88
|
-
// Cérémonie - traité comme les autres prestataires
|
|
89
|
-
ceremony: 575,
|
|
90
|
-
// Modules secondaires (600+)
|
|
91
|
-
cake: 600,
|
|
92
|
-
rings: 650,
|
|
93
|
-
stationery: 700,
|
|
94
|
-
transport: 750,
|
|
95
|
-
honeymoon: 800,
|
|
96
|
-
// Module final (toujours à la fin)
|
|
97
|
-
final: 1000,
|
|
98
|
-
};
|
|
5
|
+
export {};
|