@walkeros/server-destination-klaviyo 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 +13 -0
- package/dist/examples/index.mjs +13 -0
- package/dist/walkerOS.json +21 -8
- package/package.json +4 -4
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,n=(e,a)=>{for(var i in a)t(e,i,{get:a[i],enumerable:!0})},o={};n(o,{examples:()=>f,schemas:()=>s}),module.exports=(e=o,((e,n,o,s)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let p of i(n))r.call(e,p)||p===o||t(e,p,{get:()=>n[p],enumerable:!(s=a(n,p))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s={};n(s,{MappingSchema:()=>d,SettingsSchema:()=>m,mapping:()=>v,settings:()=>c});var p=require("@walkeros/core/dev"),l=require("@walkeros/core/dev"),m=l.z.object({apiKey:l.z.string().min(1).describe("Klaviyo private API key. Starts with pk_. Find it under Settings > API Keys in your Klaviyo account."),email:l.z.string().describe("walkerOS mapping value path to resolve email from each event (like user.email).").optional(),phoneNumber:l.z.string().describe("walkerOS mapping value path to resolve phone number in E.164 format from each event.").optional(),externalId:l.z.string().describe("walkerOS mapping value path to resolve external ID from each event (like user.id).").optional(),identify:l.z.unknown().describe("Destination-level identity mapping. Resolves to profile attributes { firstName?, lastName?, organization?, properties? }. Fires createOrUpdateProfile() on first push and re-fires when values change.").optional(),currency:l.z.string().length(3).describe("Default ISO 4217 currency code for revenue events (like USD, EUR). Sets valueCurrency on Klaviyo events.").optional()}),u=require("@walkeros/core/dev"),d=u.z.object({identify:u.z.unknown().describe("Per-event identify mapping. Resolves to profile attributes for createOrUpdateProfile(). Use with rule-level skip: true on login/signup events.").optional(),value:u.z.unknown().describe("Revenue value mapping. Resolves to a numeric value for Klaviyo revenue tracking. Sets the value property and valueCurrency on the event.").optional()}),c=(0,p.zodToSchema)(m),v=(0,p.zodToSchema)(d),f={};n(f,{env:()=>g,step:()=>h});var g={};n(g,{push:()=>b,simulation:()=>w});var y=()=>Promise.resolve({});var b={eventsApi:{createEvent:y},profilesApi:{createOrUpdateProfile:y}},w=["call:eventsApi.createEvent","call:profilesApi.createOrUpdateProfile"],h={};n(h,{defaultEvent:()=>P,destinationIdentify:()=>N,emailOnly:()=>A,mappedEventName:()=>I,revenueEvent:()=>S,userLoginIdentify:()=>x,wildcardIgnored:()=>E});var O=require("@walkeros/core"),P={title:"Default event",description:"An event is sent to Klaviyo as a metric with an inline profile resolved from the user email and id.",in:(0,O.getEvent)("product view",{timestamp:1700000100,user:{id:"us3r",email:"user@example.com"}}),out:[["eventsApi.createEvent",{data:{type:"event",attributes:{profile:{data:{type:"profile",attributes:{email:"user@example.com",externalId:"us3r"}}},metric:{data:{type:"metric",attributes:{name:"product view"}}},properties:{},time:new Date(1700000100).toISOString()}}}]]},I={title:"Viewed product",description:"A product view is mapped to the Klaviyo Viewed Product metric with properties such as product name and price.",in:(0,O.getEvent)("product view",{timestamp:1700000101,user:{id:"us3r",email:"user@example.com"},data:{name:"USB Cable",id:"PROD-1",price:9.99}}),mapping:{name:"Viewed Product",data:{map:{ProductName:"data.name",ProductID:"data.id",Price:"data.price"}}},out:[["eventsApi.createEvent",{data:{type:"event",attributes:{profile:{data:{type:"profile",attributes:{email:"user@example.com",externalId:"us3r"}}},metric:{data:{type:"metric",attributes:{name:"Viewed Product"}}},properties:{ProductName:"USB Cable",ProductID:"PROD-1",Price:9.99},time:new Date(1700000101).toISOString()}}}]]},S={title:"Placed order",description:"An order complete is sent to Klaviyo as Placed Order with value and currency for revenue attribution.",in:(0,O.getEvent)("order complete",{timestamp:1700000102,user:{id:"us3r",email:"user@example.com"},data:{id:"ORD-123",total:99.99,itemNames:["Widget A","Widget B"]}}),settings:{currency:"EUR"},mapping:{name:"Placed Order",data:{map:{OrderId:"data.id",value:"data.total",ItemNames:"data.itemNames"}},settings:{value:"data.total"}},out:[["eventsApi.createEvent",{data:{type:"event",attributes:{profile:{data:{type:"profile",attributes:{email:"user@example.com",externalId:"us3r"}}},metric:{data:{type:"metric",attributes:{name:"Placed Order"}}},properties:{OrderId:"ORD-123",value:99.99,ItemNames:["Widget A","Widget B"]},time:new Date(1700000102).toISOString(),valueCurrency:"EUR"}}}]]},x={title:"User login identify",description:"A user login upserts the Klaviyo profile with name, organization, and custom properties without firing an event.",in:(0,O.getEvent)("user login",{timestamp:1700000103,user:{id:"us3r",email:"user@acme.com"},data:{firstName:"Jane",lastName:"Doe",company:"Acme Corp",plan:"premium"}}),mapping:{skip:!0,settings:{identify:{map:{firstName:"data.firstName",lastName:"data.lastName",organization:"data.company",properties:{map:{plan:"data.plan"}}}}}},out:[["profilesApi.createOrUpdateProfile",{data:{type:"profile",attributes:{email:"user@acme.com",externalId:"us3r",firstName:"Jane",lastName:"Doe",organization:"Acme Corp",properties:{plan:"premium"}}}}]]},N={title:"Destination identify",description:"Destination-level identify upserts the Klaviyo profile with a first name before each event is sent.",in:(0,O.getEvent)("page view",{timestamp:1700000104,user:{id:"us3r",email:"user@example.com",firstName:"Jane"}}),settings:{identify:{map:{firstName:"user.firstName"}}},out:[["profilesApi.createOrUpdateProfile",{data:{type:"profile",attributes:{email:"user@example.com",externalId:"us3r",firstName:"Jane"}}}],["eventsApi.createEvent",{data:{type:"event",attributes:{profile:{data:{type:"profile",attributes:{email:"user@example.com",externalId:"us3r"}}},metric:{data:{type:"metric",attributes:{name:"page view"}}},properties:{},time:new Date(1700000104).toISOString()}}}]]},A={title:"Email only",description:"A newsletter signup uses only the email address as the Klaviyo profile identifier, with no external id.",in:(0,O.getEvent)("newsletter signup",{timestamp:1700000105,user:{email:"subscriber@example.com"}}),settings:{externalId:void 0},out:[["eventsApi.createEvent",{data:{type:"event",attributes:{profile:{data:{type:"profile",attributes:{email:"subscriber@example.com"}}},metric:{data:{type:"metric",attributes:{name:"newsletter signup"}}},properties:{},time:new Date(1700000105).toISOString()}}}]]},E={public:!1,in:(0,O.getEvent)("debug noise",{timestamp:1700000106,user:{id:"us3r",email:"user@example.com"}}),mapping:{ignore:!0},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 .describe(\n 'Klaviyo private API key. Starts with pk_. Find it under Settings > API Keys in your Klaviyo account.',\n ),\n email: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve email from each event (like user.email).',\n )\n .optional(),\n phoneNumber: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve phone number in E.164 format from each event.',\n )\n .optional(),\n externalId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve external ID from each event (like user.id).',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'Destination-level identity mapping. Resolves to profile attributes { firstName?, lastName?, organization?, properties? }. Fires createOrUpdateProfile() on first push and re-fires when values change.',\n )\n .optional(),\n currency: z\n .string()\n .length(3)\n .describe(\n 'Default ISO 4217 currency code for revenue events (like USD, EUR). Sets valueCurrency on Klaviyo events.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identify mapping. Resolves to profile attributes for createOrUpdateProfile(). Use with rule-level skip: true on login/signup events.',\n )\n .optional(),\n value: z\n .unknown()\n .describe(\n 'Revenue value mapping. Resolves to a numeric value for Klaviyo revenue tracking. Sets the value property and valueCurrency on the event.',\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 {\n Env,\n KlaviyoEventsApiMock,\n KlaviyoProfilesApiMock,\n} from '../types';\n\nconst asyncNoop = () => Promise.resolve({});\n\nfunction createMockEventsApi(): KlaviyoEventsApiMock {\n return {\n createEvent: asyncNoop,\n };\n}\n\nfunction createMockProfilesApi(): KlaviyoProfilesApiMock {\n return {\n createOrUpdateProfile: asyncNoop,\n };\n}\n\nexport const push: Env = {\n eventsApi: createMockEventsApi(),\n profilesApi: createMockProfilesApi(),\n};\n\nexport const simulation = [\n 'call:eventsApi.createEvent',\n 'call:profilesApi.createOrUpdateProfile',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Klaviyo SDK step examples.\n *\n * At push time, the destination invokes the `klaviyo-api` SDK. The public\n * method paths users see on the client are:\n *\n * - `eventsApi.createEvent(body)` — fires a metric event with inline profile\n * - `profilesApi.createOrUpdateProfile(body)` — upserts a profile\n *\n * Each `out` is therefore `[['method.path', ...args], ...]` matching the\n * actual SDK call order. `identify` fires before the event. When the rule\n * uses `skip: true` or `ignore: true`, `out` is `[]` or the identify-only\n * list.\n */\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type KlaviyoStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default event forwarding -- eventsApi.createEvent() with event name and\n * inline profile. Email resolved from default settings.email = 'user.email'.\n */\nexport const defaultEvent: KlaviyoStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000100,\n user: { id: 'us3r', email: 'user@example.com' },\n }),\n out: [\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'product view' },\n },\n },\n properties: {},\n time: new Date(1700000100).toISOString(),\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Mapped event name -- mapping.name renames the event to Klaviyo's expected\n * metric name for ecommerce reporting.\n */\nexport const mappedEventName: KlaviyoStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000101,\n user: { id: 'us3r', email: 'user@example.com' },\n data: {\n name: 'USB Cable',\n id: 'PROD-1',\n price: 9.99,\n },\n }),\n mapping: {\n name: 'Viewed Product',\n data: {\n map: {\n ProductName: 'data.name',\n ProductID: 'data.id',\n Price: 'data.price',\n },\n },\n },\n out: [\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'Viewed Product' },\n },\n },\n properties: {\n ProductName: 'USB Cable',\n ProductID: 'PROD-1',\n Price: 9.99,\n },\n time: new Date(1700000101).toISOString(),\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Revenue event -- order complete with value mapping. Sets $value and\n * valueCurrency on the Klaviyo event for revenue tracking.\n */\nexport const revenueEvent: KlaviyoStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000102,\n user: { id: 'us3r', email: 'user@example.com' },\n data: {\n id: 'ORD-123',\n total: 99.99,\n itemNames: ['Widget A', 'Widget B'],\n },\n }),\n settings: {\n currency: 'EUR',\n },\n mapping: {\n name: 'Placed Order',\n data: {\n map: {\n OrderId: 'data.id',\n value: 'data.total',\n ItemNames: 'data.itemNames',\n },\n },\n settings: {\n value: 'data.total',\n },\n },\n out: [\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'Placed Order' },\n },\n },\n properties: {\n OrderId: 'ORD-123',\n value: 99.99,\n ItemNames: ['Widget A', 'Widget B'],\n },\n time: new Date(1700000102).toISOString(),\n valueCurrency: 'EUR',\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Per-event identify with skip -- user login fires\n * profilesApi.createOrUpdateProfile() only, no event tracked.\n */\nexport const userLoginIdentify: KlaviyoStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000103,\n user: { id: 'us3r', email: 'user@acme.com' },\n data: {\n firstName: 'Jane',\n lastName: 'Doe',\n company: 'Acme Corp',\n plan: 'premium',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n firstName: 'data.firstName',\n lastName: 'data.lastName',\n organization: 'data.company',\n properties: {\n map: {\n plan: 'data.plan',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'profilesApi.createOrUpdateProfile',\n {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@acme.com',\n externalId: 'us3r',\n firstName: 'Jane',\n lastName: 'Doe',\n organization: 'Acme Corp',\n properties: {\n plan: 'premium',\n },\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Destination-level identify -- fires profilesApi.createOrUpdateProfile()\n * on first push when settings.identify resolves, then fires createEvent().\n */\nexport const destinationIdentify: KlaviyoStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000104,\n user: { id: 'us3r', email: 'user@example.com', firstName: 'Jane' },\n }),\n settings: {\n identify: {\n map: {\n firstName: 'user.firstName',\n },\n },\n },\n out: [\n [\n 'profilesApi.createOrUpdateProfile',\n {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n firstName: 'Jane',\n },\n },\n },\n ],\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'page view' },\n },\n },\n properties: {},\n time: new Date(1700000104).toISOString(),\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Email only -- no externalId. Klaviyo accepts email as sole identifier.\n */\nexport const emailOnly: KlaviyoStepExample = {\n in: getEvent('newsletter signup', {\n timestamp: 1700000105,\n user: { email: 'subscriber@example.com' },\n }),\n settings: {\n externalId: undefined,\n },\n out: [\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'subscriber@example.com',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'newsletter signup' },\n },\n },\n properties: {},\n time: new Date(1700000105).toISOString(),\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Wildcard ignore -- the event matches a mapping rule with ignore: true.\n * The destination fires zero API calls.\n */\nexport const wildcardIgnored: KlaviyoStepExample = {\n in: getEvent('debug noise', {\n timestamp: 1700000106,\n user: { id: 'us3r', email: 'user@example.com' },\n }),\n mapping: { ignore: true },\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,aAAE,OAAO;AAAA,EACrC,QAAQ,aACL,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,OAAO,aACJ,OAAO,EACP;AAAA,IACC;AAAA,EAC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ACxB,KAAK,CAAC;AACR;","names":["import_dev","import_dev"]}
|
|
1
|
+
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"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 .describe(\n 'Klaviyo private API key. Starts with pk_. Find it under Settings > API Keys in your Klaviyo account.',\n ),\n email: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve email from each event (like user.email).',\n )\n .optional(),\n phoneNumber: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve phone number in E.164 format from each event.',\n )\n .optional(),\n externalId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve external ID from each event (like user.id).',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'Destination-level identity mapping. Resolves to profile attributes { firstName?, lastName?, organization?, properties? }. Fires createOrUpdateProfile() on first push and re-fires when values change.',\n )\n .optional(),\n currency: z\n .string()\n .length(3)\n .describe(\n 'Default ISO 4217 currency code for revenue events (like USD, EUR). Sets valueCurrency on Klaviyo events.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identify mapping. Resolves to profile attributes for createOrUpdateProfile(). Use with rule-level skip: true on login/signup events.',\n )\n .optional(),\n value: z\n .unknown()\n .describe(\n 'Revenue value mapping. Resolves to a numeric value for Klaviyo revenue tracking. Sets the value property and valueCurrency on the event.',\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 {\n Env,\n KlaviyoEventsApiMock,\n KlaviyoProfilesApiMock,\n} from '../types';\n\nconst asyncNoop = () => Promise.resolve({});\n\nfunction createMockEventsApi(): KlaviyoEventsApiMock {\n return {\n createEvent: asyncNoop,\n };\n}\n\nfunction createMockProfilesApi(): KlaviyoProfilesApiMock {\n return {\n createOrUpdateProfile: asyncNoop,\n };\n}\n\nexport const push: Env = {\n eventsApi: createMockEventsApi(),\n profilesApi: createMockProfilesApi(),\n};\n\nexport const simulation = [\n 'call:eventsApi.createEvent',\n 'call:profilesApi.createOrUpdateProfile',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Klaviyo SDK step examples.\n *\n * At push time, the destination invokes the `klaviyo-api` SDK. The public\n * method paths users see on the client are:\n *\n * - `eventsApi.createEvent(body)` — fires a metric event with inline profile\n * - `profilesApi.createOrUpdateProfile(body)` — upserts a profile\n *\n * Each `out` is therefore `[['method.path', ...args], ...]` matching the\n * actual SDK call order. `identify` fires before the event. When the rule\n * uses `skip: true` or `ignore: true`, `out` is `[]` or the identify-only\n * list.\n */\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type KlaviyoStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default event forwarding -- eventsApi.createEvent() with event name and\n * inline profile. Email resolved from default settings.email = 'user.email'.\n */\nexport const defaultEvent: KlaviyoStepExample = {\n title: 'Default event',\n description:\n 'An event is sent to Klaviyo as a metric with an inline profile resolved from the user email and id.',\n in: getEvent('product view', {\n timestamp: 1700000100,\n user: { id: 'us3r', email: 'user@example.com' },\n }),\n out: [\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'product view' },\n },\n },\n properties: {},\n time: new Date(1700000100).toISOString(),\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Mapped event name -- mapping.name renames the event to Klaviyo's expected\n * metric name for ecommerce reporting.\n */\nexport const mappedEventName: KlaviyoStepExample = {\n title: 'Viewed product',\n description:\n 'A product view is mapped to the Klaviyo Viewed Product metric with properties such as product name and price.',\n in: getEvent('product view', {\n timestamp: 1700000101,\n user: { id: 'us3r', email: 'user@example.com' },\n data: {\n name: 'USB Cable',\n id: 'PROD-1',\n price: 9.99,\n },\n }),\n mapping: {\n name: 'Viewed Product',\n data: {\n map: {\n ProductName: 'data.name',\n ProductID: 'data.id',\n Price: 'data.price',\n },\n },\n },\n out: [\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'Viewed Product' },\n },\n },\n properties: {\n ProductName: 'USB Cable',\n ProductID: 'PROD-1',\n Price: 9.99,\n },\n time: new Date(1700000101).toISOString(),\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Revenue event -- order complete with value mapping. Sets $value and\n * valueCurrency on the Klaviyo event for revenue tracking.\n */\nexport const revenueEvent: KlaviyoStepExample = {\n title: 'Placed order',\n description:\n 'An order complete is sent to Klaviyo as Placed Order with value and currency for revenue attribution.',\n in: getEvent('order complete', {\n timestamp: 1700000102,\n user: { id: 'us3r', email: 'user@example.com' },\n data: {\n id: 'ORD-123',\n total: 99.99,\n itemNames: ['Widget A', 'Widget B'],\n },\n }),\n settings: {\n currency: 'EUR',\n },\n mapping: {\n name: 'Placed Order',\n data: {\n map: {\n OrderId: 'data.id',\n value: 'data.total',\n ItemNames: 'data.itemNames',\n },\n },\n settings: {\n value: 'data.total',\n },\n },\n out: [\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'Placed Order' },\n },\n },\n properties: {\n OrderId: 'ORD-123',\n value: 99.99,\n ItemNames: ['Widget A', 'Widget B'],\n },\n time: new Date(1700000102).toISOString(),\n valueCurrency: 'EUR',\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Per-event identify with skip -- user login fires\n * profilesApi.createOrUpdateProfile() only, no event tracked.\n */\nexport const userLoginIdentify: KlaviyoStepExample = {\n title: 'User login identify',\n description:\n 'A user login upserts the Klaviyo profile with name, organization, and custom properties without firing an event.',\n in: getEvent('user login', {\n timestamp: 1700000103,\n user: { id: 'us3r', email: 'user@acme.com' },\n data: {\n firstName: 'Jane',\n lastName: 'Doe',\n company: 'Acme Corp',\n plan: 'premium',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n firstName: 'data.firstName',\n lastName: 'data.lastName',\n organization: 'data.company',\n properties: {\n map: {\n plan: 'data.plan',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'profilesApi.createOrUpdateProfile',\n {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@acme.com',\n externalId: 'us3r',\n firstName: 'Jane',\n lastName: 'Doe',\n organization: 'Acme Corp',\n properties: {\n plan: 'premium',\n },\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Destination-level identify -- fires profilesApi.createOrUpdateProfile()\n * on first push when settings.identify resolves, then fires createEvent().\n */\nexport const destinationIdentify: KlaviyoStepExample = {\n title: 'Destination identify',\n description:\n 'Destination-level identify upserts the Klaviyo profile with a first name before each event is sent.',\n in: getEvent('page view', {\n timestamp: 1700000104,\n user: { id: 'us3r', email: 'user@example.com', firstName: 'Jane' },\n }),\n settings: {\n identify: {\n map: {\n firstName: 'user.firstName',\n },\n },\n },\n out: [\n [\n 'profilesApi.createOrUpdateProfile',\n {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n firstName: 'Jane',\n },\n },\n },\n ],\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'page view' },\n },\n },\n properties: {},\n time: new Date(1700000104).toISOString(),\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Email only -- no externalId. Klaviyo accepts email as sole identifier.\n */\nexport const emailOnly: KlaviyoStepExample = {\n title: 'Email only',\n description:\n 'A newsletter signup uses only the email address as the Klaviyo profile identifier, with no external id.',\n in: getEvent('newsletter signup', {\n timestamp: 1700000105,\n user: { email: 'subscriber@example.com' },\n }),\n settings: {\n externalId: undefined,\n },\n out: [\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'subscriber@example.com',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'newsletter signup' },\n },\n },\n properties: {},\n time: new Date(1700000105).toISOString(),\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Wildcard ignore -- the event matches a mapping rule with ignore: true.\n * The destination fires zero API calls.\n */\nexport const wildcardIgnored: KlaviyoStepExample = {\n public: false,\n in: getEvent('debug noise', {\n timestamp: 1700000106,\n user: { id: 'us3r', email: 'user@example.com' },\n }),\n mapping: { ignore: true },\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,aAAE,OAAO;AAAA,EACrC,QAAQ,aACL,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF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,UACzC;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,kBAAsC;AAAA,EACjD,QAAQ;AAAA,EACR,QAAI,sBAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,OAAO,mBAAmB;AAAA,EAChD,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["import_dev","import_dev"]}
|
package/dist/dev.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(t,a)=>{for(var
|
|
1
|
+
var e=Object.defineProperty,t=(t,a)=>{for(var i in a)e(t,i,{get:a[i],enumerable:!0})},a={};t(a,{MappingSchema:()=>o,SettingsSchema:()=>n,mapping:()=>l,settings:()=>p});import{zodToSchema as i}from"@walkeros/core/dev";import{z as r}from"@walkeros/core/dev";var n=r.object({apiKey:r.string().min(1).describe("Klaviyo private API key. Starts with pk_. Find it under Settings > API Keys in your Klaviyo account."),email:r.string().describe("walkerOS mapping value path to resolve email from each event (like user.email).").optional(),phoneNumber:r.string().describe("walkerOS mapping value path to resolve phone number in E.164 format from each event.").optional(),externalId:r.string().describe("walkerOS mapping value path to resolve external ID from each event (like user.id).").optional(),identify:r.unknown().describe("Destination-level identity mapping. Resolves to profile attributes { firstName?, lastName?, organization?, properties? }. Fires createOrUpdateProfile() on first push and re-fires when values change.").optional(),currency:r.string().length(3).describe("Default ISO 4217 currency code for revenue events (like USD, EUR). Sets valueCurrency on Klaviyo events.").optional()});import{z as s}from"@walkeros/core/dev";var o=s.object({identify:s.unknown().describe("Per-event identify mapping. Resolves to profile attributes for createOrUpdateProfile(). Use with rule-level skip: true on login/signup events.").optional(),value:s.unknown().describe("Revenue value mapping. Resolves to a numeric value for Klaviyo revenue tracking. Sets the value property and valueCurrency on the event.").optional()}),p=i(n),l=i(o),m={};t(m,{env:()=>d,step:()=>f});var d={};t(d,{push:()=>c,simulation:()=>v});var u=()=>Promise.resolve({});var c={eventsApi:{createEvent:u},profilesApi:{createOrUpdateProfile:u}},v=["call:eventsApi.createEvent","call:profilesApi.createOrUpdateProfile"],f={};t(f,{defaultEvent:()=>y,destinationIdentify:()=>I,emailOnly:()=>O,mappedEventName:()=>b,revenueEvent:()=>w,userLoginIdentify:()=>h,wildcardIgnored:()=>P});import{getEvent as g}from"@walkeros/core";var y={title:"Default event",description:"An event is sent to Klaviyo as a metric with an inline profile resolved from the user email and id.",in:g("product view",{timestamp:1700000100,user:{id:"us3r",email:"user@example.com"}}),out:[["eventsApi.createEvent",{data:{type:"event",attributes:{profile:{data:{type:"profile",attributes:{email:"user@example.com",externalId:"us3r"}}},metric:{data:{type:"metric",attributes:{name:"product view"}}},properties:{},time:new Date(1700000100).toISOString()}}}]]},b={title:"Viewed product",description:"A product view is mapped to the Klaviyo Viewed Product metric with properties such as product name and price.",in:g("product view",{timestamp:1700000101,user:{id:"us3r",email:"user@example.com"},data:{name:"USB Cable",id:"PROD-1",price:9.99}}),mapping:{name:"Viewed Product",data:{map:{ProductName:"data.name",ProductID:"data.id",Price:"data.price"}}},out:[["eventsApi.createEvent",{data:{type:"event",attributes:{profile:{data:{type:"profile",attributes:{email:"user@example.com",externalId:"us3r"}}},metric:{data:{type:"metric",attributes:{name:"Viewed Product"}}},properties:{ProductName:"USB Cable",ProductID:"PROD-1",Price:9.99},time:new Date(1700000101).toISOString()}}}]]},w={title:"Placed order",description:"An order complete is sent to Klaviyo as Placed Order with value and currency for revenue attribution.",in:g("order complete",{timestamp:1700000102,user:{id:"us3r",email:"user@example.com"},data:{id:"ORD-123",total:99.99,itemNames:["Widget A","Widget B"]}}),settings:{currency:"EUR"},mapping:{name:"Placed Order",data:{map:{OrderId:"data.id",value:"data.total",ItemNames:"data.itemNames"}},settings:{value:"data.total"}},out:[["eventsApi.createEvent",{data:{type:"event",attributes:{profile:{data:{type:"profile",attributes:{email:"user@example.com",externalId:"us3r"}}},metric:{data:{type:"metric",attributes:{name:"Placed Order"}}},properties:{OrderId:"ORD-123",value:99.99,ItemNames:["Widget A","Widget B"]},time:new Date(1700000102).toISOString(),valueCurrency:"EUR"}}}]]},h={title:"User login identify",description:"A user login upserts the Klaviyo profile with name, organization, and custom properties without firing an event.",in:g("user login",{timestamp:1700000103,user:{id:"us3r",email:"user@acme.com"},data:{firstName:"Jane",lastName:"Doe",company:"Acme Corp",plan:"premium"}}),mapping:{skip:!0,settings:{identify:{map:{firstName:"data.firstName",lastName:"data.lastName",organization:"data.company",properties:{map:{plan:"data.plan"}}}}}},out:[["profilesApi.createOrUpdateProfile",{data:{type:"profile",attributes:{email:"user@acme.com",externalId:"us3r",firstName:"Jane",lastName:"Doe",organization:"Acme Corp",properties:{plan:"premium"}}}}]]},I={title:"Destination identify",description:"Destination-level identify upserts the Klaviyo profile with a first name before each event is sent.",in:g("page view",{timestamp:1700000104,user:{id:"us3r",email:"user@example.com",firstName:"Jane"}}),settings:{identify:{map:{firstName:"user.firstName"}}},out:[["profilesApi.createOrUpdateProfile",{data:{type:"profile",attributes:{email:"user@example.com",externalId:"us3r",firstName:"Jane"}}}],["eventsApi.createEvent",{data:{type:"event",attributes:{profile:{data:{type:"profile",attributes:{email:"user@example.com",externalId:"us3r"}}},metric:{data:{type:"metric",attributes:{name:"page view"}}},properties:{},time:new Date(1700000104).toISOString()}}}]]},O={title:"Email only",description:"A newsletter signup uses only the email address as the Klaviyo profile identifier, with no external id.",in:g("newsletter signup",{timestamp:1700000105,user:{email:"subscriber@example.com"}}),settings:{externalId:void 0},out:[["eventsApi.createEvent",{data:{type:"event",attributes:{profile:{data:{type:"profile",attributes:{email:"subscriber@example.com"}}},metric:{data:{type:"metric",attributes:{name:"newsletter signup"}}},properties:{},time:new Date(1700000105).toISOString()}}}]]},P={public:!1,in:g("debug noise",{timestamp:1700000106,user:{id:"us3r",email:"user@example.com"}}),mapping:{ignore:!0},out:[]};export{m as examples,a as schemas};//# sourceMappingURL=dev.mjs.map
|
package/dist/dev.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n apiKey: z\n .string()\n .min(1)\n .describe(\n 'Klaviyo private API key. Starts with pk_. Find it under Settings > API Keys in your Klaviyo account.',\n ),\n email: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve email from each event (like user.email).',\n )\n .optional(),\n phoneNumber: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve phone number in E.164 format from each event.',\n )\n .optional(),\n externalId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve external ID from each event (like user.id).',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'Destination-level identity mapping. Resolves to profile attributes { firstName?, lastName?, organization?, properties? }. Fires createOrUpdateProfile() on first push and re-fires when values change.',\n )\n .optional(),\n currency: z\n .string()\n .length(3)\n .describe(\n 'Default ISO 4217 currency code for revenue events (like USD, EUR). Sets valueCurrency on Klaviyo events.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identify mapping. Resolves to profile attributes for createOrUpdateProfile(). Use with rule-level skip: true on login/signup events.',\n )\n .optional(),\n value: z\n .unknown()\n .describe(\n 'Revenue value mapping. Resolves to a numeric value for Klaviyo revenue tracking. Sets the value property and valueCurrency on the event.',\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 {\n Env,\n KlaviyoEventsApiMock,\n KlaviyoProfilesApiMock,\n} from '../types';\n\nconst asyncNoop = () => Promise.resolve({});\n\nfunction createMockEventsApi(): KlaviyoEventsApiMock {\n return {\n createEvent: asyncNoop,\n };\n}\n\nfunction createMockProfilesApi(): KlaviyoProfilesApiMock {\n return {\n createOrUpdateProfile: asyncNoop,\n };\n}\n\nexport const push: Env = {\n eventsApi: createMockEventsApi(),\n profilesApi: createMockProfilesApi(),\n};\n\nexport const simulation = [\n 'call:eventsApi.createEvent',\n 'call:profilesApi.createOrUpdateProfile',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Klaviyo SDK step examples.\n *\n * At push time, the destination invokes the `klaviyo-api` SDK. The public\n * method paths users see on the client are:\n *\n * - `eventsApi.createEvent(body)` — fires a metric event with inline profile\n * - `profilesApi.createOrUpdateProfile(body)` — upserts a profile\n *\n * Each `out` is therefore `[['method.path', ...args], ...]` matching the\n * actual SDK call order. `identify` fires before the event. When the rule\n * uses `skip: true` or `ignore: true`, `out` is `[]` or the identify-only\n * list.\n */\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type KlaviyoStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default event forwarding -- eventsApi.createEvent() with event name and\n * inline profile. Email resolved from default settings.email = 'user.email'.\n */\nexport const defaultEvent: KlaviyoStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000100,\n user: { id: 'us3r', email: 'user@example.com' },\n }),\n out: [\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'product view' },\n },\n },\n properties: {},\n time: new Date(1700000100).toISOString(),\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Mapped event name -- mapping.name renames the event to Klaviyo's expected\n * metric name for ecommerce reporting.\n */\nexport const mappedEventName: KlaviyoStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000101,\n user: { id: 'us3r', email: 'user@example.com' },\n data: {\n name: 'USB Cable',\n id: 'PROD-1',\n price: 9.99,\n },\n }),\n mapping: {\n name: 'Viewed Product',\n data: {\n map: {\n ProductName: 'data.name',\n ProductID: 'data.id',\n Price: 'data.price',\n },\n },\n },\n out: [\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'Viewed Product' },\n },\n },\n properties: {\n ProductName: 'USB Cable',\n ProductID: 'PROD-1',\n Price: 9.99,\n },\n time: new Date(1700000101).toISOString(),\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Revenue event -- order complete with value mapping. Sets $value and\n * valueCurrency on the Klaviyo event for revenue tracking.\n */\nexport const revenueEvent: KlaviyoStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000102,\n user: { id: 'us3r', email: 'user@example.com' },\n data: {\n id: 'ORD-123',\n total: 99.99,\n itemNames: ['Widget A', 'Widget B'],\n },\n }),\n settings: {\n currency: 'EUR',\n },\n mapping: {\n name: 'Placed Order',\n data: {\n map: {\n OrderId: 'data.id',\n value: 'data.total',\n ItemNames: 'data.itemNames',\n },\n },\n settings: {\n value: 'data.total',\n },\n },\n out: [\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'Placed Order' },\n },\n },\n properties: {\n OrderId: 'ORD-123',\n value: 99.99,\n ItemNames: ['Widget A', 'Widget B'],\n },\n time: new Date(1700000102).toISOString(),\n valueCurrency: 'EUR',\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Per-event identify with skip -- user login fires\n * profilesApi.createOrUpdateProfile() only, no event tracked.\n */\nexport const userLoginIdentify: KlaviyoStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000103,\n user: { id: 'us3r', email: 'user@acme.com' },\n data: {\n firstName: 'Jane',\n lastName: 'Doe',\n company: 'Acme Corp',\n plan: 'premium',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n firstName: 'data.firstName',\n lastName: 'data.lastName',\n organization: 'data.company',\n properties: {\n map: {\n plan: 'data.plan',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'profilesApi.createOrUpdateProfile',\n {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@acme.com',\n externalId: 'us3r',\n firstName: 'Jane',\n lastName: 'Doe',\n organization: 'Acme Corp',\n properties: {\n plan: 'premium',\n },\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Destination-level identify -- fires profilesApi.createOrUpdateProfile()\n * on first push when settings.identify resolves, then fires createEvent().\n */\nexport const destinationIdentify: KlaviyoStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000104,\n user: { id: 'us3r', email: 'user@example.com', firstName: 'Jane' },\n }),\n settings: {\n identify: {\n map: {\n firstName: 'user.firstName',\n },\n },\n },\n out: [\n [\n 'profilesApi.createOrUpdateProfile',\n {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n firstName: 'Jane',\n },\n },\n },\n ],\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'page view' },\n },\n },\n properties: {},\n time: new Date(1700000104).toISOString(),\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Email only -- no externalId. Klaviyo accepts email as sole identifier.\n */\nexport const emailOnly: KlaviyoStepExample = {\n in: getEvent('newsletter signup', {\n timestamp: 1700000105,\n user: { email: 'subscriber@example.com' },\n }),\n settings: {\n externalId: undefined,\n },\n out: [\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'subscriber@example.com',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'newsletter signup' },\n },\n },\n properties: {},\n time: new Date(1700000105).toISOString(),\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Wildcard ignore -- the event matches a mapping rule with ignore: true.\n * The destination fires zero API calls.\n */\nexport const wildcardIgnored: KlaviyoStepExample = {\n in: getEvent('debug noise', {\n timestamp: 1700000106,\n user: { id: 'us3r', email: 'user@example.com' },\n }),\n mapping: { ignore: true },\n out: [],\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,EACF;AAAA,EACF,OAAO,EACJ,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,EACV,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,YAAY,EACT,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,EACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,EACP,OAAO,EACP,OAAO,CAAC,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;ACxCD,SAAS,KAAAA,UAAS;AAEX,IAAM,gBAAgBA,GAAE,OAAO;AAAA,EACpC,UAAUA,GACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;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C3C,IAAI,SAAS,qBAAqB;AAAA,IAChC,WAAW;AAAA,IACX,MAAM,EAAE,OAAO,yBAAyB;AAAA,EAC1C,CAAC;AAAA,EACD,UAAU;AAAA,IACR,YAAY;AAAA,EACd;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,MAAM;AAAA,UACJ,MAAM;AAAA,UACN,YAAY;AAAA,YACV,SAAS;AAAA,cACP,MAAM;AAAA,gBACJ,MAAM;AAAA,gBACN,YAAY;AAAA,kBACV,OAAO;AAAA,gBACT;AAAA,cACF;AAAA,YACF;AAAA,YACA,QAAQ;AAAA,cACN,MAAM;AAAA,gBACJ,MAAM;AAAA,gBACN,YAAY,EAAE,MAAM,oBAAoB;AAAA,cAC1C;AAAA,YACF;AAAA,YACA,YAAY,CAAC;AAAA,YACb,OAAM,oBAAI,KAAK,UAAU,GAAE,YAAY;AAAA,UACzC;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,kBAAsC;AAAA,EACjD,IAAI,SAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,OAAO,mBAAmB;AAAA,EAChD,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["z"]}
|
|
1
|
+
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"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 .describe(\n 'Klaviyo private API key. Starts with pk_. Find it under Settings > API Keys in your Klaviyo account.',\n ),\n email: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve email from each event (like user.email).',\n )\n .optional(),\n phoneNumber: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve phone number in E.164 format from each event.',\n )\n .optional(),\n externalId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve external ID from each event (like user.id).',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'Destination-level identity mapping. Resolves to profile attributes { firstName?, lastName?, organization?, properties? }. Fires createOrUpdateProfile() on first push and re-fires when values change.',\n )\n .optional(),\n currency: z\n .string()\n .length(3)\n .describe(\n 'Default ISO 4217 currency code for revenue events (like USD, EUR). Sets valueCurrency on Klaviyo events.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identify mapping. Resolves to profile attributes for createOrUpdateProfile(). Use with rule-level skip: true on login/signup events.',\n )\n .optional(),\n value: z\n .unknown()\n .describe(\n 'Revenue value mapping. Resolves to a numeric value for Klaviyo revenue tracking. Sets the value property and valueCurrency on the event.',\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 {\n Env,\n KlaviyoEventsApiMock,\n KlaviyoProfilesApiMock,\n} from '../types';\n\nconst asyncNoop = () => Promise.resolve({});\n\nfunction createMockEventsApi(): KlaviyoEventsApiMock {\n return {\n createEvent: asyncNoop,\n };\n}\n\nfunction createMockProfilesApi(): KlaviyoProfilesApiMock {\n return {\n createOrUpdateProfile: asyncNoop,\n };\n}\n\nexport const push: Env = {\n eventsApi: createMockEventsApi(),\n profilesApi: createMockProfilesApi(),\n};\n\nexport const simulation = [\n 'call:eventsApi.createEvent',\n 'call:profilesApi.createOrUpdateProfile',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Klaviyo SDK step examples.\n *\n * At push time, the destination invokes the `klaviyo-api` SDK. The public\n * method paths users see on the client are:\n *\n * - `eventsApi.createEvent(body)` — fires a metric event with inline profile\n * - `profilesApi.createOrUpdateProfile(body)` — upserts a profile\n *\n * Each `out` is therefore `[['method.path', ...args], ...]` matching the\n * actual SDK call order. `identify` fires before the event. When the rule\n * uses `skip: true` or `ignore: true`, `out` is `[]` or the identify-only\n * list.\n */\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type KlaviyoStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default event forwarding -- eventsApi.createEvent() with event name and\n * inline profile. Email resolved from default settings.email = 'user.email'.\n */\nexport const defaultEvent: KlaviyoStepExample = {\n title: 'Default event',\n description:\n 'An event is sent to Klaviyo as a metric with an inline profile resolved from the user email and id.',\n in: getEvent('product view', {\n timestamp: 1700000100,\n user: { id: 'us3r', email: 'user@example.com' },\n }),\n out: [\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'product view' },\n },\n },\n properties: {},\n time: new Date(1700000100).toISOString(),\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Mapped event name -- mapping.name renames the event to Klaviyo's expected\n * metric name for ecommerce reporting.\n */\nexport const mappedEventName: KlaviyoStepExample = {\n title: 'Viewed product',\n description:\n 'A product view is mapped to the Klaviyo Viewed Product metric with properties such as product name and price.',\n in: getEvent('product view', {\n timestamp: 1700000101,\n user: { id: 'us3r', email: 'user@example.com' },\n data: {\n name: 'USB Cable',\n id: 'PROD-1',\n price: 9.99,\n },\n }),\n mapping: {\n name: 'Viewed Product',\n data: {\n map: {\n ProductName: 'data.name',\n ProductID: 'data.id',\n Price: 'data.price',\n },\n },\n },\n out: [\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'Viewed Product' },\n },\n },\n properties: {\n ProductName: 'USB Cable',\n ProductID: 'PROD-1',\n Price: 9.99,\n },\n time: new Date(1700000101).toISOString(),\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Revenue event -- order complete with value mapping. Sets $value and\n * valueCurrency on the Klaviyo event for revenue tracking.\n */\nexport const revenueEvent: KlaviyoStepExample = {\n title: 'Placed order',\n description:\n 'An order complete is sent to Klaviyo as Placed Order with value and currency for revenue attribution.',\n in: getEvent('order complete', {\n timestamp: 1700000102,\n user: { id: 'us3r', email: 'user@example.com' },\n data: {\n id: 'ORD-123',\n total: 99.99,\n itemNames: ['Widget A', 'Widget B'],\n },\n }),\n settings: {\n currency: 'EUR',\n },\n mapping: {\n name: 'Placed Order',\n data: {\n map: {\n OrderId: 'data.id',\n value: 'data.total',\n ItemNames: 'data.itemNames',\n },\n },\n settings: {\n value: 'data.total',\n },\n },\n out: [\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'Placed Order' },\n },\n },\n properties: {\n OrderId: 'ORD-123',\n value: 99.99,\n ItemNames: ['Widget A', 'Widget B'],\n },\n time: new Date(1700000102).toISOString(),\n valueCurrency: 'EUR',\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Per-event identify with skip -- user login fires\n * profilesApi.createOrUpdateProfile() only, no event tracked.\n */\nexport const userLoginIdentify: KlaviyoStepExample = {\n title: 'User login identify',\n description:\n 'A user login upserts the Klaviyo profile with name, organization, and custom properties without firing an event.',\n in: getEvent('user login', {\n timestamp: 1700000103,\n user: { id: 'us3r', email: 'user@acme.com' },\n data: {\n firstName: 'Jane',\n lastName: 'Doe',\n company: 'Acme Corp',\n plan: 'premium',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n firstName: 'data.firstName',\n lastName: 'data.lastName',\n organization: 'data.company',\n properties: {\n map: {\n plan: 'data.plan',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'profilesApi.createOrUpdateProfile',\n {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@acme.com',\n externalId: 'us3r',\n firstName: 'Jane',\n lastName: 'Doe',\n organization: 'Acme Corp',\n properties: {\n plan: 'premium',\n },\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Destination-level identify -- fires profilesApi.createOrUpdateProfile()\n * on first push when settings.identify resolves, then fires createEvent().\n */\nexport const destinationIdentify: KlaviyoStepExample = {\n title: 'Destination identify',\n description:\n 'Destination-level identify upserts the Klaviyo profile with a first name before each event is sent.',\n in: getEvent('page view', {\n timestamp: 1700000104,\n user: { id: 'us3r', email: 'user@example.com', firstName: 'Jane' },\n }),\n settings: {\n identify: {\n map: {\n firstName: 'user.firstName',\n },\n },\n },\n out: [\n [\n 'profilesApi.createOrUpdateProfile',\n {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n firstName: 'Jane',\n },\n },\n },\n ],\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'user@example.com',\n externalId: 'us3r',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'page view' },\n },\n },\n properties: {},\n time: new Date(1700000104).toISOString(),\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Email only -- no externalId. Klaviyo accepts email as sole identifier.\n */\nexport const emailOnly: KlaviyoStepExample = {\n title: 'Email only',\n description:\n 'A newsletter signup uses only the email address as the Klaviyo profile identifier, with no external id.',\n in: getEvent('newsletter signup', {\n timestamp: 1700000105,\n user: { email: 'subscriber@example.com' },\n }),\n settings: {\n externalId: undefined,\n },\n out: [\n [\n 'eventsApi.createEvent',\n {\n data: {\n type: 'event',\n attributes: {\n profile: {\n data: {\n type: 'profile',\n attributes: {\n email: 'subscriber@example.com',\n },\n },\n },\n metric: {\n data: {\n type: 'metric',\n attributes: { name: 'newsletter signup' },\n },\n },\n properties: {},\n time: new Date(1700000105).toISOString(),\n },\n },\n },\n ],\n ],\n};\n\n/**\n * Wildcard ignore -- the event matches a mapping rule with ignore: true.\n * The destination fires zero API calls.\n */\nexport const wildcardIgnored: KlaviyoStepExample = {\n public: false,\n in: getEvent('debug noise', {\n timestamp: 1700000106,\n user: { id: 'us3r', email: 'user@example.com' },\n }),\n mapping: { ignore: true },\n out: [],\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,EACF;AAAA,EACF,OAAO,EACJ,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,EACV,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,YAAY,EACT,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,EACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,EACP,OAAO,EACP,OAAO,CAAC,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;ACxCD,SAAS,KAAAA,UAAS;AAEX,IAAM,gBAAgBA,GAAE,OAAO;AAAA,EACpC,UAAUA,GACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,OAAOA,GACJ,QAAQ,EACR;AAAA,IACC;AAAA,EACF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AAU,GAAE,YAAY;AAAA,UACzC;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAKO,IAAM,YAAgC;AAAA,EAC3C,OAAO;AAAA,EACP,aACE;AAAA,EACF,IAAI,SAAS,qBAAqB;AAAA,IAChC,WAAW;AAAA,IACX,MAAM,EAAE,OAAO,yBAAyB;AAAA,EAC1C,CAAC;AAAA,EACD,UAAU;AAAA,IACR,YAAY;AAAA,EACd;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,MAAM;AAAA,UACJ,MAAM;AAAA,UACN,YAAY;AAAA,YACV,SAAS;AAAA,cACP,MAAM;AAAA,gBACJ,MAAM;AAAA,gBACN,YAAY;AAAA,kBACV,OAAO;AAAA,gBACT;AAAA,cACF;AAAA,YACF;AAAA,YACA,QAAQ;AAAA,cACN,MAAM;AAAA,gBACJ,MAAM;AAAA,gBACN,YAAY,EAAE,MAAM,oBAAoB;AAAA,cAC1C;AAAA,YACF;AAAA,YACA,YAAY,CAAC;AAAA,YACb,OAAM,oBAAI,KAAK,UAAU,GAAE,YAAY;AAAA,UACzC;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,kBAAsC;AAAA,EACjD,QAAQ;AAAA,EACR,IAAI,SAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,OAAO,mBAAmB;AAAA,EAChD,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["z"]}
|
package/dist/examples/index.js
CHANGED
|
@@ -64,6 +64,8 @@ __export(step_exports, {
|
|
|
64
64
|
});
|
|
65
65
|
var import_core = require("@walkeros/core");
|
|
66
66
|
var defaultEvent = {
|
|
67
|
+
title: "Default event",
|
|
68
|
+
description: "An event is sent to Klaviyo as a metric with an inline profile resolved from the user email and id.",
|
|
67
69
|
in: (0, import_core.getEvent)("product view", {
|
|
68
70
|
timestamp: 1700000100,
|
|
69
71
|
user: { id: "us3r", email: "user@example.com" }
|
|
@@ -99,6 +101,8 @@ var defaultEvent = {
|
|
|
99
101
|
]
|
|
100
102
|
};
|
|
101
103
|
var mappedEventName = {
|
|
104
|
+
title: "Viewed product",
|
|
105
|
+
description: "A product view is mapped to the Klaviyo Viewed Product metric with properties such as product name and price.",
|
|
102
106
|
in: (0, import_core.getEvent)("product view", {
|
|
103
107
|
timestamp: 1700000101,
|
|
104
108
|
user: { id: "us3r", email: "user@example.com" },
|
|
@@ -153,6 +157,8 @@ var mappedEventName = {
|
|
|
153
157
|
]
|
|
154
158
|
};
|
|
155
159
|
var revenueEvent = {
|
|
160
|
+
title: "Placed order",
|
|
161
|
+
description: "An order complete is sent to Klaviyo as Placed Order with value and currency for revenue attribution.",
|
|
156
162
|
in: (0, import_core.getEvent)("order complete", {
|
|
157
163
|
timestamp: 1700000102,
|
|
158
164
|
user: { id: "us3r", email: "user@example.com" },
|
|
@@ -214,6 +220,8 @@ var revenueEvent = {
|
|
|
214
220
|
]
|
|
215
221
|
};
|
|
216
222
|
var userLoginIdentify = {
|
|
223
|
+
title: "User login identify",
|
|
224
|
+
description: "A user login upserts the Klaviyo profile with name, organization, and custom properties without firing an event.",
|
|
217
225
|
in: (0, import_core.getEvent)("user login", {
|
|
218
226
|
timestamp: 1700000103,
|
|
219
227
|
user: { id: "us3r", email: "user@acme.com" },
|
|
@@ -263,6 +271,8 @@ var userLoginIdentify = {
|
|
|
263
271
|
]
|
|
264
272
|
};
|
|
265
273
|
var destinationIdentify = {
|
|
274
|
+
title: "Destination identify",
|
|
275
|
+
description: "Destination-level identify upserts the Klaviyo profile with a first name before each event is sent.",
|
|
266
276
|
in: (0, import_core.getEvent)("page view", {
|
|
267
277
|
timestamp: 1700000104,
|
|
268
278
|
user: { id: "us3r", email: "user@example.com", firstName: "Jane" }
|
|
@@ -318,6 +328,8 @@ var destinationIdentify = {
|
|
|
318
328
|
]
|
|
319
329
|
};
|
|
320
330
|
var emailOnly = {
|
|
331
|
+
title: "Email only",
|
|
332
|
+
description: "A newsletter signup uses only the email address as the Klaviyo profile identifier, with no external id.",
|
|
321
333
|
in: (0, import_core.getEvent)("newsletter signup", {
|
|
322
334
|
timestamp: 1700000105,
|
|
323
335
|
user: { email: "subscriber@example.com" }
|
|
@@ -355,6 +367,7 @@ var emailOnly = {
|
|
|
355
367
|
]
|
|
356
368
|
};
|
|
357
369
|
var wildcardIgnored = {
|
|
370
|
+
public: false,
|
|
358
371
|
in: (0, import_core.getEvent)("debug noise", {
|
|
359
372
|
timestamp: 1700000106,
|
|
360
373
|
user: { id: "us3r", email: "user@example.com" }
|
package/dist/examples/index.mjs
CHANGED
|
@@ -43,6 +43,8 @@ __export(step_exports, {
|
|
|
43
43
|
});
|
|
44
44
|
import { getEvent } from "@walkeros/core";
|
|
45
45
|
var defaultEvent = {
|
|
46
|
+
title: "Default event",
|
|
47
|
+
description: "An event is sent to Klaviyo as a metric with an inline profile resolved from the user email and id.",
|
|
46
48
|
in: getEvent("product view", {
|
|
47
49
|
timestamp: 1700000100,
|
|
48
50
|
user: { id: "us3r", email: "user@example.com" }
|
|
@@ -78,6 +80,8 @@ var defaultEvent = {
|
|
|
78
80
|
]
|
|
79
81
|
};
|
|
80
82
|
var mappedEventName = {
|
|
83
|
+
title: "Viewed product",
|
|
84
|
+
description: "A product view is mapped to the Klaviyo Viewed Product metric with properties such as product name and price.",
|
|
81
85
|
in: getEvent("product view", {
|
|
82
86
|
timestamp: 1700000101,
|
|
83
87
|
user: { id: "us3r", email: "user@example.com" },
|
|
@@ -132,6 +136,8 @@ var mappedEventName = {
|
|
|
132
136
|
]
|
|
133
137
|
};
|
|
134
138
|
var revenueEvent = {
|
|
139
|
+
title: "Placed order",
|
|
140
|
+
description: "An order complete is sent to Klaviyo as Placed Order with value and currency for revenue attribution.",
|
|
135
141
|
in: getEvent("order complete", {
|
|
136
142
|
timestamp: 1700000102,
|
|
137
143
|
user: { id: "us3r", email: "user@example.com" },
|
|
@@ -193,6 +199,8 @@ var revenueEvent = {
|
|
|
193
199
|
]
|
|
194
200
|
};
|
|
195
201
|
var userLoginIdentify = {
|
|
202
|
+
title: "User login identify",
|
|
203
|
+
description: "A user login upserts the Klaviyo profile with name, organization, and custom properties without firing an event.",
|
|
196
204
|
in: getEvent("user login", {
|
|
197
205
|
timestamp: 1700000103,
|
|
198
206
|
user: { id: "us3r", email: "user@acme.com" },
|
|
@@ -242,6 +250,8 @@ var userLoginIdentify = {
|
|
|
242
250
|
]
|
|
243
251
|
};
|
|
244
252
|
var destinationIdentify = {
|
|
253
|
+
title: "Destination identify",
|
|
254
|
+
description: "Destination-level identify upserts the Klaviyo profile with a first name before each event is sent.",
|
|
245
255
|
in: getEvent("page view", {
|
|
246
256
|
timestamp: 1700000104,
|
|
247
257
|
user: { id: "us3r", email: "user@example.com", firstName: "Jane" }
|
|
@@ -297,6 +307,8 @@ var destinationIdentify = {
|
|
|
297
307
|
]
|
|
298
308
|
};
|
|
299
309
|
var emailOnly = {
|
|
310
|
+
title: "Email only",
|
|
311
|
+
description: "A newsletter signup uses only the email address as the Klaviyo profile identifier, with no external id.",
|
|
300
312
|
in: getEvent("newsletter signup", {
|
|
301
313
|
timestamp: 1700000105,
|
|
302
314
|
user: { email: "subscriber@example.com" }
|
|
@@ -334,6 +346,7 @@ var emailOnly = {
|
|
|
334
346
|
]
|
|
335
347
|
};
|
|
336
348
|
var wildcardIgnored = {
|
|
349
|
+
public: false,
|
|
337
350
|
in: getEvent("debug noise", {
|
|
338
351
|
timestamp: 1700000106,
|
|
339
352
|
user: { id: "us3r", email: "user@example.com" }
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/server-destination-klaviyo",
|
|
4
|
-
"version": "3.4.
|
|
4
|
+
"version": "3.4.1",
|
|
5
5
|
"type": "destination",
|
|
6
6
|
"platform": [
|
|
7
7
|
"server"
|
|
@@ -81,6 +81,8 @@
|
|
|
81
81
|
},
|
|
82
82
|
"step": {
|
|
83
83
|
"defaultEvent": {
|
|
84
|
+
"title": "Default event",
|
|
85
|
+
"description": "An event is sent to Klaviyo as a metric with an inline profile resolved from the user email and id.",
|
|
84
86
|
"in": {
|
|
85
87
|
"name": "product view",
|
|
86
88
|
"data": {
|
|
@@ -119,7 +121,7 @@
|
|
|
119
121
|
"group": "gr0up",
|
|
120
122
|
"count": 1,
|
|
121
123
|
"version": {
|
|
122
|
-
"source": "3.4.
|
|
124
|
+
"source": "3.4.1",
|
|
123
125
|
"tagging": 1
|
|
124
126
|
},
|
|
125
127
|
"source": {
|
|
@@ -161,6 +163,8 @@
|
|
|
161
163
|
]
|
|
162
164
|
},
|
|
163
165
|
"destinationIdentify": {
|
|
166
|
+
"title": "Destination identify",
|
|
167
|
+
"description": "Destination-level identify upserts the Klaviyo profile with a first name before each event is sent.",
|
|
164
168
|
"in": {
|
|
165
169
|
"name": "page view",
|
|
166
170
|
"data": {
|
|
@@ -215,7 +219,7 @@
|
|
|
215
219
|
"group": "gr0up",
|
|
216
220
|
"count": 1,
|
|
217
221
|
"version": {
|
|
218
|
-
"source": "3.4.
|
|
222
|
+
"source": "3.4.1",
|
|
219
223
|
"tagging": 1
|
|
220
224
|
},
|
|
221
225
|
"source": {
|
|
@@ -277,6 +281,8 @@
|
|
|
277
281
|
]
|
|
278
282
|
},
|
|
279
283
|
"emailOnly": {
|
|
284
|
+
"title": "Email only",
|
|
285
|
+
"description": "A newsletter signup uses only the email address as the Klaviyo profile identifier, with no external id.",
|
|
280
286
|
"in": {
|
|
281
287
|
"name": "newsletter signup",
|
|
282
288
|
"data": {
|
|
@@ -331,7 +337,7 @@
|
|
|
331
337
|
"group": "gr0up",
|
|
332
338
|
"count": 1,
|
|
333
339
|
"version": {
|
|
334
|
-
"source": "3.4.
|
|
340
|
+
"source": "3.4.1",
|
|
335
341
|
"tagging": 1
|
|
336
342
|
},
|
|
337
343
|
"source": {
|
|
@@ -373,6 +379,8 @@
|
|
|
373
379
|
]
|
|
374
380
|
},
|
|
375
381
|
"mappedEventName": {
|
|
382
|
+
"title": "Viewed product",
|
|
383
|
+
"description": "A product view is mapped to the Klaviyo Viewed Product metric with properties such as product name and price.",
|
|
376
384
|
"in": {
|
|
377
385
|
"name": "product view",
|
|
378
386
|
"data": {
|
|
@@ -409,7 +417,7 @@
|
|
|
409
417
|
"group": "gr0up",
|
|
410
418
|
"count": 1,
|
|
411
419
|
"version": {
|
|
412
|
-
"source": "3.4.
|
|
420
|
+
"source": "3.4.1",
|
|
413
421
|
"tagging": 1
|
|
414
422
|
},
|
|
415
423
|
"source": {
|
|
@@ -465,6 +473,8 @@
|
|
|
465
473
|
]
|
|
466
474
|
},
|
|
467
475
|
"revenueEvent": {
|
|
476
|
+
"title": "Placed order",
|
|
477
|
+
"description": "An order complete is sent to Klaviyo as Placed Order with value and currency for revenue attribution.",
|
|
468
478
|
"in": {
|
|
469
479
|
"name": "order complete",
|
|
470
480
|
"data": {
|
|
@@ -551,7 +561,7 @@
|
|
|
551
561
|
"group": "gr0up",
|
|
552
562
|
"count": 1,
|
|
553
563
|
"version": {
|
|
554
|
-
"source": "3.4.
|
|
564
|
+
"source": "3.4.1",
|
|
555
565
|
"tagging": 1
|
|
556
566
|
},
|
|
557
567
|
"source": {
|
|
@@ -617,6 +627,8 @@
|
|
|
617
627
|
]
|
|
618
628
|
},
|
|
619
629
|
"userLoginIdentify": {
|
|
630
|
+
"title": "User login identify",
|
|
631
|
+
"description": "A user login upserts the Klaviyo profile with name, organization, and custom properties without firing an event.",
|
|
620
632
|
"in": {
|
|
621
633
|
"name": "user login",
|
|
622
634
|
"data": {
|
|
@@ -668,7 +680,7 @@
|
|
|
668
680
|
"group": "gr0up",
|
|
669
681
|
"count": 1,
|
|
670
682
|
"version": {
|
|
671
|
-
"source": "3.4.
|
|
683
|
+
"source": "3.4.1",
|
|
672
684
|
"tagging": 1
|
|
673
685
|
},
|
|
674
686
|
"source": {
|
|
@@ -716,6 +728,7 @@
|
|
|
716
728
|
]
|
|
717
729
|
},
|
|
718
730
|
"wildcardIgnored": {
|
|
731
|
+
"public": false,
|
|
719
732
|
"in": {
|
|
720
733
|
"name": "debug noise",
|
|
721
734
|
"data": {
|
|
@@ -771,7 +784,7 @@
|
|
|
771
784
|
"group": "gr0up",
|
|
772
785
|
"count": 1,
|
|
773
786
|
"version": {
|
|
774
|
-
"source": "3.4.
|
|
787
|
+
"source": "3.4.1",
|
|
775
788
|
"tagging": 1
|
|
776
789
|
},
|
|
777
790
|
"source": {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/server-destination-klaviyo",
|
|
3
3
|
"description": "Klaviyo marketing automation server destination for walkerOS (klaviyo-api SDK, events + profile upserts)",
|
|
4
|
-
"version": "3.4.
|
|
4
|
+
"version": "3.4.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"klaviyo-api": "^22.0.0",
|
|
38
|
-
"@walkeros/core": "3.4.
|
|
39
|
-
"@walkeros/server-core": "3.4.
|
|
38
|
+
"@walkeros/core": "3.4.1",
|
|
39
|
+
"@walkeros/server-core": "3.4.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@walkeros/collector": "3.4.
|
|
42
|
+
"@walkeros/collector": "3.4.1"
|
|
43
43
|
},
|
|
44
44
|
"repository": {
|
|
45
45
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|