@walkeros/server-destination-rudderstack 3.4.2 → 4.0.0-next-1777882869103

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/README.md CHANGED
@@ -51,7 +51,7 @@ npm install @walkeros/server-destination-rudderstack
51
51
 
52
52
  Per-event mapping settings control which RudderStack methods are called:
53
53
 
54
- | Setting | Effect | Use with `skip: true` |
54
+ | Setting | Effect | Use with `silent: true` |
55
55
  | ---------- | ---------------------------- | ------------------------ |
56
56
  | `identify` | Calls `analytics.identify()` | Yes, for login events |
57
57
  | `group` | Calls `analytics.group()` | Yes, for company events |
package/dist/dev.d.mts CHANGED
@@ -132,7 +132,7 @@ type RudderStackStepExample = Flow.StepExample & {
132
132
  };
133
133
  /**
134
134
  * RudderStack server destination invokes the injected `env.analytics` SDK
135
- * methods (`track`, `identify`, `group`, `page`, `screen`, `alias`) not a
135
+ * methods (`track`, `identify`, `group`, `page`, `screen`, `alias`) - not a
136
136
  * raw HTTP endpoint. Each `out` entry is therefore
137
137
  * `[callable, params]` where `callable` is the dotted method name
138
138
  * (e.g. `'analytics.track'`) and `params` is the object passed to the SDK.
@@ -155,16 +155,16 @@ declare const mappedEventName: RudderStackStepExample;
155
155
  */
156
156
  declare const destinationIdentify: RudderStackStepExample;
157
157
  /**
158
- * Per-event identify with skip -- user login fires identify() only.
158
+ * Per-event identify with silent -- user login fires identify() only.
159
159
  */
160
160
  declare const userLoginIdentify: RudderStackStepExample;
161
161
  /**
162
- * Per-event group with skip -- company update fires group() only.
162
+ * Per-event group with silent -- company update fires group() only.
163
163
  */
164
164
  declare const companyGroup: RudderStackStepExample;
165
165
  /**
166
166
  * Explicit page() call with properties. RudderStack requires name -- resolved
167
- * from mapping. skip: true suppresses track().
167
+ * from mapping. silent: true suppresses track().
168
168
  */
169
169
  declare const pageView: RudderStackStepExample;
170
170
  /**
@@ -174,7 +174,7 @@ declare const pageView: RudderStackStepExample;
174
174
  declare const screenView: RudderStackStepExample;
175
175
  /**
176
176
  * Alias call -- links anonymous user identity to registered user.
177
- * skip: true suppresses track(). Requires previousId from mapping.
177
+ * silent: true suppresses track(). Requires previousId from mapping.
178
178
  */
179
179
  declare const aliasUser: RudderStackStepExample;
180
180
  /**
package/dist/dev.d.ts CHANGED
@@ -132,7 +132,7 @@ type RudderStackStepExample = Flow.StepExample & {
132
132
  };
133
133
  /**
134
134
  * RudderStack server destination invokes the injected `env.analytics` SDK
135
- * methods (`track`, `identify`, `group`, `page`, `screen`, `alias`) not a
135
+ * methods (`track`, `identify`, `group`, `page`, `screen`, `alias`) - not a
136
136
  * raw HTTP endpoint. Each `out` entry is therefore
137
137
  * `[callable, params]` where `callable` is the dotted method name
138
138
  * (e.g. `'analytics.track'`) and `params` is the object passed to the SDK.
@@ -155,16 +155,16 @@ declare const mappedEventName: RudderStackStepExample;
155
155
  */
156
156
  declare const destinationIdentify: RudderStackStepExample;
157
157
  /**
158
- * Per-event identify with skip -- user login fires identify() only.
158
+ * Per-event identify with silent -- user login fires identify() only.
159
159
  */
160
160
  declare const userLoginIdentify: RudderStackStepExample;
161
161
  /**
162
- * Per-event group with skip -- company update fires group() only.
162
+ * Per-event group with silent -- company update fires group() only.
163
163
  */
164
164
  declare const companyGroup: RudderStackStepExample;
165
165
  /**
166
166
  * Explicit page() call with properties. RudderStack requires name -- resolved
167
- * from mapping. skip: true suppresses track().
167
+ * from mapping. silent: true suppresses track().
168
168
  */
169
169
  declare const pageView: RudderStackStepExample;
