@walkeros/server-destination-linkedin 3.4.0 → 3.4.1
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/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.js +6 -0
- package/dist/examples/index.mjs +6 -0
- package/dist/walkerOS.json +11 -5
- package/package.json +4 -4
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,r=Object.defineProperty,
|
|
1
|
+
"use strict";var e,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,t=Object.prototype.hasOwnProperty,o=(e,i)=>{for(var n in i)r(e,n,{get:i[n],enumerable:!0})},a={};o(a,{examples:()=>I,schemas:()=>s}),module.exports=(e=a,((e,o,a,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let c of n(o))t.call(e,c)||c===a||r(e,c,{get:()=>o[c],enumerable:!(s=i(o,c))||s.enumerable});return e})(r({},"__esModule",{value:!0}),e));var s={};o(s,{ApiVersionSchema:()=>p,MappingSchema:()=>f,SettingsSchema:()=>m,UserIdTypeSchema:()=>u,mapping:()=>b,settings:()=>h});var c=require("@walkeros/core/dev"),d=require("@walkeros/core/dev"),l=require("@walkeros/core/dev"),u=l.z.enum(["SHA256_EMAIL","LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID","ACXIOM_ID","ORACLE_MOAT_ID"]),p=l.z.string().regex(/^\d{6}$/,"API version must be in YYYYMM format (e.g. 202604)"),m=d.z.object({accessToken:d.z.string().min(1).describe("LinkedIn OAuth 2.0 Bearer token for Conversions API authentication (like AQX...)"),conversionRuleId:d.z.string().regex(/^[0-9]+$/,"Conversion rule ID must contain only digits").describe("Default LinkedIn conversion rule ID from Campaign Manager (like 12345678)"),apiVersion:p.describe("Linkedin-Version header value in YYYYMM format (like 202604)").optional(),doNotHash:d.z.array(d.z.string()).describe("Array of user data fields that should not be hashed (like ['email'])").optional(),url:d.z.string().url().describe("Custom URL for LinkedIn Conversions API endpoint (like https://api.linkedin.com/rest/)").optional(),user_data:d.z.record(d.z.string(),d.z.string()).describe("Mapping configuration for user data fields (like { email: 'user.email', li_fat_id: 'context.li_fat_id' })").optional()}),v=require("@walkeros/core/dev"),f=v.z.object({conversion:v.z.object({ruleId:v.z.string().describe("Override conversion rule ID for this event").optional(),value:v.z.union([v.z.string(),v.z.number()]).describe("Conversion monetary value").optional(),currency:v.z.string().describe("ISO 4217 currency code (like USD, EUR)").optional()}).describe("Per-event conversion override with ruleId, value, and currency").optional()}),h=(0,c.zodToSchema)(m),b=(0,c.zodToSchema)(f),I={};o(I,{env:()=>g,step:()=>A});var g={};o(g,{push:()=>y,simulation:()=>_});var y={sendServer:async function(e,r,i){return{ok:!0,data:{}}}},_=["sendServer"],A={};o(A,{lead:()=>L,purchase:()=>C,purchaseWithLiFatId:()=>T});var S=require("@walkeros/core"),k="https://api.linkedin.com/rest/conversionEvents",z={headers:{Authorization:"Bearer s3cr3t","Content-Type":"application/json","X-Restli-Protocol-Version":"2.0.0","X-RestLi-Method":"BATCH_CREATE","Linkedin-Version":"202604"}},C={title:"Purchase",description:"A completed order is sent to the LinkedIn Conversions API with conversion value, currency, and hashed email.",in:(0,S.getEvent)("order complete",{timestamp:17000009e5,data:{total:249.99,currency:"EUR"},user:{email:"jane@example.com"},source:{type:"server",id:"https://shop.example.com",previous_id:""}}),mapping:{settings:{conversion:{map:{value:"data.total",currency:{key:"data.currency",value:"EUR"}}}}},out:[["sendServer",k,JSON.stringify({elements:[{conversion:"urn:lla:llaPartnerConversion:12345678",conversionHappenedAt:17000009e5,user:{userIds:[{idType:"SHA256_EMAIL",idValue:"8c87b489ce35cf2e2f39f80e282cb2e804932a56a213983eeeb428407d43b52d"}]},eventId:"1700000900000-gr0up-1",conversionValue:{currencyCode:"EUR",amount:"249.99"}}]}),z]]},L={title:"Lead",description:"A form submission is posted to LinkedIn as a conversion with the SHA-256 hashed email as the user identifier.",in:(0,S.getEvent)("form submit",{timestamp:1700000901e3,user:{email:"user@example.com"},source:{type:"server",id:"https://example.com",previous_id:""}}),mapping:void 0,out:[["sendServer",k,JSON.stringify({elements:[{conversion:"urn:lla:llaPartnerConversion:12345678",conversionHappenedAt:1700000901e3,user:{userIds:[{idType:"SHA256_EMAIL",idValue:"b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514"}]},eventId:"1700000901000-gr0up-1"}]}),z]]},T={title:"Purchase with li_fat_id",description:"A purchase is sent to LinkedIn with both the hashed email and the first-party li_fat_id tracking identifier.",in:(0,S.getEvent)("order complete",{timestamp:1700000902e3,data:{total:89.99,currency:"USD"},user:{email:"buyer@co.com"},context:{li_fat_id:["abc123-fat-id",0]},source:{type:"server",id:"https://shop.example.com",previous_id:""}}),mapping:{settings:{conversion:{map:{value:"data.total",currency:{key:"data.currency",value:"USD"}}}},data:{map:{user_data:{map:{li_fat_id:"context.li_fat_id"}}}}},out:[["sendServer",k,JSON.stringify({elements:[{conversion:"urn:lla:llaPartnerConversion:12345678",conversionHappenedAt:1700000902e3,user:{userIds:[{idType:"SHA256_EMAIL",idValue:"484c39bfb51212665d9673805c112b5ba04cbf0460b6d3f00bcdc18b92afed66"},{idType:"LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID",idValue:"abc123-fat-id"}]},eventId:"1700000902000-gr0up-1",conversionValue:{currencyCode:"USD",amount:"89.99"}}]}),z]]};//# 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/primitives.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 * from './primitives';\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';\nimport { ApiVersionSchema } from './primitives';\n\nexport const SettingsSchema = z.object({\n accessToken: z\n .string()\n .min(1)\n .describe(\n 'LinkedIn OAuth 2.0 Bearer token for Conversions API authentication (like AQX...)',\n ),\n conversionRuleId: z\n .string()\n .regex(/^[0-9]+$/, 'Conversion rule ID must contain only digits')\n .describe(\n 'Default LinkedIn conversion rule ID from Campaign Manager (like 12345678)',\n ),\n apiVersion: ApiVersionSchema.describe(\n 'Linkedin-Version header value in YYYYMM format (like 202604)',\n ).optional(),\n doNotHash: z\n .array(z.string())\n .describe(\n \"Array of user data fields that should not be hashed (like ['email'])\",\n )\n .optional(),\n url: z\n .string()\n .url()\n .describe(\n 'Custom URL for LinkedIn Conversions API endpoint (like https://api.linkedin.com/rest/)',\n )\n .optional(),\n user_data: z\n .record(z.string(), z.string())\n .describe(\n \"Mapping configuration for user data fields (like { email: 'user.email', li_fat_id: 'context.li_fat_id' })\",\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * LinkedIn User ID Type Enum\n * Types of user identifiers supported by LinkedIn Conversions API\n */\nexport const UserIdTypeSchema = z.enum([\n 'SHA256_EMAIL',\n 'LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID',\n 'ACXIOM_ID',\n 'ORACLE_MOAT_ID',\n]);\n\n/**\n * API Version Schema\n * LinkedIn-Version header value in YYYYMM format\n */\nexport const ApiVersionSchema = z\n .string()\n .regex(/^\\d{6}$/, 'API version must be in YYYYMM format (e.g. 202604)');\n","import { z } from '@walkeros/core/dev';\n\n/**\n * LinkedIn Conversions API Mapping Schema\n *\n * Per-event override for conversion rule, value, and currency.\n * The `conversion` field is a mapping value that resolves to an object\n * with optional `ruleId`, `value`, and `currency` keys.\n */\nexport const MappingSchema = z.object({\n conversion: z\n .object({\n ruleId: z\n .string()\n .describe('Override conversion rule ID for this event')\n .optional(),\n value: z\n .union([z.string(), z.number()])\n .describe('Conversion monetary value')\n .optional(),\n currency: z\n .string()\n .describe('ISO 4217 currency code (like USD, EUR)')\n .optional(),\n })\n .describe('Per-event conversion override with ruleId, value, and currency')\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 { SendDataValue, SendResponse } from '@walkeros/core';\nimport type { SendServerOptions } from '@walkeros/server-core';\nimport type { Env } from '../types';\n\n/**\n * Example environment configurations for LinkedIn Conversions API destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring actual HTTP requests.\n */\n\n/**\n * Mock sendServer function that simulates successful HTTP responses\n */\nasync function mockSendServer(\n url: string,\n data?: SendDataValue,\n options?: SendServerOptions,\n): Promise<SendResponse> {\n return {\n ok: true,\n data: {},\n };\n}\n\n/**\n * Standard mock environment for push operations\n *\n * Use this for testing LinkedIn Conversions API events without making\n * actual HTTP requests to LinkedIn's servers.\n */\nexport const push: Env = {\n sendServer: mockSendServer,\n};\n\nexport const simulation = ['sendServer'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\n/**\n * LinkedIn Conversions API step examples.\n *\n * At push time, the destination calls\n * `env.sendServer(endpoint, JSON.stringify(body), options)` where\n * endpoint = `${settings.url}conversionEvents`\n * body = `{ elements: [conversionEvent] }`\n *\n * Test fixture pins `conversionRuleId = '12345678'` and the default url, so\n * every call targets:\n * https://api.linkedin.com/rest/conversionEvents\n *\n * Each conversion event is emitted with keys in the destination's build order:\n * 1. conversion (`urn:lla:llaPartnerConversion:<ruleId>`)\n * 2. conversionHappenedAt (raw `event.timestamp` in ms)\n * 3. user\n * 4. eventId\n * 5. conversionValue (only when mapping provides a value)\n *\n * `options` carries the Authorization + LinkedIn-specific headers.\n */\nconst ENDPOINT = 'https://api.linkedin.com/rest/conversionEvents';\nconst OPTIONS = {\n headers: {\n Authorization: 'Bearer s3cr3t',\n 'Content-Type': 'application/json',\n 'X-Restli-Protocol-Version': '2.0.0',\n 'X-RestLi-Method': 'BATCH_CREATE',\n 'Linkedin-Version': '202604',\n },\n};\n\nexport const purchase: Flow.StepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000900000,\n data: { total: 249.99, currency: 'EUR' },\n user: { email: 'jane@example.com' },\n source: { type: 'server', id: 'https://shop.example.com', previous_id: '' },\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n value: 'data.total',\n currency: { key: 'data.currency', value: 'EUR' },\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n elements: [\n {\n conversion: 'urn:lla:llaPartnerConversion:12345678',\n conversionHappenedAt: 1700000900000,\n user: {\n userIds: [\n {\n idType: 'SHA256_EMAIL',\n // sha256('jane@example.com')\n idValue:\n '8c87b489ce35cf2e2f39f80e282cb2e804932a56a213983eeeb428407d43b52d',\n },\n ],\n },\n eventId: '1700000900000-gr0up-1',\n conversionValue: {\n currencyCode: 'EUR',\n amount: '249.99',\n },\n },\n ],\n }),\n OPTIONS,\n ],\n ],\n};\n\nexport const lead: Flow.StepExample = {\n in: getEvent('form submit', {\n timestamp: 1700000901000,\n user: { email: 'user@example.com' },\n source: { type: 'server', id: 'https://example.com', previous_id: '' },\n }),\n mapping: undefined,\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n elements: [\n {\n conversion: 'urn:lla:llaPartnerConversion:12345678',\n conversionHappenedAt: 1700000901000,\n user: {\n userIds: [\n {\n idType: 'SHA256_EMAIL',\n // sha256('user@example.com')\n idValue:\n 'b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514',\n },\n ],\n },\n eventId: '1700000901000-gr0up-1',\n },\n ],\n }),\n OPTIONS,\n ],\n ],\n};\n\nexport const purchaseWithLiFatId: Flow.StepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000902000,\n data: { total: 89.99, currency: 'USD' },\n user: { email: 'buyer@co.com' },\n context: { li_fat_id: ['abc123-fat-id', 0] },\n source: { type: 'server', id: 'https://shop.example.com', previous_id: '' },\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n value: 'data.total',\n currency: { key: 'data.currency', value: 'USD' },\n },\n },\n },\n data: {\n map: {\n user_data: {\n map: {\n li_fat_id: 'context.li_fat_id',\n },\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n elements: [\n {\n conversion: 'urn:lla:llaPartnerConversion:12345678',\n conversionHappenedAt: 1700000902000,\n user: {\n userIds: [\n {\n idType: 'SHA256_EMAIL',\n // sha256('buyer@co.com')\n idValue:\n '484c39bfb51212665d9673805c112b5ba04cbf0460b6d3f00bcdc18b92afed66',\n },\n {\n idType: 'LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID',\n idValue: 'abc123-fat-id',\n },\n ],\n },\n eventId: '1700000902000-gr0up-1',\n conversionValue: {\n currencyCode: 'USD',\n amount: '89.99',\n },\n },\n ],\n }),\n OPTIONS,\n ],\n ],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,IAAAC,cAAkB;;;ACAlB,iBAAkB;AAMX,IAAM,mBAAmB,aAAE,KAAK;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAMM,IAAM,mBAAmB,aAC7B,OAAO,EACP,MAAM,WAAW,oDAAoD;;;ADhBjE,IAAM,iBAAiB,cAAE,OAAO;AAAA,EACrC,aAAa,cACV,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF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cAAc;AAAA,cACd,QAAQ;AAAA,YACV;AAAA,UACF;AAAA,QACF;AAAA,MACF,CAAC;AAAA,MACD;AAAA,IACF;AAAA,EACF;AACF;","names":["import_dev","import_dev","import_dev"]}
|
|
1
|
+
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/primitives.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 * from './primitives';\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';\nimport { ApiVersionSchema } from './primitives';\n\nexport const SettingsSchema = z.object({\n accessToken: z\n .string()\n .min(1)\n .describe(\n 'LinkedIn OAuth 2.0 Bearer token for Conversions API authentication (like AQX...)',\n ),\n conversionRuleId: z\n .string()\n .regex(/^[0-9]+$/, 'Conversion rule ID must contain only digits')\n .describe(\n 'Default LinkedIn conversion rule ID from Campaign Manager (like 12345678)',\n ),\n apiVersion: ApiVersionSchema.describe(\n 'Linkedin-Version header value in YYYYMM format (like 202604)',\n ).optional(),\n doNotHash: z\n .array(z.string())\n .describe(\n \"Array of user data fields that should not be hashed (like ['email'])\",\n )\n .optional(),\n url: z\n .string()\n .url()\n .describe(\n 'Custom URL for LinkedIn Conversions API endpoint (like https://api.linkedin.com/rest/)',\n )\n .optional(),\n user_data: z\n .record(z.string(), z.string())\n .describe(\n \"Mapping configuration for user data fields (like { email: 'user.email', li_fat_id: 'context.li_fat_id' })\",\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * LinkedIn User ID Type Enum\n * Types of user identifiers supported by LinkedIn Conversions API\n */\nexport const UserIdTypeSchema = z.enum([\n 'SHA256_EMAIL',\n 'LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID',\n 'ACXIOM_ID',\n 'ORACLE_MOAT_ID',\n]);\n\n/**\n * API Version Schema\n * LinkedIn-Version header value in YYYYMM format\n */\nexport const ApiVersionSchema = z\n .string()\n .regex(/^\\d{6}$/, 'API version must be in YYYYMM format (e.g. 202604)');\n","import { z } from '@walkeros/core/dev';\n\n/**\n * LinkedIn Conversions API Mapping Schema\n *\n * Per-event override for conversion rule, value, and currency.\n * The `conversion` field is a mapping value that resolves to an object\n * with optional `ruleId`, `value`, and `currency` keys.\n */\nexport const MappingSchema = z.object({\n conversion: z\n .object({\n ruleId: z\n .string()\n .describe('Override conversion rule ID for this event')\n .optional(),\n value: z\n .union([z.string(), z.number()])\n .describe('Conversion monetary value')\n .optional(),\n currency: z\n .string()\n .describe('ISO 4217 currency code (like USD, EUR)')\n .optional(),\n })\n .describe('Per-event conversion override with ruleId, value, and currency')\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 { SendDataValue, SendResponse } from '@walkeros/core';\nimport type { SendServerOptions } from '@walkeros/server-core';\nimport type { Env } from '../types';\n\n/**\n * Example environment configurations for LinkedIn Conversions API destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring actual HTTP requests.\n */\n\n/**\n * Mock sendServer function that simulates successful HTTP responses\n */\nasync function mockSendServer(\n url: string,\n data?: SendDataValue,\n options?: SendServerOptions,\n): Promise<SendResponse> {\n return {\n ok: true,\n data: {},\n };\n}\n\n/**\n * Standard mock environment for push operations\n *\n * Use this for testing LinkedIn Conversions API events without making\n * actual HTTP requests to LinkedIn's servers.\n */\nexport const push: Env = {\n sendServer: mockSendServer,\n};\n\nexport const simulation = ['sendServer'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\n/**\n * LinkedIn Conversions API step examples.\n *\n * At push time, the destination calls\n * `env.sendServer(endpoint, JSON.stringify(body), options)` where\n * endpoint = `${settings.url}conversionEvents`\n * body = `{ elements: [conversionEvent] }`\n *\n * Test fixture pins `conversionRuleId = '12345678'` and the default url, so\n * every call targets:\n * https://api.linkedin.com/rest/conversionEvents\n *\n * Each conversion event is emitted with keys in the destination's build order:\n * 1. conversion (`urn:lla:llaPartnerConversion:<ruleId>`)\n * 2. conversionHappenedAt (raw `event.timestamp` in ms)\n * 3. user\n * 4. eventId\n * 5. conversionValue (only when mapping provides a value)\n *\n * `options` carries the Authorization + LinkedIn-specific headers.\n */\nconst ENDPOINT = 'https://api.linkedin.com/rest/conversionEvents';\nconst OPTIONS = {\n headers: {\n Authorization: 'Bearer s3cr3t',\n 'Content-Type': 'application/json',\n 'X-Restli-Protocol-Version': '2.0.0',\n 'X-RestLi-Method': 'BATCH_CREATE',\n 'Linkedin-Version': '202604',\n },\n};\n\nexport const purchase: Flow.StepExample = {\n title: 'Purchase',\n description:\n 'A completed order is sent to the LinkedIn Conversions API with conversion value, currency, and hashed email.',\n in: getEvent('order complete', {\n timestamp: 1700000900000,\n data: { total: 249.99, currency: 'EUR' },\n user: { email: 'jane@example.com' },\n source: { type: 'server', id: 'https://shop.example.com', previous_id: '' },\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n value: 'data.total',\n currency: { key: 'data.currency', value: 'EUR' },\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n elements: [\n {\n conversion: 'urn:lla:llaPartnerConversion:12345678',\n conversionHappenedAt: 1700000900000,\n user: {\n userIds: [\n {\n idType: 'SHA256_EMAIL',\n // sha256('jane@example.com')\n idValue:\n '8c87b489ce35cf2e2f39f80e282cb2e804932a56a213983eeeb428407d43b52d',\n },\n ],\n },\n eventId: '1700000900000-gr0up-1',\n conversionValue: {\n currencyCode: 'EUR',\n amount: '249.99',\n },\n },\n ],\n }),\n OPTIONS,\n ],\n ],\n};\n\nexport const lead: Flow.StepExample = {\n title: 'Lead',\n description:\n 'A form submission is posted to LinkedIn as a conversion with the SHA-256 hashed email as the user identifier.',\n in: getEvent('form submit', {\n timestamp: 1700000901000,\n user: { email: 'user@example.com' },\n source: { type: 'server', id: 'https://example.com', previous_id: '' },\n }),\n mapping: undefined,\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n elements: [\n {\n conversion: 'urn:lla:llaPartnerConversion:12345678',\n conversionHappenedAt: 1700000901000,\n user: {\n userIds: [\n {\n idType: 'SHA256_EMAIL',\n // sha256('user@example.com')\n idValue:\n 'b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514',\n },\n ],\n },\n eventId: '1700000901000-gr0up-1',\n },\n ],\n }),\n OPTIONS,\n ],\n ],\n};\n\nexport const purchaseWithLiFatId: Flow.StepExample = {\n title: 'Purchase with li_fat_id',\n description:\n 'A purchase is sent to LinkedIn with both the hashed email and the first-party li_fat_id tracking identifier.',\n in: getEvent('order complete', {\n timestamp: 1700000902000,\n data: { total: 89.99, currency: 'USD' },\n user: { email: 'buyer@co.com' },\n context: { li_fat_id: ['abc123-fat-id', 0] },\n source: { type: 'server', id: 'https://shop.example.com', previous_id: '' },\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n value: 'data.total',\n currency: { key: 'data.currency', value: 'USD' },\n },\n },\n },\n data: {\n map: {\n user_data: {\n map: {\n li_fat_id: 'context.li_fat_id',\n },\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n elements: [\n {\n conversion: 'urn:lla:llaPartnerConversion:12345678',\n conversionHappenedAt: 1700000902000,\n user: {\n userIds: [\n {\n idType: 'SHA256_EMAIL',\n // sha256('buyer@co.com')\n idValue:\n '484c39bfb51212665d9673805c112b5ba04cbf0460b6d3f00bcdc18b92afed66',\n },\n {\n idType: 'LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID',\n idValue: 'abc123-fat-id',\n },\n ],\n },\n eventId: '1700000902000-gr0up-1',\n conversionValue: {\n currencyCode: 'USD',\n amount: '89.99',\n },\n },\n ],\n }),\n OPTIONS,\n ],\n ],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,IAAAC,cAAkB;;;ACAlB,iBAAkB;AAMX,IAAM,mBAAmB,aAAE,KAAK;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAMM,IAAM,mBAAmB,aAC7B,OAAO,EACP,MAAM,WAAW,oDAAoD;;;ADhBjE,IAAM,iBAAiB,cAAE,OAAO;AAAA,EACrC,aAAa,cACV,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,kBAAkB,cACf,OAAO,EACP,MAAM,YAAY,6CAA6C,EAC/D;AAAA,IACC;AAAA,EACF;AAAA,EACF,YAAY,iBAAiB;AAAA,IAC3B;AAAA,EACF,EAAE,SAAS;AAAA,EACX,WAAW,cACR,MAAM,cAAE,OAAO,CAAC,EAChB;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,KAAK,cACF,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,WAAW,cACR,OAAO,cAAE,OAAO,GAAG,cAAE,OAAO,CAAC,EAC7B;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AEtCD,IAAAC,cAAkB;AASX,IAAM,gBAAgB,cAAE,OAAO;AAAA,EACpC,YAAY,cACT,OAAO;AAAA,IACN,QAAQ,cACL,OAAO,EACP,SAAS,4CAA4C,EACrD,SAAS;AAAA,IACZ,OAAO,cACJ,MAAM,CAAC,cAAE,OAAO,GAAG,cAAE,OAAO,CAAC,CAAC,EAC9B,SAAS,2BAA2B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,EACD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,YAAY;AAAA,QACV,KAAK;AAAA,UACH,OAAO;AAAA,UACP,UAAU,EAAE,KAAK,iBAAiB,OAAO,MAAM;AAAA,QACjD;AAAA,MACF;AAAA,IACF;AAAA,IACA,MAAM;AAAA,MACJ,KAAK;AAAA,QACH,WAAW;AAAA,UACT,KAAK;AAAA,YACH,WAAW;AAAA,UACb;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA,KAAK,UAAU;AAAA,QACb,UAAU;AAAA,UACR;AAAA,YACE,YAAY;AAAA,YACZ,sBAAsB;AAAA,YACtB,MAAM;AAAA,cACJ,SAAS;AAAA,gBACP;AAAA,kBACE,QAAQ;AAAA;AAAA,kBAER,SACE;AAAA,gBACJ;AAAA,gBACA;AAAA,kBACE,QAAQ;AAAA,kBACR,SAAS;AAAA,gBACX;AAAA,cACF;AAAA,YACF;AAAA,YACA,SAAS;AAAA,YACT,iBAAiB;AAAA,cACf,cAAc;AAAA,cACd,QAAQ;AAAA,YACV;AAAA,UACF;AAAA,QACF;AAAA,MACF,CAAC;AAAA,MACD;AAAA,IACF;AAAA,EACF;AACF;","names":["import_dev","import_dev","import_dev"]}
|
package/dist/dev.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,r=(r,
|
|
1
|
+
var e=Object.defineProperty,r=(r,i)=>{for(var n in i)e(r,n,{get:i[n],enumerable:!0})},i={};r(i,{ApiVersionSchema:()=>s,MappingSchema:()=>l,SettingsSchema:()=>c,UserIdTypeSchema:()=>a,mapping:()=>p,settings:()=>u});import{zodToSchema as n}from"@walkeros/core/dev";import{z as t}from"@walkeros/core/dev";import{z as o}from"@walkeros/core/dev";var a=o.enum(["SHA256_EMAIL","LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID","ACXIOM_ID","ORACLE_MOAT_ID"]),s=o.string().regex(/^\d{6}$/,"API version must be in YYYYMM format (e.g. 202604)"),c=t.object({accessToken:t.string().min(1).describe("LinkedIn OAuth 2.0 Bearer token for Conversions API authentication (like AQX...)"),conversionRuleId:t.string().regex(/^[0-9]+$/,"Conversion rule ID must contain only digits").describe("Default LinkedIn conversion rule ID from Campaign Manager (like 12345678)"),apiVersion:s.describe("Linkedin-Version header value in YYYYMM format (like 202604)").optional(),doNotHash:t.array(t.string()).describe("Array of user data fields that should not be hashed (like ['email'])").optional(),url:t.string().url().describe("Custom URL for LinkedIn Conversions API endpoint (like https://api.linkedin.com/rest/)").optional(),user_data:t.record(t.string(),t.string()).describe("Mapping configuration for user data fields (like { email: 'user.email', li_fat_id: 'context.li_fat_id' })").optional()});import{z as d}from"@walkeros/core/dev";var l=d.object({conversion:d.object({ruleId:d.string().describe("Override conversion rule ID for this event").optional(),value:d.union([d.string(),d.number()]).describe("Conversion monetary value").optional(),currency:d.string().describe("ISO 4217 currency code (like USD, EUR)").optional()}).describe("Per-event conversion override with ruleId, value, and currency").optional()}),u=n(c),p=n(l),m={};r(m,{env:()=>v,step:()=>I});var v={};r(v,{push:()=>f,simulation:()=>h});var f={sendServer:async function(e,r,i){return{ok:!0,data:{}}}},h=["sendServer"],I={};r(I,{lead:()=>y,purchase:()=>A,purchaseWithLiFatId:()=>k});import{getEvent as b}from"@walkeros/core";var _="https://api.linkedin.com/rest/conversionEvents",g={headers:{Authorization:"Bearer s3cr3t","Content-Type":"application/json","X-Restli-Protocol-Version":"2.0.0","X-RestLi-Method":"BATCH_CREATE","Linkedin-Version":"202604"}},A={title:"Purchase",description:"A completed order is sent to the LinkedIn Conversions API with conversion value, currency, and hashed email.",in:b("order complete",{timestamp:17000009e5,data:{total:249.99,currency:"EUR"},user:{email:"jane@example.com"},source:{type:"server",id:"https://shop.example.com",previous_id:""}}),mapping:{settings:{conversion:{map:{value:"data.total",currency:{key:"data.currency",value:"EUR"}}}}},out:[["sendServer",_,JSON.stringify({elements:[{conversion:"urn:lla:llaPartnerConversion:12345678",conversionHappenedAt:17000009e5,user:{userIds:[{idType:"SHA256_EMAIL",idValue:"8c87b489ce35cf2e2f39f80e282cb2e804932a56a213983eeeb428407d43b52d"}]},eventId:"1700000900000-gr0up-1",conversionValue:{currencyCode:"EUR",amount:"249.99"}}]}),g]]},y={title:"Lead",description:"A form submission is posted to LinkedIn as a conversion with the SHA-256 hashed email as the user identifier.",in:b("form submit",{timestamp:1700000901e3,user:{email:"user@example.com"},source:{type:"server",id:"https://example.com",previous_id:""}}),mapping:void 0,out:[["sendServer",_,JSON.stringify({elements:[{conversion:"urn:lla:llaPartnerConversion:12345678",conversionHappenedAt:1700000901e3,user:{userIds:[{idType:"SHA256_EMAIL",idValue:"b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514"}]},eventId:"1700000901000-gr0up-1"}]}),g]]},k={title:"Purchase with li_fat_id",description:"A purchase is sent to LinkedIn with both the hashed email and the first-party li_fat_id tracking identifier.",in:b("order complete",{timestamp:1700000902e3,data:{total:89.99,currency:"USD"},user:{email:"buyer@co.com"},context:{li_fat_id:["abc123-fat-id",0]},source:{type:"server",id:"https://shop.example.com",previous_id:""}}),mapping:{settings:{conversion:{map:{value:"data.total",currency:{key:"data.currency",value:"USD"}}}},data:{map:{user_data:{map:{li_fat_id:"context.li_fat_id"}}}}},out:[["sendServer",_,JSON.stringify({elements:[{conversion:"urn:lla:llaPartnerConversion:12345678",conversionHappenedAt:1700000902e3,user:{userIds:[{idType:"SHA256_EMAIL",idValue:"484c39bfb51212665d9673805c112b5ba04cbf0460b6d3f00bcdc18b92afed66"},{idType:"LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID",idValue:"abc123-fat-id"}]},eventId:"1700000902000-gr0up-1",conversionValue:{currencyCode:"USD",amount:"89.99"}}]}),g]]};export{m as examples,i 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/primitives.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 * from './primitives';\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';\nimport { ApiVersionSchema } from './primitives';\n\nexport const SettingsSchema = z.object({\n accessToken: z\n .string()\n .min(1)\n .describe(\n 'LinkedIn OAuth 2.0 Bearer token for Conversions API authentication (like AQX...)',\n ),\n conversionRuleId: z\n .string()\n .regex(/^[0-9]+$/, 'Conversion rule ID must contain only digits')\n .describe(\n 'Default LinkedIn conversion rule ID from Campaign Manager (like 12345678)',\n ),\n apiVersion: ApiVersionSchema.describe(\n 'Linkedin-Version header value in YYYYMM format (like 202604)',\n ).optional(),\n doNotHash: z\n .array(z.string())\n .describe(\n \"Array of user data fields that should not be hashed (like ['email'])\",\n )\n .optional(),\n url: z\n .string()\n .url()\n .describe(\n 'Custom URL for LinkedIn Conversions API endpoint (like https://api.linkedin.com/rest/)',\n )\n .optional(),\n user_data: z\n .record(z.string(), z.string())\n .describe(\n \"Mapping configuration for user data fields (like { email: 'user.email', li_fat_id: 'context.li_fat_id' })\",\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * LinkedIn User ID Type Enum\n * Types of user identifiers supported by LinkedIn Conversions API\n */\nexport const UserIdTypeSchema = z.enum([\n 'SHA256_EMAIL',\n 'LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID',\n 'ACXIOM_ID',\n 'ORACLE_MOAT_ID',\n]);\n\n/**\n * API Version Schema\n * LinkedIn-Version header value in YYYYMM format\n */\nexport const ApiVersionSchema = z\n .string()\n .regex(/^\\d{6}$/, 'API version must be in YYYYMM format (e.g. 202604)');\n","import { z } from '@walkeros/core/dev';\n\n/**\n * LinkedIn Conversions API Mapping Schema\n *\n * Per-event override for conversion rule, value, and currency.\n * The `conversion` field is a mapping value that resolves to an object\n * with optional `ruleId`, `value`, and `currency` keys.\n */\nexport const MappingSchema = z.object({\n conversion: z\n .object({\n ruleId: z\n .string()\n .describe('Override conversion rule ID for this event')\n .optional(),\n value: z\n .union([z.string(), z.number()])\n .describe('Conversion monetary value')\n .optional(),\n currency: z\n .string()\n .describe('ISO 4217 currency code (like USD, EUR)')\n .optional(),\n })\n .describe('Per-event conversion override with ruleId, value, and currency')\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 { SendDataValue, SendResponse } from '@walkeros/core';\nimport type { SendServerOptions } from '@walkeros/server-core';\nimport type { Env } from '../types';\n\n/**\n * Example environment configurations for LinkedIn Conversions API destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring actual HTTP requests.\n */\n\n/**\n * Mock sendServer function that simulates successful HTTP responses\n */\nasync function mockSendServer(\n url: string,\n data?: SendDataValue,\n options?: SendServerOptions,\n): Promise<SendResponse> {\n return {\n ok: true,\n data: {},\n };\n}\n\n/**\n * Standard mock environment for push operations\n *\n * Use this for testing LinkedIn Conversions API events without making\n * actual HTTP requests to LinkedIn's servers.\n */\nexport const push: Env = {\n sendServer: mockSendServer,\n};\n\nexport const simulation = ['sendServer'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\n/**\n * LinkedIn Conversions API step examples.\n *\n * At push time, the destination calls\n * `env.sendServer(endpoint, JSON.stringify(body), options)` where\n * endpoint = `${settings.url}conversionEvents`\n * body = `{ elements: [conversionEvent] }`\n *\n * Test fixture pins `conversionRuleId = '12345678'` and the default url, so\n * every call targets:\n * https://api.linkedin.com/rest/conversionEvents\n *\n * Each conversion event is emitted with keys in the destination's build order:\n * 1. conversion (`urn:lla:llaPartnerConversion:<ruleId>`)\n * 2. conversionHappenedAt (raw `event.timestamp` in ms)\n * 3. user\n * 4. eventId\n * 5. conversionValue (only when mapping provides a value)\n *\n * `options` carries the Authorization + LinkedIn-specific headers.\n */\nconst ENDPOINT = 'https://api.linkedin.com/rest/conversionEvents';\nconst OPTIONS = {\n headers: {\n Authorization: 'Bearer s3cr3t',\n 'Content-Type': 'application/json',\n 'X-Restli-Protocol-Version': '2.0.0',\n 'X-RestLi-Method': 'BATCH_CREATE',\n 'Linkedin-Version': '202604',\n },\n};\n\nexport const purchase: Flow.StepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000900000,\n data: { total: 249.99, currency: 'EUR' },\n user: { email: 'jane@example.com' },\n source: { type: 'server', id: 'https://shop.example.com', previous_id: '' },\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n value: 'data.total',\n currency: { key: 'data.currency', value: 'EUR' },\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n elements: [\n {\n conversion: 'urn:lla:llaPartnerConversion:12345678',\n conversionHappenedAt: 1700000900000,\n user: {\n userIds: [\n {\n idType: 'SHA256_EMAIL',\n // sha256('jane@example.com')\n idValue:\n '8c87b489ce35cf2e2f39f80e282cb2e804932a56a213983eeeb428407d43b52d',\n },\n ],\n },\n eventId: '1700000900000-gr0up-1',\n conversionValue: {\n currencyCode: 'EUR',\n amount: '249.99',\n },\n },\n ],\n }),\n OPTIONS,\n ],\n ],\n};\n\nexport const lead: Flow.StepExample = {\n in: getEvent('form submit', {\n timestamp: 1700000901000,\n user: { email: 'user@example.com' },\n source: { type: 'server', id: 'https://example.com', previous_id: '' },\n }),\n mapping: undefined,\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n elements: [\n {\n conversion: 'urn:lla:llaPartnerConversion:12345678',\n conversionHappenedAt: 1700000901000,\n user: {\n userIds: [\n {\n idType: 'SHA256_EMAIL',\n // sha256('user@example.com')\n idValue:\n 'b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514',\n },\n ],\n },\n eventId: '1700000901000-gr0up-1',\n },\n ],\n }),\n OPTIONS,\n ],\n ],\n};\n\nexport const purchaseWithLiFatId: Flow.StepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000902000,\n data: { total: 89.99, currency: 'USD' },\n user: { email: 'buyer@co.com' },\n context: { li_fat_id: ['abc123-fat-id', 0] },\n source: { type: 'server', id: 'https://shop.example.com', previous_id: '' },\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n value: 'data.total',\n currency: { key: 'data.currency', value: 'USD' },\n },\n },\n },\n data: {\n map: {\n user_data: {\n map: {\n li_fat_id: 'context.li_fat_id',\n },\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n elements: [\n {\n conversion: 'urn:lla:llaPartnerConversion:12345678',\n conversionHappenedAt: 1700000902000,\n user: {\n userIds: [\n {\n idType: 'SHA256_EMAIL',\n // sha256('buyer@co.com')\n idValue:\n '484c39bfb51212665d9673805c112b5ba04cbf0460b6d3f00bcdc18b92afed66',\n },\n {\n idType: 'LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID',\n idValue: 'abc123-fat-id',\n },\n ],\n },\n eventId: '1700000902000-gr0up-1',\n conversionValue: {\n currencyCode: 'USD',\n amount: '89.99',\n },\n },\n ],\n }),\n OPTIONS,\n ],\n ],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,KAAAA,UAAS;;;ACAlB,SAAS,SAAS;AAMX,IAAM,mBAAmB,EAAE,KAAK;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAMM,IAAM,mBAAmB,EAC7B,OAAO,EACP,MAAM,WAAW,oDAAoD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AAA,gBACJ;AAAA,gBACA;AAAA,kBACE,QAAQ;AAAA,kBACR,SAAS;AAAA,gBACX;AAAA,cACF;AAAA,YACF;AAAA,YACA,SAAS;AAAA,YACT,iBAAiB;AAAA,cACf,cAAc;AAAA,cACd,QAAQ;AAAA,YACV;AAAA,UACF;AAAA,QACF;AAAA,MACF,CAAC;AAAA,MACD;AAAA,IACF;AAAA,EACF;AACF;","names":["z","z","z"]}
|
|
1
|
+
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/primitives.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 * from './primitives';\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';\nimport { ApiVersionSchema } from './primitives';\n\nexport const SettingsSchema = z.object({\n accessToken: z\n .string()\n .min(1)\n .describe(\n 'LinkedIn OAuth 2.0 Bearer token for Conversions API authentication (like AQX...)',\n ),\n conversionRuleId: z\n .string()\n .regex(/^[0-9]+$/, 'Conversion rule ID must contain only digits')\n .describe(\n 'Default LinkedIn conversion rule ID from Campaign Manager (like 12345678)',\n ),\n apiVersion: ApiVersionSchema.describe(\n 'Linkedin-Version header value in YYYYMM format (like 202604)',\n ).optional(),\n doNotHash: z\n .array(z.string())\n .describe(\n \"Array of user data fields that should not be hashed (like ['email'])\",\n )\n .optional(),\n url: z\n .string()\n .url()\n .describe(\n 'Custom URL for LinkedIn Conversions API endpoint (like https://api.linkedin.com/rest/)',\n )\n .optional(),\n user_data: z\n .record(z.string(), z.string())\n .describe(\n \"Mapping configuration for user data fields (like { email: 'user.email', li_fat_id: 'context.li_fat_id' })\",\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * LinkedIn User ID Type Enum\n * Types of user identifiers supported by LinkedIn Conversions API\n */\nexport const UserIdTypeSchema = z.enum([\n 'SHA256_EMAIL',\n 'LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID',\n 'ACXIOM_ID',\n 'ORACLE_MOAT_ID',\n]);\n\n/**\n * API Version Schema\n * LinkedIn-Version header value in YYYYMM format\n */\nexport const ApiVersionSchema = z\n .string()\n .regex(/^\\d{6}$/, 'API version must be in YYYYMM format (e.g. 202604)');\n","import { z } from '@walkeros/core/dev';\n\n/**\n * LinkedIn Conversions API Mapping Schema\n *\n * Per-event override for conversion rule, value, and currency.\n * The `conversion` field is a mapping value that resolves to an object\n * with optional `ruleId`, `value`, and `currency` keys.\n */\nexport const MappingSchema = z.object({\n conversion: z\n .object({\n ruleId: z\n .string()\n .describe('Override conversion rule ID for this event')\n .optional(),\n value: z\n .union([z.string(), z.number()])\n .describe('Conversion monetary value')\n .optional(),\n currency: z\n .string()\n .describe('ISO 4217 currency code (like USD, EUR)')\n .optional(),\n })\n .describe('Per-event conversion override with ruleId, value, and currency')\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 { SendDataValue, SendResponse } from '@walkeros/core';\nimport type { SendServerOptions } from '@walkeros/server-core';\nimport type { Env } from '../types';\n\n/**\n * Example environment configurations for LinkedIn Conversions API destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring actual HTTP requests.\n */\n\n/**\n * Mock sendServer function that simulates successful HTTP responses\n */\nasync function mockSendServer(\n url: string,\n data?: SendDataValue,\n options?: SendServerOptions,\n): Promise<SendResponse> {\n return {\n ok: true,\n data: {},\n };\n}\n\n/**\n * Standard mock environment for push operations\n *\n * Use this for testing LinkedIn Conversions API events without making\n * actual HTTP requests to LinkedIn's servers.\n */\nexport const push: Env = {\n sendServer: mockSendServer,\n};\n\nexport const simulation = ['sendServer'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\n/**\n * LinkedIn Conversions API step examples.\n *\n * At push time, the destination calls\n * `env.sendServer(endpoint, JSON.stringify(body), options)` where\n * endpoint = `${settings.url}conversionEvents`\n * body = `{ elements: [conversionEvent] }`\n *\n * Test fixture pins `conversionRuleId = '12345678'` and the default url, so\n * every call targets:\n * https://api.linkedin.com/rest/conversionEvents\n *\n * Each conversion event is emitted with keys in the destination's build order:\n * 1. conversion (`urn:lla:llaPartnerConversion:<ruleId>`)\n * 2. conversionHappenedAt (raw `event.timestamp` in ms)\n * 3. user\n * 4. eventId\n * 5. conversionValue (only when mapping provides a value)\n *\n * `options` carries the Authorization + LinkedIn-specific headers.\n */\nconst ENDPOINT = 'https://api.linkedin.com/rest/conversionEvents';\nconst OPTIONS = {\n headers: {\n Authorization: 'Bearer s3cr3t',\n 'Content-Type': 'application/json',\n 'X-Restli-Protocol-Version': '2.0.0',\n 'X-RestLi-Method': 'BATCH_CREATE',\n 'Linkedin-Version': '202604',\n },\n};\n\nexport const purchase: Flow.StepExample = {\n title: 'Purchase',\n description:\n 'A completed order is sent to the LinkedIn Conversions API with conversion value, currency, and hashed email.',\n in: getEvent('order complete', {\n timestamp: 1700000900000,\n data: { total: 249.99, currency: 'EUR' },\n user: { email: 'jane@example.com' },\n source: { type: 'server', id: 'https://shop.example.com', previous_id: '' },\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n value: 'data.total',\n currency: { key: 'data.currency', value: 'EUR' },\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n elements: [\n {\n conversion: 'urn:lla:llaPartnerConversion:12345678',\n conversionHappenedAt: 1700000900000,\n user: {\n userIds: [\n {\n idType: 'SHA256_EMAIL',\n // sha256('jane@example.com')\n idValue:\n '8c87b489ce35cf2e2f39f80e282cb2e804932a56a213983eeeb428407d43b52d',\n },\n ],\n },\n eventId: '1700000900000-gr0up-1',\n conversionValue: {\n currencyCode: 'EUR',\n amount: '249.99',\n },\n },\n ],\n }),\n OPTIONS,\n ],\n ],\n};\n\nexport const lead: Flow.StepExample = {\n title: 'Lead',\n description:\n 'A form submission is posted to LinkedIn as a conversion with the SHA-256 hashed email as the user identifier.',\n in: getEvent('form submit', {\n timestamp: 1700000901000,\n user: { email: 'user@example.com' },\n source: { type: 'server', id: 'https://example.com', previous_id: '' },\n }),\n mapping: undefined,\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n elements: [\n {\n conversion: 'urn:lla:llaPartnerConversion:12345678',\n conversionHappenedAt: 1700000901000,\n user: {\n userIds: [\n {\n idType: 'SHA256_EMAIL',\n // sha256('user@example.com')\n idValue:\n 'b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514',\n },\n ],\n },\n eventId: '1700000901000-gr0up-1',\n },\n ],\n }),\n OPTIONS,\n ],\n ],\n};\n\nexport const purchaseWithLiFatId: Flow.StepExample = {\n title: 'Purchase with li_fat_id',\n description:\n 'A purchase is sent to LinkedIn with both the hashed email and the first-party li_fat_id tracking identifier.',\n in: getEvent('order complete', {\n timestamp: 1700000902000,\n data: { total: 89.99, currency: 'USD' },\n user: { email: 'buyer@co.com' },\n context: { li_fat_id: ['abc123-fat-id', 0] },\n source: { type: 'server', id: 'https://shop.example.com', previous_id: '' },\n }),\n mapping: {\n settings: {\n conversion: {\n map: {\n value: 'data.total',\n currency: { key: 'data.currency', value: 'USD' },\n },\n },\n },\n data: {\n map: {\n user_data: {\n map: {\n li_fat_id: 'context.li_fat_id',\n },\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n elements: [\n {\n conversion: 'urn:lla:llaPartnerConversion:12345678',\n conversionHappenedAt: 1700000902000,\n user: {\n userIds: [\n {\n idType: 'SHA256_EMAIL',\n // sha256('buyer@co.com')\n idValue:\n '484c39bfb51212665d9673805c112b5ba04cbf0460b6d3f00bcdc18b92afed66',\n },\n {\n idType: 'LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID',\n idValue: 'abc123-fat-id',\n },\n ],\n },\n eventId: '1700000902000-gr0up-1',\n conversionValue: {\n currencyCode: 'USD',\n amount: '89.99',\n },\n },\n ],\n }),\n OPTIONS,\n ],\n ],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,KAAAA,UAAS;;;ACAlB,SAAS,SAAS;AAMX,IAAM,mBAAmB,EAAE,KAAK;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAMM,IAAM,mBAAmB,EAC7B,OAAO,EACP,MAAM,WAAW,oDAAoD;;;ADhBjE,IAAM,iBAAiBC,GAAE,OAAO;AAAA,EACrC,aAAaA,GACV,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,kBAAkBA,GACf,OAAO,EACP,MAAM,YAAY,6CAA6C,EAC/D;AAAA,IACC;AAAA,EACF;AAAA,EACF,YAAY,iBAAiB;AAAA,IAC3B;AAAA,EACF,EAAE,SAAS;AAAA,EACX,WAAWA,GACR,MAAMA,GAAE,OAAO,CAAC,EAChB;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,KAAKA,GACF,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,WAAWA,GACR,OAAOA,GAAE,OAAO,GAAGA,GAAE,OAAO,CAAC,EAC7B;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AEtCD,SAAS,KAAAC,UAAS;AASX,IAAM,gBAAgBA,GAAE,OAAO;AAAA,EACpC,YAAYA,GACT,OAAO;AAAA,IACN,QAAQA,GACL,OAAO,EACP,SAAS,4CAA4C,EACrD,SAAS;AAAA,IACZ,OAAOA,GACJ,MAAM,CAACA,GA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MAAM,UAAU,IAAI,4BAA4B,aAAa,GAAG;AAAA,EAC5E,CAAC;AAAA,EACD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,YAAY;AAAA,QACV,KAAK;AAAA,UACH,OAAO;AAAA,UACP,UAAU,EAAE,KAAK,iBAAiB,OAAO,MAAM;AAAA,QACjD;AAAA,MACF;AAAA,IACF;AAAA,IACA,MAAM;AAAA,MACJ,KAAK;AAAA,QACH,WAAW;AAAA,UACT,KAAK;AAAA,YACH,WAAW;AAAA,UACb;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA,KAAK,UAAU;AAAA,QACb,UAAU;AAAA,UACR;AAAA,YACE,YAAY;AAAA,YACZ,sBAAsB;AAAA,YACtB,MAAM;AAAA,cACJ,SAAS;AAAA,gBACP;AAAA,kBACE,QAAQ;AAAA;AAAA,kBAER,SACE;AAAA,gBACJ;AAAA,gBACA;AAAA,kBACE,QAAQ;AAAA,kBACR,SAAS;AAAA,gBACX;AAAA,cACF;AAAA,YACF;AAAA,YACA,SAAS;AAAA,YACT,iBAAiB;AAAA,cACf,cAAc;AAAA,cACd,QAAQ;AAAA,YACV;AAAA,UACF;AAAA,QACF;AAAA,MACF,CAAC;AAAA,MACD;AAAA,IACF;AAAA,EACF;AACF;","names":["z","z","z"]}
|
package/dist/examples/index.js
CHANGED
|
@@ -61,6 +61,8 @@ var OPTIONS = {
|
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
var purchase = {
|
|
64
|
+
title: "Purchase",
|
|
65
|
+
description: "A completed order is sent to the LinkedIn Conversions API with conversion value, currency, and hashed email.",
|
|
64
66
|
in: (0, import_core.getEvent)("order complete", {
|
|
65
67
|
timestamp: 17000009e5,
|
|
66
68
|
data: { total: 249.99, currency: "EUR" },
|
|
@@ -108,6 +110,8 @@ var purchase = {
|
|
|
108
110
|
]
|
|
109
111
|
};
|
|
110
112
|
var lead = {
|
|
113
|
+
title: "Lead",
|
|
114
|
+
description: "A form submission is posted to LinkedIn as a conversion with the SHA-256 hashed email as the user identifier.",
|
|
111
115
|
in: (0, import_core.getEvent)("form submit", {
|
|
112
116
|
timestamp: 1700000901e3,
|
|
113
117
|
user: { email: "user@example.com" },
|
|
@@ -141,6 +145,8 @@ var lead = {
|
|
|
141
145
|
]
|
|
142
146
|
};
|
|
143
147
|
var purchaseWithLiFatId = {
|
|
148
|
+
title: "Purchase with li_fat_id",
|
|
149
|
+
description: "A purchase is sent to LinkedIn with both the hashed email and the first-party li_fat_id tracking identifier.",
|
|
144
150
|
in: (0, import_core.getEvent)("order complete", {
|
|
145
151
|
timestamp: 1700000902e3,
|
|
146
152
|
data: { total: 89.99, currency: "USD" },
|
package/dist/examples/index.mjs
CHANGED
|
@@ -40,6 +40,8 @@ var OPTIONS = {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
var purchase = {
|
|
43
|
+
title: "Purchase",
|
|
44
|
+
description: "A completed order is sent to the LinkedIn Conversions API with conversion value, currency, and hashed email.",
|
|
43
45
|
in: getEvent("order complete", {
|
|
44
46
|
timestamp: 17000009e5,
|
|
45
47
|
data: { total: 249.99, currency: "EUR" },
|
|
@@ -87,6 +89,8 @@ var purchase = {
|
|
|
87
89
|
]
|
|
88
90
|
};
|
|
89
91
|
var lead = {
|
|
92
|
+
title: "Lead",
|
|
93
|
+
description: "A form submission is posted to LinkedIn as a conversion with the SHA-256 hashed email as the user identifier.",
|
|
90
94
|
in: getEvent("form submit", {
|
|
91
95
|
timestamp: 1700000901e3,
|
|
92
96
|
user: { email: "user@example.com" },
|
|
@@ -120,6 +124,8 @@ var lead = {
|
|
|
120
124
|
]
|
|
121
125
|
};
|
|
122
126
|
var purchaseWithLiFatId = {
|
|
127
|
+
title: "Purchase with li_fat_id",
|
|
128
|
+
description: "A purchase is sent to LinkedIn with both the hashed email and the first-party li_fat_id tracking identifier.",
|
|
123
129
|
in: getEvent("order complete", {
|
|
124
130
|
timestamp: 1700000902e3,
|
|
125
131
|
data: { total: 89.99, currency: "USD" },
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/server-destination-linkedin",
|
|
4
|
-
"version": "3.4.
|
|
4
|
+
"version": "3.4.1",
|
|
5
5
|
"type": "destination",
|
|
6
6
|
"platform": [
|
|
7
7
|
"server"
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"env": {
|
|
97
97
|
"push": {
|
|
98
98
|
"sendServer": {
|
|
99
|
-
"$code": "async function(e,r,
|
|
99
|
+
"$code": "async function(e,r,i){return{ok:!0,data:{}}}"
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
"simulation": [
|
|
@@ -105,6 +105,8 @@
|
|
|
105
105
|
},
|
|
106
106
|
"step": {
|
|
107
107
|
"lead": {
|
|
108
|
+
"title": "Lead",
|
|
109
|
+
"description": "A form submission is posted to LinkedIn as a conversion with the SHA-256 hashed email as the user identifier.",
|
|
108
110
|
"in": {
|
|
109
111
|
"name": "form submit",
|
|
110
112
|
"data": {
|
|
@@ -159,7 +161,7 @@
|
|
|
159
161
|
"group": "gr0up",
|
|
160
162
|
"count": 1,
|
|
161
163
|
"version": {
|
|
162
|
-
"source": "3.4.
|
|
164
|
+
"source": "3.4.1",
|
|
163
165
|
"tagging": 1
|
|
164
166
|
},
|
|
165
167
|
"source": {
|
|
@@ -186,6 +188,8 @@
|
|
|
186
188
|
]
|
|
187
189
|
},
|
|
188
190
|
"purchase": {
|
|
191
|
+
"title": "Purchase",
|
|
192
|
+
"description": "A completed order is sent to the LinkedIn Conversions API with conversion value, currency, and hashed email.",
|
|
189
193
|
"in": {
|
|
190
194
|
"name": "order complete",
|
|
191
195
|
"data": {
|
|
@@ -267,7 +271,7 @@
|
|
|
267
271
|
"group": "gr0up",
|
|
268
272
|
"count": 1,
|
|
269
273
|
"version": {
|
|
270
|
-
"source": "3.4.
|
|
274
|
+
"source": "3.4.1",
|
|
271
275
|
"tagging": 1
|
|
272
276
|
},
|
|
273
277
|
"source": {
|
|
@@ -307,6 +311,8 @@
|
|
|
307
311
|
]
|
|
308
312
|
},
|
|
309
313
|
"purchaseWithLiFatId": {
|
|
314
|
+
"title": "Purchase with li_fat_id",
|
|
315
|
+
"description": "A purchase is sent to LinkedIn with both the hashed email and the first-party li_fat_id tracking identifier.",
|
|
310
316
|
"in": {
|
|
311
317
|
"name": "order complete",
|
|
312
318
|
"data": {
|
|
@@ -388,7 +394,7 @@
|
|
|
388
394
|
"group": "gr0up",
|
|
389
395
|
"count": 1,
|
|
390
396
|
"version": {
|
|
391
|
-
"source": "3.4.
|
|
397
|
+
"source": "3.4.1",
|
|
392
398
|
"tagging": 1
|
|
393
399
|
},
|
|
394
400
|
"source": {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/server-destination-linkedin",
|
|
3
3
|
"description": "LinkedIn Conversions API server destination for walkerOS",
|
|
4
|
-
"version": "3.4.
|
|
4
|
+
"version": "3.4.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"update": "npx npm-check-updates -u && npm update"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@walkeros/core": "3.4.
|
|
38
|
-
"@walkeros/server-core": "3.4.
|
|
37
|
+
"@walkeros/core": "3.4.1",
|
|
38
|
+
"@walkeros/server-core": "3.4.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@walkeros/collector": "3.4.
|
|
41
|
+
"@walkeros/collector": "3.4.1"
|
|
42
42
|
},
|
|
43
43
|
"repository": {
|
|
44
44
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|