@walkeros/server-destination-segment 3.4.0 → 3.4.1-next-1776790594143

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 CHANGED
@@ -1 +1 @@
1
- "use strict";var e,t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,i=(e,s)=>{for(var n in s)t(e,n,{get:s[n],enumerable:!0})},r={};i(r,{examples:()=>y,schemas:()=>o}),module.exports=(e=r,((e,i,r,o)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let p of n(i))a.call(e,p)||p===r||t(e,p,{get:()=>i[p],enumerable:!(o=s(i,p))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o={};i(o,{MappingSchema:()=>c,SettingsSchema:()=>u,mapping:()=>g,settings:()=>d});var p=require("@walkeros/core/dev"),m=require("@walkeros/core/dev"),u=m.z.object({writeKey:m.z.string().min(1).describe("Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys."),userId:m.z.string().describe("walkerOS mapping value path to resolve userId from each event (like user.id).").optional(),anonymousId:m.z.string().describe("walkerOS mapping value path to resolve anonymousId from each event (like user.session).").optional(),host:m.z.string().url().describe("Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.").optional(),path:m.z.string().describe("API path route (like /v1/batch).").optional(),flushAt:m.z.number().int().positive().describe("Events to enqueue before flushing a batch. Default: 15.").optional(),flushInterval:m.z.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxRetries:m.z.number().int().min(0).describe("Retry attempts for failed batches. Default: 3.").optional(),httpRequestTimeout:m.z.number().int().positive().describe("HTTP request timeout in milliseconds. Default: 10000.").optional(),disable:m.z.boolean().describe("Completely disable the SDK (no-ops all calls). Default: false.").optional(),identify:m.z.unknown().describe("Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.").optional(),group:m.z.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.").optional(),consent:m.z.record(m.z.string(),m.z.string()).describe('Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { "marketing": "Advertising", "analytics": "Analytics" }.').optional(),integrations:m.z.record(m.z.string(),m.z.unknown()).describe('Enable/disable downstream Segment destinations. Example: { "All": true, "Mixpanel": false }.').optional()}),l=require("@walkeros/core/dev"),c=l.z.object({identify:l.z.unknown().describe("Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.").optional(),group:l.z.unknown().describe("Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.").optional(),page:l.z.unknown().describe("Per-event page call. Resolves to { category?, name?, properties? } or true for minimal page(). Use with skip: true.").optional(),screen:l.z.unknown().describe("Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.").optional()}),d=(0,p.zodToSchema)(u),g=(0,p.zodToSchema)(c),y={};i(y,{env:()=>v,step:()=>k});var v={};i(v,{push:()=>w,simulation:()=>f});var b=()=>{};var w={analytics:{track:b,identify:b,group:b,page:b,screen:b,closeAndFlush:()=>Promise.resolve()}},f=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen"],k={};i(k,{anonymousOnly:()=>O,companyGroup:()=>E,consentForwarding:()=>x,defaultTrack:()=>I,destinationIdentify:()=>D,mappedEventName:()=>z,pageView:()=>P,screenView:()=>A,userLoginIdentify:()=>S,wildcardIgnored:()=>R});var h=require("@walkeros/core"),I={in:(0,h.getEvent)("product view",{timestamp:1700000100,user:{id:"us3r",session:"s3ss10n"}}),out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000100)}]]},z={in:(0,h.getEvent)("order complete",{timestamp:1700000101,user:{id:"us3r",session:"s3ss10n"}}),mapping:{name:"Order Completed"},out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"Order Completed",properties:{},timestamp:new Date(1700000101)}]]},D={in:(0,h.getEvent)("page view",{timestamp:1700000102,user:{id:"us3r",session:"s3ss10n",email:"user@example.com"}}),settings:{identify:{map:{traits:{map:{email:"user.email"}}}}},out:[["analytics.identify",{userId:"us3r",anonymousId:"s3ss10n",traits:{email:"user@example.com"},timestamp:new Date(1700000102)}],["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"page view",properties:{},timestamp:new Date(1700000102)}]]},S={in:(0,h.getEvent)("user login",{timestamp:1700000103,user:{id:"us3r",session:"s3ss10n"},data:{user_id:"new-user-123",email:"user@acme.com",name:"Jane Doe",plan:"premium"}}),mapping:{skip:!0,settings:{identify:{map:{userId:"data.user_id",traits:{map:{email:"data.email",name:"data.name",plan:"data.plan"}}}}}},out:[["analytics.identify",{userId:"new-user-123",anonymousId:"s3ss10n",traits:{email:"user@acme.com",name:"Jane Doe",plan:"premium"},timestamp:new Date(1700000103)}]]},E={in:(0,h.getEvent)("company update",{timestamp:1700000104,user:{id:"us3r",session:"s3ss10n"},data:{company_id:"comp-456",company_name:"Acme",industry:"tech",employees:50}}),mapping:{skip:!0,settings:{group:{map:{groupId:"data.company_id",traits:{map:{name:"data.company_name",industry:"data.industry",employees:"data.employees"}}}}}},out:[["analytics.group",{userId:"us3r",anonymousId:"s3ss10n",groupId:"comp-456",traits:{name:"Acme",industry:"tech",employees:50},timestamp:new Date(1700000104)}]]},P={in:(0,h.getEvent)("page view",{timestamp:1700000105,user:{id:"us3r",session:"s3ss10n"},data:{category:"docs",title:"Getting Started",section:"tutorials"}}),mapping:{skip:!0,settings:{page:{map:{category:"data.category",name:"data.title",properties:{map:{section:"data.section"}}}}}},out:[["analytics.page",{userId:"us3r",anonymousId:"s3ss10n",category:"docs",name:"Getting Started",properties:{section:"tutorials"},timestamp:new Date(1700000105)}]]},A={in:(0,h.getEvent)("screen view",{timestamp:1700000106,user:{id:"us3r",session:"s3ss10n"},data:{screen_name:"Welcome",section:"onboarding",build:"1.2.3"}}),mapping:{skip:!0,settings:{screen:{map:{name:"data.screen_name",category:"data.section",properties:{map:{build:"data.build"}}}}}},out:[["analytics.screen",{userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",category:"onboarding",properties:{build:"1.2.3"},timestamp:new Date(1700000106)}]]},O={in:(0,h.getEvent)("product view",{timestamp:1700000107,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:[["analytics.track",{anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000107)}]]},x={in:(0,h.getEvent)("product view",{timestamp:1700000108,user:{id:"us3r",session:"s3ss10n"},consent:{analytics:!0,marketing:!0}}),settings:{consent:{analytics:"Analytics",marketing:"Advertising"}},out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108),context:{consent:{categoryPreferences:{Analytics:!0,Advertising:!0}}}}]]},R={in:(0,h.getEvent)("debug noise",{timestamp:1700000109,user:{id:"us3r",session:"s3ss10n"}}),mapping:{ignore:!0},out:[]};//# sourceMappingURL=dev.js.map
1
+ "use strict";var e,t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,a=(e,s)=>{for(var n in s)t(e,n,{get:s[n],enumerable:!0})},r={};a(r,{examples:()=>y,schemas:()=>o}),module.exports=(e=r,((e,a,r,o)=>{if(a&&"object"==typeof a||"function"==typeof a)for(let p of n(a))i.call(e,p)||p===r||t(e,p,{get:()=>a[p],enumerable:!(o=s(a,p))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o={};a(o,{MappingSchema:()=>d,SettingsSchema:()=>c,mapping:()=>g,settings:()=>u});var p=require("@walkeros/core/dev"),l=require("@walkeros/core/dev"),c=l.z.object({writeKey:l.z.string().min(1).describe("Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys."),userId:l.z.string().describe("walkerOS mapping value path to resolve userId from each event (like user.id).").optional(),anonymousId:l.z.string().describe("walkerOS mapping value path to resolve anonymousId from each event (like user.session).").optional(),host:l.z.string().url().describe("Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.").optional(),path:l.z.string().describe("API path route (like /v1/batch).").optional(),flushAt:l.z.number().int().positive().describe("Events to enqueue before flushing a batch. Default: 15.").optional(),flushInterval:l.z.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxRetries:l.z.number().int().min(0).describe("Retry attempts for failed batches. Default: 3.").optional(),httpRequestTimeout:l.z.number().int().positive().describe("HTTP request timeout in milliseconds. Default: 10000.").optional(),disable:l.z.boolean().describe("Completely disable the SDK (no-ops all calls). Default: false.").optional(),identify:l.z.unknown().describe("Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.").optional(),group:l.z.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.").optional(),consent:l.z.record(l.z.string(),l.z.string()).describe('Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { "marketing": "Advertising", "analytics": "Analytics" }.').optional(),integrations:l.z.record(l.z.string(),l.z.unknown()).describe('Enable/disable downstream Segment destinations. Example: { "All": true, "Mixpanel": false }.').optional()}),m=require("@walkeros/core/dev"),d=m.z.object({identify:m.z.unknown().describe("Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.").optional(),group:m.z.unknown().describe("Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.").optional(),page:m.z.unknown().describe("Per-event page call. Resolves to { category?, name?, properties? } or true for minimal page(). Use with skip: true.").optional(),screen:m.z.unknown().describe("Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.").optional()}),u=(0,p.zodToSchema)(c),g=(0,p.zodToSchema)(d),y={};a(y,{env:()=>v,step:()=>h});var v={};a(v,{push:()=>w,simulation:()=>b});var f=()=>{};var w={analytics:{track:f,identify:f,group:f,page:f,screen:f,closeAndFlush:()=>Promise.resolve()}},b=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen"],h={};a(h,{anonymousOnly:()=>O,companyGroup:()=>A,consentForwarding:()=>x,defaultTrack:()=>I,destinationIdentify:()=>z,mappedEventName:()=>S,pageView:()=>P,screenView:()=>E,userLoginIdentify:()=>D,wildcardIgnored:()=>R});var k=require("@walkeros/core"),I={title:"Default track",description:"A walker event becomes a Segment analytics.track call with userId and anonymousId resolved from the event.",in:(0,k.getEvent)("product view",{timestamp:1700000100,user:{id:"us3r",session:"s3ss10n"}}),out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000100)}]]},S={title:"Renamed event",description:"A mapping renames the event so the Segment track call uses Segment's canonical 'Order Completed' name.",in:(0,k.getEvent)("order complete",{timestamp:1700000101,user:{id:"us3r",session:"s3ss10n"}}),mapping:{name:"Order Completed"},out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"Order Completed",properties:{},timestamp:new Date(1700000101)}]]},z={title:"Destination identify",description:"Destination-level identify fires Segment analytics.identify with traits on the first push only, then the track call follows.",in:(0,k.getEvent)("page view",{timestamp:1700000102,user:{id:"us3r",session:"s3ss10n",email:"user@example.com"}}),settings:{identify:{map:{traits:{map:{email:"user.email"}}}}},out:[["analytics.identify",{userId:"us3r",anonymousId:"s3ss10n",traits:{email:"user@example.com"},timestamp:new Date(1700000102)}],["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"page view",properties:{},timestamp:new Date(1700000102)}]]},D={title:"User login identify",description:"A user login fires only Segment analytics.identify with the userId and traits, skipping the track.",in:(0,k.getEvent)("user login",{timestamp:1700000103,user:{id:"us3r",session:"s3ss10n"},data:{user_id:"new-user-123",email:"user@acme.com",name:"Jane Doe",plan:"premium"}}),mapping:{skip:!0,settings:{identify:{map:{userId:"data.user_id",traits:{map:{email:"data.email",name:"data.name",plan:"data.plan"}}}}}},out:[["analytics.identify",{userId:"new-user-123",anonymousId:"s3ss10n",traits:{email:"user@acme.com",name:"Jane Doe",plan:"premium"},timestamp:new Date(1700000103)}]]},A={title:"Group company",description:"A company update fires Segment analytics.group with groupId and group traits for account-level tracking.",in:(0,k.getEvent)("company update",{timestamp:1700000104,user:{id:"us3r",session:"s3ss10n"},data:{company_id:"comp-456",company_name:"Acme",industry:"tech",employees:50}}),mapping:{skip:!0,settings:{group:{map:{groupId:"data.company_id",traits:{map:{name:"data.company_name",industry:"data.industry",employees:"data.employees"}}}}}},out:[["analytics.group",{userId:"us3r",anonymousId:"s3ss10n",groupId:"comp-456",traits:{name:"Acme",industry:"tech",employees:50},timestamp:new Date(1700000104)}]]},P={title:"Page view",description:"A page view fires Segment analytics.page with category, name, and properties instead of a generic track.",in:(0,k.getEvent)("page view",{timestamp:1700000105,user:{id:"us3r",session:"s3ss10n"},data:{category:"docs",title:"Getting Started",section:"tutorials"}}),mapping:{skip:!0,settings:{page:{map:{category:"data.category",name:"data.title",properties:{map:{section:"data.section"}}}}}},out:[["analytics.page",{userId:"us3r",anonymousId:"s3ss10n",category:"docs",name:"Getting Started",properties:{section:"tutorials"},timestamp:new Date(1700000105)}]]},E={title:"Screen view",description:"A screen view fires Segment analytics.screen with name, category, and properties for mobile app tracking.",in:(0,k.getEvent)("screen view",{timestamp:1700000106,user:{id:"us3r",session:"s3ss10n"},data:{screen_name:"Welcome",section:"onboarding",build:"1.2.3"}}),mapping:{skip:!0,settings:{screen:{map:{name:"data.screen_name",category:"data.section",properties:{map:{build:"data.build"}}}}}},out:[["analytics.screen",{userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",category:"onboarding",properties:{build:"1.2.3"},timestamp:new Date(1700000106)}]]},O={title:"Anonymous only",description:"When no userId is resolved Segment accepts a track call keyed solely by anonymousId.",in:(0,k.getEvent)("product view",{timestamp:1700000107,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:[["analytics.track",{anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000107)}]]},x={title:"Consent forwarding",description:"Walker consent keys are mapped to Segment categoryPreferences on the analytics context for downstream filtering.",in:(0,k.getEvent)("product view",{timestamp:1700000108,user:{id:"us3r",session:"s3ss10n"},consent:{analytics:!0,marketing:!0}}),settings:{consent:{analytics:"Analytics",marketing:"Advertising"}},out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108),context:{consent:{categoryPreferences:{Analytics:!0,Advertising:!0}}}}]]},R={public:!1,in:(0,k.getEvent)("debug noise",{timestamp:1700000109,user:{id:"us3r",session:"s3ss10n"}}),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 writeKey: z\n .string()\n .min(1)\n .describe(\n 'Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys.',\n ),\n userId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve userId from each event (like user.id).',\n )\n .optional(),\n anonymousId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve anonymousId from each event (like user.session).',\n )\n .optional(),\n host: z\n .string()\n .url()\n .describe(\n 'Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.',\n )\n .optional(),\n path: z.string().describe('API path route (like /v1/batch).').optional(),\n flushAt: z\n .number()\n .int()\n .positive()\n .describe('Events to enqueue before flushing a batch. Default: 15.')\n .optional(),\n flushInterval: z\n .number()\n .int()\n .positive()\n .describe('Max milliseconds before auto-flush. Default: 10000.')\n .optional(),\n maxRetries: z\n .number()\n .int()\n .min(0)\n .describe('Retry attempts for failed batches. Default: 3.')\n .optional(),\n httpRequestTimeout: z\n .number()\n .int()\n .positive()\n .describe('HTTP request timeout in milliseconds. Default: 10000.')\n .optional(),\n disable: z\n .boolean()\n .describe('Completely disable the SDK (no-ops all calls). Default: false.')\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.',\n )\n .optional(),\n consent: z\n .record(z.string(), z.string())\n .describe(\n 'Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { \"marketing\": \"Advertising\", \"analytics\": \"Analytics\" }.',\n )\n .optional(),\n integrations: z\n .record(z.string(), z.unknown())\n .describe(\n 'Enable/disable downstream Segment destinations. Example: { \"All\": true, \"Mixpanel\": false }.',\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 identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.',\n )\n .optional(),\n page: z\n .unknown()\n .describe(\n 'Per-event page call. Resolves to { category?, name?, properties? } or true for minimal page(). Use with skip: true.',\n )\n .optional(),\n screen: z\n .unknown()\n .describe(\n 'Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, SegmentAnalyticsMock } from '../types';\n\nconst noop = () => {};\nconst asyncNoop = () => Promise.resolve();\n\nfunction createMockAnalytics(): SegmentAnalyticsMock {\n return {\n track: noop,\n identify: noop,\n group: noop,\n page: noop,\n screen: noop,\n closeAndFlush: asyncNoop,\n };\n}\n\nexport const push: Env = {\n analytics: createMockAnalytics(),\n};\n\nexport const simulation = [\n 'call:analytics.track',\n 'call:analytics.identify',\n 'call:analytics.group',\n 'call:analytics.page',\n 'call:analytics.screen',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type SegmentStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Segment server destination invokes the injected `env.analytics` SDK methods\n * (`track`, `identify`, `group`, `page`, `screen`) — not a raw HTTP endpoint.\n * Each `out` entry is therefore `[callable, params]` where `callable` is the\n * dotted method name (e.g. `'analytics.track'`) and `params` is the object\n * passed to the SDK.\n *\n * Examples may emit multiple calls in order (e.g. identify + track), so\n * every `out` is wrapped as `[[callable, params], ...]`.\n */\n\n/**\n * Default event forwarding -- analytics.track() with event name and empty\n * properties. userId resolved from default settings.userId = 'user.id'.\n */\nexport const defaultTrack: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000100,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000100),\n },\n ],\n ],\n};\n\n/**\n * Mapped event name -- mapping.name renames the event for Segment.\n */\nexport const mappedEventName: SegmentStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000101,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: {\n name: 'Order Completed',\n },\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'Order Completed',\n properties: {},\n timestamp: new Date(1700000101),\n },\n ],\n ],\n};\n\n/**\n * Destination-level identify -- fires analytics.identify() on first push\n * when settings.identify mapping resolves. Then fires analytics.track().\n */\nexport const destinationIdentify: SegmentStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000102,\n user: { id: 'us3r', session: 's3ss10n', email: 'user@example.com' },\n }),\n settings: {\n identify: {\n map: {\n traits: {\n map: {\n email: 'user.email',\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.identify',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n traits: { email: 'user@example.com' },\n timestamp: new Date(1700000102),\n },\n ],\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'page view',\n properties: {},\n timestamp: new Date(1700000102),\n },\n ],\n ],\n};\n\n/**\n * Per-event identify with skip -- user login fires identify() only.\n */\nexport const userLoginIdentify: SegmentStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000103,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n user_id: 'new-user-123',\n email: 'user@acme.com',\n name: 'Jane Doe',\n plan: 'premium',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n userId: 'data.user_id',\n traits: {\n map: {\n email: 'data.email',\n name: 'data.name',\n plan: 'data.plan',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.identify',\n {\n userId: 'new-user-123',\n anonymousId: 's3ss10n',\n traits: { email: 'user@acme.com', name: 'Jane Doe', plan: 'premium' },\n timestamp: new Date(1700000103),\n },\n ],\n ],\n};\n\n/**\n * Per-event group with skip -- company update fires group() only.\n */\nexport const companyGroup: SegmentStepExample = {\n in: getEvent('company update', {\n timestamp: 1700000104,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n company_id: 'comp-456',\n company_name: 'Acme',\n industry: 'tech',\n employees: 50,\n },\n }),\n mapping: {\n skip: true,\n settings: {\n group: {\n map: {\n groupId: 'data.company_id',\n traits: {\n map: {\n name: 'data.company_name',\n industry: 'data.industry',\n employees: 'data.employees',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.group',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n groupId: 'comp-456',\n traits: { name: 'Acme', industry: 'tech', employees: 50 },\n timestamp: new Date(1700000104),\n },\n ],\n ],\n};\n\n/**\n * Explicit page() call with properties -- the canonical Segment page view.\n * skip: true suppresses track(); settings.page fires analytics.page().\n */\nexport const pageView: SegmentStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000105,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n category: 'docs',\n title: 'Getting Started',\n section: 'tutorials',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n page: {\n map: {\n category: 'data.category',\n name: 'data.title',\n properties: {\n map: {\n section: 'data.section',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.page',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n category: 'docs',\n name: 'Getting Started',\n properties: { section: 'tutorials' },\n timestamp: new Date(1700000105),\n },\n ],\n ],\n};\n\n/**\n * Screen call -- server-only method for mobile app backends.\n */\nexport const screenView: SegmentStepExample = {\n in: getEvent('screen view', {\n timestamp: 1700000106,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n screen_name: 'Welcome',\n section: 'onboarding',\n build: '1.2.3',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n screen: {\n map: {\n name: 'data.screen_name',\n category: 'data.section',\n properties: {\n map: {\n build: 'data.build',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.screen',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n name: 'Welcome',\n category: 'onboarding',\n properties: { build: '1.2.3' },\n timestamp: new Date(1700000106),\n },\n ],\n ],\n};\n\n/**\n * AnonymousId only -- no userId resolved. Segment accepts anonymousId alone.\n */\nexport const anonymousOnly: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000107,\n user: { session: 's3ss10n' },\n }),\n settings: {\n userId: undefined,\n },\n out: [\n [\n 'analytics.track',\n {\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000107),\n },\n ],\n ],\n};\n\n/**\n * Consent context forwarding -- settings.consent maps walkerOS consent\n * keys to Segment categoryPreferences on the context object.\n */\nexport const consentForwarding: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000108,\n user: { id: 'us3r', session: 's3ss10n' },\n consent: { analytics: true, marketing: true },\n }),\n settings: {\n consent: {\n analytics: 'Analytics',\n marketing: 'Advertising',\n },\n },\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000108),\n context: {\n consent: {\n categoryPreferences: {\n Analytics: true,\n Advertising: true,\n },\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 SDK calls.\n */\nexport const wildcardIgnored: SegmentStepExample = {\n in: getEvent('debug noise', {\n timestamp: 1700000109,\n user: { id: 'us3r', session: 's3ss10n' },\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,UAAU,aACP,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,aACL,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,aACV,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,aACH,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,aAAE,OAAO,EAAE,SAAS,kCAAkC,EAAE,SAAS;AAAA,EACvE,SAAS,aACN,OAAO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AA,MAChC;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,oBAAwC;AAAA,EACnD,QAAI,sBAAS,gBAAgB;AAAA,IAC3B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,IACvC,SAAS,EAAE,WAAW,MAAM,WAAW,KAAK;AAAA,EAC9C,CAAC;AAAA,EACD,UAAU;AAAA,IACR,SAAS;AAAA,MACP,WAAW;AAAA,MACX,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,QAAQ;AAAA,QACR,aAAa;AAAA,QACb,OAAO;AAAA,QACP,YAAY,CAAC;AAAA,QACb,WAAW,oBAAI,KAAK,UAAU;AAAA,QAC9B,SAAS;AAAA,UACP,SAAS;AAAA,YACP,qBAAqB;AAAA,cACnB,WAAW;AAAA,cACX,aAAa;AAAA,YACf;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,kBAAsC;AAAA,EACjD,QAAI,sBAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,EACzC,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,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 writeKey: z\n .string()\n .min(1)\n .describe(\n 'Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys.',\n ),\n userId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve userId from each event (like user.id).',\n )\n .optional(),\n anonymousId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve anonymousId from each event (like user.session).',\n )\n .optional(),\n host: z\n .string()\n .url()\n .describe(\n 'Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.',\n )\n .optional(),\n path: z.string().describe('API path route (like /v1/batch).').optional(),\n flushAt: z\n .number()\n .int()\n .positive()\n .describe('Events to enqueue before flushing a batch. Default: 15.')\n .optional(),\n flushInterval: z\n .number()\n .int()\n .positive()\n .describe('Max milliseconds before auto-flush. Default: 10000.')\n .optional(),\n maxRetries: z\n .number()\n .int()\n .min(0)\n .describe('Retry attempts for failed batches. Default: 3.')\n .optional(),\n httpRequestTimeout: z\n .number()\n .int()\n .positive()\n .describe('HTTP request timeout in milliseconds. Default: 10000.')\n .optional(),\n disable: z\n .boolean()\n .describe('Completely disable the SDK (no-ops all calls). Default: false.')\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.',\n )\n .optional(),\n consent: z\n .record(z.string(), z.string())\n .describe(\n 'Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { \"marketing\": \"Advertising\", \"analytics\": \"Analytics\" }.',\n )\n .optional(),\n integrations: z\n .record(z.string(), z.unknown())\n .describe(\n 'Enable/disable downstream Segment destinations. Example: { \"All\": true, \"Mixpanel\": false }.',\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 identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.',\n )\n .optional(),\n page: z\n .unknown()\n .describe(\n 'Per-event page call. Resolves to { category?, name?, properties? } or true for minimal page(). Use with skip: true.',\n )\n .optional(),\n screen: z\n .unknown()\n .describe(\n 'Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, SegmentAnalyticsMock } from '../types';\n\nconst noop = () => {};\nconst asyncNoop = () => Promise.resolve();\n\nfunction createMockAnalytics(): SegmentAnalyticsMock {\n return {\n track: noop,\n identify: noop,\n group: noop,\n page: noop,\n screen: noop,\n closeAndFlush: asyncNoop,\n };\n}\n\nexport const push: Env = {\n analytics: createMockAnalytics(),\n};\n\nexport const simulation = [\n 'call:analytics.track',\n 'call:analytics.identify',\n 'call:analytics.group',\n 'call:analytics.page',\n 'call:analytics.screen',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type SegmentStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Segment server destination invokes the injected `env.analytics` SDK methods\n * (`track`, `identify`, `group`, `page`, `screen`) — not a raw HTTP endpoint.\n * Each `out` entry is therefore `[callable, params]` where `callable` is the\n * dotted method name (e.g. `'analytics.track'`) and `params` is the object\n * passed to the SDK.\n *\n * Examples may emit multiple calls in order (e.g. identify + track), so\n * every `out` is wrapped as `[[callable, params], ...]`.\n */\n\n/**\n * Default event forwarding -- analytics.track() with event name and empty\n * properties. userId resolved from default settings.userId = 'user.id'.\n */\nexport const defaultTrack: SegmentStepExample = {\n title: 'Default track',\n description:\n 'A walker event becomes a Segment analytics.track call with userId and anonymousId resolved from the event.',\n in: getEvent('product view', {\n timestamp: 1700000100,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000100),\n },\n ],\n ],\n};\n\n/**\n * Mapped event name -- mapping.name renames the event for Segment.\n */\nexport const mappedEventName: SegmentStepExample = {\n title: 'Renamed event',\n description:\n \"A mapping renames the event so the Segment track call uses Segment's canonical 'Order Completed' name.\",\n in: getEvent('order complete', {\n timestamp: 1700000101,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: {\n name: 'Order Completed',\n },\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'Order Completed',\n properties: {},\n timestamp: new Date(1700000101),\n },\n ],\n ],\n};\n\n/**\n * Destination-level identify -- fires analytics.identify() on first push\n * when settings.identify mapping resolves. Then fires analytics.track().\n */\nexport const destinationIdentify: SegmentStepExample = {\n title: 'Destination identify',\n description:\n 'Destination-level identify fires Segment analytics.identify with traits on the first push only, then the track call follows.',\n in: getEvent('page view', {\n timestamp: 1700000102,\n user: { id: 'us3r', session: 's3ss10n', email: 'user@example.com' },\n }),\n settings: {\n identify: {\n map: {\n traits: {\n map: {\n email: 'user.email',\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.identify',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n traits: { email: 'user@example.com' },\n timestamp: new Date(1700000102),\n },\n ],\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'page view',\n properties: {},\n timestamp: new Date(1700000102),\n },\n ],\n ],\n};\n\n/**\n * Per-event identify with skip -- user login fires identify() only.\n */\nexport const userLoginIdentify: SegmentStepExample = {\n title: 'User login identify',\n description:\n 'A user login fires only Segment analytics.identify with the userId and traits, skipping the track.',\n in: getEvent('user login', {\n timestamp: 1700000103,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n user_id: 'new-user-123',\n email: 'user@acme.com',\n name: 'Jane Doe',\n plan: 'premium',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n userId: 'data.user_id',\n traits: {\n map: {\n email: 'data.email',\n name: 'data.name',\n plan: 'data.plan',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.identify',\n {\n userId: 'new-user-123',\n anonymousId: 's3ss10n',\n traits: { email: 'user@acme.com', name: 'Jane Doe', plan: 'premium' },\n timestamp: new Date(1700000103),\n },\n ],\n ],\n};\n\n/**\n * Per-event group with skip -- company update fires group() only.\n */\nexport const companyGroup: SegmentStepExample = {\n title: 'Group company',\n description:\n 'A company update fires Segment analytics.group with groupId and group traits for account-level tracking.',\n in: getEvent('company update', {\n timestamp: 1700000104,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n company_id: 'comp-456',\n company_name: 'Acme',\n industry: 'tech',\n employees: 50,\n },\n }),\n mapping: {\n skip: true,\n settings: {\n group: {\n map: {\n groupId: 'data.company_id',\n traits: {\n map: {\n name: 'data.company_name',\n industry: 'data.industry',\n employees: 'data.employees',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.group',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n groupId: 'comp-456',\n traits: { name: 'Acme', industry: 'tech', employees: 50 },\n timestamp: new Date(1700000104),\n },\n ],\n ],\n};\n\n/**\n * Explicit page() call with properties -- the canonical Segment page view.\n * skip: true suppresses track(); settings.page fires analytics.page().\n */\nexport const pageView: SegmentStepExample = {\n title: 'Page view',\n description:\n 'A page view fires Segment analytics.page with category, name, and properties instead of a generic track.',\n in: getEvent('page view', {\n timestamp: 1700000105,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n category: 'docs',\n title: 'Getting Started',\n section: 'tutorials',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n page: {\n map: {\n category: 'data.category',\n name: 'data.title',\n properties: {\n map: {\n section: 'data.section',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.page',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n category: 'docs',\n name: 'Getting Started',\n properties: { section: 'tutorials' },\n timestamp: new Date(1700000105),\n },\n ],\n ],\n};\n\n/**\n * Screen call -- server-only method for mobile app backends.\n */\nexport const screenView: SegmentStepExample = {\n title: 'Screen view',\n description:\n 'A screen view fires Segment analytics.screen with name, category, and properties for mobile app tracking.',\n in: getEvent('screen view', {\n timestamp: 1700000106,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n screen_name: 'Welcome',\n section: 'onboarding',\n build: '1.2.3',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n screen: {\n map: {\n name: 'data.screen_name',\n category: 'data.section',\n properties: {\n map: {\n build: 'data.build',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.screen',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n name: 'Welcome',\n category: 'onboarding',\n properties: { build: '1.2.3' },\n timestamp: new Date(1700000106),\n },\n ],\n ],\n};\n\n/**\n * AnonymousId only -- no userId resolved. Segment accepts anonymousId alone.\n */\nexport const anonymousOnly: SegmentStepExample = {\n title: 'Anonymous only',\n description:\n 'When no userId is resolved Segment accepts a track call keyed solely by anonymousId.',\n in: getEvent('product view', {\n timestamp: 1700000107,\n user: { session: 's3ss10n' },\n }),\n settings: {\n userId: undefined,\n },\n out: [\n [\n 'analytics.track',\n {\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000107),\n },\n ],\n ],\n};\n\n/**\n * Consent context forwarding -- settings.consent maps walkerOS consent\n * keys to Segment categoryPreferences on the context object.\n */\nexport const consentForwarding: SegmentStepExample = {\n title: 'Consent forwarding',\n description:\n 'Walker consent keys are mapped to Segment categoryPreferences on the analytics context for downstream filtering.',\n in: getEvent('product view', {\n timestamp: 1700000108,\n user: { id: 'us3r', session: 's3ss10n' },\n consent: { analytics: true, marketing: true },\n }),\n settings: {\n consent: {\n analytics: 'Analytics',\n marketing: 'Advertising',\n },\n },\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000108),\n context: {\n consent: {\n categoryPreferences: {\n Analytics: true,\n Advertising: true,\n },\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 SDK calls.\n */\nexport const wildcardIgnored: SegmentStepExample = {\n public: false,\n in: getEvent('debug noise', {\n timestamp: 1700000109,\n user: { id: 'us3r', session: 's3ss10n' },\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,UAAU,aACP,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,aACL,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,aACV,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,aACH,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,aAAE,OAAO,EAAE,SAAS,kCAAkC,EAAE,SAAS;AAAA,EACvE,SAAS,aACN,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,yDAAyD,EAClE,SAAS;AAAA,EACZ,eAAe,aACZ,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,qDAAqD,EAC9D,SAAS;AAAA,EACZ,YAAY,aACT,OAAO,EACP,IAAI,EACJ,IAAI,CAAC,EACL,SAAS,gDAAgD,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AC;AAAA,QACb,WAAW,oBAAI,KAAK,UAAU;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,oBAAwC;AAAA,EACnD,OAAO;AAAA,EACP,aACE;AAAA,EACF,QAAI,sBAAS,gBAAgB;AAAA,IAC3B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,IACvC,SAAS,EAAE,WAAW,MAAM,WAAW,KAAK;AAAA,EAC9C,CAAC;AAAA,EACD,UAAU;AAAA,IACR,SAAS;AAAA,MACP,WAAW;AAAA,MACX,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,QAAQ;AAAA,QACR,aAAa;AAAA,QACb,OAAO;AAAA,QACP,YAAY,CAAC;AAAA,QACb,WAAW,oBAAI,KAAK,UAAU;AAAA,QAC9B,SAAS;AAAA,UACP,SAAS;AAAA,YACP,qBAAqB;AAAA,cACnB,WAAW;AAAA,cACX,aAAa;AAAA,YACf;AAAA,UACF;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,SAAS,UAAU;AAAA,EACzC,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,s=(s,t)=>{for(var n in t)e(s,n,{get:t[n],enumerable:!0})},t={};s(t,{MappingSchema:()=>o,SettingsSchema:()=>i,mapping:()=>m,settings:()=>p});import{zodToSchema as n}from"@walkeros/core/dev";import{z as a}from"@walkeros/core/dev";var i=a.object({writeKey:a.string().min(1).describe("Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys."),userId:a.string().describe("walkerOS mapping value path to resolve userId from each event (like user.id).").optional(),anonymousId:a.string().describe("walkerOS mapping value path to resolve anonymousId from each event (like user.session).").optional(),host:a.string().url().describe("Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.").optional(),path:a.string().describe("API path route (like /v1/batch).").optional(),flushAt:a.number().int().positive().describe("Events to enqueue before flushing a batch. Default: 15.").optional(),flushInterval:a.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxRetries:a.number().int().min(0).describe("Retry attempts for failed batches. Default: 3.").optional(),httpRequestTimeout:a.number().int().positive().describe("HTTP request timeout in milliseconds. Default: 10000.").optional(),disable:a.boolean().describe("Completely disable the SDK (no-ops all calls). Default: false.").optional(),identify:a.unknown().describe("Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.").optional(),group:a.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.").optional(),consent:a.record(a.string(),a.string()).describe('Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { "marketing": "Advertising", "analytics": "Analytics" }.').optional(),integrations:a.record(a.string(),a.unknown()).describe('Enable/disable downstream Segment destinations. Example: { "All": true, "Mixpanel": false }.').optional()});import{z as r}from"@walkeros/core/dev";var o=r.object({identify:r.unknown().describe("Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.").optional(),group:r.unknown().describe("Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.").optional(),page:r.unknown().describe("Per-event page call. Resolves to { category?, name?, properties? } or true for minimal page(). Use with skip: true.").optional(),screen:r.unknown().describe("Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.").optional()}),p=n(i),m=n(o),u={};s(u,{env:()=>l,step:()=>y});var l={};s(l,{push:()=>c,simulation:()=>g});var d=()=>{};var c={analytics:{track:d,identify:d,group:d,page:d,screen:d,closeAndFlush:()=>Promise.resolve()}},g=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen"],y={};s(y,{anonymousOnly:()=>S,companyGroup:()=>I,consentForwarding:()=>A,defaultTrack:()=>w,destinationIdentify:()=>b,mappedEventName:()=>f,pageView:()=>h,screenView:()=>D,userLoginIdentify:()=>k,wildcardIgnored:()=>P});import{getEvent as v}from"@walkeros/core";var w={in:v("product view",{timestamp:1700000100,user:{id:"us3r",session:"s3ss10n"}}),out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000100)}]]},f={in:v("order complete",{timestamp:1700000101,user:{id:"us3r",session:"s3ss10n"}}),mapping:{name:"Order Completed"},out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"Order Completed",properties:{},timestamp:new Date(1700000101)}]]},b={in:v("page view",{timestamp:1700000102,user:{id:"us3r",session:"s3ss10n",email:"user@example.com"}}),settings:{identify:{map:{traits:{map:{email:"user.email"}}}}},out:[["analytics.identify",{userId:"us3r",anonymousId:"s3ss10n",traits:{email:"user@example.com"},timestamp:new Date(1700000102)}],["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"page view",properties:{},timestamp:new Date(1700000102)}]]},k={in:v("user login",{timestamp:1700000103,user:{id:"us3r",session:"s3ss10n"},data:{user_id:"new-user-123",email:"user@acme.com",name:"Jane Doe",plan:"premium"}}),mapping:{skip:!0,settings:{identify:{map:{userId:"data.user_id",traits:{map:{email:"data.email",name:"data.name",plan:"data.plan"}}}}}},out:[["analytics.identify",{userId:"new-user-123",anonymousId:"s3ss10n",traits:{email:"user@acme.com",name:"Jane Doe",plan:"premium"},timestamp:new Date(1700000103)}]]},I={in:v("company update",{timestamp:1700000104,user:{id:"us3r",session:"s3ss10n"},data:{company_id:"comp-456",company_name:"Acme",industry:"tech",employees:50}}),mapping:{skip:!0,settings:{group:{map:{groupId:"data.company_id",traits:{map:{name:"data.company_name",industry:"data.industry",employees:"data.employees"}}}}}},out:[["analytics.group",{userId:"us3r",anonymousId:"s3ss10n",groupId:"comp-456",traits:{name:"Acme",industry:"tech",employees:50},timestamp:new Date(1700000104)}]]},h={in:v("page view",{timestamp:1700000105,user:{id:"us3r",session:"s3ss10n"},data:{category:"docs",title:"Getting Started",section:"tutorials"}}),mapping:{skip:!0,settings:{page:{map:{category:"data.category",name:"data.title",properties:{map:{section:"data.section"}}}}}},out:[["analytics.page",{userId:"us3r",anonymousId:"s3ss10n",category:"docs",name:"Getting Started",properties:{section:"tutorials"},timestamp:new Date(1700000105)}]]},D={in:v("screen view",{timestamp:1700000106,user:{id:"us3r",session:"s3ss10n"},data:{screen_name:"Welcome",section:"onboarding",build:"1.2.3"}}),mapping:{skip:!0,settings:{screen:{map:{name:"data.screen_name",category:"data.section",properties:{map:{build:"data.build"}}}}}},out:[["analytics.screen",{userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",category:"onboarding",properties:{build:"1.2.3"},timestamp:new Date(1700000106)}]]},S={in:v("product view",{timestamp:1700000107,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:[["analytics.track",{anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000107)}]]},A={in:v("product view",{timestamp:1700000108,user:{id:"us3r",session:"s3ss10n"},consent:{analytics:!0,marketing:!0}}),settings:{consent:{analytics:"Analytics",marketing:"Advertising"}},out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108),context:{consent:{categoryPreferences:{Analytics:!0,Advertising:!0}}}}]]},P={in:v("debug noise",{timestamp:1700000109,user:{id:"us3r",session:"s3ss10n"}}),mapping:{ignore:!0},out:[]};export{u as examples,t as schemas};//# sourceMappingURL=dev.mjs.map
1
+ var e=Object.defineProperty,t=(t,s)=>{for(var n in s)e(t,n,{get:s[n],enumerable:!0})},s={};t(s,{MappingSchema:()=>o,SettingsSchema:()=>a,mapping:()=>m,settings:()=>p});import{zodToSchema as n}from"@walkeros/core/dev";import{z as i}from"@walkeros/core/dev";var a=i.object({writeKey:i.string().min(1).describe("Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys."),userId:i.string().describe("walkerOS mapping value path to resolve userId from each event (like user.id).").optional(),anonymousId:i.string().describe("walkerOS mapping value path to resolve anonymousId from each event (like user.session).").optional(),host:i.string().url().describe("Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.").optional(),path:i.string().describe("API path route (like /v1/batch).").optional(),flushAt:i.number().int().positive().describe("Events to enqueue before flushing a batch. Default: 15.").optional(),flushInterval:i.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxRetries:i.number().int().min(0).describe("Retry attempts for failed batches. Default: 3.").optional(),httpRequestTimeout:i.number().int().positive().describe("HTTP request timeout in milliseconds. Default: 10000.").optional(),disable:i.boolean().describe("Completely disable the SDK (no-ops all calls). Default: false.").optional(),identify:i.unknown().describe("Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.").optional(),group:i.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.").optional(),consent:i.record(i.string(),i.string()).describe('Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { "marketing": "Advertising", "analytics": "Analytics" }.').optional(),integrations:i.record(i.string(),i.unknown()).describe('Enable/disable downstream Segment destinations. Example: { "All": true, "Mixpanel": false }.').optional()});import{z as r}from"@walkeros/core/dev";var o=r.object({identify:r.unknown().describe("Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.").optional(),group:r.unknown().describe("Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.").optional(),page:r.unknown().describe("Per-event page call. Resolves to { category?, name?, properties? } or true for minimal page(). Use with skip: true.").optional(),screen:r.unknown().describe("Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.").optional()}),p=n(a),m=n(o),l={};t(l,{env:()=>c,step:()=>y});var c={};t(c,{push:()=>u,simulation:()=>g});var d=()=>{};var u={analytics:{track:d,identify:d,group:d,page:d,screen:d,closeAndFlush:()=>Promise.resolve()}},g=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen"],y={};t(y,{anonymousOnly:()=>D,companyGroup:()=>b,consentForwarding:()=>A,defaultTrack:()=>f,destinationIdentify:()=>k,mappedEventName:()=>w,pageView:()=>I,screenView:()=>S,userLoginIdentify:()=>h,wildcardIgnored:()=>P});import{getEvent as v}from"@walkeros/core";var f={title:"Default track",description:"A walker event becomes a Segment analytics.track call with userId and anonymousId resolved from the event.",in:v("product view",{timestamp:1700000100,user:{id:"us3r",session:"s3ss10n"}}),out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000100)}]]},w={title:"Renamed event",description:"A mapping renames the event so the Segment track call uses Segment's canonical 'Order Completed' name.",in:v("order complete",{timestamp:1700000101,user:{id:"us3r",session:"s3ss10n"}}),mapping:{name:"Order Completed"},out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"Order Completed",properties:{},timestamp:new Date(1700000101)}]]},k={title:"Destination identify",description:"Destination-level identify fires Segment analytics.identify with traits on the first push only, then the track call follows.",in:v("page view",{timestamp:1700000102,user:{id:"us3r",session:"s3ss10n",email:"user@example.com"}}),settings:{identify:{map:{traits:{map:{email:"user.email"}}}}},out:[["analytics.identify",{userId:"us3r",anonymousId:"s3ss10n",traits:{email:"user@example.com"},timestamp:new Date(1700000102)}],["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"page view",properties:{},timestamp:new Date(1700000102)}]]},h={title:"User login identify",description:"A user login fires only Segment analytics.identify with the userId and traits, skipping the track.",in:v("user login",{timestamp:1700000103,user:{id:"us3r",session:"s3ss10n"},data:{user_id:"new-user-123",email:"user@acme.com",name:"Jane Doe",plan:"premium"}}),mapping:{skip:!0,settings:{identify:{map:{userId:"data.user_id",traits:{map:{email:"data.email",name:"data.name",plan:"data.plan"}}}}}},out:[["analytics.identify",{userId:"new-user-123",anonymousId:"s3ss10n",traits:{email:"user@acme.com",name:"Jane Doe",plan:"premium"},timestamp:new Date(1700000103)}]]},b={title:"Group company",description:"A company update fires Segment analytics.group with groupId and group traits for account-level tracking.",in:v("company update",{timestamp:1700000104,user:{id:"us3r",session:"s3ss10n"},data:{company_id:"comp-456",company_name:"Acme",industry:"tech",employees:50}}),mapping:{skip:!0,settings:{group:{map:{groupId:"data.company_id",traits:{map:{name:"data.company_name",industry:"data.industry",employees:"data.employees"}}}}}},out:[["analytics.group",{userId:"us3r",anonymousId:"s3ss10n",groupId:"comp-456",traits:{name:"Acme",industry:"tech",employees:50},timestamp:new Date(1700000104)}]]},I={title:"Page view",description:"A page view fires Segment analytics.page with category, name, and properties instead of a generic track.",in:v("page view",{timestamp:1700000105,user:{id:"us3r",session:"s3ss10n"},data:{category:"docs",title:"Getting Started",section:"tutorials"}}),mapping:{skip:!0,settings:{page:{map:{category:"data.category",name:"data.title",properties:{map:{section:"data.section"}}}}}},out:[["analytics.page",{userId:"us3r",anonymousId:"s3ss10n",category:"docs",name:"Getting Started",properties:{section:"tutorials"},timestamp:new Date(1700000105)}]]},S={title:"Screen view",description:"A screen view fires Segment analytics.screen with name, category, and properties for mobile app tracking.",in:v("screen view",{timestamp:1700000106,user:{id:"us3r",session:"s3ss10n"},data:{screen_name:"Welcome",section:"onboarding",build:"1.2.3"}}),mapping:{skip:!0,settings:{screen:{map:{name:"data.screen_name",category:"data.section",properties:{map:{build:"data.build"}}}}}},out:[["analytics.screen",{userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",category:"onboarding",properties:{build:"1.2.3"},timestamp:new Date(1700000106)}]]},D={title:"Anonymous only",description:"When no userId is resolved Segment accepts a track call keyed solely by anonymousId.",in:v("product view",{timestamp:1700000107,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:[["analytics.track",{anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000107)}]]},A={title:"Consent forwarding",description:"Walker consent keys are mapped to Segment categoryPreferences on the analytics context for downstream filtering.",in:v("product view",{timestamp:1700000108,user:{id:"us3r",session:"s3ss10n"},consent:{analytics:!0,marketing:!0}}),settings:{consent:{analytics:"Analytics",marketing:"Advertising"}},out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108),context:{consent:{categoryPreferences:{Analytics:!0,Advertising:!0}}}}]]},P={public:!1,in:v("debug noise",{timestamp:1700000109,user:{id:"us3r",session:"s3ss10n"}}),mapping:{ignore:!0},out:[]};export{l as examples,s 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 writeKey: z\n .string()\n .min(1)\n .describe(\n 'Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys.',\n ),\n userId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve userId from each event (like user.id).',\n )\n .optional(),\n anonymousId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve anonymousId from each event (like user.session).',\n )\n .optional(),\n host: z\n .string()\n .url()\n .describe(\n 'Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.',\n )\n .optional(),\n path: z.string().describe('API path route (like /v1/batch).').optional(),\n flushAt: z\n .number()\n .int()\n .positive()\n .describe('Events to enqueue before flushing a batch. Default: 15.')\n .optional(),\n flushInterval: z\n .number()\n .int()\n .positive()\n .describe('Max milliseconds before auto-flush. Default: 10000.')\n .optional(),\n maxRetries: z\n .number()\n .int()\n .min(0)\n .describe('Retry attempts for failed batches. Default: 3.')\n .optional(),\n httpRequestTimeout: z\n .number()\n .int()\n .positive()\n .describe('HTTP request timeout in milliseconds. Default: 10000.')\n .optional(),\n disable: z\n .boolean()\n .describe('Completely disable the SDK (no-ops all calls). Default: false.')\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.',\n )\n .optional(),\n consent: z\n .record(z.string(), z.string())\n .describe(\n 'Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { \"marketing\": \"Advertising\", \"analytics\": \"Analytics\" }.',\n )\n .optional(),\n integrations: z\n .record(z.string(), z.unknown())\n .describe(\n 'Enable/disable downstream Segment destinations. Example: { \"All\": true, \"Mixpanel\": false }.',\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 identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.',\n )\n .optional(),\n page: z\n .unknown()\n .describe(\n 'Per-event page call. Resolves to { category?, name?, properties? } or true for minimal page(). Use with skip: true.',\n )\n .optional(),\n screen: z\n .unknown()\n .describe(\n 'Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, SegmentAnalyticsMock } from '../types';\n\nconst noop = () => {};\nconst asyncNoop = () => Promise.resolve();\n\nfunction createMockAnalytics(): SegmentAnalyticsMock {\n return {\n track: noop,\n identify: noop,\n group: noop,\n page: noop,\n screen: noop,\n closeAndFlush: asyncNoop,\n };\n}\n\nexport const push: Env = {\n analytics: createMockAnalytics(),\n};\n\nexport const simulation = [\n 'call:analytics.track',\n 'call:analytics.identify',\n 'call:analytics.group',\n 'call:analytics.page',\n 'call:analytics.screen',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type SegmentStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Segment server destination invokes the injected `env.analytics` SDK methods\n * (`track`, `identify`, `group`, `page`, `screen`) — not a raw HTTP endpoint.\n * Each `out` entry is therefore `[callable, params]` where `callable` is the\n * dotted method name (e.g. `'analytics.track'`) and `params` is the object\n * passed to the SDK.\n *\n * Examples may emit multiple calls in order (e.g. identify + track), so\n * every `out` is wrapped as `[[callable, params], ...]`.\n */\n\n/**\n * Default event forwarding -- analytics.track() with event name and empty\n * properties. userId resolved from default settings.userId = 'user.id'.\n */\nexport const defaultTrack: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000100,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000100),\n },\n ],\n ],\n};\n\n/**\n * Mapped event name -- mapping.name renames the event for Segment.\n */\nexport const mappedEventName: SegmentStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000101,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: {\n name: 'Order Completed',\n },\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'Order Completed',\n properties: {},\n timestamp: new Date(1700000101),\n },\n ],\n ],\n};\n\n/**\n * Destination-level identify -- fires analytics.identify() on first push\n * when settings.identify mapping resolves. Then fires analytics.track().\n */\nexport const destinationIdentify: SegmentStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000102,\n user: { id: 'us3r', session: 's3ss10n', email: 'user@example.com' },\n }),\n settings: {\n identify: {\n map: {\n traits: {\n map: {\n email: 'user.email',\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.identify',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n traits: { email: 'user@example.com' },\n timestamp: new Date(1700000102),\n },\n ],\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'page view',\n properties: {},\n timestamp: new Date(1700000102),\n },\n ],\n ],\n};\n\n/**\n * Per-event identify with skip -- user login fires identify() only.\n */\nexport const userLoginIdentify: SegmentStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000103,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n user_id: 'new-user-123',\n email: 'user@acme.com',\n name: 'Jane Doe',\n plan: 'premium',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n userId: 'data.user_id',\n traits: {\n map: {\n email: 'data.email',\n name: 'data.name',\n plan: 'data.plan',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.identify',\n {\n userId: 'new-user-123',\n anonymousId: 's3ss10n',\n traits: { email: 'user@acme.com', name: 'Jane Doe', plan: 'premium' },\n timestamp: new Date(1700000103),\n },\n ],\n ],\n};\n\n/**\n * Per-event group with skip -- company update fires group() only.\n */\nexport const companyGroup: SegmentStepExample = {\n in: getEvent('company update', {\n timestamp: 1700000104,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n company_id: 'comp-456',\n company_name: 'Acme',\n industry: 'tech',\n employees: 50,\n },\n }),\n mapping: {\n skip: true,\n settings: {\n group: {\n map: {\n groupId: 'data.company_id',\n traits: {\n map: {\n name: 'data.company_name',\n industry: 'data.industry',\n employees: 'data.employees',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.group',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n groupId: 'comp-456',\n traits: { name: 'Acme', industry: 'tech', employees: 50 },\n timestamp: new Date(1700000104),\n },\n ],\n ],\n};\n\n/**\n * Explicit page() call with properties -- the canonical Segment page view.\n * skip: true suppresses track(); settings.page fires analytics.page().\n */\nexport const pageView: SegmentStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000105,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n category: 'docs',\n title: 'Getting Started',\n section: 'tutorials',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n page: {\n map: {\n category: 'data.category',\n name: 'data.title',\n properties: {\n map: {\n section: 'data.section',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.page',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n category: 'docs',\n name: 'Getting Started',\n properties: { section: 'tutorials' },\n timestamp: new Date(1700000105),\n },\n ],\n ],\n};\n\n/**\n * Screen call -- server-only method for mobile app backends.\n */\nexport const screenView: SegmentStepExample = {\n in: getEvent('screen view', {\n timestamp: 1700000106,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n screen_name: 'Welcome',\n section: 'onboarding',\n build: '1.2.3',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n screen: {\n map: {\n name: 'data.screen_name',\n category: 'data.section',\n properties: {\n map: {\n build: 'data.build',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.screen',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n name: 'Welcome',\n category: 'onboarding',\n properties: { build: '1.2.3' },\n timestamp: new Date(1700000106),\n },\n ],\n ],\n};\n\n/**\n * AnonymousId only -- no userId resolved. Segment accepts anonymousId alone.\n */\nexport const anonymousOnly: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000107,\n user: { session: 's3ss10n' },\n }),\n settings: {\n userId: undefined,\n },\n out: [\n [\n 'analytics.track',\n {\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000107),\n },\n ],\n ],\n};\n\n/**\n * Consent context forwarding -- settings.consent maps walkerOS consent\n * keys to Segment categoryPreferences on the context object.\n */\nexport const consentForwarding: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000108,\n user: { id: 'us3r', session: 's3ss10n' },\n consent: { analytics: true, marketing: true },\n }),\n settings: {\n consent: {\n analytics: 'Analytics',\n marketing: 'Advertising',\n },\n },\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000108),\n context: {\n consent: {\n categoryPreferences: {\n Analytics: true,\n Advertising: true,\n },\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 SDK calls.\n */\nexport const wildcardIgnored: SegmentStepExample = {\n in: getEvent('debug noise', {\n timestamp: 1700000109,\n user: { id: 'us3r', session: 's3ss10n' },\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,UAAU,EACP,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,EACL,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,EACV,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,EACH,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,EAAE,OAAO,EAAE,SAAS,kCAAkC,EAAE,SAAS;AAAA,EACvE,SAAS,EACN,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,yDAAyD,EAClE,SAAS;AAAA,EACZ,eAAe,EACZ,OAAO,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BAAgB;AAAA,IAC3B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,IACvC,SAAS,EAAE,WAAW,MAAM,WAAW,KAAK;AAAA,EAC9C,CAAC;AAAA,EACD,UAAU;AAAA,IACR,SAAS;AAAA,MACP,WAAW;AAAA,MACX,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,QAAQ;AAAA,QACR,aAAa;AAAA,QACb,OAAO;AAAA,QACP,YAAY,CAAC;AAAA,QACb,WAAW,oBAAI,KAAK,UAAU;AAAA,QAC9B,SAAS;AAAA,UACP,SAAS;AAAA,YACP,qBAAqB;AAAA,cACnB,WAAW;AAAA,cACX,aAAa;AAAA,YACf;AAAA,UACF;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,SAAS,UAAU;AAAA,EACzC,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 writeKey: z\n .string()\n .min(1)\n .describe(\n 'Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys.',\n ),\n userId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve userId from each event (like user.id).',\n )\n .optional(),\n anonymousId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve anonymousId from each event (like user.session).',\n )\n .optional(),\n host: z\n .string()\n .url()\n .describe(\n 'Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.',\n )\n .optional(),\n path: z.string().describe('API path route (like /v1/batch).').optional(),\n flushAt: z\n .number()\n .int()\n .positive()\n .describe('Events to enqueue before flushing a batch. Default: 15.')\n .optional(),\n flushInterval: z\n .number()\n .int()\n .positive()\n .describe('Max milliseconds before auto-flush. Default: 10000.')\n .optional(),\n maxRetries: z\n .number()\n .int()\n .min(0)\n .describe('Retry attempts for failed batches. Default: 3.')\n .optional(),\n httpRequestTimeout: z\n .number()\n .int()\n .positive()\n .describe('HTTP request timeout in milliseconds. Default: 10000.')\n .optional(),\n disable: z\n .boolean()\n .describe('Completely disable the SDK (no-ops all calls). Default: false.')\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.',\n )\n .optional(),\n consent: z\n .record(z.string(), z.string())\n .describe(\n 'Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { \"marketing\": \"Advertising\", \"analytics\": \"Analytics\" }.',\n )\n .optional(),\n integrations: z\n .record(z.string(), z.unknown())\n .describe(\n 'Enable/disable downstream Segment destinations. Example: { \"All\": true, \"Mixpanel\": false }.',\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 identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.',\n )\n .optional(),\n page: z\n .unknown()\n .describe(\n 'Per-event page call. Resolves to { category?, name?, properties? } or true for minimal page(). Use with skip: true.',\n )\n .optional(),\n screen: z\n .unknown()\n .describe(\n 'Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, SegmentAnalyticsMock } from '../types';\n\nconst noop = () => {};\nconst asyncNoop = () => Promise.resolve();\n\nfunction createMockAnalytics(): SegmentAnalyticsMock {\n return {\n track: noop,\n identify: noop,\n group: noop,\n page: noop,\n screen: noop,\n closeAndFlush: asyncNoop,\n };\n}\n\nexport const push: Env = {\n analytics: createMockAnalytics(),\n};\n\nexport const simulation = [\n 'call:analytics.track',\n 'call:analytics.identify',\n 'call:analytics.group',\n 'call:analytics.page',\n 'call:analytics.screen',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type SegmentStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Segment server destination invokes the injected `env.analytics` SDK methods\n * (`track`, `identify`, `group`, `page`, `screen`) — not a raw HTTP endpoint.\n * Each `out` entry is therefore `[callable, params]` where `callable` is the\n * dotted method name (e.g. `'analytics.track'`) and `params` is the object\n * passed to the SDK.\n *\n * Examples may emit multiple calls in order (e.g. identify + track), so\n * every `out` is wrapped as `[[callable, params], ...]`.\n */\n\n/**\n * Default event forwarding -- analytics.track() with event name and empty\n * properties. userId resolved from default settings.userId = 'user.id'.\n */\nexport const defaultTrack: SegmentStepExample = {\n title: 'Default track',\n description:\n 'A walker event becomes a Segment analytics.track call with userId and anonymousId resolved from the event.',\n in: getEvent('product view', {\n timestamp: 1700000100,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000100),\n },\n ],\n ],\n};\n\n/**\n * Mapped event name -- mapping.name renames the event for Segment.\n */\nexport const mappedEventName: SegmentStepExample = {\n title: 'Renamed event',\n description:\n \"A mapping renames the event so the Segment track call uses Segment's canonical 'Order Completed' name.\",\n in: getEvent('order complete', {\n timestamp: 1700000101,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: {\n name: 'Order Completed',\n },\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'Order Completed',\n properties: {},\n timestamp: new Date(1700000101),\n },\n ],\n ],\n};\n\n/**\n * Destination-level identify -- fires analytics.identify() on first push\n * when settings.identify mapping resolves. Then fires analytics.track().\n */\nexport const destinationIdentify: SegmentStepExample = {\n title: 'Destination identify',\n description:\n 'Destination-level identify fires Segment analytics.identify with traits on the first push only, then the track call follows.',\n in: getEvent('page view', {\n timestamp: 1700000102,\n user: { id: 'us3r', session: 's3ss10n', email: 'user@example.com' },\n }),\n settings: {\n identify: {\n map: {\n traits: {\n map: {\n email: 'user.email',\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.identify',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n traits: { email: 'user@example.com' },\n timestamp: new Date(1700000102),\n },\n ],\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'page view',\n properties: {},\n timestamp: new Date(1700000102),\n },\n ],\n ],\n};\n\n/**\n * Per-event identify with skip -- user login fires identify() only.\n */\nexport const userLoginIdentify: SegmentStepExample = {\n title: 'User login identify',\n description:\n 'A user login fires only Segment analytics.identify with the userId and traits, skipping the track.',\n in: getEvent('user login', {\n timestamp: 1700000103,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n user_id: 'new-user-123',\n email: 'user@acme.com',\n name: 'Jane Doe',\n plan: 'premium',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n userId: 'data.user_id',\n traits: {\n map: {\n email: 'data.email',\n name: 'data.name',\n plan: 'data.plan',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.identify',\n {\n userId: 'new-user-123',\n anonymousId: 's3ss10n',\n traits: { email: 'user@acme.com', name: 'Jane Doe', plan: 'premium' },\n timestamp: new Date(1700000103),\n },\n ],\n ],\n};\n\n/**\n * Per-event group with skip -- company update fires group() only.\n */\nexport const companyGroup: SegmentStepExample = {\n title: 'Group company',\n description:\n 'A company update fires Segment analytics.group with groupId and group traits for account-level tracking.',\n in: getEvent('company update', {\n timestamp: 1700000104,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n company_id: 'comp-456',\n company_name: 'Acme',\n industry: 'tech',\n employees: 50,\n },\n }),\n mapping: {\n skip: true,\n settings: {\n group: {\n map: {\n groupId: 'data.company_id',\n traits: {\n map: {\n name: 'data.company_name',\n industry: 'data.industry',\n employees: 'data.employees',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.group',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n groupId: 'comp-456',\n traits: { name: 'Acme', industry: 'tech', employees: 50 },\n timestamp: new Date(1700000104),\n },\n ],\n ],\n};\n\n/**\n * Explicit page() call with properties -- the canonical Segment page view.\n * skip: true suppresses track(); settings.page fires analytics.page().\n */\nexport const pageView: SegmentStepExample = {\n title: 'Page view',\n description:\n 'A page view fires Segment analytics.page with category, name, and properties instead of a generic track.',\n in: getEvent('page view', {\n timestamp: 1700000105,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n category: 'docs',\n title: 'Getting Started',\n section: 'tutorials',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n page: {\n map: {\n category: 'data.category',\n name: 'data.title',\n properties: {\n map: {\n section: 'data.section',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.page',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n category: 'docs',\n name: 'Getting Started',\n properties: { section: 'tutorials' },\n timestamp: new Date(1700000105),\n },\n ],\n ],\n};\n\n/**\n * Screen call -- server-only method for mobile app backends.\n */\nexport const screenView: SegmentStepExample = {\n title: 'Screen view',\n description:\n 'A screen view fires Segment analytics.screen with name, category, and properties for mobile app tracking.',\n in: getEvent('screen view', {\n timestamp: 1700000106,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n screen_name: 'Welcome',\n section: 'onboarding',\n build: '1.2.3',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n screen: {\n map: {\n name: 'data.screen_name',\n category: 'data.section',\n properties: {\n map: {\n build: 'data.build',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.screen',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n name: 'Welcome',\n category: 'onboarding',\n properties: { build: '1.2.3' },\n timestamp: new Date(1700000106),\n },\n ],\n ],\n};\n\n/**\n * AnonymousId only -- no userId resolved. Segment accepts anonymousId alone.\n */\nexport const anonymousOnly: SegmentStepExample = {\n title: 'Anonymous only',\n description:\n 'When no userId is resolved Segment accepts a track call keyed solely by anonymousId.',\n in: getEvent('product view', {\n timestamp: 1700000107,\n user: { session: 's3ss10n' },\n }),\n settings: {\n userId: undefined,\n },\n out: [\n [\n 'analytics.track',\n {\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000107),\n },\n ],\n ],\n};\n\n/**\n * Consent context forwarding -- settings.consent maps walkerOS consent\n * keys to Segment categoryPreferences on the context object.\n */\nexport const consentForwarding: SegmentStepExample = {\n title: 'Consent forwarding',\n description:\n 'Walker consent keys are mapped to Segment categoryPreferences on the analytics context for downstream filtering.',\n in: getEvent('product view', {\n timestamp: 1700000108,\n user: { id: 'us3r', session: 's3ss10n' },\n consent: { analytics: true, marketing: true },\n }),\n settings: {\n consent: {\n analytics: 'Analytics',\n marketing: 'Advertising',\n },\n },\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000108),\n context: {\n consent: {\n categoryPreferences: {\n Analytics: true,\n Advertising: true,\n },\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 SDK calls.\n */\nexport const wildcardIgnored: SegmentStepExample = {\n public: false,\n in: getEvent('debug noise', {\n timestamp: 1700000109,\n user: { id: 'us3r', session: 's3ss10n' },\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,UAAU,EACP,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,EACL,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,EACV,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,EACH,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,EAAE,OAAO,EAAE,SAAS,kCAAkC,EAAE,SAAS;AAAA,EACvE,SAAS,EACN,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,yDAAyD,EAClE,SAAS;AAAA,EACZ,eAAe,EACZ,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,qDAAqD,EAC9D,SAAS;AAAA,EACZ,YAAY,EACT,OAAO,EACP,IAAI,EACJ,IAAI,CAAC,EACL,SAAS,gDAAgD,EACzD,SAAS;AAAA,EACZ,oBAAoB,EACjB,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,uDAAuD,EAChE,SAAS;AAAA,EACZ,SAAS,EACN,QAAQ,EACR,SAAS,gEAAgE,EACzE,SAAS;AAAA,EACZ,UAAU,EACP,QAAQ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AA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,IACvC,SAAS,EAAE,WAAW,MAAM,WAAW,KAAK;AAAA,EAC9C,CAAC;AAAA,EACD,UAAU;AAAA,IACR,SAAS;AAAA,MACP,WAAW;AAAA,MACX,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,QAAQ;AAAA,QACR,aAAa;AAAA,QACb,OAAO;AAAA,QACP,YAAY,CAAC;AAAA,QACb,WAAW,oBAAI,KAAK,UAAU;AAAA,QAC9B,SAAS;AAAA,UACP,SAAS;AAAA,YACP,qBAAqB;AAAA,cACnB,WAAW;AAAA,cACX,aAAa;AAAA,YACf;AAAA,UACF;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,SAAS,UAAU;AAAA,EACzC,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["z"]}
@@ -71,6 +71,8 @@ __export(step_exports, {
71
71
  });
72
72
  var import_core = require("@walkeros/core");
73
73
  var defaultTrack = {
74
+ title: "Default track",
75
+ description: "A walker event becomes a Segment analytics.track call with userId and anonymousId resolved from the event.",
74
76
  in: (0, import_core.getEvent)("product view", {
75
77
  timestamp: 1700000100,
76
78
  user: { id: "us3r", session: "s3ss10n" }
@@ -89,6 +91,8 @@ var defaultTrack = {
89
91
  ]
90
92
  };
91
93
  var mappedEventName = {
94
+ title: "Renamed event",
95
+ description: "A mapping renames the event so the Segment track call uses Segment's canonical 'Order Completed' name.",
92
96
  in: (0, import_core.getEvent)("order complete", {
93
97
  timestamp: 1700000101,
94
98
  user: { id: "us3r", session: "s3ss10n" }
@@ -110,6 +114,8 @@ var mappedEventName = {
110
114
  ]
111
115
  };
112
116
  var destinationIdentify = {
117
+ title: "Destination identify",
118
+ description: "Destination-level identify fires Segment analytics.identify with traits on the first push only, then the track call follows.",
113
119
  in: (0, import_core.getEvent)("page view", {
114
120
  timestamp: 1700000102,
115
121
  user: { id: "us3r", session: "s3ss10n", email: "user@example.com" }
@@ -148,6 +154,8 @@ var destinationIdentify = {
148
154
  ]
149
155
  };
150
156
  var userLoginIdentify = {
157
+ title: "User login identify",
158
+ description: "A user login fires only Segment analytics.identify with the userId and traits, skipping the track.",
151
159
  in: (0, import_core.getEvent)("user login", {
152
160
  timestamp: 1700000103,
153
161
  user: { id: "us3r", session: "s3ss10n" },
@@ -188,6 +196,8 @@ var userLoginIdentify = {
188
196
  ]
189
197
  };
190
198
  var companyGroup = {
199
+ title: "Group company",
200
+ description: "A company update fires Segment analytics.group with groupId and group traits for account-level tracking.",
191
201
  in: (0, import_core.getEvent)("company update", {
192
202
  timestamp: 1700000104,
193
203
  user: { id: "us3r", session: "s3ss10n" },
@@ -229,6 +239,8 @@ var companyGroup = {
229
239
  ]
230
240
  };
231
241
  var pageView = {
242
+ title: "Page view",
243
+ description: "A page view fires Segment analytics.page with category, name, and properties instead of a generic track.",
232
244
  in: (0, import_core.getEvent)("page view", {
233
245
  timestamp: 1700000105,
234
246
  user: { id: "us3r", session: "s3ss10n" },
@@ -269,6 +281,8 @@ var pageView = {
269
281
  ]
270
282
  };
271
283
  var screenView = {
284
+ title: "Screen view",
285
+ description: "A screen view fires Segment analytics.screen with name, category, and properties for mobile app tracking.",
272
286
  in: (0, import_core.getEvent)("screen view", {
273
287
  timestamp: 1700000106,
274
288
  user: { id: "us3r", session: "s3ss10n" },
@@ -309,6 +323,8 @@ var screenView = {
309
323
  ]
310
324
  };
311
325
  var anonymousOnly = {
326
+ title: "Anonymous only",
327
+ description: "When no userId is resolved Segment accepts a track call keyed solely by anonymousId.",
312
328
  in: (0, import_core.getEvent)("product view", {
313
329
  timestamp: 1700000107,
314
330
  user: { session: "s3ss10n" }
@@ -329,6 +345,8 @@ var anonymousOnly = {
329
345
  ]
330
346
  };
331
347
  var consentForwarding = {
348
+ title: "Consent forwarding",
349
+ description: "Walker consent keys are mapped to Segment categoryPreferences on the analytics context for downstream filtering.",
332
350
  in: (0, import_core.getEvent)("product view", {
333
351
  timestamp: 1700000108,
334
352
  user: { id: "us3r", session: "s3ss10n" },
@@ -362,6 +380,7 @@ var consentForwarding = {
362
380
  ]
363
381
  };
364
382
  var wildcardIgnored = {
383
+ public: false,
365
384
  in: (0, import_core.getEvent)("debug noise", {
366
385
  timestamp: 1700000109,
367
386
  user: { id: "us3r", session: "s3ss10n" }
@@ -50,6 +50,8 @@ __export(step_exports, {
50
50
  });
51
51
  import { getEvent } from "@walkeros/core";
52
52
  var defaultTrack = {
53
+ title: "Default track",
54
+ description: "A walker event becomes a Segment analytics.track call with userId and anonymousId resolved from the event.",
53
55
  in: getEvent("product view", {
54
56
  timestamp: 1700000100,
55
57
  user: { id: "us3r", session: "s3ss10n" }
@@ -68,6 +70,8 @@ var defaultTrack = {
68
70
  ]
69
71
  };
70
72
  var mappedEventName = {
73
+ title: "Renamed event",
74
+ description: "A mapping renames the event so the Segment track call uses Segment's canonical 'Order Completed' name.",
71
75
  in: getEvent("order complete", {
72
76
  timestamp: 1700000101,
73
77
  user: { id: "us3r", session: "s3ss10n" }
@@ -89,6 +93,8 @@ var mappedEventName = {
89
93
  ]
90
94
  };
91
95
  var destinationIdentify = {
96
+ title: "Destination identify",
97
+ description: "Destination-level identify fires Segment analytics.identify with traits on the first push only, then the track call follows.",
92
98
  in: getEvent("page view", {
93
99
  timestamp: 1700000102,
94
100
  user: { id: "us3r", session: "s3ss10n", email: "user@example.com" }
@@ -127,6 +133,8 @@ var destinationIdentify = {
127
133
  ]
128
134
  };
129
135
  var userLoginIdentify = {
136
+ title: "User login identify",
137
+ description: "A user login fires only Segment analytics.identify with the userId and traits, skipping the track.",
130
138
  in: getEvent("user login", {
131
139
  timestamp: 1700000103,
132
140
  user: { id: "us3r", session: "s3ss10n" },
@@ -167,6 +175,8 @@ var userLoginIdentify = {
167
175
  ]
168
176
  };
169
177
  var companyGroup = {
178
+ title: "Group company",
179
+ description: "A company update fires Segment analytics.group with groupId and group traits for account-level tracking.",
170
180
  in: getEvent("company update", {
171
181
  timestamp: 1700000104,
172
182
  user: { id: "us3r", session: "s3ss10n" },
@@ -208,6 +218,8 @@ var companyGroup = {
208
218
  ]
209
219
  };
210
220
  var pageView = {
221
+ title: "Page view",
222
+ description: "A page view fires Segment analytics.page with category, name, and properties instead of a generic track.",
211
223
  in: getEvent("page view", {
212
224
  timestamp: 1700000105,
213
225
  user: { id: "us3r", session: "s3ss10n" },
@@ -248,6 +260,8 @@ var pageView = {
248
260
  ]
249
261
  };
250
262
  var screenView = {
263
+ title: "Screen view",
264
+ description: "A screen view fires Segment analytics.screen with name, category, and properties for mobile app tracking.",
251
265
  in: getEvent("screen view", {
252
266
  timestamp: 1700000106,
253
267
  user: { id: "us3r", session: "s3ss10n" },
@@ -288,6 +302,8 @@ var screenView = {
288
302
  ]
289
303
  };
290
304
  var anonymousOnly = {
305
+ title: "Anonymous only",
306
+ description: "When no userId is resolved Segment accepts a track call keyed solely by anonymousId.",
291
307
  in: getEvent("product view", {
292
308
  timestamp: 1700000107,
293
309
  user: { session: "s3ss10n" }
@@ -308,6 +324,8 @@ var anonymousOnly = {
308
324
  ]
309
325
  };
310
326
  var consentForwarding = {
327
+ title: "Consent forwarding",
328
+ description: "Walker consent keys are mapped to Segment categoryPreferences on the analytics context for downstream filtering.",
311
329
  in: getEvent("product view", {
312
330
  timestamp: 1700000108,
313
331
  user: { id: "us3r", session: "s3ss10n" },
@@ -341,6 +359,7 @@ var consentForwarding = {
341
359
  ]
342
360
  };
343
361
  var wildcardIgnored = {
362
+ public: false,
344
363
  in: getEvent("debug noise", {
345
364
  timestamp: 1700000109,
346
365
  user: { id: "us3r", session: "s3ss10n" }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$meta": {
3
3
  "package": "@walkeros/server-destination-segment",
4
- "version": "3.4.0",
4
+ "version": "3.4.1-next-1776790594143",
5
5
  "type": "destination",
6
6
  "platform": [
7
7
  "server"
@@ -148,6 +148,8 @@
148
148
  },
149
149
  "step": {
150
150
  "anonymousOnly": {
151
+ "title": "Anonymous only",
152
+ "description": "When no userId is resolved Segment accepts a track call keyed solely by anonymousId.",
151
153
  "in": {
152
154
  "name": "product view",
153
155
  "data": {
@@ -185,7 +187,7 @@
185
187
  "group": "gr0up",
186
188
  "count": 1,
187
189
  "version": {
188
- "source": "3.4.0",
190
+ "source": "3.4.1-next-1776790594143",
189
191
  "tagging": 1
190
192
  },
191
193
  "source": {
@@ -208,6 +210,8 @@
208
210
  ]
209
211
  },
210
212
  "companyGroup": {
213
+ "title": "Group company",
214
+ "description": "A company update fires Segment analytics.group with groupId and group traits for account-level tracking.",
211
215
  "in": {
212
216
  "name": "company update",
213
217
  "data": {
@@ -259,7 +263,7 @@
259
263
  "group": "gr0up",
260
264
  "count": 1,
261
265
  "version": {
262
- "source": "3.4.0",
266
+ "source": "3.4.1-next-1776790594143",
263
267
  "tagging": 1
264
268
  },
265
269
  "source": {
@@ -303,6 +307,8 @@
303
307
  ]
304
308
  },
305
309
  "consentForwarding": {
310
+ "title": "Consent forwarding",
311
+ "description": "Walker consent keys are mapped to Segment categoryPreferences on the analytics context for downstream filtering.",
306
312
  "in": {
307
313
  "name": "product view",
308
314
  "data": {
@@ -342,7 +348,7 @@
342
348
  "group": "gr0up",
343
349
  "count": 1,
344
350
  "version": {
345
- "source": "3.4.0",
351
+ "source": "3.4.1-next-1776790594143",
346
352
  "tagging": 1
347
353
  },
348
354
  "source": {
@@ -379,6 +385,8 @@
379
385
  ]
380
386
  },
381
387
  "defaultTrack": {
388
+ "title": "Default track",
389
+ "description": "A walker event becomes a Segment analytics.track call with userId and anonymousId resolved from the event.",
382
390
  "in": {
383
391
  "name": "product view",
384
392
  "data": {
@@ -417,7 +425,7 @@
417
425
  "group": "gr0up",
418
426
  "count": 1,
419
427
  "version": {
420
- "source": "3.4.0",
428
+ "source": "3.4.1-next-1776790594143",
421
429
  "tagging": 1
422
430
  },
423
431
  "source": {
@@ -440,6 +448,8 @@
440
448
  ]
441
449
  },
442
450
  "destinationIdentify": {
451
+ "title": "Destination identify",
452
+ "description": "Destination-level identify fires Segment analytics.identify with traits on the first push only, then the track call follows.",
443
453
  "in": {
444
454
  "name": "page view",
445
455
  "data": {
@@ -494,7 +504,7 @@
494
504
  "group": "gr0up",
495
505
  "count": 1,
496
506
  "version": {
497
- "source": "3.4.0",
507
+ "source": "3.4.1-next-1776790594143",
498
508
  "tagging": 1
499
509
  },
500
510
  "source": {
@@ -539,6 +549,8 @@
539
549
  ]
540
550
  },
541
551
  "mappedEventName": {
552
+ "title": "Renamed event",
553
+ "description": "A mapping renames the event so the Segment track call uses Segment's canonical 'Order Completed' name.",
542
554
  "in": {
543
555
  "name": "order complete",
544
556
  "data": {
@@ -624,7 +636,7 @@
624
636
  "group": "gr0up",
625
637
  "count": 1,
626
638
  "version": {
627
- "source": "3.4.0",
639
+ "source": "3.4.1-next-1776790594143",
628
640
  "tagging": 1
629
641
  },
630
642
  "source": {
@@ -650,6 +662,8 @@
650
662
  ]
651
663
  },
652
664
  "pageView": {
665
+ "title": "Page view",
666
+ "description": "A page view fires Segment analytics.page with category, name, and properties instead of a generic track.",
653
667
  "in": {
654
668
  "name": "page view",
655
669
  "data": {
@@ -700,7 +714,7 @@
700
714
  "group": "gr0up",
701
715
  "count": 1,
702
716
  "version": {
703
- "source": "3.4.0",
717
+ "source": "3.4.1-next-1776790594143",
704
718
  "tagging": 1
705
719
  },
706
720
  "source": {
@@ -742,6 +756,8 @@
742
756
  ]
743
757
  },
744
758
  "screenView": {
759
+ "title": "Screen view",
760
+ "description": "A screen view fires Segment analytics.screen with name, category, and properties for mobile app tracking.",
745
761
  "in": {
746
762
  "name": "screen view",
747
763
  "data": {
@@ -792,7 +808,7 @@
792
808
  "group": "gr0up",
793
809
  "count": 1,
794
810
  "version": {
795
- "source": "3.4.0",
811
+ "source": "3.4.1-next-1776790594143",
796
812
  "tagging": 1
797
813
  },
798
814
  "source": {
@@ -834,6 +850,8 @@
834
850
  ]
835
851
  },
836
852
  "userLoginIdentify": {
853
+ "title": "User login identify",
854
+ "description": "A user login fires only Segment analytics.identify with the userId and traits, skipping the track.",
837
855
  "in": {
838
856
  "name": "user login",
839
857
  "data": {
@@ -885,7 +903,7 @@
885
903
  "group": "gr0up",
886
904
  "count": 1,
887
905
  "version": {
888
- "source": "3.4.0",
906
+ "source": "3.4.1-next-1776790594143",
889
907
  "tagging": 1
890
908
  },
891
909
  "source": {
@@ -928,6 +946,7 @@
928
946
  ]
929
947
  },
930
948
  "wildcardIgnored": {
949
+ "public": false,
931
950
  "in": {
932
951
  "name": "debug noise",
933
952
  "data": {
@@ -983,7 +1002,7 @@
983
1002
  "group": "gr0up",
984
1003
  "count": 1,
985
1004
  "version": {
986
- "source": "3.4.0",
1005
+ "source": "3.4.1-next-1776790594143",
987
1006
  "tagging": 1
988
1007
  },
989
1008
  "source": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@walkeros/server-destination-segment",
3
3
  "description": "Segment CDP server destination for walkerOS (@segment/analytics-node, full Segment Spec)",
4
- "version": "3.4.0",
4
+ "version": "3.4.1-next-1776790594143",
5
5
  "license": "MIT",
6
6
  "exports": {
7
7
  ".": {
@@ -35,11 +35,11 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@segment/analytics-node": "^3.0.0",
38
- "@walkeros/core": "3.4.0",
39
- "@walkeros/server-core": "3.4.0"
38
+ "@walkeros/core": "3.4.1-next-1776790594143",
39
+ "@walkeros/server-core": "3.4.1-next-1776790594143"
40
40
  },
41
41
  "devDependencies": {
42
- "@walkeros/collector": "3.4.0"
42
+ "@walkeros/collector": "3.4.1-next-1776790594143"
43
43
  },
44
44
  "repository": {
45
45
  "url": "git+https://github.com/elbwalker/walkerOS.git",