170
170
  /**
@@ -174,7 +174,7 @@ declare const pageView: RudderStackStepExample;
174
174
  declare const screenView: RudderStackStepExample;
175
175
  /**
176
176
  * Alias call -- links anonymous user identity to registered user.
177
- * skip: true suppresses track(). Requires previousId from mapping.
177
+ * silent: true suppresses track(). Requires previousId from mapping.
178
178
  */
179
179
  declare const aliasUser: RudderStackStepExample;
180
180
  /**
package/dist/dev.js CHANGED
@@ -1 +1 @@
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
1
+ "use strict";var e,t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,i=(e,s)=>{for(var a in s)t(e,a,{get:s[a],enumerable:!0})},r={};i(r,{examples:()=>g,schemas:()=>o}),module.exports=(e=r,((e,i,r,o)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let l of a(i))n.call(e,l)||l===r||t(e,l,{get:()=>i[l],enumerable:!(o=s(i,l))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o={};i(o,{MappingSchema:()=>m,SettingsSchema:()=>p,mapping:()=>y,settings:()=>c});var l=require("@walkeros/core/dev"),u=require("@walkeros/core/dev"),p=u.z.object({writeKey:u.z.string().min(1).describe("RudderStack source write key. Find it in the RudderStack dashboard under Sources > Setup."),dataPlaneUrl:u.z.string().url().describe("RudderStack data plane URL. Required. Example: https://your-data-plane.rudderstack.com"),userId:u.z.string().describe("walkerOS mapping value path to resolve userId from each event (like user.id).").optional(),anonymousId:u.z.string().describe("walkerOS mapping value path to resolve anonymousId from each event (like user.session).").optional(),path:u.z.string().describe("API path route (like /v1/batch).").optional(),flushAt:u.z.number().int().positive().describe("Events to enqueue before flushing a batch. Default: 20.").optional(),flushInterval:u.z.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxQueueSize:u.z.number().int().positive().describe("Maximum batch payload size in bytes. Default: 460800 (~500KB).").optional(),maxInternalQueueSize:u.z.number().int().positive().describe("Maximum in-memory queue length. Default: 20000.").optional(),logLevel:u.z.string().describe("SDK log level: 'info', 'debug', 'error', or 'silly'. Default: 'info'.").optional(),retryCount:u.z.number().int().min(0).describe("Retry attempts for failed batches. Default: 3.").optional(),enable:u.z.boolean().describe("Set to false to no-op all SDK calls. Default: true.").optional(),gzip:u.z.boolean().describe("Enable gzip compression for requests. Default: true.").optional(),identify:u.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:u.z.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.").optional(),integrations:u.z.record(u.z.string(),u.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 silent: true on login/identify events.").optional(),group:d.z.unknown().describe("Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level silent: 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 silent: 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 silent: true.").optional(),alias:d.z.unknown().describe("Per-event alias call. Resolves to { previousId }. Links anonymous user to identified user. Use with rule-level silent: true.").optional()}),c=(0,l.zodToSchema)(p),y=(0,l.zodToSchema)(m),g={};i(g,{env:()=>v,step:()=>h});var v={};i(v,{push:()=>b,simulation:()=>w});var f=()=>{};var b={analytics:{track:f,identify:f,group:f,page:f,screen:f,alias:f,flush:()=>Promise.resolve()}},w=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen","call:analytics.alias"],h={};i(h,{aliasUser:()=>O,anonymousOnly:()=>P,companyGroup:()=>R,defaultTrack:()=>I,destinationIdentify:()=>D,mappedEventName:()=>z,pageView:()=>E,screenView:()=>A,userLoginIdentify:()=>S,wildcardIgnored:()=>x});var k=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,k.getEvent)("product view",{timestamp:1700000100,user:{id:"us3r",session:"s3ss10n"}}),out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000100)}]]},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,k.getEvent)("order complete",{timestamp:1700000101,user:{id:"us3r",session:"s3ss10n"}}),mapping:{name:"Order Completed"},out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"Order Completed",properties:{},timestamp:new Date(1700000101)}]]},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,k.getEvent)("page view",{timestamp:1700000102,user:{id:"us3r",session:"s3ss10n",email:"user@example.com"}}),settings:{identify:{map:{traits:{map:{email:"user.email"}}}}},out:[["analytics.identify",{userId:"us3r",anonymousId:"s3ss10n",traits:{email:"user@example.com"},timestamp:new Date(1700000102)}],["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"page view",properties:{},timestamp:new Date(1700000102)}]]},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,k.getEvent)("user login",{timestamp:1700000103,user:{id:"us3r",session:"s3ss10n"},data:{user_id:"new-user-123",email:"user@acme.com",name:"Jane Doe",plan:"premium"}}),mapping:{silent:!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,k.getEvent)("company update",{timestamp:1700000104,user:{id:"us3r",session:"s3ss10n"},data:{company_id:"comp-456",company_name:"Acme",industry:"tech",employees:50}}),mapping:{silent:!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,k.getEvent)("page view",{timestamp:1700000105,user:{id:"us3r",session:"s3ss10n"},data:{title:"Getting Started",section:"tutorials"}}),mapping:{silent:!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,k.getEvent)("screen view",{timestamp:1700000106,user:{id:"us3r",session:"s3ss10n"},data:{screen_name:"Welcome",section:"onboarding",build:"1.2.3"}}),mapping:{silent:!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,k.getEvent)("identity merge",{timestamp:1700000107,user:{id:"registered-456",session:"s3ss10n"},data:{anonymous_id:"anonymous-123"}}),mapping:{silent:!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,k.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,k.getEvent)("debug noise",{timestamp:1700000109,user:{id:"us3r",session:"s3ss10n"}}),mapping:{ignore:!0},out:[]};//# sourceMappingURL=dev.js.map
package/dist/dev.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n writeKey: z\n .string()\n .min(1)\n .describe(\n '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;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,UAAU,aACP,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,cAAc,aACX,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,aACL,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,aACV,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,aAAE,OAAO,EAAE,SAAS,kCAAkC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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 silent: 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 silent: 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 silent: 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 silent: 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 silent: 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 silent -- 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 silent: 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 silent -- 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 silent: 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. silent: 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 silent: 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 silent: 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 * silent: 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 silent: 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;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB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,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,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
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 silent: true on login/identify events.").optional(),group:r.unknown().describe("Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level silent: 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 silent: 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 silent: true.").optional(),alias:r.unknown().describe("Per-event alias call. Resolves to { previousId }. Links anonymous user to identified user. Use with rule-level silent: 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:()=>k,defaultTrack:()=>f,destinationIdentify:()=>w,mappedEventName:()=>b,pageView:()=>I,screenView:()=>D,userLoginIdentify:()=>h,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)}]]},b={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)}]]},w={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)}]]},h={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:{silent:!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)}]]},k={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:{silent:!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:{silent:!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:{silent:!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:{silent:!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 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,SAAS;AAAA,EACZ,sBAAsB,EACnB,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,iDAAiD,EAC1D,SAAS;AAAA,EACZ,UAAU,EACP,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,YAAY,EACT,OAAO,EACP,IAAI,EACJ,IAAI,CAAC,EACL,SAAS,g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;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"]}
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 silent: 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 silent: 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 silent: 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 silent: 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 silent: 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 silent -- 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 silent: 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 silent -- 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 silent: 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. silent: 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 silent: 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 silent: 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 * silent: 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 silent: 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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AAA,IACjD,MAAM;AAAA,MACJ,cAAc;AAAA,IAChB;AAAA,EACF,CAAC;AAAA,EACD,SAAS;AAAA,IACP,QAAQ;AAAA,IACR,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"]}
@@ -89,7 +89,7 @@ type RudderStackStepExample = Flow.StepExample & {
89
89
  };
90
90
  /**
91
91
  * RudderStack server destination invokes the injected `env.analytics` SDK
92
- * methods (`track`, `identify`, `group`, `page`, `screen`, `alias`) not a
92
+ * methods (`track`, `identify`, `group`, `page`, `screen`, `alias`) - not a
93
93
  * raw HTTP endpoint. Each `out` entry is therefore
94
94
  * `[callable, params]` where `callable` is the dotted method name
95
95
  * (e.g. `'analytics.track'`) and `params` is the object passed to the SDK.
@@ -112,16 +112,16 @@ declare const mappedEventName: RudderStackStepExample;
112
112
  */
