@walkeros/web-destination-pinterest 4.8.2 → 4.8.3-next-1793115089237
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 +36 -3
- package/README.md +1 -1
- package/dist/dev.d.mts +6 -2
- package/dist/dev.d.ts +6 -2
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/examples/index.d.mts +5 -2
- package/dist/examples/index.d.ts +5 -2
- package/dist/examples/index.js +37 -15
- package/dist/examples/index.mjs +37 -16
- package/dist/walkerOS.json +50 -26
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @walkeros/web-destination-pinterest
|
|
2
2
|
|
|
3
|
+
## 4.8.3-next-1793115089237
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5313635: The sample events from `getEvent` now use the standard event names:
|
|
8
|
+
`checkout start` replaces `checkout view`, an order carries `tax` and `total`,
|
|
9
|
+
a promotion names its placement `slot`, and product events carry `currency`.
|
|
10
|
+
Order `value` is now the merchandise value: the `order complete` sample goes
|
|
11
|
+
from 555 to 462, and the gross amount charged is `total` (467.22). The
|
|
12
|
+
destination examples read `data.tax`, `data.slot` and the search keys
|
|
13
|
+
`data.term` and `data.results`, and gross fields such as Matomo `grandTotal`
|
|
14
|
+
read `data.total` first, then `data.value`. The CLI ships default event
|
|
15
|
+
contracts for common site types in `examples/contracts/`.
|
|
16
|
+
- 9316f2a: The `identify` description matches the destination: init calls
|
|
17
|
+
`pintrk('load', tagId)` without an identity, which is sent with
|
|
18
|
+
`pintrk('set', ...)` when it changes, and the tag takes a plain or hashed
|
|
19
|
+
email. The checkout example's condition works as published, and the commerce
|
|
20
|
+
examples send product fields inside `line_items`, with `product_name` taken
|
|
21
|
+
from the product name.
|
|
22
|
+
- 5313635: The package publishes a minimal example: the Tag ID is all Pinterest
|
|
23
|
+
needs to deliver. The docs page renders the install line, the integrated code
|
|
24
|
+
and the flow from it, and the package test runs the same settings, so the
|
|
25
|
+
setup a reader copies is the one that was tested.
|
|
26
|
+
- Updated dependencies [29d2218]
|
|
27
|
+
- Updated dependencies [34fd225]
|
|
28
|
+
- Updated dependencies [5313635]
|
|
29
|
+
- Updated dependencies [5313635]
|
|
30
|
+
- Updated dependencies [5313635]
|
|
31
|
+
- Updated dependencies [5313635]
|
|
32
|
+
- Updated dependencies [5313635]
|
|
33
|
+
- Updated dependencies [34fd225]
|
|
34
|
+
- Updated dependencies [5313635]
|
|
35
|
+
- Updated dependencies [5313635]
|
|
36
|
+
- @walkeros/web-core@4.8.3-next-1793115089237
|
|
37
|
+
- @walkeros/core@4.8.3-next-1793115089237
|
|
38
|
+
|
|
3
39
|
## 4.8.2
|
|
4
40
|
|
|
5
41
|
### Patch Changes
|
|
@@ -282,9 +318,6 @@
|
|
|
282
318
|
and `event.context` remain required.
|
|
283
319
|
- Each source self-registers via TypeScript module augmentation of `SourceMap`
|
|
284
320
|
in `@walkeros/core`.
|
|
285
|
-
- App-side coordination (`/workspaces/developer/app`) is a follow-up plan, not
|
|
286
|
-
part of this release. Telemetry from v4 CLI/MCP will not validate against
|
|
287
|
-
the existing app schema until that follow-up ships.
|
|
288
321
|
- `Mapping.Rule.skip` is renamed to `Mapping.Rule.silent`. Customer flow.json
|
|
289
322
|
configs using `skip: true` in mapping rules must rename to `silent: true`.
|
|
290
323
|
Hard cut: no legacy alias, the field is gone.
|
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ npm install @walkeros/web-destination-pinterest
|
|
|
33
33
|
"destinations": {
|
|
34
34
|
"pinterest": {
|
|
35
35
|
"package": "@walkeros/web-destination-pinterest",
|
|
36
|
-
"config": { "settings": { "apiKey": "
|
|
36
|
+
"config": { "settings": { "apiKey": "2612345678901" } }
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
}
|
package/dist/dev.d.mts
CHANGED
|
@@ -155,7 +155,7 @@ declare const wildcardIgnored: Flow.StepExample;
|
|
|
155
155
|
*/
|
|
156
156
|
declare const pageViewRename: Flow.StepExample;
|
|
157
157
|
/**
|
|
158
|
-
* Search - walkerOS
|
|
158
|
+
* Search - walkerOS search submit → Pinterest "search" with search_query.
|
|
159
159
|
* Illustrates single-field mapping.data resolution.
|
|
160
160
|
*/
|
|
161
161
|
declare const siteSearch: Flow.StepExample;
|
|
@@ -216,10 +216,14 @@ declare namespace step {
|
|
|
216
216
|
export { step_consentGrant as consentGrant, step_consentRevoke as consentRevoke, step_defaultForward as defaultForward, step_identifyOnlySilent as identifyOnlySilent, step_identifyOnlySilentWithoutData as identifyOnlySilentWithoutData, step_orderCompleteCheckout as orderCompleteCheckout, step_pageViewRename as pageViewRename, step_productAddToCart as productAddToCart, step_productViewContent as productViewContent, step_silentRule as silentRule, step_siteSearch as siteSearch, step_userLoginLead as userLoginLead, step_wildcardIgnored as wildcardIgnored };
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
+
/** The settings the Pinterest Tag needs to deliver: the Tag ID. */
|
|
220
|
+
declare const minimal: Flow.MinimalExample;
|
|
221
|
+
|
|
219
222
|
declare const index_env: typeof env;
|
|
223
|
+
declare const index_minimal: typeof minimal;
|
|
220
224
|
declare const index_step: typeof step;
|
|
221
225
|
declare namespace index {
|
|
222
|
-
export { index_env as env, index_step as step };
|
|
226
|
+
export { index_env as env, index_minimal as minimal, index_step as step };
|
|
223
227
|
}
|
|
224
228
|
|
|
225
229
|
export { index as examples, index$1 as schemas };
|
package/dist/dev.d.ts
CHANGED
|
@@ -155,7 +155,7 @@ declare const wildcardIgnored: Flow.StepExample;
|
|
|
155
155
|
*/
|
|
156
156
|
declare const pageViewRename: Flow.StepExample;
|
|
157
157
|
/**
|
|
158
|
-
* Search - walkerOS
|
|
158
|
+
* Search - walkerOS search submit → Pinterest "search" with search_query.
|
|
159
159
|
* Illustrates single-field mapping.data resolution.
|
|
160
160
|
*/
|
|
161
161
|
declare const siteSearch: Flow.StepExample;
|
|
@@ -216,10 +216,14 @@ declare namespace step {
|
|
|
216
216
|
export { step_consentGrant as consentGrant, step_consentRevoke as consentRevoke, step_defaultForward as defaultForward, step_identifyOnlySilent as identifyOnlySilent, step_identifyOnlySilentWithoutData as identifyOnlySilentWithoutData, step_orderCompleteCheckout as orderCompleteCheckout, step_pageViewRename as pageViewRename, step_productAddToCart as productAddToCart, step_productViewContent as productViewContent, step_silentRule as silentRule, step_siteSearch as siteSearch, step_userLoginLead as userLoginLead, step_wildcardIgnored as wildcardIgnored };
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
+
/** The settings the Pinterest Tag needs to deliver: the Tag ID. */
|
|
220
|
+
declare const minimal: Flow.MinimalExample;
|
|
221
|
+
|
|
219
222
|
declare const index_env: typeof env;
|
|
223
|
+
declare const index_minimal: typeof minimal;
|
|
220
224
|
declare const index_step: typeof step;
|
|
221
225
|
declare namespace index {
|
|
222
|
-
export { index_env as env, index_step as step };
|
|
226
|
+
export { index_env as env, index_minimal as minimal, index_step as step };
|
|
223
227
|
}
|
|
224
228
|
|
|
225
229
|
export { index as examples, index$1 as schemas };
|
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,r=(e,a)=>{for(var i in a)t(e,i,{get:a[i],enumerable:!0})},d={};r(d,{examples:()=>g,schemas:()=>o}),module.exports=(e=d,((e,r,d,o)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let c of i(r))n.call(e,c)||c===d||t(e,c,{get:()=>r[c],enumerable:!(o=a(r,c))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o={};r(o,{MappingSchema:()=>l,SettingsSchema:()=>p,mapping:()=>v,settings:()=>m});var c=require("@walkeros/core/dev"),s=require("@walkeros/core/dev"),p=s.z.object({apiKey:s.z.string().regex(/^\d+$/,"Must be a numeric Pinterest Tag ID").min(6).describe('Your Pinterest Tag ID (numeric string, e.g. "2612345678901"). Found in Pinterest Ads Manager under Conversions → Pinterest Tag. Passed to pintrk("load", tagId).'),pageview:s.z.boolean().describe('
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,r=(e,a)=>{for(var i in a)t(e,i,{get:a[i],enumerable:!0})},d={};r(d,{examples:()=>g,schemas:()=>o}),module.exports=(e=d,((e,r,d,o)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let c of i(r))n.call(e,c)||c===d||t(e,c,{get:()=>r[c],enumerable:!(o=a(r,c))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o={};r(o,{MappingSchema:()=>l,SettingsSchema:()=>p,mapping:()=>v,settings:()=>m});var c=require("@walkeros/core/dev"),s=require("@walkeros/core/dev"),p=s.z.object({apiKey:s.z.string().regex(/^\d+$/,"Must be a numeric Pinterest Tag ID").min(6).describe('Your Pinterest Tag ID (numeric string, e.g. "2612345678901"). Found in Pinterest Ads Manager under Conversions → Pinterest Tag. Passed to pintrk("load", tagId).'),pageview:s.z.boolean().describe('Call pintrk("page") once in init, as Pinterest\'s base code does. Default true. Set false to leave the call out.').optional(),identify:s.z.unknown().describe('walkerOS mapping value resolving to enhanced matching fields: { em?: string, external_id?: string }. The Pinterest tag takes em plain (it hashes it with SHA-256 in the browser) or already hashed. Resolved on each event and sent with pintrk("set", data) when it changes; init calls pintrk("load", tagId) without it.').optional()}).strict(),u=require("@walkeros/core/dev"),l=u.z.object({identify:u.z.unknown().describe('Per-event identity override. Resolves to { em?, external_id? } and fires pintrk("set", data) when the resolved value differs from the current state.').optional()}),m=(0,c.zodToSchema)(p),v=(0,c.zodToSchema)(l),g={};r(g,{env:()=>h,minimal:()=>I,step:()=>f});var h={};r(h,{init:()=>_,push:()=>y,simulation:()=>w});var k=Object.assign(()=>{},{queue:[],version:"3.0"}),_={window:{pintrk:void 0}},y={window:{pintrk:k}},w=["call:window.pintrk"],f={};r(f,{consentGrant:()=>z,consentRevoke:()=>C,defaultForward:()=>E,identifyOnlySilent:()=>O,identifyOnlySilentWithoutData:()=>D,orderCompleteCheckout:()=>R,pageViewRename:()=>q,productAddToCart:()=>A,productViewContent:()=>j,silentRule:()=>T,siteSearch:()=>S,userLoginLead:()=>x,wildcardIgnored:()=>P});var b=require("@walkeros/core"),E={title:"Default forward",description:"Without a mapping the walker event name is forwarded as-is to pintrk track with an event_id for dedup.",in:(0,b.getEvent)("page view",{timestamp:1700000100,id:"ev-1700000100"}),mapping:void 0,out:[["pintrk","track","page view",{event_id:"ev-1700000100"}]]},P={public:!1,in:(0,b.createEvent)({name:"debug noise",timestamp:1700000101}),mapping:{ignore:!0},out:[]},q={title:"Page visit",description:"A mapping renames the walker event to the Pinterest standard pagevisit event for conversion tracking.",in:(0,b.getEvent)("page view",{timestamp:1700000102,id:"ev-1700000102"}),mapping:{name:"pagevisit"},out:[["pintrk","track","pagevisit",{event_id:"ev-1700000102"}]]},S={title:"Search",description:"A search submit fires Pinterest search with the search_query field resolved from event data.",in:(0,b.createEvent)({name:"search submit",timestamp:1700000103,id:"ev-1700000103",data:{term:"leather jacket"}}),mapping:{name:"search",data:{map:{search_query:"data.term"}}},out:[["pintrk","track","search",{search_query:"leather jacket",event_id:"ev-1700000103"}]]},j={title:"View content",description:"A product view fires Pinterest viewcontent with value, currency, and a single-item line_items array.",in:(0,b.getEvent)("product view",{timestamp:1700000104,id:"ev-1700000104"}),mapping:{name:"viewcontent",data:{map:{value:"data.price",currency:{key:"data.currency",value:"EUR"},line_items:{set:[{map:{product_id:"data.id",product_name:"data.name",product_price:"data.price"}}]}}}},out:[["pintrk","track","viewcontent",{value:420,currency:"EUR",line_items:[{product_id:"ers",product_name:"Everyday Ruck Snack",product_price:420}],event_id:"ev-1700000104"}]]},A={title:"Add to cart",description:"A product add fires Pinterest addtocart with value, currency, and a single-item line_items array.",in:(0,b.getEvent)("product add",{timestamp:1700000105,id:"ev-1700000105"}),mapping:{name:"addtocart",data:{map:{value:"data.price",order_quantity:{value:1},currency:{key:"data.currency",value:"EUR"},line_items:{set:[{map:{product_id:"data.id",product_name:"data.name",product_price:"data.price",product_quantity:{value:1}}}]}}}},out:[["pintrk","track","addtocart",{value:420,order_quantity:1,currency:"EUR",line_items:[{product_id:"ers",product_name:"Everyday Ruck Snack",product_price:420,product_quantity:1}],event_id:"ev-1700000105"}]]},R={title:"Checkout",description:"A completed order fires Pinterest checkout with value, order_id, currency, and a nested line_items array.",in:(0,b.getEvent)("order complete",{timestamp:1700000106,id:"ev-1700000106"}),mapping:{name:"checkout",data:{map:{value:"data.value",order_id:"data.id",currency:{key:"data.currency",value:"EUR"},line_items:{loop:["nested",{condition:e=>"object"==typeof e&&null!==e&&"data"in e&&"object"==typeof e.data&&null!==e.data&&"price"in e.data&&"number"==typeof e.data.price,map:{product_id:"data.id",product_name:"data.name",product_price:"data.price",product_quantity:{value:1}}}]}}}},out:[["pintrk","track","checkout",{value:462,order_id:"0rd3r1d",currency:"EUR",line_items:[{product_id:"ers",product_name:"Everyday Ruck Snack",product_price:420,product_quantity:1},{product_id:"cc",product_name:"Cool Cap",product_price:42,product_quantity:1}],event_id:"ev-1700000106"}]]},x={title:"Lead with matching",description:"A user login fires pintrk set for enhanced matching and then a lead conversion track call.",in:(0,b.createEvent)({name:"user login",timestamp:1700000107,id:"ev-1700000107",data:{id:"usr_123",email:"jane@example.com"}}),mapping:{name:"lead",settings:{identify:{map:{em:"data.email",external_id:"data.id"}}},data:{map:{lead_type:{value:"login"}}}},out:[["pintrk","set",{em:"jane@example.com",external_id:"usr_123"}],["pintrk","track","lead",{lead_type:"login",event_id:"ev-1700000107"}]]},O={title:"Identify only",description:"A user update fires pintrk set for enhanced matching without a track call via mapping silent.",in:(0,b.createEvent)({name:"user update",timestamp:1700000108,id:"ev-1700000108",data:{id:"usr_456",email:"new@example.com"}}),mapping:{silent:!0,settings:{identify:{map:{em:"data.email",external_id:"data.id"}}}},out:[["pintrk","set",{em:"new@example.com",external_id:"usr_456"}]]},C={public:!1,description:"For a destination with config.consent { marketing: true }, revoking marketing makes no vendor call: the destination stops sending track calls itself.",command:"consent",in:{marketing:!1},out:[]},z={public:!1,description:"A grant of the required consent lets the destination send track calls again; Pinterest has no consent call to make.",command:"consent",in:{marketing:!0},out:[]},T={public:!1,description:"A rule with silent: true sends no pintrk track call.",in:(0,b.createEvent)({name:"page view",timestamp:1700000109}),mapping:{silent:!0},out:[]},D={public:!1,description:"A silent rule whose identify mapping finds no email or id sends nothing: an unmet mapping, not a failure, so the push returns normally.",in:{name:"user update",entity:"user",action:"update"},mapping:O.mapping,out:[]},I={settings:{apiKey:"2612345678901"}};//# sourceMappingURL=dev.js.map
|
package/dist/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z\n .object({\n apiKey: z\n .string()\n .regex(/^\\d+$/, 'Must be a numeric Pinterest Tag ID')\n .min(6)\n .describe(\n 'Your Pinterest Tag ID (numeric string, e.g. \"2612345678901\"). Found in Pinterest Ads Manager under Conversions → Pinterest Tag. Passed to pintrk(\"load\", tagId).',\n ),\n pageview: z\n .boolean()\n .describe(\n 'Fire pintrk(\"page\") once in init after core.js loads. Default true (matches Pinterest\\'s base code convention). Set false when walkerOS sources already emit page view events and you would otherwise get a duplicate initial fire.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to enhanced matching fields: { em?: string, external_id?: string }. em is auto-hashed by the Pinterest JS tag — do not hash before passing. Passed to pintrk(\"load\", tagId, data) on init and pintrk(\"set\", data) when the resolved value changes.',\n )\n .optional(),\n })\n .strict();\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identity override. Resolves to { em?, external_id? } and fires pintrk(\"set\", data) when the resolved value differs from the current state.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, Pintrk } from '../types';\n\n/**\n * Example environment configurations for the Pinterest destination.\n *\n * These mock window.pintrk, allowing tests to run in a pure\n * Node environment without jsdom and without touching the real Pinterest\n * CDN. Tests replace env.window.pintrk with a jest.fn() spy.\n */\n\nconst noop = () => {};\n\nconst noopPintrk: Pintrk = Object.assign(noop, {\n queue: [],\n version: '3.0',\n});\n\n/**\n * Pre-init environment: pintrk is not yet on the window.\n * Used to validate the init path that creates the queue function.\n */\nexport const init: Env = {\n window: {\n pintrk: undefined,\n },\n};\n\n/**\n * Post-init environment: pintrk is available as a spy-able function.\n * Tests clone this and replace `pintrk` with a jest.fn() to record calls.\n */\nexport const push: Env = {\n window: {\n pintrk: noopPintrk,\n },\n};\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = ['call:window.pintrk'];\n","import type { Flow } from '@walkeros/core';\nimport { createEvent, getEvent, isObject } from '@walkeros/core';\n\n/**\n * Output convention:\n * - Single SDK call: out = [['pintrk', 'track', 'checkout', { ... }]]\n * - Multiple SDK calls: out = [['pintrk', ...], ['pintrk', ...]]\n * - Zero SDK calls: out = []\n */\n\n/**\n * Default event forwarding - no rule. Without a mapping.name, the walkerOS\n * event name is forwarded as-is. Pinterest accepts it but won't match a\n * standard conversion event. event_id is auto-attached for deduplication.\n */\nexport const defaultForward: Flow.StepExample = {\n title: 'Default forward',\n description:\n 'Without a mapping the walker event name is forwarded as-is to pintrk track with an event_id for dedup.',\n in: getEvent('page view', { timestamp: 1700000100, id: 'ev-1700000100' }),\n mapping: undefined,\n out: [['pintrk', 'track', 'page view', { event_id: 'ev-1700000100' }]],\n};\n\n/**\n * Wildcard ignore pattern - the standard walkerOS way to suppress noisy\n * events. `mapping.ignore: true` at rule level produces zero SDK calls.\n */\nexport const wildcardIgnored: Flow.StepExample = {\n public: false,\n in: createEvent({ name: 'debug noise', timestamp: 1700000101 }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * Standard Pinterest event rename via mapping.name. walkerOS \"page view\"\n * → Pinterest \"pagevisit\". The ONLY way to get Pinterest to recognize\n * a conversion event - the destination never auto-maps.\n */\nexport const pageViewRename: Flow.StepExample = {\n title: 'Page visit',\n description:\n 'A mapping renames the walker event to the Pinterest standard pagevisit event for conversion tracking.',\n in: getEvent('page view', { timestamp: 1700000102, id: 'ev-1700000102' }),\n mapping: { name: 'pagevisit' },\n out: [['pintrk', 'track', 'pagevisit', { event_id: 'ev-1700000102' }]],\n};\n\n/**\n * Search - walkerOS site search → Pinterest \"search\" with search_query.\n * Illustrates single-field mapping.data resolution.\n */\nexport const siteSearch: Flow.StepExample = {\n title: 'Search',\n description:\n 'A site search fires Pinterest search with the search_query field resolved from event data.',\n in: createEvent({\n name: 'site search',\n timestamp: 1700000103,\n id: 'ev-1700000103',\n data: { query: 'leather jacket' },\n }),\n mapping: {\n name: 'search',\n data: {\n map: {\n search_query: 'data.query',\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'search',\n {\n search_query: 'leather jacket',\n event_id: 'ev-1700000103',\n },\n ],\n ],\n};\n\n/**\n * Single-product viewcontent.\n */\nexport const productViewContent: Flow.StepExample = {\n title: 'View content',\n description:\n 'A product view fires Pinterest viewcontent with value, currency, product_id, and product_name.',\n in: getEvent('product view', {\n timestamp: 1700000104,\n id: 'ev-1700000104',\n }),\n mapping: {\n name: 'viewcontent',\n data: {\n map: {\n value: 'data.price',\n currency: { key: 'data.currency', value: 'EUR' },\n product_id: 'data.id',\n product_name: 'data.color',\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'viewcontent',\n {\n value: 420,\n currency: 'EUR',\n product_id: 'ers',\n product_name: 'black',\n event_id: 'ev-1700000104',\n },\n ],\n ],\n};\n\n/**\n * Add-to-cart with an inline line_items array.\n */\nexport const productAddToCart: Flow.StepExample = {\n title: 'Add to cart',\n description:\n 'A product add fires Pinterest addtocart with value, currency, and a single-item line_items array.',\n in: getEvent('product add', {\n timestamp: 1700000105,\n id: 'ev-1700000105',\n }),\n mapping: {\n name: 'addtocart',\n data: {\n map: {\n value: 'data.price',\n order_quantity: { value: 1 },\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n set: [\n {\n map: {\n product_id: 'data.id',\n product_name: 'data.color',\n product_price: 'data.price',\n product_quantity: { value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'addtocart',\n {\n value: 420,\n order_quantity: 1,\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'black',\n product_price: 420,\n product_quantity: 1,\n },\n ],\n event_id: 'ev-1700000105',\n },\n ],\n ],\n};\n\n/**\n * Multi-product checkout - the canonical Pinterest ecommerce pattern.\n */\nexport const orderCompleteCheckout: Flow.StepExample = {\n title: 'Checkout',\n description:\n 'A completed order fires Pinterest checkout with value, order_id, currency, and a nested line_items array.',\n in: getEvent('order complete', {\n timestamp: 1700000106,\n id: 'ev-1700000106',\n }),\n mapping: {\n name: 'checkout',\n data: {\n map: {\n value: 'data.value',\n order_id: 'data.id',\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n loop: [\n 'nested',\n {\n condition: (value: unknown) =>\n isObject(value) &&\n isObject(value.data) &&\n typeof value.data.price === 'number',\n map: {\n product_id: 'data.id',\n product_name: 'data.color',\n product_price: 'data.price',\n product_quantity: { value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'checkout',\n {\n value: 555,\n order_id: '0rd3r1d',\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'black',\n product_price: 420,\n product_quantity: 1,\n },\n {\n product_id: 'cc',\n product_price: 42,\n product_quantity: 1,\n },\n ],\n event_id: 'ev-1700000106',\n },\n ],\n ],\n};\n\n/**\n * Lead conversion with per-event enhanced matching update.\n */\nexport const userLoginLead: Flow.StepExample = {\n title: 'Lead with matching',\n description:\n 'A user login fires pintrk set for enhanced matching and then a lead conversion track call.',\n in: createEvent({\n name: 'user login',\n timestamp: 1700000107,\n id: 'ev-1700000107',\n data: {\n id: 'usr_123',\n email: 'jane@example.com',\n },\n }),\n mapping: {\n name: 'lead',\n settings: {\n identify: {\n map: {\n em: 'data.email',\n external_id: 'data.id',\n },\n },\n },\n data: {\n map: {\n lead_type: { value: 'login' },\n },\n },\n },\n out: [\n ['pintrk', 'set', { em: 'jane@example.com', external_id: 'usr_123' }],\n [\n 'pintrk',\n 'track',\n 'lead',\n {\n lead_type: 'login',\n event_id: 'ev-1700000107',\n },\n ],\n ],\n};\n\n/**\n * mapping.silent - processes side effects (identify set) but suppresses\n * the default pintrk('track', ...) call.\n */\nexport const identifyOnlySilent: Flow.StepExample = {\n title: 'Identify only',\n description:\n 'A user update fires pintrk set for enhanced matching without a track call via mapping silent.',\n in: createEvent({\n name: 'user update',\n timestamp: 1700000108,\n id: 'ev-1700000108',\n data: {\n id: 'usr_456',\n email: 'new@example.com',\n },\n }),\n mapping: {\n silent: true,\n settings: {\n identify: {\n map: {\n em: 'data.email',\n external_id: 'data.id',\n },\n },\n },\n },\n out: [['pintrk', 'set', { em: 'new@example.com', external_id: 'usr_456' }]],\n};\n\n/**\n * Consent revocation - walkerOS walker consent { marketing: false }.\n * The destination's on('consent') handler flips the runtime state flag\n * and stops calling pintrk('track', ...) for subsequent events.\n */\nexport const consentRevoke: Flow.StepExample = {\n public: false,\n description:\n 'For a destination with config.consent { marketing: true }, revoking marketing makes no vendor call: the destination stops sending track calls itself.',\n command: 'consent',\n in: { marketing: false },\n out: [],\n};\n\n/**\n * Consent grant - explicit opt-in.\n */\nexport const consentGrant: Flow.StepExample = {\n public: false,\n description:\n 'A grant of the required consent lets the destination send track calls again; Pinterest has no consent call to make.',\n command: 'consent',\n in: { marketing: true },\n out: [],\n};\n\n/** A silent rule sends no track call and no identity. */\nexport const silentRule: Flow.StepExample = {\n public: false,\n description: 'A rule with silent: true sends no pintrk track call.',\n in: createEvent({ name: 'page view', timestamp: 1700000109 }),\n mapping: { silent: true },\n out: [],\n};\n\n/**\n * The silent identify rule of identifyOnlySilent on an update without data:\n * no identity resolves and the rule suppresses the track, so nothing is\n * sent. A declared skip: an unmet mapping, not a failure.\n */\nexport const identifyOnlySilentWithoutData: Flow.StepExample = {\n public: false,\n description:\n 'A silent rule whose identify mapping finds no email or id sends nothing: an unmet mapping, not a failure, so the push returns normally.',\n in: { name: 'user update', entity: 'user', action: 'update' },\n mapping: identifyOnlySilent.mapping,\n out: [],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAC3B,OAAO;AAAA,EACN,QAAQ,aACL,OAAO,EACP,MAAM,SAAS,oCAAoC,EACnD,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,UAAU,aACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,aACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC,EACA,OAAO;;;ACxBV,IAAAC,cAAkB;AAEX,IAAM,gB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;AAAA,IACX,IAAI;AAAA,IACJ,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,IACT;AAAA,EACF,CAAC;AAAA,EACD,SAAS;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,MACR,UAAU;AAAA,QACR,KAAK;AAAA,UACH,IAAI;AAAA,UACJ,aAAa;AAAA,QACf;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK,CAAC,CAAC,UAAU,OAAO,EAAE,IAAI,mBAAmB,aAAa,UAAU,CAAC,CAAC;AAC5E;AAOO,IAAM,gBAAkC;AAAA,EAC7C,QAAQ;AAAA,EACR,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,MAAM;AAAA,EACvB,KAAK,CAAC;AACR;AAKO,IAAM,eAAiC;AAAA,EAC5C,QAAQ;AAAA,EACR,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,KAAK;AAAA,EACtB,KAAK,CAAC;AACR;AAGO,IAAM,aAA+B;AAAA,EAC1C,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,QAAI,yBAAY,EAAE,MAAM,aAAa,WAAW,WAAW,CAAC;AAAA,EAC5D,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;AAOO,IAAM,gCAAkD;AAAA,EAC7D,QAAQ;AAAA,EACR,aACE;AAAA,EACF,IAAI,EAAE,MAAM,eAAe,QAAQ,QAAQ,QAAQ,SAAS;AAAA,EAC5D,SAAS,mBAAmB;AAAA,EAC5B,KAAK,CAAC;AACR;","names":["import_dev","import_dev"]}
|
|
1
|
+
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts","../src/examples/minimal.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z\n .object({\n apiKey: z\n .string()\n .regex(/^\\d+$/, 'Must be a numeric Pinterest Tag ID')\n .min(6)\n .describe(\n 'Your Pinterest Tag ID (numeric string, e.g. \"2612345678901\"). Found in Pinterest Ads Manager under Conversions → Pinterest Tag. Passed to pintrk(\"load\", tagId).',\n ),\n pageview: z\n .boolean()\n .describe(\n 'Call pintrk(\"page\") once in init, as Pinterest\\'s base code does. Default true. Set false to leave the call out.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to enhanced matching fields: { em?: string, external_id?: string }. The Pinterest tag takes em plain (it hashes it with SHA-256 in the browser) or already hashed. Resolved on each event and sent with pintrk(\"set\", data) when it changes; init calls pintrk(\"load\", tagId) without it.',\n )\n .optional(),\n })\n .strict();\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identity override. Resolves to { em?, external_id? } and fires pintrk(\"set\", data) when the resolved value differs from the current state.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\nexport { minimal } from './minimal';\n","import type { Env, Pintrk } from '../types';\n\n/**\n * Example environment configurations for the Pinterest destination.\n *\n * These mock window.pintrk, allowing tests to run in a pure\n * Node environment without jsdom and without touching the real Pinterest\n * CDN. Tests replace env.window.pintrk with a jest.fn() spy.\n */\n\nconst noop = () => {};\n\nconst noopPintrk: Pintrk = Object.assign(noop, {\n queue: [],\n version: '3.0',\n});\n\n/**\n * Pre-init environment: pintrk is not yet on the window.\n * Used to validate the init path that creates the queue function.\n */\nexport const init: Env = {\n window: {\n pintrk: undefined,\n },\n};\n\n/**\n * Post-init environment: pintrk is available as a spy-able function.\n * Tests clone this and replace `pintrk` with a jest.fn() to record calls.\n */\nexport const push: Env = {\n window: {\n pintrk: noopPintrk,\n },\n};\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = ['call:window.pintrk'];\n","import type { Flow } from '@walkeros/core';\nimport { createEvent, getEvent } from '@walkeros/core';\n\n/**\n * Output convention:\n * - Single SDK call: out = [['pintrk', 'track', 'checkout', { ... }]]\n * - Multiple SDK calls: out = [['pintrk', ...], ['pintrk', ...]]\n * - Zero SDK calls: out = []\n */\n\n/**\n * Default event forwarding - no rule. Without a mapping.name, the walkerOS\n * event name is forwarded as-is. Pinterest accepts it but won't match a\n * standard conversion event. event_id is auto-attached for deduplication.\n */\nexport const defaultForward: Flow.StepExample = {\n title: 'Default forward',\n description:\n 'Without a mapping the walker event name is forwarded as-is to pintrk track with an event_id for dedup.',\n in: getEvent('page view', { timestamp: 1700000100, id: 'ev-1700000100' }),\n mapping: undefined,\n out: [['pintrk', 'track', 'page view', { event_id: 'ev-1700000100' }]],\n};\n\n/**\n * Wildcard ignore pattern - the standard walkerOS way to suppress noisy\n * events. `mapping.ignore: true` at rule level produces zero SDK calls.\n */\nexport const wildcardIgnored: Flow.StepExample = {\n public: false,\n in: createEvent({ name: 'debug noise', timestamp: 1700000101 }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * Standard Pinterest event rename via mapping.name. walkerOS \"page view\"\n * → Pinterest \"pagevisit\". The ONLY way to get Pinterest to recognize\n * a conversion event - the destination never auto-maps.\n */\nexport const pageViewRename: Flow.StepExample = {\n title: 'Page visit',\n description:\n 'A mapping renames the walker event to the Pinterest standard pagevisit event for conversion tracking.',\n in: getEvent('page view', { timestamp: 1700000102, id: 'ev-1700000102' }),\n mapping: { name: 'pagevisit' },\n out: [['pintrk', 'track', 'pagevisit', { event_id: 'ev-1700000102' }]],\n};\n\n/**\n * Search - walkerOS search submit → Pinterest \"search\" with search_query.\n * Illustrates single-field mapping.data resolution.\n */\nexport const siteSearch: Flow.StepExample = {\n title: 'Search',\n description:\n 'A search submit fires Pinterest search with the search_query field resolved from event data.',\n in: createEvent({\n name: 'search submit',\n timestamp: 1700000103,\n id: 'ev-1700000103',\n data: { term: 'leather jacket' },\n }),\n mapping: {\n name: 'search',\n data: {\n map: {\n search_query: 'data.term',\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'search',\n {\n search_query: 'leather jacket',\n event_id: 'ev-1700000103',\n },\n ],\n ],\n};\n\n/**\n * Single-product viewcontent.\n */\nexport const productViewContent: Flow.StepExample = {\n title: 'View content',\n description:\n 'A product view fires Pinterest viewcontent with value, currency, and a single-item line_items array.',\n in: getEvent('product view', {\n timestamp: 1700000104,\n id: 'ev-1700000104',\n }),\n mapping: {\n name: 'viewcontent',\n data: {\n map: {\n value: 'data.price',\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n set: [\n {\n map: {\n product_id: 'data.id',\n product_name: 'data.name',\n product_price: 'data.price',\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'viewcontent',\n {\n value: 420,\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'Everyday Ruck Snack',\n product_price: 420,\n },\n ],\n event_id: 'ev-1700000104',\n },\n ],\n ],\n};\n\n/**\n * Add-to-cart with an inline line_items array.\n */\nexport const productAddToCart: Flow.StepExample = {\n title: 'Add to cart',\n description:\n 'A product add fires Pinterest addtocart with value, currency, and a single-item line_items array.',\n in: getEvent('product add', {\n timestamp: 1700000105,\n id: 'ev-1700000105',\n }),\n mapping: {\n name: 'addtocart',\n data: {\n map: {\n value: 'data.price',\n order_quantity: { value: 1 },\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n set: [\n {\n map: {\n product_id: 'data.id',\n product_name: 'data.name',\n product_price: 'data.price',\n product_quantity: { value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'addtocart',\n {\n value: 420,\n order_quantity: 1,\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'Everyday Ruck Snack',\n product_price: 420,\n product_quantity: 1,\n },\n ],\n event_id: 'ev-1700000105',\n },\n ],\n ],\n};\n\n/**\n * Multi-product checkout - the canonical Pinterest ecommerce pattern.\n */\nexport const orderCompleteCheckout: Flow.StepExample = {\n title: 'Checkout',\n description:\n 'A completed order fires Pinterest checkout with value, order_id, currency, and a nested line_items array.',\n in: getEvent('order complete', {\n timestamp: 1700000106,\n id: 'ev-1700000106',\n }),\n mapping: {\n name: 'checkout',\n data: {\n map: {\n value: 'data.value',\n order_id: 'data.id',\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n loop: [\n 'nested',\n {\n condition: (value: unknown) =>\n typeof value === 'object' &&\n value !== null &&\n 'data' in value &&\n typeof value.data === 'object' &&\n value.data !== null &&\n 'price' in value.data &&\n typeof value.data.price === 'number',\n map: {\n product_id: 'data.id',\n product_name: 'data.name',\n product_price: 'data.price',\n product_quantity: { value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'checkout',\n {\n value: 462,\n order_id: '0rd3r1d',\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'Everyday Ruck Snack',\n product_price: 420,\n product_quantity: 1,\n },\n {\n product_id: 'cc',\n product_name: 'Cool Cap',\n product_price: 42,\n product_quantity: 1,\n },\n ],\n event_id: 'ev-1700000106',\n },\n ],\n ],\n};\n\n/**\n * Lead conversion with per-event enhanced matching update.\n */\nexport const userLoginLead: Flow.StepExample = {\n title: 'Lead with matching',\n description:\n 'A user login fires pintrk set for enhanced matching and then a lead conversion track call.',\n in: createEvent({\n name: 'user login',\n timestamp: 1700000107,\n id: 'ev-1700000107',\n data: {\n id: 'usr_123',\n email: 'jane@example.com',\n },\n }),\n mapping: {\n name: 'lead',\n settings: {\n identify: {\n map: {\n em: 'data.email',\n external_id: 'data.id',\n },\n },\n },\n data: {\n map: {\n lead_type: { value: 'login' },\n },\n },\n },\n out: [\n ['pintrk', 'set', { em: 'jane@example.com', external_id: 'usr_123' }],\n [\n 'pintrk',\n 'track',\n 'lead',\n {\n lead_type: 'login',\n event_id: 'ev-1700000107',\n },\n ],\n ],\n};\n\n/**\n * mapping.silent - processes side effects (identify set) but suppresses\n * the default pintrk('track', ...) call.\n */\nexport const identifyOnlySilent: Flow.StepExample = {\n title: 'Identify only',\n description:\n 'A user update fires pintrk set for enhanced matching without a track call via mapping silent.',\n in: createEvent({\n name: 'user update',\n timestamp: 1700000108,\n id: 'ev-1700000108',\n data: {\n id: 'usr_456',\n email: 'new@example.com',\n },\n }),\n mapping: {\n silent: true,\n settings: {\n identify: {\n map: {\n em: 'data.email',\n external_id: 'data.id',\n },\n },\n },\n },\n out: [['pintrk', 'set', { em: 'new@example.com', external_id: 'usr_456' }]],\n};\n\n/**\n * Consent revocation - walkerOS walker consent { marketing: false }.\n * The destination's on('consent') handler flips the runtime state flag\n * and stops calling pintrk('track', ...) for subsequent events.\n */\nexport const consentRevoke: Flow.StepExample = {\n public: false,\n description:\n 'For a destination with config.consent { marketing: true }, revoking marketing makes no vendor call: the destination stops sending track calls itself.',\n command: 'consent',\n in: { marketing: false },\n out: [],\n};\n\n/**\n * Consent grant - explicit opt-in.\n */\nexport const consentGrant: Flow.StepExample = {\n public: false,\n description:\n 'A grant of the required consent lets the destination send track calls again; Pinterest has no consent call to make.',\n command: 'consent',\n in: { marketing: true },\n out: [],\n};\n\n/** A silent rule sends no track call and no identity. */\nexport const silentRule: Flow.StepExample = {\n public: false,\n description: 'A rule with silent: true sends no pintrk track call.',\n in: createEvent({ name: 'page view', timestamp: 1700000109 }),\n mapping: { silent: true },\n out: [],\n};\n\n/**\n * The silent identify rule of identifyOnlySilent on an update without data:\n * no identity resolves and the rule suppresses the track, so nothing is\n * sent. A declared skip: an unmet mapping, not a failure.\n */\nexport const identifyOnlySilentWithoutData: Flow.StepExample = {\n public: false,\n description:\n 'A silent rule whose identify mapping finds no email or id sends nothing: an unmet mapping, not a failure, so the push returns normally.',\n in: { name: 'user update', entity: 'user', action: 'update' },\n mapping: identifyOnlySilent.mapping,\n out: [],\n};\n","import type { Flow } from '@walkeros/core';\n\n/** The settings the Pinterest Tag needs to deliver: the Tag ID. */\nexport const minimal: Flow.MinimalExample = {\n settings: { apiKey: '2612345678901' },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAC3B,OAAO;AAAA,EACN,QAAQ,aACL,OAAO,EACP,MAAM,SAAS,oCAAoC,EACnD,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,UAAU,aACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,aACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC,EACA,OAAO;;;ACxBV,IAAAC,cAAkB;AAEX,IAAM,gBAAgB,cAAE,OAAO;AAAA,EACpC,UAAU,cACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AFDM,IAAM,eAAW,yBAAY,cAAc;AAC3C,IAAM,cAAU,yBAAY,aAAa;;;AGThD;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,IAAM,OAAO,MAAM;AAAC;AAEpB,IAAM,aAAqB,OAAO,OAAO,MAAM;AAAA,EAC7C,OAAO,CAAC;AAAA,EACR,SAAS;AACX,CAAC;AAMM,IAAM,OAAY;AAAA,EACvB,QAAQ;AAAA,IACN,QAAQ;AAAA,EACV;AACF;AAMO,IAAM,OAAY;AAAA,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;AAAA,UACH,IAAI;AAAA,UACJ,aAAa;AAAA,QACf;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK,CAAC,CAAC,UAAU,OAAO,EAAE,IAAI,mBAAmB,aAAa,UAAU,CAAC,CAAC;AAC5E;AAOO,IAAM,gBAAkC;AAAA,EAC7C,QAAQ;AAAA,EACR,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,MAAM;AAAA,EACvB,KAAK,CAAC;AACR;AAKO,IAAM,eAAiC;AAAA,EAC5C,QAAQ;AAAA,EACR,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,KAAK;AAAA,EACtB,KAAK,CAAC;AACR;AAGO,IAAM,aAA+B;AAAA,EAC1C,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,QAAI,yBAAY,EAAE,MAAM,aAAa,WAAW,WAAW,CAAC;AAAA,EAC5D,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;AAOO,IAAM,gCAAkD;AAAA,EAC7D,QAAQ;AAAA,EACR,aACE;AAAA,EACF,IAAI,EAAE,MAAM,eAAe,QAAQ,QAAQ,QAAQ,SAAS;AAAA,EAC5D,SAAS,mBAAmB;AAAA,EAC5B,KAAK,CAAC;AACR;;;AChYO,IAAM,UAA+B;AAAA,EAC1C,UAAU,EAAE,QAAQ,gBAAgB;AACtC;","names":["import_dev","import_dev"]}
|
package/dist/dev.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(t,a)=>{for(var i in a)e(t,i,{get:a[i],enumerable:!0})},a={};t(a,{MappingSchema:()=>o,SettingsSchema:()=>r,mapping:()=>s,settings:()=>c});import{zodToSchema as i}from"@walkeros/core/dev";import{z as n}from"@walkeros/core/dev";var r=n.object({apiKey:n.string().regex(/^\d+$/,"Must be a numeric Pinterest Tag ID").min(6).describe('Your Pinterest Tag ID (numeric string, e.g. "2612345678901"). Found in Pinterest Ads Manager under Conversions → Pinterest Tag. Passed to pintrk("load", tagId).'),pageview:n.boolean().describe('
|
|
1
|
+
var e=Object.defineProperty,t=(t,a)=>{for(var i in a)e(t,i,{get:a[i],enumerable:!0})},a={};t(a,{MappingSchema:()=>o,SettingsSchema:()=>r,mapping:()=>s,settings:()=>c});import{zodToSchema as i}from"@walkeros/core/dev";import{z as n}from"@walkeros/core/dev";var r=n.object({apiKey:n.string().regex(/^\d+$/,"Must be a numeric Pinterest Tag ID").min(6).describe('Your Pinterest Tag ID (numeric string, e.g. "2612345678901"). Found in Pinterest Ads Manager under Conversions → Pinterest Tag. Passed to pintrk("load", tagId).'),pageview:n.boolean().describe('Call pintrk("page") once in init, as Pinterest\'s base code does. Default true. Set false to leave the call out.').optional(),identify:n.unknown().describe('walkerOS mapping value resolving to enhanced matching fields: { em?: string, external_id?: string }. The Pinterest tag takes em plain (it hashes it with SHA-256 in the browser) or already hashed. Resolved on each event and sent with pintrk("set", data) when it changes; init calls pintrk("load", tagId) without it.').optional()}).strict();import{z as d}from"@walkeros/core/dev";var o=d.object({identify:d.unknown().describe('Per-event identity override. Resolves to { em?, external_id? } and fires pintrk("set", data) when the resolved value differs from the current state.').optional()}),c=i(r),s=i(o),p={};t(p,{env:()=>u,minimal:()=>I,step:()=>k});var u={};t(u,{init:()=>m,push:()=>v,simulation:()=>g});var l=Object.assign(()=>{},{queue:[],version:"3.0"}),m={window:{pintrk:void 0}},v={window:{pintrk:l}},g=["call:window.pintrk"],k={};t(k,{consentGrant:()=>j,consentRevoke:()=>q,defaultForward:()=>y,identifyOnlySilent:()=>S,identifyOnlySilentWithoutData:()=>E,orderCompleteCheckout:()=>R,pageViewRename:()=>f,productAddToCart:()=>A,productViewContent:()=>P,silentRule:()=>C,siteSearch:()=>b,userLoginLead:()=>x,wildcardIgnored:()=>w});import{createEvent as h,getEvent as _}from"@walkeros/core";var y={title:"Default forward",description:"Without a mapping the walker event name is forwarded as-is to pintrk track with an event_id for dedup.",in:_("page view",{timestamp:1700000100,id:"ev-1700000100"}),mapping:void 0,out:[["pintrk","track","page view",{event_id:"ev-1700000100"}]]},w={public:!1,in:h({name:"debug noise",timestamp:1700000101}),mapping:{ignore:!0},out:[]},f={title:"Page visit",description:"A mapping renames the walker event to the Pinterest standard pagevisit event for conversion tracking.",in:_("page view",{timestamp:1700000102,id:"ev-1700000102"}),mapping:{name:"pagevisit"},out:[["pintrk","track","pagevisit",{event_id:"ev-1700000102"}]]},b={title:"Search",description:"A search submit fires Pinterest search with the search_query field resolved from event data.",in:h({name:"search submit",timestamp:1700000103,id:"ev-1700000103",data:{term:"leather jacket"}}),mapping:{name:"search",data:{map:{search_query:"data.term"}}},out:[["pintrk","track","search",{search_query:"leather jacket",event_id:"ev-1700000103"}]]},P={title:"View content",description:"A product view fires Pinterest viewcontent with value, currency, and a single-item line_items array.",in:_("product view",{timestamp:1700000104,id:"ev-1700000104"}),mapping:{name:"viewcontent",data:{map:{value:"data.price",currency:{key:"data.currency",value:"EUR"},line_items:{set:[{map:{product_id:"data.id",product_name:"data.name",product_price:"data.price"}}]}}}},out:[["pintrk","track","viewcontent",{value:420,currency:"EUR",line_items:[{product_id:"ers",product_name:"Everyday Ruck Snack",product_price:420}],event_id:"ev-1700000104"}]]},A={title:"Add to cart",description:"A product add fires Pinterest addtocart with value, currency, and a single-item line_items array.",in:_("product add",{timestamp:1700000105,id:"ev-1700000105"}),mapping:{name:"addtocart",data:{map:{value:"data.price",order_quantity:{value:1},currency:{key:"data.currency",value:"EUR"},line_items:{set:[{map:{product_id:"data.id",product_name:"data.name",product_price:"data.price",product_quantity:{value:1}}}]}}}},out:[["pintrk","track","addtocart",{value:420,order_quantity:1,currency:"EUR",line_items:[{product_id:"ers",product_name:"Everyday Ruck Snack",product_price:420,product_quantity:1}],event_id:"ev-1700000105"}]]},R={title:"Checkout",description:"A completed order fires Pinterest checkout with value, order_id, currency, and a nested line_items array.",in:_("order complete",{timestamp:1700000106,id:"ev-1700000106"}),mapping:{name:"checkout",data:{map:{value:"data.value",order_id:"data.id",currency:{key:"data.currency",value:"EUR"},line_items:{loop:["nested",{condition:e=>"object"==typeof e&&null!==e&&"data"in e&&"object"==typeof e.data&&null!==e.data&&"price"in e.data&&"number"==typeof e.data.price,map:{product_id:"data.id",product_name:"data.name",product_price:"data.price",product_quantity:{value:1}}}]}}}},out:[["pintrk","track","checkout",{value:462,order_id:"0rd3r1d",currency:"EUR",line_items:[{product_id:"ers",product_name:"Everyday Ruck Snack",product_price:420,product_quantity:1},{product_id:"cc",product_name:"Cool Cap",product_price:42,product_quantity:1}],event_id:"ev-1700000106"}]]},x={title:"Lead with matching",description:"A user login fires pintrk set for enhanced matching and then a lead conversion track call.",in:h({name:"user login",timestamp:1700000107,id:"ev-1700000107",data:{id:"usr_123",email:"jane@example.com"}}),mapping:{name:"lead",settings:{identify:{map:{em:"data.email",external_id:"data.id"}}},data:{map:{lead_type:{value:"login"}}}},out:[["pintrk","set",{em:"jane@example.com",external_id:"usr_123"}],["pintrk","track","lead",{lead_type:"login",event_id:"ev-1700000107"}]]},S={title:"Identify only",description:"A user update fires pintrk set for enhanced matching without a track call via mapping silent.",in:h({name:"user update",timestamp:1700000108,id:"ev-1700000108",data:{id:"usr_456",email:"new@example.com"}}),mapping:{silent:!0,settings:{identify:{map:{em:"data.email",external_id:"data.id"}}}},out:[["pintrk","set",{em:"new@example.com",external_id:"usr_456"}]]},q={public:!1,description:"For a destination with config.consent { marketing: true }, revoking marketing makes no vendor call: the destination stops sending track calls itself.",command:"consent",in:{marketing:!1},out:[]},j={public:!1,description:"A grant of the required consent lets the destination send track calls again; Pinterest has no consent call to make.",command:"consent",in:{marketing:!0},out:[]},C={public:!1,description:"A rule with silent: true sends no pintrk track call.",in:h({name:"page view",timestamp:1700000109}),mapping:{silent:!0},out:[]},E={public:!1,description:"A silent rule whose identify mapping finds no email or id sends nothing: an unmet mapping, not a failure, so the push returns normally.",in:{name:"user update",entity:"user",action:"update"},mapping:S.mapping,out:[]},I={settings:{apiKey:"2612345678901"}};export{p as examples,a as schemas};//# sourceMappingURL=dev.mjs.map
|
package/dist/dev.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z\n .object({\n apiKey: z\n .string()\n .regex(/^\\d+$/, 'Must be a numeric Pinterest Tag ID')\n .min(6)\n .describe(\n 'Your Pinterest Tag ID (numeric string, e.g. \"2612345678901\"). Found in Pinterest Ads Manager under Conversions → Pinterest Tag. Passed to pintrk(\"load\", tagId).',\n ),\n pageview: z\n .boolean()\n .describe(\n 'Fire pintrk(\"page\") once in init after core.js loads. Default true (matches Pinterest\\'s base code convention). Set false when walkerOS sources already emit page view events and you would otherwise get a duplicate initial fire.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to enhanced matching fields: { em?: string, external_id?: string }. em is auto-hashed by the Pinterest JS tag — do not hash before passing. Passed to pintrk(\"load\", tagId, data) on init and pintrk(\"set\", data) when the resolved value changes.',\n )\n .optional(),\n })\n .strict();\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identity override. Resolves to { em?, external_id? } and fires pintrk(\"set\", data) when the resolved value differs from the current state.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, Pintrk } from '../types';\n\n/**\n * Example environment configurations for the Pinterest destination.\n *\n * These mock window.pintrk, allowing tests to run in a pure\n * Node environment without jsdom and without touching the real Pinterest\n * CDN. Tests replace env.window.pintrk with a jest.fn() spy.\n */\n\nconst noop = () => {};\n\nconst noopPintrk: Pintrk = Object.assign(noop, {\n queue: [],\n version: '3.0',\n});\n\n/**\n * Pre-init environment: pintrk is not yet on the window.\n * Used to validate the init path that creates the queue function.\n */\nexport const init: Env = {\n window: {\n pintrk: undefined,\n },\n};\n\n/**\n * Post-init environment: pintrk is available as a spy-able function.\n * Tests clone this and replace `pintrk` with a jest.fn() to record calls.\n */\nexport const push: Env = {\n window: {\n pintrk: noopPintrk,\n },\n};\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = ['call:window.pintrk'];\n","import type { Flow } from '@walkeros/core';\nimport { createEvent, getEvent, isObject } from '@walkeros/core';\n\n/**\n * Output convention:\n * - Single SDK call: out = [['pintrk', 'track', 'checkout', { ... }]]\n * - Multiple SDK calls: out = [['pintrk', ...], ['pintrk', ...]]\n * - Zero SDK calls: out = []\n */\n\n/**\n * Default event forwarding - no rule. Without a mapping.name, the walkerOS\n * event name is forwarded as-is. Pinterest accepts it but won't match a\n * standard conversion event. event_id is auto-attached for deduplication.\n */\nexport const defaultForward: Flow.StepExample = {\n title: 'Default forward',\n description:\n 'Without a mapping the walker event name is forwarded as-is to pintrk track with an event_id for dedup.',\n in: getEvent('page view', { timestamp: 1700000100, id: 'ev-1700000100' }),\n mapping: undefined,\n out: [['pintrk', 'track', 'page view', { event_id: 'ev-1700000100' }]],\n};\n\n/**\n * Wildcard ignore pattern - the standard walkerOS way to suppress noisy\n * events. `mapping.ignore: true` at rule level produces zero SDK calls.\n */\nexport const wildcardIgnored: Flow.StepExample = {\n public: false,\n in: createEvent({ name: 'debug noise', timestamp: 1700000101 }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * Standard Pinterest event rename via mapping.name. walkerOS \"page view\"\n * → Pinterest \"pagevisit\". The ONLY way to get Pinterest to recognize\n * a conversion event - the destination never auto-maps.\n */\nexport const pageViewRename: Flow.StepExample = {\n title: 'Page visit',\n description:\n 'A mapping renames the walker event to the Pinterest standard pagevisit event for conversion tracking.',\n in: getEvent('page view', { timestamp: 1700000102, id: 'ev-1700000102' }),\n mapping: { name: 'pagevisit' },\n out: [['pintrk', 'track', 'pagevisit', { event_id: 'ev-1700000102' }]],\n};\n\n/**\n * Search - walkerOS site search → Pinterest \"search\" with search_query.\n * Illustrates single-field mapping.data resolution.\n */\nexport const siteSearch: Flow.StepExample = {\n title: 'Search',\n description:\n 'A site search fires Pinterest search with the search_query field resolved from event data.',\n in: createEvent({\n name: 'site search',\n timestamp: 1700000103,\n id: 'ev-1700000103',\n data: { query: 'leather jacket' },\n }),\n mapping: {\n name: 'search',\n data: {\n map: {\n search_query: 'data.query',\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'search',\n {\n search_query: 'leather jacket',\n event_id: 'ev-1700000103',\n },\n ],\n ],\n};\n\n/**\n * Single-product viewcontent.\n */\nexport const productViewContent: Flow.StepExample = {\n title: 'View content',\n description:\n 'A product view fires Pinterest viewcontent with value, currency, product_id, and product_name.',\n in: getEvent('product view', {\n timestamp: 1700000104,\n id: 'ev-1700000104',\n }),\n mapping: {\n name: 'viewcontent',\n data: {\n map: {\n value: 'data.price',\n currency: { key: 'data.currency', value: 'EUR' },\n product_id: 'data.id',\n product_name: 'data.color',\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'viewcontent',\n {\n value: 420,\n currency: 'EUR',\n product_id: 'ers',\n product_name: 'black',\n event_id: 'ev-1700000104',\n },\n ],\n ],\n};\n\n/**\n * Add-to-cart with an inline line_items array.\n */\nexport const productAddToCart: Flow.StepExample = {\n title: 'Add to cart',\n description:\n 'A product add fires Pinterest addtocart with value, currency, and a single-item line_items array.',\n in: getEvent('product add', {\n timestamp: 1700000105,\n id: 'ev-1700000105',\n }),\n mapping: {\n name: 'addtocart',\n data: {\n map: {\n value: 'data.price',\n order_quantity: { value: 1 },\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n set: [\n {\n map: {\n product_id: 'data.id',\n product_name: 'data.color',\n product_price: 'data.price',\n product_quantity: { value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'addtocart',\n {\n value: 420,\n order_quantity: 1,\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'black',\n product_price: 420,\n product_quantity: 1,\n },\n ],\n event_id: 'ev-1700000105',\n },\n ],\n ],\n};\n\n/**\n * Multi-product checkout - the canonical Pinterest ecommerce pattern.\n */\nexport const orderCompleteCheckout: Flow.StepExample = {\n title: 'Checkout',\n description:\n 'A completed order fires Pinterest checkout with value, order_id, currency, and a nested line_items array.',\n in: getEvent('order complete', {\n timestamp: 1700000106,\n id: 'ev-1700000106',\n }),\n mapping: {\n name: 'checkout',\n data: {\n map: {\n value: 'data.value',\n order_id: 'data.id',\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n loop: [\n 'nested',\n {\n condition: (value: unknown) =>\n isObject(value) &&\n isObject(value.data) &&\n typeof value.data.price === 'number',\n map: {\n product_id: 'data.id',\n product_name: 'data.color',\n product_price: 'data.price',\n product_quantity: { value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'checkout',\n {\n value: 555,\n order_id: '0rd3r1d',\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'black',\n product_price: 420,\n product_quantity: 1,\n },\n {\n product_id: 'cc',\n product_price: 42,\n product_quantity: 1,\n },\n ],\n event_id: 'ev-1700000106',\n },\n ],\n ],\n};\n\n/**\n * Lead conversion with per-event enhanced matching update.\n */\nexport const userLoginLead: Flow.StepExample = {\n title: 'Lead with matching',\n description:\n 'A user login fires pintrk set for enhanced matching and then a lead conversion track call.',\n in: createEvent({\n name: 'user login',\n timestamp: 1700000107,\n id: 'ev-1700000107',\n data: {\n id: 'usr_123',\n email: 'jane@example.com',\n },\n }),\n mapping: {\n name: 'lead',\n settings: {\n identify: {\n map: {\n em: 'data.email',\n external_id: 'data.id',\n },\n },\n },\n data: {\n map: {\n lead_type: { value: 'login' },\n },\n },\n },\n out: [\n ['pintrk', 'set', { em: 'jane@example.com', external_id: 'usr_123' }],\n [\n 'pintrk',\n 'track',\n 'lead',\n {\n lead_type: 'login',\n event_id: 'ev-1700000107',\n },\n ],\n ],\n};\n\n/**\n * mapping.silent - processes side effects (identify set) but suppresses\n * the default pintrk('track', ...) call.\n */\nexport const identifyOnlySilent: Flow.StepExample = {\n title: 'Identify only',\n description:\n 'A user update fires pintrk set for enhanced matching without a track call via mapping silent.',\n in: createEvent({\n name: 'user update',\n timestamp: 1700000108,\n id: 'ev-1700000108',\n data: {\n id: 'usr_456',\n email: 'new@example.com',\n },\n }),\n mapping: {\n silent: true,\n settings: {\n identify: {\n map: {\n em: 'data.email',\n external_id: 'data.id',\n },\n },\n },\n },\n out: [['pintrk', 'set', { em: 'new@example.com', external_id: 'usr_456' }]],\n};\n\n/**\n * Consent revocation - walkerOS walker consent { marketing: false }.\n * The destination's on('consent') handler flips the runtime state flag\n * and stops calling pintrk('track', ...) for subsequent events.\n */\nexport const consentRevoke: Flow.StepExample = {\n public: false,\n description:\n 'For a destination with config.consent { marketing: true }, revoking marketing makes no vendor call: the destination stops sending track calls itself.',\n command: 'consent',\n in: { marketing: false },\n out: [],\n};\n\n/**\n * Consent grant - explicit opt-in.\n */\nexport const consentGrant: Flow.StepExample = {\n public: false,\n description:\n 'A grant of the required consent lets the destination send track calls again; Pinterest has no consent call to make.',\n command: 'consent',\n in: { marketing: true },\n out: [],\n};\n\n/** A silent rule sends no track call and no identity. */\nexport const silentRule: Flow.StepExample = {\n public: false,\n description: 'A rule with silent: true sends no pintrk track call.',\n in: createEvent({ name: 'page view', timestamp: 1700000109 }),\n mapping: { silent: true },\n out: [],\n};\n\n/**\n * The silent identify rule of identifyOnlySilent on an update without data:\n * no identity resolves and the rule suppresses the track, so nothing is\n * sent. A declared skip: an unmet mapping, not a failure.\n */\nexport const identifyOnlySilentWithoutData: Flow.StepExample = {\n public: false,\n description:\n 'A silent rule whose identify mapping finds no email or id sends nothing: an unmet mapping, not a failure, so the push returns normally.',\n in: { name: 'user update', entity: 'user', action: 'update' },\n mapping: identifyOnlySilent.mapping,\n out: [],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAC3B,OAAO;AAAA,EACN,QAAQ,EACL,OAAO,EACP,MAAM,SAAS,oCAAoC,EACnD,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,UAAU,EACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,EACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC,EACA,OAAO;;;ACxBV,SAAS,KAAAA,UAAS;AAEX,IAAM,gBAAgBA,GAAE,OAAO;AAAA,EACpC,UAAUA,GACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AFDM,IAAM,WAAW,YAAY,cAAc;AAC3C,IAAM,UAAU,YAAY,aAAa;;;AGThD;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,IAAM,OAAO,MAAM;AAAC;AAEpB,IAAM,aAAqB,OAAO,OAAO,MAAM;AAAA,EAC7C,OAAO,CAAC;AAAA,EACR,SAAS;AACX,CAAC;AAMM,IAAM,OAAY;AAAA,EACvB,QAAQ;AAAA,IACN,QAAQ;AAAA,EACV;AACF;AAMO,IAAM,OAAY;AAAA,EACvB,QAAQ;AAAA,IACN,QAAQ;AAAA,EACV;AACF;AAGO,IAAM,aAAa,CAAC,oBAAoB;;;ACtC/C;A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A,EACR,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,KAAK;AAAA,EACtB,KAAK,CAAC;AACR;AAGO,IAAM,aAA+B;AAAA,EAC1C,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,IAAI,YAAY,EAAE,MAAM,aAAa,WAAW,WAAW,CAAC;AAAA,EAC5D,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;AAOO,IAAM,gCAAkD;AAAA,EAC7D,QAAQ;AAAA,EACR,aACE;AAAA,EACF,IAAI,EAAE,MAAM,eAAe,QAAQ,QAAQ,QAAQ,SAAS;AAAA,EAC5D,SAAS,mBAAmB;AAAA,EAC5B,KAAK,CAAC;AACR;","names":["z"]}
|
|
1
|
+
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts","../src/examples/minimal.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z\n .object({\n apiKey: z\n .string()\n .regex(/^\\d+$/, 'Must be a numeric Pinterest Tag ID')\n .min(6)\n .describe(\n 'Your Pinterest Tag ID (numeric string, e.g. \"2612345678901\"). Found in Pinterest Ads Manager under Conversions → Pinterest Tag. Passed to pintrk(\"load\", tagId).',\n ),\n pageview: z\n .boolean()\n .describe(\n 'Call pintrk(\"page\") once in init, as Pinterest\\'s base code does. Default true. Set false to leave the call out.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to enhanced matching fields: { em?: string, external_id?: string }. The Pinterest tag takes em plain (it hashes it with SHA-256 in the browser) or already hashed. Resolved on each event and sent with pintrk(\"set\", data) when it changes; init calls pintrk(\"load\", tagId) without it.',\n )\n .optional(),\n })\n .strict();\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identity override. Resolves to { em?, external_id? } and fires pintrk(\"set\", data) when the resolved value differs from the current state.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\nexport { minimal } from './minimal';\n","import type { Env, Pintrk } from '../types';\n\n/**\n * Example environment configurations for the Pinterest destination.\n *\n * These mock window.pintrk, allowing tests to run in a pure\n * Node environment without jsdom and without touching the real Pinterest\n * CDN. Tests replace env.window.pintrk with a jest.fn() spy.\n */\n\nconst noop = () => {};\n\nconst noopPintrk: Pintrk = Object.assign(noop, {\n queue: [],\n version: '3.0',\n});\n\n/**\n * Pre-init environment: pintrk is not yet on the window.\n * Used to validate the init path that creates the queue function.\n */\nexport const init: Env = {\n window: {\n pintrk: undefined,\n },\n};\n\n/**\n * Post-init environment: pintrk is available as a spy-able function.\n * Tests clone this and replace `pintrk` with a jest.fn() to record calls.\n */\nexport const push: Env = {\n window: {\n pintrk: noopPintrk,\n },\n};\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = ['call:window.pintrk'];\n","import type { Flow } from '@walkeros/core';\nimport { createEvent, getEvent } from '@walkeros/core';\n\n/**\n * Output convention:\n * - Single SDK call: out = [['pintrk', 'track', 'checkout', { ... }]]\n * - Multiple SDK calls: out = [['pintrk', ...], ['pintrk', ...]]\n * - Zero SDK calls: out = []\n */\n\n/**\n * Default event forwarding - no rule. Without a mapping.name, the walkerOS\n * event name is forwarded as-is. Pinterest accepts it but won't match a\n * standard conversion event. event_id is auto-attached for deduplication.\n */\nexport const defaultForward: Flow.StepExample = {\n title: 'Default forward',\n description:\n 'Without a mapping the walker event name is forwarded as-is to pintrk track with an event_id for dedup.',\n in: getEvent('page view', { timestamp: 1700000100, id: 'ev-1700000100' }),\n mapping: undefined,\n out: [['pintrk', 'track', 'page view', { event_id: 'ev-1700000100' }]],\n};\n\n/**\n * Wildcard ignore pattern - the standard walkerOS way to suppress noisy\n * events. `mapping.ignore: true` at rule level produces zero SDK calls.\n */\nexport const wildcardIgnored: Flow.StepExample = {\n public: false,\n in: createEvent({ name: 'debug noise', timestamp: 1700000101 }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * Standard Pinterest event rename via mapping.name. walkerOS \"page view\"\n * → Pinterest \"pagevisit\". The ONLY way to get Pinterest to recognize\n * a conversion event - the destination never auto-maps.\n */\nexport const pageViewRename: Flow.StepExample = {\n title: 'Page visit',\n description:\n 'A mapping renames the walker event to the Pinterest standard pagevisit event for conversion tracking.',\n in: getEvent('page view', { timestamp: 1700000102, id: 'ev-1700000102' }),\n mapping: { name: 'pagevisit' },\n out: [['pintrk', 'track', 'pagevisit', { event_id: 'ev-1700000102' }]],\n};\n\n/**\n * Search - walkerOS search submit → Pinterest \"search\" with search_query.\n * Illustrates single-field mapping.data resolution.\n */\nexport const siteSearch: Flow.StepExample = {\n title: 'Search',\n description:\n 'A search submit fires Pinterest search with the search_query field resolved from event data.',\n in: createEvent({\n name: 'search submit',\n timestamp: 1700000103,\n id: 'ev-1700000103',\n data: { term: 'leather jacket' },\n }),\n mapping: {\n name: 'search',\n data: {\n map: {\n search_query: 'data.term',\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'search',\n {\n search_query: 'leather jacket',\n event_id: 'ev-1700000103',\n },\n ],\n ],\n};\n\n/**\n * Single-product viewcontent.\n */\nexport const productViewContent: Flow.StepExample = {\n title: 'View content',\n description:\n 'A product view fires Pinterest viewcontent with value, currency, and a single-item line_items array.',\n in: getEvent('product view', {\n timestamp: 1700000104,\n id: 'ev-1700000104',\n }),\n mapping: {\n name: 'viewcontent',\n data: {\n map: {\n value: 'data.price',\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n set: [\n {\n map: {\n product_id: 'data.id',\n product_name: 'data.name',\n product_price: 'data.price',\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'viewcontent',\n {\n value: 420,\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'Everyday Ruck Snack',\n product_price: 420,\n },\n ],\n event_id: 'ev-1700000104',\n },\n ],\n ],\n};\n\n/**\n * Add-to-cart with an inline line_items array.\n */\nexport const productAddToCart: Flow.StepExample = {\n title: 'Add to cart',\n description:\n 'A product add fires Pinterest addtocart with value, currency, and a single-item line_items array.',\n in: getEvent('product add', {\n timestamp: 1700000105,\n id: 'ev-1700000105',\n }),\n mapping: {\n name: 'addtocart',\n data: {\n map: {\n value: 'data.price',\n order_quantity: { value: 1 },\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n set: [\n {\n map: {\n product_id: 'data.id',\n product_name: 'data.name',\n product_price: 'data.price',\n product_quantity: { value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'addtocart',\n {\n value: 420,\n order_quantity: 1,\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'Everyday Ruck Snack',\n product_price: 420,\n product_quantity: 1,\n },\n ],\n event_id: 'ev-1700000105',\n },\n ],\n ],\n};\n\n/**\n * Multi-product checkout - the canonical Pinterest ecommerce pattern.\n */\nexport const orderCompleteCheckout: Flow.StepExample = {\n title: 'Checkout',\n description:\n 'A completed order fires Pinterest checkout with value, order_id, currency, and a nested line_items array.',\n in: getEvent('order complete', {\n timestamp: 1700000106,\n id: 'ev-1700000106',\n }),\n mapping: {\n name: 'checkout',\n data: {\n map: {\n value: 'data.value',\n order_id: 'data.id',\n currency: { key: 'data.currency', value: 'EUR' },\n line_items: {\n loop: [\n 'nested',\n {\n condition: (value: unknown) =>\n typeof value === 'object' &&\n value !== null &&\n 'data' in value &&\n typeof value.data === 'object' &&\n value.data !== null &&\n 'price' in value.data &&\n typeof value.data.price === 'number',\n map: {\n product_id: 'data.id',\n product_name: 'data.name',\n product_price: 'data.price',\n product_quantity: { value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'pintrk',\n 'track',\n 'checkout',\n {\n value: 462,\n order_id: '0rd3r1d',\n currency: 'EUR',\n line_items: [\n {\n product_id: 'ers',\n product_name: 'Everyday Ruck Snack',\n product_price: 420,\n product_quantity: 1,\n },\n {\n product_id: 'cc',\n product_name: 'Cool Cap',\n product_price: 42,\n product_quantity: 1,\n },\n ],\n event_id: 'ev-1700000106',\n },\n ],\n ],\n};\n\n/**\n * Lead conversion with per-event enhanced matching update.\n */\nexport const userLoginLead: Flow.StepExample = {\n title: 'Lead with matching',\n description:\n 'A user login fires pintrk set for enhanced matching and then a lead conversion track call.',\n in: createEvent({\n name: 'user login',\n timestamp: 1700000107,\n id: 'ev-1700000107',\n data: {\n id: 'usr_123',\n email: 'jane@example.com',\n },\n }),\n mapping: {\n name: 'lead',\n settings: {\n identify: {\n map: {\n em: 'data.email',\n external_id: 'data.id',\n },\n },\n },\n data: {\n map: {\n lead_type: { value: 'login' },\n },\n },\n },\n out: [\n ['pintrk', 'set', { em: 'jane@example.com', external_id: 'usr_123' }],\n [\n 'pintrk',\n 'track',\n 'lead',\n {\n lead_type: 'login',\n event_id: 'ev-1700000107',\n },\n ],\n ],\n};\n\n/**\n * mapping.silent - processes side effects (identify set) but suppresses\n * the default pintrk('track', ...) call.\n */\nexport const identifyOnlySilent: Flow.StepExample = {\n title: 'Identify only',\n description:\n 'A user update fires pintrk set for enhanced matching without a track call via mapping silent.',\n in: createEvent({\n name: 'user update',\n timestamp: 1700000108,\n id: 'ev-1700000108',\n data: {\n id: 'usr_456',\n email: 'new@example.com',\n },\n }),\n mapping: {\n silent: true,\n settings: {\n identify: {\n map: {\n em: 'data.email',\n external_id: 'data.id',\n },\n },\n },\n },\n out: [['pintrk', 'set', { em: 'new@example.com', external_id: 'usr_456' }]],\n};\n\n/**\n * Consent revocation - walkerOS walker consent { marketing: false }.\n * The destination's on('consent') handler flips the runtime state flag\n * and stops calling pintrk('track', ...) for subsequent events.\n */\nexport const consentRevoke: Flow.StepExample = {\n public: false,\n description:\n 'For a destination with config.consent { marketing: true }, revoking marketing makes no vendor call: the destination stops sending track calls itself.',\n command: 'consent',\n in: { marketing: false },\n out: [],\n};\n\n/**\n * Consent grant - explicit opt-in.\n */\nexport const consentGrant: Flow.StepExample = {\n public: false,\n description:\n 'A grant of the required consent lets the destination send track calls again; Pinterest has no consent call to make.',\n command: 'consent',\n in: { marketing: true },\n out: [],\n};\n\n/** A silent rule sends no track call and no identity. */\nexport const silentRule: Flow.StepExample = {\n public: false,\n description: 'A rule with silent: true sends no pintrk track call.',\n in: createEvent({ name: 'page view', timestamp: 1700000109 }),\n mapping: { silent: true },\n out: [],\n};\n\n/**\n * The silent identify rule of identifyOnlySilent on an update without data:\n * no identity resolves and the rule suppresses the track, so nothing is\n * sent. A declared skip: an unmet mapping, not a failure.\n */\nexport const identifyOnlySilentWithoutData: Flow.StepExample = {\n public: false,\n description:\n 'A silent rule whose identify mapping finds no email or id sends nothing: an unmet mapping, not a failure, so the push returns normally.',\n in: { name: 'user update', entity: 'user', action: 'update' },\n mapping: identifyOnlySilent.mapping,\n out: [],\n};\n","import type { Flow } from '@walkeros/core';\n\n/** The settings the Pinterest Tag needs to deliver: the Tag ID. */\nexport const minimal: Flow.MinimalExample = {\n settings: { apiKey: '2612345678901' },\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAC3B,OAAO;AAAA,EACN,QAAQ,EACL,OAAO,EACP,MAAM,SAAS,oCAAoC,EACnD,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,UAAU,EACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,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AM,gCAAkD;AAAA,EAC7D,QAAQ;AAAA,EACR,aACE;AAAA,EACF,IAAI,EAAE,MAAM,eAAe,QAAQ,QAAQ,QAAQ,SAAS;AAAA,EAC5D,SAAS,mBAAmB;AAAA,EAC5B,KAAK,CAAC;AACR;;;AChYO,IAAM,UAA+B;AAAA,EAC1C,UAAU,EAAE,QAAQ,gBAAgB;AACtC;","names":["z"]}
|
|
@@ -128,7 +128,7 @@ declare const wildcardIgnored: Flow.StepExample;
|
|
|
128
128
|
*/
|
|
129
129
|
declare const pageViewRename: Flow.StepExample;
|
|
130
130
|
/**
|
|
131
|
-
* Search - walkerOS
|
|
131
|
+
* Search - walkerOS search submit → Pinterest "search" with search_query.
|
|
132
132
|
* Illustrates single-field mapping.data resolution.
|
|
133
133
|
*/
|
|
134
134
|
declare const siteSearch: Flow.StepExample;
|
|
@@ -189,4 +189,7 @@ declare namespace step {
|
|
|
189
189
|
export { step_consentGrant as consentGrant, step_consentRevoke as consentRevoke, step_defaultForward as defaultForward, step_identifyOnlySilent as identifyOnlySilent, step_identifyOnlySilentWithoutData as identifyOnlySilentWithoutData, step_orderCompleteCheckout as orderCompleteCheckout, step_pageViewRename as pageViewRename, step_productAddToCart as productAddToCart, step_productViewContent as productViewContent, step_silentRule as silentRule, step_siteSearch as siteSearch, step_userLoginLead as userLoginLead, step_wildcardIgnored as wildcardIgnored };
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
|
|
192
|
+
/** The settings the Pinterest Tag needs to deliver: the Tag ID. */
|
|
193
|
+
declare const minimal: Flow.MinimalExample;
|
|
194
|
+
|
|
195
|
+
export { env, minimal, step };
|
package/dist/examples/index.d.ts
CHANGED
|
@@ -128,7 +128,7 @@ declare const wildcardIgnored: Flow.StepExample;
|
|
|
128
128
|
*/
|
|
129
129
|
declare const pageViewRename: Flow.StepExample;
|
|
130
130
|
/**
|
|
131
|
-
* Search - walkerOS
|
|
131
|
+
* Search - walkerOS search submit → Pinterest "search" with search_query.
|
|
132
132
|
* Illustrates single-field mapping.data resolution.
|
|
133
133
|
*/
|
|
134
134
|
declare const siteSearch: Flow.StepExample;
|
|
@@ -189,4 +189,7 @@ declare namespace step {
|
|
|
189
189
|
export { step_consentGrant as consentGrant, step_consentRevoke as consentRevoke, step_defaultForward as defaultForward, step_identifyOnlySilent as identifyOnlySilent, step_identifyOnlySilentWithoutData as identifyOnlySilentWithoutData, step_orderCompleteCheckout as orderCompleteCheckout, step_pageViewRename as pageViewRename, step_productAddToCart as productAddToCart, step_productViewContent as productViewContent, step_silentRule as silentRule, step_siteSearch as siteSearch, step_userLoginLead as userLoginLead, step_wildcardIgnored as wildcardIgnored };
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
|
|
192
|
+
/** The settings the Pinterest Tag needs to deliver: the Tag ID. */
|
|
193
|
+
declare const minimal: Flow.MinimalExample;
|
|
194
|
+
|
|
195
|
+
export { env, minimal, step };
|
package/dist/examples/index.js
CHANGED
|
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var examples_exports = {};
|
|
22
22
|
__export(examples_exports, {
|
|
23
23
|
env: () => env_exports,
|
|
24
|
+
minimal: () => minimal,
|
|
24
25
|
step: () => step_exports
|
|
25
26
|
});
|
|
26
27
|
module.exports = __toCommonJS(examples_exports);
|
|
@@ -90,18 +91,18 @@ var pageViewRename = {
|
|
|
90
91
|
};
|
|
91
92
|
var siteSearch = {
|
|
92
93
|
title: "Search",
|
|
93
|
-
description: "A
|
|
94
|
+
description: "A search submit fires Pinterest search with the search_query field resolved from event data.",
|
|
94
95
|
in: (0, import_core.createEvent)({
|
|
95
|
-
name: "
|
|
96
|
+
name: "search submit",
|
|
96
97
|
timestamp: 1700000103,
|
|
97
98
|
id: "ev-1700000103",
|
|
98
|
-
data: {
|
|
99
|
+
data: { term: "leather jacket" }
|
|
99
100
|
}),
|
|
100
101
|
mapping: {
|
|
101
102
|
name: "search",
|
|
102
103
|
data: {
|
|
103
104
|
map: {
|
|
104
|
-
search_query: "data.
|
|
105
|
+
search_query: "data.term"
|
|
105
106
|
}
|
|
106
107
|
}
|
|
107
108
|
},
|
|
@@ -119,7 +120,7 @@ var siteSearch = {
|
|
|
119
120
|
};
|
|
120
121
|
var productViewContent = {
|
|
121
122
|
title: "View content",
|
|
122
|
-
description: "A product view fires Pinterest viewcontent with value, currency,
|
|
123
|
+
description: "A product view fires Pinterest viewcontent with value, currency, and a single-item line_items array.",
|
|
123
124
|
in: (0, import_core.getEvent)("product view", {
|
|
124
125
|
timestamp: 1700000104,
|
|
125
126
|
id: "ev-1700000104"
|
|
@@ -130,8 +131,17 @@ var productViewContent = {
|
|
|
130
131
|
map: {
|
|
131
132
|
value: "data.price",
|
|
132
133
|
currency: { key: "data.currency", value: "EUR" },
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
line_items: {
|
|
135
|
+
set: [
|
|
136
|
+
{
|
|
137
|
+
map: {
|
|
138
|
+
product_id: "data.id",
|
|
139
|
+
product_name: "data.name",
|
|
140
|
+
product_price: "data.price"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
}
|
|
135
145
|
}
|
|
136
146
|
}
|
|
137
147
|
},
|
|
@@ -143,8 +153,13 @@ var productViewContent = {
|
|
|
143
153
|
{
|
|
144
154
|
value: 420,
|
|
145
155
|
currency: "EUR",
|
|
146
|
-
|
|
147
|
-
|
|
156
|
+
line_items: [
|
|
157
|
+
{
|
|
158
|
+
product_id: "ers",
|
|
159
|
+
product_name: "Everyday Ruck Snack",
|
|
160
|
+
product_price: 420
|
|
161
|
+
}
|
|
162
|
+
],
|
|
148
163
|
event_id: "ev-1700000104"
|
|
149
164
|
}
|
|
150
165
|
]
|
|
@@ -169,7 +184,7 @@ var productAddToCart = {
|
|
|
169
184
|
{
|
|
170
185
|
map: {
|
|
171
186
|
product_id: "data.id",
|
|
172
|
-
product_name: "data.
|
|
187
|
+
product_name: "data.name",
|
|
173
188
|
product_price: "data.price",
|
|
174
189
|
product_quantity: { value: 1 }
|
|
175
190
|
}
|
|
@@ -191,7 +206,7 @@ var productAddToCart = {
|
|
|
191
206
|
line_items: [
|
|
192
207
|
{
|
|
193
208
|
product_id: "ers",
|
|
194
|
-
product_name: "
|
|
209
|
+
product_name: "Everyday Ruck Snack",
|
|
195
210
|
product_price: 420,
|
|
196
211
|
product_quantity: 1
|
|
197
212
|
}
|
|
@@ -219,10 +234,10 @@ var orderCompleteCheckout = {
|
|
|
219
234
|
loop: [
|
|
220
235
|
"nested",
|
|
221
236
|
{
|
|
222
|
-
condition: (value) =>
|
|
237
|
+
condition: (value) => typeof value === "object" && value !== null && "data" in value && typeof value.data === "object" && value.data !== null && "price" in value.data && typeof value.data.price === "number",
|
|
223
238
|
map: {
|
|
224
239
|
product_id: "data.id",
|
|
225
|
-
product_name: "data.
|
|
240
|
+
product_name: "data.name",
|
|
226
241
|
product_price: "data.price",
|
|
227
242
|
product_quantity: { value: 1 }
|
|
228
243
|
}
|
|
@@ -238,18 +253,19 @@ var orderCompleteCheckout = {
|
|
|
238
253
|
"track",
|
|
239
254
|
"checkout",
|
|
240
255
|
{
|
|
241
|
-
value:
|
|
256
|
+
value: 462,
|
|
242
257
|
order_id: "0rd3r1d",
|
|
243
258
|
currency: "EUR",
|
|
244
259
|
line_items: [
|
|
245
260
|
{
|
|
246
261
|
product_id: "ers",
|
|
247
|
-
product_name: "
|
|
262
|
+
product_name: "Everyday Ruck Snack",
|
|
248
263
|
product_price: 420,
|
|
249
264
|
product_quantity: 1
|
|
250
265
|
},
|
|
251
266
|
{
|
|
252
267
|
product_id: "cc",
|
|
268
|
+
product_name: "Cool Cap",
|
|
253
269
|
product_price: 42,
|
|
254
270
|
product_quantity: 1
|
|
255
271
|
}
|
|
@@ -353,8 +369,14 @@ var identifyOnlySilentWithoutData = {
|
|
|
353
369
|
mapping: identifyOnlySilent.mapping,
|
|
354
370
|
out: []
|
|
355
371
|
};
|
|
372
|
+
|
|
373
|
+
// src/examples/minimal.ts
|
|
374
|
+
var minimal = {
|
|
375
|
+
settings: { apiKey: "2612345678901" }
|
|
376
|
+
};
|
|
356
377
|
// Annotate the CommonJS export names for ESM import in node:
|
|
357
378
|
0 && (module.exports = {
|
|
358
379
|
env,
|
|
380
|
+
minimal,
|
|
359
381
|
step
|
|
360
382
|
});
|
package/dist/examples/index.mjs
CHANGED
|
@@ -46,7 +46,7 @@ __export(step_exports, {
|
|
|
46
46
|
userLoginLead: () => userLoginLead,
|
|
47
47
|
wildcardIgnored: () => wildcardIgnored
|
|
48
48
|
});
|
|
49
|
-
import { createEvent, getEvent
|
|
49
|
+
import { createEvent, getEvent } from "@walkeros/core";
|
|
50
50
|
var defaultForward = {
|
|
51
51
|
title: "Default forward",
|
|
52
52
|
description: "Without a mapping the walker event name is forwarded as-is to pintrk track with an event_id for dedup.",
|
|
@@ -69,18 +69,18 @@ var pageViewRename = {
|
|
|
69
69
|
};
|
|
70
70
|
var siteSearch = {
|
|
71
71
|
title: "Search",
|
|
72
|
-
description: "A
|
|
72
|
+
description: "A search submit fires Pinterest search with the search_query field resolved from event data.",
|
|
73
73
|
in: createEvent({
|
|
74
|
-
name: "
|
|
74
|
+
name: "search submit",
|
|
75
75
|
timestamp: 1700000103,
|
|
76
76
|
id: "ev-1700000103",
|
|
77
|
-
data: {
|
|
77
|
+
data: { term: "leather jacket" }
|
|
78
78
|
}),
|
|
79
79
|
mapping: {
|
|
80
80
|
name: "search",
|
|
81
81
|
data: {
|
|
82
82
|
map: {
|
|
83
|
-
search_query: "data.
|
|
83
|
+
search_query: "data.term"
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
},
|
|
@@ -98,7 +98,7 @@ var siteSearch = {
|
|
|
98
98
|
};
|
|
99
99
|
var productViewContent = {
|
|
100
100
|
title: "View content",
|
|
101
|
-
description: "A product view fires Pinterest viewcontent with value, currency,
|
|
101
|
+
description: "A product view fires Pinterest viewcontent with value, currency, and a single-item line_items array.",
|
|
102
102
|
in: getEvent("product view", {
|
|
103
103
|
timestamp: 1700000104,
|
|
104
104
|
id: "ev-1700000104"
|
|
@@ -109,8 +109,17 @@ var productViewContent = {
|
|
|
109
109
|
map: {
|
|
110
110
|
value: "data.price",
|
|
111
111
|
currency: { key: "data.currency", value: "EUR" },
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
line_items: {
|
|
113
|
+
set: [
|
|
114
|
+
{
|
|
115
|
+
map: {
|
|
116
|
+
product_id: "data.id",
|
|
117
|
+
product_name: "data.name",
|
|
118
|
+
product_price: "data.price"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
114
123
|
}
|
|
115
124
|
}
|
|
116
125
|
},
|
|
@@ -122,8 +131,13 @@ var productViewContent = {
|
|
|
122
131
|
{
|
|
123
132
|
value: 420,
|
|
124
133
|
currency: "EUR",
|
|
125
|
-
|
|
126
|
-
|
|
134
|
+
line_items: [
|
|
135
|
+
{
|
|
136
|
+
product_id: "ers",
|
|
137
|
+
product_name: "Everyday Ruck Snack",
|
|
138
|
+
product_price: 420
|
|
139
|
+
}
|
|
140
|
+
],
|
|
127
141
|
event_id: "ev-1700000104"
|
|
128
142
|
}
|
|
129
143
|
]
|
|
@@ -148,7 +162,7 @@ var productAddToCart = {
|
|
|
148
162
|
{
|
|
149
163
|
map: {
|
|
150
164
|
product_id: "data.id",
|
|
151
|
-
product_name: "data.
|
|
165
|
+
product_name: "data.name",
|
|
152
166
|
product_price: "data.price",
|
|
153
167
|
product_quantity: { value: 1 }
|
|
154
168
|
}
|
|
@@ -170,7 +184,7 @@ var productAddToCart = {
|
|
|
170
184
|
line_items: [
|
|
171
185
|
{
|
|
172
186
|
product_id: "ers",
|
|
173
|
-
product_name: "
|
|
187
|
+
product_name: "Everyday Ruck Snack",
|
|
174
188
|
product_price: 420,
|
|
175
189
|
product_quantity: 1
|
|
176
190
|
}
|
|
@@ -198,10 +212,10 @@ var orderCompleteCheckout = {
|
|
|
198
212
|
loop: [
|
|
199
213
|
"nested",
|
|
200
214
|
{
|
|
201
|
-
condition: (value) =>
|
|
215
|
+
condition: (value) => typeof value === "object" && value !== null && "data" in value && typeof value.data === "object" && value.data !== null && "price" in value.data && typeof value.data.price === "number",
|
|
202
216
|
map: {
|
|
203
217
|
product_id: "data.id",
|
|
204
|
-
product_name: "data.
|
|
218
|
+
product_name: "data.name",
|
|
205
219
|
product_price: "data.price",
|
|
206
220
|
product_quantity: { value: 1 }
|
|
207
221
|
}
|
|
@@ -217,18 +231,19 @@ var orderCompleteCheckout = {
|
|
|
217
231
|
"track",
|
|
218
232
|
"checkout",
|
|
219
233
|
{
|
|
220
|
-
value:
|
|
234
|
+
value: 462,
|
|
221
235
|
order_id: "0rd3r1d",
|
|
222
236
|
currency: "EUR",
|
|
223
237
|
line_items: [
|
|
224
238
|
{
|
|
225
239
|
product_id: "ers",
|
|
226
|
-
product_name: "
|
|
240
|
+
product_name: "Everyday Ruck Snack",
|
|
227
241
|
product_price: 420,
|
|
228
242
|
product_quantity: 1
|
|
229
243
|
},
|
|
230
244
|
{
|
|
231
245
|
product_id: "cc",
|
|
246
|
+
product_name: "Cool Cap",
|
|
232
247
|
product_price: 42,
|
|
233
248
|
product_quantity: 1
|
|
234
249
|
}
|
|
@@ -332,7 +347,13 @@ var identifyOnlySilentWithoutData = {
|
|
|
332
347
|
mapping: identifyOnlySilent.mapping,
|
|
333
348
|
out: []
|
|
334
349
|
};
|
|
350
|
+
|
|
351
|
+
// src/examples/minimal.ts
|
|
352
|
+
var minimal = {
|
|
353
|
+
settings: { apiKey: "2612345678901" }
|
|
354
|
+
};
|
|
335
355
|
export {
|
|
336
356
|
env_exports as env,
|
|
357
|
+
minimal,
|
|
337
358
|
step_exports as step
|
|
338
359
|
};
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/web-destination-pinterest",
|
|
4
|
-
"version": "4.8.
|
|
4
|
+
"version": "4.8.3-next-1793115089237",
|
|
5
5
|
"type": "destination",
|
|
6
6
|
"platform": [
|
|
7
7
|
"web"
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
},
|
|
34
34
|
"pageview": {
|
|
35
35
|
"type": "boolean",
|
|
36
|
-
"description": "
|
|
36
|
+
"description": "Call pintrk(\"page\") once in init, as Pinterest's base code does. Default true. Set false to leave the call out."
|
|
37
37
|
},
|
|
38
38
|
"identify": {
|
|
39
|
-
"description": "walkerOS mapping value resolving to enhanced matching fields: { em?: string, external_id?: string }. em
|
|
39
|
+
"description": "walkerOS mapping value resolving to enhanced matching fields: { em?: string, external_id?: string }. The Pinterest tag takes em plain (it hashes it with SHA-256 in the browser) or already hashed. Resolved on each event and sent with pintrk(\"set\", data) when it changes; init calls pintrk(\"load\", tagId) without it."
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"required": [
|
|
@@ -61,6 +61,11 @@
|
|
|
61
61
|
"call:window.pintrk"
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
|
+
"minimal": {
|
|
65
|
+
"settings": {
|
|
66
|
+
"apiKey": "2612345678901"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
64
69
|
"step": {
|
|
65
70
|
"consentGrant": {
|
|
66
71
|
"public": false,
|
|
@@ -246,9 +251,10 @@
|
|
|
246
251
|
"data": {
|
|
247
252
|
"id": "0rd3r1d",
|
|
248
253
|
"currency": "EUR",
|
|
254
|
+
"value": 462,
|
|
255
|
+
"tax": 73.76,
|
|
249
256
|
"shipping": 5.22,
|
|
250
|
-
"
|
|
251
|
-
"value": 555
|
|
257
|
+
"total": 467.22
|
|
252
258
|
},
|
|
253
259
|
"context": {
|
|
254
260
|
"shopping": [
|
|
@@ -346,11 +352,11 @@
|
|
|
346
352
|
"nested",
|
|
347
353
|
{
|
|
348
354
|
"condition": {
|
|
349
|
-
"$code": "e
|
|
355
|
+
"$code": "e=>\"object\"==typeof e&&null!==e&&\"data\"in e&&\"object\"==typeof e.data&&null!==e.data&&\"price\"in e.data&&\"number\"==typeof e.data.price"
|
|
350
356
|
},
|
|
351
357
|
"map": {
|
|
352
358
|
"product_id": "data.id",
|
|
353
|
-
"product_name": "data.
|
|
359
|
+
"product_name": "data.name",
|
|
354
360
|
"product_price": "data.price",
|
|
355
361
|
"product_quantity": {
|
|
356
362
|
"value": 1
|
|
@@ -368,18 +374,19 @@
|
|
|
368
374
|
"track",
|
|
369
375
|
"checkout",
|
|
370
376
|
{
|
|
371
|
-
"value":
|
|
377
|
+
"value": 462,
|
|
372
378
|
"order_id": "0rd3r1d",
|
|
373
379
|
"currency": "EUR",
|
|
374
380
|
"line_items": [
|
|
375
381
|
{
|
|
376
382
|
"product_id": "ers",
|
|
377
|
-
"product_name": "
|
|
383
|
+
"product_name": "Everyday Ruck Snack",
|
|
378
384
|
"product_price": 420,
|
|
379
385
|
"product_quantity": 1
|
|
380
386
|
},
|
|
381
387
|
{
|
|
382
388
|
"product_id": "cc",
|
|
389
|
+
"product_name": "Cool Cap",
|
|
383
390
|
"product_price": 42,
|
|
384
391
|
"product_quantity": 1
|
|
385
392
|
}
|
|
@@ -467,7 +474,9 @@
|
|
|
467
474
|
"name": "Everyday Ruck Snack",
|
|
468
475
|
"color": "black",
|
|
469
476
|
"size": "l",
|
|
470
|
-
"price": 420
|
|
477
|
+
"price": 420,
|
|
478
|
+
"quantity": 1,
|
|
479
|
+
"currency": "EUR"
|
|
471
480
|
},
|
|
472
481
|
"context": {
|
|
473
482
|
"shopping": [
|
|
@@ -520,7 +529,7 @@
|
|
|
520
529
|
{
|
|
521
530
|
"map": {
|
|
522
531
|
"product_id": "data.id",
|
|
523
|
-
"product_name": "data.
|
|
532
|
+
"product_name": "data.name",
|
|
524
533
|
"product_price": "data.price",
|
|
525
534
|
"product_quantity": {
|
|
526
535
|
"value": 1
|
|
@@ -544,7 +553,7 @@
|
|
|
544
553
|
"line_items": [
|
|
545
554
|
{
|
|
546
555
|
"product_id": "ers",
|
|
547
|
-
"product_name": "
|
|
556
|
+
"product_name": "Everyday Ruck Snack",
|
|
548
557
|
"product_price": 420,
|
|
549
558
|
"product_quantity": 1
|
|
550
559
|
}
|
|
@@ -556,7 +565,7 @@
|
|
|
556
565
|
},
|
|
557
566
|
"productViewContent": {
|
|
558
567
|
"title": "View content",
|
|
559
|
-
"description": "A product view fires Pinterest viewcontent with value, currency,
|
|
568
|
+
"description": "A product view fires Pinterest viewcontent with value, currency, and a single-item line_items array.",
|
|
560
569
|
"in": {
|
|
561
570
|
"name": "product view",
|
|
562
571
|
"data": {
|
|
@@ -564,7 +573,8 @@
|
|
|
564
573
|
"name": "Everyday Ruck Snack",
|
|
565
574
|
"color": "black",
|
|
566
575
|
"size": "l",
|
|
567
|
-
"price": 420
|
|
576
|
+
"price": 420,
|
|
577
|
+
"currency": "EUR"
|
|
568
578
|
},
|
|
569
579
|
"context": {
|
|
570
580
|
"shopping": [
|
|
@@ -609,8 +619,17 @@
|
|
|
609
619
|
"key": "data.currency",
|
|
610
620
|
"value": "EUR"
|
|
611
621
|
},
|
|
612
|
-
"
|
|
613
|
-
|
|
622
|
+
"line_items": {
|
|
623
|
+
"set": [
|
|
624
|
+
{
|
|
625
|
+
"map": {
|
|
626
|
+
"product_id": "data.id",
|
|
627
|
+
"product_name": "data.name",
|
|
628
|
+
"product_price": "data.price"
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
]
|
|
632
|
+
}
|
|
614
633
|
}
|
|
615
634
|
}
|
|
616
635
|
},
|
|
@@ -622,8 +641,13 @@
|
|
|
622
641
|
{
|
|
623
642
|
"value": 420,
|
|
624
643
|
"currency": "EUR",
|
|
625
|
-
"
|
|
626
|
-
|
|
644
|
+
"line_items": [
|
|
645
|
+
{
|
|
646
|
+
"product_id": "ers",
|
|
647
|
+
"product_name": "Everyday Ruck Snack",
|
|
648
|
+
"product_price": 420
|
|
649
|
+
}
|
|
650
|
+
],
|
|
627
651
|
"event_id": "ev-1700000104"
|
|
628
652
|
}
|
|
629
653
|
]
|
|
@@ -672,7 +696,7 @@
|
|
|
672
696
|
"consent": {
|
|
673
697
|
"functional": true
|
|
674
698
|
},
|
|
675
|
-
"id": "
|
|
699
|
+
"id": "1b9f0af95a45d19c",
|
|
676
700
|
"trigger": "test",
|
|
677
701
|
"entity": "page",
|
|
678
702
|
"action": "view",
|
|
@@ -692,11 +716,11 @@
|
|
|
692
716
|
},
|
|
693
717
|
"siteSearch": {
|
|
694
718
|
"title": "Search",
|
|
695
|
-
"description": "A
|
|
719
|
+
"description": "A search submit fires Pinterest search with the search_query field resolved from event data.",
|
|
696
720
|
"in": {
|
|
697
|
-
"name": "
|
|
721
|
+
"name": "search submit",
|
|
698
722
|
"data": {
|
|
699
|
-
"
|
|
723
|
+
"term": "leather jacket"
|
|
700
724
|
},
|
|
701
725
|
"context": {
|
|
702
726
|
"dev": [
|
|
@@ -728,8 +752,8 @@
|
|
|
728
752
|
},
|
|
729
753
|
"id": "ev-1700000103",
|
|
730
754
|
"trigger": "test",
|
|
731
|
-
"entity": "
|
|
732
|
-
"action": "
|
|
755
|
+
"entity": "search",
|
|
756
|
+
"action": "submit",
|
|
733
757
|
"timestamp": 1700000103,
|
|
734
758
|
"timing": 3.14,
|
|
735
759
|
"source": {
|
|
@@ -743,7 +767,7 @@
|
|
|
743
767
|
"name": "search",
|
|
744
768
|
"data": {
|
|
745
769
|
"map": {
|
|
746
|
-
"search_query": "data.
|
|
770
|
+
"search_query": "data.term"
|
|
747
771
|
}
|
|
748
772
|
}
|
|
749
773
|
},
|
|
@@ -889,7 +913,7 @@
|
|
|
889
913
|
"consent": {
|
|
890
914
|
"functional": true
|
|
891
915
|
},
|
|
892
|
-
"id": "
|
|
916
|
+
"id": "badeb8a7a16373bf",
|
|
893
917
|
"trigger": "test",
|
|
894
918
|
"entity": "debug",
|
|
895
919
|
"action": "noise",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/web-destination-pinterest",
|
|
3
3
|
"description": "Pinterest Tag web destination for walkerOS (conversion tracking, enhanced matching, audience building)",
|
|
4
|
-
"version": "4.8.
|
|
4
|
+
"version": "4.8.3-next-1793115089237",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"update": "npx npm-check-updates -u && npm update"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@walkeros/core": "4.8.
|
|
42
|
-
"@walkeros/web-core": "4.8.
|
|
41
|
+
"@walkeros/core": "4.8.3-next-1793115089237",
|
|
42
|
+
"@walkeros/web-core": "4.8.3-next-1793115089237"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@walkeros/collector": "4.8.
|
|
45
|
+
"@walkeros/collector": "4.8.3-next-1793115089237"
|
|
46
46
|
},
|
|
47
47
|
"repository": {
|
|
48
48
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|