@walkeros/web-destination-pinterest 4.8.1 → 4.8.2

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/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{getEnv as t}from"@walkeros/web-core";import{getMappingValue as n,isObject as e,isString as i}from"@walkeros/core";var o={};var r={type:"pinterest",config:{},init({config:n,env:e}){const i=n.settings;if(!(null==i?void 0:i.apiKey))return!1;const o=!1!==i.pageview;!function(n){const{window:e}=t(n),i=e;if(i.pintrk)return;const o=(...t)=>{i.pintrk.queue.push(t)};o.queue=[],o.version="3.0",i.pintrk=o}(e),!1!==n.loadScript&&function(n){const{document:e}=t(n),i=e,o=i.createElement("script");o.src="https://s.pinimg.com/ct/core.js",o.async=!0,i.head.appendChild(o)}(e);const{window:r}=t(e),s=r.pintrk;return s("load",i.apiKey),o&&s("page"),i._state={lastIdentify:void 0,consentGranted:!0},n},async push(o,{config:r,rule:s,data:a,env:c,collector:l}){var d,u;const f=r.settings||{},p=f._state||(f._state={consentGranted:!0});if(!1===p.consentGranted)return;const{window:v}=t(c),m=v.pintrk;if(!m)return;const g=null!=(u=null==(d=null==s?void 0:s.settings)?void 0:d.identify)?u:f.identify,y=await async function(t,o,r){if(null==o)return;const s=await n(t,o,{collector:r});if(!e(s))return;const a={},c=s.em,l=s.external_id;return i(c)&&c&&(a.em=c),i(l)&&l&&(a.external_id=l),Object.keys(a).length>0?a:void 0}(o,g,l);var w,k;if(!y||(w=y,k=p.lastIdentify,!w&&!k||w&&k&&w.em===k.em&&w.external_id===k.external_id)||(m("set",y),p.lastIdentify=y),!0===(null==s?void 0:s.silent))return;const _=i(null==s?void 0:s.name)?s.name:o.name,h=e(a)?a:{};m("track",_,{...o.id?{event_id:o.id}:{},...h})},on(t,n){var e,i;if("consent"!==t||!n.data)return;const o=null==(e=n.config)?void 0:e.settings;if(!o)return;const r=n.data,s=null==(i=n.config)?void 0:i.consent;if(!s)return;const a=Object.keys(s);if(0===a.length)return;let c=!1,l=!0;for(const t of a)!0!==r[t]&&(!1===r[t]?(c=!0,l=!1):l=!1);const d=o._state||(o._state={consentGranted:!0});c?d.consentGranted=!1:l&&(d.consentGranted=!0)}},s=r;export{o as DestinationPinterest,s as default,r as destinationPinterest};//# sourceMappingURL=index.mjs.map
1
+ import{getEnv as t,loadVendor as e}from"@walkeros/web-core";import{getGrantedConsent as n,getMappingValue as i,isObject as o,isString as s,StepError as r,stepCall as a}from"@walkeros/core";var c={};function d(e){const{pintrk:n}=t(e).window;if(!n)throw new r("Pinterest Tag not ready: pintrk is missing",{code:"vendor-not-ready"});return n}function l(n,i){return e(!1!==n.loadScript?"https://s.pinimg.com/ct/core.js":void 0,()=>t(i).window.pintrk,{timeout:n.timeout,document:t(i).document})}var u={type:"pinterest",config:{},async init({config:e,env:n}){const i={...e.settings};if(!i.apiKey)throw new r("Pinterest needs settings.apiKey",{code:"config"});const{apiKey:o}=i,s=!1!==i.pageview;!function(e){const{window:n}=t(e);if(n.pintrk)return;const i=Object.assign((...t)=>{var e;null==(e=i.queue)||e.push(t)},{queue:[],version:"3.0"});n.pintrk=i}(n),l(e,n);const c=d(n);return await a(()=>c("load",o),"vendor-not-ready","Pinterest load call failed"),s&&await a(()=>c("page"),"vendor-not-ready","Pinterest page call failed"),{...e,settings:{...i,_state:{lastIdentify:void 0,consentGranted:!0}}}},async push(t,{config:e,rule:n,data:r,env:c,collector:u,logger:f}){var p,g;l(e,c).check();const v=e.settings||{},m=v._state||(v._state={consentGranted:!0}),w=d(c);if(!1!==m.consentGranted){const e=null!=(g=null==(p=null==n?void 0:n.settings)?void 0:p.identify)?g:v.identify,c=await async function(t,e,n){if(null==e)return;const r=await i(t,e,{collector:n});if(!o(r))return;const a={},{em:c,external_id:d}=r;return s(c)&&c&&(a.em=c),s(d)&&d&&(a.external_id=d),Object.keys(a).length>0?a:void 0}(t,e,u);if(c?(y=c,k=m.lastIdentify,!y&&!k||y&&k&&y.em===k.em&&y.external_id===k.external_id||(await a(()=>w("set",c),"transport","Pinterest set call failed"),m.lastIdentify=c)):void 0!==e&&function(t,e,n,i){t.debug(`Pinterest skipped ${n}: ${i} resolved to nothing`,{event:e.name})}(f,t,"set","identify"),!0!==(null==n?void 0:n.silent)){const e=s(null==n?void 0:n.name)?n.name:t.name,i=o(r)?r:{},c={...t.id?{event_id:t.id}:{},...i};await a(()=>w("track",e,c),"transport","Pinterest track call failed")}}var y,k},on(t,{config:e,data:i,collector:s}){const r=e.consent;if("consent"!==t||!r||!o(i))return;if(!Object.keys(r).some(t=>t in i))return;const a=e.settings;if(!o(a))return;(o(a._state)?a._state:a._state={consentGranted:!0}).consentGranted=!1!==n(r,s.consent)}},f=u;export{c as DestinationPinterest,f as default,u as destinationPinterest};//# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/types/index.ts"],"sourcesContent":["import type { DestinationWeb } from '@walkeros/web-core';\nimport { getEnv } from '@walkeros/web-core';\nimport { getMappingValue, isObject, isString } from '@walkeros/core';\nimport type { Collector, WalkerOS } from '@walkeros/core';\nimport type {\n Destination,\n EventData,\n IdentifyFields,\n Pintrk,\n Settings,\n} from './types';\n\n// Types export\nexport * as DestinationPinterest from './types';\n\nconst PINTEREST_SCRIPT_SRC = 'https://s.pinimg.com/ct/core.js';\n\n/**\n * Install the Pinterest `window.pintrk` queue shim. Mirrors the official\n * snippet - any call made before core.js loads is pushed onto `pintrk.queue`,\n * which the real script processes once it initializes. Idempotent.\n */\nfunction installPintrkQueue(env?: DestinationWeb.Env): void {\n const { window } = getEnv(env);\n const w = window as Window & { pintrk?: Pintrk };\n if (w.pintrk) return;\n const queue: unknown[][] = [];\n const fn = ((...args: unknown[]) => {\n (w.pintrk!.queue as unknown[][]).push(args);\n }) as unknown as Pintrk;\n fn.queue = queue;\n fn.version = '3.0';\n w.pintrk = fn;\n}\n\n/**\n * Insert the Pinterest core.js script tag. Async, non-blocking. Matches the\n * plausible/meta precedent.\n */\nfunction addScript(env?: DestinationWeb.Env): void {\n const { document } = getEnv(env);\n const doc = document as Document;\n const script = doc.createElement('script');\n script.src = PINTEREST_SCRIPT_SRC;\n script.async = true;\n doc.head.appendChild(script);\n}\n\n/**\n * Resolve an identify mapping value into IdentifyFields. Strict allow-list:\n * only `em` and `external_id` pass through.\n */\nasync function resolveIdentify(\n event: WalkerOS.Event,\n mappingValue: unknown,\n collector: Collector.Instance,\n): Promise<IdentifyFields | undefined> {\n if (mappingValue === undefined || mappingValue === null) return undefined;\n const resolved = await getMappingValue(\n event,\n mappingValue as Parameters<typeof getMappingValue>[1],\n { collector },\n );\n if (!isObject(resolved)) return undefined;\n const fields: IdentifyFields = {};\n const em = (resolved as Record<string, unknown>).em;\n const external_id = (resolved as Record<string, unknown>).external_id;\n if (isString(em) && em) fields.em = em;\n if (isString(external_id) && external_id) fields.external_id = external_id;\n return Object.keys(fields).length > 0 ? fields : undefined;\n}\n\n/**\n * Shallow-equal compare two IdentifyFields - used to suppress redundant\n * pintrk('set', ...) calls when the resolved identity has not changed.\n */\nfunction identifyEqual(a?: IdentifyFields, b?: IdentifyFields): boolean {\n if (!a && !b) return true;\n if (!a || !b) return false;\n return a.em === b.em && a.external_id === b.external_id;\n}\n\nexport const destinationPinterest: Destination = {\n type: 'pinterest',\n\n config: {},\n\n init({ config, env }) {\n const settings = config.settings;\n if (!settings?.apiKey) return false;\n\n const pageview = settings.pageview !== false;\n\n installPintrkQueue(env);\n if (config.loadScript !== false) addScript(env);\n\n const { window } = getEnv(env);\n const pintrk = (window as Window).pintrk as Pintrk;\n\n pintrk('load', settings.apiKey);\n if (pageview) pintrk('page');\n\n // Seed runtime state (mutation is allowed on Settings._state).\n settings._state = {\n lastIdentify: undefined,\n consentGranted: true,\n };\n\n return config;\n },\n\n async push(event, { config, rule, data, env, collector }) {\n const settings = (config.settings || {}) as Settings;\n const state = (settings._state ||= { consentGranted: true });\n if (state.consentGranted === false) return; // Consent revoked - suppress\n\n const { window } = getEnv(env);\n const pintrk = (window as Window).pintrk as Pintrk;\n if (!pintrk) return;\n\n // 1. Identity - per-event override falls back to destination-level.\n const identifyMapping =\n (rule?.settings?.identify as unknown) ?? settings.identify;\n const identify = await resolveIdentify(event, identifyMapping, collector);\n if (identify && !identifyEqual(identify, state.lastIdentify)) {\n pintrk('set', identify);\n state.lastIdentify = identify;\n }\n\n // 2. Silent - process identity (above) but suppress the default track.\n if (rule?.silent === true) return;\n\n // 3. Track\n const eventName = isString(rule?.name)\n ? (rule!.name as string)\n : event.name;\n\n // context.data contains both include-flattened and mapping.data-resolved\n // properties. Include is the bottom layer, mapping.data wins on conflict.\n const contextData: Record<string, unknown> = isObject(data)\n ? (data as Record<string, unknown>)\n : {};\n\n const eventData: EventData = {\n ...(event.id ? { event_id: event.id } : {}),\n ...contextData,\n };\n\n pintrk('track', eventName, eventData);\n },\n\n on(type, context) {\n if (type !== 'consent' || !context.data) return;\n const settings = context.config?.settings as Settings | undefined;\n if (!settings) return;\n\n const consent = context.data as WalkerOS.Consent;\n const required = context.config?.consent;\n if (!required) return;\n\n const keys = Object.keys(required);\n if (keys.length === 0) return;\n\n // Deny as soon as any required key is explicitly false. Grant only if\n // every required key is explicitly true.\n let anyDenied = false;\n let allGranted = true;\n for (const key of keys) {\n if (consent[key] === true) continue;\n if (consent[key] === false) {\n anyDenied = true;\n allGranted = false;\n } else {\n // undefined / unknown - don't flip\n allGranted = false;\n }\n }\n\n const state = (settings._state ||= { consentGranted: true });\n if (anyDenied) {\n state.consentGranted = false;\n } else if (allGranted) {\n state.consentGranted = true;\n }\n },\n};\n\nexport default destinationPinterest;\n","import type {\n Mapping as WalkerOSMapping,\n Destination as CoreDestination,\n} from '@walkeros/core';\nimport type { DestinationWeb } from '@walkeros/web-core';\n\n/**\n * Pinterest Tag global. The queue-based function created by the Pinterest\n * snippet. Before core.js loads, calls are queued on `pintrk.queue`.\n * After core.js resolves the queue, `pintrk` is replaced with the real\n * implementation. Both shapes accept the same argument signatures.\n */\nexport interface Pintrk {\n (command: 'load', tagId: string, identify?: IdentifyFields): void;\n (command: 'page'): void;\n (\n command: 'track',\n eventName: string,\n eventData?: EventData,\n callback?: (didInit: boolean, error?: unknown) => void,\n ): void;\n (command: 'set', userData: IdentifyFields): void;\n queue?: unknown[][];\n version?: string;\n}\n\ndeclare global {\n interface Window {\n pintrk?: Pintrk;\n }\n}\n\n/**\n * Pinterest standard event taxonomy. See Pinterest Tag documentation.\n * Client-side names are lowercase concatenated strings (addtocart,\n * not add_to_cart). Sending the wrong name means the event will not\n * appear correctly in Pinterest's conversion reports.\n */\nexport type StandardEventName =\n | 'pagevisit'\n | 'viewcategory'\n | 'search'\n | 'addtocart'\n | 'checkout'\n | 'watchvideo'\n | 'signup'\n | 'lead'\n | 'addpaymentinfo'\n | 'addtowishlist'\n | 'initiatecheckout'\n | 'subscribe'\n | 'viewcontent'\n | 'contact'\n | 'customizeproduct'\n | 'findlocation'\n | 'schedule'\n | 'starttrial'\n | 'submitapplication'\n | 'custom';\n\n/** Open union — any string is still passed through to pintrk. */\nexport type EventName = StandardEventName | (string & {});\n\n/**\n * Enhanced matching fields. Web destination strictly limits to the two\n * documented client-side Pinterest Tag fields. CAPI-only fields (ph, fn,\n * ln, address, country, ip, ua) belong to a future server destination\n * and are intentionally not accepted here.\n *\n * The Pinterest JS tag auto-hashes `em` with SHA-256 before transmission —\n * the destination does NOT hash.\n */\nexport interface IdentifyFields {\n em?: string;\n external_id?: string;\n}\n\n/**\n * Event data payload for pintrk('track', ...). Pinterest has a prescribed\n * set of parameter names. Common parameters across events plus an open\n * `[key: string]: unknown` for event-specific fields (search_query,\n * video_title, lead_type, opt_out_type, custom properties, etc.).\n */\nexport interface EventData {\n value?: number;\n order_quantity?: number;\n currency?: string;\n event_id?: string;\n order_id?: string;\n promo_code?: string;\n property?: string;\n product_name?: string;\n product_id?: string;\n product_category?: string;\n product_brand?: string;\n product_price?: number;\n product_quantity?: number;\n product_variant_id?: string;\n product_variant?: string;\n line_items?: LineItem[];\n search_query?: string;\n video_title?: string;\n lead_type?: string;\n opt_out_type?: 'LDP';\n [key: string]: unknown;\n}\n\nexport interface LineItem {\n product_name?: string;\n product_id?: string;\n product_category?: string;\n product_brand?: string;\n product_price?: number;\n product_quantity?: number;\n product_variant_id?: string;\n product_variant?: string;\n [key: string]: unknown;\n}\n\n/**\n * Destination-level settings.\n *\n * @property apiKey — Pinterest Tag ID (numeric string). Required. Passed\n * to pintrk('load', tagId) on init.\n * @property pageview — Fire pintrk('page') once in init after core.js\n * loads. Default true (matches Pinterest's base code convention).\n * Set false when walkerOS sources already emit page view events and\n * you would otherwise get a duplicate initial fire.\n * @property identify — walkerOS mapping value resolving to IdentifyFields.\n * Enhanced matching data for pintrk('load', tagId, data) and subsequent\n * pintrk('set', data) calls when the resolved identity changes.\n * @property include — walkerOS event sections forwarded as prefixed\n * properties in the track event data. Pinterest strongly prefers\n * explicit mapping.data over include — include is a fallback for\n * forwarding auxiliary context.\n */\nexport interface Settings {\n apiKey: string;\n pageview?: boolean;\n identify?: WalkerOSMapping.Value;\n /**\n * Runtime-only state. Not serialized to schema, not configurable by users.\n * The destination uses this to diff enhanced matching across pushes and\n * to suppress track() calls after consent revocation.\n */\n _state?: {\n lastIdentify?: IdentifyFields;\n consentGranted?: boolean;\n };\n}\n\nexport type InitSettings = Partial<Settings>;\n\n/**\n * Per-event mapping settings (on rule.settings).\n *\n * @property identify — Per-event identity override. Resolves to\n * IdentifyFields passed to pintrk('set', data).\n * @property include — Overrides destination-level include for this rule.\n */\nexport interface Mapping {\n identify?: WalkerOSMapping.Value;\n}\n\n/**\n * Env — mock surface for tests. Pinterest Tag uses window.pintrk, so\n * the env extends DestinationWeb.Env (which already provides window\n * and document).\n */\nexport interface Env extends DestinationWeb.Env {\n window: {\n pintrk?: Pintrk;\n };\n}\n\nexport type Types = CoreDestination.Types<Settings, Mapping, Env, InitSettings>;\n\nexport type Destination = DestinationWeb.Destination<Types>;\nexport type Config = DestinationWeb.Config<Types>;\n\nexport interface PinterestDestination extends Destination {\n env?: Env;\n}\n\nexport type Rule = WalkerOSMapping.Rule<Mapping>;\nexport type Rules = WalkerOSMapping.Rules<Rule>;\n"],"mappings":";AACA,SAAS,cAAc;AACvB,SAAS,iBAAiB,UAAU,gBAAgB;;;ACFpD;;;ADeA,IAAM,uBAAuB;AAO7B,SAAS,mBAAmB,KAAgC;AAC1D,QAAM,EAAE,OAAO,IAAI,OAAO,GAAG;AAC7B,QAAM,IAAI;AACV,MAAI,EAAE,OAAQ;AACd,QAAM,QAAqB,CAAC;AAC5B,QAAM,MAAM,IAAI,SAAoB;AAClC,IAAC,EAAE,OAAQ,MAAsB,KAAK,IAAI;AAAA,EAC5C;AACA,KAAG,QAAQ;AACX,KAAG,UAAU;AACb,IAAE,SAAS;AACb;AAMA,SAAS,UAAU,KAAgC;AACjD,QAAM,EAAE,SAAS,IAAI,OAAO,GAAG;AAC/B,QAAM,MAAM;AACZ,QAAM,SAAS,IAAI,cAAc,QAAQ;AACzC,SAAO,MAAM;AACb,SAAO,QAAQ;AACf,MAAI,KAAK,YAAY,MAAM;AAC7B;AAMA,eAAe,gBACb,OACA,cACA,WACqC;AACrC,MAAI,iBAAiB,UAAa,iBAAiB,KAAM,QAAO;AAChE,QAAM,WAAW,MAAM;AAAA,IACrB;AAAA,IACA;AAAA,IACA,EAAE,UAAU;AAAA,EACd;AACA,MAAI,CAAC,SAAS,QAAQ,EAAG,QAAO;AAChC,QAAM,SAAyB,CAAC;AAChC,QAAM,KAAM,SAAqC;AACjD,QAAM,cAAe,SAAqC;AAC1D,MAAI,SAAS,EAAE,KAAK,GAAI,QAAO,KAAK;AACpC,MAAI,SAAS,WAAW,KAAK,YAAa,QAAO,cAAc;AAC/D,SAAO,OAAO,KAAK,MAAM,EAAE,SAAS,IAAI,SAAS;AACnD;AAMA,SAAS,cAAc,GAAoB,GAA6B;AACtE,MAAI,CAAC,KAAK,CAAC,EAAG,QAAO;AACrB,MAAI,CAAC,KAAK,CAAC,E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CAAC;AAEL,UAAM,YAAuB;AAAA,MAC3B,GAAI,MAAM,KAAK,EAAE,UAAU,MAAM,GAAG,IAAI,CAAC;AAAA,MACzC,GAAG;AAAA,IACL;AAEA,WAAO,SAAS,WAAW,SAAS;AAAA,EACtC;AAAA,EAEA,GAAG,MAAM,SAAS;AAvJpB;AAwJI,QAAI,SAAS,aAAa,CAAC,QAAQ,KAAM;AACzC,UAAM,YAAW,aAAQ,WAAR,mBAAgB;AACjC,QAAI,CAAC,SAAU;AAEf,UAAM,UAAU,QAAQ;AACxB,UAAM,YAAW,aAAQ,WAAR,mBAAgB;AACjC,QAAI,CAAC,SAAU;AAEf,UAAM,OAAO,OAAO,KAAK,QAAQ;AACjC,QAAI,KAAK,WAAW,EAAG;AAIvB,QAAI,YAAY;AAChB,QAAI,aAAa;AACjB,eAAW,OAAO,MAAM;AACtB,UAAI,QAAQ,GAAG,MAAM,KAAM;AAC3B,UAAI,QAAQ,GAAG,MAAM,OAAO;AAC1B,oBAAY;AACZ,qBAAa;AAAA,MACf,OAAO;AAEL,qBAAa;AAAA,MACf;AAAA,IACF;AAEA,UAAM,QAAS,SAAS,WAAT,SAAS,SAAW,EAAE,gBAAgB,KAAK;AAC1D,QAAI,WAAW;AACb,YAAM,iBAAiB;AAAA,IACzB,WAAW,YAAY;AACrB,YAAM,iBAAiB;AAAA,IACzB;AAAA,EACF;AACF;AAEA,IAAO,gBAAQ;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/types/index.ts"],"sourcesContent":["import type { DestinationWeb } from '@walkeros/web-core';\nimport { getEnv, loadVendor } from '@walkeros/web-core';\nimport {\n getGrantedConsent,\n getMappingValue,\n isObject,\n isString,\n StepError,\n stepCall,\n} from '@walkeros/core';\nimport type { Collector, Logger, Mapping, WalkerOS } from '@walkeros/core';\nimport type {\n Destination,\n EventData,\n IdentifyFields,\n Pintrk,\n Settings,\n} from './types';\n\n// Types export\nexport * as DestinationPinterest from './types';\n\nconst PINTEREST_SCRIPT_SRC = 'https://s.pinimg.com/ct/core.js';\n\n/**\n * Install the Pinterest `window.pintrk` queue shim. Mirrors the official\n * snippet - any call made before core.js loads is pushed onto `pintrk.queue`,\n * which the real script processes once it initializes. Idempotent.\n */\nfunction installPintrkQueue(env?: DestinationWeb.Env): void {\n const { window } = getEnv(env);\n if (window.pintrk) return;\n const pintrk: Pintrk = Object.assign(\n (...args: unknown[]) => {\n pintrk.queue?.push(args);\n },\n { queue: [], version: '3.0' },\n );\n window.pintrk = pintrk;\n}\n\n/** The pintrk queue or tag, or a StepError when it is not there. */\nfunction getPintrk(env?: DestinationWeb.Env): Pintrk {\n const { pintrk } = getEnv(env).window;\n if (!pintrk)\n throw new StepError('Pinterest Tag not ready: pintrk is missing', {\n code: 'vendor-not-ready',\n });\n return pintrk;\n}\n\n/**\n * The core.js script `loadVendor` injects unless `loadScript` is false.\n * pintrk replays its own queue, so it is called synchronously and only a\n * failed script is reported.\n */\nfunction vendor(\n config: { loadScript?: boolean; timeout?: number },\n env?: DestinationWeb.Env,\n) {\n return loadVendor(\n config.loadScript !== false ? PINTEREST_SCRIPT_SRC : undefined,\n () => getEnv(env).window.pintrk,\n { timeout: config.timeout, document: getEnv(env).document },\n );\n}\n\n/**\n * Resolve an identify mapping value into IdentifyFields. Strict allow-list:\n * only `em` and `external_id` pass through.\n */\nasync function resolveIdentify(\n event: WalkerOS.Event,\n mappingValue: Mapping.Value | undefined,\n collector: Collector.Instance,\n): Promise<IdentifyFields | undefined> {\n if (mappingValue === undefined || mappingValue === null) return undefined;\n const resolved = await getMappingValue(event, mappingValue, { collector });\n if (!isObject(resolved)) return undefined;\n const fields: IdentifyFields = {};\n const { em, external_id } = resolved;\n if (isString(em) && em) fields.em = em;\n if (isString(external_id) && external_id) fields.external_id = external_id;\n return Object.keys(fields).length > 0 ? fields : undefined;\n}\n\n/**\n * Shallow-equal compare two IdentifyFields - used to suppress redundant\n * pintrk('set', ...) calls when the resolved identity has not changed.\n */\nfunction identifyEqual(a?: IdentifyFields, b?: IdentifyFields): boolean {\n if (!a && !b) return true;\n if (!a || !b) return false;\n return a.em === b.em && a.external_id === b.external_id;\n}\n\n/**\n * A configured mapping that resolved to nothing skips its call: a declared\n * skip, said once at DEBUG with the event and the mapping key, never the\n * value, so a wrong mapping path does not look like an event without data.\n */\nfunction skipped(\n logger: Logger.Instance,\n event: WalkerOS.Event,\n call: string,\n key: string,\n): void {\n logger.debug(`Pinterest skipped ${call}: ${key} resolved to nothing`, {\n event: event.name,\n });\n}\n\nexport const destinationPinterest: Destination = {\n type: 'pinterest',\n\n config: {},\n\n async init({ config, env }) {\n // A copy, so adding the runtime state below does not write onto the live settings\n const settings = { ...config.settings };\n if (!settings.apiKey)\n throw new StepError('Pinterest needs settings.apiKey', {\n code: 'config',\n });\n const { apiKey } = settings;\n\n const pageview = settings.pageview !== false;\n\n installPintrkQueue(env);\n vendor(config, env);\n\n const pintrk = getPintrk(env);\n\n await stepCall(\n () => pintrk('load', apiKey),\n 'vendor-not-ready',\n 'Pinterest load call failed',\n );\n if (pageview)\n await stepCall(\n () => pintrk('page'),\n 'vendor-not-ready',\n 'Pinterest page call failed',\n );\n\n // Seed runtime state (mutation is allowed on Settings._state).\n return {\n ...config,\n settings: {\n ...settings,\n _state: { lastIdentify: undefined, consentGranted: true },\n },\n };\n },\n\n async push(event, { config, rule, data, env, collector, logger }) {\n vendor(config, env).check();\n\n const settings: Partial<Settings> = config.settings || {};\n const state = (settings._state ||= { consentGranted: true });\n\n const pintrk = getPintrk(env);\n\n // Consent revoked: suppress. This is the consent state, not a failure.\n if (state.consentGranted !== false) {\n // 1. Identity - per-event override falls back to destination-level.\n // A silent rule whose identify resolves nothing (or an identity that\n // is already current) sends nothing: a declared skip, not a failure.\n const identifyMapping = rule?.settings?.identify ?? settings.identify;\n const identify = await resolveIdentify(event, identifyMapping, collector);\n if (!identify) {\n if (identifyMapping !== undefined)\n skipped(logger, event, 'set', 'identify');\n } else if (!identifyEqual(identify, state.lastIdentify)) {\n await stepCall(\n () => pintrk('set', identify),\n 'transport',\n 'Pinterest set call failed',\n );\n state.lastIdentify = identify;\n }\n\n // 2. Silent - process identity (above) but suppress the default track.\n if (rule?.silent !== true) {\n // 3. Track\n const eventName = isString(rule?.name) ? rule.name : event.name;\n\n // context.data contains both include-flattened and mapping.data-resolved\n // properties. Include is the bottom layer, mapping.data wins on conflict.\n const contextData: Record<string, unknown> = isObject(data) ? data : {};\n\n const eventData: EventData = {\n ...(event.id ? { event_id: event.id } : {}),\n ...contextData,\n };\n\n await stepCall(\n () => pintrk('track', eventName, eventData),\n 'transport',\n 'Pinterest track call failed',\n );\n }\n }\n },\n\n // Pinterest has no consent API: the destination stops its own sends. The\n // destination's required consent decides on the whole consent state, as\n // it gates the pushes, and only a change that names a required key counts.\n on(type, { config, data, collector }) {\n const required = config.consent;\n if (type !== 'consent' || !required || !isObject(data)) return;\n if (!Object.keys(required).some((key) => key in data)) return;\n const settings = config.settings;\n if (!isObject(settings)) return;\n\n const state = isObject(settings._state)\n ? settings._state\n : (settings._state = { consentGranted: true });\n state.consentGranted =\n getGrantedConsent(required, collector.consent) !== false;\n },\n};\n\nexport default destinationPinterest;\n","import type {\n Mapping as WalkerOSMapping,\n Destination as CoreDestination,\n} from '@walkeros/core';\nimport type { DestinationWeb } from '@walkeros/web-core';\n\n/**\n * Pinterest Tag global. The queue-based function created by the Pinterest\n * snippet. Before core.js loads, calls are queued on `pintrk.queue`.\n * After core.js resolves the queue, `pintrk` is replaced with the real\n * implementation. Both shapes accept the same argument signatures.\n */\nexport interface Pintrk {\n (command: 'load', tagId: string, identify?: IdentifyFields): void;\n (command: 'page'): void;\n (\n command: 'track',\n eventName: string,\n eventData?: EventData,\n callback?: (didInit: boolean, error?: unknown) => void,\n ): void;\n (command: 'set', userData: IdentifyFields): void;\n queue?: unknown[][];\n version?: string;\n}\n\ndeclare global {\n interface Window {\n pintrk?: Pintrk;\n }\n}\n\n/**\n * Pinterest standard event taxonomy. See Pinterest Tag documentation.\n * Client-side names are lowercase concatenated strings (addtocart,\n * not add_to_cart). Sending the wrong name means the event will not\n * appear correctly in Pinterest's conversion reports.\n */\nexport type StandardEventName =\n | 'pagevisit'\n | 'viewcategory'\n | 'search'\n | 'addtocart'\n | 'checkout'\n | 'watchvideo'\n | 'signup'\n | 'lead'\n | 'addpaymentinfo'\n | 'addtowishlist'\n | 'initiatecheckout'\n | 'subscribe'\n | 'viewcontent'\n | 'contact'\n | 'customizeproduct'\n | 'findlocation'\n | 'schedule'\n | 'starttrial'\n | 'submitapplication'\n | 'custom';\n\n/** Open union — any string is still passed through to pintrk. */\nexport type EventName = StandardEventName | (string & {});\n\n/**\n * Enhanced matching fields. Web destination strictly limits to the two\n * documented client-side Pinterest Tag fields. CAPI-only fields (ph, fn,\n * ln, address, country, ip, ua) belong to a future server destination\n * and are intentionally not accepted here.\n *\n * The Pinterest JS tag auto-hashes `em` with SHA-256 before transmission —\n * the destination does NOT hash.\n */\nexport interface IdentifyFields {\n em?: string;\n external_id?: string;\n}\n\n/**\n * Event data payload for pintrk('track', ...). Pinterest has a prescribed\n * set of parameter names. Common parameters across events plus an open\n * `[key: string]: unknown` for event-specific fields (search_query,\n * video_title, lead_type, opt_out_type, custom properties, etc.).\n */\nexport interface EventData {\n value?: number;\n order_quantity?: number;\n currency?: string;\n event_id?: string;\n order_id?: string;\n promo_code?: string;\n property?: string;\n product_name?: string;\n product_id?: string;\n product_category?: string;\n product_brand?: string;\n product_price?: number;\n product_quantity?: number;\n product_variant_id?: string;\n product_variant?: string;\n line_items?: LineItem[];\n search_query?: string;\n video_title?: string;\n lead_type?: string;\n opt_out_type?: 'LDP';\n [key: string]: unknown;\n}\n\nexport interface LineItem {\n product_name?: string;\n product_id?: string;\n product_category?: string;\n product_brand?: string;\n product_price?: number;\n product_quantity?: number;\n product_variant_id?: string;\n product_variant?: string;\n [key: string]: unknown;\n}\n\n/**\n * Destination-level settings.\n *\n * @property apiKey — Pinterest Tag ID (numeric string). Required. Passed\n * to pintrk('load', tagId) on init.\n * @property pageview — Fire pintrk('page') once in init after core.js\n * loads. Default true (matches Pinterest's base code convention).\n * Set false when walkerOS sources already emit page view events and\n * you would otherwise get a duplicate initial fire.\n * @property identify — walkerOS mapping value resolving to IdentifyFields.\n * Enhanced matching data for pintrk('load', tagId, data) and subsequent\n * pintrk('set', data) calls when the resolved identity changes.\n * @property include — walkerOS event sections forwarded as prefixed\n * properties in the track event data. Pinterest strongly prefers\n * explicit mapping.data over include — include is a fallback for\n * forwarding auxiliary context.\n */\nexport interface Settings {\n apiKey: string;\n pageview?: boolean;\n identify?: WalkerOSMapping.Value;\n /**\n * Runtime-only state. Not serialized to schema, not configurable by users.\n * The destination uses this to diff enhanced matching across pushes and\n * to suppress track() calls after consent revocation.\n */\n _state?: {\n lastIdentify?: IdentifyFields;\n consentGranted?: boolean;\n };\n}\n\nexport type InitSettings = Partial<Settings>;\n\n/**\n * Per-event mapping settings (on rule.settings).\n *\n * @property identify — Per-event identity override. Resolves to\n * IdentifyFields passed to pintrk('set', data).\n * @property include — Overrides destination-level include for this rule.\n */\nexport interface Mapping {\n identify?: WalkerOSMapping.Value;\n}\n\n/**\n * Env — mock surface for tests. Pinterest Tag uses window.pintrk, so\n * the env extends DestinationWeb.Env (which already provides window\n * and document).\n */\nexport interface Env extends DestinationWeb.Env {\n window: {\n pintrk?: Pintrk;\n };\n}\n\nexport type Types = CoreDestination.Types<Settings, Mapping, Env, InitSettings>;\n\nexport type Destination = DestinationWeb.Destination<Types>;\nexport type Config = DestinationWeb.Config<Types>;\n\nexport interface PinterestDestination extends Destination {\n env?: Env;\n}\n\nexport type Rule = WalkerOSMapping.Rule<Mapping>;\nexport type Rules = WalkerOSMapping.Rules<Rule>;\n"],"mappings":";AACA,SAAS,QAAQ,kBAAkB;AACnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACTP;;;ADsBA,IAAM,uBAAuB;AAO7B,SAAS,mBAAmB,KA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.8.2",
5
5
  "type": "destination",