113
113
  declare const destinationIdentify: RudderStackStepExample;
114
114
  /**
115
- * Per-event identify with skip -- user login fires identify() only.
115
+ * Per-event identify with silent -- user login fires identify() only.
116
116
  */
117
117
  declare const userLoginIdentify: RudderStackStepExample;
118
118
  /**
119
- * Per-event group with skip -- company update fires group() only.
119
+ * Per-event group with silent -- company update fires group() only.
120
120
  */
121
121
  declare const companyGroup: RudderStackStepExample;
122
122
  /**
123
123
  * Explicit page() call with properties. RudderStack requires name -- resolved
124
- * from mapping. skip: true suppresses track().
124
+ * from mapping. silent: true suppresses track().
125
125
  */
126
126
  declare const pageView: RudderStackStepExample;
127
127
  /**
@@ -131,7 +131,7 @@ declare const pageView: RudderStackStepExample;
131
131
  declare const screenView: RudderStackStepExample;
132
132
  /**
133
133
  * Alias call -- links anonymous user identity to registered user.
134
- * skip: true suppresses track(). Requires previousId from mapping.
134
+ * silent: true suppresses track(). Requires previousId from mapping.
135
135
  */
136
136
  declare const aliasUser: RudderStackStepExample;
137
137
  /**
@@ -89,7 +89,7 @@ type RudderStackStepExample = Flow.StepExample & {
89
89
  };
90
90
  /**
91
91
  * RudderStack server destination invokes the injected `env.analytics` SDK
92
- * methods (`track`, `identify`, `group`, `page`, `screen`, `alias`) not a
92
+ * methods (`track`, `identify`, `group`, `page`, `screen`, `alias`) - not a
93
93
  * raw HTTP endpoint. Each `out` entry is therefore
94
94
  * `[callable, params]` where `callable` is the dotted method name
95
95
  * (e.g. `'analytics.track'`) and `params` is the object passed to the SDK.
@@ -112,16 +112,16 @@ declare const mappedEventName: RudderStackStepExample;
112
112
  */
