@useinsider/guido 3.19.0-beta.2854f4f → 3.19.0-beta.3906ea8
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 +21 -3
- package/dist/@types/config/schemas.js +59 -51
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +57 -55
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +3 -3
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +56 -52
- 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 +18 -18
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +28 -26
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +46 -0
- package/dist/composables/useCustomInterfaceAppearance.js +54 -50
- package/dist/composables/useLegacyStrategyConversion.js +61 -0
- package/dist/enums/extensions/recommendationBlock.js +34 -25
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +73 -72
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +81 -38
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +169 -108
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +42 -0
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +10 -10
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +46 -37
- package/dist/src/@types/config/schemas.d.ts +16 -0
- package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +2 -0
- package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +2 -0
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +5 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +76 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +32 -0
- package/dist/src/services/recommendationApi.d.ts +2 -1
- package/dist/src/stores/config.d.ts +322 -0
- package/dist/src/stores/onboarding.d.ts +421 -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 +70 -5
- package/dist/stores/config.js +74 -60
- package/dist/stores/onboarding.js +6 -1
- package/package.json +2 -2
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-1ca6baf0]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-
|
|
1
|
+
@charset "UTF-8";.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-1ca6baf0]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-36867e2e]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-36867e2e]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-36867e2e]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
|
|
@@ -1,91 +1,100 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import { URLS as
|
|
3
|
-
const
|
|
4
|
-
(s,
|
|
5
|
-
attributeName:
|
|
6
|
-
attributeJs:
|
|
7
|
-
attributeType:
|
|
8
|
-
type:
|
|
9
|
-
displayName:
|
|
10
|
-
isFilterable:
|
|
1
|
+
import { useHttp as y } from "../composables/useHttp.js";
|
|
2
|
+
import { MIGRATION_PATHS as R, URLS as i, QUERY_PARAMS as u } from "../enums/extensions/recommendationBlock.js";
|
|
3
|
+
const g = "[sr_strategies.status][=][active]*[sr_strategies.suitable_channels][~][EMAIL]", l = (r) => r.reduce(
|
|
4
|
+
(s, a, d) => (s[d] = {
|
|
5
|
+
attributeName: a.attributeName,
|
|
6
|
+
attributeJs: a.attributeJs,
|
|
7
|
+
attributeType: a.attributeType,
|
|
8
|
+
type: a.type,
|
|
9
|
+
displayName: a.displayName,
|
|
10
|
+
isFilterable: a.isFilterable
|
|
11
11
|
}, s),
|
|
12
12
|
{}
|
|
13
|
-
),
|
|
14
|
-
const { get:
|
|
13
|
+
), h = (r) => r && typeof r == "object" && "data" in r ? r.data : r, w = () => {
|
|
14
|
+
const { get: r, post: s } = y(), { get: a } = y({ headers: {} }), d = "6KcLM9TwheVB1mgK";
|
|
15
15
|
return {
|
|
16
16
|
fetchRecommendationCreateData: async () => {
|
|
17
17
|
try {
|
|
18
|
-
return (await
|
|
18
|
+
return (await r(`${i.NEWSLETTER_RECOMMENDATIONS_PATH}/create-data`)).data;
|
|
19
19
|
} catch (e) {
|
|
20
20
|
throw console.error("fetchUserModalState error:", e), e;
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
fetchRecommendationFilters: async () => {
|
|
24
24
|
try {
|
|
25
|
-
const { data: e } = await
|
|
26
|
-
|
|
27
|
-
),
|
|
28
|
-
return
|
|
25
|
+
const { data: e } = await r(
|
|
26
|
+
i.PRODUCT_ATTRIBUTES_PATH
|
|
27
|
+
), n = Array.isArray(e) ? e : (e == null ? void 0 : e.data) ?? [];
|
|
28
|
+
return l(n);
|
|
29
29
|
} catch (e) {
|
|
30
30
|
throw console.error("fetchRecommendationFilters error:", e), e;
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
|
-
fetchRecommendationProducts: async (e,
|
|
33
|
+
fetchRecommendationProducts: async (e, n) => {
|
|
34
34
|
var t;
|
|
35
35
|
try {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
console.debug("🏁 Recommendation API Query:",
|
|
40
|
-
const
|
|
41
|
-
`${
|
|
36
|
+
const o = new URLSearchParams(Object.entries(n));
|
|
37
|
+
o.set(u.CLIENT_ID, d);
|
|
38
|
+
const m = decodeURIComponent(o.toString());
|
|
39
|
+
console.debug("🏁 Recommendation API Query:", m);
|
|
40
|
+
const c = await a(
|
|
41
|
+
`${i.RECOMMENDATION_API_URL}/v2/${e}?${m}`
|
|
42
42
|
);
|
|
43
|
-
return ((t =
|
|
44
|
-
} catch (
|
|
45
|
-
throw console.error("fetchRecommendationProducts error:",
|
|
43
|
+
return ((t = c == null ? void 0 : c.data) == null ? void 0 : t.data) ?? [];
|
|
44
|
+
} catch (o) {
|
|
45
|
+
throw console.error("fetchRecommendationProducts error:", o), o;
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
fetchRecommendationProductsByUrl: async (e) => {
|
|
49
|
-
var
|
|
49
|
+
var n;
|
|
50
50
|
try {
|
|
51
|
-
const t = new RegExp(`[?&]${u.CLIENT_ID}=`).test(e),
|
|
52
|
-
|
|
51
|
+
const t = new RegExp(`[?&]${u.CLIENT_ID}=`).test(e), o = e.includes("?") ? "&" : "?", m = t ? e : `${e}${o}${u.CLIENT_ID}=${d}`, c = await a(
|
|
52
|
+
m
|
|
53
53
|
);
|
|
54
|
-
return ((
|
|
54
|
+
return ((n = c == null ? void 0 : c.data) == null ? void 0 : n.data) ?? [];
|
|
55
55
|
} catch (t) {
|
|
56
56
|
return console.error("fetchRecommendationProductsByUrl error:", t), [];
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
fetchRecommendationStrategies: async () => {
|
|
60
60
|
try {
|
|
61
|
-
const { data: e } = await
|
|
62
|
-
`${
|
|
61
|
+
const { data: e } = await r(
|
|
62
|
+
`${i.RECOMMENDATION_STRATEGIES_PATH}?filters=${encodeURIComponent(g)}`
|
|
63
63
|
);
|
|
64
64
|
return Array.isArray(e) ? e : (e == null ? void 0 : e.data) ?? [];
|
|
65
65
|
} catch (e) {
|
|
66
66
|
throw console.error("fetchRecommendationStrategies error:", e), e;
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
|
-
generateStrategyEndpoint: async (e,
|
|
69
|
+
generateStrategyEndpoint: async (e, n) => {
|
|
70
70
|
try {
|
|
71
71
|
const { data: t } = await s(
|
|
72
|
-
`${
|
|
72
|
+
`${i.RECOMMENDATION_STRATEGIES_PATH}/endpoint-generate`,
|
|
73
73
|
{
|
|
74
74
|
campaignId: 0,
|
|
75
75
|
pageTypes: [],
|
|
76
76
|
isPreviewer: !1,
|
|
77
77
|
strategy: e,
|
|
78
78
|
userId: "",
|
|
79
|
-
currency:
|
|
79
|
+
currency: n
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
82
|
return !t || typeof t != "object" || !("full_path" in t || "data" in t) ? (console.error("generateStrategyEndpoint unexpected response shape:", t), null) : "full_path" in t ? t : t.data;
|
|
83
83
|
} catch (t) {
|
|
84
84
|
return console.error("generateStrategyEndpoint error:", t), null;
|
|
85
85
|
}
|
|
86
|
+
},
|
|
87
|
+
migrateLegacyStrategy: async (e, n = { scope: "campaign" }) => {
|
|
88
|
+
const { data: t } = await s(
|
|
89
|
+
R[n.scope],
|
|
90
|
+
e
|
|
91
|
+
), { strategyId: o } = h(t) ?? {};
|
|
92
|
+
if (o == null || o === "")
|
|
93
|
+
throw new Error("[Guido] migrate-strategies returned no strategyId");
|
|
94
|
+
return String(o);
|
|
86
95
|
}
|
|
87
96
|
};
|
|
88
97
|
};
|
|
89
98
|
export {
|
|
90
|
-
|
|
99
|
+
w as useRecommendationApi
|
|
91
100
|
};
|
|
@@ -50,6 +50,14 @@ export declare const IdentitySchema: v.ObjectSchema<{
|
|
|
50
50
|
readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "userId is required">]>;
|
|
51
51
|
/** Optional variation ID for A/B testing */
|
|
52
52
|
readonly variationId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
53
|
+
/** Optional numeric campaign ID of the host campaign; absent for templates and modules */
|
|
54
|
+
readonly campaignId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
55
|
+
/**
|
|
56
|
+
* Optional numeric template-library id of the host template; absent for campaigns and
|
|
57
|
+
* modules. Distinct from `templateId`, which is the editor's document identity (a uuid /
|
|
58
|
+
* Stripo doc id) and is never an endpoint id.
|
|
59
|
+
*/
|
|
60
|
+
readonly templateLibraryId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
53
61
|
}, undefined>;
|
|
54
62
|
/**
|
|
55
63
|
* Partner configuration - organization and product context
|
|
@@ -625,6 +633,14 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
625
633
|
readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "userId is required">]>;
|
|
626
634
|
/** Optional variation ID for A/B testing */
|
|
627
635
|
readonly variationId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
636
|
+
/** Optional numeric campaign ID of the host campaign; absent for templates and modules */
|
|
637
|
+
readonly campaignId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
638
|
+
/**
|
|
639
|
+
* Optional numeric template-library id of the host template; absent for campaigns and
|
|
640
|
+
* modules. Distinct from `templateId`, which is the editor's document identity (a uuid /
|
|
641
|
+
* Stripo doc id) and is never an endpoint id.
|
|
642
|
+
*/
|
|
643
|
+
readonly templateLibraryId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
628
644
|
}, undefined>;
|
|
629
645
|
/** Partner configuration (required) */
|
|
630
646
|
readonly partner: v.ObjectSchema<{
|
package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
+
export default _default;
|
package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
+
export default _default;
|
|
@@ -11,6 +11,8 @@ export declare const useConfig: () => {
|
|
|
11
11
|
templateId: string;
|
|
12
12
|
userId: string;
|
|
13
13
|
variationId?: string | undefined;
|
|
14
|
+
campaignId?: string | undefined;
|
|
15
|
+
templateLibraryId?: string | undefined;
|
|
14
16
|
};
|
|
15
17
|
partner: {
|
|
16
18
|
name: string;
|
|
@@ -146,6 +148,8 @@ export declare const useConfig: () => {
|
|
|
146
148
|
templateId: string;
|
|
147
149
|
userId: string;
|
|
148
150
|
variationId?: string | undefined;
|
|
151
|
+
campaignId?: string | undefined;
|
|
152
|
+
templateLibraryId?: string | undefined;
|
|
149
153
|
} | null>;
|
|
150
154
|
partner: import("vue").ComputedRef<{
|
|
151
155
|
name: string;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { TextValueObject } from '@@/Types/generic';
|
|
2
|
-
import type { RecommendationFeedItem } from '@@/Types/recommendation';
|
|
2
|
+
import type { RecommendationFeedItem, RrsMigrationTarget } from '@@/Types/recommendation';
|
|
3
3
|
export declare const URLS: {
|
|
4
4
|
RECOMMENDATION_API_URL: string;
|
|
5
5
|
PRODUCT_ATTRIBUTES_PATH: string;
|
|
6
6
|
RECOMMENDATION_STRATEGIES_PATH: string;
|
|
7
7
|
RECOMMENDATION_STRATEGIES_PANEL_PATH: string;
|
|
8
|
+
NEWSLETTER_RECOMMENDATIONS_PATH: string;
|
|
9
|
+
MIGRATE_STRATEGIES_PATH: string;
|
|
10
|
+
TEMPLATE_MIGRATE_STRATEGIES_PATH: string;
|
|
8
11
|
RECOMMENDATION_STRATEGY_CREATE_PATH: string;
|
|
9
12
|
};
|
|
10
13
|
export declare const strategyEditPath: (strategyId: string | number) => string;
|
|
14
|
+
export declare const MIGRATION_PATHS: Record<RrsMigrationTarget['scope'], string>;
|
|
11
15
|
export declare const QUERY_PARAMS: {
|
|
12
16
|
CLIENT_ID: string;
|
|
13
17
|
};
|
|
@@ -3,6 +3,7 @@ export declare const STRATEGY_CONTROL_ID = "recommendation-strategy-control";
|
|
|
3
3
|
export declare class StrategyControl extends CommonControl {
|
|
4
4
|
private store;
|
|
5
5
|
private onboardingStore;
|
|
6
|
+
private legacyConversion;
|
|
6
7
|
private storeUnsubscription;
|
|
7
8
|
private listeners;
|
|
8
9
|
private lastPaintedState;
|
|
@@ -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
|
|
@@ -231,6 +234,59 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
231
234
|
strategyPanelOpen: boolean;
|
|
232
235
|
configVersion: number;
|
|
233
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;
|
|
288
|
+
configVersion: number;
|
|
289
|
+
} & import("pinia").PiniaCustomStateProperties<StoreState>): boolean;
|
|
234
290
|
assignedStrategy(state: {
|
|
235
291
|
recommendationCampaignUrls: Record<string, RecommendationCampaignUrlValue>;
|
|
236
292
|
activePredictiveAlgorithms: number[];
|
|
@@ -482,6 +538,8 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
482
538
|
cancelFilterDrawer(): void;
|
|
483
539
|
openAssignStrategyDrawer(): void;
|
|
484
540
|
closeAssignStrategyDrawer(): void;
|
|
541
|
+
openLegacyStrategyUpdatedModal(): void;
|
|
542
|
+
closeLegacyStrategyUpdatedModal(): void;
|
|
485
543
|
openRemoveStrategyModal(): void;
|
|
486
544
|
closeRemoveStrategyModal(): void;
|
|
487
545
|
fetchStrategies(): Promise<void>;
|
|
@@ -528,6 +586,17 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
528
586
|
openStrategyEdit(strategyId: string | number): boolean;
|
|
529
587
|
resolveStrategyUrlTemplate(strategy: RrsStrategy, currency: string): Promise<string>;
|
|
530
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;
|
|
531
600
|
removeStrategy(): void;
|
|
532
601
|
fetchRecommendationCreateData(): Promise<void>;
|
|
533
602
|
fetchRecommendationFilters(): Promise<void>;
|
|
@@ -550,6 +619,12 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
550
619
|
invalidBlockFields(): string[];
|
|
551
620
|
fetchRecommendationProducts(): Promise<void>;
|
|
552
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>;
|
|
553
628
|
_doFetchStrategyProducts(blockId: number): Promise<void>;
|
|
554
629
|
_setBlockProducts(blockId: number, products: RecommendationProduct[], size: number): void;
|
|
555
630
|
}>;
|
|
@@ -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 {};
|
|
@@ -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
|
};
|