@walkeros/web-destination-pinterest 3.3.0-next-1776098542393
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/LICENSE +21 -0
- package/README.md +249 -0
- package/dist/dev.d.mts +239 -0
- package/dist/dev.d.ts +239 -0
- package/dist/dev.js +1 -0
- package/dist/dev.js.map +1 -0
- package/dist/dev.mjs +1 -0
- package/dist/dev.mjs.map +1 -0
- package/dist/examples/index.d.mts +206 -0
- package/dist/examples/index.d.ts +206 -0
- package/dist/examples/index.js +14506 -0
- package/dist/examples/index.mjs +14484 -0
- package/dist/index.browser.js +1 -0
- package/dist/index.d.mts +168 -0
- package/dist/index.d.ts +168 -0
- package/dist/index.es5.js +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -0
- package/dist/walkerOS.json +913 -0
- package/package.json +78 -0
package/dist/dev.d.ts
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
2
|
+
import { z } from '@walkeros/core/dev';
|
|
3
|
+
import { DestinationWeb } from '@walkeros/web-core';
|
|
4
|
+
import { Flow } from '@walkeros/core';
|
|
5
|
+
|
|
6
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
7
|
+
apiKey: z.ZodString;
|
|
8
|
+
pageview: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
identify: z.ZodOptional<z.ZodUnknown>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
type Settings = z.infer<typeof SettingsSchema>;
|
|
12
|
+
|
|
13
|
+
declare const MappingSchema: z.ZodObject<{
|
|
14
|
+
identify: z.ZodOptional<z.ZodUnknown>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
type Mapping = z.infer<typeof MappingSchema>;
|
|
17
|
+
|
|
18
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
19
|
+
declare const mapping: _walkeros_core_dev.JSONSchema;
|
|
20
|
+
|
|
21
|
+
type index$1_Mapping = Mapping;
|
|
22
|
+
declare const index$1_MappingSchema: typeof MappingSchema;
|
|
23
|
+
type index$1_Settings = Settings;
|
|
24
|
+
declare const index$1_SettingsSchema: typeof SettingsSchema;
|
|
25
|
+
declare const index$1_mapping: typeof mapping;
|
|
26
|
+
declare const index$1_settings: typeof settings;
|
|
27
|
+
declare namespace index$1 {
|
|
28
|
+
export { type index$1_Mapping as Mapping, index$1_MappingSchema as MappingSchema, type index$1_Settings as Settings, index$1_SettingsSchema as SettingsSchema, index$1_mapping as mapping, index$1_settings as settings };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Pinterest Tag global. The queue-based function created by the Pinterest
|
|
33
|
+
* snippet. Before core.js loads, calls are queued on `pintrk.queue`.
|
|
34
|
+
* After core.js resolves the queue, `pintrk` is replaced with the real
|
|
35
|
+
* implementation. Both shapes accept the same argument signatures.
|
|
36
|
+
*/
|
|
37
|
+
interface Pintrk {
|
|
38
|
+
(command: 'load', tagId: string, identify?: IdentifyFields): void;
|
|
39
|
+
(command: 'page'): void;
|
|
40
|
+
(command: 'track', eventName: string, eventData?: EventData, callback?: (didInit: boolean, error?: unknown) => void): void;
|
|
41
|
+
(command: 'set', userData: IdentifyFields): void;
|
|
42
|
+
queue?: unknown[][];
|
|
43
|
+
version?: string;
|
|
44
|
+
}
|
|
45
|
+
declare global {
|
|
46
|
+
interface Window {
|
|
47
|
+
pintrk?: Pintrk;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Enhanced matching fields. Web destination strictly limits to the two
|
|
52
|
+
* documented client-side Pinterest Tag fields. CAPI-only fields (ph, fn,
|
|
53
|
+
* ln, address, country, ip, ua) belong to a future server destination
|
|
54
|
+
* and are intentionally not accepted here.
|
|
55
|
+
*
|
|
56
|
+
* The Pinterest JS tag auto-hashes `em` with SHA-256 before transmission —
|
|
57
|
+
* the destination does NOT hash.
|
|
58
|
+
*/
|
|
59
|
+
interface IdentifyFields {
|
|
60
|
+
em?: string;
|
|
61
|
+
external_id?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Event data payload for pintrk('track', ...). Pinterest has a prescribed
|
|
65
|
+
* set of parameter names. Common parameters across events plus an open
|
|
66
|
+
* `[key: string]: unknown` for event-specific fields (search_query,
|
|
67
|
+
* video_title, lead_type, opt_out_type, custom properties, etc.).
|
|
68
|
+
*/
|
|
69
|
+
interface EventData {
|
|
70
|
+
value?: number;
|
|
71
|
+
order_quantity?: number;
|
|
72
|
+
currency?: string;
|
|
73
|
+
event_id?: string;
|
|
74
|
+
order_id?: string;
|
|
75
|
+
promo_code?: string;
|
|
76
|
+
property?: string;
|
|
77
|
+
product_name?: string;
|
|
78
|
+
product_id?: string;
|
|
79
|
+
product_category?: string;
|
|
80
|
+
product_brand?: string;
|
|
81
|
+
product_price?: number;
|
|
82
|
+
product_quantity?: number;
|
|
83
|
+
product_variant_id?: string;
|
|
84
|
+
product_variant?: string;
|
|
85
|
+
line_items?: LineItem[];
|
|
86
|
+
search_query?: string;
|
|
87
|
+
video_title?: string;
|
|
88
|
+
lead_type?: string;
|
|
89
|
+
opt_out_type?: 'LDP';
|
|
90
|
+
[key: string]: unknown;
|
|
91
|
+
}
|
|
92
|
+
interface LineItem {
|
|
93
|
+
product_name?: string;
|
|
94
|
+
product_id?: string;
|
|
95
|
+
product_category?: string;
|
|
96
|
+
product_brand?: string;
|
|
97
|
+
product_price?: number;
|
|
98
|
+
product_quantity?: number;
|
|
99
|
+
product_variant_id?: string;
|
|
100
|
+
product_variant?: string;
|
|
101
|
+
[key: string]: unknown;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Env — mock surface for tests. Pinterest Tag uses window.pintrk, so
|
|
105
|
+
* the env extends DestinationWeb.Env (which already provides window
|
|
106
|
+
* and document).
|
|
107
|
+
*/
|
|
108
|
+
interface Env extends DestinationWeb.Env {
|
|
109
|
+
window: {
|
|
110
|
+
pintrk?: Pintrk;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Pre-init environment — pintrk is not yet on the window.
|
|
116
|
+
* Used to validate the init path that creates the queue function.
|
|
117
|
+
*/
|
|
118
|
+
declare const init: Env;
|
|
119
|
+
/**
|
|
120
|
+
* Post-init environment — pintrk is available as a spy-able function.
|
|
121
|
+
* Tests clone this and replace `pintrk` with a jest.fn() to record calls.
|
|
122
|
+
*/
|
|
123
|
+
declare const push: Env;
|
|
124
|
+
/** Simulation tracking paths for CLI --simulate. */
|
|
125
|
+
declare const simulation: string[];
|
|
126
|
+
|
|
127
|
+
declare const env_init: typeof init;
|
|
128
|
+
declare const env_push: typeof push;
|
|
129
|
+
declare const env_simulation: typeof simulation;
|
|
130
|
+
declare namespace env {
|
|
131
|
+
export { env_init as init, env_push as push, env_simulation as simulation };
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Output convention:
|
|
136
|
+
* - Single SDK call: out = ['window.pintrk', 'track', 'checkout', { ... }]
|
|
137
|
+
* (flat array: first element is the dot-path, remaining elements are args)
|
|
138
|
+
* - Multiple SDK calls: out = [ [path, ...args], [path, ...args] ]
|
|
139
|
+
* - Zero SDK calls: out = []
|
|
140
|
+
*
|
|
141
|
+
* The step-examples test runner normalizes both shapes via flatten().
|
|
142
|
+
*/
|
|
143
|
+
/**
|
|
144
|
+
* Default event forwarding — no rule. Without a mapping.name, the walkerOS
|
|
145
|
+
* event name is forwarded as-is. Pinterest accepts it but won't match a
|
|
146
|
+
* standard conversion event. event_id is auto-attached for deduplication.
|
|
147
|
+
*/
|
|
148
|
+
declare const defaultForward: Flow.StepExample;
|
|
149
|
+
/**
|
|
150
|
+
* Wildcard ignore pattern — the standard walkerOS way to suppress noisy
|
|
151
|
+
* events. `mapping.ignore: true` at rule level produces zero SDK calls.
|
|
152
|
+
*/
|
|
153
|
+
declare const wildcardIgnored: Flow.StepExample;
|
|
154
|
+
/**
|
|
155
|
+
* Standard Pinterest event rename via mapping.name. walkerOS "page view"
|
|
156
|
+
* → Pinterest "pagevisit". The ONLY way to get Pinterest to recognize
|
|
157
|
+
* a conversion event — the destination never auto-maps.
|
|
158
|
+
*/
|
|
159
|
+
declare const pageViewRename: Flow.StepExample;
|
|
160
|
+
/**
|
|
161
|
+
* Search — walkerOS site search → Pinterest "search" with search_query.
|
|
162
|
+
* Illustrates single-field mapping.data resolution.
|
|
163
|
+
*/
|
|
164
|
+
declare const siteSearch: Flow.StepExample;
|
|
165
|
+
/**
|
|
166
|
+
* Single-product viewcontent. Illustrates:
|
|
167
|
+
* - currency fallback via { key, value: 'EUR' }
|
|
168
|
+
* - flat product_* parameter names
|
|
169
|
+
*/
|
|
170
|
+
declare const productViewContent: Flow.StepExample;
|
|
171
|
+
/**
|
|
172
|
+
* Add-to-cart with an inline line_items array.
|
|
173
|
+
*
|
|
174
|
+
* Pinterest sends a single track() call with line_items as an ARRAY
|
|
175
|
+
* INSIDE the event data — NOT a loop of N separate calls.
|
|
176
|
+
*/
|
|
177
|
+
declare const productAddToCart: Flow.StepExample;
|
|
178
|
+
/**
|
|
179
|
+
* Multi-product checkout — the canonical Pinterest ecommerce pattern.
|
|
180
|
+
* `line_items.loop: ["nested", { condition, map }]` iterates event.nested
|
|
181
|
+
* and produces ONE array inside a SINGLE track() call.
|
|
182
|
+
*
|
|
183
|
+
* Default fixture has 3 nested entries: ers (420 black), cc (42, no color),
|
|
184
|
+
* gift (no price → filtered out by condition).
|
|
185
|
+
*/
|
|
186
|
+
declare const orderCompleteCheckout: Flow.StepExample;
|
|
187
|
+
/**
|
|
188
|
+
* Lead conversion with per-event enhanced matching update.
|
|
189
|
+
*
|
|
190
|
+
* The rule-level settings.identify resolves to { em, external_id } and
|
|
191
|
+
* triggers pintrk('set', data) BEFORE the track() call — enhanced
|
|
192
|
+
* matching data is associated with the same event via event_id.
|
|
193
|
+
*/
|
|
194
|
+
declare const userLoginLead: Flow.StepExample;
|
|
195
|
+
/**
|
|
196
|
+
* mapping.skip — processes side effects (identify set) but suppresses
|
|
197
|
+
* the default pintrk('track', ...) call. Useful when an upstream
|
|
198
|
+
* destination already fired the conversion and you only want to update
|
|
199
|
+
* enhanced matching.
|
|
200
|
+
*/
|
|
201
|
+
declare const identifyOnlySkip: Flow.StepExample;
|
|
202
|
+
/**
|
|
203
|
+
* Consent revocation — walkerOS walker consent { marketing: false }.
|
|
204
|
+
* The destination's on('consent') handler flips the runtime state flag
|
|
205
|
+
* and stops calling pintrk('track', ...) for subsequent events. There
|
|
206
|
+
* is NO opt_out SDK call — Pinterest has no such API.
|
|
207
|
+
*
|
|
208
|
+
* Expected out: [] — no pintrk calls fire as a direct result of the
|
|
209
|
+
* consent dispatch.
|
|
210
|
+
*/
|
|
211
|
+
declare const consentRevoke: Flow.StepExample;
|
|
212
|
+
/**
|
|
213
|
+
* Consent grant — explicit opt-in. Same behavior: the destination's
|
|
214
|
+
* on('consent') flips the flag. No SDK call fires.
|
|
215
|
+
*/
|
|
216
|
+
declare const consentGrant: Flow.StepExample;
|
|
217
|
+
|
|
218
|
+
declare const step_consentGrant: typeof consentGrant;
|
|
219
|
+
declare const step_consentRevoke: typeof consentRevoke;
|
|
220
|
+
declare const step_defaultForward: typeof defaultForward;
|
|
221
|
+
declare const step_identifyOnlySkip: typeof identifyOnlySkip;
|
|
222
|
+
declare const step_orderCompleteCheckout: typeof orderCompleteCheckout;
|
|
223
|
+
declare const step_pageViewRename: typeof pageViewRename;
|
|
224
|
+
declare const step_productAddToCart: typeof productAddToCart;
|
|
225
|
+
declare const step_productViewContent: typeof productViewContent;
|
|
226
|
+
declare const step_siteSearch: typeof siteSearch;
|
|
227
|
+
declare const step_userLoginLead: typeof userLoginLead;
|
|
228
|
+
declare const step_wildcardIgnored: typeof wildcardIgnored;
|
|
229
|
+
declare namespace step {
|
|
230
|
+
export { step_consentGrant as consentGrant, step_consentRevoke as consentRevoke, step_defaultForward as defaultForward, step_identifyOnlySkip as identifyOnlySkip, step_orderCompleteCheckout as orderCompleteCheckout, step_pageViewRename as pageViewRename, step_productAddToCart as productAddToCart, step_productViewContent as productViewContent, step_siteSearch as siteSearch, step_userLoginLead as userLoginLead, step_wildcardIgnored as wildcardIgnored };
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
declare const index_env: typeof env;
|
|
234
|
+
declare const index_step: typeof step;
|
|
235
|
+
declare namespace index {
|
|
236
|
+
export { index_env as env, index_step as step };
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export { index as examples, index$1 as schemas };
|