113
113
  declare const destinationIdentify: RudderStackStepExample;
114
114
  /**
115
- * Per-event identify with skip -- user login fires identify() only.
115
+ * Per-event identify with silent -- user login fires identify() only.
116
116
  */
117
117
  declare const userLoginIdentify: RudderStackStepExample;
118
118
  /**
119
- * Per-event group with skip -- company update fires group() only.
119
+ * Per-event group with silent -- company update fires group() only.
120
120
  */
121
121
  declare const companyGroup: RudderStackStepExample;
122
122
  /**
123
123
  * Explicit page() call with properties. RudderStack requires name -- resolved
124
- * from mapping. skip: true suppresses track().
124
+ * from mapping. silent: true suppresses track().
125
125
  */
126
126
  declare const pageView: RudderStackStepExample;
127
127
  /**
@@ -131,7 +131,7 @@ declare const pageView: RudderStackStepExample;
131
131
  declare const screenView: RudderStackStepExample;
132
132
  /**
133
133
  * Alias call -- links anonymous user identity to registered user.
134
- * skip: true suppresses track(). Requires previousId from mapping.
134
+ * silent: true suppresses track(). Requires previousId from mapping.
135
135
  */
136
136
  declare const aliasUser: RudderStackStepExample;
137
137
  /**
@@ -169,7 +169,7 @@ var userLoginIdentify = {
169
169
  }
170
170
  }),
171
171
  mapping: {
172
- skip: true,
172
+ silent: true,
173
173
  settings: {
174
174
  identify: {
175
175
  map: {
@@ -211,7 +211,7 @@ var companyGroup = {
211
211
  }
212
212
  }),
213
213
  mapping: {
214
- skip: true,
214
+ silent: true,
215
215
  settings: {
216
216
  group: {
217
217
  map: {
@@ -252,7 +252,7 @@ var pageView = {
252
252
  }
253
253
  }),
254
254
  mapping: {
255
- skip: true,
255
+ silent: true,
256
256
  settings: {
257
257
  page: {
258
258
  map: {
@@ -292,7 +292,7 @@ var screenView = {
292
292
  }
293
293
  }),
294
294
  mapping: {
295
- skip: true,
295
+ silent: true,
296
296
  settings: {
297
297
  screen: {
298
298
  map: {
@@ -330,7 +330,7 @@ var aliasUser = {
330
330
  }
331
331
  }),
332
332
  mapping: {
333
- skip: true,
333
+ silent: true,
334
334
  settings: {
335
335
  alias: {
336
336
  map: {
@@ -148,7 +148,7 @@ var userLoginIdentify = {
148
148
  }
149
149
  }),
150
150
  mapping: {
151
- skip: true,
151
+ silent: true,
152
152
  settings: {
153
153
  identify: {
154
154
  map: {
@@ -190,7 +190,7 @@ var companyGroup = {
190
190
  }
191
191
  }),
192
192
  mapping: {
193
- skip: true,
193
+ silent: true,
194
194
  settings: {
195
195
  group: {
196
196
  map: {
@@ -231,7 +231,7 @@ var pageView = {
231
231
  }
232
232
  }),
233
233
  mapping: {
234
- skip: true,
234
+ silent: true,
235
235
  settings: {
236
236
  page: {
237
237
  map: {
@@ -271,7 +271,7 @@ var screenView = {
271
271
  }
272
272
  }),
273
273
  mapping: {
274
- skip: true,
274
+ silent: true,
275
275
  settings: {
276
276
  screen: {
277
277
  map: {
@@ -309,7 +309,7 @@ var aliasUser = {
309
309
  }
310
310
  }),
311
311
  mapping: {
312
- skip: true,
312
+ silent: true,
313
313
  settings: {
314
314
  alias: {
315
315
  map: {
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var t,e=Object.defineProperty,i=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,s={};((t,i)=>{for(var n in i)e(t,n,{get:i[n],enumerable:!0})})(s,{DestinationRudderStack:()=>d,default:()=>p,destinationRudderStack:()=>l}),module.exports=(t=s,((t,s,a,o)=>{if(s&&"object"==typeof s||"function"==typeof s)for(let u of n(s))r.call(t,u)||u===a||e(t,u,{get:()=>s[u],enumerable:!(o=i(s,u))||o.enumerable});return t})(e({},"__esModule",{value:!0}),t));var a=require("@walkeros/core"),o=async function(t,{config:e,rule:i,data:n,collector:r,env:s,logger:o}){var d,l;const p=e.settings,g=p._analytics,y=(null==s?void 0:s.analytics)||g;if(!y)return void o.warn("RudderStack Analytics not initialized");const f=p._state||{},m=(null==i?void 0:i.settings)||{},v=new Date(t.timestamp||Date.now()),I=p.userId?u(await(0,a.getMappingValue)(t,p.userId,{collector:r})):void 0,w=p.anonymousId?u(await(0,a.getMappingValue)(t,p.anonymousId,{collector:r})):void 0;if(!I&&!w)return void o.warn("RudderStack requires userId or anonymousId; skipping event",{event:t.name});const b={};I&&(b.userId=I),w&&(b.anonymousId=w);const O=null!=(d=m.identify)?d:p.identify;if(void 0!==O){const e=await(0,a.getMappingValue)(t,O,{collector:r});(0,a.isObject)(e)&&function(t,e,i,n,r){var s;const o=n.lastIdentity||{},u=(0,a.isString)(e.userId)?e.userId:i.userId,d=(0,a.isObject)(e.traits)&&!(0,a.isArray)(e.traits)?e.traits:void 0,l=c(d),p=u!==o.userId,g=l!==(null!=(s=o.traitsHash)?s:"");if(!p&&!g)return;const y={...i,timestamp:r};u&&(y.userId=u);d&&(y.traits=d);t.identify(y),n.lastIdentity={userId:u,anonymousId:i.anonymousId,traitsHash:l}}(y,e,b,f,v)}const j=null!=(l=m.group)?l:p.group;if(void 0!==j){const e=await(0,a.getMappingValue)(t,j,{collector:r});(0,a.isObject)(e)&&function(t,e,i,n,r){var s;const o=(0,a.isString)(e.groupId)?e.groupId:void 0;if(!o)return;const u=n.lastGroup||{},d=(0,a.isObject)(e.traits)&&!(0,a.isArray)(e.traits)?e.traits:void 0,l=c(d),p=o!==u.groupId,g=l!==(null!=(s=u.traitsHash)?s:"");if(!p&&!g)return;const y={...i,groupId:o,timestamp:r};d&&(y.traits=d);t.group(y),n.lastGroup={groupId:o,traitsHash:l}}(y,e,b,f,v)}if(void 0!==m.page&&await async function(t,e,i,n,r,s){const o={...n,timestamp:s};if(!0===e)return o.name="",void t.page(o);const u=await(0,a.getMappingValue)(i,e,{collector:r});if(!(0,a.isObject)(u))return;const c=u;o.name=(0,a.isString)(c.name)?c.name:"",(0,a.isObject)(c.properties)&&!(0,a.isArray)(c.properties)&&(o.properties=c.properties);t.page(o)}(y,m.page,t,b,r,v),void 0!==m.screen&&await async function(t,e,i,n,r,s){const o={...n,timestamp:s};if(!0===e)return o.name="",void t.screen(o);const u=await(0,a.getMappingValue)(i,e,{collector:r});if(!(0,a.isObject)(u))return;const c=u;o.name=(0,a.isString)(c.name)?c.name:"",(0,a.isObject)(c.properties)&&!(0,a.isArray)(c.properties)&&(o.properties=c.properties);t.screen(o)}(y,m.screen,t,b,r,v),void 0!==m.alias&&await async function(t,e,i,n,r,s){const o=await(0,a.getMappingValue)(i,e,{collector:r});if(!(0,a.isObject)(o))return;const u=o,c=(0,a.isString)(u.previousId)?u.previousId:void 0;if(!c)return;const d={previousId:c,timestamp:s};n.userId&&(d.userId=n.userId);t.alias(d)}(y,m.alias,t,b,r,v),!0!==(null==i?void 0:i.skip)){const e=(0,a.isString)(null==i?void 0:i.name)?i.name:t.name,r=(0,a.isObject)(n)?n:{};y.track({...b,event:e,properties:r,timestamp:v})}p._state=f};function u(t){if((0,a.isString)(t)&&t.length>0)return t}function c(t){if(!t)return"";try{return JSON.stringify(t)}catch(t){return""}}var d={},l={type:"rudderstack",config:{},init({config:t,logger:e,env:i}){const n=function(t={},e){var i,n;const r=t.settings||{},{writeKey:s,dataPlaneUrl:a}=r;s||e.throw("Config settings writeKey missing"),a||e.throw("Config settings dataPlaneUrl missing");const o={...r,writeKey:s,dataPlaneUrl:a,userId:null!=(i=r.userId)?i:"user.id",anonymousId:null!=(n=r.anonymousId)?n:"user.session"};return{...t,settings:o}}(t,e),r=n.settings;if(!(null==i?void 0:i.analytics))try{const t=require("@rudderstack/rudder-sdk-node"),{writeKey:e,dataPlaneUrl:i,userId:n,anonymousId:s,identify:a,group:o,integrations:u,_analytics:c,_state:d,...l}=r,p=new t(e,{dataPlaneUrl:i,...l});r._analytics=p}catch(t){e.throw(`Failed to initialize RudderStack SDK: ${t}`)}return r._state={},n},push:async(t,e)=>await o(t,e),async destroy({config:t}){const e=((null==t?void 0:t.settings)||{})._analytics;e&&await e.flush()}},p=l;//# sourceMappingURL=index.js.map
1
+ "use strict";var t,e=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,s={};((t,i)=>{for(var r in i)e(t,r,{get:i[r],enumerable:!0})})(s,{DestinationRudderStack:()=>d,default:()=>l,destinationRudderStack:()=>p}),module.exports=(t=s,((t,s,a,o)=>{if(s&&"object"==typeof s||"function"==typeof s)for(let c of r(s))n.call(t,c)||c===a||e(t,c,{get:()=>s[c],enumerable:!(o=i(s,c))||o.enumerable});return t})(e({},"__esModule",{value:!0}),t));var a=require("@walkeros/core"),o=async function(t,{config:e,rule:i,data:r,collector:n,env:s,logger:o}){const d=e.settings,p=d._analytics,l=s?.analytics,g=l||p;if(!g)return void o.warn("RudderStack Analytics not initialized");const y=d._state||{},f=i?.settings||{},m=new Date(t.timestamp||Date.now()),I=d.userId?c(await(0,a.getMappingValue)(t,d.userId,{collector:n})):void 0,v=d.anonymousId?c(await(0,a.getMappingValue)(t,d.anonymousId,{collector:n})):void 0;if(!I&&!v)return void o.warn("RudderStack requires userId or anonymousId; skipping event",{event:t.name});const w={};I&&(w.userId=I),v&&(w.anonymousId=v);const b=f.identify??d.identify;if(void 0!==b){const e=await(0,a.getMappingValue)(t,b,{collector:n});(0,a.isObject)(e)&&function(t,e,i,r,n){const s=r.lastIdentity||{},o=(0,a.isString)(e.userId)?e.userId:i.userId,c=(0,a.isObject)(e.traits)&&!(0,a.isArray)(e.traits)?e.traits:void 0,d=u(c),p=o!==s.userId,l=d!==(s.traitsHash??"");if(!p&&!l)return;const g={...i,timestamp:n};o&&(g.userId=o);c&&(g.traits=c);t.identify(g),r.lastIdentity={userId:o,anonymousId:i.anonymousId,traitsHash:d}}(g,e,w,y,m)}const O=f.group??d.group;if(void 0!==O){const e=await(0,a.getMappingValue)(t,O,{collector:n});(0,a.isObject)(e)&&function(t,e,i,r,n){const s=(0,a.isString)(e.groupId)?e.groupId:void 0;if(!s)return;const o=r.lastGroup||{},c=(0,a.isObject)(e.traits)&&!(0,a.isArray)(e.traits)?e.traits:void 0,d=u(c),p=s!==o.groupId,l=d!==(o.traitsHash??"");if(!p&&!l)return;const g={...i,groupId:s,timestamp:n};c&&(g.traits=c);t.group(g),r.lastGroup={groupId:s,traitsHash:d}}(g,e,w,y,m)}if(void 0!==f.page&&await async function(t,e,i,r,n,s){const o={...r,timestamp:s};if(!0===e)return o.name="",void t.page(o);const c=await(0,a.getMappingValue)(i,e,{collector:n});if(!(0,a.isObject)(c))return;const u=c;o.name=(0,a.isString)(u.name)?u.name:"",(0,a.isObject)(u.properties)&&!(0,a.isArray)(u.properties)&&(o.properties=u.properties);t.page(o)}(g,f.page,t,w,n,m),void 0!==f.screen&&await async function(t,e,i,r,n,s){const o={...r,timestamp:s};if(!0===e)return o.name="",void t.screen(o);const c=await(0,a.getMappingValue)(i,e,{collector:n});if(!(0,a.isObject)(c))return;const u=c;o.name=(0,a.isString)(u.name)?u.name:"",(0,a.isObject)(u.properties)&&!(0,a.isArray)(u.properties)&&(o.properties=u.properties);t.screen(o)}(g,f.screen,t,w,n,m),void 0!==f.alias&&await async function(t,e,i,r,n,s){const o=await(0,a.getMappingValue)(i,e,{collector:n});if(!(0,a.isObject)(o))return;const c=o,u=(0,a.isString)(c.previousId)?c.previousId:void 0;if(!u)return;const d={previousId:u,timestamp:s};r.userId&&(d.userId=r.userId);t.alias(d)}(g,f.alias,t,w,n,m),!0!==i?.silent){const e=(0,a.isString)(i?.name)?i.name:t.name,n=(0,a.isObject)(r)?r:{};g.track({...w,event:e,properties:n,timestamp:m})}d._state=y};function c(t){if((0,a.isString)(t)&&t.length>0)return t}function u(t){if(!t)return"";try{return JSON.stringify(t)}catch{return""}}var d={},p={type:"rudderstack",config:{},init({config:t,logger:e,env:i}){const r=function(t={},e){const i=t.settings||{},{writeKey:r,dataPlaneUrl:n}=i;r||e.throw("Config settings writeKey missing"),n||e.throw("Config settings dataPlaneUrl missing");const s={...i,writeKey:r,dataPlaneUrl:n,userId:i.userId??"user.id",anonymousId:i.anonymousId??"user.session"};return{...t,settings:s}}(t,e),n=r.settings,s=i?.analytics;if(!s)try{const t=require("@rudderstack/rudder-sdk-node"),{writeKey:e,dataPlaneUrl:i,userId:r,anonymousId:s,identify:a,group:o,integrations:c,_analytics:u,_state:d,...p}=n,l=new t(e,{dataPlaneUrl:i,...p});n._analytics=l}catch(t){e.throw(`Failed to initialize RudderStack SDK: ${t}`)}return n._state={},r},push:async(t,e)=>await o(t,e),async destroy({config:t}){const e=(t?.settings||{})._analytics;e&&await e.flush()}},l=p;//# sourceMappingURL=index.js.map