@useinsider/guido 3.19.0-beta.c8d2be8 → 3.19.0-beta.cd75ff0
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 +1 -0
- package/dist/@types/config/schemas.js +102 -87
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +83 -75
- package/dist/components/organisms/AutoSaveController.vue2.js +10 -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/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +83 -48
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +16 -12
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +20 -0
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +50 -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 +44 -42
- package/dist/composables/useCodeEditorApi.js +23 -9
- package/dist/composables/useHtmlCompiler.js +37 -26
- package/dist/composables/useHtmlValidator.js +2 -0
- package/dist/composables/useHttp.js +48 -49
- package/dist/composables/useLegacyStrategyConversion.js +23 -19
- package/dist/composables/useSave.js +92 -45
- package/dist/composables/useSaveValidation.js +284 -0
- package/dist/composables/useSaveValidationRollout.js +20 -0
- package/dist/composables/useStripo.js +24 -20
- package/dist/composables/useToaster.js +17 -15
- 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/recommendationPartnerMigrator.js +50 -0
- package/dist/enums/extensions/recommendationBlock.js +30 -29
- package/dist/enums/save-validation.js +4 -0
- package/dist/extensions/Blocks/Recommendation/block.js +15 -14
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +45 -38
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +72 -49
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +30 -29
- package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +25 -0
- package/dist/guido.css +1 -1
- package/dist/services/settingsApi.js +11 -0
- package/dist/src/@types/config/schemas.d.ts +20 -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/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/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/useAutoSave.d.ts +4 -1
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/composables/useHtmlValidator.d.ts +21 -0
- package/dist/src/composables/useHttp.d.ts +2 -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 +4 -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 +1 -1
- package/dist/src/enums/save-validation.d.ts +27 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +33 -0
- package/dist/src/services/settingsApi.d.ts +6 -0
- package/dist/src/stores/config.d.ts +52 -0
- package/dist/src/stores/save-validation.d.ts +22 -0
- package/dist/src/stores/setup-settings.d.ts +4 -0
- package/dist/src/utils/stripoEditorApi.d.ts +4 -0
- package/dist/src/utils/templatePreparation.d.ts +30 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +9 -0
- package/dist/stores/config.js +84 -67
- package/dist/stores/save-validation.js +30 -0
- package/dist/stores/setup-settings.js +10 -0
- package/dist/stores/unsubscribe.js +3 -3
- package/dist/utils/stripoEditorApi.js +11 -0
- package/dist/utils/templatePreparation.js +39 -36
- package/package.json +2 -1
|
@@ -10,11 +10,11 @@ interface Props {
|
|
|
10
10
|
status: boolean;
|
|
11
11
|
titleText: string;
|
|
12
12
|
}
|
|
13
|
-
declare var
|
|
13
|
+
declare var __VLS_13: {}, __VLS_15: {};
|
|
14
14
|
type __VLS_Slots = {} & {
|
|
15
|
-
headerBottomSlot?: (props: typeof
|
|
15
|
+
headerBottomSlot?: (props: typeof __VLS_13) => any;
|
|
16
16
|
} & {
|
|
17
|
-
default?: (props: typeof
|
|
17
|
+
default?: (props: typeof __VLS_15) => any;
|
|
18
18
|
};
|
|
19
19
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
20
20
|
className: string;
|
|
@@ -26,6 +26,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
26
26
|
cancelOrBackButtonEvent: () => void;
|
|
27
27
|
onCloseEvent: () => void;
|
|
28
28
|
primaryButtonEvent: () => void;
|
|
29
|
+
secondaryButtonEvent: () => void;
|
|
29
30
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
30
31
|
className: string;
|
|
31
32
|
size: string;
|
|
@@ -3,6 +3,7 @@ type __VLS_Props = {
|
|
|
3
3
|
id: string;
|
|
4
4
|
title: string;
|
|
5
5
|
description?: string;
|
|
6
|
+
state?: 'default' | 'primary' | 'warning' | 'danger';
|
|
6
7
|
size?: 'X-small' | 'small' | 'medium' | 'large';
|
|
7
8
|
footerButtonOptions?: FooterButtonGroup;
|
|
8
9
|
closeButtonStatus?: boolean;
|
|
@@ -15,6 +16,7 @@ type __VLS_Slots = {} & {
|
|
|
15
16
|
};
|
|
16
17
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
17
18
|
description: string;
|
|
19
|
+
state: string;
|
|
18
20
|
size: string;
|
|
19
21
|
footerButtonOptions: undefined;
|
|
20
22
|
closeButtonStatus: boolean;
|
|
@@ -26,6 +28,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
26
28
|
"secondary-action": () => void;
|
|
27
29
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
28
30
|
description: string;
|
|
31
|
+
state: string;
|
|
29
32
|
size: string;
|
|
30
33
|
footerButtonOptions: undefined;
|
|
31
34
|
closeButtonStatus: boolean;
|
|
@@ -34,9 +37,10 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
34
37
|
}>>>, {
|
|
35
38
|
size: "X-small" | "small" | "medium" | "large";
|
|
36
39
|
description: string;
|
|
37
|
-
|
|
40
|
+
state: "default" | "primary" | "warning" | "danger";
|
|
38
41
|
footerButtonOptions: FooterButtonGroup;
|
|
39
42
|
closeButtonStatus: boolean;
|
|
43
|
+
closeOnOutsideClick: boolean;
|
|
40
44
|
footerStatus: boolean;
|
|
41
45
|
}>;
|
|
42
46
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface AuthErrorState {
|
|
2
|
+
status: number;
|
|
3
|
+
data: Record<string, unknown> | null;
|
|
4
|
+
}
|
|
5
|
+
export declare const isPanelOrigin: (url: string) => boolean;
|
|
6
|
+
export declare const reportAuthError: (status: number, body: string, url: string) => void;
|
|
7
|
+
export declare const useAuthError: () => {
|
|
8
|
+
authError: import("vue").Ref<{
|
|
9
|
+
status: number;
|
|
10
|
+
data: Record<string, unknown> | null;
|
|
11
|
+
} | null>;
|
|
12
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
type SaveSilent = () => Promise<unknown>;
|
|
2
|
-
|
|
2
|
+
interface AutoSaveOptions {
|
|
3
|
+
clearsChanges?: () => boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const useAutoSave: (saveSilent: SaveSilent, { clearsChanges }?: AutoSaveOptions) => void;
|
|
3
6
|
export {};
|
|
@@ -43,6 +43,7 @@ export declare const useConfig: () => {
|
|
|
43
43
|
selectedUnsubscribePages: number[];
|
|
44
44
|
forceRecreate: boolean;
|
|
45
45
|
trackIdCounter: number;
|
|
46
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
46
47
|
migration: {
|
|
47
48
|
recommendationConfigs: {
|
|
48
49
|
[x: string]: {
|
|
@@ -101,6 +102,7 @@ export declare const useConfig: () => {
|
|
|
101
102
|
autosave: boolean;
|
|
102
103
|
allowlistEnabled: boolean;
|
|
103
104
|
linkTrackingIds: boolean;
|
|
105
|
+
allowSaveWithErrors: boolean;
|
|
104
106
|
reusableRecommendationStrategy: boolean;
|
|
105
107
|
};
|
|
106
108
|
blocks: {
|
|
@@ -180,6 +182,7 @@ export declare const useConfig: () => {
|
|
|
180
182
|
selectedUnsubscribePages: number[];
|
|
181
183
|
forceRecreate: boolean;
|
|
182
184
|
trackIdCounter: number;
|
|
185
|
+
recommendationCampaignUrls?: Record<string, unknown> | undefined;
|
|
183
186
|
migration: {
|
|
184
187
|
recommendationConfigs: {
|
|
185
188
|
[x: string]: {
|
|
@@ -238,6 +241,7 @@ export declare const useConfig: () => {
|
|
|
238
241
|
autosave: boolean;
|
|
239
242
|
allowlistEnabled: boolean;
|
|
240
243
|
linkTrackingIds: boolean;
|
|
244
|
+
allowSaveWithErrors: boolean;
|
|
241
245
|
reusableRecommendationStrategy: boolean;
|
|
242
246
|
} | null>;
|
|
243
247
|
blocks: import("vue").ComputedRef<{
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { DynamicContent } from '@@/Types/generic';
|
|
2
2
|
import type { FiltersResponse } from '@@/Types/recommendation';
|
|
3
|
+
/**
|
|
4
|
+
* Extracts recommendation block IDs directly from the HTML by parsing
|
|
5
|
+
* the recommendation-id attribute on block elements.
|
|
6
|
+
* This avoids depending on store state which may not be populated
|
|
7
|
+
* when the settings panel hasn't been opened yet (e.g., saved templates).
|
|
8
|
+
*/
|
|
9
|
+
export declare function getRecommendationBlockIds(html: string): string[];
|
|
3
10
|
/**
|
|
4
11
|
* Parses a `{{recoId_index_attributeName}}` variable (already stripped of the
|
|
5
12
|
* braces/whitespace) into its recommendation id and attribute name. Returns
|
|
@@ -27,6 +34,20 @@ export declare function buildPartnerAttributeNameSet(filterList: FiltersResponse
|
|
|
27
34
|
* before, so flagging it would false-positive on merge tags like `{{user.name}}`.
|
|
28
35
|
*/
|
|
29
36
|
export declare function findInvalidCustomFields(html: string, validCustomFields: string[], recommendationBlockIds: string[], ignoredIds: Set<string>, ignoredAttributeNames: Set<string> | null): string[];
|
|
37
|
+
/**
|
|
38
|
+
* Returns the invalid `{{ ... }}` dynamic-content tags found in the HTML.
|
|
39
|
+
*
|
|
40
|
+
* A tag's variable name is the part before the first `|` (everything after it is the fallback).
|
|
41
|
+
* Surrounding whitespace is always allowed (trimmed). A tag is valid only when the variable name
|
|
42
|
+
* is an allowed system token, or it is a clean identifier (`[A-Za-z0-9_.]`) and — when a `|` is
|
|
43
|
+
* present — the fallback after it is not empty. Otherwise the tag is invalid (e.g.
|
|
44
|
+
* `{{Api Response: OA1 Main Item Url}}` — spaces/`:` — or `{{bounce|}}` — empty fallback).
|
|
45
|
+
*
|
|
46
|
+
* `data-*` block-config attribute values are excluded from the scan: blocks such as Items/cart
|
|
47
|
+
* store product merge tags (`data-product_button_link="{{Abandoned Cart Item (1) Url}}"`) that the
|
|
48
|
+
* backend resolves through its own pipeline, so they must not be treated as user-authored tags.
|
|
49
|
+
*/
|
|
50
|
+
export declare function getInvalidDynamicContentTags(html: string): string[];
|
|
30
51
|
export declare const useHtmlValidator: () => {
|
|
31
52
|
validateHtml: (html: string, customFields: DynamicContent[], isOnSaveValidation?: boolean) => Promise<boolean>;
|
|
32
53
|
};
|
|
@@ -16,6 +16,7 @@ export interface HttpError {
|
|
|
16
16
|
status?: number;
|
|
17
17
|
statusText?: string;
|
|
18
18
|
response?: Response;
|
|
19
|
+
authReported?: boolean;
|
|
19
20
|
}
|
|
20
21
|
export declare const useHttp: (defaultOptions?: HttpOptions) => {
|
|
21
22
|
loading: import("vue").ComputedRef<boolean>;
|
|
@@ -65,6 +66,7 @@ export declare const useHttp: (defaultOptions?: HttpOptions) => {
|
|
|
65
66
|
json: () => Promise<any>;
|
|
66
67
|
text: () => Promise<string>;
|
|
67
68
|
} | undefined;
|
|
69
|
+
authReported?: boolean | undefined;
|
|
68
70
|
} | null>;
|
|
69
71
|
hasError: import("vue").ComputedRef<boolean>;
|
|
70
72
|
request: <T = unknown>(method: HttpMethod, url: string, data?: unknown, options?: HttpOptions) => Promise<HttpResponse<T>>;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
2
|
+
type SaveDetails = Omit<SavedTemplateDetails, 'metadata' | 'silent'>;
|
|
3
|
+
type SaveResult = SaveDetails | undefined;
|
|
2
4
|
export declare const useSave: () => {
|
|
3
|
-
save: (suppressEmit?: boolean, silent?: boolean) => Promise<
|
|
5
|
+
save: (suppressEmit?: boolean, silent?: boolean) => Promise<SaveResult>;
|
|
6
|
+
saveWithErrors: () => Promise<SaveResult>;
|
|
7
|
+
saveRawOnly: () => Promise<SaveResult>;
|
|
4
8
|
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DynamicContent } from '@@/Types/generic';
|
|
2
|
+
import type { SaveValidationError } from '@@/Types/save-validation';
|
|
3
|
+
export declare const useSaveValidation: () => {
|
|
4
|
+
collectSaveValidationErrors: (compiledHtml: string, dynamicContentList: DynamicContent[]) => Promise<SaveValidationError[]>;
|
|
5
|
+
validateCurrentTemplate: () => Promise<SaveValidationError[]>;
|
|
6
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export declare const COUPON_TAG_MODIFIED_KEY = "newsletter.coupon-tag-modified";
|
|
2
|
+
/** Pure core: the tag text of every coupon block whose code was modified. */
|
|
3
|
+
export declare function findInvalidCouponBlocks(html: string): string[];
|
|
1
4
|
export declare const useCouponBlockValidator: () => {
|
|
2
5
|
validateCouponBlockTags: (html: string) => boolean;
|
|
3
6
|
};
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
declare const SINGLETON_BLOCK_RULES: {
|
|
2
|
+
pageType: number;
|
|
3
|
+
messageKey: string;
|
|
4
|
+
}[];
|
|
5
|
+
export declare const EMPTY_BLOCK_KEY = "unsubscription-preference.select-page-to-continue";
|
|
6
|
+
/** Pure core: the singleton rules whose page type appears more than once. */
|
|
7
|
+
export declare function findDuplicateUnsubPageTypes(html: string): typeof SINGLETON_BLOCK_RULES;
|
|
8
|
+
/** Pure core: count of unsubscribe blocks with no page type or page list chosen. */
|
|
9
|
+
export declare function countUnsubBlocksWithoutPage(html: string): number;
|
|
1
10
|
export declare const useUnsubscribeBlockValidator: () => {
|
|
2
11
|
validateUnsubscribeBlockUniqueness: (html: string) => boolean;
|
|
3
12
|
validateUnsubscribeBlockHasTemplate: (html: string) => boolean;
|
|
4
13
|
};
|
|
14
|
+
export {};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { LegacyRecommendationConfig } from '@@/Types/config';
|
|
2
|
-
|
|
2
|
+
import { type PartnerScopeMigrationOptions } from './recommendationPartnerMigrator';
|
|
3
|
+
export declare const migrate: (html: string, recommendationConfigs?: Record<string, LegacyRecommendationConfig>, partnerScope?: PartnerScopeMigrationOptions) => Promise<string>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Empties recommendation blocks copied in from another account and stamps the
|
|
3
|
+
* current one, before the editor ever sees the template (SD-151945).
|
|
4
|
+
*
|
|
5
|
+
* Runs at load rather than on document change: the stamp makes it a one-time
|
|
6
|
+
* pass per template, the campaign-URL rule only ever applies to the loaded HTML,
|
|
7
|
+
* and Stripo takes the result as the original document, so nothing is dirtied.
|
|
8
|
+
*/
|
|
9
|
+
export interface PartnerScopeMigrationOptions {
|
|
10
|
+
partnerName: string;
|
|
11
|
+
/** `undefined` when the host does not pass the map — the unstamped check is then off. */
|
|
12
|
+
campaignUrls?: Record<string, unknown>;
|
|
13
|
+
rrsEnabled: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @param html Template HTML, already normalized by `migrateRecommendation`.
|
|
17
|
+
* @returns Migrated HTML, or the original when no block needed a reset or a stamp.
|
|
18
|
+
*/
|
|
19
|
+
export declare function migrateRecommendationPartnerScope(html: string, { partnerName, campaignUrls, rrsEnabled }: PartnerScopeMigrationOptions): string;
|
|
@@ -8,8 +8,8 @@ export declare const URLS: {
|
|
|
8
8
|
NEWSLETTER_RECOMMENDATIONS_PATH: string;
|
|
9
9
|
MIGRATE_STRATEGIES_PATH: string;
|
|
10
10
|
TEMPLATE_MIGRATE_STRATEGIES_PATH: string;
|
|
11
|
-
RECOMMENDATION_STRATEGY_CREATE_PATH: string;
|
|
12
11
|
};
|
|
12
|
+
export declare const strategyCreatePath: () => string;
|
|
13
13
|
export declare const strategyEditPath: (strategyId: string | number) => string;
|
|
14
14
|
export declare const MIGRATION_PATHS: Record<RrsMigrationTarget['scope'], string>;
|
|
15
15
|
export declare const QUERY_PARAMS: {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable discriminators for each save-validation rule site — one per rule that
|
|
3
|
+
* can produce a drawer row, kept in sync with the collector + legacy validator chains.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum SaveValidationRule {
|
|
6
|
+
CouponTagModified = "coupon-tag-modified",
|
|
7
|
+
DuplicateUnsubBlock = "duplicate-unsub-block",
|
|
8
|
+
UnsubBlockMissingTemplate = "unsub-block-missing-template",
|
|
9
|
+
LiquidSyntax = "liquid-syntax",
|
|
10
|
+
InvalidLinks = "invalid-links",
|
|
11
|
+
LinkCheckInProgress = "link-check-in-progress",
|
|
12
|
+
CustomFieldScript = "custom-field-script",
|
|
13
|
+
EmptyHtml = "empty-html",
|
|
14
|
+
MismatchedBraces = "mismatched-braces",
|
|
15
|
+
InvalidDynamicTag = "invalid-dynamic-tag",
|
|
16
|
+
InvalidCustomField = "invalid-custom-field",
|
|
17
|
+
ConditionsSyntax = "conditions-syntax",
|
|
18
|
+
WrongEqualityOperator = "wrong-equality-operator",
|
|
19
|
+
MissingIfEndif = "missing-if-endif",
|
|
20
|
+
ConditionTagSpacing = "condition-tag-spacing",
|
|
21
|
+
BracesInsideIfTag = "braces-inside-if-tag",
|
|
22
|
+
RecommendationRequiredFields = "recommendation-required-fields",
|
|
23
|
+
RecommendationFilters = "recommendation-filters",
|
|
24
|
+
InvalidImageType = "invalid-image-type",
|
|
25
|
+
CheckboxUnsubGroup = "checkbox-unsub-group",
|
|
26
|
+
RadioButtonUnsubGroup = "radio-button-unsub-group"
|
|
27
|
+
}
|
|
@@ -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,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[];
|