6
6
  "platform": [
7
7
  "web"
@@ -48,45 +48,13 @@
48
48
  "examples": {
49
49
  "env": {
50
50
  "init": {
51
- "window": {},
52
- "document": {
53
- "createElement": {
54
- "$code": "()=>({src:\"\",async:!1,dataset:{},setAttribute:()=>{},removeAttribute:()=>{}})"
55
- },
56
- "head": {
57
- "appendChild": {
58
- "$code": "()=>{}"
59
- }
60
- },
61
- "getElementsByTagName": {
62
- "$code": "()=>[{parentNode:{insertBefore:()=>{}}}]"
63
- },
64
- "querySelector": {
65
- "$code": "()=>null"
66
- }
67
- }
51
+ "window": {}
68
52
  },
69
53
  "push": {
70
54
  "window": {
71
55
  "pintrk": {
72
56
  "$code": "()=>{}"
73
57
  }
74
- },
75
- "document": {
76
- "createElement": {
77
- "$code": "()=>({src:\"\",async:!1,dataset:{},setAttribute:()=>{},removeAttribute:()=>{}})"
78
- },
79
- "head": {
80
- "appendChild": {
81
- "$code": "()=>{}"
82
- }
83
- },
84
- "getElementsByTagName": {
85
- "$code": "()=>[{parentNode:{insertBefore:()=>{}}}]"
86
- },
87
- "querySelector": {
88
- "$code": "()=>null"
89
- }
90
58
  }
91
59
  },
92
60
  "simulation": [
@@ -96,6 +64,7 @@
96
64
  "step": {
97
65
  "consentGrant": {
98
66
  "public": false,
67
+ "description": "A grant of the required consent lets the destination send track calls again; Pinterest has no consent call to make.",
99
68
  "command": "consent",
100
69
  "in": {
101
70
  "marketing": true
@@ -104,6 +73,7 @@
104
73
  },
105
74
  "consentRevoke": {
106
75
  "public": false,
76
+ "description": "For a destination with config.consent { marketing: true }, revoking marketing makes no vendor call: the destination stops sending track calls itself.",
107
77
  "command": "consent",
108
78
  "in": {
109
79
  "marketing": false
@@ -247,6 +217,27 @@
247
217
  ]
248
218
  ]
249
219
  },
220
+ "identifyOnlySilentWithoutData": {
221
+ "public": false,
222
+ "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.",
223
+ "in": {
224
+ "name": "user update",
225
+ "entity": "user",
226
+ "action": "update"
227
+ },
228
+ "mapping": {
229
+ "silent": true,
230
+ "settings": {
231
+ "identify": {
232
+ "map": {
233
+ "em": "data.email",
234
+ "external_id": "data.id"
235
+ }
236
+ }
237
+ }
238
+ },
239
+ "out": []
240
+ },
250
241
  "orderCompleteCheckout": {
251
242
  "title": "Checkout",
252
243
  "description": "A completed order fires Pinterest checkout with value, order_id, currency, and a nested line_items array.",
@@ -257,7 +248,7 @@
257
248
  "currency": "EUR",
258
249
  "shipping": 5.22,
259
250
  "taxes": 73.76,
260
- "total": 555
251
+ "value": 555
261
252
  },
262
253
  "context": {
263
254
  "shopping": [
@@ -344,7 +335,7 @@
344
335
  "name": "checkout",
345
336
  "data": {
346
337
  "map": {
347
- "value": "data.total",
338
+ "value": "data.value",
348
339
  "order_id": "data.id",
349
340
  "currency": {
350
341
  "key": "data.currency",
@@ -355,7 +346,7 @@
355
346
  "nested",
356
347
  {
357
348
  "condition": {
358
- "$code": "e=>{var t;return\"number\"==typeof(null==(t=null==e?void 0:e.data)?void 0:t.price)}"
349
+ "$code": "e=>w(e)&&w(e.data)&&\"number\"==typeof e.data.price"
359
350
  },
360
351
  "map": {
361
352
  "product_id": "data.id",
@@ -638,6 +629,67 @@
638
629
  ]
639
630
  ]
640
631
  },
632
+ "silentRule": {
633
+ "public": false,
634
+ "description": "A rule with silent: true sends no pintrk track call.",
635
+ "in": {
636
+ "name": "page view",
637
+ "data": {
638
+ "string": "foo",
639
+ "number": 1,
640
+ "boolean": true,
641
+ "array": [
642
+ 0,
643
+ "text",
644
+ false
645
+ ]
646
+ },
647
+ "context": {
648
+ "dev": [
649
+ "test",
650
+ 1
651
+ ]
652
+ },
653
+ "globals": {
654
+ "lang": "elb"
655
+ },
656
+ "custom": {
657
+ "completely": "random"
658
+ },
659
+ "user": {
660
+ "id": "us3r",
661
+ "device": "c00k13",
662
+ "session": "s3ss10n"
663
+ },
664
+ "nested": [
665
+ {
666
+ "entity": "child",
667
+ "data": {
668
+ "is": "subordinated"
669
+ }
670
+ }
671
+ ],
672
+ "consent": {
673
+ "functional": true
674
+ },
675
+ "id": "20de9782ccef5444",
676
+ "trigger": "test",
677
+ "entity": "page",
678
+ "action": "view",
679
+ "timestamp": 1700000109,
680
+ "timing": 3.14,
681
+ "source": {
682
+ "count": 1,
683
+ "trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
684
+ "type": "collector",
685
+ "schema": "4"
686
+ }
687
+ },
688
+ "mapping": {
689
+ "silent": true
690
+ },
691
+ "out": []
692
+ },
641
693
  "siteSearch": {
642
694
  "title": "Search",
643
695
  "description": "A site search fires Pinterest search with the search_query field resolved from event data.",
@@ -837,7 +889,7 @@
837
889
  "consent": {
838
890
  "functional": true
839
891
  },
840
- "id": "d8196612ff40e02a",
892
+ "id": "eab6e141f01b8a59",
841
893
  "trigger": "test",
842
894
  "entity": "debug",
843
895
  "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.1",
4
+ "version": "4.8.2",
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.1",
42
- "@walkeros/web-core": "4.8.1"
41
+ "@walkeros/core": "4.8.2",
42
+ "@walkeros/web-core": "4.8.2"
43
43
  },
44
44
  "devDependencies": {
45
- "@walkeros/collector": "4.8.1"
45
+ "@walkeros/collector": "4.8.2"
46
46
  },
47
47
  "repository": {
48
48
  "url": "git+https://github.com/elbwalker/walkerOS.git",