@walkeros/server-destination-rudderstack 4.9.0-next-1793116456867 → 4.9.0
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 +14 -3
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/examples/index.js +10 -7
- package/dist/examples/index.mjs +10 -7
- package/dist/walkerOS.json +9 -9
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
# @walkeros/server-destination-rudderstack
|
|
2
2
|
|
|
3
|
-
## 4.9.0
|
|
3
|
+
## 4.9.0
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
+
- a67546d: The `breaker` description in the destination config now says which
|
|
8
|
+
failures open the breaker: retryable ones such as a network error, a timeout
|
|
9
|
+
or a 429 or 5xx answer, never any other 4xx, a missing setting or a runtime
|
|
10
|
+
failure. The Segment and RudderStack failure examples carry their event
|
|
11
|
+
timestamps in milliseconds.
|
|
7
12
|
- 5313635: The package publishes a minimal example: the data plane URL and a
|
|
8
13
|
write key, read as the `RUDDERSTACK_WRITE_KEY` secret. The docs page renders
|
|
9
14
|
the install line, the integrated code and the flow from it, and the package
|
|
@@ -13,16 +18,22 @@
|
|
|
13
18
|
`screen` mapping descriptions now say that the name is optional, the `alias`
|
|
14
19
|
description that the call needs the event's userId, and the `maxQueueSize`
|
|
15
20
|
description gives its 450 KB default. Example timestamps are in milliseconds.
|
|
21
|
+
- Updated dependencies [a67546d]
|
|
22
|
+
- Updated dependencies [1306d8a]
|
|
16
23
|
- Updated dependencies [34fd225]
|
|
17
24
|
- Updated dependencies [5313635]
|
|
25
|
+
- Updated dependencies [1306d8a]
|
|
26
|
+
- Updated dependencies [fa46337]
|
|
18
27
|
- Updated dependencies [5313635]
|
|
19
28
|
- Updated dependencies [5313635]
|
|
20
29
|
- Updated dependencies [5313635]
|
|
21
30
|
- Updated dependencies [5313635]
|
|
22
31
|
- Updated dependencies [34fd225]
|
|
32
|
+
- Updated dependencies [fa46337]
|
|
33
|
+
- Updated dependencies [1306d8a]
|
|
23
34
|
- Updated dependencies [5313635]
|
|
24
|
-
- @walkeros/core@4.9.0
|
|
25
|
-
- @walkeros/server-core@4.9.0
|
|
35
|
+
- @walkeros/core@4.9.0
|
|
36
|
+
- @walkeros/server-core@4.9.0
|
|
26
37
|
|
|
27
38
|
## 4.8.2
|
|
28
39
|
|
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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",170000011e4),K=_("order complete",1700000111e3),U=_("page view",1700000112e3),x=_("user login",1700000113e3),j=_("company update",1700000114e3),C=_("screen view",1700000115e3),L=_("identity merge",1700000116e3),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","../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,cA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,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,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"]}
|
|
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', 1700000110000);\nexport const noIdentityOrder = withoutIdentity('order complete', 1700000111000);\nexport const noIdentityPage = withoutIdentity('page view', 1700000112000);\nexport const noIdentityLogin = withoutIdentity('user login', 1700000113000);\nexport const noIdentityCompany = withoutIdentity(\n 'company update',\n 1700000114000,\n);\nexport const noIdentityScreen = withoutIdentity('screen view', 1700000115000);\nexport const noIdentityMerge = withoutIdentity('identity merge', 1700000116000);\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,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,SAAS,qDAAqD,EAC9D,SAAS;AAAA,EACZ,cAAc,aACX,OAAO,EACP,IAAI,EACJ,SAAS,EACT;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,sBAAsB,aACnB,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,iDAAiD,EAC1D,SAAS;AAAA,EACZ,UAAU,aACP,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,YAAY,aACT,OAAO,EACP,IAAI,EACJ,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,SAAS,aAC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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:()=>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
|
|
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",170000011e4),U=_("order complete",1700000111e3),x=_("page view",1700000112e3),E=_("user login",1700000113e3),O=_("company update",1700000114e3),q=_("screen view",1700000115e3),z=_("identity merge",1700000116e3),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","../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 dataPlaneUrl: 'https://hosted.rudderlabs.com',\n },\n secrets: { writeKey: 'RUDDERSTACK_WRITE_KEY' },\n};\n"],"mappings":";;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAC3B,OAAO;AAAA,EACN,UAAU,EACP,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA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AAI,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"]}
|
|
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', 1700000110000);\nexport const noIdentityOrder = withoutIdentity('order complete', 1700000111000);\nexport const noIdentityPage = withoutIdentity('page view', 1700000112000);\nexport const noIdentityLogin = withoutIdentity('user login', 1700000113000);\nexport const noIdentityCompany = withoutIdentity(\n 'company update',\n 1700000114000,\n);\nexport const noIdentityScreen = withoutIdentity('screen view', 1700000115000);\nexport const noIdentityMerge = withoutIdentity('identity merge', 1700000116000);\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;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAC3B,OAAO;AAAA,EACN,UAAU,EACP,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,cAAc,EACX,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,EACL,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,EACV,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,EAAE,OAAO,EAAE,SAAS,kCAAkC,EAAE,SAAS;AAAA,EACvE,SAAS,EACN,OAAO,EACP,IAAI,EACJ,SAAS,EACT;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,eAAe,EACZ,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,qDAAqD,EAC9D,SAAS;AAAA,EACZ,cAAc,EACX,OAAO,EACP,IAAI,EACJ,SAAS,EACT;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,sBAAsB,EACnB,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,iDAAiD,EAC1D,SAAS;AAAA,EACZ,UAAU,EACP,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,YAAY,EACT,OAAO,EACP,IAAI,EACJ,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,SAAS,EACN,OAAO,EACP,IAAI,EACJ,SAAS,EACT;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EAC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outcome: { status: "failed", code: "missing-input", retryable: false }
|
|
415
415
|
};
|
|
416
416
|
}
|
|
417
|
-
var noIdentityProduct = withoutIdentity("product view",
|
|
418
|
-
var noIdentityOrder = withoutIdentity("order complete",
|
|
419
|
-
var noIdentityPage = withoutIdentity("page view",
|
|
420
|
-
var noIdentityLogin = withoutIdentity("user login",
|
|
421
|
-
var noIdentityCompany = withoutIdentity(
|
|
422
|
-
|
|
423
|
-
|
|
417
|
+
var noIdentityProduct = withoutIdentity("product view", 170000011e4);
|
|
418
|
+
var noIdentityOrder = withoutIdentity("order complete", 1700000111e3);
|
|
419
|
+
var noIdentityPage = withoutIdentity("page view", 1700000112e3);
|
|
420
|
+
var noIdentityLogin = withoutIdentity("user login", 1700000113e3);
|
|
421
|
+
var noIdentityCompany = withoutIdentity(
|
|
422
|
+
"company update",
|
|
423
|
+
1700000114e3
|
|
424
|
+
);
|
|
425
|
+
var noIdentityScreen = withoutIdentity("screen view", 1700000115e3);
|
|
426
|
+
var noIdentityMerge = withoutIdentity("identity merge", 1700000116e3);
|
|
424
427
|
var silentRule = {
|
|
425
428
|
public: false,
|
|
426
429
|
description: "A rule with silent: true and no identify, group, page, screen or alias mapping sends nothing to RudderStack.",
|
package/dist/examples/index.mjs
CHANGED
|
@@ -392,13 +392,16 @@ function withoutIdentity(name, timestamp) {
|
|
|
392
392
|
outcome: { status: "failed", code: "missing-input", retryable: false }
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
|
-
var noIdentityProduct = withoutIdentity("product view",
|
|
396
|
-
var noIdentityOrder = withoutIdentity("order complete",
|
|
397
|
-
var noIdentityPage = withoutIdentity("page view",
|
|
398
|
-
var noIdentityLogin = withoutIdentity("user login",
|
|
399
|
-
var noIdentityCompany = withoutIdentity(
|
|
400
|
-
|
|
401
|
-
|
|
395
|
+
var noIdentityProduct = withoutIdentity("product view", 170000011e4);
|
|
396
|
+
var noIdentityOrder = withoutIdentity("order complete", 1700000111e3);
|
|
397
|
+
var noIdentityPage = withoutIdentity("page view", 1700000112e3);
|
|
398
|
+
var noIdentityLogin = withoutIdentity("user login", 1700000113e3);
|
|
399
|
+
var noIdentityCompany = withoutIdentity(
|
|
400
|
+
"company update",
|
|
401
|
+
1700000114e3
|
|
402
|
+
);
|
|
403
|
+
var noIdentityScreen = withoutIdentity("screen view", 1700000115e3);
|
|
404
|
+
var noIdentityMerge = withoutIdentity("identity merge", 1700000116e3);
|
|
402
405
|
var silentRule = {
|
|
403
406
|
public: false,
|
|
404
407
|
description: "A rule with silent: true and no identify, group, page, screen or alias mapping sends nothing to RudderStack.",
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/server-destination-rudderstack",
|
|
4
|
-
"version": "4.9.0
|
|
4
|
+
"version": "4.9.0",
|
|
5
5
|
"type": "destination",
|
|
6
6
|
"platform": [
|
|
7
7
|
"server"
|
|
@@ -690,7 +690,7 @@
|
|
|
690
690
|
"name": "company update",
|
|
691
691
|
"entity": "company",
|
|
692
692
|
"action": "update",
|
|
693
|
-
"timestamp":
|
|
693
|
+
"timestamp": 1700000114000
|
|
694
694
|
},
|
|
695
695
|
"out": [],
|
|
696
696
|
"outcome": {
|
|
@@ -706,7 +706,7 @@
|
|
|
706
706
|
"name": "user login",
|
|
707
707
|
"entity": "user",
|
|
708
708
|
"action": "login",
|
|
709
|
-
"timestamp":
|
|
709
|
+
"timestamp": 1700000113000
|
|
710
710
|
},
|
|
711
711
|
"out": [],
|
|
712
712
|
"outcome": {
|
|
@@ -722,7 +722,7 @@
|
|
|
722
722
|
"name": "identity merge",
|
|
723
723
|
"entity": "identity",
|
|
724
724
|
"action": "merge",
|
|
725
|
-
"timestamp":
|
|
725
|
+
"timestamp": 1700000116000
|
|
726
726
|
},
|
|
727
727
|
"out": [],
|
|
728
728
|
"outcome": {
|
|
@@ -738,7 +738,7 @@
|
|
|
738
738
|
"name": "order complete",
|
|
739
739
|
"entity": "order",
|
|
740
740
|
"action": "complete",
|
|
741
|
-
"timestamp":
|
|
741
|
+
"timestamp": 1700000111000
|
|
742
742
|
},
|
|
743
743
|
"out": [],
|
|
744
744
|
"outcome": {
|
|
@@ -754,7 +754,7 @@
|
|
|
754
754
|
"name": "page view",
|
|
755
755
|
"entity": "page",
|
|
756
756
|
"action": "view",
|
|
757
|
-
"timestamp":
|
|
757
|
+
"timestamp": 1700000112000
|
|
758
758
|
},
|
|
759
759
|
"out": [],
|
|
760
760
|
"outcome": {
|
|
@@ -770,7 +770,7 @@
|
|
|
770
770
|
"name": "product view",
|
|
771
771
|
"entity": "product",
|
|
772
772
|
"action": "view",
|
|
773
|
-
"timestamp":
|
|
773
|
+
"timestamp": 1700000110000
|
|
774
774
|
},
|
|
775
775
|
"out": [],
|
|
776
776
|
"outcome": {
|
|
@@ -786,7 +786,7 @@
|
|
|
786
786
|
"name": "screen view",
|
|
787
787
|
"entity": "screen",
|
|
788
788
|
"action": "view",
|
|
789
|
-
"timestamp":
|
|
789
|
+
"timestamp": 1700000115000
|
|
790
790
|
},
|
|
791
791
|
"out": [],
|
|
792
792
|
"outcome": {
|
|
@@ -1140,7 +1140,7 @@
|
|
|
1140
1140
|
"consent": {
|
|
1141
1141
|
"functional": true
|
|
1142
1142
|
},
|
|
1143
|
-
"id": "
|
|
1143
|
+
"id": "108b64404f3cfb57",
|
|
1144
1144
|
"trigger": "test",
|
|
1145
1145
|
"entity": "debug",
|
|
1146
1146
|
"action": "noise",
|
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.9.0
|
|
4
|
+
"version": "4.9.0",
|
|
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.9.0
|
|
40
|
-
"@walkeros/server-core": "4.9.0
|
|
39
|
+
"@walkeros/core": "4.9.0",
|
|
40
|
+
"@walkeros/server-core": "4.9.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@walkeros/collector": "4.9.0
|
|
43
|
+
"@walkeros/collector": "4.9.0"
|
|
44
44
|
},
|
|
45
45
|
"repository": {
|
|
46
46
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|