@walkeros/server-destination-rudderstack 3.4.0 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dev.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e,s=Object.defineProperty,t=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,i=(e,t)=>{for(var a in t)s(e,a,{get:t[a],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 u of a(i))n.call(e,u)||u===r||s(e,u,{get:()=>i[u],enumerable:!(o=t(i,u))||o.enumerable});return e})(s({},"__esModule",{value:!0}),e));var o={};i(o,{MappingSchema:()=>d,SettingsSchema:()=>l,mapping:()=>g,settings:()=>c});var u=require("@walkeros/core/dev"),p=require("@walkeros/core/dev"),l=p.z.object({writeKey:p.z.string().min(1).describe("RudderStack source write key. Find it in the RudderStack dashboard under Sources > Setup."),dataPlaneUrl:p.z.string().url().describe("RudderStack data plane URL. Required. Example: https://your-data-plane.rudderstack.com"),userId:p.z.string().describe("walkerOS mapping value path to resolve userId from each event (like user.id).").optional(),anonymousId:p.z.string().describe("walkerOS mapping value path to resolve anonymousId from each event (like user.session).").optional(),path:p.z.string().describe("API path route (like /v1/batch).").optional(),flushAt:p.z.number().int().positive().describe("Events to enqueue before flushing a batch. Default: 20.").optional(),flushInterval:p.z.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxQueueSize:p.z.number().int().positive().describe("Maximum batch payload size in bytes. Default: 460800 (~500KB).").optional(),maxInternalQueueSize:p.z.number().int().positive().describe("Maximum in-memory queue length. Default: 20000.").optional(),logLevel:p.z.string().describe("SDK log level: 'info', 'debug', 'error', or 'silly'. Default: 'info'.").optional(),retryCount:p.z.number().int().min(0).describe("Retry attempts for failed batches. Default: 3.").optional(),enable:p.z.boolean().describe("Set to false to no-op all SDK calls. Default: true.").optional(),gzip:p.z.boolean().describe("Enable gzip compression for requests. Default: true.").optional(),identify:p.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:p.z.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.").optional(),integrations:p.z.record(p.z.string(),p.z.unknown()).describe('Enable/disable downstream RudderStack 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 { name, properties? } or true for minimal page(). RudderStack requires name (falls back to empty string). Use with skip: true.").optional(),screen:m.z.unknown().describe("Per-event screen call (mobile backends). Resolves to { name, properties? } or true for minimal screen(). RudderStack requires name (falls back to empty string). Use with skip: true.").optional(),alias:m.z.unknown().describe("Per-event alias call. Resolves to { previousId }. Links anonymous user to identified user. Use with rule-level skip: true.").optional()}),c=(0,u.zodToSchema)(l),g=(0,u.zodToSchema)(d),y={};i(y,{env:()=>v,step:()=>k});var v={};i(v,{push:()=>f,simulation:()=>w});var b=()=>{};var f={analytics:{track:b,identify:b,group:b,page:b,screen:b,alias:b,flush:()=>Promise.resolve()}},w=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen","call:analytics.alias"],k={};i(k,{aliasUser:()=>O,anonymousOnly:()=>P,companyGroup:()=>E,defaultTrack:()=>I,destinationIdentify:()=>D,mappedEventName:()=>z,pageView:()=>R,screenView:()=>x,userLoginIdentify:()=>S,wildcardIgnored:()=>_});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)}]]},R={in:(0,h.getEvent)("page view",{timestamp:1700000105,user:{id:"us3r",session:"s3ss10n"},data:{title:"Getting Started",section:"tutorials"}}),mapping:{skip:!0,settings:{page:{map:{name:"data.title",properties:{map:{section:"data.section"}}}}}},out:[["analytics.page",{userId:"us3r",anonymousId:"s3ss10n",name:"Getting Started",properties:{section:"tutorials"},timestamp:new Date(1700000105)}]]},x={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",properties:{map:{build:"data.build"}}}}}},out:[["analytics.screen",{userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",properties:{build:"1.2.3"},timestamp:new Date(1700000106)}]]},O={in:(0,h.getEvent)("identity merge",{timestamp:1700000107,user:{id:"registered-456",session:"s3ss10n"},data:{anonymous_id:"anonymous-123"}}),mapping:{skip:!0,settings:{alias:{map:{previousId:"data.anonymous_id"}}}},out:[["analytics.alias",{userId:"registered-456",previousId:"anonymous-123",timestamp:new Date(1700000107)}]]},P={in:(0,h.getEvent)("product view",{timestamp:1700000108,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:[["analytics.track",{anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108)}]]},_={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,a=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,n=(e,s)=>{for(var a in s)t(e,a,{get:s[a],enumerable:!0})},r={};n(r,{examples:()=>g,schemas:()=>o}),module.exports=(e=r,((e,n,r,o)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let l of a(n))i.call(e,l)||l===r||t(e,l,{get:()=>n[l],enumerable:!(o=s(n,l))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o={};n(o,{MappingSchema:()=>m,SettingsSchema:()=>u,mapping:()=>y,settings:()=>c});var l=require("@walkeros/core/dev"),p=require("@walkeros/core/dev"),u=p.z.object({writeKey:p.z.string().min(1).describe("RudderStack source write key. Find it in the RudderStack dashboard under Sources > Setup."),dataPlaneUrl:p.z.string().url().describe("RudderStack data plane URL. Required. Example: https://your-data-plane.rudderstack.com"),userId:p.z.string().describe("walkerOS mapping value path to resolve userId from each event (like user.id).").optional(),anonymousId:p.z.string().describe("walkerOS mapping value path to resolve anonymousId from each event (like user.session).").optional(),path:p.z.string().describe("API path route (like /v1/batch).").optional(),flushAt:p.z.number().int().positive().describe("Events to enqueue before flushing a batch. Default: 20.").optional(),flushInterval:p.z.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxQueueSize:p.z.number().int().positive().describe("Maximum batch payload size in bytes. Default: 460800 (~500KB).").optional(),maxInternalQueueSize:p.z.number().int().positive().describe("Maximum in-memory queue length. Default: 20000.").optional(),logLevel:p.z.string().describe("SDK log level: 'info', 'debug', 'error', or 'silly'. Default: 'info'.").optional(),retryCount:p.z.number().int().min(0).describe("Retry attempts for failed batches. Default: 3.").optional(),enable:p.z.boolean().describe("Set to false to no-op all SDK calls. Default: true.").optional(),gzip:p.z.boolean().describe("Enable gzip compression for requests. Default: true.").optional(),identify:p.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:p.z.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.").optional(),integrations:p.z.record(p.z.string(),p.z.unknown()).describe('Enable/disable downstream RudderStack destinations. Example: { "All": true, "Mixpanel": false }.').optional()}),d=require("@walkeros/core/dev"),m=d.z.object({identify:d.z.unknown().describe("Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.").optional(),group:d.z.unknown().describe("Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.").optional(),page:d.z.unknown().describe("Per-event page call. Resolves to { name, properties? } or true for minimal page(). RudderStack requires name (falls back to empty string). Use with skip: true.").optional(),screen:d.z.unknown().describe("Per-event screen call (mobile backends). Resolves to { name, properties? } or true for minimal screen(). RudderStack requires name (falls back to empty string). Use with skip: true.").optional(),alias:d.z.unknown().describe("Per-event alias call. Resolves to { previousId }. Links anonymous user to identified user. Use with rule-level skip: true.").optional()}),c=(0,l.zodToSchema)(u),y=(0,l.zodToSchema)(m),g={};n(g,{env:()=>v,step:()=>w});var v={};n(v,{push:()=>b,simulation:()=>k});var f=()=>{};var b={analytics:{track:f,identify:f,group:f,page:f,screen:f,alias:f,flush:()=>Promise.resolve()}},k=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen","call:analytics.alias"],w={};n(w,{aliasUser:()=>O,anonymousOnly:()=>P,companyGroup:()=>R,defaultTrack:()=>I,destinationIdentify:()=>D,mappedEventName:()=>z,pageView:()=>E,screenView:()=>A,userLoginIdentify:()=>S,wildcardIgnored:()=>x});var h=require("@walkeros/core"),I={title:"Default track",description:"A walker event becomes a RudderStack analytics.track call with userId and anonymousId resolved from the event.",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={title:"Renamed event",description:"A mapping renames the event so the RudderStack track call uses a canonical name such as Order Completed.",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={title:"Destination identify",description:"Destination-level identify fires analytics.identify with traits on the first push only, then the track call follows.",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={title:"User login identify",description:"A user login fires only an analytics.identify call with the resolved userId and traits, skipping the track.",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)}]]},R={title:"Group company",description:"A company update fires analytics.group with the groupId and group traits for B2B account tracking.",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)}]]},E={title:"Page view",description:"A page view fires analytics.page with a resolved page name and properties instead of a generic track.",in:(0,h.getEvent)("page view",{timestamp:1700000105,user:{id:"us3r",session:"s3ss10n"},data:{title:"Getting Started",section:"tutorials"}}),mapping:{skip:!0,settings:{page:{map:{name:"data.title",properties:{map:{section:"data.section"}}}}}},out:[["analytics.page",{userId:"us3r",anonymousId:"s3ss10n",name:"Getting Started",properties:{section:"tutorials"},timestamp:new Date(1700000105)}]]},A={title:"Screen view",description:"A screen view from a mobile app backend fires analytics.screen with a screen name and properties.",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",properties:{map:{build:"data.build"}}}}}},out:[["analytics.screen",{userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",properties:{build:"1.2.3"},timestamp:new Date(1700000106)}]]},O={title:"Alias user",description:"An identity merge fires analytics.alias to link a previous anonymous id to the newly registered user id.",in:(0,h.getEvent)("identity merge",{timestamp:1700000107,user:{id:"registered-456",session:"s3ss10n"},data:{anonymous_id:"anonymous-123"}}),mapping:{skip:!0,settings:{alias:{map:{previousId:"data.anonymous_id"}}}},out:[["analytics.alias",{userId:"registered-456",previousId:"anonymous-123",timestamp:new Date(1700000107)}]]},P={title:"Anonymous only",description:"When no userId is resolved RudderStack accepts the track call keyed solely by anonymousId.",in:(0,h.getEvent)("product view",{timestamp:1700000108,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:[["analytics.track",{anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108)}]]},x={public:!1,in:(0,h.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 'RudderStack source write key. Find it in the RudderStack dashboard under Sources > Setup.',\n ),\n dataPlaneUrl: z\n .string()\n .url()\n .describe(\n 'RudderStack data plane URL. Required. Example: https://your-data-plane.rudderstack.com',\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 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: 20.')\n .optional(),\n flushInterval: z\n .number()\n .int()\n .positive()\n .describe('Max milliseconds before auto-flush. Default: 10000.')\n .optional(),\n maxQueueSize: z\n .number()\n .int()\n .positive()\n .describe('Maximum batch payload size in bytes. Default: 460800 (~500KB).')\n .optional(),\n maxInternalQueueSize: z\n .number()\n .int()\n .positive()\n .describe('Maximum in-memory queue length. Default: 20000.')\n .optional(),\n logLevel: z\n .string()\n .describe(\n \"SDK log level: 'info', 'debug', 'error', or 'silly'. Default: 'info'.\",\n )\n .optional(),\n retryCount: z\n .number()\n .int()\n .min(0)\n .describe('Retry attempts for failed batches. Default: 3.')\n .optional(),\n enable: z\n .boolean()\n .describe('Set to false to no-op all SDK calls. Default: true.')\n .optional(),\n gzip: z\n .boolean()\n .describe('Enable gzip compression for requests. Default: true.')\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 integrations: z\n .record(z.string(), z.unknown())\n .describe(\n 'Enable/disable downstream RudderStack 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 { name, properties? } or true for minimal page(). RudderStack requires name (falls back to empty string). Use with skip: true.',\n )\n .optional(),\n screen: z\n .unknown()\n .describe(\n 'Per-event screen call (mobile backends). Resolves to { name, properties? } or true for minimal screen(). RudderStack requires name (falls back to empty string). Use with skip: true.',\n )\n .optional(),\n alias: z\n .unknown()\n .describe(\n 'Per-event alias call. Resolves to { previousId }. Links anonymous user to identified user. Use with rule-level 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, RudderStackAnalyticsMock } from '../types';\n\ntype SdkCall = (_params: Record<string, unknown>) => void;\ntype SdkFlush = (\n _callback?: (err?: Error, data?: unknown) => void,\n) => Promise<void>;\n\nconst noop: SdkCall = () => {};\nconst asyncNoop: SdkFlush = () => Promise.resolve();\n\nfunction createMockAnalytics(): RudderStackAnalyticsMock {\n return {\n track: noop,\n identify: noop,\n group: noop,\n page: noop,\n screen: noop,\n alias: noop,\n flush: 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 'call:analytics.alias',\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 RudderStackStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * RudderStack server destination invokes the injected `env.analytics` SDK\n * methods (`track`, `identify`, `group`, `page`, `screen`, `alias`) — not a\n * raw HTTP endpoint. Each `out` entry is therefore\n * `[callable, params]` where `callable` is the dotted method name\n * (e.g. `'analytics.track'`) and `params` is the object 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: RudderStackStepExample = {\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 RudderStack.\n */\nexport const mappedEventName: RudderStackStepExample = {\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: RudderStackStepExample = {\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: RudderStackStepExample = {\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: RudderStackStepExample = {\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. RudderStack requires name -- resolved\n * from mapping. skip: true suppresses track().\n */\nexport const pageView: RudderStackStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000105,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n title: 'Getting Started',\n section: 'tutorials',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n page: {\n map: {\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 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 * RudderStack requires name -- resolved from mapping.\n */\nexport const screenView: RudderStackStepExample = {\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 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 properties: { build: '1.2.3' },\n timestamp: new Date(1700000106),\n },\n ],\n ],\n};\n\n/**\n * Alias call -- links anonymous user identity to registered user.\n * skip: true suppresses track(). Requires previousId from mapping.\n */\nexport const aliasUser: RudderStackStepExample = {\n in: getEvent('identity merge', {\n timestamp: 1700000107,\n user: { id: 'registered-456', session: 's3ss10n' },\n data: {\n anonymous_id: 'anonymous-123',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n alias: {\n map: {\n previousId: 'data.anonymous_id',\n },\n },\n },\n },\n out: [\n [\n 'analytics.alias',\n {\n userId: 'registered-456',\n previousId: 'anonymous-123',\n timestamp: new Date(1700000107),\n },\n ],\n ],\n};\n\n/**\n * AnonymousId only -- no userId resolved. RudderStack accepts anonymousId alone.\n */\nexport const anonymousOnly: RudderStackStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000108,\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(1700000108),\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: RudderStackStepExample = {\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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ACD,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 'RudderStack source write key. Find it in the RudderStack dashboard under Sources > Setup.',\n ),\n dataPlaneUrl: z\n .string()\n .url()\n .describe(\n 'RudderStack data plane URL. Required. Example: https://your-data-plane.rudderstack.com',\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 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: 20.')\n .optional(),\n flushInterval: z\n .number()\n .int()\n .positive()\n .describe('Max milliseconds before auto-flush. Default: 10000.')\n .optional(),\n maxQueueSize: z\n .number()\n .int()\n .positive()\n .describe('Maximum batch payload size in bytes. Default: 460800 (~500KB).')\n .optional(),\n maxInternalQueueSize: z\n .number()\n .int()\n .positive()\n .describe('Maximum in-memory queue length. Default: 20000.')\n .optional(),\n logLevel: z\n .string()\n .describe(\n \"SDK log level: 'info', 'debug', 'error', or 'silly'. Default: 'info'.\",\n )\n .optional(),\n retryCount: z\n .number()\n .int()\n .min(0)\n .describe('Retry attempts for failed batches. Default: 3.')\n .optional(),\n enable: z\n .boolean()\n .describe('Set to false to no-op all SDK calls. Default: true.')\n .optional(),\n gzip: z\n .boolean()\n .describe('Enable gzip compression for requests. Default: true.')\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 integrations: z\n .record(z.string(), z.unknown())\n .describe(\n 'Enable/disable downstream RudderStack 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 { name, properties? } or true for minimal page(). RudderStack requires name (falls back to empty string). Use with skip: true.',\n )\n .optional(),\n screen: z\n .unknown()\n .describe(\n 'Per-event screen call (mobile backends). Resolves to { name, properties? } or true for minimal screen(). RudderStack requires name (falls back to empty string). Use with skip: true.',\n )\n .optional(),\n alias: z\n .unknown()\n .describe(\n 'Per-event alias call. Resolves to { previousId }. Links anonymous user to identified user. Use with rule-level 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, RudderStackAnalyticsMock } from '../types';\n\ntype SdkCall = (_params: Record<string, unknown>) => void;\ntype SdkFlush = (\n _callback?: (err?: Error, data?: unknown) => void,\n) => Promise<void>;\n\nconst noop: SdkCall = () => {};\nconst asyncNoop: SdkFlush = () => Promise.resolve();\n\nfunction createMockAnalytics(): RudderStackAnalyticsMock {\n return {\n track: noop,\n identify: noop,\n group: noop,\n page: noop,\n screen: noop,\n alias: noop,\n flush: 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 'call:analytics.alias',\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 RudderStackStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * RudderStack server destination invokes the injected `env.analytics` SDK\n * methods (`track`, `identify`, `group`, `page`, `screen`, `alias`) — not a\n * raw HTTP endpoint. Each `out` entry is therefore\n * `[callable, params]` where `callable` is the dotted method name\n * (e.g. `'analytics.track'`) and `params` is the object 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: RudderStackStepExample = {\n title: 'Default track',\n description:\n 'A walker event becomes a RudderStack 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 RudderStack.\n */\nexport const mappedEventName: RudderStackStepExample = {\n title: 'Renamed event',\n description:\n 'A mapping renames the event so the RudderStack track call uses a canonical name such as Order Completed.',\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: RudderStackStepExample = {\n title: 'Destination identify',\n description:\n 'Destination-level identify fires 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: RudderStackStepExample = {\n title: 'User login identify',\n description:\n 'A user login fires only an analytics.identify call with the resolved 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: RudderStackStepExample = {\n title: 'Group company',\n description:\n 'A company update fires analytics.group with the groupId and group traits for B2B account 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. RudderStack requires name -- resolved\n * from mapping. skip: true suppresses track().\n */\nexport const pageView: RudderStackStepExample = {\n title: 'Page view',\n description:\n 'A page view fires analytics.page with a resolved page 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 title: 'Getting Started',\n section: 'tutorials',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n page: {\n map: {\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 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 * RudderStack requires name -- resolved from mapping.\n */\nexport const screenView: RudderStackStepExample = {\n title: 'Screen view',\n description:\n 'A screen view from a mobile app backend fires analytics.screen with a screen name and properties.',\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 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 properties: { build: '1.2.3' },\n timestamp: new Date(1700000106),\n },\n ],\n ],\n};\n\n/**\n * Alias call -- links anonymous user identity to registered user.\n * skip: true suppresses track(). Requires previousId from mapping.\n */\nexport const aliasUser: RudderStackStepExample = {\n title: 'Alias user',\n description:\n 'An identity merge fires analytics.alias to link a previous anonymous id to the newly registered user id.',\n in: getEvent('identity merge', {\n timestamp: 1700000107,\n user: { id: 'registered-456', session: 's3ss10n' },\n data: {\n anonymous_id: 'anonymous-123',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n alias: {\n map: {\n previousId: 'data.anonymous_id',\n },\n },\n },\n },\n out: [\n [\n 'analytics.alias',\n {\n userId: 'registered-456',\n previousId: 'anonymous-123',\n timestamp: new Date(1700000107),\n },\n ],\n ],\n};\n\n/**\n * AnonymousId only -- no userId resolved. RudderStack accepts anonymousId alone.\n */\nexport const anonymousOnly: RudderStackStepExample = {\n title: 'Anonymous only',\n description:\n 'When no userId is resolved RudderStack accepts the track call keyed solely by anonymousId.',\n in: getEvent('product view', {\n timestamp: 1700000108,\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(1700000108),\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: RudderStackStepExample = {\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;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AAAA,EACV;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,QACP,YAAY,CAAC;AAAA,QACb,WAAW,oBAAI,KAAK,UAAU;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,kBAA0C;AAAA,EACrD,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,a)=>{for(var t in a)e(s,t,{get:a[t],enumerable:!0})},a={};s(a,{MappingSchema:()=>o,SettingsSchema:()=>n,mapping:()=>u,settings:()=>p});import{zodToSchema as t}from"@walkeros/core/dev";import{z as i}from"@walkeros/core/dev";var n=i.object({writeKey:i.string().min(1).describe("RudderStack source write key. Find it in the RudderStack dashboard under Sources > Setup."),dataPlaneUrl:i.string().url().describe("RudderStack data plane URL. Required. Example: https://your-data-plane.rudderstack.com"),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(),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: 20.").optional(),flushInterval:i.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxQueueSize:i.number().int().positive().describe("Maximum batch payload size in bytes. Default: 460800 (~500KB).").optional(),maxInternalQueueSize:i.number().int().positive().describe("Maximum in-memory queue length. Default: 20000.").optional(),logLevel:i.string().describe("SDK log level: 'info', 'debug', 'error', or 'silly'. Default: 'info'.").optional(),retryCount:i.number().int().min(0).describe("Retry attempts for failed batches. Default: 3.").optional(),enable:i.boolean().describe("Set to false to no-op all SDK calls. Default: true.").optional(),gzip:i.boolean().describe("Enable gzip compression for requests. Default: true.").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(),integrations:i.record(i.string(),i.unknown()).describe('Enable/disable downstream RudderStack 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 { name, properties? } or true for minimal page(). RudderStack requires name (falls back to empty string). Use with skip: true.").optional(),screen:r.unknown().describe("Per-event screen call (mobile backends). Resolves to { name, properties? } or true for minimal screen(). RudderStack requires name (falls back to empty string). Use with skip: true.").optional(),alias:r.unknown().describe("Per-event alias call. Resolves to { previousId }. Links anonymous user to identified user. Use with rule-level skip: true.").optional()}),p=t(n),u=t(o),l={};s(l,{env:()=>m,step:()=>y});var m={};s(m,{push:()=>c,simulation:()=>g});var d=()=>{};var c={analytics:{track:d,identify:d,group:d,page:d,screen:d,alias:d,flush:()=>Promise.resolve()}},g=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen","call:analytics.alias"],y={};s(y,{aliasUser:()=>S,anonymousOnly:()=>R,companyGroup:()=>I,defaultTrack:()=>b,destinationIdentify:()=>k,mappedEventName:()=>f,pageView:()=>h,screenView:()=>D,userLoginIdentify:()=>w,wildcardIgnored:()=>x});import{getEvent as v}from"@walkeros/core";var b={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)}]]},k={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)}]]},w={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:{title:"Getting Started",section:"tutorials"}}),mapping:{skip:!0,settings:{page:{map:{name:"data.title",properties:{map:{section:"data.section"}}}}}},out:[["analytics.page",{userId:"us3r",anonymousId:"s3ss10n",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",properties:{map:{build:"data.build"}}}}}},out:[["analytics.screen",{userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",properties:{build:"1.2.3"},timestamp:new Date(1700000106)}]]},S={in:v("identity merge",{timestamp:1700000107,user:{id:"registered-456",session:"s3ss10n"},data:{anonymous_id:"anonymous-123"}}),mapping:{skip:!0,settings:{alias:{map:{previousId:"data.anonymous_id"}}}},out:[["analytics.alias",{userId:"registered-456",previousId:"anonymous-123",timestamp:new Date(1700000107)}]]},R={in:v("product view",{timestamp:1700000108,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:[["analytics.track",{anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108)}]]},x={in:v("debug noise",{timestamp:1700000109,user:{id:"us3r",session:"s3ss10n"}}),mapping:{ignore:!0},out:[]};export{l as examples,a as schemas};//# sourceMappingURL=dev.mjs.map
1
+ var e=Object.defineProperty,s=(s,t)=>{for(var a in t)e(s,a,{get:t[a],enumerable:!0})},t={};s(t,{MappingSchema:()=>o,SettingsSchema:()=>n,mapping:()=>p,settings:()=>l});import{zodToSchema as a}from"@walkeros/core/dev";import{z as i}from"@walkeros/core/dev";var n=i.object({writeKey:i.string().min(1).describe("RudderStack source write key. Find it in the RudderStack dashboard under Sources > Setup."),dataPlaneUrl:i.string().url().describe("RudderStack data plane URL. Required. Example: https://your-data-plane.rudderstack.com"),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(),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: 20.").optional(),flushInterval:i.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxQueueSize:i.number().int().positive().describe("Maximum batch payload size in bytes. Default: 460800 (~500KB).").optional(),maxInternalQueueSize:i.number().int().positive().describe("Maximum in-memory queue length. Default: 20000.").optional(),logLevel:i.string().describe("SDK log level: 'info', 'debug', 'error', or 'silly'. Default: 'info'.").optional(),retryCount:i.number().int().min(0).describe("Retry attempts for failed batches. Default: 3.").optional(),enable:i.boolean().describe("Set to false to no-op all SDK calls. Default: true.").optional(),gzip:i.boolean().describe("Enable gzip compression for requests. Default: true.").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(),integrations:i.record(i.string(),i.unknown()).describe('Enable/disable downstream RudderStack 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 { name, properties? } or true for minimal page(). RudderStack requires name (falls back to empty string). Use with skip: true.").optional(),screen:r.unknown().describe("Per-event screen call (mobile backends). Resolves to { name, properties? } or true for minimal screen(). RudderStack requires name (falls back to empty string). Use with skip: true.").optional(),alias:r.unknown().describe("Per-event alias call. Resolves to { previousId }. Links anonymous user to identified user. Use with rule-level skip: true.").optional()}),l=a(n),p=a(o),u={};s(u,{env:()=>d,step:()=>g});var d={};s(d,{push:()=>c,simulation:()=>y});var m=()=>{};var c={analytics:{track:m,identify:m,group:m,page:m,screen:m,alias:m,flush:()=>Promise.resolve()}},y=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen","call:analytics.alias"],g={};s(g,{aliasUser:()=>S,anonymousOnly:()=>R,companyGroup:()=>h,defaultTrack:()=>f,destinationIdentify:()=>b,mappedEventName:()=>k,pageView:()=>I,screenView:()=>D,userLoginIdentify:()=>w,wildcardIgnored:()=>A});import{getEvent as v}from"@walkeros/core";var f={title:"Default track",description:"A walker event becomes a RudderStack 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)}]]},k={title:"Renamed event",description:"A mapping renames the event so the RudderStack track call uses a canonical name such as Order Completed.",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={title:"Destination identify",description:"Destination-level identify fires 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)}]]},w={title:"User login identify",description:"A user login fires only an analytics.identify call with the resolved 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)}]]},h={title:"Group company",description:"A company update fires analytics.group with the groupId and group traits for B2B account 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 analytics.page with a resolved page name and properties instead of a generic track.",in:v("page view",{timestamp:1700000105,user:{id:"us3r",session:"s3ss10n"},data:{title:"Getting Started",section:"tutorials"}}),mapping:{skip:!0,settings:{page:{map:{name:"data.title",properties:{map:{section:"data.section"}}}}}},out:[["analytics.page",{userId:"us3r",anonymousId:"s3ss10n",name:"Getting Started",properties:{section:"tutorials"},timestamp:new Date(1700000105)}]]},D={title:"Screen view",description:"A screen view from a mobile app backend fires analytics.screen with a screen name and properties.",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",properties:{map:{build:"data.build"}}}}}},out:[["analytics.screen",{userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",properties:{build:"1.2.3"},timestamp:new Date(1700000106)}]]},S={title:"Alias user",description:"An identity merge fires analytics.alias to link a previous anonymous id to the newly registered user id.",in:v("identity merge",{timestamp:1700000107,user:{id:"registered-456",session:"s3ss10n"},data:{anonymous_id:"anonymous-123"}}),mapping:{skip:!0,settings:{alias:{map:{previousId:"data.anonymous_id"}}}},out:[["analytics.alias",{userId:"registered-456",previousId:"anonymous-123",timestamp:new Date(1700000107)}]]},R={title:"Anonymous only",description:"When no userId is resolved RudderStack accepts the track call keyed solely by anonymousId.",in:v("product view",{timestamp:1700000108,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:[["analytics.track",{anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108)}]]},A={public:!1,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
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 'RudderStack source write key. Find it in the RudderStack dashboard under Sources > Setup.',\n ),\n dataPlaneUrl: z\n .string()\n .url()\n .describe(\n 'RudderStack data plane URL. Required. Example: https://your-data-plane.rudderstack.com',\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 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: 20.')\n .optional(),\n flushInterval: z\n .number()\n .int()\n .positive()\n .describe('Max milliseconds before auto-flush. Default: 10000.')\n .optional(),\n maxQueueSize: z\n .number()\n .int()\n .positive()\n .describe('Maximum batch payload size in bytes. Default: 460800 (~500KB).')\n .optional(),\n maxInternalQueueSize: z\n .number()\n .int()\n .positive()\n .describe('Maximum in-memory queue length. Default: 20000.')\n .optional(),\n logLevel: z\n .string()\n .describe(\n \"SDK log level: 'info', 'debug', 'error', or 'silly'. Default: 'info'.\",\n )\n .optional(),\n retryCount: z\n .number()\n .int()\n .min(0)\n .describe('Retry attempts for failed batches. Default: 3.')\n .optional(),\n enable: z\n .boolean()\n .describe('Set to false to no-op all SDK calls. Default: true.')\n .optional(),\n gzip: z\n .boolean()\n .describe('Enable gzip compression for requests. Default: true.')\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 integrations: z\n .record(z.string(), z.unknown())\n .describe(\n 'Enable/disable downstream RudderStack 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 { name, properties? } or true for minimal page(). RudderStack requires name (falls back to empty string). Use with skip: true.',\n )\n .optional(),\n screen: z\n .unknown()\n .describe(\n 'Per-event screen call (mobile backends). Resolves to { name, properties? } or true for minimal screen(). RudderStack requires name (falls back to empty string). Use with skip: true.',\n )\n .optional(),\n alias: z\n .unknown()\n .describe(\n 'Per-event alias call. Resolves to { previousId }. Links anonymous user to identified user. Use with rule-level 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, RudderStackAnalyticsMock } from '../types';\n\ntype SdkCall = (_params: Record<string, unknown>) => void;\ntype SdkFlush = (\n _callback?: (err?: Error, data?: unknown) => void,\n) => Promise<void>;\n\nconst noop: SdkCall = () => {};\nconst asyncNoop: SdkFlush = () => Promise.resolve();\n\nfunction createMockAnalytics(): RudderStackAnalyticsMock {\n return {\n track: noop,\n identify: noop,\n group: noop,\n page: noop,\n screen: noop,\n alias: noop,\n flush: 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 'call:analytics.alias',\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 RudderStackStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * RudderStack server destination invokes the injected `env.analytics` SDK\n * methods (`track`, `identify`, `group`, `page`, `screen`, `alias`) — not a\n * raw HTTP endpoint. Each `out` entry is therefore\n * `[callable, params]` where `callable` is the dotted method name\n * (e.g. `'analytics.track'`) and `params` is the object 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: RudderStackStepExample = {\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 RudderStack.\n */\nexport const mappedEventName: RudderStackStepExample = {\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: RudderStackStepExample = {\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: RudderStackStepExample = {\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: RudderStackStepExample = {\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. RudderStack requires name -- resolved\n * from mapping. skip: true suppresses track().\n */\nexport const pageView: RudderStackStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000105,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n title: 'Getting Started',\n section: 'tutorials',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n page: {\n map: {\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 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 * RudderStack requires name -- resolved from mapping.\n */\nexport const screenView: RudderStackStepExample = {\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 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 properties: { build: '1.2.3' },\n timestamp: new Date(1700000106),\n },\n ],\n ],\n};\n\n/**\n * Alias call -- links anonymous user identity to registered user.\n * skip: true suppresses track(). Requires previousId from mapping.\n */\nexport const aliasUser: RudderStackStepExample = {\n in: getEvent('identity merge', {\n timestamp: 1700000107,\n user: { id: 'registered-456', session: 's3ss10n' },\n data: {\n anonymous_id: 'anonymous-123',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n alias: {\n map: {\n previousId: 'data.anonymous_id',\n },\n },\n },\n },\n out: [\n [\n 'analytics.alias',\n {\n userId: 'registered-456',\n previousId: 'anonymous-123',\n timestamp: new Date(1700000107),\n },\n ],\n ],\n};\n\n/**\n * AnonymousId only -- no userId resolved. RudderStack accepts anonymousId alone.\n */\nexport const anonymousOnly: RudderStackStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000108,\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(1700000108),\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: RudderStackStepExample = {\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,cAAc,EACX,OAAO,EACP,IAAI,EACJ;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,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,cAAc,EACX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IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,QAAQ;AAAA,QACR,YAAY;AAAA,QACZ,WAAW,oBAAI,KAAK,UAAU;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AACF;AAKO,IAAM,gBAAwC;AAAA,EACnD,IAAI,SAAS,gBAAgB;AAAA,IAC3B,WAAW;AAAA,IACX,MAAM,EAAE,SAAS,UAAU;AAAA,EAC7B,CAAC;AAAA,EACD,UAAU;AAAA,IACR,QAAQ;AAAA,EACV;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,QACP,YAAY,CAAC;AAAA,QACb,WAAW,oBAAI,KAAK,UAAU;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,kBAA0C;AAAA,EACrD,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 'RudderStack source write key. Find it in the RudderStack dashboard under Sources > Setup.',\n ),\n dataPlaneUrl: z\n .string()\n .url()\n .describe(\n 'RudderStack data plane URL. Required. Example: https://your-data-plane.rudderstack.com',\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 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: 20.')\n .optional(),\n flushInterval: z\n .number()\n .int()\n .positive()\n .describe('Max milliseconds before auto-flush. Default: 10000.')\n .optional(),\n maxQueueSize: z\n .number()\n .int()\n .positive()\n .describe('Maximum batch payload size in bytes. Default: 460800 (~500KB).')\n .optional(),\n maxInternalQueueSize: z\n .number()\n .int()\n .positive()\n .describe('Maximum in-memory queue length. Default: 20000.')\n .optional(),\n logLevel: z\n .string()\n .describe(\n \"SDK log level: 'info', 'debug', 'error', or 'silly'. Default: 'info'.\",\n )\n .optional(),\n retryCount: z\n .number()\n .int()\n .min(0)\n .describe('Retry attempts for failed batches. Default: 3.')\n .optional(),\n enable: z\n .boolean()\n .describe('Set to false to no-op all SDK calls. Default: true.')\n .optional(),\n gzip: z\n .boolean()\n .describe('Enable gzip compression for requests. Default: true.')\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 integrations: z\n .record(z.string(), z.unknown())\n .describe(\n 'Enable/disable downstream RudderStack 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 { name, properties? } or true for minimal page(). RudderStack requires name (falls back to empty string). Use with skip: true.',\n )\n .optional(),\n screen: z\n .unknown()\n .describe(\n 'Per-event screen call (mobile backends). Resolves to { name, properties? } or true for minimal screen(). RudderStack requires name (falls back to empty string). Use with skip: true.',\n )\n .optional(),\n alias: z\n .unknown()\n .describe(\n 'Per-event alias call. Resolves to { previousId }. Links anonymous user to identified user. Use with rule-level 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, RudderStackAnalyticsMock } from '../types';\n\ntype SdkCall = (_params: Record<string, unknown>) => void;\ntype SdkFlush = (\n _callback?: (err?: Error, data?: unknown) => void,\n) => Promise<void>;\n\nconst noop: SdkCall = () => {};\nconst asyncNoop: SdkFlush = () => Promise.resolve();\n\nfunction createMockAnalytics(): RudderStackAnalyticsMock {\n return {\n track: noop,\n identify: noop,\n group: noop,\n page: noop,\n screen: noop,\n alias: noop,\n flush: 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 'call:analytics.alias',\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 RudderStackStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * RudderStack server destination invokes the injected `env.analytics` SDK\n * methods (`track`, `identify`, `group`, `page`, `screen`, `alias`) — not a\n * raw HTTP endpoint. Each `out` entry is therefore\n * `[callable, params]` where `callable` is the dotted method name\n * (e.g. `'analytics.track'`) and `params` is the object 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: RudderStackStepExample = {\n title: 'Default track',\n description:\n 'A walker event becomes a RudderStack 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 RudderStack.\n */\nexport const mappedEventName: RudderStackStepExample = {\n title: 'Renamed event',\n description:\n 'A mapping renames the event so the RudderStack track call uses a canonical name such as Order Completed.',\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: RudderStackStepExample = {\n title: 'Destination identify',\n description:\n 'Destination-level identify fires 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: RudderStackStepExample = {\n title: 'User login identify',\n description:\n 'A user login fires only an analytics.identify call with the resolved 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: RudderStackStepExample = {\n title: 'Group company',\n description:\n 'A company update fires analytics.group with the groupId and group traits for B2B account 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. RudderStack requires name -- resolved\n * from mapping. skip: true suppresses track().\n */\nexport const pageView: RudderStackStepExample = {\n title: 'Page view',\n description:\n 'A page view fires analytics.page with a resolved page 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 title: 'Getting Started',\n section: 'tutorials',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n page: {\n map: {\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 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 * RudderStack requires name -- resolved from mapping.\n */\nexport const screenView: RudderStackStepExample = {\n title: 'Screen view',\n description:\n 'A screen view from a mobile app backend fires analytics.screen with a screen name and properties.',\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 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 properties: { build: '1.2.3' },\n timestamp: new Date(1700000106),\n },\n ],\n ],\n};\n\n/**\n * Alias call -- links anonymous user identity to registered user.\n * skip: true suppresses track(). Requires previousId from mapping.\n */\nexport const aliasUser: RudderStackStepExample = {\n title: 'Alias user',\n description:\n 'An identity merge fires analytics.alias to link a previous anonymous id to the newly registered user id.',\n in: getEvent('identity merge', {\n timestamp: 1700000107,\n user: { id: 'registered-456', session: 's3ss10n' },\n data: {\n anonymous_id: 'anonymous-123',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n alias: {\n map: {\n previousId: 'data.anonymous_id',\n },\n },\n },\n },\n out: [\n [\n 'analytics.alias',\n {\n userId: 'registered-456',\n previousId: 'anonymous-123',\n timestamp: new Date(1700000107),\n },\n ],\n ],\n};\n\n/**\n * AnonymousId only -- no userId resolved. RudderStack accepts anonymousId alone.\n */\nexport const anonymousOnly: RudderStackStepExample = {\n title: 'Anonymous only',\n description:\n 'When no userId is resolved RudderStack accepts the track call keyed solely by anonymousId.',\n in: getEvent('product view', {\n timestamp: 1700000108,\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(1700000108),\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: RudderStackStepExample = {\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,cAAc,EACX,OAAO,EACP,IAAI,EACJ;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,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,cAAc,EACX,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,gEAAgE,EACzE,SAA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AAc;AAAA,IAChB;AAAA,EACF,CAAC;AAAA,EACD,SAAS;AAAA,IACP,MAAM;AAAA,IACN,UAAU;AAAA,MACR,OAAO;AAAA,QACL,KAAK;AAAA,UACH,YAAY;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,QAAQ;AAAA,QACR,YAAY;AAAA,QACZ,WAAW,oBAAI,KAAK,UAAU;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AACF;AAKO,IAAM,gBAAwC;AAAA,EACnD,OAAO;AAAA,EACP,aACE;AAAA,EACF,IAAI,SAAS,gBAAgB;AAAA,IAC3B,WAAW;AAAA,IACX,MAAM,EAAE,SAAS,UAAU;AAAA,EAC7B,CAAC;AAAA,EACD,UAAU;AAAA,IACR,QAAQ;AAAA,EACV;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,QACP,YAAY,CAAC;AAAA,QACb,WAAW,oBAAI,KAAK,UAAU;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,kBAA0C;AAAA,EACrD,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"]}
@@ -73,6 +73,8 @@ __export(step_exports, {
73
73
  });
74
74
  var import_core = require("@walkeros/core");
75
75
  var defaultTrack = {
76
+ title: "Default track",
77
+ description: "A walker event becomes a RudderStack analytics.track call with userId and anonymousId resolved from the event.",
76
78
  in: (0, import_core.getEvent)("product view", {
77
79
  timestamp: 1700000100,
78
80
  user: { id: "us3r", session: "s3ss10n" }
@@ -91,6 +93,8 @@ var defaultTrack = {
91
93
  ]
92
94
  };
93
95
  var mappedEventName = {
96
+ title: "Renamed event",
97
+ description: "A mapping renames the event so the RudderStack track call uses a canonical name such as Order Completed.",
94
98
  in: (0, import_core.getEvent)("order complete", {
95
99
  timestamp: 1700000101,
96
100
  user: { id: "us3r", session: "s3ss10n" }
@@ -112,6 +116,8 @@ var mappedEventName = {
112
116
  ]
113
117
  };
114
118
  var destinationIdentify = {
119
+ title: "Destination identify",
120
+ description: "Destination-level identify fires analytics.identify with traits on the first push only, then the track call follows.",
115
121
  in: (0, import_core.getEvent)("page view", {
116
122
  timestamp: 1700000102,
117
123
  user: { id: "us3r", session: "s3ss10n", email: "user@example.com" }
@@ -150,6 +156,8 @@ var destinationIdentify = {
150
156
  ]
151
157
  };
152
158
  var userLoginIdentify = {
159
+ title: "User login identify",
160
+ description: "A user login fires only an analytics.identify call with the resolved userId and traits, skipping the track.",
153
161
  in: (0, import_core.getEvent)("user login", {
154
162
  timestamp: 1700000103,
155
163
  user: { id: "us3r", session: "s3ss10n" },
@@ -190,6 +198,8 @@ var userLoginIdentify = {
190
198
  ]
191
199
  };
192
200
  var companyGroup = {
201
+ title: "Group company",
202
+ description: "A company update fires analytics.group with the groupId and group traits for B2B account tracking.",
193
203
  in: (0, import_core.getEvent)("company update", {
194
204
  timestamp: 1700000104,
195
205
  user: { id: "us3r", session: "s3ss10n" },
@@ -231,6 +241,8 @@ var companyGroup = {
231
241
  ]
232
242
  };
233
243
  var pageView = {
244
+ title: "Page view",
245
+ description: "A page view fires analytics.page with a resolved page name and properties instead of a generic track.",
234
246
  in: (0, import_core.getEvent)("page view", {
235
247
  timestamp: 1700000105,
236
248
  user: { id: "us3r", session: "s3ss10n" },
@@ -268,6 +280,8 @@ var pageView = {
268
280
  ]
269
281
  };
270
282
  var screenView = {
283
+ title: "Screen view",
284
+ description: "A screen view from a mobile app backend fires analytics.screen with a screen name and properties.",
271
285
  in: (0, import_core.getEvent)("screen view", {
272
286
  timestamp: 1700000106,
273
287
  user: { id: "us3r", session: "s3ss10n" },
@@ -306,6 +320,8 @@ var screenView = {
306
320
  ]
307
321
  };
308
322
  var aliasUser = {
323
+ title: "Alias user",
324
+ description: "An identity merge fires analytics.alias to link a previous anonymous id to the newly registered user id.",
309
325
  in: (0, import_core.getEvent)("identity merge", {
310
326
  timestamp: 1700000107,
311
327
  user: { id: "registered-456", session: "s3ss10n" },
@@ -335,6 +351,8 @@ var aliasUser = {
335
351
  ]
336
352
  };
337
353
  var anonymousOnly = {
354
+ title: "Anonymous only",
355
+ description: "When no userId is resolved RudderStack accepts the track call keyed solely by anonymousId.",
338
356
  in: (0, import_core.getEvent)("product view", {
339
357
  timestamp: 1700000108,
340
358
  user: { session: "s3ss10n" }
@@ -355,6 +373,7 @@ var anonymousOnly = {
355
373
  ]
356
374
  };
357
375
  var wildcardIgnored = {
376
+ public: false,
358
377
  in: (0, import_core.getEvent)("debug noise", {
359
378
  timestamp: 1700000109,
360
379
  user: { id: "us3r", session: "s3ss10n" }
@@ -52,6 +52,8 @@ __export(step_exports, {
52
52
  });
53
53
  import { getEvent } from "@walkeros/core";
54
54
  var defaultTrack = {
55
+ title: "Default track",
56
+ description: "A walker event becomes a RudderStack analytics.track call with userId and anonymousId resolved from the event.",
55
57
  in: getEvent("product view", {
56
58
  timestamp: 1700000100,
57
59
  user: { id: "us3r", session: "s3ss10n" }
@@ -70,6 +72,8 @@ var defaultTrack = {
70
72
  ]
71
73
  };
72
74
  var mappedEventName = {
75
+ title: "Renamed event",
76
+ description: "A mapping renames the event so the RudderStack track call uses a canonical name such as Order Completed.",
73
77
  in: getEvent("order complete", {
74
78
  timestamp: 1700000101,
75
79
  user: { id: "us3r", session: "s3ss10n" }
@@ -91,6 +95,8 @@ var mappedEventName = {
91
95
  ]
92
96
  };
93
97
  var destinationIdentify = {
98
+ title: "Destination identify",
99
+ description: "Destination-level identify fires analytics.identify with traits on the first push only, then the track call follows.",
94
100
  in: getEvent("page view", {
95
101
  timestamp: 1700000102,
96
102
  user: { id: "us3r", session: "s3ss10n", email: "user@example.com" }
@@ -129,6 +135,8 @@ var destinationIdentify = {
129
135
  ]
130
136
  };
131
137
  var userLoginIdentify = {
138
+ title: "User login identify",
139
+ description: "A user login fires only an analytics.identify call with the resolved userId and traits, skipping the track.",
132
140
  in: getEvent("user login", {
133
141
  timestamp: 1700000103,
134
142
  user: { id: "us3r", session: "s3ss10n" },
@@ -169,6 +177,8 @@ var userLoginIdentify = {
169
177
  ]
170
178
  };
171
179
  var companyGroup = {
180
+ title: "Group company",
181
+ description: "A company update fires analytics.group with the groupId and group traits for B2B account tracking.",
172
182
  in: getEvent("company update", {
173
183
  timestamp: 1700000104,
174
184
  user: { id: "us3r", session: "s3ss10n" },
@@ -210,6 +220,8 @@ var companyGroup = {
210
220
  ]
211
221
  };
212
222
  var pageView = {
223
+ title: "Page view",
224
+ description: "A page view fires analytics.page with a resolved page name and properties instead of a generic track.",
213
225
  in: getEvent("page view", {
214
226
  timestamp: 1700000105,
215
227
  user: { id: "us3r", session: "s3ss10n" },
@@ -247,6 +259,8 @@ var pageView = {
247
259
  ]
248
260
  };
249
261
  var screenView = {
262
+ title: "Screen view",
263
+ description: "A screen view from a mobile app backend fires analytics.screen with a screen name and properties.",
250
264
  in: getEvent("screen view", {
251
265
  timestamp: 1700000106,
252
266
  user: { id: "us3r", session: "s3ss10n" },
@@ -285,6 +299,8 @@ var screenView = {
285
299
  ]
286
300
  };
287
301
  var aliasUser = {
302
+ title: "Alias user",
303
+ description: "An identity merge fires analytics.alias to link a previous anonymous id to the newly registered user id.",
288
304
  in: getEvent("identity merge", {
289
305
  timestamp: 1700000107,
290
306
  user: { id: "registered-456", session: "s3ss10n" },
@@ -314,6 +330,8 @@ var aliasUser = {
314
330
  ]
315
331
  };
316
332
  var anonymousOnly = {
333
+ title: "Anonymous only",
334
+ description: "When no userId is resolved RudderStack accepts the track call keyed solely by anonymousId.",
317
335
  in: getEvent("product view", {
318
336
  timestamp: 1700000108,
319
337
  user: { session: "s3ss10n" }
@@ -334,6 +352,7 @@ var anonymousOnly = {
334
352
  ]
335
353
  };
336
354
  var wildcardIgnored = {
355
+ public: false,
337
356
  in: getEvent("debug noise", {
338
357
  timestamp: 1700000109,
339
358
  user: { id: "us3r", session: "s3ss10n" }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$meta": {
3
3
  "package": "@walkeros/server-destination-rudderstack",
4
- "version": "3.4.0",
4
+ "version": "3.4.1",
5
5
  "type": "destination",
6
6
  "platform": [
7
7
  "server"
@@ -160,6 +160,8 @@
160
160
  },
161
161
  "step": {
162
162
  "aliasUser": {
163
+ "title": "Alias user",
164
+ "description": "An identity merge fires analytics.alias to link a previous anonymous id to the newly registered user id.",
163
165
  "in": {
164
166
  "name": "identity merge",
165
167
  "data": {
@@ -208,7 +210,7 @@
208
210
  "group": "gr0up",
209
211
  "count": 1,
210
212
  "version": {
211
- "source": "3.4.0",
213
+ "source": "3.4.1",
212
214
  "tagging": 1
213
215
  },
214
216
  "source": {
@@ -239,6 +241,8 @@
239
241
  ]
240
242
  },
241
243
  "anonymousOnly": {
244
+ "title": "Anonymous only",
245
+ "description": "When no userId is resolved RudderStack accepts the track call keyed solely by anonymousId.",
242
246
  "in": {
243
247
  "name": "product view",
244
248
  "data": {
@@ -276,7 +280,7 @@
276
280
  "group": "gr0up",
277
281
  "count": 1,
278
282
  "version": {
279
- "source": "3.4.0",
283
+ "source": "3.4.1",
280
284
  "tagging": 1
281
285
  },
282
286
  "source": {
@@ -299,6 +303,8 @@
299
303
  ]
300
304
  },
301
305
  "companyGroup": {
306
+ "title": "Group company",
307
+ "description": "A company update fires analytics.group with the groupId and group traits for B2B account tracking.",
302
308
  "in": {
303
309
  "name": "company update",
304
310
  "data": {
@@ -350,7 +356,7 @@
350
356
  "group": "gr0up",
351
357
  "count": 1,
352
358
  "version": {
353
- "source": "3.4.0",
359
+ "source": "3.4.1",
354
360
  "tagging": 1
355
361
  },
356
362
  "source": {
@@ -394,6 +400,8 @@
394
400
  ]
395
401
  },
396
402
  "defaultTrack": {
403
+ "title": "Default track",
404
+ "description": "A walker event becomes a RudderStack analytics.track call with userId and anonymousId resolved from the event.",
397
405
  "in": {
398
406
  "name": "product view",
399
407
  "data": {
@@ -432,7 +440,7 @@
432
440
  "group": "gr0up",
433
441
  "count": 1,
434
442
  "version": {
435
- "source": "3.4.0",
443
+ "source": "3.4.1",
436
444
  "tagging": 1
437
445
  },
438
446
  "source": {
@@ -455,6 +463,8 @@
455
463
  ]
456
464
  },
457
465
  "destinationIdentify": {
466
+ "title": "Destination identify",
467
+ "description": "Destination-level identify fires analytics.identify with traits on the first push only, then the track call follows.",
458
468
  "in": {
459
469
  "name": "page view",
460
470
  "data": {
@@ -509,7 +519,7 @@
509
519
  "group": "gr0up",
510
520
  "count": 1,
511
521
  "version": {
512
- "source": "3.4.0",
522
+ "source": "3.4.1",
513
523
  "tagging": 1
514
524
  },
515
525
  "source": {
@@ -554,6 +564,8 @@
554
564
  ]
555
565
  },
556
566
  "mappedEventName": {
567
+ "title": "Renamed event",
568
+ "description": "A mapping renames the event so the RudderStack track call uses a canonical name such as Order Completed.",
557
569
  "in": {
558
570
  "name": "order complete",
559
571
  "data": {
@@ -639,7 +651,7 @@
639
651
  "group": "gr0up",
640
652
  "count": 1,
641
653
  "version": {
642
- "source": "3.4.0",
654
+ "source": "3.4.1",
643
655
  "tagging": 1
644
656
  },
645
657
  "source": {
@@ -665,6 +677,8 @@
665
677
  ]
666
678
  },
667
679
  "pageView": {
680
+ "title": "Page view",
681
+ "description": "A page view fires analytics.page with a resolved page name and properties instead of a generic track.",
668
682
  "in": {
669
683
  "name": "page view",
670
684
  "data": {
@@ -714,7 +728,7 @@
714
728
  "group": "gr0up",
715
729
  "count": 1,
716
730
  "version": {
717
- "source": "3.4.0",
731
+ "source": "3.4.1",
718
732
  "tagging": 1
719
733
  },
720
734
  "source": {
@@ -754,6 +768,8 @@
754
768
  ]
755
769
  },
756
770
  "screenView": {
771
+ "title": "Screen view",
772
+ "description": "A screen view from a mobile app backend fires analytics.screen with a screen name and properties.",
757
773
  "in": {
758
774
  "name": "screen view",
759
775
  "data": {
@@ -804,7 +820,7 @@
804
820
  "group": "gr0up",
805
821
  "count": 1,
806
822
  "version": {
807
- "source": "3.4.0",
823
+ "source": "3.4.1",
808
824
  "tagging": 1
809
825
  },
810
826
  "source": {
@@ -844,6 +860,8 @@
844
860
  ]
845
861
  },
846
862
  "userLoginIdentify": {
863
+ "title": "User login identify",
864
+ "description": "A user login fires only an analytics.identify call with the resolved userId and traits, skipping the track.",
847
865
  "in": {
848
866
  "name": "user login",
849
867
  "data": {
@@ -895,7 +913,7 @@
895
913
  "group": "gr0up",
896
914
  "count": 1,
897
915
  "version": {
898
- "source": "3.4.0",
916
+ "source": "3.4.1",
899
917
  "tagging": 1
900
918
  },
901
919
  "source": {
@@ -938,6 +956,7 @@
938
956
  ]
939
957
  },
940
958
  "wildcardIgnored": {
959
+ "public": false,
941
960
  "in": {
942
961
  "name": "debug noise",
943
962
  "data": {
@@ -993,7 +1012,7 @@
993
1012
  "group": "gr0up",
994
1013
  "count": 1,
995
1014
  "version": {
996
- "source": "3.4.0",
1015
+ "source": "3.4.1",
997
1016
  "tagging": 1
998
1017
  },
999
1018
  "source": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@walkeros/server-destination-rudderstack",
3
3
  "description": "RudderStack CDP server destination for walkerOS (@rudderstack/rudder-sdk-node, full Segment Spec)",
4
- "version": "3.4.0",
4
+ "version": "3.4.1",
5
5
  "license": "MIT",
6
6
  "exports": {
7
7
  ".": {
@@ -35,11 +35,11 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@rudderstack/rudder-sdk-node": "^3.0.0",
38
- "@walkeros/core": "3.4.0",
39
- "@walkeros/server-core": "3.4.0"
38
+ "@walkeros/core": "3.4.1",
39
+ "@walkeros/server-core": "3.4.1"
40
40
  },
41
41
  "devDependencies": {
42
- "@walkeros/collector": "3.4.0"
42
+ "@walkeros/collector": "3.4.1"
43
43
  },
44
44
  "repository": {
45
45
  "url": "git+https://github.com/elbwalker/walkerOS.git",