@walkeros/server-destination-rudderstack 4.8.2 → 4.8.3-next-1793115089237

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/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @walkeros/server-destination-rudderstack
2
2
 
3
+ ## 4.8.3-next-1793115089237
4
+
5
+ ### Patch Changes
6
+
7
+ - 5313635: The package publishes a minimal example: the data plane URL and a
8
+ write key, read as the `RUDDERSTACK_WRITE_KEY` secret. The docs page renders
9
+ the install line, the integrated code and the flow from it, and the package
10
+ test runs the same settings.
11
+ - 5313635: The `identify` and `group` descriptions now say when a call is
12
+ skipped, and `integrations` says that it has no effect. The `page` and
13
+ `screen` mapping descriptions now say that the name is optional, the `alias`
14
+ description that the call needs the event's userId, and the `maxQueueSize`
15
+ description gives its 450 KB default. Example timestamps are in milliseconds.
16
+ - Updated dependencies [34fd225]
17
+ - Updated dependencies [5313635]
18
+ - Updated dependencies [5313635]
19
+ - Updated dependencies [5313635]
20
+ - Updated dependencies [5313635]
21
+ - Updated dependencies [5313635]
22
+ - Updated dependencies [34fd225]
23
+ - Updated dependencies [5313635]
24
+ - @walkeros/core@4.8.3-next-1793115089237
25
+ - @walkeros/server-core@4.8.3-next-1793115089237
26
+
3
27
  ## 4.8.2
4
28
 
5
29
  ### Patch Changes
@@ -271,9 +295,6 @@
271
295
  and `event.context` remain required.
272
296
  - Each source self-registers via TypeScript module augmentation of `SourceMap`
273
297
  in `@walkeros/core`.
274
- - App-side coordination (`/workspaces/developer/app`) is a follow-up plan, not
275
- part of this release. Telemetry from v4 CLI/MCP will not validate against
276
- the existing app schema until that follow-up ships.
277
298
  - `Mapping.Rule.skip` is renamed to `Mapping.Rule.silent`. Customer flow.json
278
299
  configs using `skip: true` in mapping rules must rename to `silent: true`.
279
300
  Hard cut: no legacy alias, the field is gone.
package/README.md CHANGED
@@ -7,8 +7,7 @@
7
7
  # @walkeros/server-destination-rudderstack
8
8
 
9
9
  Server-side event delivery to RudderStack via the official rudder-sdk-node SDK,
10
- implementing the full Segment Spec surface with automatic identity
11
- deduplication.
10
+ sending the Segment Spec calls track, identify, group, page, screen, and alias.
12
11
 
