@beworke/pixel 0.1.0-rc.1 → 0.1.0-rc.6
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/CHANGELOG.md +260 -4
- package/README.md +65 -118
- package/RELEASE_CANDIDATE.md +181 -36
- package/dist/{StorageFactory-BhpbB6Jj.d.mts → StorageFactory-CPghDPBj.d.mts} +2 -2
- package/dist/{StorageFactory-CAkJJqVD.d.ts → StorageFactory-tjfzk57c.d.ts} +2 -2
- package/dist/config/index.cjs.js +1 -1
- package/dist/config/index.cjs.js.map +1 -1
- package/dist/config/index.d.mts +4 -3
- package/dist/config/index.d.ts +4 -3
- package/dist/config/index.esm.js +1 -1
- package/dist/config/index.esm.js.map +1 -1
- package/dist/events/index.cjs.js +1 -1
- package/dist/events/index.cjs.js.map +1 -1
- package/dist/events/index.d.mts +2 -1
- package/dist/events/index.d.ts +2 -1
- package/dist/events/index.esm.js +1 -1
- package/dist/events/index.esm.js.map +1 -1
- package/dist/examples/html-script/README.md +24 -2
- package/dist/examples/html-script/RELEASE_CANDIDATE.md +20 -6
- package/dist/examples/html-script/add-payment-info/README.md +3 -3
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-autocomplete.html +66 -48
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-disabled.html +66 -48
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-fields.html +65 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-data-track.html +73 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-dedupe.html +65 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-manual.html +56 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-rules-card.html +65 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-security.html +65 -47
- package/dist/examples/html-script/add-to-cart/README.md +3 -3
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-attribute.html +90 -70
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-auto.html +103 -81
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-click.html +101 -78
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-dedupe.html +90 -70
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-manual.html +81 -67
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-order-bump.html +90 -70
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-text.html +104 -81
- package/dist/examples/html-script/behavior/example-behavior-engagement.html +489 -0
- package/dist/examples/html-script/behavior/example-behavior-heartbeat.html +350 -0
- package/dist/examples/html-script/behavior/example-behavior-runtime-intelligence.html +433 -0
- package/dist/examples/html-script/behavior/example-behavior-viewport.html +397 -0
- package/dist/examples/html-script/{example-behavior.html → behavior/example-behavior.html} +23 -17
- package/dist/examples/html-script/example-checkout-commerce.html +825 -0
- package/dist/examples/html-script/example-integration.html +5 -5
- package/dist/examples/html-script/example-landing-commerce.html +380 -0
- package/dist/examples/html-script/example-runtime-diagnostics.html +108 -0
- package/dist/examples/html-script/example-transport.html +5 -5
- package/dist/examples/html-script/full-funnel/README.md +64 -0
- package/dist/examples/html-script/full-funnel/checkout.html +116 -0
- package/dist/examples/html-script/full-funnel/downsell.html +58 -0
- package/dist/examples/html-script/full-funnel/landing.html +99 -0
- package/dist/examples/html-script/full-funnel/thank-you.html +85 -0
- package/dist/examples/html-script/full-funnel/upsell.html +64 -0
- package/dist/examples/html-script/initiate-checkout/README.md +6 -6
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-attribute.html +94 -74
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-auto.html +102 -80
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-click.html +103 -80
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-manual.html +86 -72
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-snapshot.html +95 -75
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-submit.html +103 -83
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-text.html +105 -82
- package/dist/examples/html-script/lead/README.md +9 -7
- package/dist/examples/html-script/lead/example-lead-trigger-attribute.html +67 -47
- package/dist/examples/html-script/lead/example-lead-trigger-auto.html +78 -56
- package/dist/examples/html-script/lead/example-lead-trigger-click.html +78 -55
- package/dist/examples/html-script/release-candidate.html +187 -76
- package/dist/examples/html-script/remove-from-cart/README.md +1 -1
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-attribute.html +93 -73
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-css.html +93 -73
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-dedupe.html +93 -73
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-manual.html +84 -70
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-multi.html +94 -74
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-state.html +95 -75
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-text.html +98 -76
- package/dist/examples/html-script/search/README.md +1 -1
- package/dist/examples/html-script/search/example-search-attribute.html +66 -51
- package/dist/examples/html-script/search/example-search-button-sync.html +66 -51
- package/dist/examples/html-script/search/example-search-dedupe.html +66 -51
- package/dist/examples/html-script/search/example-search-input.html +67 -51
- package/dist/examples/html-script/search/example-search-manual.html +57 -48
- package/dist/examples/html-script/search/example-search-submit.html +66 -51
- package/dist/examples/html-script/search/example-search-text.html +71 -51
- package/dist/examples/html-script/url-context/example-url-context-allowed-domains.html +63 -0
- package/dist/examples/html-script/url-context/example-url-context-landing.html +70 -0
- package/dist/examples/html-script/url-context/example-url-context-upsell.html +67 -0
- package/dist/examples/html-script/url-context/example-url-context.html +171 -0
- package/dist/examples/html-script/view-content/README.md +1 -1
- package/dist/examples/html-script/view-content/example-view-content-attribute.html +85 -70
- package/dist/examples/html-script/view-content/example-view-content-css.html +85 -70
- package/dist/examples/html-script/view-content/example-view-content-dedupe.html +85 -70
- package/dist/examples/html-script/view-content/example-view-content-empty.html +85 -70
- package/dist/examples/html-script/view-content/example-view-content-manual.html +76 -67
- package/dist/examples/html-script/view-content/example-view-content-product-card.html +85 -70
- package/dist/examples/html-script/view-content/example-view-content-text.html +90 -73
- package/dist/examples/v2/README.md +4 -1
- package/dist/{index-DUfFzniE.d.ts → index-CQAyT5Od.d.ts} +170 -3
- package/dist/{index-DUfFzniE.d.mts → index-JlKPz4pp.d.mts} +170 -3
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +435 -12
- package/dist/index.d.ts +435 -12
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/{pixel-CbeF25mD.d.mts → pixel-BxZZx8l5.d.ts} +248 -72
- package/dist/{pixel-CbeF25mD.d.ts → pixel-CKc4OQUx.d.mts} +248 -72
- package/dist/{pixel-default-config-1VgLFOiL.d.mts → pixel-default-config-CJl-eypl.d.mts} +1 -1
- package/dist/{pixel-default-config-Bxb-Vdd8.d.ts → pixel-default-config-aAOujzwp.d.ts} +1 -1
- package/dist/runtime/index.cjs.js +1 -1
- package/dist/runtime/index.cjs.js.map +1 -1
- package/dist/runtime/index.d.mts +19 -26
- package/dist/runtime/index.d.ts +19 -26
- package/dist/runtime/index.esm.js +1 -1
- package/dist/runtime/index.esm.js.map +1 -1
- package/dist/services/index.cjs.js +1 -1
- package/dist/services/index.cjs.js.map +1 -1
- package/dist/services/index.d.mts +14 -6
- package/dist/services/index.d.ts +14 -6
- package/dist/services/index.esm.js +1 -1
- package/dist/services/index.esm.js.map +1 -1
- package/dist/types-BP8dz1gP.d.mts +19 -0
- package/dist/types-C75pQP31.d.ts +19 -0
- package/dist/types-DMhzHSVC.d.mts +293 -0
- package/dist/types-D_SsCur9.d.ts +293 -0
- package/dist/url-context-BjAsQoVl.d.mts +85 -0
- package/dist/url-context-BjAsQoVl.d.ts +85 -0
- package/dist/v2/global.global.js +1 -1
- package/dist/v2/global.global.js.map +1 -1
- package/dist/v2/index.cjs.js +1 -1
- package/dist/v2/index.cjs.js.map +1 -1
- package/dist/v2/index.d.mts +8 -6
- package/dist/v2/index.d.ts +8 -6
- package/dist/v2/index.esm.js +1 -1
- package/dist/v2/index.esm.js.map +1 -1
- package/docs/public/README.md +75 -0
- package/docs/public/api/exports.md +47 -0
- package/docs/public/api/pixel.md +65 -0
- package/docs/public/configuration/commerce.md +44 -0
- package/docs/public/configuration/modules.md +66 -0
- package/docs/public/configuration/overview.md +66 -0
- package/docs/public/events/catalog.md +65 -0
- package/docs/public/getting-started/installation.md +75 -0
- package/docs/public/getting-started/quick-start.md +77 -0
- package/docs/public/getting-started/react-nextjs.md +55 -0
- package/docs/public/getting-started/script-tag.md +57 -0
- package/docs/public/guides/funnel-checkout.md +52 -0
- package/docs/public/guides/funnel-downsell.md +53 -0
- package/docs/public/guides/funnel-full.md +64 -0
- package/docs/public/guides/funnel-landing.md +68 -0
- package/docs/public/guides/funnel-thank-you.md +48 -0
- package/docs/public/guides/funnel-upsell.md +72 -0
- package/docs/public/limitations.md +32 -0
- package/docs/public/privacy/limitations.md +33 -0
- package/docs/public/release-candidate/validation.md +37 -0
- package/docs/public/troubleshooting.md +55 -0
- package/package.json +13 -1
- package/dist/types-CTpRvFKZ.d.ts +0 -71
- package/dist/types-DGlBdsAy.d.mts +0 -71
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { P as PixelEvent, a as PixelItem, b as StorageService, B as BrowserMetadataService, c as BaseEventBuilder, A as AttributionService, U as UrlContextService } from './index-JlKPz4pp.mjs';
|
|
2
|
+
import { W as CommerceProduct, J as CommerceCartItem, G as CommerceCalculateValueFrom, O as CommerceEnrichmentSource, M as CommerceConfig, R as CommerceEventEnrichmentConfig, a2 as normalizeCalculateValueFrom, U as CommerceMappingsConfig } from './pixel-CKc4OQUx.mjs';
|
|
3
|
+
|
|
4
|
+
interface DispatcherService {
|
|
5
|
+
dispatch(event: PixelEvent): void;
|
|
6
|
+
subscribe(listener: (event: PixelEvent) => void): () => void;
|
|
7
|
+
clear(): void;
|
|
8
|
+
getListenerCount(): number;
|
|
9
|
+
getLastEvent(): PixelEvent | null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type ProductCatalogOptions = {
|
|
13
|
+
readonly defaultCurrency?: string;
|
|
14
|
+
};
|
|
15
|
+
type ProductCatalogSnapshot = {
|
|
16
|
+
readonly products: CommerceProduct[];
|
|
17
|
+
readonly count: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Catálogo de produtos configurados em `config.commerce.catalog`.
|
|
21
|
+
* Isolado por instância — sem estado global / module-level.
|
|
22
|
+
* Não acessa DOM, Transport nem altera payloads de eventos.
|
|
23
|
+
*/
|
|
24
|
+
declare class ProductCatalog {
|
|
25
|
+
private readonly productsById;
|
|
26
|
+
private readonly productsBySku;
|
|
27
|
+
private readonly orderedIds;
|
|
28
|
+
constructor(products?: readonly CommerceProduct[] | undefined, options?: ProductCatalogOptions);
|
|
29
|
+
list(): CommerceProduct[];
|
|
30
|
+
getById(id: string): CommerceProduct | null;
|
|
31
|
+
getBySku(sku: string): CommerceProduct | null;
|
|
32
|
+
hasProduct(id: string): boolean;
|
|
33
|
+
getSnapshot(): ProductCatalogSnapshot;
|
|
34
|
+
private indexProducts;
|
|
35
|
+
private normalizeProduct;
|
|
36
|
+
private cloneProduct;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
type CommerceStateOptions = {
|
|
40
|
+
/**
|
|
41
|
+
* Quando `false`, `upsertItem` só atualiza itens já presentes
|
|
42
|
+
* (não adiciona novos productIds). Default: `true`.
|
|
43
|
+
*/
|
|
44
|
+
readonly allowDynamicItems?: boolean;
|
|
45
|
+
};
|
|
46
|
+
type CommerceStateSnapshot = {
|
|
47
|
+
/**
|
|
48
|
+
* Estado vivo do carrinho (runtime).
|
|
49
|
+
* Não confundir com `commerce.cart.initialItems` da config.
|
|
50
|
+
*/
|
|
51
|
+
readonly selectedItems: CommerceCartItem[];
|
|
52
|
+
readonly count: number;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Estado em memória do cart da instância.
|
|
56
|
+
* Inicializado com `config.commerce.cart.initialItems`.
|
|
57
|
+
* Não persiste, não acessa DOM/Transport e não dispara eventos.
|
|
58
|
+
*/
|
|
59
|
+
declare class CommerceState {
|
|
60
|
+
private readonly itemsByProductId;
|
|
61
|
+
private readonly allowDynamicItems;
|
|
62
|
+
constructor(initialItems?: readonly CommerceCartItem[] | undefined, options?: CommerceStateOptions);
|
|
63
|
+
getSelectedItems(): CommerceCartItem[];
|
|
64
|
+
hasItem(productId: string): boolean;
|
|
65
|
+
getItem(productId: string): CommerceCartItem | null;
|
|
66
|
+
/**
|
|
67
|
+
* Insere ou atualiza item.
|
|
68
|
+
* - Sem `productId` → no-op
|
|
69
|
+
* - `selected === false` → remove se existir / não adiciona
|
|
70
|
+
* - `quantity <= 0` → remove
|
|
71
|
+
* - `allowDynamicItems === false` e item novo → no-op
|
|
72
|
+
*/
|
|
73
|
+
upsertItem(item: CommerceCartItem): void;
|
|
74
|
+
removeItem(productId: string): void;
|
|
75
|
+
/**
|
|
76
|
+
* Atualiza quantidade. `quantity <= 0` remove o item.
|
|
77
|
+
*/
|
|
78
|
+
updateQuantity(productId: string, quantity: number): void;
|
|
79
|
+
clear(): void;
|
|
80
|
+
getSnapshot(): CommerceStateSnapshot;
|
|
81
|
+
private seed;
|
|
82
|
+
private seedItem;
|
|
83
|
+
private normalizeQuantity;
|
|
84
|
+
private cloneItem;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Calcula value/currency a partir de items resolvidos.
|
|
89
|
+
* Não conhece DOM, detectors, Transport nem Dispatcher.
|
|
90
|
+
* Não muta o input.
|
|
91
|
+
*/
|
|
92
|
+
type ResolvedCommerceItem = {
|
|
93
|
+
productId?: string;
|
|
94
|
+
sku?: string;
|
|
95
|
+
productName?: string;
|
|
96
|
+
price?: number;
|
|
97
|
+
quantity?: number;
|
|
98
|
+
currency?: string;
|
|
99
|
+
category?: string;
|
|
100
|
+
variant?: string;
|
|
101
|
+
brand?: string;
|
|
102
|
+
type?: string;
|
|
103
|
+
metadata?: Record<string, unknown>;
|
|
104
|
+
};
|
|
105
|
+
type OrderCalculationInput = {
|
|
106
|
+
items?: ResolvedCommerceItem[];
|
|
107
|
+
value?: number;
|
|
108
|
+
currency?: string;
|
|
109
|
+
defaultCurrency?: string;
|
|
110
|
+
};
|
|
111
|
+
type OrderCalculationResult = {
|
|
112
|
+
items: ResolvedCommerceItem[];
|
|
113
|
+
value?: number;
|
|
114
|
+
currency?: string;
|
|
115
|
+
};
|
|
116
|
+
declare class OrderCalculator {
|
|
117
|
+
calculate(input: OrderCalculationInput): OrderCalculationResult;
|
|
118
|
+
private sumValue;
|
|
119
|
+
/**
|
|
120
|
+
* Ordem: currency manual → primeiro item com currency → defaultCurrency.
|
|
121
|
+
* Multi-currency: determinístico — usa o primeiro item com currency
|
|
122
|
+
* (não normaliza conversão entre moedas nesta etapa).
|
|
123
|
+
*/
|
|
124
|
+
private resolveCurrency;
|
|
125
|
+
private cloneItem;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
type CommerceEventType = 'ADD_TO_CART' | 'REMOVE_FROM_CART' | 'INITIATE_CHECKOUT' | 'PURCHASE' | 'VIEW_CONTENT' | 'ADD_PAYMENT_INFO';
|
|
129
|
+
type ExtractedProductInput = {
|
|
130
|
+
productId?: string;
|
|
131
|
+
productName?: string;
|
|
132
|
+
price?: number;
|
|
133
|
+
quantity?: number;
|
|
134
|
+
currency?: string;
|
|
135
|
+
sku?: string;
|
|
136
|
+
};
|
|
137
|
+
type CommerceResolverInput = {
|
|
138
|
+
eventType: CommerceEventType;
|
|
139
|
+
payload?: Record<string, unknown>;
|
|
140
|
+
extractedProduct?: ExtractedProductInput;
|
|
141
|
+
enrichmentSource?: CommerceEnrichmentSource;
|
|
142
|
+
items?: Array<{
|
|
143
|
+
productId?: string;
|
|
144
|
+
id?: string;
|
|
145
|
+
sku?: string;
|
|
146
|
+
name?: string;
|
|
147
|
+
productName?: string;
|
|
148
|
+
price?: number;
|
|
149
|
+
quantity?: number;
|
|
150
|
+
currency?: string;
|
|
151
|
+
category?: string;
|
|
152
|
+
}>;
|
|
153
|
+
};
|
|
154
|
+
type CommerceResolverResult = {
|
|
155
|
+
data: Record<string, unknown>;
|
|
156
|
+
items?: ResolvedCommerceItem[];
|
|
157
|
+
value?: number;
|
|
158
|
+
currency?: string;
|
|
159
|
+
};
|
|
160
|
+
type CommerceResolverOptions = {
|
|
161
|
+
catalog: ProductCatalog;
|
|
162
|
+
state: CommerceState;
|
|
163
|
+
calculator: OrderCalculator;
|
|
164
|
+
defaultCurrency?: string;
|
|
165
|
+
calculateValueFrom?: CommerceCalculateValueFrom;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* Combina payload + extracted + state + catalog + defaults.
|
|
169
|
+
* Não dispara eventos, não escreve em CommerceState, não conhece DOM/Transport.
|
|
170
|
+
*
|
|
171
|
+
* Prioridade de merge por campo:
|
|
172
|
+
* manual payload > extractedProduct > commerce state > catalog > defaults
|
|
173
|
+
*/
|
|
174
|
+
declare class CommerceResolver {
|
|
175
|
+
private readonly catalog;
|
|
176
|
+
private readonly state;
|
|
177
|
+
private readonly calculator;
|
|
178
|
+
private readonly defaultCurrency?;
|
|
179
|
+
private readonly calculateValueFrom;
|
|
180
|
+
constructor(options: CommerceResolverOptions);
|
|
181
|
+
resolve(input: CommerceResolverInput): CommerceResolverResult;
|
|
182
|
+
private resolveAddToCart;
|
|
183
|
+
/**
|
|
184
|
+
* Escolhe o item principal do cart runtime:
|
|
185
|
+
* 1. único item → esse
|
|
186
|
+
* 2. múltiplos → preferir catalog.type === 'main'
|
|
187
|
+
* 3. senão → primeiro do cart
|
|
188
|
+
* 4. cart vazio → null
|
|
189
|
+
*/
|
|
190
|
+
private resolvePrimaryCartItem;
|
|
191
|
+
private resolveRemoveFromCart;
|
|
192
|
+
private resolveCheckoutLike;
|
|
193
|
+
private resolveViewContent;
|
|
194
|
+
/**
|
|
195
|
+
* null = payload não trouxe items (usar state conforme calculateValueFrom)
|
|
196
|
+
* [] = payload trouxe items vazios
|
|
197
|
+
*/
|
|
198
|
+
private readPayloadItems;
|
|
199
|
+
private resolveItemsSource;
|
|
200
|
+
private enrichItem;
|
|
201
|
+
private toPixelItem;
|
|
202
|
+
private normalizeLooseItem;
|
|
203
|
+
private lookupIdBySku;
|
|
204
|
+
private lookupProductBySku;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
type CommerceEnrichmentEvent = 'pageView' | 'viewContent' | 'lead' | 'addToCart' | 'removeFromCart' | 'initiateCheckout' | 'addPaymentInfo' | 'purchase';
|
|
208
|
+
type PageViewCommercePayload = {
|
|
209
|
+
readonly value?: number;
|
|
210
|
+
readonly currency?: string;
|
|
211
|
+
readonly items?: PixelItem[];
|
|
212
|
+
readonly contentId?: string;
|
|
213
|
+
readonly contentName?: string;
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* Serviço compartilhado de commerce (root config).
|
|
217
|
+
* Usado por Core (PAGE_VIEW) e Conversion sem dependência circular
|
|
218
|
+
* entre os módulos.
|
|
219
|
+
*/
|
|
220
|
+
declare class CommerceService {
|
|
221
|
+
readonly enabled: boolean;
|
|
222
|
+
readonly config: CommerceConfig;
|
|
223
|
+
readonly catalog: ProductCatalog;
|
|
224
|
+
readonly state: CommerceState;
|
|
225
|
+
private readonly resolver;
|
|
226
|
+
constructor(config: CommerceConfig | undefined);
|
|
227
|
+
getEnrichment(event: CommerceEnrichmentEvent): CommerceEventEnrichmentConfig;
|
|
228
|
+
isEnabled(): boolean;
|
|
229
|
+
isEnrichmentEnabled(event: CommerceEnrichmentEvent): boolean;
|
|
230
|
+
getEnrichmentSource(event: CommerceEnrichmentEvent): CommerceEnrichmentSource;
|
|
231
|
+
/**
|
|
232
|
+
* Resolve payload de commerce para um evento conversion.
|
|
233
|
+
* Retorna null quando enrichment está desabilitado (caller usa payload original).
|
|
234
|
+
*/
|
|
235
|
+
resolveForEvent(event: CommerceEnrichmentEvent, eventType: 'ADD_TO_CART' | 'REMOVE_FROM_CART' | 'INITIATE_CHECKOUT' | 'PURCHASE' | 'VIEW_CONTENT' | 'ADD_PAYMENT_INFO', payload?: Record<string, unknown>): Record<string, unknown> | null;
|
|
236
|
+
/**
|
|
237
|
+
* Payload de commerce para PAGE_VIEW quando enrichment.pageView.enabled.
|
|
238
|
+
* Não depende de ConversionEngine.
|
|
239
|
+
*/
|
|
240
|
+
resolvePageViewEnrichment(): PageViewCommercePayload | null;
|
|
241
|
+
getResolver(): CommerceResolver;
|
|
242
|
+
getCalculateValueFrom(): ReturnType<typeof normalizeCalculateValueFrom>;
|
|
243
|
+
getMappings(): CommerceMappingsConfig | undefined;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
interface FingerprintService {
|
|
247
|
+
getFingerprint(): string | null;
|
|
248
|
+
ensureFingerprint(): string;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
interface SessionData {
|
|
252
|
+
readonly sessionId: string;
|
|
253
|
+
readonly lastActivityAt: number;
|
|
254
|
+
readonly createdAt: number;
|
|
255
|
+
}
|
|
256
|
+
type EnsureSessionResult = {
|
|
257
|
+
readonly sessionId: string;
|
|
258
|
+
readonly expired: boolean;
|
|
259
|
+
readonly previousSessionId?: string;
|
|
260
|
+
readonly created: boolean;
|
|
261
|
+
};
|
|
262
|
+
interface SessionService {
|
|
263
|
+
getSessionId(): string | null;
|
|
264
|
+
getSessionData(): SessionData | null;
|
|
265
|
+
getLastActivityAt(): number | null;
|
|
266
|
+
isExpired(ttlMs: number): boolean;
|
|
267
|
+
ensureSession(ttlMs: number): EnsureSessionResult;
|
|
268
|
+
ensureSessionId(): string;
|
|
269
|
+
touchActivity(): void;
|
|
270
|
+
renew(): string;
|
|
271
|
+
clear(): void;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
interface VisitorService {
|
|
275
|
+
getVisitorId(): string | null;
|
|
276
|
+
ensureVisitorId(): string;
|
|
277
|
+
clearVisitorId(): void;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
type PixelRuntimeServices = {
|
|
281
|
+
readonly storage: StorageService;
|
|
282
|
+
readonly visitor: VisitorService;
|
|
283
|
+
readonly session: SessionService;
|
|
284
|
+
readonly fingerprint: FingerprintService;
|
|
285
|
+
readonly dispatcher: DispatcherService;
|
|
286
|
+
readonly browserMetadata: BrowserMetadataService;
|
|
287
|
+
readonly eventBuilder: BaseEventBuilder;
|
|
288
|
+
readonly attribution: AttributionService;
|
|
289
|
+
readonly commerce: CommerceService;
|
|
290
|
+
readonly urlContext: UrlContextService;
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
export { CommerceResolver as C, type DispatcherService as D, type EnsureSessionResult as E, type FingerprintService as F, OrderCalculator as O, type PixelRuntimeServices as P, type ResolvedCommerceItem as R, type SessionService as S, type VisitorService as V, type SessionData as a, CommerceService as b, CommerceState as c, ProductCatalog as d, type CommerceEnrichmentEvent as e, type CommerceEventType as f, type CommerceResolverInput as g, type CommerceResolverOptions as h, type CommerceResolverResult as i, type CommerceStateOptions as j, type CommerceStateSnapshot as k, type ExtractedProductInput as l, type OrderCalculationInput as m, type OrderCalculationResult as n, type PageViewCommercePayload as o, type ProductCatalogOptions as p, type ProductCatalogSnapshot as q };
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { P as PixelEvent, a as PixelItem, b as StorageService, B as BrowserMetadataService, c as BaseEventBuilder, A as AttributionService, U as UrlContextService } from './index-CQAyT5Od.js';
|
|
2
|
+
import { W as CommerceProduct, J as CommerceCartItem, G as CommerceCalculateValueFrom, O as CommerceEnrichmentSource, M as CommerceConfig, R as CommerceEventEnrichmentConfig, a2 as normalizeCalculateValueFrom, U as CommerceMappingsConfig } from './pixel-BxZZx8l5.js';
|
|
3
|
+
|
|
4
|
+
interface DispatcherService {
|
|
5
|
+
dispatch(event: PixelEvent): void;
|
|
6
|
+
subscribe(listener: (event: PixelEvent) => void): () => void;
|
|
7
|
+
clear(): void;
|
|
8
|
+
getListenerCount(): number;
|
|
9
|
+
getLastEvent(): PixelEvent | null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type ProductCatalogOptions = {
|
|
13
|
+
readonly defaultCurrency?: string;
|
|
14
|
+
};
|
|
15
|
+
type ProductCatalogSnapshot = {
|
|
16
|
+
readonly products: CommerceProduct[];
|
|
17
|
+
readonly count: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Catálogo de produtos configurados em `config.commerce.catalog`.
|
|
21
|
+
* Isolado por instância — sem estado global / module-level.
|
|
22
|
+
* Não acessa DOM, Transport nem altera payloads de eventos.
|
|
23
|
+
*/
|
|
24
|
+
declare class ProductCatalog {
|
|
25
|
+
private readonly productsById;
|
|
26
|
+
private readonly productsBySku;
|
|
27
|
+
private readonly orderedIds;
|
|
28
|
+
constructor(products?: readonly CommerceProduct[] | undefined, options?: ProductCatalogOptions);
|
|
29
|
+
list(): CommerceProduct[];
|
|
30
|
+
getById(id: string): CommerceProduct | null;
|
|
31
|
+
getBySku(sku: string): CommerceProduct | null;
|
|
32
|
+
hasProduct(id: string): boolean;
|
|
33
|
+
getSnapshot(): ProductCatalogSnapshot;
|
|
34
|
+
private indexProducts;
|
|
35
|
+
private normalizeProduct;
|
|
36
|
+
private cloneProduct;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
type CommerceStateOptions = {
|
|
40
|
+
/**
|
|
41
|
+
* Quando `false`, `upsertItem` só atualiza itens já presentes
|
|
42
|
+
* (não adiciona novos productIds). Default: `true`.
|
|
43
|
+
*/
|
|
44
|
+
readonly allowDynamicItems?: boolean;
|
|
45
|
+
};
|
|
46
|
+
type CommerceStateSnapshot = {
|
|
47
|
+
/**
|
|
48
|
+
* Estado vivo do carrinho (runtime).
|
|
49
|
+
* Não confundir com `commerce.cart.initialItems` da config.
|
|
50
|
+
*/
|
|
51
|
+
readonly selectedItems: CommerceCartItem[];
|
|
52
|
+
readonly count: number;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Estado em memória do cart da instância.
|
|
56
|
+
* Inicializado com `config.commerce.cart.initialItems`.
|
|
57
|
+
* Não persiste, não acessa DOM/Transport e não dispara eventos.
|
|
58
|
+
*/
|
|
59
|
+
declare class CommerceState {
|
|
60
|
+
private readonly itemsByProductId;
|
|
61
|
+
private readonly allowDynamicItems;
|
|
62
|
+
constructor(initialItems?: readonly CommerceCartItem[] | undefined, options?: CommerceStateOptions);
|
|
63
|
+
getSelectedItems(): CommerceCartItem[];
|
|
64
|
+
hasItem(productId: string): boolean;
|
|
65
|
+
getItem(productId: string): CommerceCartItem | null;
|
|
66
|
+
/**
|
|
67
|
+
* Insere ou atualiza item.
|
|
68
|
+
* - Sem `productId` → no-op
|
|
69
|
+
* - `selected === false` → remove se existir / não adiciona
|
|
70
|
+
* - `quantity <= 0` → remove
|
|
71
|
+
* - `allowDynamicItems === false` e item novo → no-op
|
|
72
|
+
*/
|
|
73
|
+
upsertItem(item: CommerceCartItem): void;
|
|
74
|
+
removeItem(productId: string): void;
|
|
75
|
+
/**
|
|
76
|
+
* Atualiza quantidade. `quantity <= 0` remove o item.
|
|
77
|
+
*/
|
|
78
|
+
updateQuantity(productId: string, quantity: number): void;
|
|
79
|
+
clear(): void;
|
|
80
|
+
getSnapshot(): CommerceStateSnapshot;
|
|
81
|
+
private seed;
|
|
82
|
+
private seedItem;
|
|
83
|
+
private normalizeQuantity;
|
|
84
|
+
private cloneItem;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Calcula value/currency a partir de items resolvidos.
|
|
89
|
+
* Não conhece DOM, detectors, Transport nem Dispatcher.
|
|
90
|
+
* Não muta o input.
|
|
91
|
+
*/
|
|
92
|
+
type ResolvedCommerceItem = {
|
|
93
|
+
productId?: string;
|
|
94
|
+
sku?: string;
|
|
95
|
+
productName?: string;
|
|
96
|
+
price?: number;
|
|
97
|
+
quantity?: number;
|
|
98
|
+
currency?: string;
|
|
99
|
+
category?: string;
|
|
100
|
+
variant?: string;
|
|
101
|
+
brand?: string;
|
|
102
|
+
type?: string;
|
|
103
|
+
metadata?: Record<string, unknown>;
|
|
104
|
+
};
|
|
105
|
+
type OrderCalculationInput = {
|
|
106
|
+
items?: ResolvedCommerceItem[];
|
|
107
|
+
value?: number;
|
|
108
|
+
currency?: string;
|
|
109
|
+
defaultCurrency?: string;
|
|
110
|
+
};
|
|
111
|
+
type OrderCalculationResult = {
|
|
112
|
+
items: ResolvedCommerceItem[];
|
|
113
|
+
value?: number;
|
|
114
|
+
currency?: string;
|
|
115
|
+
};
|
|
116
|
+
declare class OrderCalculator {
|
|
117
|
+
calculate(input: OrderCalculationInput): OrderCalculationResult;
|
|
118
|
+
private sumValue;
|
|
119
|
+
/**
|
|
120
|
+
* Ordem: currency manual → primeiro item com currency → defaultCurrency.
|
|
121
|
+
* Multi-currency: determinístico — usa o primeiro item com currency
|
|
122
|
+
* (não normaliza conversão entre moedas nesta etapa).
|
|
123
|
+
*/
|
|
124
|
+
private resolveCurrency;
|
|
125
|
+
private cloneItem;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
type CommerceEventType = 'ADD_TO_CART' | 'REMOVE_FROM_CART' | 'INITIATE_CHECKOUT' | 'PURCHASE' | 'VIEW_CONTENT' | 'ADD_PAYMENT_INFO';
|
|
129
|
+
type ExtractedProductInput = {
|
|
130
|
+
productId?: string;
|
|
131
|
+
productName?: string;
|
|
132
|
+
price?: number;
|
|
133
|
+
quantity?: number;
|
|
134
|
+
currency?: string;
|
|
135
|
+
sku?: string;
|
|
136
|
+
};
|
|
137
|
+
type CommerceResolverInput = {
|
|
138
|
+
eventType: CommerceEventType;
|
|
139
|
+
payload?: Record<string, unknown>;
|
|
140
|
+
extractedProduct?: ExtractedProductInput;
|
|
141
|
+
enrichmentSource?: CommerceEnrichmentSource;
|
|
142
|
+
items?: Array<{
|
|
143
|
+
productId?: string;
|
|
144
|
+
id?: string;
|
|
145
|
+
sku?: string;
|
|
146
|
+
name?: string;
|
|
147
|
+
productName?: string;
|
|
148
|
+
price?: number;
|
|
149
|
+
quantity?: number;
|
|
150
|
+
currency?: string;
|
|
151
|
+
category?: string;
|
|
152
|
+
}>;
|
|
153
|
+
};
|
|
154
|
+
type CommerceResolverResult = {
|
|
155
|
+
data: Record<string, unknown>;
|
|
156
|
+
items?: ResolvedCommerceItem[];
|
|
157
|
+
value?: number;
|
|
158
|
+
currency?: string;
|
|
159
|
+
};
|
|
160
|
+
type CommerceResolverOptions = {
|
|
161
|
+
catalog: ProductCatalog;
|
|
162
|
+
state: CommerceState;
|
|
163
|
+
calculator: OrderCalculator;
|
|
164
|
+
defaultCurrency?: string;
|
|
165
|
+
calculateValueFrom?: CommerceCalculateValueFrom;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* Combina payload + extracted + state + catalog + defaults.
|
|
169
|
+
* Não dispara eventos, não escreve em CommerceState, não conhece DOM/Transport.
|
|
170
|
+
*
|
|
171
|
+
* Prioridade de merge por campo:
|
|
172
|
+
* manual payload > extractedProduct > commerce state > catalog > defaults
|
|
173
|
+
*/
|
|
174
|
+
declare class CommerceResolver {
|
|
175
|
+
private readonly catalog;
|
|
176
|
+
private readonly state;
|
|
177
|
+
private readonly calculator;
|
|
178
|
+
private readonly defaultCurrency?;
|
|
179
|
+
private readonly calculateValueFrom;
|
|
180
|
+
constructor(options: CommerceResolverOptions);
|
|
181
|
+
resolve(input: CommerceResolverInput): CommerceResolverResult;
|
|
182
|
+
private resolveAddToCart;
|
|
183
|
+
/**
|
|
184
|
+
* Escolhe o item principal do cart runtime:
|
|
185
|
+
* 1. único item → esse
|
|
186
|
+
* 2. múltiplos → preferir catalog.type === 'main'
|
|
187
|
+
* 3. senão → primeiro do cart
|
|
188
|
+
* 4. cart vazio → null
|
|
189
|
+
*/
|
|
190
|
+
private resolvePrimaryCartItem;
|
|
191
|
+
private resolveRemoveFromCart;
|
|
192
|
+
private resolveCheckoutLike;
|
|
193
|
+
private resolveViewContent;
|
|
194
|
+
/**
|
|
195
|
+
* null = payload não trouxe items (usar state conforme calculateValueFrom)
|
|
196
|
+
* [] = payload trouxe items vazios
|
|
197
|
+
*/
|
|
198
|
+
private readPayloadItems;
|
|
199
|
+
private resolveItemsSource;
|
|
200
|
+
private enrichItem;
|
|
201
|
+
private toPixelItem;
|
|
202
|
+
private normalizeLooseItem;
|
|
203
|
+
private lookupIdBySku;
|
|
204
|
+
private lookupProductBySku;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
type CommerceEnrichmentEvent = 'pageView' | 'viewContent' | 'lead' | 'addToCart' | 'removeFromCart' | 'initiateCheckout' | 'addPaymentInfo' | 'purchase';
|
|
208
|
+
type PageViewCommercePayload = {
|
|
209
|
+
readonly value?: number;
|
|
210
|
+
readonly currency?: string;
|
|
211
|
+
readonly items?: PixelItem[];
|
|
212
|
+
readonly contentId?: string;
|
|
213
|
+
readonly contentName?: string;
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* Serviço compartilhado de commerce (root config).
|
|
217
|
+
* Usado por Core (PAGE_VIEW) e Conversion sem dependência circular
|
|
218
|
+
* entre os módulos.
|
|
219
|
+
*/
|
|
220
|
+
declare class CommerceService {
|
|
221
|
+
readonly enabled: boolean;
|
|
222
|
+
readonly config: CommerceConfig;
|
|
223
|
+
readonly catalog: ProductCatalog;
|
|
224
|
+
readonly state: CommerceState;
|
|
225
|
+
private readonly resolver;
|
|
226
|
+
constructor(config: CommerceConfig | undefined);
|
|
227
|
+
getEnrichment(event: CommerceEnrichmentEvent): CommerceEventEnrichmentConfig;
|
|
228
|
+
isEnabled(): boolean;
|
|
229
|
+
isEnrichmentEnabled(event: CommerceEnrichmentEvent): boolean;
|
|
230
|
+
getEnrichmentSource(event: CommerceEnrichmentEvent): CommerceEnrichmentSource;
|
|
231
|
+
/**
|
|
232
|
+
* Resolve payload de commerce para um evento conversion.
|
|
233
|
+
* Retorna null quando enrichment está desabilitado (caller usa payload original).
|
|
234
|
+
*/
|
|
235
|
+
resolveForEvent(event: CommerceEnrichmentEvent, eventType: 'ADD_TO_CART' | 'REMOVE_FROM_CART' | 'INITIATE_CHECKOUT' | 'PURCHASE' | 'VIEW_CONTENT' | 'ADD_PAYMENT_INFO', payload?: Record<string, unknown>): Record<string, unknown> | null;
|
|
236
|
+
/**
|
|
237
|
+
* Payload de commerce para PAGE_VIEW quando enrichment.pageView.enabled.
|
|
238
|
+
* Não depende de ConversionEngine.
|
|
239
|
+
*/
|
|
240
|
+
resolvePageViewEnrichment(): PageViewCommercePayload | null;
|
|
241
|
+
getResolver(): CommerceResolver;
|
|
242
|
+
getCalculateValueFrom(): ReturnType<typeof normalizeCalculateValueFrom>;
|
|
243
|
+
getMappings(): CommerceMappingsConfig | undefined;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
interface FingerprintService {
|
|
247
|
+
getFingerprint(): string | null;
|
|
248
|
+
ensureFingerprint(): string;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
interface SessionData {
|
|
252
|
+
readonly sessionId: string;
|
|
253
|
+
readonly lastActivityAt: number;
|
|
254
|
+
readonly createdAt: number;
|
|
255
|
+
}
|
|
256
|
+
type EnsureSessionResult = {
|
|
257
|
+
readonly sessionId: string;
|
|
258
|
+
readonly expired: boolean;
|
|
259
|
+
readonly previousSessionId?: string;
|
|
260
|
+
readonly created: boolean;
|
|
261
|
+
};
|
|
262
|
+
interface SessionService {
|
|
263
|
+
getSessionId(): string | null;
|
|
264
|
+
getSessionData(): SessionData | null;
|
|
265
|
+
getLastActivityAt(): number | null;
|
|
266
|
+
isExpired(ttlMs: number): boolean;
|
|
267
|
+
ensureSession(ttlMs: number): EnsureSessionResult;
|
|
268
|
+
ensureSessionId(): string;
|
|
269
|
+
touchActivity(): void;
|
|
270
|
+
renew(): string;
|
|
271
|
+
clear(): void;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
interface VisitorService {
|
|
275
|
+
getVisitorId(): string | null;
|
|
276
|
+
ensureVisitorId(): string;
|
|
277
|
+
clearVisitorId(): void;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
type PixelRuntimeServices = {
|
|
281
|
+
readonly storage: StorageService;
|
|
282
|
+
readonly visitor: VisitorService;
|
|
283
|
+
readonly session: SessionService;
|
|
284
|
+
readonly fingerprint: FingerprintService;
|
|
285
|
+
readonly dispatcher: DispatcherService;
|
|
286
|
+
readonly browserMetadata: BrowserMetadataService;
|
|
287
|
+
readonly eventBuilder: BaseEventBuilder;
|
|
288
|
+
readonly attribution: AttributionService;
|
|
289
|
+
readonly commerce: CommerceService;
|
|
290
|
+
readonly urlContext: UrlContextService;
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
export { CommerceResolver as C, type DispatcherService as D, type EnsureSessionResult as E, type FingerprintService as F, OrderCalculator as O, type PixelRuntimeServices as P, type ResolvedCommerceItem as R, type SessionService as S, type VisitorService as V, type SessionData as a, CommerceService as b, CommerceState as c, ProductCatalog as d, type CommerceEnrichmentEvent as e, type CommerceEventType as f, type CommerceResolverInput as g, type CommerceResolverOptions as h, type CommerceResolverResult as i, type CommerceStateOptions as j, type CommerceStateSnapshot as k, type ExtractedProductInput as l, type OrderCalculationInput as m, type OrderCalculationResult as n, type PageViewCommercePayload as o, type ProductCatalogOptions as p, type ProductCatalogSnapshot as q };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contratos de Core UrlContext — captura, gestão e propagação de params de URL.
|
|
3
|
+
* `sid` público ≠ `session_id` interno do Pixel.
|
|
4
|
+
*/
|
|
5
|
+
type UrlContextMode = 'allowlist' | 'all_except';
|
|
6
|
+
type UrlContextSource = 'url' | 'cookie' | 'storage' | 'generated';
|
|
7
|
+
type UrlContextWriteStrategy = 'replaceState' | 'none';
|
|
8
|
+
type UrlContextLinkDecorationStrategy = 'on_click' | 'on_init' | 'both';
|
|
9
|
+
type UrlManagedParamMode = 'read_only' | 'write_only' | 'read_write';
|
|
10
|
+
type UrlQueryParamsConfig = {
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
mode?: UrlContextMode;
|
|
13
|
+
allowlist?: string[];
|
|
14
|
+
denylist?: string[];
|
|
15
|
+
mergeDefaultDenylist?: boolean;
|
|
16
|
+
};
|
|
17
|
+
type UrlManagedParamGeneratorConfig = {
|
|
18
|
+
type: 'public_id';
|
|
19
|
+
prefix?: string;
|
|
20
|
+
};
|
|
21
|
+
type UrlManagedParamCookieConfig = {
|
|
22
|
+
enabled?: boolean;
|
|
23
|
+
name?: string;
|
|
24
|
+
domain?: 'auto' | string;
|
|
25
|
+
path?: string;
|
|
26
|
+
sameSite?: 'Lax' | 'Strict' | 'None';
|
|
27
|
+
secure?: boolean;
|
|
28
|
+
maxAgeMs?: number;
|
|
29
|
+
};
|
|
30
|
+
type UrlManagedParamPersistenceConfig = {
|
|
31
|
+
enabled?: boolean;
|
|
32
|
+
strategy?: 'storage' | 'cookie' | 'localStorage_cookie';
|
|
33
|
+
storageKey?: string;
|
|
34
|
+
cookie?: UrlManagedParamCookieConfig;
|
|
35
|
+
};
|
|
36
|
+
type UrlManagedParamConfig = {
|
|
37
|
+
key: string;
|
|
38
|
+
param: string;
|
|
39
|
+
mode?: UrlManagedParamMode;
|
|
40
|
+
writeStrategy?: UrlContextWriteStrategy;
|
|
41
|
+
generator?: UrlManagedParamGeneratorConfig;
|
|
42
|
+
persistence?: UrlManagedParamPersistenceConfig;
|
|
43
|
+
decorateLinks?: boolean;
|
|
44
|
+
};
|
|
45
|
+
type UrlForwardParamsConfig = {
|
|
46
|
+
enabled?: boolean;
|
|
47
|
+
mode?: UrlContextMode;
|
|
48
|
+
allowlist?: string[];
|
|
49
|
+
denylist?: string[];
|
|
50
|
+
mergeDefaultDenylist?: boolean;
|
|
51
|
+
};
|
|
52
|
+
type UrlLinkDecorationConfig = {
|
|
53
|
+
enabled?: boolean;
|
|
54
|
+
strategy?: UrlContextLinkDecorationStrategy;
|
|
55
|
+
selector?: string;
|
|
56
|
+
allowedDomains?: '*' | string[];
|
|
57
|
+
excludedDomains?: string[];
|
|
58
|
+
mergeDefaultExcludedDomains?: boolean;
|
|
59
|
+
excludeSelectors?: string[];
|
|
60
|
+
mergeDefaultExcludeSelectors?: boolean;
|
|
61
|
+
preserveExisting?: boolean;
|
|
62
|
+
overwriteExisting?: boolean;
|
|
63
|
+
decorateHashLinks?: boolean;
|
|
64
|
+
decorateMailto?: boolean;
|
|
65
|
+
decorateTel?: boolean;
|
|
66
|
+
};
|
|
67
|
+
type UrlContextConfig = {
|
|
68
|
+
enabled?: boolean;
|
|
69
|
+
queryParams?: UrlQueryParamsConfig;
|
|
70
|
+
managedParams?: UrlManagedParamConfig[];
|
|
71
|
+
forwardParams?: UrlForwardParamsConfig;
|
|
72
|
+
linkDecoration?: UrlLinkDecorationConfig;
|
|
73
|
+
};
|
|
74
|
+
/** Payload interno (camelCase) anexado pelo EventBuilder. */
|
|
75
|
+
type UrlContextPayload = {
|
|
76
|
+
managed?: Record<string, string>;
|
|
77
|
+
forwarded?: Record<string, string>;
|
|
78
|
+
source?: Record<string, UrlContextSource>;
|
|
79
|
+
};
|
|
80
|
+
type UrlContextSnapshot = {
|
|
81
|
+
queryParams: Record<string, string>;
|
|
82
|
+
urlContext: UrlContextPayload;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export type { UrlContextConfig as U, UrlContextLinkDecorationStrategy as a, UrlContextMode as b, UrlContextPayload as c, UrlContextSnapshot as d, UrlContextSource as e, UrlContextWriteStrategy as f, UrlForwardParamsConfig as g, UrlLinkDecorationConfig as h, UrlManagedParamConfig as i, UrlManagedParamMode as j, UrlQueryParamsConfig as k };
|