@useinsider/guido 3.19.0 → 3.20.0-beta.0849ec7
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 +22 -3
- package/dist/@types/config/schemas.js +76 -53
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +102 -86
- package/dist/components/organisms/AutoSaveController.vue2.js +9 -8
- package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
- package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
- package/dist/components/organisms/base/Toaster.vue2.js +13 -12
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +13 -11
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +78 -57
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +18 -0
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +25 -0
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +28 -42
- package/dist/components/organisms/header/EditorActions.vue.js +5 -5
- package/dist/components/organisms/header/EditorActions.vue2.js +90 -57
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +16 -12
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +28 -24
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +46 -0
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +47 -0
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +20 -0
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +49 -0
- package/dist/components/wrappers/WpDrawer.vue.js +9 -7
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/components/wrappers/WpModal.vue.js +1 -1
- package/dist/components/wrappers/WpModal.vue2.js +4 -3
- package/dist/composables/useActionsApi.js +52 -47
- package/dist/composables/useAuthError.js +52 -0
- package/dist/composables/useAutoSave.js +11 -11
- package/dist/composables/useCodeEditorApi.js +23 -9
- package/dist/composables/useCortexBlueprintBridge.js +122 -54
- package/dist/composables/useCustomInterfaceAppearance.js +65 -51
- package/dist/composables/useEmailTemplateApplier.js +111 -50
- package/dist/composables/useHtmlCompiler.js +37 -26
- package/dist/composables/useHtmlValidator.js +89 -82
- package/dist/composables/useHttp.js +64 -54
- package/dist/composables/useLegacyStrategyConversion.js +65 -0
- package/dist/composables/useRecommendation.js +40 -35
- package/dist/composables/useSave.js +90 -45
- package/dist/composables/useSaveValidation.js +282 -0
- package/dist/composables/useSaveValidationRollout.js +9 -0
- package/dist/composables/useStripo.js +43 -39
- package/dist/composables/useToaster.js +18 -22
- package/dist/composables/useTranslations.js +3 -2
- package/dist/composables/useVersionHistoryApi.js +33 -24
- package/dist/composables/validators/useCouponBlockValidator.js +24 -21
- package/dist/composables/validators/useLiquidValidator.js +15 -15
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +34 -27
- package/dist/config/migrator/index.js +14 -13
- package/dist/config/migrator/itemsBlockMigrator.js +236 -248
- package/dist/config/migrator/recommendationMigrator.js +28 -21
- package/dist/config/migrator/recommendationPartnerMigrator.js +56 -0
- package/dist/enums/extensions/recommendationBlock.js +51 -34
- package/dist/enums/save-validation.js +4 -0
- package/dist/extensions/Blocks/Items/constants/cardLayout.js +20 -0
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +18 -17
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +114 -105
- package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +11 -9
- package/dist/extensions/Blocks/Items/template.js +219 -204
- package/dist/extensions/Blocks/Recommendation/block.js +65 -45
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +21 -20
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +103 -90
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +150 -52
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -74
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +274 -92
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +42 -0
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +26 -16
- package/dist/extensions/Blocks/Recommendation/utils/partnerCustomizations.js +3 -1
- package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +25 -0
- package/dist/extensions/Blocks/Recommendation/utils/productIds.js +5 -3
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +24 -0
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +21 -12
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +46 -37
- package/dist/src/@types/config/schemas.d.ts +36 -0
- package/dist/src/@types/save-validation.d.ts +19 -0
- package/dist/src/components/Guido.vue.d.ts +17 -1
- package/dist/src/components/organisms/base/AuthErrorModal.vue.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +17 -1
- package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +2 -0
- package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +2 -0
- package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +2 -0
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
- package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
- package/dist/src/composables/useAuthError.d.ts +12 -0
- package/dist/src/composables/useConfig.d.ts +8 -0
- package/dist/src/composables/useCortexBlueprintBridge.d.ts +2 -3
- package/dist/src/composables/useEmailTemplateApplier.d.ts +18 -5
- package/dist/src/composables/useGuidoActions.d.ts +2 -0
- package/dist/src/composables/useHtmlValidator.d.ts +21 -0
- package/dist/src/composables/useHttp.d.ts +2 -0
- package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
- package/dist/src/composables/useSave.d.ts +6 -1
- package/dist/src/composables/useSaveValidation.d.ts +6 -0
- package/dist/src/composables/useSaveValidationRollout.d.ts +3 -0
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
- package/dist/src/config/migrator/index.d.ts +2 -1
- package/dist/src/config/migrator/recommendationPartnerMigrator.d.ts +19 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +7 -1
- package/dist/src/enums/save-validation.d.ts +27 -0
- package/dist/src/extensions/Blocks/Items/constants/cardLayout.d.ts +44 -0
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +3 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +19 -0
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +7 -2
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +162 -1
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +32 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +33 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/productIds.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +14 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +4 -0
- package/dist/src/mock/cortexChatStore.d.ts +12 -0
- package/dist/src/services/recommendationApi.d.ts +2 -1
- package/dist/src/stores/config.d.ts +374 -0
- package/dist/src/stores/guido-email-editor.d.ts +20 -10
- package/dist/src/stores/onboarding.d.ts +812 -10
- package/dist/src/stores/recommendation.d.ts +5 -0
- package/dist/src/stores/save-validation.d.ts +22 -0
- package/dist/src/utils/dateUtil.d.ts +10 -0
- package/dist/src/utils/genericUtil.d.ts +3 -0
- package/dist/src/utils/stripoEditorApi.d.ts +4 -0
- package/dist/src/utils/templatePreparation.d.ts +30 -0
- package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
- package/dist/static/assets/icons/line-info.svg.js +5 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +113 -9
- package/dist/static/styles/components/skeleton.css.js +23 -0
- package/dist/static/styles/components/version-history.css.js +2 -6
- package/dist/stores/config.js +55 -24
- package/dist/stores/guido-email-editor.js +3 -1
- package/dist/stores/onboarding.js +50 -36
- package/dist/stores/save-validation.js +30 -0
- package/dist/stores/unsubscribe.js +3 -3
- package/dist/utils/pairProductVariables.js +71 -71
- package/dist/utils/stripoEditorApi.js +11 -0
- package/dist/utils/templatePreparation.js +54 -51
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Orientation, Languages, Currency, NumericSeparator, FiltersResponse, Filter, RecommendationCampaignUrlValue, RecommendationProduct, RrsStrategy } from '@@/Types/recommendation';
|
|
1
|
+
import type { Orientation, Languages, Currency, NumericSeparator, FiltersResponse, Filter, RecommendationCampaignUrlValue, RecommendationProduct, RrsMigrationPayload, RrsMigrationTarget, RrsStrategy } from '@@/Types/recommendation';
|
|
2
2
|
export interface PerBlockConfigs {
|
|
3
3
|
cardsInRow: number;
|
|
4
4
|
currencySettings: {
|
|
@@ -22,6 +22,7 @@ export interface PerBlockConfigs {
|
|
|
22
22
|
shuffleProducts: boolean;
|
|
23
23
|
strategy: string;
|
|
24
24
|
strategyId: string;
|
|
25
|
+
nodeConfigVersion: number;
|
|
25
26
|
textTrimming: boolean;
|
|
26
27
|
unresponsive: boolean;
|
|
27
28
|
size: string;
|
|
@@ -36,6 +37,7 @@ interface PerBlockState {
|
|
|
36
37
|
filterSelectionDrawerStatus: boolean;
|
|
37
38
|
assignStrategyDrawerStatus: boolean;
|
|
38
39
|
removeStrategyModalStatus: boolean;
|
|
40
|
+
legacyStrategyUpdatedModalStatus: boolean;
|
|
39
41
|
filterGroup: number;
|
|
40
42
|
/** Whether initial API data (filters, algorithms, products) has been fetched for this block */
|
|
41
43
|
isInitialized: boolean;
|
|
@@ -51,6 +53,7 @@ interface PerBlockState {
|
|
|
51
53
|
* same id skipped the re-sync and kept the defaults (SD-150347).
|
|
52
54
|
*/
|
|
53
55
|
syncedConfigFingerprint: string | null;
|
|
56
|
+
legacyConversionLoading: boolean;
|
|
54
57
|
}
|
|
55
58
|
/**
|
|
56
59
|
* Persisted-config subset used by `seedBlockUrlConfig` to reconstruct
|
|
@@ -83,8 +86,11 @@ interface StoreState {
|
|
|
83
86
|
strategies: RrsStrategy[];
|
|
84
87
|
strategiesLoading: boolean;
|
|
85
88
|
strategyUrlTemplates: Record<string, string>;
|
|
89
|
+
strategiesFetched: boolean;
|
|
90
|
+
strategiesSettled: boolean;
|
|
86
91
|
blockStates: Record<number, PerBlockState>;
|
|
87
92
|
currentRecommendationId: number | null;
|
|
93
|
+
strategyPanelOpen: boolean;
|
|
88
94
|
configVersion: number;
|
|
89
95
|
}
|
|
90
96
|
export declare const useRecommendationExtensionStore: import("pinia").StoreDefinition<"guidoRecommendationExtension", StoreState, {
|
|
@@ -111,8 +117,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
111
117
|
}[];
|
|
112
118
|
strategiesLoading: boolean;
|
|
113
119
|
strategyUrlTemplates: Record<string, string>;
|
|
120
|
+
strategiesFetched: boolean;
|
|
121
|
+
strategiesSettled: boolean;
|
|
114
122
|
blockStates: Record<number, PerBlockState>;
|
|
115
123
|
currentRecommendationId: number | null;
|
|
124
|
+
strategyPanelOpen: boolean;
|
|
116
125
|
configVersion: number;
|
|
117
126
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): PerBlockConfigs;
|
|
118
127
|
/**
|
|
@@ -137,8 +146,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
137
146
|
}[];
|
|
138
147
|
strategiesLoading: boolean;
|
|
139
148
|
strategyUrlTemplates: Record<string, string>;
|
|
149
|
+
strategiesFetched: boolean;
|
|
150
|
+
strategiesSettled: boolean;
|
|
140
151
|
blockStates: Record<number, PerBlockState>;
|
|
141
152
|
currentRecommendationId: number | null;
|
|
153
|
+
strategyPanelOpen: boolean;
|
|
142
154
|
configVersion: number;
|
|
143
155
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): RecommendationProduct[];
|
|
144
156
|
/**
|
|
@@ -163,8 +175,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
163
175
|
}[];
|
|
164
176
|
strategiesLoading: boolean;
|
|
165
177
|
strategyUrlTemplates: Record<string, string>;
|
|
178
|
+
strategiesFetched: boolean;
|
|
179
|
+
strategiesSettled: boolean;
|
|
166
180
|
blockStates: Record<number, PerBlockState>;
|
|
167
181
|
currentRecommendationId: number | null;
|
|
182
|
+
strategyPanelOpen: boolean;
|
|
168
183
|
configVersion: number;
|
|
169
184
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
170
185
|
assignStrategyDrawerStatus(state: {
|
|
@@ -186,8 +201,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
186
201
|
}[];
|
|
187
202
|
strategiesLoading: boolean;
|
|
188
203
|
strategyUrlTemplates: Record<string, string>;
|
|
204
|
+
strategiesFetched: boolean;
|
|
205
|
+
strategiesSettled: boolean;
|
|
189
206
|
blockStates: Record<number, PerBlockState>;
|
|
190
207
|
currentRecommendationId: number | null;
|
|
208
|
+
strategyPanelOpen: boolean;
|
|
191
209
|
configVersion: number;
|
|
192
210
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
193
211
|
removeStrategyModalStatus(state: {
|
|
@@ -209,8 +227,64 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
209
227
|
}[];
|
|
210
228
|
strategiesLoading: boolean;
|
|
211
229
|
strategyUrlTemplates: Record<string, string>;
|
|
230
|
+
strategiesFetched: boolean;
|
|
231
|
+
strategiesSettled: boolean;
|
|
212
232
|
blockStates: Record<number, PerBlockState>;
|
|
213
233
|
currentRecommendationId: number | null;
|
|
234
|
+
strategyPanelOpen: boolean;
|
|
235
|
+
configVersion: number;
|
|
236
|
+
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
237
|
+
isLegacyStrategyBlock(): boolean;
|
|
238
|
+
legacyConversionLoading(state: {
|
|
239
|
+
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
240
|
+
activePredictiveAlgorithms: number[];
|
|
241
|
+
languages: Languages;
|
|
242
|
+
currencyList: {
|
|
243
|
+
text: string;
|
|
244
|
+
value: string;
|
|
245
|
+
}[];
|
|
246
|
+
filterList: FiltersResponse;
|
|
247
|
+
strategies: {
|
|
248
|
+
[x: string]: unknown;
|
|
249
|
+
strategy_id: number;
|
|
250
|
+
name: string;
|
|
251
|
+
status: string;
|
|
252
|
+
suitable_channels: string;
|
|
253
|
+
size?: (number | string) | undefined;
|
|
254
|
+
}[];
|
|
255
|
+
strategiesLoading: boolean;
|
|
256
|
+
strategyUrlTemplates: Record<string, string>;
|
|
257
|
+
strategiesFetched: boolean;
|
|
258
|
+
strategiesSettled: boolean;
|
|
259
|
+
blockStates: Record<number, PerBlockState>;
|
|
260
|
+
currentRecommendationId: number | null;
|
|
261
|
+
strategyPanelOpen: boolean;
|
|
262
|
+
configVersion: number;
|
|
263
|
+
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
264
|
+
legacyStrategyUpdatedModalStatus(state: {
|
|
265
|
+
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
266
|
+
activePredictiveAlgorithms: number[];
|
|
267
|
+
languages: Languages;
|
|
268
|
+
currencyList: {
|
|
269
|
+
text: string;
|
|
270
|
+
value: string;
|
|
271
|
+
}[];
|
|
272
|
+
filterList: FiltersResponse;
|
|
273
|
+
strategies: {
|
|
274
|
+
[x: string]: unknown;
|
|
275
|
+
strategy_id: number;
|
|
276
|
+
name: string;
|
|
277
|
+
status: string;
|
|
278
|
+
suitable_channels: string;
|
|
279
|
+
size?: (number | string) | undefined;
|
|
280
|
+
}[];
|
|
281
|
+
strategiesLoading: boolean;
|
|
282
|
+
strategyUrlTemplates: Record<string, string>;
|
|
283
|
+
strategiesFetched: boolean;
|
|
284
|
+
strategiesSettled: boolean;
|
|
285
|
+
blockStates: Record<number, PerBlockState>;
|
|
286
|
+
currentRecommendationId: number | null;
|
|
287
|
+
strategyPanelOpen: boolean;
|
|
214
288
|
configVersion: number;
|
|
215
289
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
216
290
|
assignedStrategy(state: {
|
|
@@ -232,8 +306,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
232
306
|
}[];
|
|
233
307
|
strategiesLoading: boolean;
|
|
234
308
|
strategyUrlTemplates: Record<string, string>;
|
|
309
|
+
strategiesFetched: boolean;
|
|
310
|
+
strategiesSettled: boolean;
|
|
235
311
|
blockStates: Record<number, PerBlockState>;
|
|
236
312
|
currentRecommendationId: number | null;
|
|
313
|
+
strategyPanelOpen: boolean;
|
|
237
314
|
configVersion: number;
|
|
238
315
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): RrsStrategy | null;
|
|
239
316
|
/**
|
|
@@ -258,8 +335,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
258
335
|
}[];
|
|
259
336
|
strategiesLoading: boolean;
|
|
260
337
|
strategyUrlTemplates: Record<string, string>;
|
|
338
|
+
strategiesFetched: boolean;
|
|
339
|
+
strategiesSettled: boolean;
|
|
261
340
|
blockStates: Record<number, PerBlockState>;
|
|
262
341
|
currentRecommendationId: number | null;
|
|
342
|
+
strategyPanelOpen: boolean;
|
|
263
343
|
configVersion: number;
|
|
264
344
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
265
345
|
/**
|
|
@@ -284,8 +364,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
284
364
|
}[];
|
|
285
365
|
strategiesLoading: boolean;
|
|
286
366
|
strategyUrlTemplates: Record<string, string>;
|
|
367
|
+
strategiesFetched: boolean;
|
|
368
|
+
strategiesSettled: boolean;
|
|
287
369
|
blockStates: Record<number, PerBlockState>;
|
|
288
370
|
currentRecommendationId: number | null;
|
|
371
|
+
strategyPanelOpen: boolean;
|
|
289
372
|
configVersion: number;
|
|
290
373
|
} & import("pinia").PiniaCustomStateProperties<StoreState>): number;
|
|
291
374
|
hasFilters(): boolean;
|
|
@@ -311,8 +394,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
311
394
|
}[];
|
|
312
395
|
strategiesLoading: boolean;
|
|
313
396
|
strategyUrlTemplates: Record<string, string>;
|
|
397
|
+
strategiesFetched: boolean;
|
|
398
|
+
strategiesSettled: boolean;
|
|
314
399
|
blockStates: Record<number, PerBlockState>;
|
|
315
400
|
currentRecommendationId: number | null;
|
|
401
|
+
strategyPanelOpen: boolean;
|
|
316
402
|
configVersion: number;
|
|
317
403
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
318
404
|
text: string;
|
|
@@ -337,8 +423,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
337
423
|
}[];
|
|
338
424
|
strategiesLoading: boolean;
|
|
339
425
|
strategyUrlTemplates: Record<string, string>;
|
|
426
|
+
strategiesFetched: boolean;
|
|
427
|
+
strategiesSettled: boolean;
|
|
340
428
|
blockStates: Record<number, PerBlockState>;
|
|
341
429
|
currentRecommendationId: number | null;
|
|
430
|
+
strategyPanelOpen: boolean;
|
|
342
431
|
configVersion: number;
|
|
343
432
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
344
433
|
text: string;
|
|
@@ -363,8 +452,11 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
363
452
|
}[];
|
|
364
453
|
strategiesLoading: boolean;
|
|
365
454
|
strategyUrlTemplates: Record<string, string>;
|
|
455
|
+
strategiesFetched: boolean;
|
|
456
|
+
strategiesSettled: boolean;
|
|
366
457
|
blockStates: Record<number, PerBlockState>;
|
|
367
458
|
currentRecommendationId: number | null;
|
|
459
|
+
strategyPanelOpen: boolean;
|
|
368
460
|
configVersion: number;
|
|
369
461
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
370
462
|
text: string;
|
|
@@ -390,6 +482,10 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
390
482
|
/**
|
|
391
483
|
* Deep-clones a block's state and mirrors its campaign URL under a new id.
|
|
392
484
|
* Invoked from `onCreated` when a duplicate is detected (SD-142352).
|
|
485
|
+
*
|
|
486
|
+
* The clone keeps the source's data but drops its "already fetched / already
|
|
487
|
+
* synced" claims for strategy blocks, so it fetches again like a fresh drop
|
|
488
|
+
* (SD-149916).
|
|
393
489
|
*/
|
|
394
490
|
cloneBlockState(sourceId: number, newId: number): void;
|
|
395
491
|
/**
|
|
@@ -442,11 +538,65 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
442
538
|
cancelFilterDrawer(): void;
|
|
443
539
|
openAssignStrategyDrawer(): void;
|
|
444
540
|
closeAssignStrategyDrawer(): void;
|
|
541
|
+
openLegacyStrategyUpdatedModal(): void;
|
|
542
|
+
closeLegacyStrategyUpdatedModal(): void;
|
|
445
543
|
openRemoveStrategyModal(): void;
|
|
446
544
|
closeRemoveStrategyModal(): void;
|
|
447
545
|
fetchStrategies(): Promise<void>;
|
|
546
|
+
/**
|
|
547
|
+
* Clears what a block inherited from the id it arrived holding, so the panel fetches for it.
|
|
548
|
+
* A re-dropped saved module can keep the source's id — and its "already fetched" entry —
|
|
549
|
+
* while the strategy's product count has moved on (SD-149916).
|
|
550
|
+
*/
|
|
551
|
+
resetArrivedBlock(id: number): void;
|
|
552
|
+
invalidateStrategies(): void;
|
|
553
|
+
/**
|
|
554
|
+
* Opens a Smart Recommender strategy page in a new tab and refreshes the list every time
|
|
555
|
+
* the user comes back. `visibilitychange` only: a `focus` listener would also fire when
|
|
556
|
+
* focus merely returns from the Stripo canvas iframe to the panel, refetching and
|
|
557
|
+
* regenerating the canvas while the user never left the editor (SD-149916).
|
|
558
|
+
*
|
|
559
|
+
* Deliberately NOT one-shot: the strategy tab stays open, so a user can create a second
|
|
560
|
+
* strategy in it and come back again — a listener that disarmed on the first return would
|
|
561
|
+
* leave that one missing from the list. It disarms on the first return AFTER that tab is
|
|
562
|
+
* closed instead, so an ordinary alt-tab later in the session costs nothing. Armed only
|
|
563
|
+
* once the user actually opens a strategy page, so anyone who never does pays nothing.
|
|
564
|
+
* @returns whether a tab actually opened, so callers can skip work that assumes one did
|
|
565
|
+
*/
|
|
566
|
+
_armStrategyPageReturn(url: string): boolean;
|
|
567
|
+
/**
|
|
568
|
+
* Reloads the products of the block the user is on, so an edit made in the strategy tab
|
|
569
|
+
* lands on the canvas instead of waiting for the assign drawer to be reopened.
|
|
570
|
+
*
|
|
571
|
+
* Only the selected block: the canvas regeneration is driven off the active block's
|
|
572
|
+
* product array, so refreshing an unselected block would fetch without redrawing it.
|
|
573
|
+
*/
|
|
574
|
+
_refreshAssignedStrategyProducts(): Promise<void>;
|
|
575
|
+
/** Lets the editor tear the return listeners down when it unmounts. */
|
|
576
|
+
disposeStrategyPageReturn(): void;
|
|
577
|
+
/**
|
|
578
|
+
* Opens Smart Recommender's strategy creation page. Every return refreshes the list so the
|
|
579
|
+
* new strategy is offered; the user picks it themselves.
|
|
580
|
+
*/
|
|
581
|
+
openStrategyCreation(): boolean;
|
|
582
|
+
/**
|
|
583
|
+
* Opens the strategy's edit page. Every return refreshes the list so the block reflects the
|
|
584
|
+
* edited configuration.
|
|
585
|
+
*/
|
|
586
|
+
openStrategyEdit(strategyId: string | number): boolean;
|
|
448
587
|
resolveStrategyUrlTemplate(strategy: RrsStrategy, currency: string): Promise<string>;
|
|
449
588
|
assignStrategy(strategy: RrsStrategy): void;
|
|
589
|
+
convertLegacyStrategy(payload: RrsMigrationPayload, target?: RrsMigrationTarget): Promise<string>;
|
|
590
|
+
/**
|
|
591
|
+
* Undoes the config half of a conversion whose document write never landed, so the
|
|
592
|
+
* panel and the drawer fall back to "Legacy Strategy" instead of showing an assignment
|
|
593
|
+
* the document never received.
|
|
594
|
+
*/
|
|
595
|
+
revertLegacyConversion(blockId: number, previous: {
|
|
596
|
+
strategyId: string;
|
|
597
|
+
size: string;
|
|
598
|
+
nodeConfigVersion: number;
|
|
599
|
+
}): void;
|
|
450
600
|
removeStrategy(): void;
|
|
451
601
|
fetchRecommendationCreateData(): Promise<void>;
|
|
452
602
|
fetchRecommendationFilters(): Promise<void>;
|
|
@@ -462,8 +612,19 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
462
612
|
* every block's recommendationConfigs across user edits.
|
|
463
613
|
*/
|
|
464
614
|
hasInvalidBlock(): boolean;
|
|
615
|
+
/**
|
|
616
|
+
* Which required fields are missing across the design's blocks, so the save
|
|
617
|
+
* toaster can name the cause instead of always showing the generic message.
|
|
618
|
+
*/
|
|
619
|
+
invalidBlockFields(): string[];
|
|
465
620
|
fetchRecommendationProducts(): Promise<void>;
|
|
466
621
|
_doFetchProducts(): Promise<void>;
|
|
622
|
+
/**
|
|
623
|
+
* Block-scoped counterpart of `fetchRecommendationProducts`, which only ever serves the
|
|
624
|
+
* selected block. The legacy conversion must refresh the products of the block that
|
|
625
|
+
* started it even after the user selected another one.
|
|
626
|
+
*/
|
|
627
|
+
fetchStrategyProductsForBlock(blockId: number): Promise<void>;
|
|
467
628
|
_doFetchStrategyProducts(blockId: number): Promise<void>;
|
|
468
629
|
_setBlockProducts(blockId: number, products: RecommendationProduct[], size: number): void;
|
|
469
630
|
}>;
|
|
@@ -83,6 +83,12 @@ export interface RecommendationNodeConfig {
|
|
|
83
83
|
*/
|
|
84
84
|
filters: Filter[];
|
|
85
85
|
strategyId: string;
|
|
86
|
+
/**
|
|
87
|
+
* Account (`config.partner.name`) that last wrote the strategy config. Strategy ids and
|
|
88
|
+
* attribute types are account-scoped, so a block opened under another account is reset.
|
|
89
|
+
* Absent on blocks saved before SD-151945.
|
|
90
|
+
*/
|
|
91
|
+
partnerName?: string;
|
|
86
92
|
/**
|
|
87
93
|
* Layout orientation
|
|
88
94
|
* - 'grid': Products in a grid, attributes aligned across products
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { RrsMigrationPayload, RrsMigrationTarget } from '@@/Types/recommendation';
|
|
2
|
+
/**
|
|
3
|
+
* A block authored before reusable strategies: it still carries a plain feed
|
|
4
|
+
* configuration (compiled into a feed URL string) instead of a strategy id.
|
|
5
|
+
* Blocks created under RRS stamp at least `RRS_CONFIG_VERSION`, so the version is
|
|
6
|
+
* what separates "never converted" from "not assigned yet".
|
|
7
|
+
*/
|
|
8
|
+
export declare function isLegacyStrategyConfig({ strategyId, nodeConfigVersion }: {
|
|
9
|
+
strategyId: string;
|
|
10
|
+
nodeConfigVersion: number;
|
|
11
|
+
}): boolean;
|
|
12
|
+
export declare function resolveMigrationTarget({ campaignId, templateLibraryId }: {
|
|
13
|
+
campaignId?: string;
|
|
14
|
+
templateLibraryId?: string;
|
|
15
|
+
}): RrsMigrationTarget;
|
|
16
|
+
interface MigrationInputs {
|
|
17
|
+
blockId: number;
|
|
18
|
+
url: string;
|
|
19
|
+
campaignId: string;
|
|
20
|
+
variationId: string;
|
|
21
|
+
strategy: string;
|
|
22
|
+
productIds: string[];
|
|
23
|
+
target: RrsMigrationTarget;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The server names and de-duplicates the strategy, so nothing here derives a name, and the
|
|
27
|
+
* filters travel inside `url` — the endpoint parses the feed URL's filter DSL itself. The two
|
|
28
|
+
* routes take different identity fields — the campaign one names from `campaignId`/`variationId`
|
|
29
|
+
* (0 for modules, which carry no numeric campaign), the template one from `templateId`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildLegacyMigrationPayload({ blockId, url, campaignId, variationId, strategy, productIds, target, }: MigrationInputs): RrsMigrationPayload;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { RecommendationNodeConfig } from '../types/nodeConfig';
|
|
2
|
+
/**
|
|
3
|
+
* Mirrors the backend's `RecommendationCampaignUrls::isDefined`: a legacy feed URL
|
|
4
|
+
* string or an entry that names a strategy.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isDefinedCampaignUrl(value: unknown): boolean;
|
|
7
|
+
export interface PartnerScopeInputs {
|
|
8
|
+
config: Pick<RecommendationNodeConfig, 'strategyId' | 'partnerName'>;
|
|
9
|
+
blockId: number;
|
|
10
|
+
partnerName: string;
|
|
11
|
+
/** `undefined` when the host does not pass the map — the unstamped check is then off. */
|
|
12
|
+
campaignUrls: Record<string, unknown> | undefined;
|
|
13
|
+
/** With RRS off `buildCampaignUrl` drops the block's map entry, so the map says nothing. */
|
|
14
|
+
rrsEnabled: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Whether a block carries another account's strategy config (SD-151945).
|
|
18
|
+
*
|
|
19
|
+
* A stamped block is judged by its stamp. An unstamped one predates the stamp, so it
|
|
20
|
+
* falls back to the backend's own signal: a cross-account duplicate drops the block's
|
|
21
|
+
* strategy entry from the campaign URL map but leaves the HTML untouched. That signal
|
|
22
|
+
* only holds while RRS is on, and only for the HTML the host loaded — which is what
|
|
23
|
+
* the caller, a load-time migrator, runs on.
|
|
24
|
+
*/
|
|
25
|
+
export declare function carriesForeignPartnerConfig({ config, blockId, partnerName, campaignUrls, rrsEnabled }: PartnerScopeInputs): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Whether an unstamped block's ownership can be decided at all. `carriesForeignPartnerConfig`
|
|
28
|
+
* answers `false` both for "clean" and for "cannot tell", and stamping on the latter would
|
|
29
|
+
* record a foreign block as this account's and silence every later check. A block with no
|
|
30
|
+
* strategy reference has nothing foreign to carry, so it is always decidable.
|
|
31
|
+
*/
|
|
32
|
+
export declare function canJudgeUnstampedBlock({ config, campaignUrls, rrsEnabled }: Pick<PartnerScopeInputs, 'config' | 'campaignUrls' | 'rrsEnabled'>): boolean;
|
|
33
|
+
export declare function withoutCustomAttributes(composition: string[]): string[];
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** Separator between product ids in the `sanitizeProductIds` output; split that output with it too. */
|
|
2
|
+
export declare const PRODUCT_ID_SEPARATOR = ",";
|
|
1
3
|
/**
|
|
2
4
|
* Builds the request/URL `productId` value from raw product ID segments.
|
|
3
5
|
* Trimming happens here — NOT on input change — so the user's in-progress
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Writes a strategy change and its products straight to the document, without the settings panel.
|
|
3
|
+
*
|
|
4
|
+
* Every entry point is host-rendered UI outside `ui-editor`, and none of them can rely on the
|
|
5
|
+
* panel control: opening the strategy page deselects the block, so by the time the user comes back
|
|
6
|
+
* and presses Assign the control — and with it the subscription that does the node write, the
|
|
7
|
+
* product fetch and the repaint — is gone. The assignment then reaches Pinia and nothing else
|
|
8
|
+
* (SD-149916).
|
|
9
|
+
*
|
|
10
|
+
* Call AFTER the store change (`assignStrategy` / `removeStrategy`).
|
|
11
|
+
* @param description - labels the undo entry
|
|
12
|
+
* @returns whether the write reached a node
|
|
13
|
+
*/
|
|
14
|
+
export declare function commitStrategyChange(blockId: number, description: string): Promise<boolean>;
|
|
@@ -15,7 +15,11 @@ export interface RequiredField {
|
|
|
15
15
|
getAvailableOptions?: (store: ExtensionStoreSlice) => string[];
|
|
16
16
|
condition?: (config: PerBlockConfigs) => boolean;
|
|
17
17
|
}
|
|
18
|
+
/** Field key of the strategy/algorithm descriptor, used to pick the toaster message. */
|
|
19
|
+
export declare const STRATEGY_FIELD_KEY = "strategy";
|
|
18
20
|
export declare const REQUIRED_RECOMMENDATION_FIELDS: RequiredField[];
|
|
19
21
|
export declare const RecommendationRequiredFieldsKey = "newsletter.recommendation-fill-required-fields";
|
|
22
|
+
/** Shown instead of the generic message when the only thing missing is the strategy. */
|
|
23
|
+
export declare const RecommendationAssignStrategyKey = "newsletter.recommendation-assign-strategy";
|
|
20
24
|
export declare function getInvalidFields(config: PerBlockConfigs, store: ExtensionStoreSlice, fields?: RequiredField[]): string[];
|
|
21
25
|
export declare function isConfigValid(config: PerBlockConfigs, store: ExtensionStoreSlice): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dev-harness stand-in for the cortex-fe MFE's shared `chat` store.
|
|
3
|
+
*
|
|
4
|
+
* `useCortexBlueprintBridge` resolves that store by id off the host's pinia at
|
|
5
|
+
* Guido's setup time, so a store registered after mount is never seen. Installing
|
|
6
|
+
* it here — before `<Guido>` renders — lets e2e drive the bridge through its real
|
|
7
|
+
* registration path instead of re-invoking the composable by hand.
|
|
8
|
+
*
|
|
9
|
+
* Activated with `?chatStore=true`; the instance is exposed on `window` so a test
|
|
10
|
+
* can push agent messages into it.
|
|
11
|
+
*/
|
|
12
|
+
export declare const installMockChatStore: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InitialResponse, FiltersResponse, RecommendationProduct, RecommendationProductsParams, RrsEndpointGenerateResponse, RrsStrategy } from '@@/Types/recommendation';
|
|
1
|
+
import type { InitialResponse, FiltersResponse, RecommendationProduct, RecommendationProductsParams, RrsEndpointGenerateResponse, RrsMigrationPayload, RrsMigrationTarget, RrsStrategy } from '@@/Types/recommendation';
|
|
2
2
|
export declare const useRecommendationApi: () => {
|
|
3
3
|
fetchRecommendationCreateData: () => Promise<InitialResponse>;
|
|
4
4
|
fetchRecommendationFilters: () => Promise<FiltersResponse>;
|
|
@@ -6,4 +6,5 @@ export declare const useRecommendationApi: () => {
|
|
|
6
6
|
fetchRecommendationProductsByUrl: (url: string) => Promise<RecommendationProduct[]>;
|
|
7
7
|
fetchRecommendationStrategies: () => Promise<RrsStrategy[]>;
|
|
8
8
|
generateStrategyEndpoint: (strategy: RrsStrategy, currency: string) => Promise<RrsEndpointGenerateResponse | null>;
|
|
9
|
+
migrateLegacyStrategy: (payload: RrsMigrationPayload, target?: RrsMigrationTarget) => Promise<string>;
|
|
9
10
|
};
|