13
12
  [Documentation](https://www.walkeros.io/docs/destinations/server/rudderstack)
14
13
  •
package/dist/dev.d.mts CHANGED
@@ -232,10 +232,17 @@ declare namespace step {
232
232
  export { type step_RudderStackStepExample as RudderStackStepExample, step_aliasUser as aliasUser, step_anonymousOnly as anonymousOnly, step_companyGroup as companyGroup, step_companyGroupWithoutData as companyGroupWithoutData, step_defaultTrack as defaultTrack, step_destinationIdentify as destinationIdentify, step_mappedEventName as mappedEventName, step_noIdentityCompany as noIdentityCompany, step_noIdentityLogin as noIdentityLogin, step_noIdentityMerge as noIdentityMerge, step_noIdentityOrder as noIdentityOrder, step_noIdentityPage as noIdentityPage, step_noIdentityProduct as noIdentityProduct, step_noIdentityScreen as noIdentityScreen, step_pageView as pageView, step_screenView as screenView, step_silentRule as silentRule, step_userLoginIdentify as userLoginIdentify, step_wildcardIgnored as wildcardIgnored };
233
233
  }
234
234
 
235
+ /**
236
+ * The settings RudderStack needs to deliver: the write key, read from the
237
+ * environment, and the data plane URL.
238
+ */
239
+ declare const minimal: Flow.MinimalExample;
240
+
235
241
  declare const index_env: typeof env;
242
+ declare const index_minimal: typeof minimal;
236
243
  declare const index_step: typeof step;
237
244
  declare namespace index {
238
- export { index_env as env, index_step as step };
245
+ export { index_env as env, index_minimal as minimal, index_step as step };
239
246
  }
240
247
 
241
248
  export { index as examples, index$1 as schemas };
package/dist/dev.d.ts CHANGED
@@ -232,10 +232,17 @@ declare namespace step {
232
232
  export { type step_RudderStackStepExample as RudderStackStepExample, step_aliasUser as aliasUser, step_anonymousOnly as anonymousOnly, step_companyGroup as companyGroup, step_companyGroupWithoutData as companyGroupWithoutData, step_defaultTrack as defaultTrack, step_destinationIdentify as destinationIdentify, step_mappedEventName as mappedEventName, step_noIdentityCompany as noIdentityCompany, step_noIdentityLogin as noIdentityLogin, step_noIdentityMerge as noIdentityMerge, step_noIdentityOrder as noIdentityOrder, step_noIdentityPage as noIdentityPage, step_noIdentityProduct as noIdentityProduct, step_noIdentityScreen as noIdentityScreen, step_pageView as pageView, step_screenView as screenView, step_silentRule as silentRule, step_userLoginIdentify as userLoginIdentify, step_wildcardIgnored as wildcardIgnored };
233
233
  }
234
234
 
235
+ /**
236
+ * The settings RudderStack needs to deliver: the write key, read from the
237
+ * environment, and the data plane URL.
238
+ */
239
+ declare const minimal: Flow.MinimalExample;
240
+
235
241
  declare const index_env: typeof env;
242
+ declare const index_minimal: typeof minimal;
236
243
  declare const index_step: typeof step;
237
244
  declare namespace index {
238
- export { index_env as env, index_step as step };
245
+ export { index_env as env, index_minimal as minimal, index_step as step };
239
246
  }
240
247
 
241
248
  export { index as examples, index$1 as schemas };
package/dist/dev.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e,t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,a=(e,s)=>{for(var n in s)t(e,n,{get:s[n],enumerable:!0})},r={};a(r,{examples:()=>y,schemas:()=>o}),module.exports=(e=r,((e,a,r,o)=>{if(a&&"object"==typeof a||"function"==typeof a)for(let l of n(a))i.call(e,l)||l===r||t(e,l,{get:()=>a[l],enumerable:!(o=s(a,l))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o={};a(o,{MappingSchema:()=>m,SettingsSchema:()=>u,mapping:()=>g,settings:()=>c});var l=require("@walkeros/core/dev"),d=require("@walkeros/core/dev"),u=d.z.object({writeKey:d.z.string().min(1).describe("RudderStack source write key. Find it in the RudderStack dashboard under Sources > Setup."),dataPlaneUrl:d.z.string().url().describe("RudderStack data plane URL. Required. Example: https://your-data-plane.rudderstack.com"),userId:d.z.string().describe("walkerOS mapping value path to resolve userId from each event (like user.id).").optional(),anonymousId:d.z.string().describe("walkerOS mapping value path to resolve anonymousId from each event (like user.session).").optional(),path:d.z.string().describe("API path route (like /v1/batch).").optional(),flushAt:d.z.number().int().positive().describe("Events the SDK sends in one request. Each push and each config.batch batch flushes the SDK and waits until its calls are sent. Default: 20.").optional(),flushInterval:d.z.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxQueueSize:d.z.number().int().positive().describe("Maximum batch payload size in bytes. Default: 460800 (~500KB).").optional(),maxInternalQueueSize:d.z.number().int().positive().describe("Maximum in-memory queue length. Default: 20000.").optional(),logLevel:d.z.string().describe("SDK log level: 'info', 'debug', 'error', or 'silly'. Default: 'info'.").optional(),retryCount:d.z.number().int().min(0).describe("Retries the SDK makes for a failed request, a tenth of config.timeout apart. Default: 2, which ends within config.timeout. A value set here wins.").optional(),timeout:d.z.number().int().positive().describe("Time one request may take, in milliseconds. Default: a quarter of config.timeout (2500 at the 10 s default). A value set here wins.").optional(),enable:d.z.boolean().describe("Set to false to no-op all SDK calls. Default: true.").optional(),gzip:d.z.boolean().describe("Enable gzip compression for requests. Default: true.").optional(),identify:d.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:d.z.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.").optional(),integrations:d.z.record(d.z.string(),d.z.unknown()).describe('Enable/disable downstream RudderStack destinations. Example: { "All": true, "Mixpanel": false }.').optional()}).strict(),p=require("@walkeros/core/dev"),m=p.z.object({identify:p.z.unknown().describe("Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level silent: true on login/identify events.").optional(),group:p.z.unknown().describe("Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level silent: true on company/team events.").optional(),page:p.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:p.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:p.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)(u),g=(0,l.zodToSchema)(m),y={};a(y,{env:()=>v,step:()=>b});var v={};a(v,{push:()=>h,simulation:()=>w});var f=(e,t)=>t?.();var h={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"],b={};a(b,{aliasUser:()=>P,anonymousOnly:()=>O,companyGroup:()=>R,companyGroupWithoutData:()=>T,defaultTrack:()=>k,destinationIdentify:()=>D,mappedEventName:()=>z,noIdentityCompany:()=>K,noIdentityLogin:()=>j,noIdentityMerge:()=>C,noIdentityOrder:()=>_,noIdentityPage:()=>U,noIdentityProduct:()=>x,noIdentityScreen:()=>M,pageView:()=>A,screenView:()=>E,silentRule:()=>G,userLoginIdentify:()=>S,wildcardIgnored:()=>L});var I=require("@walkeros/core"),k={title:"Default track",description:"A walker event becomes a RudderStack analytics.track call with userId and anonymousId resolved from the event.",in:(0,I.getEvent)("product view",{id:"ev1700000100",timestamp:1700000100,user:{id:"us3r",session:"s3ss10n"}}),out:[["analytics.track",{messageId:"ev1700000100",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,I.getEvent)("order complete",{id:"ev1700000101",timestamp:1700000101,user:{id:"us3r",session:"s3ss10n"}}),mapping:{name:"Order Completed"},out:[["analytics.track",{messageId:"ev1700000101",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,I.getEvent)("page view",{id:"ev1700000102",timestamp:1700000102,user:{id:"us3r",session:"s3ss10n",email:"user@example.com"}}),settings:{identify:{map:{traits:{map:{email:"user.email"}}}}},out:[["analytics.identify",{messageId:"ev1700000102-identify",userId:"us3r",anonymousId:"s3ss10n",traits:{email:"user@example.com"},timestamp:new Date(1700000102)}],["analytics.track",{messageId:"ev1700000102",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,I.createEvent)({name:"user login",id:"ev1700000103",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",{messageId:"ev1700000103-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,I.createEvent)({name:"company update",id:"ev1700000104",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",{messageId:"ev1700000104-group",userId:"us3r",anonymousId:"s3ss10n",groupId:"comp-456",traits:{name:"Acme",industry:"tech",employees:50},timestamp:new Date(1700000104)}]]},A={title:"Page view",description:"A page view fires analytics.page with a resolved page name and properties instead of a generic track.",in:(0,I.getEvent)("page view",{id:"ev1700000105",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",{messageId:"ev1700000105-page",userId:"us3r",anonymousId:"s3ss10n",name:"Getting Started",properties:{section:"tutorials"},timestamp:new Date(1700000105)}]]},E={title:"Screen view",description:"A screen view from a mobile app backend fires analytics.screen with a screen name and properties.",in:(0,I.createEvent)({name:"screen view",id:"ev1700000106",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",{messageId:"ev1700000106-screen",userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",properties:{build:"1.2.3"},timestamp:new Date(1700000106)}]]},P={title:"Alias user",description:"An identity merge fires analytics.alias to link a previous anonymous id to the newly registered user id.",in:(0,I.createEvent)({name:"identity merge",id:"ev1700000107",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",{messageId:"ev1700000107-alias",userId:"registered-456",previousId:"anonymous-123",timestamp:new Date(1700000107)}]]},O={title:"Anonymous only",description:"When no userId is resolved RudderStack accepts the track call keyed solely by anonymousId.",in:(0,I.getEvent)("product view",{id:"ev1700000108",timestamp:1700000108,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:[["analytics.track",{messageId:"ev1700000108",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108)}]]};function q(e,t){const[s,n]=e.split(" ");return{public:!1,description:`A ${e} event without userId or anonymousId cannot be sent to RudderStack: the push fails with missing-input instead of counting as delivered.`,in:{name:e,entity:s,action:n,timestamp:t},out:[],outcome:{status:"failed",code:"missing-input",retryable:!1}}}var x=q("product view",1700000110),_=q("order complete",1700000111),U=q("page view",1700000112),j=q("user login",1700000113),K=q("company update",1700000114),M=q("screen view",1700000115),C=q("identity merge",1700000116),G={public:!1,description:"A rule with silent: true and no identify, group, page, screen or alias mapping sends nothing to RudderStack.",in:(0,I.getEvent)("page view",{timestamp:1700000117,user:{id:"us3r",session:"s3ss10n"}}),mapping:{silent:!0},out:[]},L={public:!1,in:(0,I.createEvent)({name:"debug noise",timestamp:1700000109,user:{id:"us3r",session:"s3ss10n"}}),mapping:{ignore:!0},out:[]},T={public:!1,description:"A silent group rule whose groupId finds no data sends nothing: an unmet mapping, not a failure, so the push returns normally.",in:{name:"company update",entity:"company",action:"update",timestamp:1700000120,user:{id:"us3r",session:"s3ss10n"}},mapping:R.mapping,out:[]};//# sourceMappingURL=dev.js.map
1
+ "use strict";var e,t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,a=(e,s)=>{for(var i in s)t(e,i,{get:s[i],enumerable:!0})},r={};a(r,{examples:()=>y,schemas:()=>o}),module.exports=(e=r,((e,a,r,o)=>{if(a&&"object"==typeof a||"function"==typeof a)for(let d of i(a))n.call(e,d)||d===r||t(e,d,{get:()=>a[d],enumerable:!(o=s(a,d))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o={};a(o,{MappingSchema:()=>m,SettingsSchema:()=>l,mapping:()=>g,settings:()=>c});var d=require("@walkeros/core/dev"),u=require("@walkeros/core/dev"),l=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 the SDK sends in one request. Each push and each config.batch batch flushes the SDK and waits until its calls are sent. 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 (450 KB).").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("Retries the SDK makes for a failed request, a tenth of config.timeout apart. Default: 2, which ends within config.timeout. A value set here wins.").optional(),timeout:u.z.number().int().positive().describe("Time one request may take, in milliseconds. Default: a quarter of config.timeout (2500 at the 10 s default). A value set here wins.").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 { userId?, traits? }. identify() fires when the userId or traits differ from the previous identify call this destination sent; the anonymousId is not compared.").optional(),group:u.z.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits? }. group() fires when the groupId or traits differ from the previous group call this destination sent; the user is not compared.").optional(),integrations:u.z.record(u.z.string(),u.z.unknown()).describe("Has no effect: the destination does not add integrations to its calls.").optional()}).strict(),p=require("@walkeros/core/dev"),m=p.z.object({identify:p.z.unknown().describe("Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level silent: true on login/identify events.").optional(),group:p.z.unknown().describe("Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level silent: true on company/team events.").optional(),page:p.z.unknown().describe("Per-event page call. Resolves to { name?, properties? }, or true for a page() call without a name. Use with silent: true.").optional(),screen:p.z.unknown().describe("Per-event screen call (mobile backends). Resolves to { name?, properties? }, or true for a screen() call without a name. Use with silent: true.").optional(),alias:p.z.unknown().describe("Per-event alias call. Resolves to { previousId }. Links that anonymous id to the event userId, which the call needs: an event without a userId fails. Use with rule-level silent: true.").optional()}),c=(0,d.zodToSchema)(l),g=(0,d.zodToSchema)(m),y={};a(y,{env:()=>v,minimal:()=>G,step:()=>I});var v={};a(v,{push:()=>f,simulation:()=>w});var h=(e,t)=>t?.();var f={analytics:{track:h,identify:h,group:h,page:h,screen:h,alias:h,flush:()=>Promise.resolve()}},w=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen","call:analytics.alias"],I={};a(I,{aliasUser:()=>P,anonymousOnly:()=>O,companyGroup:()=>R,companyGroupWithoutData:()=>W,defaultTrack:()=>k,destinationIdentify:()=>z,mappedEventName:()=>D,noIdentityCompany:()=>j,noIdentityLogin:()=>x,noIdentityMerge:()=>L,noIdentityOrder:()=>K,noIdentityPage:()=>U,noIdentityProduct:()=>q,noIdentityScreen:()=>C,pageView:()=>A,screenView:()=>E,silentRule:()=>M,userLoginIdentify:()=>S,wildcardIgnored:()=>T});var b=require("@walkeros/core"),k={title:"Default track",description:"A walker event becomes a RudderStack analytics.track call with userId and anonymousId resolved from the event.",in:(0,b.getEvent)("product view",{id:"ev1700000100",timestamp:17000001e5,user:{id:"us3r",session:"s3ss10n"}}),out:[["analytics.track",{messageId:"ev1700000100",userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(17000001e5)}]]},D={title:"Renamed event",description:"A mapping renames the event so the RudderStack track call uses a canonical name such as Order Completed.",in:(0,b.getEvent)("order complete",{id:"ev1700000101",timestamp:1700000101e3,user:{id:"us3r",session:"s3ss10n"}}),mapping:{name:"Order Completed"},out:[["analytics.track",{messageId:"ev1700000101",userId:"us3r",anonymousId:"s3ss10n",event:"Order Completed",properties:{},timestamp:new Date(1700000101e3)}]]},z={title:"Destination identify",description:"With settings.identify mapping the email trait to 'user.email', the first push fires analytics.identify with the traits before the track call. Later pushes repeat it only when the userId or traits differ.",in:(0,b.getEvent)("page view",{id:"ev1700000102",timestamp:1700000102e3,user:{id:"us3r",session:"s3ss10n",email:"user@example.com"}}),settings:{identify:{map:{traits:{map:{email:"user.email"}}}}},out:[["analytics.identify",{messageId:"ev1700000102-identify",userId:"us3r",anonymousId:"s3ss10n",traits:{email:"user@example.com"},timestamp:new Date(1700000102e3)}],["analytics.track",{messageId:"ev1700000102",userId:"us3r",anonymousId:"s3ss10n",event:"page view",properties:{},timestamp:new Date(1700000102e3)}]]},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,b.createEvent)({name:"user login",id:"ev1700000103",timestamp:1700000103e3,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",{messageId:"ev1700000103-identify",userId:"new-user-123",anonymousId:"s3ss10n",traits:{email:"user@acme.com",name:"Jane Doe",plan:"premium"},timestamp:new Date(1700000103e3)}]]},R={title:"Group company",description:"A company update fires analytics.group with the groupId and group traits for B2B account tracking.",in:(0,b.createEvent)({name:"company update",id:"ev1700000104",timestamp:1700000104e3,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",{messageId:"ev1700000104-group",userId:"us3r",anonymousId:"s3ss10n",groupId:"comp-456",traits:{name:"Acme",industry:"tech",employees:50},timestamp:new Date(1700000104e3)}]]},A={title:"Page view",description:"A page view fires analytics.page with a resolved page name and properties instead of a generic track.",in:(0,b.getEvent)("page view",{id:"ev1700000105",timestamp:1700000105e3,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",{messageId:"ev1700000105-page",userId:"us3r",anonymousId:"s3ss10n",name:"Getting Started",properties:{section:"tutorials"},timestamp:new Date(1700000105e3)}]]},E={title:"Screen view",description:"A screen view from a mobile app backend fires analytics.screen with a screen name and properties.",in:(0,b.createEvent)({name:"screen view",id:"ev1700000106",timestamp:1700000106e3,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",{messageId:"ev1700000106-screen",userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",properties:{build:"1.2.3"},timestamp:new Date(1700000106e3)}]]},P={title:"Alias user",description:"An identity merge fires analytics.alias to link a previous anonymous id to the newly registered user id.",in:(0,b.createEvent)({name:"identity merge",id:"ev1700000107",timestamp:1700000107e3,user:{id:"registered-456",session:"s3ss10n"},data:{anonymous_id:"anonymous-123"}}),mapping:{silent:!0,settings:{alias:{map:{previousId:"data.anonymous_id"}}}},out:[["analytics.alias",{messageId:"ev1700000107-alias",userId:"registered-456",previousId:"anonymous-123",timestamp:new Date(1700000107e3)}]]},O={title:"Anonymous only",description:"When no userId is resolved RudderStack accepts the track call keyed solely by anonymousId.",in:(0,b.getEvent)("product view",{id:"ev1700000108",timestamp:1700000108e3,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:[["analytics.track",{messageId:"ev1700000108",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108e3)}]]};function _(e,t){const[s,i]=e.split(" ");return{public:!1,description:`A ${e} event without userId or anonymousId cannot be sent to RudderStack: the push fails with missing-input instead of counting as delivered.`,in:{name:e,entity:s,action:i,timestamp:t},out:[],outcome:{status:"failed",code:"missing-input",retryable:!1}}}var q=_("product view",1700000110),K=_("order complete",1700000111),U=_("page view",1700000112),x=_("user login",1700000113),j=_("company update",1700000114),C=_("screen view",1700000115),L=_("identity merge",1700000116),M={public:!1,description:"A rule with silent: true and no identify, group, page, screen or alias mapping sends nothing to RudderStack.",in:(0,b.getEvent)("page view",{timestamp:1700000117e3,user:{id:"us3r",session:"s3ss10n"}}),mapping:{silent:!0},out:[]},T={public:!1,in:(0,b.createEvent)({name:"debug noise",timestamp:1700000109e3,user:{id:"us3r",session:"s3ss10n"}}),mapping:{ignore:!0},out:[]},W={public:!1,description:"A silent group rule whose groupId finds no data sends nothing: an unmet mapping, not a failure, so the push returns normally.",in:{name:"company update",entity:"company",action:"update",timestamp:170000012e4,user:{id:"us3r",session:"s3ss10n"}},mapping:R.mapping,out:[]},G={settings:{writeKey:"test-write-key",dataPlaneUrl:"https://hosted.rudderlabs.com"},secrets:{writeKey:"RUDDERSTACK_WRITE_KEY"}};//# 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\n .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(\n 'Events the SDK sends in one request. Each push and each config.batch batch flushes the SDK and waits until its calls are sent. Default: 20.',\n )\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(\n 'Maximum batch payload size in bytes. Default: 460800 (~500KB).',\n )\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(\n 'Retries the SDK makes for a failed request, a tenth of config.timeout apart. Default: 2, which ends within config.timeout. A value set here wins.',\n )\n .optional(),\n timeout: z\n .number()\n .int()\n .positive()\n .describe(\n 'Time one request may take, in milliseconds. Default: a quarter of config.timeout (2500 at the 10 s default). A value set here wins.',\n )\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 .strict();\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 {\n Env,\n RudderStackAnalyticsMock,\n RudderStackCallback,\n} from '../types';\n\n/** Every call is sent: its callback answers without an error. */\nconst sent = (_params: unknown, callback?: RudderStackCallback) => callback?.();\nconst asyncNoop = () => Promise.resolve();\n\nfunction createMockAnalytics(): RudderStackAnalyticsMock {\n return {\n track: sent,\n identify: sent,\n group: sent,\n page: sent,\n screen: sent,\n alias: sent,\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 { createEvent, 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 id: 'ev1700000100',\n timestamp: 1700000100,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n out: [\n [\n 'analytics.track',\n {\n messageId: 'ev1700000100',\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 id: 'ev1700000101',\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 messageId: 'ev1700000101',\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 id: 'ev1700000102',\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 messageId: 'ev1700000102-identify',\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 messageId: 'ev1700000102',\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: createEvent({\n name: 'user login',\n id: 'ev1700000103',\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 messageId: 'ev1700000103-identify',\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: createEvent({\n name: 'company update',\n id: 'ev1700000104',\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 messageId: 'ev1700000104-group',\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 id: 'ev1700000105',\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 messageId: 'ev1700000105-page',\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: createEvent({\n name: 'screen view',\n id: 'ev1700000106',\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 messageId: 'ev1700000106-screen',\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: createEvent({\n name: 'identity merge',\n id: 'ev1700000107',\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 messageId: 'ev1700000107-alias',\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 id: 'ev1700000108',\n timestamp: 1700000108,\n user: { session: 's3ss10n' },\n }),\n settings: {\n userId: undefined,\n },\n out: [\n [\n 'analytics.track',\n {\n messageId: 'ev1700000108',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000108),\n },\n ],\n ],\n};\n\n/**\n * No identity -- neither userId nor anonymousId resolves from the event, so\n * RudderStack cannot take it: the push fails with missing-input instead of\n * counting as delivered. One per event name above, so every example's event\n * without identity has its declared outcome.\n */\nfunction withoutIdentity(\n name: string,\n timestamp: number,\n): RudderStackStepExample {\n const [entity, action] = name.split(' ');\n return {\n public: false,\n description: `A ${name} event without userId or anonymousId cannot be sent to RudderStack: the push fails with missing-input instead of counting as delivered.`,\n in: { name, entity, action, timestamp },\n out: [],\n outcome: { status: 'failed', code: 'missing-input', retryable: false },\n };\n}\n\nexport const noIdentityProduct = withoutIdentity('product view', 1700000110);\nexport const noIdentityOrder = withoutIdentity('order complete', 1700000111);\nexport const noIdentityPage = withoutIdentity('page view', 1700000112);\nexport const noIdentityLogin = withoutIdentity('user login', 1700000113);\nexport const noIdentityCompany = withoutIdentity('company update', 1700000114);\nexport const noIdentityScreen = withoutIdentity('screen view', 1700000115);\nexport const noIdentityMerge = withoutIdentity('identity merge', 1700000116);\n\n/** A silent rule without identify, group, page, screen or alias calls nothing. */\nexport const silentRule: RudderStackStepExample = {\n public: false,\n description:\n 'A rule with silent: true and no identify, group, page, screen or alias mapping sends nothing to RudderStack.',\n in: getEvent('page view', {\n timestamp: 1700000117,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: { silent: true },\n out: [],\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: createEvent({\n name: 'debug noise',\n timestamp: 1700000109,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * The silent group rule of companyGroup on an event without company data: no\n * groupId resolves and the rule suppresses the track, so nothing is sent.\n */\nexport const companyGroupWithoutData: RudderStackStepExample = {\n public: false,\n description:\n 'A silent group rule whose groupId finds no data sends nothing: an unmet mapping, not a failure, so the push returns normally.',\n in: {\n name: 'company update',\n entity: 'company',\n action: 'update',\n timestamp: 1700000120,\n user: { id: 'us3r', session: 's3ss10n' },\n },\n mapping: companyGroup.mapping,\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,aAC3B,OAAO;AAAA,EACN,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,EAAE,SAAS;AAAA,EACvE,SAAS,aACN,OAAO,EACP,IAAI,EACJ,SAAS,EACT;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,eAAe,aACZ,OAAO,EACP,IAAI,EACJ,SAAS,EACT,S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AAQ;AAAA,EACR,aACE;AAAA,EACF,IAAI;AAAA,IACF,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,EACzC;AAAA,EACA,SAAS,aAAa;AAAA,EACtB,KAAK,CAAC;AACR;","names":["import_dev","import_dev"]}
1
+ {"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts","../src/examples/minimal.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\n .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(\n 'Events the SDK sends in one request. Each push and each config.batch batch flushes the SDK and waits until its calls are sent. Default: 20.',\n )\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(\n 'Maximum batch payload size in bytes. Default: 460800 (450 KB).',\n )\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(\n 'Retries the SDK makes for a failed request, a tenth of config.timeout apart. Default: 2, which ends within config.timeout. A value set here wins.',\n )\n .optional(),\n timeout: z\n .number()\n .int()\n .positive()\n .describe(\n 'Time one request may take, in milliseconds. Default: a quarter of config.timeout (2500 at the 10 s default). A value set here wins.',\n )\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 { userId?, traits? }. identify() fires when the userId or traits differ from the previous identify call this destination sent; the anonymousId is not compared.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Destination-level group mapping. Resolves to { groupId, traits? }. group() fires when the groupId or traits differ from the previous group call this destination sent; the user is not compared.',\n )\n .optional(),\n integrations: z\n .record(z.string(), z.unknown())\n .describe(\n 'Has no effect: the destination does not add integrations to its calls.',\n )\n .optional(),\n })\n .strict();\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 a page() call without a name. 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 a screen() call without a name. Use with silent: true.',\n )\n .optional(),\n alias: z\n .unknown()\n .describe(\n 'Per-event alias call. Resolves to { previousId }. Links that anonymous id to the event userId, which the call needs: an event without a userId fails. 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';\nexport { minimal } from './minimal';\n","import type {\n Env,\n RudderStackAnalyticsMock,\n RudderStackCallback,\n} from '../types';\n\n/** Every call is sent: its callback answers without an error. */\nconst sent = (_params: unknown, callback?: RudderStackCallback) => callback?.();\nconst asyncNoop = () => Promise.resolve();\n\nfunction createMockAnalytics(): RudderStackAnalyticsMock {\n return {\n track: sent,\n identify: sent,\n group: sent,\n page: sent,\n screen: sent,\n alias: sent,\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 { createEvent, 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 id: 'ev1700000100',\n timestamp: 1700000100000,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n out: [\n [\n 'analytics.track',\n {\n messageId: 'ev1700000100',\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000100000),\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 id: 'ev1700000101',\n timestamp: 1700000101000,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: {\n name: 'Order Completed',\n },\n out: [\n [\n 'analytics.track',\n {\n messageId: 'ev1700000101',\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'Order Completed',\n properties: {},\n timestamp: new Date(1700000101000),\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 \"With settings.identify mapping the email trait to 'user.email', the first push fires analytics.identify with the traits before the track call. Later pushes repeat it only when the userId or traits differ.\",\n in: getEvent('page view', {\n id: 'ev1700000102',\n timestamp: 1700000102000,\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 messageId: 'ev1700000102-identify',\n userId: 'us3r',\n anonymousId: 's3ss10n',\n traits: { email: 'user@example.com' },\n timestamp: new Date(1700000102000),\n },\n ],\n [\n 'analytics.track',\n {\n messageId: 'ev1700000102',\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'page view',\n properties: {},\n timestamp: new Date(1700000102000),\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: createEvent({\n name: 'user login',\n id: 'ev1700000103',\n timestamp: 1700000103000,\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 messageId: 'ev1700000103-identify',\n userId: 'new-user-123',\n anonymousId: 's3ss10n',\n traits: { email: 'user@acme.com', name: 'Jane Doe', plan: 'premium' },\n timestamp: new Date(1700000103000),\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: createEvent({\n name: 'company update',\n id: 'ev1700000104',\n timestamp: 1700000104000,\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 messageId: 'ev1700000104-group',\n userId: 'us3r',\n anonymousId: 's3ss10n',\n groupId: 'comp-456',\n traits: { name: 'Acme', industry: 'tech', employees: 50 },\n timestamp: new Date(1700000104000),\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 id: 'ev1700000105',\n timestamp: 1700000105000,\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 messageId: 'ev1700000105-page',\n userId: 'us3r',\n anonymousId: 's3ss10n',\n name: 'Getting Started',\n properties: { section: 'tutorials' },\n timestamp: new Date(1700000105000),\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: createEvent({\n name: 'screen view',\n id: 'ev1700000106',\n timestamp: 1700000106000,\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 messageId: 'ev1700000106-screen',\n userId: 'us3r',\n anonymousId: 's3ss10n',\n name: 'Welcome',\n properties: { build: '1.2.3' },\n timestamp: new Date(1700000106000),\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: createEvent({\n name: 'identity merge',\n id: 'ev1700000107',\n timestamp: 1700000107000,\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 messageId: 'ev1700000107-alias',\n userId: 'registered-456',\n previousId: 'anonymous-123',\n timestamp: new Date(1700000107000),\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 id: 'ev1700000108',\n timestamp: 1700000108000,\n user: { session: 's3ss10n' },\n }),\n settings: {\n userId: undefined,\n },\n out: [\n [\n 'analytics.track',\n {\n messageId: 'ev1700000108',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000108000),\n },\n ],\n ],\n};\n\n/**\n * No identity -- neither userId nor anonymousId resolves from the event, so\n * RudderStack cannot take it: the push fails with missing-input instead of\n * counting as delivered. One per event name above, so every example's event\n * without identity has its declared outcome.\n */\nfunction withoutIdentity(\n name: string,\n timestamp: number,\n): RudderStackStepExample {\n const [entity, action] = name.split(' ');\n return {\n public: false,\n description: `A ${name} event without userId or anonymousId cannot be sent to RudderStack: the push fails with missing-input instead of counting as delivered.`,\n in: { name, entity, action, timestamp },\n out: [],\n outcome: { status: 'failed', code: 'missing-input', retryable: false },\n };\n}\n\nexport const noIdentityProduct = withoutIdentity('product view', 1700000110);\nexport const noIdentityOrder = withoutIdentity('order complete', 1700000111);\nexport const noIdentityPage = withoutIdentity('page view', 1700000112);\nexport const noIdentityLogin = withoutIdentity('user login', 1700000113);\nexport const noIdentityCompany = withoutIdentity('company update', 1700000114);\nexport const noIdentityScreen = withoutIdentity('screen view', 1700000115);\nexport const noIdentityMerge = withoutIdentity('identity merge', 1700000116);\n\n/** A silent rule without identify, group, page, screen or alias calls nothing. */\nexport const silentRule: RudderStackStepExample = {\n public: false,\n description:\n 'A rule with silent: true and no identify, group, page, screen or alias mapping sends nothing to RudderStack.',\n in: getEvent('page view', {\n timestamp: 1700000117000,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: { silent: true },\n out: [],\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: createEvent({\n name: 'debug noise',\n timestamp: 1700000109000,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * The silent group rule of companyGroup on an event without company data: no\n * groupId resolves and the rule suppresses the track, so nothing is sent.\n */\nexport const companyGroupWithoutData: RudderStackStepExample = {\n public: false,\n description:\n 'A silent group rule whose groupId finds no data sends nothing: an unmet mapping, not a failure, so the push returns normally.',\n in: {\n name: 'company update',\n entity: 'company',\n action: 'update',\n timestamp: 1700000120000,\n user: { id: 'us3r', session: 's3ss10n' },\n },\n mapping: companyGroup.mapping,\n out: [],\n};\n","import type { Flow } from '@walkeros/core';\n\n/**\n * The settings RudderStack needs to deliver: the write key, read from the\n * environment, and the data plane URL.\n */\nexport const minimal: Flow.MinimalExample = {\n settings: {\n writeKey: 'test-write-key',\n dataPlaneUrl: 'https://hosted.rudderlabs.com',\n },\n secrets: { writeKey: 'RUDDERSTACK_WRITE_KEY' },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAC3B,OAAO;AAAA,EACN,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,E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AAAA,EACxB,KAAK,CAAC;AACR;AAMO,IAAM,kBAA0C;AAAA,EACrD,QAAQ;AAAA,EACR,QAAI,yBAAY;AAAA,IACd,MAAM;AAAA,IACN,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,EACzC,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;AAMO,IAAM,0BAAkD;AAAA,EAC7D,QAAQ;AAAA,EACR,aACE;AAAA,EACF,IAAI;AAAA,IACF,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,EACzC;AAAA,EACA,SAAS,aAAa;AAAA,EACtB,KAAK,CAAC;AACR;;;AC9cO,IAAM,UAA+B;AAAA,EAC1C,UAAU;AAAA,IACR,UAAU;AAAA,IACV,cAAc;AAAA,EAChB;AAAA,EACA,SAAS,EAAE,UAAU,wBAAwB;AAC/C;","names":["import_dev","import_dev"]}
package/dist/dev.mjs CHANGED
@@ -1 +1 @@
1
- import{createRequire as e}from"module";e(import.meta.url);var t=Object.defineProperty,s=(e,s)=>{for(var i in s)t(e,i,{get:s[i],enumerable:!0})},i={};s(i,{MappingSchema:()=>l,SettingsSchema:()=>r,mapping:()=>u,settings:()=>d});import{zodToSchema as n}from"@walkeros/core/dev";import{z as a}from"@walkeros/core/dev";var r=a.object({writeKey:a.string().min(1).describe("RudderStack source write key. Find it in the RudderStack dashboard under Sources > Setup."),dataPlaneUrl:a.string().url().describe("RudderStack data plane URL. Required. Example: https://your-data-plane.rudderstack.com"),userId:a.string().describe("walkerOS mapping value path to resolve userId from each event (like user.id).").optional(),anonymousId:a.string().describe("walkerOS mapping value path to resolve anonymousId from each event (like user.session).").optional(),path:a.string().describe("API path route (like /v1/batch).").optional(),flushAt:a.number().int().positive().describe("Events the SDK sends in one request. Each push and each config.batch batch flushes the SDK and waits until its calls are sent. Default: 20.").optional(),flushInterval:a.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxQueueSize:a.number().int().positive().describe("Maximum batch payload size in bytes. Default: 460800 (~500KB).").optional(),maxInternalQueueSize:a.number().int().positive().describe("Maximum in-memory queue length. Default: 20000.").optional(),logLevel:a.string().describe("SDK log level: 'info', 'debug', 'error', or 'silly'. Default: 'info'.").optional(),retryCount:a.number().int().min(0).describe("Retries the SDK makes for a failed request, a tenth of config.timeout apart. Default: 2, which ends within config.timeout. A value set here wins.").optional(),timeout:a.number().int().positive().describe("Time one request may take, in milliseconds. Default: a quarter of config.timeout (2500 at the 10 s default). A value set here wins.").optional(),enable:a.boolean().describe("Set to false to no-op all SDK calls. Default: true.").optional(),gzip:a.boolean().describe("Enable gzip compression for requests. Default: true.").optional(),identify:a.unknown().describe("Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.").optional(),group:a.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.").optional(),integrations:a.record(a.string(),a.unknown()).describe('Enable/disable downstream RudderStack destinations. Example: { "All": true, "Mixpanel": false }.').optional()}).strict();import{z as o}from"@walkeros/core/dev";var l=o.object({identify:o.unknown().describe("Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level silent: true on login/identify events.").optional(),group:o.unknown().describe("Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level silent: true on company/team events.").optional(),page:o.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:o.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:o.unknown().describe("Per-event alias call. Resolves to { previousId }. Links anonymous user to identified user. Use with rule-level silent: true.").optional()}),d=n(r),u=n(l),p={};s(p,{env:()=>m,step:()=>v});var m={};s(m,{push:()=>g,simulation:()=>y});var c=(e,t)=>t?.();var g={analytics:{track:c,identify:c,group:c,page:c,screen:c,alias:c,flush:()=>Promise.resolve()}},y=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen","call:analytics.alias"],v={};s(v,{aliasUser:()=>A,anonymousOnly:()=>x,companyGroup:()=>D,companyGroupWithoutData:()=>G,defaultTrack:()=>w,destinationIdentify:()=>I,mappedEventName:()=>b,noIdentityCompany:()=>E,noIdentityLogin:()=>O,noIdentityMerge:()=>z,noIdentityOrder:()=>q,noIdentityPage:()=>U,noIdentityProduct:()=>_,noIdentityScreen:()=>K,pageView:()=>S,screenView:()=>R,silentRule:()=>M,userLoginIdentify:()=>k,wildcardIgnored:()=>C});import{createEvent as f,getEvent as h}from"@walkeros/core";var w={title:"Default track",description:"A walker event becomes a RudderStack analytics.track call with userId and anonymousId resolved from the event.",in:h("product view",{id:"ev1700000100",timestamp:1700000100,user:{id:"us3r",session:"s3ss10n"}}),out:[["analytics.track",{messageId:"ev1700000100",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:h("order complete",{id:"ev1700000101",timestamp:1700000101,user:{id:"us3r",session:"s3ss10n"}}),mapping:{name:"Order Completed"},out:[["analytics.track",{messageId:"ev1700000101",userId:"us3r",anonymousId:"s3ss10n",event:"Order Completed",properties:{},timestamp:new Date(1700000101)}]]},I={title:"Destination identify",description:"Destination-level identify fires analytics.identify with traits on the first push only, then the track call follows.",in:h("page view",{id:"ev1700000102",timestamp:1700000102,user:{id:"us3r",session:"s3ss10n",email:"user@example.com"}}),settings:{identify:{map:{traits:{map:{email:"user.email"}}}}},out:[["analytics.identify",{messageId:"ev1700000102-identify",userId:"us3r",anonymousId:"s3ss10n",traits:{email:"user@example.com"},timestamp:new Date(1700000102)}],["analytics.track",{messageId:"ev1700000102",userId:"us3r",anonymousId:"s3ss10n",event:"page view",properties:{},timestamp:new Date(1700000102)}]]},k={title:"User login identify",description:"A user login fires only an analytics.identify call with the resolved userId and traits, skipping the track.",in:f({name:"user login",id:"ev1700000103",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",{messageId:"ev1700000103-identify",userId:"new-user-123",anonymousId:"s3ss10n",traits:{email:"user@acme.com",name:"Jane Doe",plan:"premium"},timestamp:new Date(1700000103)}]]},D={title:"Group company",description:"A company update fires analytics.group with the groupId and group traits for B2B account tracking.",in:f({name:"company update",id:"ev1700000104",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",{messageId:"ev1700000104-group",userId:"us3r",anonymousId:"s3ss10n",groupId:"comp-456",traits:{name:"Acme",industry:"tech",employees:50},timestamp:new Date(1700000104)}]]},S={title:"Page view",description:"A page view fires analytics.page with a resolved page name and properties instead of a generic track.",in:h("page view",{id:"ev1700000105",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",{messageId:"ev1700000105-page",userId:"us3r",anonymousId:"s3ss10n",name:"Getting Started",properties:{section:"tutorials"},timestamp:new Date(1700000105)}]]},R={title:"Screen view",description:"A screen view from a mobile app backend fires analytics.screen with a screen name and properties.",in:f({name:"screen view",id:"ev1700000106",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",{messageId:"ev1700000106-screen",userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",properties:{build:"1.2.3"},timestamp:new Date(1700000106)}]]},A={title:"Alias user",description:"An identity merge fires analytics.alias to link a previous anonymous id to the newly registered user id.",in:f({name:"identity merge",id:"ev1700000107",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",{messageId:"ev1700000107-alias",userId:"registered-456",previousId:"anonymous-123",timestamp:new Date(1700000107)}]]},x={title:"Anonymous only",description:"When no userId is resolved RudderStack accepts the track call keyed solely by anonymousId.",in:h("product view",{id:"ev1700000108",timestamp:1700000108,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:[["analytics.track",{messageId:"ev1700000108",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108)}]]};function P(e,t){const[s,i]=e.split(" ");return{public:!1,description:`A ${e} event without userId or anonymousId cannot be sent to RudderStack: the push fails with missing-input instead of counting as delivered.`,in:{name:e,entity:s,action:i,timestamp:t},out:[],outcome:{status:"failed",code:"missing-input",retryable:!1}}}var _=P("product view",1700000110),q=P("order complete",1700000111),U=P("page view",1700000112),O=P("user login",1700000113),E=P("company update",1700000114),K=P("screen view",1700000115),z=P("identity merge",1700000116),M={public:!1,description:"A rule with silent: true and no identify, group, page, screen or alias mapping sends nothing to RudderStack.",in:h("page view",{timestamp:1700000117,user:{id:"us3r",session:"s3ss10n"}}),mapping:{silent:!0},out:[]},C={public:!1,in:f({name:"debug noise",timestamp:1700000109,user:{id:"us3r",session:"s3ss10n"}}),mapping:{ignore:!0},out:[]},G={public:!1,description:"A silent group rule whose groupId finds no data sends nothing: an unmet mapping, not a failure, so the push returns normally.",in:{name:"company update",entity:"company",action:"update",timestamp:1700000120,user:{id:"us3r",session:"s3ss10n"}},mapping:D.mapping,out:[]};export{p as examples,i as schemas};//# sourceMappingURL=dev.mjs.map
1
+ import{createRequire as e}from"module";e(import.meta.url);var t=Object.defineProperty,s=(e,s)=>{for(var i in s)t(e,i,{get:s[i],enumerable:!0})},i={};s(i,{MappingSchema:()=>d,SettingsSchema:()=>r,mapping:()=>u,settings:()=>l});import{zodToSchema as a}from"@walkeros/core/dev";import{z as n}from"@walkeros/core/dev";var r=n.object({writeKey:n.string().min(1).describe("RudderStack source write key. Find it in the RudderStack dashboard under Sources > Setup."),dataPlaneUrl:n.string().url().describe("RudderStack data plane URL. Required. Example: https://your-data-plane.rudderstack.com"),userId:n.string().describe("walkerOS mapping value path to resolve userId from each event (like user.id).").optional(),anonymousId:n.string().describe("walkerOS mapping value path to resolve anonymousId from each event (like user.session).").optional(),path:n.string().describe("API path route (like /v1/batch).").optional(),flushAt:n.number().int().positive().describe("Events the SDK sends in one request. Each push and each config.batch batch flushes the SDK and waits until its calls are sent. Default: 20.").optional(),flushInterval:n.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxQueueSize:n.number().int().positive().describe("Maximum batch payload size in bytes. Default: 460800 (450 KB).").optional(),maxInternalQueueSize:n.number().int().positive().describe("Maximum in-memory queue length. Default: 20000.").optional(),logLevel:n.string().describe("SDK log level: 'info', 'debug', 'error', or 'silly'. Default: 'info'.").optional(),retryCount:n.number().int().min(0).describe("Retries the SDK makes for a failed request, a tenth of config.timeout apart. Default: 2, which ends within config.timeout. A value set here wins.").optional(),timeout:n.number().int().positive().describe("Time one request may take, in milliseconds. Default: a quarter of config.timeout (2500 at the 10 s default). A value set here wins.").optional(),enable:n.boolean().describe("Set to false to no-op all SDK calls. Default: true.").optional(),gzip:n.boolean().describe("Enable gzip compression for requests. Default: true.").optional(),identify:n.unknown().describe("Destination-level identity mapping. Resolves to { userId?, traits? }. identify() fires when the userId or traits differ from the previous identify call this destination sent; the anonymousId is not compared.").optional(),group:n.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits? }. group() fires when the groupId or traits differ from the previous group call this destination sent; the user is not compared.").optional(),integrations:n.record(n.string(),n.unknown()).describe("Has no effect: the destination does not add integrations to its calls.").optional()}).strict();import{z as o}from"@walkeros/core/dev";var d=o.object({identify:o.unknown().describe("Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level silent: true on login/identify events.").optional(),group:o.unknown().describe("Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level silent: true on company/team events.").optional(),page:o.unknown().describe("Per-event page call. Resolves to { name?, properties? }, or true for a page() call without a name. Use with silent: true.").optional(),screen:o.unknown().describe("Per-event screen call (mobile backends). Resolves to { name?, properties? }, or true for a screen() call without a name. Use with silent: true.").optional(),alias:o.unknown().describe("Per-event alias call. Resolves to { previousId }. Links that anonymous id to the event userId, which the call needs: an event without a userId fails. Use with rule-level silent: true.").optional()}),l=a(r),u=a(d),p={};s(p,{env:()=>m,minimal:()=>G,step:()=>v});var m={};s(m,{push:()=>g,simulation:()=>y});var c=(e,t)=>t?.();var g={analytics:{track:c,identify:c,group:c,page:c,screen:c,alias:c,flush:()=>Promise.resolve()}},y=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen","call:analytics.alias"],v={};s(v,{aliasUser:()=>A,anonymousOnly:()=>P,companyGroup:()=>D,companyGroupWithoutData:()=>W,defaultTrack:()=>w,destinationIdentify:()=>b,mappedEventName:()=>I,noIdentityCompany:()=>O,noIdentityLogin:()=>E,noIdentityMerge:()=>z,noIdentityOrder:()=>U,noIdentityPage:()=>x,noIdentityProduct:()=>K,noIdentityScreen:()=>q,pageView:()=>S,screenView:()=>R,silentRule:()=>C,userLoginIdentify:()=>k,wildcardIgnored:()=>L});import{createEvent as h,getEvent as f}from"@walkeros/core";var w={title:"Default track",description:"A walker event becomes a RudderStack analytics.track call with userId and anonymousId resolved from the event.",in:f("product view",{id:"ev1700000100",timestamp:17000001e5,user:{id:"us3r",session:"s3ss10n"}}),out:[["analytics.track",{messageId:"ev1700000100",userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(17000001e5)}]]},I={title:"Renamed event",description:"A mapping renames the event so the RudderStack track call uses a canonical name such as Order Completed.",in:f("order complete",{id:"ev1700000101",timestamp:1700000101e3,user:{id:"us3r",session:"s3ss10n"}}),mapping:{name:"Order Completed"},out:[["analytics.track",{messageId:"ev1700000101",userId:"us3r",anonymousId:"s3ss10n",event:"Order Completed",properties:{},timestamp:new Date(1700000101e3)}]]},b={title:"Destination identify",description:"With settings.identify mapping the email trait to 'user.email', the first push fires analytics.identify with the traits before the track call. Later pushes repeat it only when the userId or traits differ.",in:f("page view",{id:"ev1700000102",timestamp:1700000102e3,user:{id:"us3r",session:"s3ss10n",email:"user@example.com"}}),settings:{identify:{map:{traits:{map:{email:"user.email"}}}}},out:[["analytics.identify",{messageId:"ev1700000102-identify",userId:"us3r",anonymousId:"s3ss10n",traits:{email:"user@example.com"},timestamp:new Date(1700000102e3)}],["analytics.track",{messageId:"ev1700000102",userId:"us3r",anonymousId:"s3ss10n",event:"page view",properties:{},timestamp:new Date(1700000102e3)}]]},k={title:"User login identify",description:"A user login fires only an analytics.identify call with the resolved userId and traits, skipping the track.",in:h({name:"user login",id:"ev1700000103",timestamp:1700000103e3,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",{messageId:"ev1700000103-identify",userId:"new-user-123",anonymousId:"s3ss10n",traits:{email:"user@acme.com",name:"Jane Doe",plan:"premium"},timestamp:new Date(1700000103e3)}]]},D={title:"Group company",description:"A company update fires analytics.group with the groupId and group traits for B2B account tracking.",in:h({name:"company update",id:"ev1700000104",timestamp:1700000104e3,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",{messageId:"ev1700000104-group",userId:"us3r",anonymousId:"s3ss10n",groupId:"comp-456",traits:{name:"Acme",industry:"tech",employees:50},timestamp:new Date(1700000104e3)}]]},S={title:"Page view",description:"A page view fires analytics.page with a resolved page name and properties instead of a generic track.",in:f("page view",{id:"ev1700000105",timestamp:1700000105e3,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",{messageId:"ev1700000105-page",userId:"us3r",anonymousId:"s3ss10n",name:"Getting Started",properties:{section:"tutorials"},timestamp:new Date(1700000105e3)}]]},R={title:"Screen view",description:"A screen view from a mobile app backend fires analytics.screen with a screen name and properties.",in:h({name:"screen view",id:"ev1700000106",timestamp:1700000106e3,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",{messageId:"ev1700000106-screen",userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",properties:{build:"1.2.3"},timestamp:new Date(1700000106e3)}]]},A={title:"Alias user",description:"An identity merge fires analytics.alias to link a previous anonymous id to the newly registered user id.",in:h({name:"identity merge",id:"ev1700000107",timestamp:1700000107e3,user:{id:"registered-456",session:"s3ss10n"},data:{anonymous_id:"anonymous-123"}}),mapping:{silent:!0,settings:{alias:{map:{previousId:"data.anonymous_id"}}}},out:[["analytics.alias",{messageId:"ev1700000107-alias",userId:"registered-456",previousId:"anonymous-123",timestamp:new Date(1700000107e3)}]]},P={title:"Anonymous only",description:"When no userId is resolved RudderStack accepts the track call keyed solely by anonymousId.",in:f("product view",{id:"ev1700000108",timestamp:1700000108e3,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:[["analytics.track",{messageId:"ev1700000108",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108e3)}]]};function _(e,t){const[s,i]=e.split(" ");return{public:!1,description:`A ${e} event without userId or anonymousId cannot be sent to RudderStack: the push fails with missing-input instead of counting as delivered.`,in:{name:e,entity:s,action:i,timestamp:t},out:[],outcome:{status:"failed",code:"missing-input",retryable:!1}}}var K=_("product view",1700000110),U=_("order complete",1700000111),x=_("page view",1700000112),E=_("user login",1700000113),O=_("company update",1700000114),q=_("screen view",1700000115),z=_("identity merge",1700000116),C={public:!1,description:"A rule with silent: true and no identify, group, page, screen or alias mapping sends nothing to RudderStack.",in:f("page view",{timestamp:1700000117e3,user:{id:"us3r",session:"s3ss10n"}}),mapping:{silent:!0},out:[]},L={public:!1,in:h({name:"debug noise",timestamp:1700000109e3,user:{id:"us3r",session:"s3ss10n"}}),mapping:{ignore:!0},out:[]},W={public:!1,description:"A silent group rule whose groupId finds no data sends nothing: an unmet mapping, not a failure, so the push returns normally.",in:{name:"company update",entity:"company",action:"update",timestamp:170000012e4,user:{id:"us3r",session:"s3ss10n"}},mapping:D.mapping,out:[]},G={settings:{writeKey:"test-write-key",dataPlaneUrl:"https://hosted.rudderlabs.com"},secrets:{writeKey:"RUDDERSTACK_WRITE_KEY"}};export{p as examples,i as schemas};//# sourceMappingURL=dev.mjs.map
package/dist/dev.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/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\n .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(\n 'Events the SDK sends in one request. Each push and each config.batch batch flushes the SDK and waits until its calls are sent. Default: 20.',\n )\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(\n 'Maximum batch payload size in bytes. Default: 460800 (~500KB).',\n )\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(\n 'Retries the SDK makes for a failed request, a tenth of config.timeout apart. Default: 2, which ends within config.timeout. A value set here wins.',\n )\n .optional(),\n timeout: z\n .number()\n .int()\n .positive()\n .describe(\n 'Time one request may take, in milliseconds. Default: a quarter of config.timeout (2500 at the 10 s default). A value set here wins.',\n )\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 .strict();\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 {\n Env,\n RudderStackAnalyticsMock,\n RudderStackCallback,\n} from '../types';\n\n/** Every call is sent: its callback answers without an error. */\nconst sent = (_params: unknown, callback?: RudderStackCallback) => callback?.();\nconst asyncNoop = () => Promise.resolve();\n\nfunction createMockAnalytics(): RudderStackAnalyticsMock {\n return {\n track: sent,\n identify: sent,\n group: sent,\n page: sent,\n screen: sent,\n alias: sent,\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 { createEvent, 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 id: 'ev1700000100',\n timestamp: 1700000100,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n out: [\n [\n 'analytics.track',\n {\n messageId: 'ev1700000100',\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 id: 'ev1700000101',\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 messageId: 'ev1700000101',\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 id: 'ev1700000102',\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 messageId: 'ev1700000102-identify',\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 messageId: 'ev1700000102',\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: createEvent({\n name: 'user login',\n id: 'ev1700000103',\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 messageId: 'ev1700000103-identify',\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: createEvent({\n name: 'company update',\n id: 'ev1700000104',\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 messageId: 'ev1700000104-group',\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 id: 'ev1700000105',\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 messageId: 'ev1700000105-page',\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: createEvent({\n name: 'screen view',\n id: 'ev1700000106',\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 messageId: 'ev1700000106-screen',\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: createEvent({\n name: 'identity merge',\n id: 'ev1700000107',\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 messageId: 'ev1700000107-alias',\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 id: 'ev1700000108',\n timestamp: 1700000108,\n user: { session: 's3ss10n' },\n }),\n settings: {\n userId: undefined,\n },\n out: [\n [\n 'analytics.track',\n {\n messageId: 'ev1700000108',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000108),\n },\n ],\n ],\n};\n\n/**\n * No identity -- neither userId nor anonymousId resolves from the event, so\n * RudderStack cannot take it: the push fails with missing-input instead of\n * counting as delivered. One per event name above, so every example's event\n * without identity has its declared outcome.\n */\nfunction withoutIdentity(\n name: string,\n timestamp: number,\n): RudderStackStepExample {\n const [entity, action] = name.split(' ');\n return {\n public: false,\n description: `A ${name} event without userId or anonymousId cannot be sent to RudderStack: the push fails with missing-input instead of counting as delivered.`,\n in: { name, entity, action, timestamp },\n out: [],\n outcome: { status: 'failed', code: 'missing-input', retryable: false },\n };\n}\n\nexport const noIdentityProduct = withoutIdentity('product view', 1700000110);\nexport const noIdentityOrder = withoutIdentity('order complete', 1700000111);\nexport const noIdentityPage = withoutIdentity('page view', 1700000112);\nexport const noIdentityLogin = withoutIdentity('user login', 1700000113);\nexport const noIdentityCompany = withoutIdentity('company update', 1700000114);\nexport const noIdentityScreen = withoutIdentity('screen view', 1700000115);\nexport const noIdentityMerge = withoutIdentity('identity merge', 1700000116);\n\n/** A silent rule without identify, group, page, screen or alias calls nothing. */\nexport const silentRule: RudderStackStepExample = {\n public: false,\n description:\n 'A rule with silent: true and no identify, group, page, screen or alias mapping sends nothing to RudderStack.',\n in: getEvent('page view', {\n timestamp: 1700000117,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: { silent: true },\n out: [],\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: createEvent({\n name: 'debug noise',\n timestamp: 1700000109,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * The silent group rule of companyGroup on an event without company data: no\n * groupId resolves and the rule suppresses the track, so nothing is sent.\n */\nexport const companyGroupWithoutData: RudderStackStepExample = {\n public: false,\n description:\n 'A silent group rule whose groupId finds no data sends nothing: an unmet mapping, not a failure, so the push returns normally.',\n in: {\n name: 'company update',\n entity: 'company',\n action: 'update',\n timestamp: 1700000120,\n user: { id: 'us3r', session: 's3ss10n' },\n },\n mapping: companyGroup.mapping,\n out: [],\n};\n"],"mappings":";;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,i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AAkB,UAAU;AAGpE,IAAM,aAAqC;AAAA,EAChD,QAAQ;AAAA,EACR,aACE;AAAA,EACF,IAAI,SAAS,aAAa;AAAA,IACxB,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,EACzC,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;AAMO,IAAM,kBAA0C;AAAA,EACrD,QAAQ;AAAA,EACR,IAAI,YAAY;AAAA,IACd,MAAM;AAAA,IACN,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,EACzC,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;AAMO,IAAM,0BAAkD;AAAA,EAC7D,QAAQ;AAAA,EACR,aACE;AAAA,EACF,IAAI;AAAA,IACF,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,EACzC;AAAA,EACA,SAAS,aAAa;AAAA,EACtB,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","../src/examples/minimal.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\n .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(\n 'Events the SDK sends in one request. Each push and each config.batch batch flushes the SDK and waits until its calls are sent. Default: 20.',\n )\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(\n 'Maximum batch payload size in bytes. Default: 460800 (450 KB).',\n )\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(\n 'Retries the SDK makes for a failed request, a tenth of config.timeout apart. Default: 2, which ends within config.timeout. A value set here wins.',\n )\n .optional(),\n timeout: z\n .number()\n .int()\n .positive()\n .describe(\n 'Time one request may take, in milliseconds. Default: a quarter of config.timeout (2500 at the 10 s default). A value set here wins.',\n )\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 { userId?, traits? }. identify() fires when the userId or traits differ from the previous identify call this destination sent; the anonymousId is not compared.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Destination-level group mapping. Resolves to { groupId, traits? }. group() fires when the groupId or traits differ from the previous group call this destination sent; the user is not compared.',\n )\n .optional(),\n integrations: z\n .record(z.string(), z.unknown())\n .describe(\n 'Has no effect: the destination does not add integrations to its calls.',\n )\n .optional(),\n })\n .strict();\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 a page() call without a name. 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 a screen() call without a name. Use with silent: true.',\n )\n .optional(),\n alias: z\n .unknown()\n .describe(\n 'Per-event alias call. Resolves to { previousId }. Links that anonymous id to the event userId, which the call needs: an event without a userId fails. 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';\nexport { minimal } from './minimal';\n","import type {\n Env,\n RudderStackAnalyticsMock,\n RudderStackCallback,\n} from '../types';\n\n/** Every call is sent: its callback answers without an error. */\nconst sent = (_params: unknown, callback?: RudderStackCallback) => callback?.();\nconst asyncNoop = () => Promise.resolve();\n\nfunction createMockAnalytics(): RudderStackAnalyticsMock {\n return {\n track: sent,\n identify: sent,\n group: sent,\n page: sent,\n screen: sent,\n alias: sent,\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 { createEvent, 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 id: 'ev1700000100',\n timestamp: 1700000100000,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n out: [\n [\n 'analytics.track',\n {\n messageId: 'ev1700000100',\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000100000),\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 id: 'ev1700000101',\n timestamp: 1700000101000,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: {\n name: 'Order Completed',\n },\n out: [\n [\n 'analytics.track',\n {\n messageId: 'ev1700000101',\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'Order Completed',\n properties: {},\n timestamp: new Date(1700000101000),\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 \"With settings.identify mapping the email trait to 'user.email', the first push fires analytics.identify with the traits before the track call. Later pushes repeat it only when the userId or traits differ.\",\n in: getEvent('page view', {\n id: 'ev1700000102',\n timestamp: 1700000102000,\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 messageId: 'ev1700000102-identify',\n userId: 'us3r',\n anonymousId: 's3ss10n',\n traits: { email: 'user@example.com' },\n timestamp: new Date(1700000102000),\n },\n ],\n [\n 'analytics.track',\n {\n messageId: 'ev1700000102',\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'page view',\n properties: {},\n timestamp: new Date(1700000102000),\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: createEvent({\n name: 'user login',\n id: 'ev1700000103',\n timestamp: 1700000103000,\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 messageId: 'ev1700000103-identify',\n userId: 'new-user-123',\n anonymousId: 's3ss10n',\n traits: { email: 'user@acme.com', name: 'Jane Doe', plan: 'premium' },\n timestamp: new Date(1700000103000),\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: createEvent({\n name: 'company update',\n id: 'ev1700000104',\n timestamp: 1700000104000,\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 messageId: 'ev1700000104-group',\n userId: 'us3r',\n anonymousId: 's3ss10n',\n groupId: 'comp-456',\n traits: { name: 'Acme', industry: 'tech', employees: 50 },\n timestamp: new Date(1700000104000),\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 id: 'ev1700000105',\n timestamp: 1700000105000,\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 messageId: 'ev1700000105-page',\n userId: 'us3r',\n anonymousId: 's3ss10n',\n name: 'Getting Started',\n properties: { section: 'tutorials' },\n timestamp: new Date(1700000105000),\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: createEvent({\n name: 'screen view',\n id: 'ev1700000106',\n timestamp: 1700000106000,\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 messageId: 'ev1700000106-screen',\n userId: 'us3r',\n anonymousId: 's3ss10n',\n name: 'Welcome',\n properties: { build: '1.2.3' },\n timestamp: new Date(1700000106000),\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: createEvent({\n name: 'identity merge',\n id: 'ev1700000107',\n timestamp: 1700000107000,\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 messageId: 'ev1700000107-alias',\n userId: 'registered-456',\n previousId: 'anonymous-123',\n timestamp: new Date(1700000107000),\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 id: 'ev1700000108',\n timestamp: 1700000108000,\n user: { session: 's3ss10n' },\n }),\n settings: {\n userId: undefined,\n },\n out: [\n [\n 'analytics.track',\n {\n messageId: 'ev1700000108',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000108000),\n },\n ],\n ],\n};\n\n/**\n * No identity -- neither userId nor anonymousId resolves from the event, so\n * RudderStack cannot take it: the push fails with missing-input instead of\n * counting as delivered. One per event name above, so every example's event\n * without identity has its declared outcome.\n */\nfunction withoutIdentity(\n name: string,\n timestamp: number,\n): RudderStackStepExample {\n const [entity, action] = name.split(' ');\n return {\n public: false,\n description: `A ${name} event without userId or anonymousId cannot be sent to RudderStack: the push fails with missing-input instead of counting as delivered.`,\n in: { name, entity, action, timestamp },\n out: [],\n outcome: { status: 'failed', code: 'missing-input', retryable: false },\n };\n}\n\nexport const noIdentityProduct = withoutIdentity('product view', 1700000110);\nexport const noIdentityOrder = withoutIdentity('order complete', 1700000111);\nexport const noIdentityPage = withoutIdentity('page view', 1700000112);\nexport const noIdentityLogin = withoutIdentity('user login', 1700000113);\nexport const noIdentityCompany = withoutIdentity('company update', 1700000114);\nexport const noIdentityScreen = withoutIdentity('screen view', 1700000115);\nexport const noIdentityMerge = withoutIdentity('identity merge', 1700000116);\n\n/** A silent rule without identify, group, page, screen or alias calls nothing. */\nexport const silentRule: RudderStackStepExample = {\n public: false,\n description:\n 'A rule with silent: true and no identify, group, page, screen or alias mapping sends nothing to RudderStack.',\n in: getEvent('page view', {\n timestamp: 1700000117000,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: { silent: true },\n out: [],\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: createEvent({\n name: 'debug noise',\n timestamp: 1700000109000,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * The silent group rule of companyGroup on an event without company data: no\n * groupId resolves and the rule suppresses the track, so nothing is sent.\n */\nexport const companyGroupWithoutData: RudderStackStepExample = {\n public: false,\n description:\n 'A silent group rule whose groupId finds no data sends nothing: an unmet mapping, not a failure, so the push returns normally.',\n in: {\n name: 'company update',\n entity: 'company',\n action: 'update',\n timestamp: 1700000120000,\n user: { id: 'us3r', session: 's3ss10n' },\n },\n mapping: companyGroup.mapping,\n out: [],\n};\n","import type { Flow } from '@walkeros/core';\n\n/**\n * The settings RudderStack needs to deliver: the write key, read from the\n * environment, and the data plane URL.\n */\nexport const minimal: Flow.MinimalExample = {\n settings: {\n writeKey: 'test-write-key',\n dataPlaneU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pE,IAAM,iBAAiB,gBAAgB,aAAa,UAAU;AAC9D,IAAM,kBAAkB,gBAAgB,cAAc,UAAU;AAChE,IAAM,oBAAoB,gBAAgB,kBAAkB,UAAU;AACtE,IAAM,mBAAmB,gBAAgB,eAAe,UAAU;AAClE,IAAM,kBAAkB,gBAAgB,kBAAkB,UAAU;AAGpE,IAAM,aAAqC;AAAA,EAChD,QAAQ;AAAA,EACR,aACE;AAAA,EACF,IAAI,SAAS,aAAa;AAAA,IACxB,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,EACzC,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;AAMO,IAAM,kBAA0C;AAAA,EACrD,QAAQ;AAAA,EACR,IAAI,YAAY;AAAA,IACd,MAAM;AAAA,IACN,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,EACzC,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;AAMO,IAAM,0BAAkD;AAAA,EAC7D,QAAQ;AAAA,EACR,aACE;AAAA,EACF,IAAI;AAAA,IACF,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,EACzC;AAAA,EACA,SAAS,aAAa;AAAA,EACtB,KAAK,CAAC;AACR;;;AC9cO,IAAM,UAA+B;AAAA,EAC1C,UAAU;AAAA,IACR,UAAU;AAAA,IACV,cAAc;AAAA,EAChB;AAAA,EACA,SAAS,EAAE,UAAU,wBAAwB;AAC/C;","names":["z"]}
@@ -188,4 +188,10 @@ declare namespace step {
188
188
  export { type step_RudderStackStepExample as RudderStackStepExample, step_aliasUser as aliasUser, step_anonymousOnly as anonymousOnly, step_companyGroup as companyGroup, step_companyGroupWithoutData as companyGroupWithoutData, step_defaultTrack as defaultTrack, step_destinationIdentify as destinationIdentify, step_mappedEventName as mappedEventName, step_noIdentityCompany as noIdentityCompany, step_noIdentityLogin as noIdentityLogin, step_noIdentityMerge as noIdentityMerge, step_noIdentityOrder as noIdentityOrder, step_noIdentityPage as noIdentityPage, step_noIdentityProduct as noIdentityProduct, step_noIdentityScreen as noIdentityScreen, step_pageView as pageView, step_screenView as screenView, step_silentRule as silentRule, step_userLoginIdentify as userLoginIdentify, step_wildcardIgnored as wildcardIgnored };
189
189
  }
190
190
 
191
- export { env, step };
191
+ /**
192
+ * The settings RudderStack needs to deliver: the write key, read from the
193
+ * environment, and the data plane URL.
194
+ */
195
+ declare const minimal: Flow.MinimalExample;
196
+
197
+ export { env, minimal, step };
@@ -188,4 +188,10 @@ declare namespace step {
188
188
  export { type step_RudderStackStepExample as RudderStackStepExample, step_aliasUser as aliasUser, step_anonymousOnly as anonymousOnly, step_companyGroup as companyGroup, step_companyGroupWithoutData as companyGroupWithoutData, step_defaultTrack as defaultTrack, step_destinationIdentify as destinationIdentify, step_mappedEventName as mappedEventName, step_noIdentityCompany as noIdentityCompany, step_noIdentityLogin as noIdentityLogin, step_noIdentityMerge as noIdentityMerge, step_noIdentityOrder as noIdentityOrder, step_noIdentityPage as noIdentityPage, step_noIdentityProduct as noIdentityProduct, step_noIdentityScreen as noIdentityScreen, step_pageView as pageView, step_screenView as screenView, step_silentRule as silentRule, step_userLoginIdentify as userLoginIdentify, step_wildcardIgnored as wildcardIgnored };
189
189
  }
190
190
 
191
- export { env, step };
191
+ /**
192
+ * The settings RudderStack needs to deliver: the write key, read from the
193
+ * environment, and the data plane URL.
194
+ */
195
+ declare const minimal: Flow.MinimalExample;
196
+
197
+ export { env, minimal, step };
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var examples_exports = {};
22
22
  __export(examples_exports, {
23
23
  env: () => env_exports,
24
+ minimal: () => minimal,
24
25
  step: () => step_exports
25
26
  });
26
27
  module.exports = __toCommonJS(examples_exports);
@@ -85,7 +86,7 @@ var defaultTrack = {
85
86
  description: "A walker event becomes a RudderStack analytics.track call with userId and anonymousId resolved from the event.",
86
87
  in: (0, import_core.getEvent)("product view", {
87
88
  id: "ev1700000100",
88
- timestamp: 1700000100,
89
+ timestamp: 17000001e5,
89
90
  user: { id: "us3r", session: "s3ss10n" }
90
91
  }),
91
92
  out: [
@@ -97,7 +98,7 @@ var defaultTrack = {
97
98
  anonymousId: "s3ss10n",
98
99
  event: "product view",
99
100
  properties: {},
100
- timestamp: /* @__PURE__ */ new Date(1700000100)
101
+ timestamp: /* @__PURE__ */ new Date(17000001e5)
101
102
  }
102
103
  ]
103
104
  ]
@@ -107,7 +108,7 @@ var mappedEventName = {
107
108
  description: "A mapping renames the event so the RudderStack track call uses a canonical name such as Order Completed.",
108
109
  in: (0, import_core.getEvent)("order complete", {
109
110
  id: "ev1700000101",
110
- timestamp: 1700000101,
111
+ timestamp: 1700000101e3,
111
112
  user: { id: "us3r", session: "s3ss10n" }
112
113
  }),
113
114
  mapping: {
@@ -122,17 +123,17 @@ var mappedEventName = {
122
123
  anonymousId: "s3ss10n",
123
124
  event: "Order Completed",
124
125
  properties: {},
125
- timestamp: /* @__PURE__ */ new Date(1700000101)
126
+ timestamp: /* @__PURE__ */ new Date(1700000101e3)
126
127
  }
127
128
  ]
128
129
  ]
129
130
  };
130
131
  var destinationIdentify = {
131
132
  title: "Destination identify",
132
- description: "Destination-level identify fires analytics.identify with traits on the first push only, then the track call follows.",
133
+ description: "With settings.identify mapping the email trait to 'user.email', the first push fires analytics.identify with the traits before the track call. Later pushes repeat it only when the userId or traits differ.",
133
134
  in: (0, import_core.getEvent)("page view", {
134
135
  id: "ev1700000102",
135
- timestamp: 1700000102,
136
+ timestamp: 1700000102e3,
136
137
  user: { id: "us3r", session: "s3ss10n", email: "user@example.com" }
137
138
  }),
138
139
  settings: {
@@ -154,7 +155,7 @@ var destinationIdentify = {
154
155
  userId: "us3r",
155
156
  anonymousId: "s3ss10n",
156
157
  traits: { email: "user@example.com" },
157
- timestamp: /* @__PURE__ */ new Date(1700000102)
158
+ timestamp: /* @__PURE__ */ new Date(1700000102e3)
158
159
  }
159
160
  ],
160
161
  [
@@ -165,7 +166,7 @@ var destinationIdentify = {
165
166
  anonymousId: "s3ss10n",
166
167
  event: "page view",
167
168
  properties: {},
168
- timestamp: /* @__PURE__ */ new Date(1700000102)
169
+ timestamp: /* @__PURE__ */ new Date(1700000102e3)
169
170
  }
170
171
  ]
171
172
  ]
@@ -176,7 +177,7 @@ var userLoginIdentify = {
176
177
  in: (0, import_core.createEvent)({
177
178
  name: "user login",
178
179
  id: "ev1700000103",
179
- timestamp: 1700000103,
180
+ timestamp: 1700000103e3,
180
181
  user: { id: "us3r", session: "s3ss10n" },
181
182
  data: {
182
183
  user_id: "new-user-123",
@@ -210,7 +211,7 @@ var userLoginIdentify = {
210
211
  userId: "new-user-123",
211
212
  anonymousId: "s3ss10n",
212
213
  traits: { email: "user@acme.com", name: "Jane Doe", plan: "premium" },
213
- timestamp: /* @__PURE__ */ new Date(1700000103)
214
+ timestamp: /* @__PURE__ */ new Date(1700000103e3)
214
215
  }
215
216
  ]
216
217
  ]
@@ -221,7 +222,7 @@ var companyGroup = {
221
222
  in: (0, import_core.createEvent)({
222
223
  name: "company update",
223
224
  id: "ev1700000104",
224
- timestamp: 1700000104,
225
+ timestamp: 1700000104e3,
225
226
  user: { id: "us3r", session: "s3ss10n" },
226
227
  data: {
227
228
  company_id: "comp-456",
@@ -256,7 +257,7 @@ var companyGroup = {
256
257
  anonymousId: "s3ss10n",
257
258
  groupId: "comp-456",
258
259
  traits: { name: "Acme", industry: "tech", employees: 50 },
259
- timestamp: /* @__PURE__ */ new Date(1700000104)
260
+ timestamp: /* @__PURE__ */ new Date(1700000104e3)
260
261
  }
261
262
  ]
262
263
  ]
@@ -266,7 +267,7 @@ var pageView = {
266
267
  description: "A page view fires analytics.page with a resolved page name and properties instead of a generic track.",
267
268
  in: (0, import_core.getEvent)("page view", {
268
269
  id: "ev1700000105",
269
- timestamp: 1700000105,
270
+ timestamp: 1700000105e3,
270
271
  user: { id: "us3r", session: "s3ss10n" },
271
272
  data: {
272
273
  title: "Getting Started",
@@ -297,7 +298,7 @@ var pageView = {
297
298
  anonymousId: "s3ss10n",
298
299
  name: "Getting Started",
299
300
  properties: { section: "tutorials" },
300
- timestamp: /* @__PURE__ */ new Date(1700000105)
301
+ timestamp: /* @__PURE__ */ new Date(1700000105e3)
301
302
  }
302
303
  ]
303
304
  ]
@@ -308,7 +309,7 @@ var screenView = {
308
309
  in: (0, import_core.createEvent)({
309
310
  name: "screen view",
310
311
  id: "ev1700000106",
311
- timestamp: 1700000106,
312
+ timestamp: 1700000106e3,
312
313
  user: { id: "us3r", session: "s3ss10n" },
313
314
  data: {
314
315
  screen_name: "Welcome",
@@ -340,7 +341,7 @@ var screenView = {
340
341
  anonymousId: "s3ss10n",
341
342
  name: "Welcome",
342
343
  properties: { build: "1.2.3" },
343
- timestamp: /* @__PURE__ */ new Date(1700000106)
344
+ timestamp: /* @__PURE__ */ new Date(1700000106e3)
344
345
  }
345
346
  ]
346
347
  ]
@@ -351,7 +352,7 @@ var aliasUser = {
351
352
  in: (0, import_core.createEvent)({
352
353
  name: "identity merge",
353
354
  id: "ev1700000107",
354
- timestamp: 1700000107,
355
+ timestamp: 1700000107e3,
355
356
  user: { id: "registered-456", session: "s3ss10n" },
356
357
  data: {
357
358
  anonymous_id: "anonymous-123"
@@ -374,7 +375,7 @@ var aliasUser = {
374
375
  messageId: "ev1700000107-alias",
375
376
  userId: "registered-456",
376
377
  previousId: "anonymous-123",
377
- timestamp: /* @__PURE__ */ new Date(1700000107)
378
+ timestamp: /* @__PURE__ */ new Date(1700000107e3)
378
379
  }
379
380
  ]
380
381
  ]
@@ -384,7 +385,7 @@ var anonymousOnly = {
384
385
  description: "When no userId is resolved RudderStack accepts the track call keyed solely by anonymousId.",
385
386
  in: (0, import_core.getEvent)("product view", {
386
387
  id: "ev1700000108",
387
- timestamp: 1700000108,
388
+ timestamp: 1700000108e3,
388
389
  user: { session: "s3ss10n" }
389
390
  }),
390
391
  settings: {
@@ -398,7 +399,7 @@ var anonymousOnly = {
398
399
  anonymousId: "s3ss10n",
399
400
  event: "product view",
400
401
  properties: {},
401
- timestamp: /* @__PURE__ */ new Date(1700000108)
402
+ timestamp: /* @__PURE__ */ new Date(1700000108e3)
402
403
  }
403
404
  ]
404
405
  ]
@@ -424,7 +425,7 @@ var silentRule = {
424
425
  public: false,
425
426
  description: "A rule with silent: true and no identify, group, page, screen or alias mapping sends nothing to RudderStack.",
426
427
  in: (0, import_core.getEvent)("page view", {
427
- timestamp: 1700000117,
428
+ timestamp: 1700000117e3,
428
429
  user: { id: "us3r", session: "s3ss10n" }
429
430
  }),
430
431
  mapping: { silent: true },
@@ -434,7 +435,7 @@ var wildcardIgnored = {
434
435
  public: false,
435
436
  in: (0, import_core.createEvent)({
436
437
  name: "debug noise",
437
- timestamp: 1700000109,
438
+ timestamp: 1700000109e3,
438
439
  user: { id: "us3r", session: "s3ss10n" }
439
440
  }),
440
441
  mapping: { ignore: true },
@@ -447,14 +448,24 @@ var companyGroupWithoutData = {
447
448
  name: "company update",
448
449
  entity: "company",
449
450
  action: "update",
450
- timestamp: 1700000120,
451
+ timestamp: 170000012e4,
451
452
  user: { id: "us3r", session: "s3ss10n" }
452
453
  },
453
454
  mapping: companyGroup.mapping,
454
455
  out: []
455
456
  };
457
+
458
+ // src/examples/minimal.ts
459
+ var minimal = {
460
+ settings: {
461
+ writeKey: "test-write-key",
462
+ dataPlaneUrl: "https://hosted.rudderlabs.com"
463
+ },
464
+ secrets: { writeKey: "RUDDERSTACK_WRITE_KEY" }
465
+ };
456
466
  // Annotate the CommonJS export names for ESM import in node:
457
467
  0 && (module.exports = {
458
468
  env,
469
+ minimal,
459
470
  step
460
471
  });
@@ -64,7 +64,7 @@ var defaultTrack = {
64
64
  description: "A walker event becomes a RudderStack analytics.track call with userId and anonymousId resolved from the event.",
65
65
  in: getEvent("product view", {
66
66
  id: "ev1700000100",
67
- timestamp: 1700000100,
67
+ timestamp: 17000001e5,
68
68
  user: { id: "us3r", session: "s3ss10n" }
69
69
  }),
70
70
  out: [
@@ -76,7 +76,7 @@ var defaultTrack = {
76
76
  anonymousId: "s3ss10n",
77
77
  event: "product view",
78
78
  properties: {},
79
- timestamp: /* @__PURE__ */ new Date(1700000100)
79
+ timestamp: /* @__PURE__ */ new Date(17000001e5)
80
80
  }
81
81
  ]
82
82
  ]
@@ -86,7 +86,7 @@ var mappedEventName = {
86
86
  description: "A mapping renames the event so the RudderStack track call uses a canonical name such as Order Completed.",
87
87
  in: getEvent("order complete", {
88
88
  id: "ev1700000101",
89
- timestamp: 1700000101,
89
+ timestamp: 1700000101e3,
90
90
  user: { id: "us3r", session: "s3ss10n" }
91
91
  }),
92
92
  mapping: {
@@ -101,17 +101,17 @@ var mappedEventName = {
101
101
  anonymousId: "s3ss10n",
102
102
  event: "Order Completed",
103
103
  properties: {},
104
- timestamp: /* @__PURE__ */ new Date(1700000101)
104
+ timestamp: /* @__PURE__ */ new Date(1700000101e3)
105
105
  }
106
106
  ]
107
107
  ]
108
108
  };
109
109
  var destinationIdentify = {
110
110
  title: "Destination identify",
111
- description: "Destination-level identify fires analytics.identify with traits on the first push only, then the track call follows.",
111
+ description: "With settings.identify mapping the email trait to 'user.email', the first push fires analytics.identify with the traits before the track call. Later pushes repeat it only when the userId or traits differ.",
112
112
  in: getEvent("page view", {
113
113
  id: "ev1700000102",
114
- timestamp: 1700000102,
114
+ timestamp: 1700000102e3,
115
115
  user: { id: "us3r", session: "s3ss10n", email: "user@example.com" }
116
116
  }),
117
117
  settings: {
@@ -133,7 +133,7 @@ var destinationIdentify = {
133
133
  userId: "us3r",
134
134
  anonymousId: "s3ss10n",
135
135
  traits: { email: "user@example.com" },
136
- timestamp: /* @__PURE__ */ new Date(1700000102)
136
+ timestamp: /* @__PURE__ */ new Date(1700000102e3)
137
137
  }
138
138
  ],
139
139
  [
@@ -144,7 +144,7 @@ var destinationIdentify = {
144
144
  anonymousId: "s3ss10n",
145
145
  event: "page view",
146
146
  properties: {},
147
- timestamp: /* @__PURE__ */ new Date(1700000102)
147
+ timestamp: /* @__PURE__ */ new Date(1700000102e3)
148
148
  }
149
149
  ]
150
150
  ]
@@ -155,7 +155,7 @@ var userLoginIdentify = {
155
155
  in: createEvent({
156
156
  name: "user login",
157
157
  id: "ev1700000103",
158
- timestamp: 1700000103,
158
+ timestamp: 1700000103e3,
159
159
  user: { id: "us3r", session: "s3ss10n" },
160
160
  data: {
161
161
  user_id: "new-user-123",
@@ -189,7 +189,7 @@ var userLoginIdentify = {
189
189
  userId: "new-user-123",
190
190
  anonymousId: "s3ss10n",
191
191
  traits: { email: "user@acme.com", name: "Jane Doe", plan: "premium" },
192
- timestamp: /* @__PURE__ */ new Date(1700000103)
192
+ timestamp: /* @__PURE__ */ new Date(1700000103e3)
193
193
  }
194
194
  ]
195
195
  ]
@@ -200,7 +200,7 @@ var companyGroup = {
200
200
  in: createEvent({
201
201
  name: "company update",
202
202
  id: "ev1700000104",
203
- timestamp: 1700000104,
203
+ timestamp: 1700000104e3,
204
204
  user: { id: "us3r", session: "s3ss10n" },
205
205
  data: {
206
206
  company_id: "comp-456",
@@ -235,7 +235,7 @@ var companyGroup = {
235
235
  anonymousId: "s3ss10n",
236
236
  groupId: "comp-456",
237
237
  traits: { name: "Acme", industry: "tech", employees: 50 },
238
- timestamp: /* @__PURE__ */ new Date(1700000104)
238
+ timestamp: /* @__PURE__ */ new Date(1700000104e3)
239
239
  }
240
240
  ]
241
241
  ]
@@ -245,7 +245,7 @@ var pageView = {
245
245
  description: "A page view fires analytics.page with a resolved page name and properties instead of a generic track.",
246
246
  in: getEvent("page view", {
247
247
  id: "ev1700000105",
248
- timestamp: 1700000105,
248
+ timestamp: 1700000105e3,
249
249
  user: { id: "us3r", session: "s3ss10n" },
250
250
  data: {
251
251
  title: "Getting Started",
@@ -276,7 +276,7 @@ var pageView = {
276
276
  anonymousId: "s3ss10n",
277
277
  name: "Getting Started",
278
278
  properties: { section: "tutorials" },
279
- timestamp: /* @__PURE__ */ new Date(1700000105)
279
+ timestamp: /* @__PURE__ */ new Date(1700000105e3)
280
280
  }
281
281
  ]
282
282
  ]
@@ -287,7 +287,7 @@ var screenView = {
287
287
  in: createEvent({
288
288
  name: "screen view",
289
289
  id: "ev1700000106",
290
- timestamp: 1700000106,
290
+ timestamp: 1700000106e3,
291
291
  user: { id: "us3r", session: "s3ss10n" },
292
292
  data: {
293
293
  screen_name: "Welcome",
@@ -319,7 +319,7 @@ var screenView = {
319
319
  anonymousId: "s3ss10n",
320
320
  name: "Welcome",
321
321
  properties: { build: "1.2.3" },
322
- timestamp: /* @__PURE__ */ new Date(1700000106)
322
+ timestamp: /* @__PURE__ */ new Date(1700000106e3)
323
323
  }
324
324
  ]
325
325
  ]
@@ -330,7 +330,7 @@ var aliasUser = {
330
330
  in: createEvent({
331
331
  name: "identity merge",
332
332
  id: "ev1700000107",
333
- timestamp: 1700000107,
333
+ timestamp: 1700000107e3,
334
334
  user: { id: "registered-456", session: "s3ss10n" },
335
335
  data: {
336
336
  anonymous_id: "anonymous-123"
@@ -353,7 +353,7 @@ var aliasUser = {
353
353
  messageId: "ev1700000107-alias",
354
354
  userId: "registered-456",
355
355
  previousId: "anonymous-123",
356
- timestamp: /* @__PURE__ */ new Date(1700000107)
356
+ timestamp: /* @__PURE__ */ new Date(1700000107e3)
357
357
  }
358
358
  ]
359
359
  ]
@@ -363,7 +363,7 @@ var anonymousOnly = {
363
363
  description: "When no userId is resolved RudderStack accepts the track call keyed solely by anonymousId.",
364
364
  in: getEvent("product view", {
365
365
  id: "ev1700000108",
366
- timestamp: 1700000108,
366
+ timestamp: 1700000108e3,
367
367
  user: { session: "s3ss10n" }
368
368
  }),
369
369
  settings: {
@@ -377,7 +377,7 @@ var anonymousOnly = {
377
377
  anonymousId: "s3ss10n",
378
378
  event: "product view",
379
379
  properties: {},
380
- timestamp: /* @__PURE__ */ new Date(1700000108)
380
+ timestamp: /* @__PURE__ */ new Date(1700000108e3)
381
381
  }
382
382
  ]
383
383
  ]
@@ -403,7 +403,7 @@ var silentRule = {
403
403
  public: false,
404
404
  description: "A rule with silent: true and no identify, group, page, screen or alias mapping sends nothing to RudderStack.",
405
405
  in: getEvent("page view", {
406
- timestamp: 1700000117,
406
+ timestamp: 1700000117e3,
407
407
  user: { id: "us3r", session: "s3ss10n" }
408
408
  }),
409
409
  mapping: { silent: true },
@@ -413,7 +413,7 @@ var wildcardIgnored = {
413
413
  public: false,
414
414
  in: createEvent({
415
415
  name: "debug noise",
416
- timestamp: 1700000109,
416
+ timestamp: 1700000109e3,
417
417
  user: { id: "us3r", session: "s3ss10n" }
418
418
  }),
419
419
  mapping: { ignore: true },
@@ -426,13 +426,23 @@ var companyGroupWithoutData = {
426
426
  name: "company update",
427
427
  entity: "company",
428
428
  action: "update",
429
- timestamp: 1700000120,
429
+ timestamp: 170000012e4,
430
430
  user: { id: "us3r", session: "s3ss10n" }
431
431
  },
432
432
  mapping: companyGroup.mapping,
433
433
  out: []
434
434
  };
435
+
436
+ // src/examples/minimal.ts
437
+ var minimal = {
438
+ settings: {
439
+ writeKey: "test-write-key",
440
+ dataPlaneUrl: "https://hosted.rudderlabs.com"
441
+ },
442
+ secrets: { writeKey: "RUDDERSTACK_WRITE_KEY" }
443
+ };
435
444
  export {
436
445
  env_exports as env,
446
+ minimal,
437
447
  step_exports as step
438
448
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$meta": {
3
3
  "package": "@walkeros/server-destination-rudderstack",
4
- "version": "4.8.2",
4
+ "version": "4.8.3-next-1793115089237",
5
5
  "type": "destination",
6
6
  "platform": [
7
7
  "server"
@@ -22,13 +22,13 @@
22
22
  "description": "Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level silent: true on company/team events."
23
23
  },
24
24
  "page": {
25
- "description": "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."
25
+ "description": "Per-event page call. Resolves to { name?, properties? }, or true for a page() call without a name. Use with silent: true."
26
26
  },
27
27
  "screen": {
28
- "description": "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."
28
+ "description": "Per-event screen call (mobile backends). Resolves to { name?, properties? }, or true for a screen() call without a name. Use with silent: true."
29
29
  },
30
30
  "alias": {
31
- "description": "Per-event alias call. Resolves to { previousId }. Links anonymous user to identified user. Use with rule-level silent: true."
31
+ "description": "Per-event alias call. Resolves to { previousId }. Links that anonymous id to the event userId, which the call needs: an event without a userId fails. Use with rule-level silent: true."
32
32
  }
33
33
  },
34
34
  "additionalProperties": false
@@ -75,7 +75,7 @@
75
75
  "type": "integer",
76
76
  "exclusiveMinimum": 0,
77
77
  "maximum": 9007199254740991,
78
- "description": "Maximum batch payload size in bytes. Default: 460800 (~500KB)."
78
+ "description": "Maximum batch payload size in bytes. Default: 460800 (450 KB)."
79
79
  },
80
80
  "maxInternalQueueSize": {
81
81
  "type": "integer",
@@ -108,10 +108,10 @@
108
108
  "description": "Enable gzip compression for requests. Default: true."
109
109
  },
110
110
  "identify": {
111
- "description": "Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change."
111
+ "description": "Destination-level identity mapping. Resolves to { userId?, traits? }. identify() fires when the userId or traits differ from the previous identify call this destination sent; the anonymousId is not compared."
112
112
  },
113
113
  "group": {
114
- "description": "Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change."
114
+ "description": "Destination-level group mapping. Resolves to { groupId, traits? }. group() fires when the groupId or traits differ from the previous group call this destination sent; the user is not compared."
115
115
  },
116
116
  "integrations": {
117
117
  "type": "object",
@@ -119,7 +119,7 @@
119
119
  "type": "string"
120
120
  },
121
121
  "additionalProperties": {},
122
- "description": "Enable/disable downstream RudderStack destinations. Example: { \"All\": true, \"Mixpanel\": false }."
122
+ "description": "Has no effect: the destination does not add integrations to its calls."
123
123
  }
124
124
  },
125
125
  "required": [
@@ -165,6 +165,15 @@
165
165
  "call:analytics.alias"
166
166
  ]
167
167
  },
168
+ "minimal": {
169
+ "settings": {
170
+ "writeKey": "test-write-key",
171
+ "dataPlaneUrl": "https://hosted.rudderlabs.com"
172
+ },
173
+ "secrets": {
174
+ "writeKey": "RUDDERSTACK_WRITE_KEY"
175
+ }
176
+ },
168
177
  "step": {
169
178
  "aliasUser": {
170
179
  "title": "Alias user",
@@ -205,7 +214,7 @@
205
214
  "trigger": "test",
206
215
  "entity": "identity",
207
216
  "action": "merge",
208
- "timestamp": 1700000107,
217
+ "timestamp": 1700000107000,
209
218
  "timing": 3.14,
210
219
  "source": {
211
220
  "count": 1,
@@ -246,7 +255,8 @@
246
255
  "name": "Everyday Ruck Snack",
247
256
  "color": "black",
248
257
  "size": "l",
249
- "price": 420
258
+ "price": 420,
259
+ "currency": "EUR"
250
260
  },
251
261
  "context": {
252
262
  "shopping": [
@@ -271,7 +281,7 @@
271
281
  "trigger": "load",
272
282
  "entity": "product",
273
283
  "action": "view",
274
- "timestamp": 1700000108,
284
+ "timestamp": 1700000108000,
275
285
  "timing": 3.14,
276
286
  "source": {
277
287
  "count": 1,
@@ -336,7 +346,7 @@
336
346
  "trigger": "test",
337
347
  "entity": "company",
338
348
  "action": "update",
339
- "timestamp": 1700000104,
349
+ "timestamp": 1700000104000,
340
350
  "timing": 3.14,
341
351
  "source": {
342
352
  "count": 1,
@@ -387,7 +397,7 @@
387
397
  "name": "company update",
388
398
  "entity": "company",
389
399
  "action": "update",
390
- "timestamp": 1700000120,
400
+ "timestamp": 1700000120000,
391
401
  "user": {
392
402
  "id": "us3r",
393
403
  "session": "s3ss10n"
@@ -422,7 +432,8 @@
422
432
  "name": "Everyday Ruck Snack",
423
433
  "color": "black",
424
434
  "size": "l",
425
- "price": 420
435
+ "price": 420,
436
+ "currency": "EUR"
426
437
  },
427
438
  "context": {
428
439
  "shopping": [
@@ -448,7 +459,7 @@
448
459
  "trigger": "load",
449
460
  "entity": "product",
450
461
  "action": "view",
451
- "timestamp": 1700000100,
462
+ "timestamp": 1700000100000,
452
463
  "timing": 3.14,
453
464
  "source": {
454
465
  "count": 1,
@@ -473,7 +484,7 @@
473
484
  },
474
485
  "destinationIdentify": {
475
486
  "title": "Destination identify",
476
- "description": "Destination-level identify fires analytics.identify with traits on the first push only, then the track call follows.",
487
+ "description": "With settings.identify mapping the email trait to 'user.email', the first push fires analytics.identify with the traits before the track call. Later pushes repeat it only when the userId or traits differ.",
477
488
  "in": {
478
489
  "name": "page view",
479
490
  "data": {
@@ -516,7 +527,7 @@
516
527
  "trigger": "load",
517
528
  "entity": "page",
518
529
  "action": "view",
519
- "timestamp": 1700000102,
530
+ "timestamp": 1700000102000,
520
531
  "timing": 3.14,
521
532
  "source": {
522
533
  "count": 1,
@@ -570,9 +581,10 @@
570
581
  "data": {
571
582
  "id": "0rd3r1d",
572
583
  "currency": "EUR",
584
+ "value": 462,
585
+ "tax": 73.76,
573
586
  "shipping": 5.22,
574
- "taxes": 73.76,
575
- "value": 555
587
+ "total": 467.22
576
588
  },
577
589
  "context": {
578
590
  "shopping": [
@@ -645,7 +657,7 @@
645
657
  "trigger": "load",
646
658
  "entity": "order",
647
659
  "action": "complete",
648
- "timestamp": 1700000101,
660
+ "timestamp": 1700000101000,
649
661
  "timing": 3.14,
650
662
  "source": {
651
663
  "count": 1,
@@ -823,7 +835,7 @@
823
835
  "trigger": "load",
824
836
  "entity": "page",
825
837
  "action": "view",
826
- "timestamp": 1700000105,
838
+ "timestamp": 1700000105000,
827
839
  "timing": 3.14,
828
840
  "source": {
829
841
  "count": 1,
@@ -904,7 +916,7 @@
904
916
  "trigger": "test",
905
917
  "entity": "screen",
906
918
  "action": "view",
907
- "timestamp": 1700000106,
919
+ "timestamp": 1700000106000,
908
920
  "timing": 3.14,
909
921
  "source": {
910
922
  "count": 1,
@@ -988,7 +1000,7 @@
988
1000
  "trigger": "load",
989
1001
  "entity": "page",
990
1002
  "action": "view",
991
- "timestamp": 1700000117,
1003
+ "timestamp": 1700000117000,
992
1004
  "timing": 3.14,
993
1005
  "source": {
994
1006
  "count": 1,
@@ -1044,7 +1056,7 @@
1044
1056
  "trigger": "test",
1045
1057
  "entity": "user",
1046
1058
  "action": "login",
1047
- "timestamp": 1700000103,
1059
+ "timestamp": 1700000103000,
1048
1060
  "timing": 3.14,
1049
1061
  "source": {
1050
1062
  "count": 1,
@@ -1128,11 +1140,11 @@
1128
1140
  "consent": {
1129
1141
  "functional": true
1130
1142
  },
1131
- "id": "9b05d07c86156f49",
1143
+ "id": "cd412b3ddf42c87a",
1132
1144
  "trigger": "test",
1133
1145
  "entity": "debug",
1134
1146
  "action": "noise",
1135
- "timestamp": 1700000109,
1147
+ "timestamp": 1700000109000,
1136
1148
  "timing": 3.14,
1137
1149
  "source": {
1138
1150
  "count": 1,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@walkeros/server-destination-rudderstack",
3
3
  "description": "RudderStack CDP server destination for walkerOS (@rudderstack/rudder-sdk-node, full Segment Spec)",
4
- "version": "4.8.2",
4
+ "version": "4.8.3-next-1793115089237",
5
5
  "license": "MIT",
6
6
  "exports": {
7
7
  ".": {
@@ -36,11 +36,11 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@rudderstack/rudder-sdk-node": "^3.0.0",
39
- "@walkeros/core": "4.8.2",
40
- "@walkeros/server-core": "4.8.2"
39
+ "@walkeros/core": "4.8.3-next-1793115089237",
40
+ "@walkeros/server-core": "4.8.3-next-1793115089237"
41
41
  },
42
42
  "devDependencies": {
43
- "@walkeros/collector": "4.8.2"
43
+ "@walkeros/collector": "4.8.3-next-1793115089237"
44
44
  },
45
45
  "repository": {
46
46
  "url": "git+https://github.com/elbwalker/walkerOS.git",