@walkeros/web-destination-linkedin 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/CHANGELOG.md +33 -0
- package/README.md +1 -1
- package/dist/dev.d.mts +10 -5
- package/dist/dev.d.ts +10 -5
- 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 +9 -4
- package/dist/examples/index.d.ts +9 -4
- package/dist/examples/index.js +17 -34
- package/dist/examples/index.mjs +18 -35
- package/dist/index.browser.js +1 -1
- package/dist/index.d.mts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.es5.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/walkerOS.json +24 -36
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @walkeros/web-destination-linkedin
|
|
2
2
|
|
|
3
|
+
## 4.8.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2374f54: A failed vendor call, a missing required setting (`config`) and an
|
|
8
|
+
event that cannot be sent (`missing-input`) are reported as failed pushes,
|
|
9
|
+
with the dead-letter queue and one ERROR line, instead of counting as
|
|
10
|
+
delivered. Rules with `silent: true` send no event. Settings schemas reject
|
|
11
|
+
unknown keys.
|
|
12
|
+
- b1d65e2: Web destinations that load a vendor script inject it through the
|
|
13
|
+
document of their `env`, so simulation and server-side rendering work without
|
|
14
|
+
a browser page. A page still gets the script in its own document by default,
|
|
15
|
+
and a missing document fails the push with `vendor-not-ready`.
|
|
16
|
+
- 2374f54: Vendor scripts load through walkerOS: a blocked or slow script fails
|
|
17
|
+
later events visibly (`vendor-not-loaded`, `vendor-timeout`) instead of losing
|
|
18
|
+
them. Pushes made while the script loads wait for it, and each script is
|
|
19
|
+
injected once per page.
|
|
20
|
+
- Updated dependencies [2374f54]
|
|
21
|
+
- Updated dependencies [7e5fc27]
|
|
22
|
+
- Updated dependencies [2374f54]
|
|
23
|
+
- Updated dependencies [964590a]
|
|
24
|
+
- Updated dependencies [4100ede]
|
|
25
|
+
- Updated dependencies [2374f54]
|
|
26
|
+
- Updated dependencies [2374f54]
|
|
27
|
+
- Updated dependencies [15eb7b2]
|
|
28
|
+
- Updated dependencies [33a2779]
|
|
29
|
+
- Updated dependencies [33a2779]
|
|
30
|
+
- Updated dependencies [b1d65e2]
|
|
31
|
+
- Updated dependencies [964590a]
|
|
32
|
+
- Updated dependencies [2374f54]
|
|
33
|
+
- @walkeros/core@4.8.2
|
|
34
|
+
- @walkeros/web-core@4.8.2
|
|
35
|
+
|
|
3
36
|
## 4.8.1
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
package/README.md
CHANGED
package/dist/dev.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ import { Flow } from '@walkeros/core';
|
|
|
5
5
|
|
|
6
6
|
declare const SettingsSchema: z.ZodObject<{
|
|
7
7
|
apiKey: z.ZodString;
|
|
8
|
-
}, z.core.$
|
|
8
|
+
}, z.core.$strict>;
|
|
9
9
|
type Settings$1 = z.infer<typeof SettingsSchema>;
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -80,8 +80,6 @@ interface Settings {
|
|
|
80
80
|
* `window._linkedin_partner_id` / `window._linkedin_data_partner_ids` and
|
|
81
81
|
* installs `window.lintrk` in init; tests can pre-seed `window.lintrk` with
|
|
82
82
|
* a spy to skip the script injection path.
|
|
83
|
-
*
|
|
84
|
-
* `document` is also mocked so `addScript()` can run headlessly.
|
|
85
83
|
*/
|
|
86
84
|
interface Env extends DestinationWeb.Env {
|
|
87
85
|
window: {
|
|
@@ -188,7 +186,7 @@ declare const demoRequestLead: LinkedInStepExample;
|
|
|
188
186
|
*/
|
|
189
187
|
declare const conversionSilenced: LinkedInStepExample;
|
|
190
188
|
/**
|
|
191
|
-
* Falsy `id` → entire lintrk call is skipped.
|
|
189
|
+
* Falsy `id` → entire lintrk call is skipped and the push fails missing-input.
|
|
192
190
|
*
|
|
193
191
|
* If the resolved conversion object has no truthy `id`, the destination does
|
|
194
192
|
* NOT call lintrk at all. This protects against misconfigured mappings
|
|
@@ -206,8 +204,15 @@ declare const missingConversionIdIgnored: LinkedInStepExample;
|
|
|
206
204
|
* `event_id` appear in the final call - no `conversion_value`, no `currency`.
|
|
207
205
|
*/
|
|
208
206
|
declare const partialFieldsOmitted: LinkedInStepExample;
|
|
207
|
+
/**
|
|
208
|
+
* A revocation of the consent the destination requires. The Insight Tag has
|
|
209
|
+
* no vendor consent mode, so the collector's consent gate is the only
|
|
210
|
+
* mechanism and no vendor call is made.
|
|
211
|
+
*/
|
|
212
|
+
declare const consentRevoke: LinkedInStepExample;
|
|
209
213
|
|
|
210
214
|
type step_LinkedInStepExample = LinkedInStepExample;
|
|
215
|
+
declare const step_consentRevoke: typeof consentRevoke;
|
|
211
216
|
declare const step_conversionSilenced: typeof conversionSilenced;
|
|
212
217
|
declare const step_demoRequestLead: typeof demoRequestLead;
|
|
213
218
|
declare const step_missingConversionIdIgnored: typeof missingConversionIdIgnored;
|
|
@@ -217,7 +222,7 @@ declare const step_partialFieldsOmitted: typeof partialFieldsOmitted;
|
|
|
217
222
|
declare const step_simpleConversionId: typeof simpleConversionId;
|
|
218
223
|
declare const step_unmappedEventIgnored: typeof unmappedEventIgnored;
|
|
219
224
|
declare namespace step {
|
|
220
|
-
export { type step_LinkedInStepExample as LinkedInStepExample, step_conversionSilenced as conversionSilenced, step_demoRequestLead as demoRequestLead, step_missingConversionIdIgnored as missingConversionIdIgnored, step_orderCompleteFullConversion as orderCompleteFullConversion, step_pageViewConversion as pageViewConversion, step_partialFieldsOmitted as partialFieldsOmitted, step_simpleConversionId as simpleConversionId, step_unmappedEventIgnored as unmappedEventIgnored };
|
|
225
|
+
export { type step_LinkedInStepExample as LinkedInStepExample, step_consentRevoke as consentRevoke, step_conversionSilenced as conversionSilenced, step_demoRequestLead as demoRequestLead, step_missingConversionIdIgnored as missingConversionIdIgnored, step_orderCompleteFullConversion as orderCompleteFullConversion, step_pageViewConversion as pageViewConversion, step_partialFieldsOmitted as partialFieldsOmitted, step_simpleConversionId as simpleConversionId, step_unmappedEventIgnored as unmappedEventIgnored };
|
|
221
226
|
}
|
|
222
227
|
|
|
223
228
|
declare const index_env: typeof env;
|
package/dist/dev.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Flow } from '@walkeros/core';
|
|
|
5
5
|
|
|
6
6
|
declare const SettingsSchema: z.ZodObject<{
|
|
7
7
|
apiKey: z.ZodString;
|
|
8
|
-
}, z.core.$
|
|
8
|
+
}, z.core.$strict>;
|
|
9
9
|
type Settings$1 = z.infer<typeof SettingsSchema>;
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -80,8 +80,6 @@ interface Settings {
|
|
|
80
80
|
* `window._linkedin_partner_id` / `window._linkedin_data_partner_ids` and
|
|
81
81
|
* installs `window.lintrk` in init; tests can pre-seed `window.lintrk` with
|
|
82
82
|
* a spy to skip the script injection path.
|
|
83
|
-
*
|
|
84
|
-
* `document` is also mocked so `addScript()` can run headlessly.
|
|
85
83
|
*/
|
|
86
84
|
interface Env extends DestinationWeb.Env {
|
|
87
85
|
window: {
|
|
@@ -188,7 +186,7 @@ declare const demoRequestLead: LinkedInStepExample;
|
|
|
188
186
|
*/
|
|
189
187
|
declare const conversionSilenced: LinkedInStepExample;
|
|
190
188
|
/**
|
|
191
|
-
* Falsy `id` → entire lintrk call is skipped.
|
|
189
|
+
* Falsy `id` → entire lintrk call is skipped and the push fails missing-input.
|
|
192
190
|
*
|
|
193
191
|
* If the resolved conversion object has no truthy `id`, the destination does
|
|
194
192
|
* NOT call lintrk at all. This protects against misconfigured mappings
|
|
@@ -206,8 +204,15 @@ declare const missingConversionIdIgnored: LinkedInStepExample;
|
|
|
206
204
|
* `event_id` appear in the final call - no `conversion_value`, no `currency`.
|
|
207
205
|
*/
|
|
208
206
|
declare const partialFieldsOmitted: LinkedInStepExample;
|
|
207
|
+
/**
|
|
208
|
+
* A revocation of the consent the destination requires. The Insight Tag has
|
|
209
|
+
* no vendor consent mode, so the collector's consent gate is the only
|
|
210
|
+
* mechanism and no vendor call is made.
|
|
211
|
+
*/
|
|
212
|
+
declare const consentRevoke: LinkedInStepExample;
|
|
209
213
|
|
|
210
214
|
type step_LinkedInStepExample = LinkedInStepExample;
|
|
215
|
+
declare const step_consentRevoke: typeof consentRevoke;
|
|
211
216
|
declare const step_conversionSilenced: typeof conversionSilenced;
|
|
212
217
|
declare const step_demoRequestLead: typeof demoRequestLead;
|
|
213
218
|
declare const step_missingConversionIdIgnored: typeof missingConversionIdIgnored;
|
|
@@ -217,7 +222,7 @@ declare const step_partialFieldsOmitted: typeof partialFieldsOmitted;
|
|
|
217
222
|
declare const step_simpleConversionId: typeof simpleConversionId;
|
|
218
223
|
declare const step_unmappedEventIgnored: typeof unmappedEventIgnored;
|
|
219
224
|
declare namespace step {
|
|
220
|
-
export { type step_LinkedInStepExample as LinkedInStepExample, step_conversionSilenced as conversionSilenced, step_demoRequestLead as demoRequestLead, step_missingConversionIdIgnored as missingConversionIdIgnored, step_orderCompleteFullConversion as orderCompleteFullConversion, step_pageViewConversion as pageViewConversion, step_partialFieldsOmitted as partialFieldsOmitted, step_simpleConversionId as simpleConversionId, step_unmappedEventIgnored as unmappedEventIgnored };
|
|
225
|
+
export { type step_LinkedInStepExample as LinkedInStepExample, step_consentRevoke as consentRevoke, step_conversionSilenced as conversionSilenced, step_demoRequestLead as demoRequestLead, step_missingConversionIdIgnored as missingConversionIdIgnored, step_orderCompleteFullConversion as orderCompleteFullConversion, step_pageViewConversion as pageViewConversion, step_partialFieldsOmitted as partialFieldsOmitted, step_simpleConversionId as simpleConversionId, step_unmappedEventIgnored as unmappedEventIgnored };
|
|
221
226
|
}
|
|
222
227
|
|
|
223
228
|
declare const index_env: typeof env;
|
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,o=(e,n)=>{for(var t in n)i(e,t,{get:n[t],enumerable:!0})},a={};o(a,{examples:()=>g,schemas:()=>
|
|
1
|
+
"use strict";var e,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,o=(e,n)=>{for(var t in n)i(e,t,{get:n[t],enumerable:!0})},a={};o(a,{examples:()=>g,schemas:()=>s}),module.exports=(e=a,((e,o,a,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let d of t(o))r.call(e,d)||d===a||i(e,d,{get:()=>o[d],enumerable:!(s=n(o,d))||s.enumerable});return e})(i({},"__esModule",{value:!0}),e));var s={};o(s,{MappingSchema:()=>m,SettingsSchema:()=>l,mapping:()=>u,settings:()=>v});var d=require("@walkeros/core/dev"),c=require("@walkeros/core/dev"),l=c.z.object({apiKey:c.z.string().min(1).regex(/^\d+$/,'Must be a numeric LinkedIn Partner ID (digits only, e.g. "123456")').describe("Your LinkedIn Partner ID (numeric string, typically 6 to 7 digits). Find it in Campaign Manager under Insight Tag. Assigned to window._linkedin_partner_id before the Insight Tag script loads (like 1234567).")}).strict(),p=require("@walkeros/core/dev"),m=p.z.object({conversion:p.z.unknown().describe("Resolves to a LinkedIn conversion object with short keys: { id (required number — the Campaign Manager conversion_id), value? (number), currency? (ISO code), eventId? (string for deduplication with a future server/Conversions API destination) }. Events without a resolved id are silently ignored.").optional()}),v=(0,d.zodToSchema)(l),u=(0,d.zodToSchema)(m),g={};o(g,{env:()=>k,step:()=>w});var k={};o(k,{init:()=>_,push:()=>b,simulation:()=>f});var _={window:{_linkedin_partner_id:void 0,_linkedin_data_partner_ids:void 0,lintrk:void 0}},b={window:{_linkedin_partner_id:"123456",_linkedin_data_partner_ids:["123456"],lintrk:Object.assign(()=>{},{q:[]})}},f=["call:window.lintrk"],w={};o(w,{consentRevoke:()=>A,conversionSilenced:()=>q,demoRequestLead:()=>j,missingConversionIdIgnored:()=>C,orderCompleteFullConversion:()=>E,pageViewConversion:()=>O,partialFieldsOmitted:()=>L,simpleConversionId:()=>y,unmappedEventIgnored:()=>I});var h=require("@walkeros/core"),I={public:!1,in:(0,h.getEvent)("product view",{timestamp:1700000100}),out:[]},y={title:"Simple conversion",description:"A form submit fires a LinkedIn lintrk track with only a conversion_id from Campaign Manager.",in:(0,h.createEvent)({name:"form submit",timestamp:1700000101}),mapping:{settings:{conversion:{map:{id:{value:12345}}}}},out:[["lintrk","track",{conversion_id:12345}]]},E={title:"Ecommerce conversion",description:"A completed order fires a LinkedIn lintrk track with conversion_id, value, currency, and event_id for deduplication.",in:(0,h.getEvent)("order complete",{timestamp:1700000102,id:"1700000102abcdef"}),mapping:{settings:{conversion:{map:{id:{value:67890},value:"data.value",currency:{key:"data.currency",value:"EUR"},eventId:"id"}}}},out:[["lintrk","track",{conversion_id:67890,conversion_value:555,currency:"EUR",event_id:"1700000102abcdef"}]]},O={title:"Key page view",description:"A page view fires an explicit lintrk track mapped to a LinkedIn KEY_PAGE_VIEW conversion rule.",in:(0,h.getEvent)("page view",{timestamp:1700000103,id:"1700000103abcdef"}),mapping:{settings:{conversion:{map:{id:{value:11111},eventId:"id"}}}},out:[["lintrk","track",{conversion_id:11111,event_id:"1700000103abcdef"}]]},j={title:"Lead conversion",description:"A demo request fires a LinkedIn lintrk track for a lead conversion with id and event_id only.",in:(0,h.createEvent)({name:"demo request",timestamp:1700000104,id:"1700000104abcdef"}),mapping:{settings:{conversion:{map:{id:{value:44444},eventId:"id"}}}},out:[["lintrk","track",{conversion_id:44444,event_id:"1700000104abcdef"}]]},q={public:!1,in:(0,h.createEvent)({name:"form submit",timestamp:1700000105}),mapping:{silent:!0,settings:{conversion:{map:{id:{value:12345}}}}},out:[]},C={public:!1,description:"A conversion mapping whose id resolves to nothing makes no lintrk call, so the push fails with missing-input instead of counting as delivered.",in:(0,h.createEvent)({name:"form submit",timestamp:1700000106}),mapping:{settings:{conversion:{map:{id:"data.nonexistentField"}}}},out:[],outcome:{status:"failed",code:"missing-input"}},L={public:!1,in:(0,h.getEvent)("order complete",{timestamp:1700000107,id:"1700000107abcdef"}),mapping:{settings:{conversion:{map:{id:{value:67890},value:"data.missingTotal",eventId:"id"}}}},out:[["lintrk","track",{conversion_id:67890,event_id:"1700000107abcdef"}]]},A={public:!1,description:"For a destination with config.consent { marketing: true }, revoking marketing makes no vendor call: the Insight Tag has no consent mode, the collector stops sending.",command:"consent",in:{marketing:!1},out:[]};//# 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.object({\n apiKey: z\n .string()\n .min(1)\n .regex(\n /^\\d+$/,\n 'Must be a numeric LinkedIn Partner ID (digits only, e.g. \"123456\")',\n )\n .describe(\n 'Your LinkedIn Partner ID (numeric string, typically 6 to 7 digits). Find it in Campaign Manager under Insight Tag. Assigned to window._linkedin_partner_id before the Insight Tag script loads (like 1234567).',\n ),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * LinkedIn per-rule mapping schema.\n *\n * Every field on `conversion` is a walkerOS mapping value (static literal,\n * string path, or `{ map, value, key, fn, ... }` object). The schema uses\n * `z.unknown()` for each so users can supply any valid mapping shape — the\n * destination resolves it via `getMappingValue()` at push time.\n */\nexport const MappingSchema = z.object({\n conversion: z\n .unknown()\n .describe(\n 'Resolves to a LinkedIn conversion object with short keys: { id (required number — the Campaign Manager conversion_id), value? (number), currency? (ISO code), eventId? (string for deduplication with a future server/Conversions API destination) }. Events without a resolved id are silently ignored.',\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, Lintrk } from '../types';\n\n/**\n * Example environment configurations for LinkedIn Insight Tag destination.\n *\n * Tests clone `push` and replace `window.lintrk` with a jest.fn() to collect\n * calls. Production leaves `env` undefined — the destination mutates the real\n * `window` object and injects the LinkedIn CDN script via `addScript()`.\n */\n\nconst noop = () => {};\n\n/**\n * Pre-init environment — no LinkedIn state present. The destination's init\n * will populate _linkedin_partner_id and install the lintrk queue.\n */\nexport const init: Env | undefined = {\n window: {\n _linkedin_partner_id: undefined,\n _linkedin_data_partner_ids: undefined,\n lintrk: undefined,\n },\n document: {\n createElement: () => ({\n src: '',\n async: false,\n dataset: {},\n setAttribute: () => {},\n removeAttribute: () => {},\n }),\n head: { appendChild: () => {} },\n querySelector: () => null,\n },\n};\n\n/**\n * Post-init environment — lintrk is a spy-able no-op function carrying the\n * queue shape the real script installs. Tests clone this and replace\n * `window.lintrk` with a jest.fn() before pushing events, so every call is\n * captured.\n */\nexport const push: Env = {\n window: {\n _linkedin_partner_id: '123456',\n _linkedin_data_partner_ids: ['123456'],\n lintrk: Object.assign(noop, { q: [] as unknown[] }) as unknown as Lintrk,\n },\n document: {\n createElement: () => ({\n src: '',\n async: false,\n dataset: {},\n setAttribute: () => {},\n removeAttribute: () => {},\n }),\n head: { appendChild: () => {} },\n querySelector: () => null,\n },\n};\n\n/**\n * Simulation tracking paths — used by CLI `--simulate` to record which\n * function calls happened during an event push.\n */\nexport const simulation = ['call:window.lintrk'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Examples may optionally override destination-level settings for a test.\n * The test runner reads `settings` from the example and merges it into the\n * base destination settings (on top of the fixed `apiKey`). Rarely needed\n * for LinkedIn - conversion config lives on the rule, not destination-level.\n */\nexport type LinkedInStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * OPT-IN: Unmapped event is silently ignored.\n *\n * LinkedIn's core behavioral difference from analytics destinations: events\n * without `mapping.settings.conversion` produce ZERO lintrk() calls. The\n * destination is opt-in - each conversion must reference a pre-created\n * Conversion Rule from Campaign Manager.\n */\nexport const unmappedEventIgnored: LinkedInStepExample = {\n public: false,\n in: getEvent('product view', { timestamp: 1700000100 }),\n out: [],\n};\n\n/**\n * Simplest possible conversion - just a `conversion_id` from Campaign Manager.\n *\n * Form submission → LinkedIn Lead conversion. The mapping resolves `id` as a\n * literal value (no walker event field needed). The destination translates\n * `{ id }` → `lintrk('track', { conversion_id })`.\n */\nexport const simpleConversionId: LinkedInStepExample = {\n title: 'Simple conversion',\n description:\n 'A form submit fires a LinkedIn lintrk track with only a conversion_id from Campaign Manager.',\n in: getEvent('form submit', { timestamp: 1700000101 }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 12345 },\n },\n },\n },\n },\n out: [['lintrk', 'track', { conversion_id: 12345 }]],\n};\n\n/**\n * Full e-commerce conversion - every supported lintrk field populated.\n *\n * mapping config uses short walkerOS keys (`id`, `value`, `currency`, `eventId`);\n * the destination translates them to the vendor parameter names\n * (`conversion_id`, `conversion_value`, `currency`, `event_id`).\n *\n * Currency uses the walkerOS fallback syntax: `{ key, value }` - pull from\n * `data.currency` first, fall back to `\"EUR\"` if absent. The default\n * `order complete` fixture from `getEvent` already sets `data.currency: \"EUR\"`,\n * so the resolved value is \"EUR\" here.\n *\n * `eventId` maps from the walkerOS event.id - stable per event, unique, and\n * ready for deduplication with a future server (Conversions API) destination.\n */\nexport const orderCompleteFullConversion: LinkedInStepExample = {\n title: 'Ecommerce conversion',\n description:\n 'A completed order fires a LinkedIn lintrk track with conversion_id, value, currency, and event_id for deduplication.',\n in: getEvent('order complete', {\n timestamp: 1700000102,\n id: '1700000102abcdef',\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 67890 },\n value: 'data.total',\n currency: { key: 'data.currency', value: 'EUR' },\n eventId: 'id',\n },\n },\n },\n },\n out: [\n [\n 'lintrk',\n 'track',\n {\n conversion_id: 67890,\n conversion_value: 555,\n currency: 'EUR',\n event_id: '1700000102abcdef',\n },\n ],\n ],\n};\n\n/**\n * Page view as an explicit conversion.\n *\n * LinkedIn's Insight Tag automatically fires a page view on load for\n * retargeting / audience building - that call is NOT something the\n * destination controls. This example tests the OTHER case: mapping a\n * specific walkerOS `page view` event to a Campaign Manager KEY_PAGE_VIEW\n * conversion rule, which fires an EXPLICIT lintrk('track') call in addition\n * to the auto page view.\n */\nexport const pageViewConversion: LinkedInStepExample = {\n title: 'Key page view',\n description:\n 'A page view fires an explicit lintrk track mapped to a LinkedIn KEY_PAGE_VIEW conversion rule.',\n in: getEvent('page view', {\n timestamp: 1700000103,\n id: '1700000103abcdef',\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 11111 },\n eventId: 'id',\n },\n },\n },\n },\n out: [\n [\n 'lintrk',\n 'track',\n {\n conversion_id: 11111,\n event_id: '1700000103abcdef',\n },\n ],\n ],\n};\n\n/**\n * Middle-funnel LEAD conversion - demo request without monetary value.\n *\n * LinkedIn's conversion types include LEAD, CONTACT, SIGN_UP, etc. The\n * destination is agnostic to the type (set in Campaign Manager, not at call\n * time) - all we forward is the conversion_id. This fixture exercises the\n * \"id + eventId only\" shape.\n */\nexport const demoRequestLead: LinkedInStepExample = {\n title: 'Lead conversion',\n description:\n 'A demo request fires a LinkedIn lintrk track for a lead conversion with id and event_id only.',\n in: getEvent('demo request', {\n timestamp: 1700000104,\n id: '1700000104abcdef',\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 44444 },\n eventId: 'id',\n },\n },\n },\n },\n out: [\n [\n 'lintrk',\n 'track',\n {\n conversion_id: 44444,\n event_id: '1700000104abcdef',\n },\n ],\n ],\n};\n\n/**\n * rule.silent - fully-configured conversion rule temporarily disabled.\n *\n * The rule has a valid `conversion.map` but `silent: true` tells the destination\n * to produce zero calls. This is distinct from the opt-in default (no\n * `conversion` at all): silent explicitly keeps the rule on disk for quick\n * reactivation without deleting it.\n */\nexport const conversionSilenced: LinkedInStepExample = {\n public: false,\n in: getEvent('form submit', { timestamp: 1700000105 }),\n mapping: {\n silent: true,\n settings: {\n conversion: {\n map: {\n id: { value: 12345 },\n },\n },\n },\n },\n out: [],\n};\n\n/**\n * Falsy `id` → entire lintrk call is skipped.\n *\n * If the resolved conversion object has no truthy `id`, the destination does\n * NOT call lintrk at all. This protects against misconfigured mappings\n * (e.g. pulling id from a non-existent field).\n *\n * Here we map `id` from `data.nonexistentField` - it resolves to undefined,\n * so zero calls are produced.\n */\nexport const missingConversionIdIgnored: LinkedInStepExample = {\n public: false,\n in: getEvent('form submit', { timestamp: 1700000106 }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: 'data.nonexistentField',\n },\n },\n },\n },\n out: [],\n};\n\n/**\n * Partial conversion - value missing → omitted from the lintrk call.\n *\n * The rule asks for `value: 'data.missingTotal'` (undefined), `currency`\n * (undefined), and `eventId: 'id'` (present). Only `conversion_id` and\n * `event_id` appear in the final call - no `conversion_value`, no `currency`.\n */\nexport const partialFieldsOmitted: LinkedInStepExample = {\n public: false,\n in: getEvent('order complete', {\n timestamp: 1700000107,\n id: '1700000107abcdef',\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 67890 },\n value: 'data.missingTotal',\n eventId: 'id',\n },\n },\n },\n },\n out: [\n [\n 'lintrk',\n 'track',\n {\n conversion_id: 67890,\n event_id: '1700000107abcdef',\n },\n ],\n ],\n};\n"],"mappings":";;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,CAAC;AACR;AAYO,IAAM,6BAAkD;AAAA,EAC7D,QAAQ;AAAA,EACR,QAAI,sBAAS,eAAe,EAAE,WAAW,WAAW,CAAC;AAAA,EACrD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,YAAY;AAAA,QACV,KAAK;AAAA,UACH,IAAI;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK,CAAC;AACR;AASO,IAAM,uBAA4C;AAAA,EACvD,QAAQ;AAAA,EACR,QAAI,sBAAS,kBAAkB;AAAA,IAC7B,WAAW;AAAA,IACX,IAAI;AAAA,EACN,CAAC;AAAA,EACD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,YAAY;AAAA,QACV,KAAK;AAAA,UACH,IAAI,EAAE,OAAO,MAAM;AAAA,UACnB,OAAO;AAAA,UACP,SAAS;AAAA,QACX;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,QACE,eAAe;AAAA,QACf,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AACF;","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"],"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 .min(1)\n .regex(\n /^\\d+$/,\n 'Must be a numeric LinkedIn Partner ID (digits only, e.g. \"123456\")',\n )\n .describe(\n 'Your LinkedIn Partner ID (numeric string, typically 6 to 7 digits). Find it in Campaign Manager under Insight Tag. Assigned to window._linkedin_partner_id before the Insight Tag script loads (like 1234567).',\n ),\n })\n .strict();\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * LinkedIn per-rule mapping schema.\n *\n * Every field on `conversion` is a walkerOS mapping value (static literal,\n * string path, or `{ map, value, key, fn, ... }` object). The schema uses\n * `z.unknown()` for each so users can supply any valid mapping shape — the\n * destination resolves it via `getMappingValue()` at push time.\n */\nexport const MappingSchema = z.object({\n conversion: z\n .unknown()\n .describe(\n 'Resolves to a LinkedIn conversion object with short keys: { id (required number — the Campaign Manager conversion_id), value? (number), currency? (ISO code), eventId? (string for deduplication with a future server/Conversions API destination) }. Events without a resolved id are silently ignored.',\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 } from '../types';\n\n/**\n * Example environment configurations for LinkedIn Insight Tag destination.\n *\n * Tests clone `push` and replace `window.lintrk` with a jest.fn() to collect\n * calls. Production leaves `env` undefined — the destination mutates the real\n * `window` object and injects the LinkedIn CDN script through `loadVendor`.\n */\n\nconst noop = () => {};\n\n/**\n * Pre-init environment — no LinkedIn state present. The destination's init\n * will populate _linkedin_partner_id and install the lintrk queue.\n */\nexport const init: Env | undefined = {\n window: {\n _linkedin_partner_id: undefined,\n _linkedin_data_partner_ids: undefined,\n lintrk: undefined,\n },\n};\n\n/**\n * Post-init environment — lintrk is a spy-able no-op function carrying the\n * queue shape the real script installs. Tests clone this and replace\n * `window.lintrk` with a jest.fn() before pushing events, so every call is\n * captured.\n */\nexport const push: Env = {\n window: {\n _linkedin_partner_id: '123456',\n _linkedin_data_partner_ids: ['123456'],\n lintrk: Object.assign(noop, { q: [] }),\n },\n};\n\n/**\n * Simulation tracking paths — used by CLI `--simulate` to record which\n * function calls happened during an event push.\n */\nexport const simulation = ['call:window.lintrk'];\n","import type { Flow } from '@walkeros/core';\nimport { createEvent, getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Examples may optionally override destination-level settings for a test.\n * The test runner reads `settings` from the example and merges it into the\n * base destination settings (on top of the fixed `apiKey`). Rarely needed\n * for LinkedIn - conversion config lives on the rule, not destination-level.\n */\nexport type LinkedInStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * OPT-IN: Unmapped event is silently ignored.\n *\n * LinkedIn's core behavioral difference from analytics destinations: events\n * without `mapping.settings.conversion` produce ZERO lintrk() calls. The\n * destination is opt-in - each conversion must reference a pre-created\n * Conversion Rule from Campaign Manager.\n */\nexport const unmappedEventIgnored: LinkedInStepExample = {\n public: false,\n in: getEvent('product view', { timestamp: 1700000100 }),\n out: [],\n};\n\n/**\n * Simplest possible conversion - just a `conversion_id` from Campaign Manager.\n *\n * Form submission → LinkedIn Lead conversion. The mapping resolves `id` as a\n * literal value (no walker event field needed). The destination translates\n * `{ id }` → `lintrk('track', { conversion_id })`.\n */\nexport const simpleConversionId: LinkedInStepExample = {\n title: 'Simple conversion',\n description:\n 'A form submit fires a LinkedIn lintrk track with only a conversion_id from Campaign Manager.',\n in: createEvent({ name: 'form submit', timestamp: 1700000101 }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 12345 },\n },\n },\n },\n },\n out: [['lintrk', 'track', { conversion_id: 12345 }]],\n};\n\n/**\n * Full e-commerce conversion - every supported lintrk field populated.\n *\n * mapping config uses short walkerOS keys (`id`, `value`, `currency`, `eventId`);\n * the destination translates them to the vendor parameter names\n * (`conversion_id`, `conversion_value`, `currency`, `event_id`).\n *\n * Currency uses the walkerOS fallback syntax: `{ key, value }` - pull from\n * `data.currency` first, fall back to `\"EUR\"` if absent. The default\n * `order complete` fixture from `getEvent` already sets `data.currency: \"EUR\"`,\n * so the resolved value is \"EUR\" here.\n *\n * `eventId` maps from the walkerOS event.id - stable per event, unique, and\n * ready for deduplication with a future server (Conversions API) destination.\n */\nexport const orderCompleteFullConversion: LinkedInStepExample = {\n title: 'Ecommerce conversion',\n description:\n 'A completed order fires a LinkedIn lintrk track with conversion_id, value, currency, and event_id for deduplication.',\n in: getEvent('order complete', {\n timestamp: 1700000102,\n id: '1700000102abcdef',\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 67890 },\n value: 'data.value',\n currency: { key: 'data.currency', value: 'EUR' },\n eventId: 'id',\n },\n },\n },\n },\n out: [\n [\n 'lintrk',\n 'track',\n {\n conversion_id: 67890,\n conversion_value: 555,\n currency: 'EUR',\n event_id: '1700000102abcdef',\n },\n ],\n ],\n};\n\n/**\n * Page view as an explicit conversion.\n *\n * LinkedIn's Insight Tag automatically fires a page view on load for\n * retargeting / audience building - that call is NOT something the\n * destination controls. This example tests the OTHER case: mapping a\n * specific walkerOS `page view` event to a Campaign Manager KEY_PAGE_VIEW\n * conversion rule, which fires an EXPLICIT lintrk('track') call in addition\n * to the auto page view.\n */\nexport const pageViewConversion: LinkedInStepExample = {\n title: 'Key page view',\n description:\n 'A page view fires an explicit lintrk track mapped to a LinkedIn KEY_PAGE_VIEW conversion rule.',\n in: getEvent('page view', {\n timestamp: 1700000103,\n id: '1700000103abcdef',\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 11111 },\n eventId: 'id',\n },\n },\n },\n },\n out: [\n [\n 'lintrk',\n 'track',\n {\n conversion_id: 11111,\n event_id: '1700000103abcdef',\n },\n ],\n ],\n};\n\n/**\n * Middle-funnel LEAD conversion - demo request without monetary value.\n *\n * LinkedIn's conversion types include LEAD, CONTACT, SIGN_UP, etc. The\n * destination is agnostic to the type (set in Campaign Manager, not at call\n * time) - all we forward is the conversion_id. This fixture exercises the\n * \"id + eventId only\" shape.\n */\nexport const demoRequestLead: LinkedInStepExample = {\n title: 'Lead conversion',\n description:\n 'A demo request fires a LinkedIn lintrk track for a lead conversion with id and event_id only.',\n in: createEvent({\n name: 'demo request',\n timestamp: 1700000104,\n id: '1700000104abcdef',\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 44444 },\n eventId: 'id',\n },\n },\n },\n },\n out: [\n [\n 'lintrk',\n 'track',\n {\n conversion_id: 44444,\n event_id: '1700000104abcdef',\n },\n ],\n ],\n};\n\n/**\n * rule.silent - fully-configured conversion rule temporarily disabled.\n *\n * The rule has a valid `conversion.map` but `silent: true` tells the destination\n * to produce zero calls. This is distinct from the opt-in default (no\n * `conversion` at all): silent explicitly keeps the rule on disk for quick\n * reactivation without deleting it.\n */\nexport const conversionSilenced: LinkedInStepExample = {\n public: false,\n in: createEvent({ name: 'form submit', timestamp: 1700000105 }),\n mapping: {\n silent: true,\n settings: {\n conversion: {\n map: {\n id: { value: 12345 },\n },\n },\n },\n },\n out: [],\n};\n\n/**\n * Falsy `id` → entire lintrk call is skipped and the push fails missing-input.\n *\n * If the resolved conversion object has no truthy `id`, the destination does\n * NOT call lintrk at all. This protects against misconfigured mappings\n * (e.g. pulling id from a non-existent field).\n *\n * Here we map `id` from `data.nonexistentField` - it resolves to undefined,\n * so zero calls are produced.\n */\nexport const missingConversionIdIgnored: LinkedInStepExample = {\n public: false,\n description:\n 'A conversion mapping whose id resolves to nothing makes no lintrk call, so the push fails with missing-input instead of counting as delivered.',\n in: createEvent({ name: 'form submit', timestamp: 1700000106 }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: 'data.nonexistentField',\n },\n },\n },\n },\n out: [],\n outcome: { status: 'failed', code: 'missing-input' },\n};\n\n/**\n * Partial conversion - value missing → omitted from the lintrk call.\n *\n * The rule asks for `value: 'data.missingTotal'` (undefined), `currency`\n * (undefined), and `eventId: 'id'` (present). Only `conversion_id` and\n * `event_id` appear in the final call - no `conversion_value`, no `currency`.\n */\nexport const partialFieldsOmitted: LinkedInStepExample = {\n public: false,\n in: getEvent('order complete', {\n timestamp: 1700000107,\n id: '1700000107abcdef',\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 67890 },\n value: 'data.missingTotal',\n eventId: 'id',\n },\n },\n },\n },\n out: [\n [\n 'lintrk',\n 'track',\n {\n conversion_id: 67890,\n event_id: '1700000107abcdef',\n },\n ],\n ],\n};\n\n/**\n * A revocation of the consent the destination requires. The Insight Tag has\n * no vendor consent mode, so the collector's consent gate is the only\n * mechanism and no vendor call is made.\n */\nexport const consentRevoke: LinkedInStepExample = {\n public: false,\n description:\n 'For a destination with config.consent { marketing: true }, revoking marketing makes no vendor call: the Insight Tag has no consent mode, the collector stops sending.',\n command: 'consent',\n in: { marketing: false },\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,IAAI,CAAC,EACL;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,EACF;AACJ,CAAC,EACA,OAAO;;;ACfV,IAAAC,cAAkB;AAUX,IAAM,gBAAgB,cAAE,OAAO;AAAA,EACpC,YAAY,cACT,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AFTM,IAAM,eAAW,yBAAY,cAAc;AAC3C,IAAM,cAAU,yBAAY,aAAa;;;AGThD;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,IAAM,OAAO,MAAM;AAAC;AAMb,IAAM,OAAwB;AAAA,EACnC,QAAQ;AAAA,IACN,sBAAsB;AAAA,IACtB,4BAA4B;AAAA,IAC5B,QAAQ;AAAA,EACV;AACF;AAQO,IAAM,OAAY;AAAA,EACvB,QAAQ;AAAA,IACN,sBAAsB;AAAA,IACtB,4BAA4B,CAAC,QAAQ;AAAA,IACrC,QAAQ,OAAO,OAAO,MAAM,EAAE,GAAG,CAA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AAS;AAAA,IACP,UAAU;AAAA,MACR,YAAY;AAAA,QACV,KAAK;AAAA,UACH,IAAI;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK,CAAC;AAAA,EACN,SAAS,EAAE,QAAQ,UAAU,MAAM,gBAAgB;AACrD;AASO,IAAM,uBAA4C;AAAA,EACvD,QAAQ;AAAA,EACR,QAAI,sBAAS,kBAAkB;AAAA,IAC7B,WAAW;AAAA,IACX,IAAI;AAAA,EACN,CAAC;AAAA,EACD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,YAAY;AAAA,QACV,KAAK;AAAA,UACH,IAAI,EAAE,OAAO,MAAM;AAAA,UACnB,OAAO;AAAA,UACP,SAAS;AAAA,QACX;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,QACE,eAAe;AAAA,QACf,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AACF;AAOO,IAAM,gBAAqC;AAAA,EAChD,QAAQ;AAAA,EACR,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,MAAM;AAAA,EACvB,KAAK,CAAC;AACR;","names":["import_dev","import_dev"]}
|
package/dist/dev.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,i=(i,n)=>{for(var t in n)e(i,t,{get:n[t],enumerable:!0})},n={};i(n,{MappingSchema:()=>
|
|
1
|
+
var e=Object.defineProperty,i=(i,n)=>{for(var t in n)e(i,t,{get:n[t],enumerable:!0})},n={};i(n,{MappingSchema:()=>s,SettingsSchema:()=>r,mapping:()=>c,settings:()=>d});import{zodToSchema as t}from"@walkeros/core/dev";import{z as o}from"@walkeros/core/dev";var r=o.object({apiKey:o.string().min(1).regex(/^\d+$/,'Must be a numeric LinkedIn Partner ID (digits only, e.g. "123456")').describe("Your LinkedIn Partner ID (numeric string, typically 6 to 7 digits). Find it in Campaign Manager under Insight Tag. Assigned to window._linkedin_partner_id before the Insight Tag script loads (like 1234567).")}).strict();import{z as a}from"@walkeros/core/dev";var s=a.object({conversion:a.unknown().describe("Resolves to a LinkedIn conversion object with short keys: { id (required number — the Campaign Manager conversion_id), value? (number), currency? (ISO code), eventId? (string for deduplication with a future server/Conversions API destination) }. Events without a resolved id are silently ignored.").optional()}),d=t(r),c=t(s),m={};i(m,{env:()=>l,step:()=>g});var l={};i(l,{init:()=>p,push:()=>v,simulation:()=>u});var p={window:{_linkedin_partner_id:void 0,_linkedin_data_partner_ids:void 0,lintrk:void 0}},v={window:{_linkedin_partner_id:"123456",_linkedin_data_partner_ids:["123456"],lintrk:Object.assign(()=>{},{q:[]})}},u=["call:window.lintrk"],g={};i(g,{consentRevoke:()=>A,conversionSilenced:()=>y,demoRequestLead:()=>I,missingConversionIdIgnored:()=>C,orderCompleteFullConversion:()=>w,pageViewConversion:()=>h,partialFieldsOmitted:()=>L,simpleConversionId:()=>b,unmappedEventIgnored:()=>f});import{createEvent as k,getEvent as _}from"@walkeros/core";var f={public:!1,in:_("product view",{timestamp:1700000100}),out:[]},b={title:"Simple conversion",description:"A form submit fires a LinkedIn lintrk track with only a conversion_id from Campaign Manager.",in:k({name:"form submit",timestamp:1700000101}),mapping:{settings:{conversion:{map:{id:{value:12345}}}}},out:[["lintrk","track",{conversion_id:12345}]]},w={title:"Ecommerce conversion",description:"A completed order fires a LinkedIn lintrk track with conversion_id, value, currency, and event_id for deduplication.",in:_("order complete",{timestamp:1700000102,id:"1700000102abcdef"}),mapping:{settings:{conversion:{map:{id:{value:67890},value:"data.value",currency:{key:"data.currency",value:"EUR"},eventId:"id"}}}},out:[["lintrk","track",{conversion_id:67890,conversion_value:555,currency:"EUR",event_id:"1700000102abcdef"}]]},h={title:"Key page view",description:"A page view fires an explicit lintrk track mapped to a LinkedIn KEY_PAGE_VIEW conversion rule.",in:_("page view",{timestamp:1700000103,id:"1700000103abcdef"}),mapping:{settings:{conversion:{map:{id:{value:11111},eventId:"id"}}}},out:[["lintrk","track",{conversion_id:11111,event_id:"1700000103abcdef"}]]},I={title:"Lead conversion",description:"A demo request fires a LinkedIn lintrk track for a lead conversion with id and event_id only.",in:k({name:"demo request",timestamp:1700000104,id:"1700000104abcdef"}),mapping:{settings:{conversion:{map:{id:{value:44444},eventId:"id"}}}},out:[["lintrk","track",{conversion_id:44444,event_id:"1700000104abcdef"}]]},y={public:!1,in:k({name:"form submit",timestamp:1700000105}),mapping:{silent:!0,settings:{conversion:{map:{id:{value:12345}}}}},out:[]},C={public:!1,description:"A conversion mapping whose id resolves to nothing makes no lintrk call, so the push fails with missing-input instead of counting as delivered.",in:k({name:"form submit",timestamp:1700000106}),mapping:{settings:{conversion:{map:{id:"data.nonexistentField"}}}},out:[],outcome:{status:"failed",code:"missing-input"}},L={public:!1,in:_("order complete",{timestamp:1700000107,id:"1700000107abcdef"}),mapping:{settings:{conversion:{map:{id:{value:67890},value:"data.missingTotal",eventId:"id"}}}},out:[["lintrk","track",{conversion_id:67890,event_id:"1700000107abcdef"}]]},A={public:!1,description:"For a destination with config.consent { marketing: true }, revoking marketing makes no vendor call: the Insight Tag has no consent mode, the collector stops sending.",command:"consent",in:{marketing:!1},out:[]};export{m as examples,n 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.object({\n apiKey: z\n .string()\n .min(1)\n .regex(\n /^\\d+$/,\n 'Must be a numeric LinkedIn Partner ID (digits only, e.g. \"123456\")',\n )\n .describe(\n 'Your LinkedIn Partner ID (numeric string, typically 6 to 7 digits). Find it in Campaign Manager under Insight Tag. Assigned to window._linkedin_partner_id before the Insight Tag script loads (like 1234567).',\n ),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * LinkedIn per-rule mapping schema.\n *\n * Every field on `conversion` is a walkerOS mapping value (static literal,\n * string path, or `{ map, value, key, fn, ... }` object). The schema uses\n * `z.unknown()` for each so users can supply any valid mapping shape — the\n * destination resolves it via `getMappingValue()` at push time.\n */\nexport const MappingSchema = z.object({\n conversion: z\n .unknown()\n .describe(\n 'Resolves to a LinkedIn conversion object with short keys: { id (required number — the Campaign Manager conversion_id), value? (number), currency? (ISO code), eventId? (string for deduplication with a future server/Conversions API destination) }. Events without a resolved id are silently ignored.',\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, Lintrk } from '../types';\n\n/**\n * Example environment configurations for LinkedIn Insight Tag destination.\n *\n * Tests clone `push` and replace `window.lintrk` with a jest.fn() to collect\n * calls. Production leaves `env` undefined — the destination mutates the real\n * `window` object and injects the LinkedIn CDN script via `addScript()`.\n */\n\nconst noop = () => {};\n\n/**\n * Pre-init environment — no LinkedIn state present. The destination's init\n * will populate _linkedin_partner_id and install the lintrk queue.\n */\nexport const init: Env | undefined = {\n window: {\n _linkedin_partner_id: undefined,\n _linkedin_data_partner_ids: undefined,\n lintrk: undefined,\n },\n document: {\n createElement: () => ({\n src: '',\n async: false,\n dataset: {},\n setAttribute: () => {},\n removeAttribute: () => {},\n }),\n head: { appendChild: () => {} },\n querySelector: () => null,\n },\n};\n\n/**\n * Post-init environment — lintrk is a spy-able no-op function carrying the\n * queue shape the real script installs. Tests clone this and replace\n * `window.lintrk` with a jest.fn() before pushing events, so every call is\n * captured.\n */\nexport const push: Env = {\n window: {\n _linkedin_partner_id: '123456',\n _linkedin_data_partner_ids: ['123456'],\n lintrk: Object.assign(noop, { q: [] as unknown[] }) as unknown as Lintrk,\n },\n document: {\n createElement: () => ({\n src: '',\n async: false,\n dataset: {},\n setAttribute: () => {},\n removeAttribute: () => {},\n }),\n head: { appendChild: () => {} },\n querySelector: () => null,\n },\n};\n\n/**\n * Simulation tracking paths — used by CLI `--simulate` to record which\n * function calls happened during an event push.\n */\nexport const simulation = ['call:window.lintrk'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Examples may optionally override destination-level settings for a test.\n * The test runner reads `settings` from the example and merges it into the\n * base destination settings (on top of the fixed `apiKey`). Rarely needed\n * for LinkedIn - conversion config lives on the rule, not destination-level.\n */\nexport type LinkedInStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * OPT-IN: Unmapped event is silently ignored.\n *\n * LinkedIn's core behavioral difference from analytics destinations: events\n * without `mapping.settings.conversion` produce ZERO lintrk() calls. The\n * destination is opt-in - each conversion must reference a pre-created\n * Conversion Rule from Campaign Manager.\n */\nexport const unmappedEventIgnored: LinkedInStepExample = {\n public: false,\n in: getEvent('product view', { timestamp: 1700000100 }),\n out: [],\n};\n\n/**\n * Simplest possible conversion - just a `conversion_id` from Campaign Manager.\n *\n * Form submission → LinkedIn Lead conversion. The mapping resolves `id` as a\n * literal value (no walker event field needed). The destination translates\n * `{ id }` → `lintrk('track', { conversion_id })`.\n */\nexport const simpleConversionId: LinkedInStepExample = {\n title: 'Simple conversion',\n description:\n 'A form submit fires a LinkedIn lintrk track with only a conversion_id from Campaign Manager.',\n in: getEvent('form submit', { timestamp: 1700000101 }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 12345 },\n },\n },\n },\n },\n out: [['lintrk', 'track', { conversion_id: 12345 }]],\n};\n\n/**\n * Full e-commerce conversion - every supported lintrk field populated.\n *\n * mapping config uses short walkerOS keys (`id`, `value`, `currency`, `eventId`);\n * the destination translates them to the vendor parameter names\n * (`conversion_id`, `conversion_value`, `currency`, `event_id`).\n *\n * Currency uses the walkerOS fallback syntax: `{ key, value }` - pull from\n * `data.currency` first, fall back to `\"EUR\"` if absent. The default\n * `order complete` fixture from `getEvent` already sets `data.currency: \"EUR\"`,\n * so the resolved value is \"EUR\" here.\n *\n * `eventId` maps from the walkerOS event.id - stable per event, unique, and\n * ready for deduplication with a future server (Conversions API) destination.\n */\nexport const orderCompleteFullConversion: LinkedInStepExample = {\n title: 'Ecommerce conversion',\n description:\n 'A completed order fires a LinkedIn lintrk track with conversion_id, value, currency, and event_id for deduplication.',\n in: getEvent('order complete', {\n timestamp: 1700000102,\n id: '1700000102abcdef',\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 67890 },\n value: 'data.total',\n currency: { key: 'data.currency', value: 'EUR' },\n eventId: 'id',\n },\n },\n },\n },\n out: [\n [\n 'lintrk',\n 'track',\n {\n conversion_id: 67890,\n conversion_value: 555,\n currency: 'EUR',\n event_id: '1700000102abcdef',\n },\n ],\n ],\n};\n\n/**\n * Page view as an explicit conversion.\n *\n * LinkedIn's Insight Tag automatically fires a page view on load for\n * retargeting / audience building - that call is NOT something the\n * destination controls. This example tests the OTHER case: mapping a\n * specific walkerOS `page view` event to a Campaign Manager KEY_PAGE_VIEW\n * conversion rule, which fires an EXPLICIT lintrk('track') call in addition\n * to the auto page view.\n */\nexport const pageViewConversion: LinkedInStepExample = {\n title: 'Key page view',\n description:\n 'A page view fires an explicit lintrk track mapped to a LinkedIn KEY_PAGE_VIEW conversion rule.',\n in: getEvent('page view', {\n timestamp: 1700000103,\n id: '1700000103abcdef',\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 11111 },\n eventId: 'id',\n },\n },\n },\n },\n out: [\n [\n 'lintrk',\n 'track',\n {\n conversion_id: 11111,\n event_id: '1700000103abcdef',\n },\n ],\n ],\n};\n\n/**\n * Middle-funnel LEAD conversion - demo request without monetary value.\n *\n * LinkedIn's conversion types include LEAD, CONTACT, SIGN_UP, etc. The\n * destination is agnostic to the type (set in Campaign Manager, not at call\n * time) - all we forward is the conversion_id. This fixture exercises the\n * \"id + eventId only\" shape.\n */\nexport const demoRequestLead: LinkedInStepExample = {\n title: 'Lead conversion',\n description:\n 'A demo request fires a LinkedIn lintrk track for a lead conversion with id and event_id only.',\n in: getEvent('demo request', {\n timestamp: 1700000104,\n id: '1700000104abcdef',\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 44444 },\n eventId: 'id',\n },\n },\n },\n },\n out: [\n [\n 'lintrk',\n 'track',\n {\n conversion_id: 44444,\n event_id: '1700000104abcdef',\n },\n ],\n ],\n};\n\n/**\n * rule.silent - fully-configured conversion rule temporarily disabled.\n *\n * The rule has a valid `conversion.map` but `silent: true` tells the destination\n * to produce zero calls. This is distinct from the opt-in default (no\n * `conversion` at all): silent explicitly keeps the rule on disk for quick\n * reactivation without deleting it.\n */\nexport const conversionSilenced: LinkedInStepExample = {\n public: false,\n in: getEvent('form submit', { timestamp: 1700000105 }),\n mapping: {\n silent: true,\n settings: {\n conversion: {\n map: {\n id: { value: 12345 },\n },\n },\n },\n },\n out: [],\n};\n\n/**\n * Falsy `id` → entire lintrk call is skipped.\n *\n * If the resolved conversion object has no truthy `id`, the destination does\n * NOT call lintrk at all. This protects against misconfigured mappings\n * (e.g. pulling id from a non-existent field).\n *\n * Here we map `id` from `data.nonexistentField` - it resolves to undefined,\n * so zero calls are produced.\n */\nexport const missingConversionIdIgnored: LinkedInStepExample = {\n public: false,\n in: getEvent('form submit', { timestamp: 1700000106 }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: 'data.nonexistentField',\n },\n },\n },\n },\n out: [],\n};\n\n/**\n * Partial conversion - value missing → omitted from the lintrk call.\n *\n * The rule asks for `value: 'data.missingTotal'` (undefined), `currency`\n * (undefined), and `eventId: 'id'` (present). Only `conversion_id` and\n * `event_id` appear in the final call - no `conversion_value`, no `currency`.\n */\nexport const partialFieldsOmitted: LinkedInStepExample = {\n public: false,\n in: getEvent('order complete', {\n timestamp: 1700000107,\n id: '1700000107abcdef',\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 67890 },\n value: 'data.missingTotal',\n eventId: 'id',\n },\n },\n },\n },\n out: [\n [\n 'lintrk',\n 'track',\n {\n conversion_id: 67890,\n event_id: '1700000107abcdef',\n },\n ],\n ],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,QAAQ,EACL,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,EACF;AACJ,CAAC;;;ACbD,SAAS,KAAAA,UAAS;AAUX,IAAM,gBAAgBA,GAAE,OAAO;AAAA,EACpC,YAAYA,GACT,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AFTM,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;AAMb,IAAM,OAAwB;AAAA,EACnC,QAAQ;AAAA,IACN,sBAAsB;AAAA,IACtB,4BAA4B;AAAA,IAC5B,QAAQ;AAAA,EACV;AAAA,EACA,UAAU;AAAA,IACR,eAAe,OAAO;AAAA,MACpB,KAAK;AAAA,MACL,OAAO;AAAA,MACP,SAAS,CAAC;AAAA,MACV,cAAc,MAAM;AAAA,MAAC;AAAA,MACrB,iBAAiB,MAAM;AAAA,MAAC;AAAA,IAC1B;AAAA,IACA,MAAM,EAAE,aAAa,MAAM;AAAA,IAAC,EAAE;AAA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EACF;AACF;AAUO,IAAM,qBAA0C;AAAA,EACrD,QAAQ;AAAA,EACR,IAAI,SAAS,eAAe,EAAE,WAAW,WAAW,CAAC;AAAA,EACrD,SAAS;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,MACR,YAAY;AAAA,QACV,KAAK;AAAA,UACH,IAAI,EAAE,OAAO,MAAM;AAAA,QACrB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK,CAAC;AACR;AAYO,IAAM,6BAAkD;AAAA,EAC7D,QAAQ;AAAA,EACR,IAAI,SAAS,eAAe,EAAE,WAAW,WAAW,CAAC;AAAA,EACrD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,YAAY;AAAA,QACV,KAAK;AAAA,UACH,IAAI;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK,CAAC;AACR;AASO,IAAM,uBAA4C;AAAA,EACvD,QAAQ;AAAA,EACR,IAAI,SAAS,kBAAkB;AAAA,IAC7B,WAAW;AAAA,IACX,IAAI;AAAA,EACN,CAAC;AAAA,EACD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,YAAY;AAAA,QACV,KAAK;AAAA,UACH,IAAI,EAAE,OAAO,MAAM;AAAA,UACnB,OAAO;AAAA,UACP,SAAS;AAAA,QACX;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,QACE,eAAe;AAAA,QACf,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AACF;","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"],"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 .min(1)\n .regex(\n /^\\d+$/,\n 'Must be a numeric LinkedIn Partner ID (digits only, e.g. \"123456\")',\n )\n .describe(\n 'Your LinkedIn Partner ID (numeric string, typically 6 to 7 digits). Find it in Campaign Manager under Insight Tag. Assigned to window._linkedin_partner_id before the Insight Tag script loads (like 1234567).',\n ),\n })\n .strict();\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * LinkedIn per-rule mapping schema.\n *\n * Every field on `conversion` is a walkerOS mapping value (static literal,\n * string path, or `{ map, value, key, fn, ... }` object). The schema uses\n * `z.unknown()` for each so users can supply any valid mapping shape — the\n * destination resolves it via `getMappingValue()` at push time.\n */\nexport const MappingSchema = z.object({\n conversion: z\n .unknown()\n .describe(\n 'Resolves to a LinkedIn conversion object with short keys: { id (required number — the Campaign Manager conversion_id), value? (number), currency? (ISO code), eventId? (string for deduplication with a future server/Conversions API destination) }. Events without a resolved id are silently ignored.',\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 } from '../types';\n\n/**\n * Example environment configurations for LinkedIn Insight Tag destination.\n *\n * Tests clone `push` and replace `window.lintrk` with a jest.fn() to collect\n * calls. Production leaves `env` undefined — the destination mutates the real\n * `window` object and injects the LinkedIn CDN script through `loadVendor`.\n */\n\nconst noop = () => {};\n\n/**\n * Pre-init environment — no LinkedIn state present. The destination's init\n * will populate _linkedin_partner_id and install the lintrk queue.\n */\nexport const init: Env | undefined = {\n window: {\n _linkedin_partner_id: undefined,\n _linkedin_data_partner_ids: undefined,\n lintrk: undefined,\n },\n};\n\n/**\n * Post-init environment — lintrk is a spy-able no-op function carrying the\n * queue shape the real script installs. Tests clone this and replace\n * `window.lintrk` with a jest.fn() before pushing events, so every call is\n * captured.\n */\nexport const push: Env = {\n window: {\n _linkedin_partner_id: '123456',\n _linkedin_data_partner_ids: ['123456'],\n lintrk: Object.assign(noop, { q: [] }),\n },\n};\n\n/**\n * Simulation tracking paths — used by CLI `--simulate` to record which\n * function calls happened during an event push.\n */\nexport const simulation = ['call:window.lintrk'];\n","import type { Flow } from '@walkeros/core';\nimport { createEvent, getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Examples may optionally override destination-level settings for a test.\n * The test runner reads `settings` from the example and merges it into the\n * base destination settings (on top of the fixed `apiKey`). Rarely needed\n * for LinkedIn - conversion config lives on the rule, not destination-level.\n */\nexport type LinkedInStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * OPT-IN: Unmapped event is silently ignored.\n *\n * LinkedIn's core behavioral difference from analytics destinations: events\n * without `mapping.settings.conversion` produce ZERO lintrk() calls. The\n * destination is opt-in - each conversion must reference a pre-created\n * Conversion Rule from Campaign Manager.\n */\nexport const unmappedEventIgnored: LinkedInStepExample = {\n public: false,\n in: getEvent('product view', { timestamp: 1700000100 }),\n out: [],\n};\n\n/**\n * Simplest possible conversion - just a `conversion_id` from Campaign Manager.\n *\n * Form submission → LinkedIn Lead conversion. The mapping resolves `id` as a\n * literal value (no walker event field needed). The destination translates\n * `{ id }` → `lintrk('track', { conversion_id })`.\n */\nexport const simpleConversionId: LinkedInStepExample = {\n title: 'Simple conversion',\n description:\n 'A form submit fires a LinkedIn lintrk track with only a conversion_id from Campaign Manager.',\n in: createEvent({ name: 'form submit', timestamp: 1700000101 }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 12345 },\n },\n },\n },\n },\n out: [['lintrk', 'track', { conversion_id: 12345 }]],\n};\n\n/**\n * Full e-commerce conversion - every supported lintrk field populated.\n *\n * mapping config uses short walkerOS keys (`id`, `value`, `currency`, `eventId`);\n * the destination translates them to the vendor parameter names\n * (`conversion_id`, `conversion_value`, `currency`, `event_id`).\n *\n * Currency uses the walkerOS fallback syntax: `{ key, value }` - pull from\n * `data.currency` first, fall back to `\"EUR\"` if absent. The default\n * `order complete` fixture from `getEvent` already sets `data.currency: \"EUR\"`,\n * so the resolved value is \"EUR\" here.\n *\n * `eventId` maps from the walkerOS event.id - stable per event, unique, and\n * ready for deduplication with a future server (Conversions API) destination.\n */\nexport const orderCompleteFullConversion: LinkedInStepExample = {\n title: 'Ecommerce conversion',\n description:\n 'A completed order fires a LinkedIn lintrk track with conversion_id, value, currency, and event_id for deduplication.',\n in: getEvent('order complete', {\n timestamp: 1700000102,\n id: '1700000102abcdef',\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 67890 },\n value: 'data.value',\n currency: { key: 'data.currency', value: 'EUR' },\n eventId: 'id',\n },\n },\n },\n },\n out: [\n [\n 'lintrk',\n 'track',\n {\n conversion_id: 67890,\n conversion_value: 555,\n currency: 'EUR',\n event_id: '1700000102abcdef',\n },\n ],\n ],\n};\n\n/**\n * Page view as an explicit conversion.\n *\n * LinkedIn's Insight Tag automatically fires a page view on load for\n * retargeting / audience building - that call is NOT something the\n * destination controls. This example tests the OTHER case: mapping a\n * specific walkerOS `page view` event to a Campaign Manager KEY_PAGE_VIEW\n * conversion rule, which fires an EXPLICIT lintrk('track') call in addition\n * to the auto page view.\n */\nexport const pageViewConversion: LinkedInStepExample = {\n title: 'Key page view',\n description:\n 'A page view fires an explicit lintrk track mapped to a LinkedIn KEY_PAGE_VIEW conversion rule.',\n in: getEvent('page view', {\n timestamp: 1700000103,\n id: '1700000103abcdef',\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 11111 },\n eventId: 'id',\n },\n },\n },\n },\n out: [\n [\n 'lintrk',\n 'track',\n {\n conversion_id: 11111,\n event_id: '1700000103abcdef',\n },\n ],\n ],\n};\n\n/**\n * Middle-funnel LEAD conversion - demo request without monetary value.\n *\n * LinkedIn's conversion types include LEAD, CONTACT, SIGN_UP, etc. The\n * destination is agnostic to the type (set in Campaign Manager, not at call\n * time) - all we forward is the conversion_id. This fixture exercises the\n * \"id + eventId only\" shape.\n */\nexport const demoRequestLead: LinkedInStepExample = {\n title: 'Lead conversion',\n description:\n 'A demo request fires a LinkedIn lintrk track for a lead conversion with id and event_id only.',\n in: createEvent({\n name: 'demo request',\n timestamp: 1700000104,\n id: '1700000104abcdef',\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 44444 },\n eventId: 'id',\n },\n },\n },\n },\n out: [\n [\n 'lintrk',\n 'track',\n {\n conversion_id: 44444,\n event_id: '1700000104abcdef',\n },\n ],\n ],\n};\n\n/**\n * rule.silent - fully-configured conversion rule temporarily disabled.\n *\n * The rule has a valid `conversion.map` but `silent: true` tells the destination\n * to produce zero calls. This is distinct from the opt-in default (no\n * `conversion` at all): silent explicitly keeps the rule on disk for quick\n * reactivation without deleting it.\n */\nexport const conversionSilenced: LinkedInStepExample = {\n public: false,\n in: createEvent({ name: 'form submit', timestamp: 1700000105 }),\n mapping: {\n silent: true,\n settings: {\n conversion: {\n map: {\n id: { value: 12345 },\n },\n },\n },\n },\n out: [],\n};\n\n/**\n * Falsy `id` → entire lintrk call is skipped and the push fails missing-input.\n *\n * If the resolved conversion object has no truthy `id`, the destination does\n * NOT call lintrk at all. This protects against misconfigured mappings\n * (e.g. pulling id from a non-existent field).\n *\n * Here we map `id` from `data.nonexistentField` - it resolves to undefined,\n * so zero calls are produced.\n */\nexport const missingConversionIdIgnored: LinkedInStepExample = {\n public: false,\n description:\n 'A conversion mapping whose id resolves to nothing makes no lintrk call, so the push fails with missing-input instead of counting as delivered.',\n in: createEvent({ name: 'form submit', timestamp: 1700000106 }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: 'data.nonexistentField',\n },\n },\n },\n },\n out: [],\n outcome: { status: 'failed', code: 'missing-input' },\n};\n\n/**\n * Partial conversion - value missing → omitted from the lintrk call.\n *\n * The rule asks for `value: 'data.missingTotal'` (undefined), `currency`\n * (undefined), and `eventId: 'id'` (present). Only `conversion_id` and\n * `event_id` appear in the final call - no `conversion_value`, no `currency`.\n */\nexport const partialFieldsOmitted: LinkedInStepExample = {\n public: false,\n in: getEvent('order complete', {\n timestamp: 1700000107,\n id: '1700000107abcdef',\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n id: { value: 67890 },\n value: 'data.missingTotal',\n eventId: 'id',\n },\n },\n },\n },\n out: [\n [\n 'lintrk',\n 'track',\n {\n conversion_id: 67890,\n event_id: '1700000107abcdef',\n },\n ],\n ],\n};\n\n/**\n * A revocation of the consent the destination requires. The Insight Tag has\n * no vendor consent mode, so the collector's consent gate is the only\n * mechanism and no vendor call is made.\n */\nexport const consentRevoke: LinkedInStepExample = {\n public: false,\n description:\n 'For a destination with config.consent { marketing: true }, revoking marketing makes no vendor call: the Insight Tag has no consent mode, the collector stops sending.',\n command: 'consent',\n in: { marketing: false },\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,IAAI,CAAC,EACL;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,EACF;AACJ,CAAC,EACA,OAAO;;;ACfV,SAAS,KAAAA,UAAS;AAUX,IAAM,gBAAgBA,GAAE,OAAO;AAAA,EACpC,YAAYA,GACT,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AFTM,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;AAMb,IAAM,OAAwB;AAAA,EACnC,QAAQ;AAAA,IACN,sBAAsB;AAAA,IACtB,4BAA4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,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK,CAAC;AACR;AAYO,IAAM,6BAAkD;AAAA,EAC7D,QAAQ;AAAA,EACR,aACE;AAAA,EACF,IAAI,YAAY,EAAE,MAAM,eAAe,WAAW,WAAW,CAAC;AAAA,EAC9D,SAAS;AAAA,IACP,UAAU;AAAA,MACR,YAAY;AAAA,QACV,KAAK;AAAA,UACH,IAAI;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK,CAAC;AAAA,EACN,SAAS,EAAE,QAAQ,UAAU,MAAM,gBAAgB;AACrD;AASO,IAAM,uBAA4C;AAAA,EACvD,QAAQ;AAAA,EACR,IAAI,SAAS,kBAAkB;AAAA,IAC7B,WAAW;AAAA,IACX,IAAI;AAAA,EACN,CAAC;AAAA,EACD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,YAAY;AAAA,QACV,KAAK;AAAA,UACH,IAAI,EAAE,OAAO,MAAM;AAAA,UACnB,OAAO;AAAA,UACP,SAAS;AAAA,QACX;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,QACE,eAAe;AAAA,QACf,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AACF;AAOO,IAAM,gBAAqC;AAAA,EAChD,QAAQ;AAAA,EACR,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,MAAM;AAAA,EACvB,KAAK,CAAC;AACR;","names":["z"]}
|
|
@@ -48,8 +48,6 @@ interface Settings {
|
|
|
48
48
|
* `window._linkedin_partner_id` / `window._linkedin_data_partner_ids` and
|
|
49
49
|
* installs `window.lintrk` in init; tests can pre-seed `window.lintrk` with
|
|
50
50
|
* a spy to skip the script injection path.
|
|
51
|
-
*
|
|
52
|
-
* `document` is also mocked so `addScript()` can run headlessly.
|
|
53
51
|
*/
|
|
54
52
|
interface Env extends DestinationWeb.Env {
|
|
55
53
|
window: {
|
|
@@ -156,7 +154,7 @@ declare const demoRequestLead: LinkedInStepExample;
|
|
|
156
154
|
*/
|
|
157
155
|
declare const conversionSilenced: LinkedInStepExample;
|
|
158
156
|
/**
|
|
159
|
-
* Falsy `id` → entire lintrk call is skipped.
|
|
157
|
+
* Falsy `id` → entire lintrk call is skipped and the push fails missing-input.
|
|
160
158
|
*
|
|
161
159
|
* If the resolved conversion object has no truthy `id`, the destination does
|
|
162
160
|
* NOT call lintrk at all. This protects against misconfigured mappings
|
|
@@ -174,8 +172,15 @@ declare const missingConversionIdIgnored: LinkedInStepExample;
|
|
|
174
172
|
* `event_id` appear in the final call - no `conversion_value`, no `currency`.
|
|
175
173
|
*/
|
|
176
174
|
declare const partialFieldsOmitted: LinkedInStepExample;
|
|
175
|
+
/**
|
|
176
|
+
* A revocation of the consent the destination requires. The Insight Tag has
|
|
177
|
+
* no vendor consent mode, so the collector's consent gate is the only
|
|
178
|
+
* mechanism and no vendor call is made.
|
|
179
|
+
*/
|
|
180
|
+
declare const consentRevoke: LinkedInStepExample;
|
|
177
181
|
|
|
178
182
|
type step_LinkedInStepExample = LinkedInStepExample;
|
|
183
|
+
declare const step_consentRevoke: typeof consentRevoke;
|
|
179
184
|
declare const step_conversionSilenced: typeof conversionSilenced;
|
|
180
185
|
declare const step_demoRequestLead: typeof demoRequestLead;
|
|
181
186
|
declare const step_missingConversionIdIgnored: typeof missingConversionIdIgnored;
|
|
@@ -185,7 +190,7 @@ declare const step_partialFieldsOmitted: typeof partialFieldsOmitted;
|
|
|
185
190
|
declare const step_simpleConversionId: typeof simpleConversionId;
|
|
186
191
|
declare const step_unmappedEventIgnored: typeof unmappedEventIgnored;
|
|
187
192
|
declare namespace step {
|
|
188
|
-
export { type step_LinkedInStepExample as LinkedInStepExample, step_conversionSilenced as conversionSilenced, step_demoRequestLead as demoRequestLead, step_missingConversionIdIgnored as missingConversionIdIgnored, step_orderCompleteFullConversion as orderCompleteFullConversion, step_pageViewConversion as pageViewConversion, step_partialFieldsOmitted as partialFieldsOmitted, step_simpleConversionId as simpleConversionId, step_unmappedEventIgnored as unmappedEventIgnored };
|
|
193
|
+
export { type step_LinkedInStepExample as LinkedInStepExample, step_consentRevoke as consentRevoke, step_conversionSilenced as conversionSilenced, step_demoRequestLead as demoRequestLead, step_missingConversionIdIgnored as missingConversionIdIgnored, step_orderCompleteFullConversion as orderCompleteFullConversion, step_pageViewConversion as pageViewConversion, step_partialFieldsOmitted as partialFieldsOmitted, step_simpleConversionId as simpleConversionId, step_unmappedEventIgnored as unmappedEventIgnored };
|
|
189
194
|
}
|
|
190
195
|
|
|
191
196
|
export { env, step };
|
package/dist/examples/index.d.ts
CHANGED
|
@@ -48,8 +48,6 @@ interface Settings {
|
|
|
48
48
|
* `window._linkedin_partner_id` / `window._linkedin_data_partner_ids` and
|
|
49
49
|
* installs `window.lintrk` in init; tests can pre-seed `window.lintrk` with
|
|
50
50
|
* a spy to skip the script injection path.
|
|
51
|
-
*
|
|
52
|
-
* `document` is also mocked so `addScript()` can run headlessly.
|
|
53
51
|
*/
|
|
54
52
|
interface Env extends DestinationWeb.Env {
|
|
55
53
|
window: {
|
|
@@ -156,7 +154,7 @@ declare const demoRequestLead: LinkedInStepExample;
|
|
|
156
154
|
*/
|
|
157
155
|
declare const conversionSilenced: LinkedInStepExample;
|
|
158
156
|
/**
|
|
159
|
-
* Falsy `id` → entire lintrk call is skipped.
|
|
157
|
+
* Falsy `id` → entire lintrk call is skipped and the push fails missing-input.
|
|
160
158
|
*
|
|
161
159
|
* If the resolved conversion object has no truthy `id`, the destination does
|
|
162
160
|
* NOT call lintrk at all. This protects against misconfigured mappings
|
|
@@ -174,8 +172,15 @@ declare const missingConversionIdIgnored: LinkedInStepExample;
|
|
|
174
172
|
* `event_id` appear in the final call - no `conversion_value`, no `currency`.
|
|
175
173
|
*/
|
|
176
174
|
declare const partialFieldsOmitted: LinkedInStepExample;
|
|
175
|
+
/**
|
|
176
|
+
* A revocation of the consent the destination requires. The Insight Tag has
|
|
177
|
+
* no vendor consent mode, so the collector's consent gate is the only
|
|
178
|
+
* mechanism and no vendor call is made.
|
|
179
|
+
*/
|
|
180
|
+
declare const consentRevoke: LinkedInStepExample;
|
|
177
181
|
|
|
178
182
|
type step_LinkedInStepExample = LinkedInStepExample;
|
|
183
|
+
declare const step_consentRevoke: typeof consentRevoke;
|
|
179
184
|
declare const step_conversionSilenced: typeof conversionSilenced;
|
|
180
185
|
declare const step_demoRequestLead: typeof demoRequestLead;
|
|
181
186
|
declare const step_missingConversionIdIgnored: typeof missingConversionIdIgnored;
|
|
@@ -185,7 +190,7 @@ declare const step_partialFieldsOmitted: typeof partialFieldsOmitted;
|
|
|
185
190
|
declare const step_simpleConversionId: typeof simpleConversionId;
|
|
186
191
|
declare const step_unmappedEventIgnored: typeof unmappedEventIgnored;
|
|
187
192
|
declare namespace step {
|
|
188
|
-
export { type step_LinkedInStepExample as LinkedInStepExample, step_conversionSilenced as conversionSilenced, step_demoRequestLead as demoRequestLead, step_missingConversionIdIgnored as missingConversionIdIgnored, step_orderCompleteFullConversion as orderCompleteFullConversion, step_pageViewConversion as pageViewConversion, step_partialFieldsOmitted as partialFieldsOmitted, step_simpleConversionId as simpleConversionId, step_unmappedEventIgnored as unmappedEventIgnored };
|
|
193
|
+
export { type step_LinkedInStepExample as LinkedInStepExample, step_consentRevoke as consentRevoke, step_conversionSilenced as conversionSilenced, step_demoRequestLead as demoRequestLead, step_missingConversionIdIgnored as missingConversionIdIgnored, step_orderCompleteFullConversion as orderCompleteFullConversion, step_pageViewConversion as pageViewConversion, step_partialFieldsOmitted as partialFieldsOmitted, step_simpleConversionId as simpleConversionId, step_unmappedEventIgnored as unmappedEventIgnored };
|
|
189
194
|
}
|
|
190
195
|
|
|
191
196
|
export { env, step };
|
package/dist/examples/index.js
CHANGED
|
@@ -39,20 +39,6 @@ var init = {
|
|
|
39
39
|
_linkedin_partner_id: void 0,
|
|
40
40
|
_linkedin_data_partner_ids: void 0,
|
|
41
41
|
lintrk: void 0
|
|
42
|
-
},
|
|
43
|
-
document: {
|
|
44
|
-
createElement: () => ({
|
|
45
|
-
src: "",
|
|
46
|
-
async: false,
|
|
47
|
-
dataset: {},
|
|
48
|
-
setAttribute: () => {
|
|
49
|
-
},
|
|
50
|
-
removeAttribute: () => {
|
|
51
|
-
}
|
|
52
|
-
}),
|
|
53
|
-
head: { appendChild: () => {
|
|
54
|
-
} },
|
|
55
|
-
querySelector: () => null
|
|
56
42
|
}
|
|
57
43
|
};
|
|
58
44
|
var push = {
|
|
@@ -60,20 +46,6 @@ var push = {
|
|
|
60
46
|
_linkedin_partner_id: "123456",
|
|
61
47
|
_linkedin_data_partner_ids: ["123456"],
|
|
62
48
|
lintrk: Object.assign(noop, { q: [] })
|
|
63
|
-
},
|
|
64
|
-
document: {
|
|
65
|
-
createElement: () => ({
|
|
66
|
-
src: "",
|
|
67
|
-
async: false,
|
|
68
|
-
dataset: {},
|
|
69
|
-
setAttribute: () => {
|
|
70
|
-
},
|
|
71
|
-
removeAttribute: () => {
|
|
72
|
-
}
|
|
73
|
-
}),
|
|
74
|
-
head: { appendChild: () => {
|
|
75
|
-
} },
|
|
76
|
-
querySelector: () => null
|
|
77
49
|
}
|
|
78
50
|
};
|
|
79
51
|
var simulation = ["call:window.lintrk"];
|
|
@@ -81,6 +53,7 @@ var simulation = ["call:window.lintrk"];
|
|
|
81
53
|
// src/examples/step.ts
|
|
82
54
|
var step_exports = {};
|
|
83
55
|
__export(step_exports, {
|
|
56
|
+
consentRevoke: () => consentRevoke,
|
|
84
57
|
conversionSilenced: () => conversionSilenced,
|
|
85
58
|
demoRequestLead: () => demoRequestLead,
|
|
86
59
|
missingConversionIdIgnored: () => missingConversionIdIgnored,
|
|
@@ -99,7 +72,7 @@ var unmappedEventIgnored = {
|
|
|
99
72
|
var simpleConversionId = {
|
|
100
73
|
title: "Simple conversion",
|
|
101
74
|
description: "A form submit fires a LinkedIn lintrk track with only a conversion_id from Campaign Manager.",
|
|
102
|
-
in: (0, import_core.
|
|
75
|
+
in: (0, import_core.createEvent)({ name: "form submit", timestamp: 1700000101 }),
|
|
103
76
|
mapping: {
|
|
104
77
|
settings: {
|
|
105
78
|
conversion: {
|
|
@@ -123,7 +96,7 @@ var orderCompleteFullConversion = {
|
|
|
123
96
|
conversion: {
|
|
124
97
|
map: {
|
|
125
98
|
id: { value: 67890 },
|
|
126
|
-
value: "data.
|
|
99
|
+
value: "data.value",
|
|
127
100
|
currency: { key: "data.currency", value: "EUR" },
|
|
128
101
|
eventId: "id"
|
|
129
102
|
}
|
|
@@ -174,7 +147,8 @@ var pageViewConversion = {
|
|
|
174
147
|
var demoRequestLead = {
|
|
175
148
|
title: "Lead conversion",
|
|
176
149
|
description: "A demo request fires a LinkedIn lintrk track for a lead conversion with id and event_id only.",
|
|
177
|
-
in: (0, import_core.
|
|
150
|
+
in: (0, import_core.createEvent)({
|
|
151
|
+
name: "demo request",
|
|
178
152
|
timestamp: 1700000104,
|
|
179
153
|
id: "1700000104abcdef"
|
|
180
154
|
}),
|
|
@@ -201,7 +175,7 @@ var demoRequestLead = {
|
|
|
201
175
|
};
|
|
202
176
|
var conversionSilenced = {
|
|
203
177
|
public: false,
|
|
204
|
-
in: (0, import_core.
|
|
178
|
+
in: (0, import_core.createEvent)({ name: "form submit", timestamp: 1700000105 }),
|
|
205
179
|
mapping: {
|
|
206
180
|
silent: true,
|
|
207
181
|
settings: {
|
|
@@ -216,7 +190,8 @@ var conversionSilenced = {
|
|
|
216
190
|
};
|
|
217
191
|
var missingConversionIdIgnored = {
|
|
218
192
|
public: false,
|
|
219
|
-
|
|
193
|
+
description: "A conversion mapping whose id resolves to nothing makes no lintrk call, so the push fails with missing-input instead of counting as delivered.",
|
|
194
|
+
in: (0, import_core.createEvent)({ name: "form submit", timestamp: 1700000106 }),
|
|
220
195
|
mapping: {
|
|
221
196
|
settings: {
|
|
222
197
|
conversion: {
|
|
@@ -226,7 +201,8 @@ var missingConversionIdIgnored = {
|
|
|
226
201
|
}
|
|
227
202
|
}
|
|
228
203
|
},
|
|
229
|
-
out: []
|
|
204
|
+
out: [],
|
|
205
|
+
outcome: { status: "failed", code: "missing-input" }
|
|
230
206
|
};
|
|
231
207
|
var partialFieldsOmitted = {
|
|
232
208
|
public: false,
|
|
@@ -256,6 +232,13 @@ var partialFieldsOmitted = {
|
|
|
256
232
|
]
|
|
257
233
|
]
|
|
258
234
|
};
|
|
235
|
+
var consentRevoke = {
|
|
236
|
+
public: false,
|
|
237
|
+
description: "For a destination with config.consent { marketing: true }, revoking marketing makes no vendor call: the Insight Tag has no consent mode, the collector stops sending.",
|
|
238
|
+
command: "consent",
|
|
239
|
+
in: { marketing: false },
|
|
240
|
+
out: []
|
|
241
|
+
};
|
|
259
242
|
// Annotate the CommonJS export names for ESM import in node:
|
|
260
243
|
0 && (module.exports = {
|
|
261
244
|
env,
|