@walkeros/server-destination-mixpanel 3.3.1 → 3.4.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/dist/dev.d.mts +20 -0
- package/dist/dev.d.ts +20 -0
- 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.d.mts +20 -0
- package/dist/examples/index.d.ts +20 -0
- package/dist/examples/index.js +29 -23
- package/dist/examples/index.mjs +29 -23
- package/dist/walkerOS.json +53 -43
- package/package.json +4 -4
package/dist/dev.d.mts
CHANGED
|
@@ -118,6 +118,26 @@ declare namespace env {
|
|
|
118
118
|
export { env_push as push, env_simulation as simulation };
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
/**
|
|
122
|
+
* Mixpanel server SDK step examples.
|
|
123
|
+
*
|
|
124
|
+
* At push time, the destination calls the `mixpanel` Node SDK via the
|
|
125
|
+
* client returned from `Mixpanel.init(...)`. Public method paths users
|
|
126
|
+
* see on the client are:
|
|
127
|
+
*
|
|
128
|
+
* - `mp.track(eventName, properties)`
|
|
129
|
+
* - `mp.import(eventName, time, properties)` (when `useImport: true`)
|
|
130
|
+
* - `mp.alias(distinctId, alias)` (fires before track)
|
|
131
|
+
* - `mp.people.{set,set_once,increment,append,union,remove,unset,delete_user}(...)`
|
|
132
|
+
* - `mp.groups.{set,set_once,union,remove,unset,delete_group}(...)`
|
|
133
|
+
*
|
|
134
|
+
* Each `out` is `[[callable, ...args], ...]`. The test filters out the
|
|
135
|
+
* one-time `Mixpanel.init` call (fired during destination init) so only
|
|
136
|
+
* per-event SDK calls are compared.
|
|
137
|
+
*
|
|
138
|
+
* For events marked `skip: true` or `ignore: true`, `track()` does not
|
|
139
|
+
* fire — only the side-effect calls (people/groups/alias) appear.
|
|
140
|
+
*/
|
|
121
141
|
/**
|
|
122
142
|
* Step examples may carry destination-level settings and configInclude.
|
|
123
143
|
* The test runner reads these to configure the destination.
|
package/dist/dev.d.ts
CHANGED
|
@@ -118,6 +118,26 @@ declare namespace env {
|
|
|
118
118
|
export { env_push as push, env_simulation as simulation };
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
/**
|
|
122
|
+
* Mixpanel server SDK step examples.
|
|
123
|
+
*
|
|
124
|
+
* At push time, the destination calls the `mixpanel` Node SDK via the
|
|
125
|
+
* client returned from `Mixpanel.init(...)`. Public method paths users
|
|
126
|
+
* see on the client are:
|
|
127
|
+
*
|
|
128
|
+
* - `mp.track(eventName, properties)`
|
|
129
|
+
* - `mp.import(eventName, time, properties)` (when `useImport: true`)
|
|
130
|
+
* - `mp.alias(distinctId, alias)` (fires before track)
|
|
131
|
+
* - `mp.people.{set,set_once,increment,append,union,remove,unset,delete_user}(...)`
|
|
132
|
+
* - `mp.groups.{set,set_once,union,remove,unset,delete_group}(...)`
|
|
133
|
+
*
|
|
134
|
+
* Each `out` is `[[callable, ...args], ...]`. The test filters out the
|
|
135
|
+
* one-time `Mixpanel.init` call (fired during destination init) so only
|
|
136
|
+
* per-event SDK calls are compared.
|
|
137
|
+
*
|
|
138
|
+
* For events marked `skip: true` or `ignore: true`, `track()` does not
|
|
139
|
+
* fire — only the side-effect calls (people/groups/alias) appear.
|
|
140
|
+
*/
|
|
121
141
|
/**
|
|
122
142
|
* Step examples may carry destination-level settings and configInclude.
|
|
123
143
|
* The test runner reads these to configure the destination.
|
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,o=(e,a)=>{for(var i in a)t(e,i,{get:a[i],enumerable:!0})},p={};o(p,{examples:()=>v,schemas:()=>s}),module.exports=(e=p,((e,o,p,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let r of i(o))n.call(e,r)||r===p||t(e,r,{get:()=>o[r],enumerable:!(s=a(o,r))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s={};o(s,{MappingSchema:()=>m,SettingsSchema:()=>d,mapping:()=>g,settings:()=>u});var r=require("@walkeros/core/dev"),l=require("@walkeros/core/dev"),d=l.z.object({apiKey:l.z.string().min(1).describe("Your Mixpanel project token. Find it in Project Settings > Access Keys. Passed as the first argument to Mixpanel.init()."),secret:l.z.string().describe("API secret for the /import endpoint (historical data). Required when useImport is true.").optional(),host:l.z.string().describe("Mixpanel API host. Default: 'api.mixpanel.com' (US). Use 'api-eu.mixpanel.com' (EU) or 'api-in.mixpanel.com' (India).").optional(),protocol:l.z.string().describe("Protocol for API requests. Default: 'https'.").optional(),keepAlive:l.z.boolean().describe("Reuse HTTP connections. Default: true.").optional(),geolocate:l.z.boolean().describe("Parse IP for geolocation. Default: false. Server IP caveat: all users map to server location unless $ip is overridden.").optional(),debug:l.z.boolean().describe("Enable SDK debug logging. Default: false.").optional(),verbose:l.z.boolean().describe("Enable verbose request logging. Default: false.").optional(),test:l.z.boolean().describe("Enable dry-run mode. Default: false.").optional(),useImport:l.z.boolean().describe("Use /import endpoint instead of /track. Accepts events of any age (no 5-day limit). Requires secret for authentication.").optional(),identify:l.z.unknown().describe("walkerOS mapping value resolving to { distinctId, alias? }. distinctId is passed as distinct_id on every SDK call.").optional(),include:l.z.unknown().describe("Event data sections to flatten into track() properties. Example: ['data', 'globals']. Sections are prefixed (data_, globals_, etc.).").optional()}),c=require("@walkeros/core/dev"),m=c.z.object({identify:c.z.unknown().describe("Per-event identity mapping. Resolves to { distinctId, alias? }. distinctId is passed as distinct_id to all SDK calls.").optional(),people:c.z.unknown().describe("Per-event people operations. Resolves to an object with any of: set, set_once, increment, append, union, remove, unset, delete_user. Each key fires a separate mp.people.* call with distinct_id as first arg.").optional(),group:c.z.unknown().describe("Per-event group association. Resolves to { key, id }. The group key/id is added as a track() property.").optional(),groupProfile:c.z.unknown().describe("Per-event group profile operations. Resolves to { key, id, set?, set_once?, union?, remove?, unset?, delete? }. Fires mp.groups.* calls.").optional(),useImport:c.z.unknown().describe("Per-event import flag. When truthy, uses mp.import() instead of mp.track() for this rule.").optional()}),u=(0,r.zodToSchema)(d),g=(0,r.zodToSchema)(m),v={};o(v,{env:()=>_,step:()=>I});var _={};o(_,{push:()=>k,simulation:()=>w});var f=()=>{},y={set:f,set_once:f,increment:f,append:f,union:f,remove:f,unset:f,delete_user:f},b={set:f,set_once:f,union:f,remove:f,unset:f,delete_group:f};var k={Mixpanel:{init:function(){return{track:f,import:f,alias:f,people:{...y},groups:{...b}}}}},w=["call:Mixpanel.init","call:mp.track","call:mp.import","call:mp.alias","call:mp.people.set","call:mp.people.set_once","call:mp.people.increment","call:mp.people.append","call:mp.people.union","call:mp.people.remove","call:mp.people.unset","call:mp.people.delete_user","call:mp.groups.set","call:mp.groups.set_once","call:mp.groups.union","call:mp.groups.remove","call:mp.groups.unset","call:mp.groups.delete_group"],I={};o(I,{aliasBeforeTrack:()=>A,allPeopleOperations:()=>j,companyGroupProfile:()=>x,defaultEventForwarding:()=>P,historicalImport:()=>q,perEventIdentify:()=>E,trackWithGroup:()=>S,trackWithInclude:()=>z,userLoginPeopleSet:()=>D,wildcardIgnored:()=>O});var h=require("@walkeros/core"),P={in:(0,h.getEvent)("product view",{timestamp:1700000100}),settings:{identify:{map:{distinctId:"user.id"}}},out:["mp.track","product view",{distinct_id:"us3r"}]},z={in:(0,h.getEvent)("product view",{timestamp:1700000101}),settings:{identify:{map:{distinctId:"user.id"}}},configInclude:["data"],out:["mp.track","product view",{distinct_id:"us3r",data_id:"ers",data_name:"Everyday Ruck Snack",data_color:"black",data_size:"l",data_price:420}]},E={in:(0,h.getEvent)("user login",{timestamp:1700000102,data:{user_id:"resolved-id",plan:"premium"}}),mapping:{settings:{identify:{map:{distinctId:"data.user_id"}}}},out:["mp.track","user login",{distinct_id:"resolved-id"}]},S={in:(0,h.getEvent)("page view",{timestamp:1700000103,data:{company_id:"acme"}}),settings:{identify:{map:{distinctId:"user.id"}}},mapping:{settings:{group:{map:{key:{value:"company_id"},id:"data.company_id"}}}},out:["mp.track","page view",{distinct_id:"us3r",company_id:"acme"}]},D={in:(0,h.getEvent)("user login",{timestamp:1700000104,data:{user_id:"new-user-123",plan:"premium",company:"Acme",email:"user@acme.com"}}),mapping:{skip:!0,settings:{identify:{map:{distinctId:"data.user_id"}},people:{map:{set:{map:{plan:"data.plan",company:"data.company",email:"data.email"}},set_once:{map:{first_login:"timestamp"}},increment:{map:{login_count:{value:1}}}}}}},out:[["mp.people.set","new-user-123",{plan:"premium",company:"Acme",email:"user@acme.com"}],["mp.people.set_once","new-user-123",{first_login:1700000104}],["mp.people.increment","new-user-123",{login_count:1}]]},j={in:(0,h.getEvent)("profile update",{timestamp:1700000105,data:{name:"Jane Doe",email:"jane@acme.com",page:"/docs/getting-started",removed_tag:"trial",source:"referral"}}),mapping:{skip:!0,settings:{identify:{map:{distinctId:"user.id"}},people:{map:{set:{map:{name:"data.name",email:"data.email"}},set_once:{map:{signup_source:"data.source"}},increment:{map:{page_views:{value:1}}},append:{map:{visited_pages:"data.page"}},union:{map:{unique_tags:{value:["active"]}}},remove:{map:{tags:"data.removed_tag"}},unset:{value:["old_plan"]}}}}},out:[["mp.people.set","us3r",{name:"Jane Doe",email:"jane@acme.com"}],["mp.people.set_once","us3r",{signup_source:"referral"}],["mp.people.increment","us3r",{page_views:1}],["mp.people.append","us3r",{visited_pages:"/docs/getting-started"}],["mp.people.union","us3r",{unique_tags:["active"]}],["mp.people.remove","us3r",{tags:"trial"}],["mp.people.unset","us3r",["old_plan"]]]},x={in:(0,h.getEvent)("company update",{timestamp:1700000106,data:{company_id:"acme-inc",company_name:"Acme, Inc.",plan:"enterprise",employee_count:250,founded_year:2010}}),mapping:{skip:!0,settings:{groupProfile:{map:{key:{value:"company_id"},id:"data.company_id",set:{map:{name:"data.company_name",plan:"data.plan",employee_count:"data.employee_count"}},set_once:{map:{founded:"data.founded_year"}}}}}},out:[["mp.groups.set","company_id","acme-inc",{name:"Acme, Inc.",plan:"enterprise",employee_count:250}],["mp.groups.set_once","company_id","acme-inc",{founded:2010}]]},q={in:(0,h.getEvent)("order complete",{timestamp:1700000107,data:{total:99.99}}),settings:{useImport:!0,identify:{map:{distinctId:"user.id"}}},out:["mp.import","order complete",1700000107,{distinct_id:"us3r"}]},A={in:(0,h.getEvent)("user login",{timestamp:1700000108,data:{user_id:"new-user-456",anon_id:"anon-789"}}),mapping:{settings:{identify:{map:{distinctId:"data.user_id",alias:"data.anon_id"}}}},out:[["mp.alias","new-user-456","anon-789"],["mp.track","user login",{distinct_id:"new-user-456"}]]},O={in:(0,h.getEvent)("debug noise",{timestamp:1700000109}),mapping:{ignore:!0},out:[]};//# sourceMappingURL=dev.js.map
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,o=(e,a)=>{for(var i in a)t(e,i,{get:a[i],enumerable:!0})},p={};o(p,{examples:()=>v,schemas:()=>s}),module.exports=(e=p,((e,o,p,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let r of i(o))n.call(e,r)||r===p||t(e,r,{get:()=>o[r],enumerable:!(s=a(o,r))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s={};o(s,{MappingSchema:()=>m,SettingsSchema:()=>d,mapping:()=>g,settings:()=>u});var r=require("@walkeros/core/dev"),l=require("@walkeros/core/dev"),d=l.z.object({apiKey:l.z.string().min(1).describe("Your Mixpanel project token. Find it in Project Settings > Access Keys. Passed as the first argument to Mixpanel.init()."),secret:l.z.string().describe("API secret for the /import endpoint (historical data). Required when useImport is true.").optional(),host:l.z.string().describe("Mixpanel API host. Default: 'api.mixpanel.com' (US). Use 'api-eu.mixpanel.com' (EU) or 'api-in.mixpanel.com' (India).").optional(),protocol:l.z.string().describe("Protocol for API requests. Default: 'https'.").optional(),keepAlive:l.z.boolean().describe("Reuse HTTP connections. Default: true.").optional(),geolocate:l.z.boolean().describe("Parse IP for geolocation. Default: false. Server IP caveat: all users map to server location unless $ip is overridden.").optional(),debug:l.z.boolean().describe("Enable SDK debug logging. Default: false.").optional(),verbose:l.z.boolean().describe("Enable verbose request logging. Default: false.").optional(),test:l.z.boolean().describe("Enable dry-run mode. Default: false.").optional(),useImport:l.z.boolean().describe("Use /import endpoint instead of /track. Accepts events of any age (no 5-day limit). Requires secret for authentication.").optional(),identify:l.z.unknown().describe("walkerOS mapping value resolving to { distinctId, alias? }. distinctId is passed as distinct_id on every SDK call.").optional(),include:l.z.unknown().describe("Event data sections to flatten into track() properties. Example: ['data', 'globals']. Sections are prefixed (data_, globals_, etc.).").optional()}),c=require("@walkeros/core/dev"),m=c.z.object({identify:c.z.unknown().describe("Per-event identity mapping. Resolves to { distinctId, alias? }. distinctId is passed as distinct_id to all SDK calls.").optional(),people:c.z.unknown().describe("Per-event people operations. Resolves to an object with any of: set, set_once, increment, append, union, remove, unset, delete_user. Each key fires a separate mp.people.* call with distinct_id as first arg.").optional(),group:c.z.unknown().describe("Per-event group association. Resolves to { key, id }. The group key/id is added as a track() property.").optional(),groupProfile:c.z.unknown().describe("Per-event group profile operations. Resolves to { key, id, set?, set_once?, union?, remove?, unset?, delete? }. Fires mp.groups.* calls.").optional(),useImport:c.z.unknown().describe("Per-event import flag. When truthy, uses mp.import() instead of mp.track() for this rule.").optional()}),u=(0,r.zodToSchema)(d),g=(0,r.zodToSchema)(m),v={};o(v,{env:()=>_,step:()=>I});var _={};o(_,{push:()=>k,simulation:()=>w});var f=()=>{},y={set:f,set_once:f,increment:f,append:f,union:f,remove:f,unset:f,delete_user:f},b={set:f,set_once:f,union:f,remove:f,unset:f,delete_group:f};var k={Mixpanel:{init:function(){return{track:f,import:f,alias:f,people:{...y},groups:{...b}}}}},w=["call:Mixpanel.init","call:mp.track","call:mp.import","call:mp.alias","call:mp.people.set","call:mp.people.set_once","call:mp.people.increment","call:mp.people.append","call:mp.people.union","call:mp.people.remove","call:mp.people.unset","call:mp.people.delete_user","call:mp.groups.set","call:mp.groups.set_once","call:mp.groups.union","call:mp.groups.remove","call:mp.groups.unset","call:mp.groups.delete_group"],I={};o(I,{aliasBeforeTrack:()=>A,allPeopleOperations:()=>j,companyGroupProfile:()=>x,defaultEventForwarding:()=>P,historicalImport:()=>q,perEventIdentify:()=>E,trackWithGroup:()=>S,trackWithInclude:()=>z,userLoginPeopleSet:()=>D,wildcardIgnored:()=>O});var h=require("@walkeros/core"),P={in:(0,h.getEvent)("product view",{timestamp:1700000100}),settings:{identify:{map:{distinctId:"user.id"}}},out:[["mp.track","product view",{distinct_id:"us3r"}]]},z={in:(0,h.getEvent)("product view",{timestamp:1700000101}),settings:{identify:{map:{distinctId:"user.id"}}},configInclude:["data"],out:[["mp.track","product view",{distinct_id:"us3r",data_id:"ers",data_name:"Everyday Ruck Snack",data_color:"black",data_size:"l",data_price:420}]]},E={in:(0,h.getEvent)("user login",{timestamp:1700000102,data:{user_id:"resolved-id",plan:"premium"}}),mapping:{settings:{identify:{map:{distinctId:"data.user_id"}}}},out:[["mp.track","user login",{distinct_id:"resolved-id"}]]},S={in:(0,h.getEvent)("page view",{timestamp:1700000103,data:{company_id:"acme"}}),settings:{identify:{map:{distinctId:"user.id"}}},mapping:{settings:{group:{map:{key:{value:"company_id"},id:"data.company_id"}}}},out:[["mp.track","page view",{distinct_id:"us3r",company_id:"acme"}]]},D={in:(0,h.getEvent)("user login",{timestamp:1700000104,data:{user_id:"new-user-123",plan:"premium",company:"Acme",email:"user@acme.com"}}),mapping:{skip:!0,settings:{identify:{map:{distinctId:"data.user_id"}},people:{map:{set:{map:{plan:"data.plan",company:"data.company",email:"data.email"}},set_once:{map:{first_login:"timestamp"}},increment:{map:{login_count:{value:1}}}}}}},out:[["mp.people.set","new-user-123",{plan:"premium",company:"Acme",email:"user@acme.com"}],["mp.people.set_once","new-user-123",{first_login:1700000104}],["mp.people.increment","new-user-123",{login_count:1}]]},j={in:(0,h.getEvent)("profile update",{timestamp:1700000105,data:{name:"Jane Doe",email:"jane@acme.com",page:"/docs/getting-started",removed_tag:"trial",source:"referral"}}),mapping:{skip:!0,settings:{identify:{map:{distinctId:"user.id"}},people:{map:{set:{map:{name:"data.name",email:"data.email"}},set_once:{map:{signup_source:"data.source"}},increment:{map:{page_views:{value:1}}},append:{map:{visited_pages:"data.page"}},union:{map:{unique_tags:{value:["active"]}}},remove:{map:{tags:"data.removed_tag"}},unset:{value:["old_plan"]}}}}},out:[["mp.people.set","us3r",{name:"Jane Doe",email:"jane@acme.com"}],["mp.people.set_once","us3r",{signup_source:"referral"}],["mp.people.increment","us3r",{page_views:1}],["mp.people.append","us3r",{visited_pages:"/docs/getting-started"}],["mp.people.union","us3r",{unique_tags:["active"]}],["mp.people.remove","us3r",{tags:"trial"}],["mp.people.unset","us3r",["old_plan"]]]},x={in:(0,h.getEvent)("company update",{timestamp:1700000106,data:{company_id:"acme-inc",company_name:"Acme, Inc.",plan:"enterprise",employee_count:250,founded_year:2010}}),mapping:{skip:!0,settings:{groupProfile:{map:{key:{value:"company_id"},id:"data.company_id",set:{map:{name:"data.company_name",plan:"data.plan",employee_count:"data.employee_count"}},set_once:{map:{founded:"data.founded_year"}}}}}},out:[["mp.groups.set","company_id","acme-inc",{name:"Acme, Inc.",plan:"enterprise",employee_count:250}],["mp.groups.set_once","company_id","acme-inc",{founded:2010}]]},q={in:(0,h.getEvent)("order complete",{timestamp:1700000107,data:{total:99.99}}),settings:{useImport:!0,identify:{map:{distinctId:"user.id"}}},out:[["mp.import","order complete",1700000107,{distinct_id:"us3r"}]]},A={in:(0,h.getEvent)("user login",{timestamp:1700000108,data:{user_id:"new-user-456",anon_id:"anon-789"}}),mapping:{settings:{identify:{map:{distinctId:"data.user_id",alias:"data.anon_id"}}}},out:[["mp.alias","new-user-456","anon-789"],["mp.track","user login",{distinct_id:"new-user-456"}]]},O={in:(0,h.getEvent)("debug noise",{timestamp:1700000109}),mapping:{ignore:!0},out:[]};//# sourceMappingURL=dev.js.map
|
package/dist/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n apiKey: z\n .string()\n .min(1)\n .describe(\n 'Your Mixpanel project token. Find it in Project Settings > Access Keys. Passed as the first argument to Mixpanel.init().',\n ),\n secret: z\n .string()\n .describe(\n 'API secret for the /import endpoint (historical data). Required when useImport is true.',\n )\n .optional(),\n host: z\n .string()\n .describe(\n \"Mixpanel API host. Default: 'api.mixpanel.com' (US). Use 'api-eu.mixpanel.com' (EU) or 'api-in.mixpanel.com' (India).\",\n )\n .optional(),\n protocol: z\n .string()\n .describe(\"Protocol for API requests. Default: 'https'.\")\n .optional(),\n keepAlive: z\n .boolean()\n .describe('Reuse HTTP connections. Default: true.')\n .optional(),\n geolocate: z\n .boolean()\n .describe(\n 'Parse IP for geolocation. Default: false. Server IP caveat: all users map to server location unless $ip is overridden.',\n )\n .optional(),\n debug: z\n .boolean()\n .describe('Enable SDK debug logging. Default: false.')\n .optional(),\n verbose: z\n .boolean()\n .describe('Enable verbose request logging. Default: false.')\n .optional(),\n test: z.boolean().describe('Enable dry-run mode. Default: false.').optional(),\n useImport: z\n .boolean()\n .describe(\n 'Use /import endpoint instead of /track. Accepts events of any age (no 5-day limit). Requires secret for authentication.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to { distinctId, alias? }. distinctId is passed as distinct_id on every SDK call.',\n )\n .optional(),\n include: z\n .unknown()\n .describe(\n \"Event data sections to flatten into track() properties. Example: ['data', 'globals']. Sections are prefixed (data_, globals_, etc.).\",\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identity mapping. Resolves to { distinctId, alias? }. distinctId is passed as distinct_id to all SDK calls.',\n )\n .optional(),\n people: z\n .unknown()\n .describe(\n 'Per-event people operations. Resolves to an object with any of: set, set_once, increment, append, union, remove, unset, delete_user. Each key fires a separate mp.people.* call with distinct_id as first arg.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Per-event group association. Resolves to { key, id }. The group key/id is added as a track() property.',\n )\n .optional(),\n groupProfile: z\n .unknown()\n .describe(\n 'Per-event group profile operations. Resolves to { key, id, set?, set_once?, union?, remove?, unset?, delete? }. Fires mp.groups.* calls.',\n )\n .optional(),\n useImport: z\n .unknown()\n .describe(\n 'Per-event import flag. When truthy, uses mp.import() instead of mp.track() for this rule.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type {\n Env,\n MixpanelClient,\n MixpanelPeople,\n MixpanelGroups,\n} from '../types';\n\nconst noop = (() => {}) as (...args: unknown[]) => void;\n\nconst noopPeople: MixpanelPeople = {\n set: noop,\n set_once: noop,\n increment: noop,\n append: noop,\n union: noop,\n remove: noop,\n unset: noop,\n delete_user: noop,\n};\n\nconst noopGroups: MixpanelGroups = {\n set: noop,\n set_once: noop,\n union: noop,\n remove: noop,\n unset: noop,\n delete_group: noop,\n};\n\n/**\n * Mock Mixpanel factory that returns a no-op client instance.\n * Tests replace individual methods with spies.\n */\nfunction mockInit(): MixpanelClient {\n return {\n track: noop,\n import: noop,\n alias: noop,\n people: { ...noopPeople },\n groups: { ...noopGroups },\n };\n}\n\n/**\n * Standard mock environment for push operations.\n * The test runner clones this and replaces methods with spies.\n */\nexport const push: Env = {\n Mixpanel: { init: mockInit as (...args: unknown[]) => MixpanelClient },\n};\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = [\n 'call:Mixpanel.init',\n 'call:mp.track',\n 'call:mp.import',\n 'call:mp.alias',\n 'call:mp.people.set',\n 'call:mp.people.set_once',\n 'call:mp.people.increment',\n 'call:mp.people.append',\n 'call:mp.people.union',\n 'call:mp.people.remove',\n 'call:mp.people.unset',\n 'call:mp.people.delete_user',\n 'call:mp.groups.set',\n 'call:mp.groups.set_once',\n 'call:mp.groups.union',\n 'call:mp.groups.remove',\n 'call:mp.groups.unset',\n 'call:mp.groups.delete_group',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Step examples may carry destination-level settings and configInclude.\n * The test runner reads these to configure the destination.\n */\nexport type MixpanelStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n configInclude?: string[];\n};\n\n/**\n * Default event forwarding — every walkerOS event becomes\n * mp.track(event.name, { distinct_id, ...properties }).\n * With default settings.identify resolving user.id.\n */\nexport const defaultEventForwarding: MixpanelStepExample = {\n in: getEvent('product view', { timestamp: 1700000100 }),\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n out: ['mp.track', 'product view', { distinct_id: 'us3r' }],\n};\n\n/**\n * Track with include — flattens walkerOS `data` section into\n * prefixed track() properties.\n */\nexport const trackWithInclude: MixpanelStepExample = {\n in: getEvent('product view', { timestamp: 1700000101 }),\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n configInclude: ['data'],\n out: [\n 'mp.track',\n 'product view',\n {\n distinct_id: 'us3r',\n data_id: 'ers',\n data_name: 'Everyday Ruck Snack',\n data_color: 'black',\n data_size: 'l',\n data_price: 420,\n },\n ],\n};\n\n/**\n * Per-event identify — mapping-level settings.identify overrides\n * destination-level default.\n */\nexport const perEventIdentify: MixpanelStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000102,\n data: {\n user_id: 'resolved-id',\n plan: 'premium',\n },\n }),\n mapping: {\n settings: {\n identify: {\n map: {\n distinctId: 'data.user_id',\n },\n },\n },\n },\n out: [\n 'mp.track',\n 'user login',\n {\n distinct_id: 'resolved-id',\n },\n ],\n};\n\n/**\n * Track with group — group key/id attached as track property.\n */\nexport const trackWithGroup: MixpanelStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000103,\n data: {\n company_id: 'acme',\n },\n }),\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n mapping: {\n settings: {\n group: {\n map: {\n key: { value: 'company_id' },\n id: 'data.company_id',\n },\n },\n },\n },\n out: [\n 'mp.track',\n 'page view',\n {\n distinct_id: 'us3r',\n company_id: 'acme',\n },\n ],\n};\n\n/**\n * User login with people operations — skip: true suppresses track,\n * only identity + people side effects fire.\n */\nexport const userLoginPeopleSet: MixpanelStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000104,\n data: {\n user_id: 'new-user-123',\n plan: 'premium',\n company: 'Acme',\n email: 'user@acme.com',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n distinctId: 'data.user_id',\n },\n },\n people: {\n map: {\n set: {\n map: {\n plan: 'data.plan',\n company: 'data.company',\n email: 'data.email',\n },\n },\n set_once: {\n map: {\n first_login: 'timestamp',\n },\n },\n increment: {\n map: {\n login_count: { value: 1 },\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'mp.people.set',\n 'new-user-123',\n { plan: 'premium', company: 'Acme', email: 'user@acme.com' },\n ],\n ['mp.people.set_once', 'new-user-123', { first_login: 1700000104 }],\n ['mp.people.increment', 'new-user-123', { login_count: 1 }],\n ],\n};\n\n/**\n * Full people operation vocabulary — exercises set, set_once, increment,\n * append, union, remove, unset, delete_user.\n */\nexport const allPeopleOperations: MixpanelStepExample = {\n in: getEvent('profile update', {\n timestamp: 1700000105,\n data: {\n name: 'Jane Doe',\n email: 'jane@acme.com',\n page: '/docs/getting-started',\n removed_tag: 'trial',\n source: 'referral',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n people: {\n map: {\n set: {\n map: {\n name: 'data.name',\n email: 'data.email',\n },\n },\n set_once: {\n map: {\n signup_source: 'data.source',\n },\n },\n increment: {\n map: {\n page_views: { value: 1 },\n },\n },\n append: {\n map: {\n visited_pages: 'data.page',\n },\n },\n union: {\n map: {\n unique_tags: { value: ['active'] },\n },\n },\n remove: {\n map: {\n tags: 'data.removed_tag',\n },\n },\n unset: { value: ['old_plan'] },\n },\n },\n },\n },\n out: [\n ['mp.people.set', 'us3r', { name: 'Jane Doe', email: 'jane@acme.com' }],\n ['mp.people.set_once', 'us3r', { signup_source: 'referral' }],\n ['mp.people.increment', 'us3r', { page_views: 1 }],\n ['mp.people.append', 'us3r', { visited_pages: '/docs/getting-started' }],\n ['mp.people.union', 'us3r', { unique_tags: ['active'] }],\n ['mp.people.remove', 'us3r', { tags: 'trial' }],\n ['mp.people.unset', 'us3r', ['old_plan']],\n ],\n};\n\n/**\n * Group profile operations — settings.groupProfile with set and set_once.\n */\nexport const companyGroupProfile: MixpanelStepExample = {\n in: getEvent('company update', {\n timestamp: 1700000106,\n data: {\n company_id: 'acme-inc',\n company_name: 'Acme, Inc.',\n plan: 'enterprise',\n employee_count: 250,\n founded_year: 2010,\n },\n }),\n mapping: {\n skip: true,\n settings: {\n groupProfile: {\n map: {\n key: { value: 'company_id' },\n id: 'data.company_id',\n set: {\n map: {\n name: 'data.company_name',\n plan: 'data.plan',\n employee_count: 'data.employee_count',\n },\n },\n set_once: {\n map: {\n founded: 'data.founded_year',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'mp.groups.set',\n 'company_id',\n 'acme-inc',\n { name: 'Acme, Inc.', plan: 'enterprise', employee_count: 250 },\n ],\n ['mp.groups.set_once', 'company_id', 'acme-inc', { founded: 2010 }],\n ],\n};\n\n/**\n * Historical import — useImport: true uses mp.import() instead of mp.track().\n */\nexport const historicalImport: MixpanelStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000107,\n data: {\n total: 99.99,\n },\n }),\n settings: {\n useImport: true,\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n out: ['mp.import', 'order complete', 1700000107, { distinct_id: 'us3r' }],\n};\n\n/**\n * Alias — legacy identity merge. Fires mp.alias before track.\n */\nexport const aliasBeforeTrack: MixpanelStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000108,\n data: {\n user_id: 'new-user-456',\n anon_id: 'anon-789',\n },\n }),\n mapping: {\n settings: {\n identify: {\n map: {\n distinctId: 'data.user_id',\n alias: 'data.anon_id',\n },\n },\n },\n },\n out: [\n ['mp.alias', 'new-user-456', 'anon-789'],\n ['mp.track', 'user login', { distinct_id: 'new-user-456' }],\n ],\n};\n\n/**\n * Wildcard ignore — the rule matches but does nothing.\n */\nexport const wildcardIgnored: MixpanelStepExample = {\n in: getEvent('debug noise', { timestamp: 1700000109 }),\n mapping: { ignore: true },\n out: [],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,QAAQ,aACL,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,aACL,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,aACH,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,aACP,OAAO,EACP,SAAS,8CAA8C,EACvD,SAAS;AAAA,EACZ,WAAW,aACR,QAAQ,EACR,SAAS,wCAAwC,EACjD,SAAS;AAAA,EACZ,WAAW,aACR,QAAQ,EACR;AAAA,IACC;A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3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n apiKey: z\n .string()\n .min(1)\n .describe(\n 'Your Mixpanel project token. Find it in Project Settings > Access Keys. Passed as the first argument to Mixpanel.init().',\n ),\n secret: z\n .string()\n .describe(\n 'API secret for the /import endpoint (historical data). Required when useImport is true.',\n )\n .optional(),\n host: z\n .string()\n .describe(\n \"Mixpanel API host. Default: 'api.mixpanel.com' (US). Use 'api-eu.mixpanel.com' (EU) or 'api-in.mixpanel.com' (India).\",\n )\n .optional(),\n protocol: z\n .string()\n .describe(\"Protocol for API requests. Default: 'https'.\")\n .optional(),\n keepAlive: z\n .boolean()\n .describe('Reuse HTTP connections. Default: true.')\n .optional(),\n geolocate: z\n .boolean()\n .describe(\n 'Parse IP for geolocation. Default: false. Server IP caveat: all users map to server location unless $ip is overridden.',\n )\n .optional(),\n debug: z\n .boolean()\n .describe('Enable SDK debug logging. Default: false.')\n .optional(),\n verbose: z\n .boolean()\n .describe('Enable verbose request logging. Default: false.')\n .optional(),\n test: z.boolean().describe('Enable dry-run mode. Default: false.').optional(),\n useImport: z\n .boolean()\n .describe(\n 'Use /import endpoint instead of /track. Accepts events of any age (no 5-day limit). Requires secret for authentication.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to { distinctId, alias? }. distinctId is passed as distinct_id on every SDK call.',\n )\n .optional(),\n include: z\n .unknown()\n .describe(\n \"Event data sections to flatten into track() properties. Example: ['data', 'globals']. Sections are prefixed (data_, globals_, etc.).\",\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identity mapping. Resolves to { distinctId, alias? }. distinctId is passed as distinct_id to all SDK calls.',\n )\n .optional(),\n people: z\n .unknown()\n .describe(\n 'Per-event people operations. Resolves to an object with any of: set, set_once, increment, append, union, remove, unset, delete_user. Each key fires a separate mp.people.* call with distinct_id as first arg.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Per-event group association. Resolves to { key, id }. The group key/id is added as a track() property.',\n )\n .optional(),\n groupProfile: z\n .unknown()\n .describe(\n 'Per-event group profile operations. Resolves to { key, id, set?, set_once?, union?, remove?, unset?, delete? }. Fires mp.groups.* calls.',\n )\n .optional(),\n useImport: z\n .unknown()\n .describe(\n 'Per-event import flag. When truthy, uses mp.import() instead of mp.track() for this rule.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type {\n Env,\n MixpanelClient,\n MixpanelPeople,\n MixpanelGroups,\n} from '../types';\n\nconst noop = (() => {}) as (...args: unknown[]) => void;\n\nconst noopPeople: MixpanelPeople = {\n set: noop,\n set_once: noop,\n increment: noop,\n append: noop,\n union: noop,\n remove: noop,\n unset: noop,\n delete_user: noop,\n};\n\nconst noopGroups: MixpanelGroups = {\n set: noop,\n set_once: noop,\n union: noop,\n remove: noop,\n unset: noop,\n delete_group: noop,\n};\n\n/**\n * Mock Mixpanel factory that returns a no-op client instance.\n * Tests replace individual methods with spies.\n */\nfunction mockInit(): MixpanelClient {\n return {\n track: noop,\n import: noop,\n alias: noop,\n people: { ...noopPeople },\n groups: { ...noopGroups },\n };\n}\n\n/**\n * Standard mock environment for push operations.\n * The test runner clones this and replaces methods with spies.\n */\nexport const push: Env = {\n Mixpanel: { init: mockInit as (...args: unknown[]) => MixpanelClient },\n};\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = [\n 'call:Mixpanel.init',\n 'call:mp.track',\n 'call:mp.import',\n 'call:mp.alias',\n 'call:mp.people.set',\n 'call:mp.people.set_once',\n 'call:mp.people.increment',\n 'call:mp.people.append',\n 'call:mp.people.union',\n 'call:mp.people.remove',\n 'call:mp.people.unset',\n 'call:mp.people.delete_user',\n 'call:mp.groups.set',\n 'call:mp.groups.set_once',\n 'call:mp.groups.union',\n 'call:mp.groups.remove',\n 'call:mp.groups.unset',\n 'call:mp.groups.delete_group',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Mixpanel server SDK step examples.\n *\n * At push time, the destination calls the `mixpanel` Node SDK via the\n * client returned from `Mixpanel.init(...)`. Public method paths users\n * see on the client are:\n *\n * - `mp.track(eventName, properties)`\n * - `mp.import(eventName, time, properties)` (when `useImport: true`)\n * - `mp.alias(distinctId, alias)` (fires before track)\n * - `mp.people.{set,set_once,increment,append,union,remove,unset,delete_user}(...)`\n * - `mp.groups.{set,set_once,union,remove,unset,delete_group}(...)`\n *\n * Each `out` is `[[callable, ...args], ...]`. The test filters out the\n * one-time `Mixpanel.init` call (fired during destination init) so only\n * per-event SDK calls are compared.\n *\n * For events marked `skip: true` or `ignore: true`, `track()` does not\n * fire — only the side-effect calls (people/groups/alias) appear.\n */\n\n/**\n * Step examples may carry destination-level settings and configInclude.\n * The test runner reads these to configure the destination.\n */\nexport type MixpanelStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n configInclude?: string[];\n};\n\n/**\n * Default event forwarding — every walkerOS event becomes\n * mp.track(event.name, { distinct_id, ...properties }).\n * With default settings.identify resolving user.id.\n */\nexport const defaultEventForwarding: MixpanelStepExample = {\n in: getEvent('product view', { timestamp: 1700000100 }),\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n out: [['mp.track', 'product view', { distinct_id: 'us3r' }]],\n};\n\n/**\n * Track with include — flattens walkerOS `data` section into\n * prefixed track() properties.\n */\nexport const trackWithInclude: MixpanelStepExample = {\n in: getEvent('product view', { timestamp: 1700000101 }),\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n configInclude: ['data'],\n out: [\n [\n 'mp.track',\n 'product view',\n {\n distinct_id: 'us3r',\n data_id: 'ers',\n data_name: 'Everyday Ruck Snack',\n data_color: 'black',\n data_size: 'l',\n data_price: 420,\n },\n ],\n ],\n};\n\n/**\n * Per-event identify — mapping-level settings.identify overrides\n * destination-level default.\n */\nexport const perEventIdentify: MixpanelStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000102,\n data: {\n user_id: 'resolved-id',\n plan: 'premium',\n },\n }),\n mapping: {\n settings: {\n identify: {\n map: {\n distinctId: 'data.user_id',\n },\n },\n },\n },\n out: [\n [\n 'mp.track',\n 'user login',\n {\n distinct_id: 'resolved-id',\n },\n ],\n ],\n};\n\n/**\n * Track with group — group key/id attached as track property.\n */\nexport const trackWithGroup: MixpanelStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000103,\n data: {\n company_id: 'acme',\n },\n }),\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n mapping: {\n settings: {\n group: {\n map: {\n key: { value: 'company_id' },\n id: 'data.company_id',\n },\n },\n },\n },\n out: [\n [\n 'mp.track',\n 'page view',\n {\n distinct_id: 'us3r',\n company_id: 'acme',\n },\n ],\n ],\n};\n\n/**\n * User login with people operations — skip: true suppresses track,\n * only identity + people side effects fire.\n */\nexport const userLoginPeopleSet: MixpanelStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000104,\n data: {\n user_id: 'new-user-123',\n plan: 'premium',\n company: 'Acme',\n email: 'user@acme.com',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n distinctId: 'data.user_id',\n },\n },\n people: {\n map: {\n set: {\n map: {\n plan: 'data.plan',\n company: 'data.company',\n email: 'data.email',\n },\n },\n set_once: {\n map: {\n first_login: 'timestamp',\n },\n },\n increment: {\n map: {\n login_count: { value: 1 },\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'mp.people.set',\n 'new-user-123',\n { plan: 'premium', company: 'Acme', email: 'user@acme.com' },\n ],\n ['mp.people.set_once', 'new-user-123', { first_login: 1700000104 }],\n ['mp.people.increment', 'new-user-123', { login_count: 1 }],\n ],\n};\n\n/**\n * Full people operation vocabulary — exercises set, set_once, increment,\n * append, union, remove, unset, delete_user.\n */\nexport const allPeopleOperations: MixpanelStepExample = {\n in: getEvent('profile update', {\n timestamp: 1700000105,\n data: {\n name: 'Jane Doe',\n email: 'jane@acme.com',\n page: '/docs/getting-started',\n removed_tag: 'trial',\n source: 'referral',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n people: {\n map: {\n set: {\n map: {\n name: 'data.name',\n email: 'data.email',\n },\n },\n set_once: {\n map: {\n signup_source: 'data.source',\n },\n },\n increment: {\n map: {\n page_views: { value: 1 },\n },\n },\n append: {\n map: {\n visited_pages: 'data.page',\n },\n },\n union: {\n map: {\n unique_tags: { value: ['active'] },\n },\n },\n remove: {\n map: {\n tags: 'data.removed_tag',\n },\n },\n unset: { value: ['old_plan'] },\n },\n },\n },\n },\n out: [\n ['mp.people.set', 'us3r', { name: 'Jane Doe', email: 'jane@acme.com' }],\n ['mp.people.set_once', 'us3r', { signup_source: 'referral' }],\n ['mp.people.increment', 'us3r', { page_views: 1 }],\n ['mp.people.append', 'us3r', { visited_pages: '/docs/getting-started' }],\n ['mp.people.union', 'us3r', { unique_tags: ['active'] }],\n ['mp.people.remove', 'us3r', { tags: 'trial' }],\n ['mp.people.unset', 'us3r', ['old_plan']],\n ],\n};\n\n/**\n * Group profile operations — settings.groupProfile with set and set_once.\n */\nexport const companyGroupProfile: MixpanelStepExample = {\n in: getEvent('company update', {\n timestamp: 1700000106,\n data: {\n company_id: 'acme-inc',\n company_name: 'Acme, Inc.',\n plan: 'enterprise',\n employee_count: 250,\n founded_year: 2010,\n },\n }),\n mapping: {\n skip: true,\n settings: {\n groupProfile: {\n map: {\n key: { value: 'company_id' },\n id: 'data.company_id',\n set: {\n map: {\n name: 'data.company_name',\n plan: 'data.plan',\n employee_count: 'data.employee_count',\n },\n },\n set_once: {\n map: {\n founded: 'data.founded_year',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'mp.groups.set',\n 'company_id',\n 'acme-inc',\n { name: 'Acme, Inc.', plan: 'enterprise', employee_count: 250 },\n ],\n ['mp.groups.set_once', 'company_id', 'acme-inc', { founded: 2010 }],\n ],\n};\n\n/**\n * Historical import — useImport: true uses mp.import() instead of mp.track().\n */\nexport const historicalImport: MixpanelStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000107,\n data: {\n total: 99.99,\n },\n }),\n settings: {\n useImport: true,\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n out: [['mp.import', 'order complete', 1700000107, { distinct_id: 'us3r' }]],\n};\n\n/**\n * Alias — legacy identity merge. Fires mp.alias before track.\n */\nexport const aliasBeforeTrack: MixpanelStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000108,\n data: {\n user_id: 'new-user-456',\n anon_id: 'anon-789',\n },\n }),\n mapping: {\n settings: {\n identify: {\n map: {\n distinctId: 'data.user_id',\n alias: 'data.anon_id',\n },\n },\n },\n },\n out: [\n ['mp.alias', 'new-user-456', 'anon-789'],\n ['mp.track', 'user login', { distinct_id: 'new-user-456' }],\n ],\n};\n\n/**\n * Wildcard ignore — the rule matches but does nothing.\n */\nexport const wildcardIgnored: MixpanelStepExample = {\n in: getEvent('debug noise', { timestamp: 1700000109 }),\n mapping: { ignore: true },\n out: [],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IA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IACX,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,EACF,CAAC;AAAA,EACD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,UAAU;AAAA,QACR,KAAK;AAAA,UACH,YAAY;AAAA,UACZ,OAAO;AAAA,QACT;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH,CAAC,YAAY,gBAAgB,UAAU;AAAA,IACvC,CAAC,YAAY,cAAc,EAAE,aAAa,eAAe,CAAC;AAAA,EAC5D;AACF;AAKO,IAAM,kBAAuC;AAAA,EAClD,QAAI,sBAAS,eAAe,EAAE,WAAW,WAAW,CAAC;AAAA,EACrD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["import_dev","import_dev"]}
|
package/dist/dev.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,a=(a,t)=>{for(var i in t)e(a,i,{get:t[i],enumerable:!0})},t={};a(t,{MappingSchema:()=>s,SettingsSchema:()=>o,mapping:()=>l,settings:()=>r});import{zodToSchema as i}from"@walkeros/core/dev";import{z as n}from"@walkeros/core/dev";var o=n.object({apiKey:n.string().min(1).describe("Your Mixpanel project token. Find it in Project Settings > Access Keys. Passed as the first argument to Mixpanel.init()."),secret:n.string().describe("API secret for the /import endpoint (historical data). Required when useImport is true.").optional(),host:n.string().describe("Mixpanel API host. Default: 'api.mixpanel.com' (US). Use 'api-eu.mixpanel.com' (EU) or 'api-in.mixpanel.com' (India).").optional(),protocol:n.string().describe("Protocol for API requests. Default: 'https'.").optional(),keepAlive:n.boolean().describe("Reuse HTTP connections. Default: true.").optional(),geolocate:n.boolean().describe("Parse IP for geolocation. Default: false. Server IP caveat: all users map to server location unless $ip is overridden.").optional(),debug:n.boolean().describe("Enable SDK debug logging. Default: false.").optional(),verbose:n.boolean().describe("Enable verbose request logging. Default: false.").optional(),test:n.boolean().describe("Enable dry-run mode. Default: false.").optional(),useImport:n.boolean().describe("Use /import endpoint instead of /track. Accepts events of any age (no 5-day limit). Requires secret for authentication.").optional(),identify:n.unknown().describe("walkerOS mapping value resolving to { distinctId, alias? }. distinctId is passed as distinct_id on every SDK call.").optional(),include:n.unknown().describe("Event data sections to flatten into track() properties. Example: ['data', 'globals']. Sections are prefixed (data_, globals_, etc.).").optional()});import{z as p}from"@walkeros/core/dev";var s=p.object({identify:p.unknown().describe("Per-event identity mapping. Resolves to { distinctId, alias? }. distinctId is passed as distinct_id to all SDK calls.").optional(),people:p.unknown().describe("Per-event people operations. Resolves to an object with any of: set, set_once, increment, append, union, remove, unset, delete_user. Each key fires a separate mp.people.* call with distinct_id as first arg.").optional(),group:p.unknown().describe("Per-event group association. Resolves to { key, id }. The group key/id is added as a track() property.").optional(),groupProfile:p.unknown().describe("Per-event group profile operations. Resolves to { key, id, set?, set_once?, union?, remove?, unset?, delete? }. Fires mp.groups.* calls.").optional(),useImport:p.unknown().describe("Per-event import flag. When truthy, uses mp.import() instead of mp.track() for this rule.").optional()}),r=i(o),l=i(s),m={};a(m,{env:()=>d,step:()=>f});var d={};a(d,{push:()=>_,simulation:()=>v});var c=()=>{},u={set:c,set_once:c,increment:c,append:c,union:c,remove:c,unset:c,delete_user:c},g={set:c,set_once:c,union:c,remove:c,unset:c,delete_group:c};var _={Mixpanel:{init:function(){return{track:c,import:c,alias:c,people:{...u},groups:{...g}}}}},v=["call:Mixpanel.init","call:mp.track","call:mp.import","call:mp.alias","call:mp.people.set","call:mp.people.set_once","call:mp.people.increment","call:mp.people.append","call:mp.people.union","call:mp.people.remove","call:mp.people.unset","call:mp.people.delete_user","call:mp.groups.set","call:mp.groups.set_once","call:mp.groups.union","call:mp.groups.remove","call:mp.groups.unset","call:mp.groups.delete_group"],f={};a(f,{aliasBeforeTrack:()=>D,allPeopleOperations:()=>P,companyGroupProfile:()=>S,defaultEventForwarding:()=>k,historicalImport:()=>x,perEventIdentify:()=>w,trackWithGroup:()=>I,trackWithInclude:()=>b,userLoginPeopleSet:()=>h,wildcardIgnored:()=>A});import{getEvent as y}from"@walkeros/core";var k={in:y("product view",{timestamp:1700000100}),settings:{identify:{map:{distinctId:"user.id"}}},out:["mp.track","product view",{distinct_id:"us3r"}]},b={in:y("product view",{timestamp:1700000101}),settings:{identify:{map:{distinctId:"user.id"}}},configInclude:["data"],out:["mp.track","product view",{distinct_id:"us3r",data_id:"ers",data_name:"Everyday Ruck Snack",data_color:"black",data_size:"l",data_price:420}]},w={in:y("user login",{timestamp:1700000102,data:{user_id:"resolved-id",plan:"premium"}}),mapping:{settings:{identify:{map:{distinctId:"data.user_id"}}}},out:["mp.track","user login",{distinct_id:"resolved-id"}]},I={in:y("page view",{timestamp:1700000103,data:{company_id:"acme"}}),settings:{identify:{map:{distinctId:"user.id"}}},mapping:{settings:{group:{map:{key:{value:"company_id"},id:"data.company_id"}}}},out:["mp.track","page view",{distinct_id:"us3r",company_id:"acme"}]},h={in:y("user login",{timestamp:1700000104,data:{user_id:"new-user-123",plan:"premium",company:"Acme",email:"user@acme.com"}}),mapping:{skip:!0,settings:{identify:{map:{distinctId:"data.user_id"}},people:{map:{set:{map:{plan:"data.plan",company:"data.company",email:"data.email"}},set_once:{map:{first_login:"timestamp"}},increment:{map:{login_count:{value:1}}}}}}},out:[["mp.people.set","new-user-123",{plan:"premium",company:"Acme",email:"user@acme.com"}],["mp.people.set_once","new-user-123",{first_login:1700000104}],["mp.people.increment","new-user-123",{login_count:1}]]},P={in:y("profile update",{timestamp:1700000105,data:{name:"Jane Doe",email:"jane@acme.com",page:"/docs/getting-started",removed_tag:"trial",source:"referral"}}),mapping:{skip:!0,settings:{identify:{map:{distinctId:"user.id"}},people:{map:{set:{map:{name:"data.name",email:"data.email"}},set_once:{map:{signup_source:"data.source"}},increment:{map:{page_views:{value:1}}},append:{map:{visited_pages:"data.page"}},union:{map:{unique_tags:{value:["active"]}}},remove:{map:{tags:"data.removed_tag"}},unset:{value:["old_plan"]}}}}},out:[["mp.people.set","us3r",{name:"Jane Doe",email:"jane@acme.com"}],["mp.people.set_once","us3r",{signup_source:"referral"}],["mp.people.increment","us3r",{page_views:1}],["mp.people.append","us3r",{visited_pages:"/docs/getting-started"}],["mp.people.union","us3r",{unique_tags:["active"]}],["mp.people.remove","us3r",{tags:"trial"}],["mp.people.unset","us3r",["old_plan"]]]},S={in:y("company update",{timestamp:1700000106,data:{company_id:"acme-inc",company_name:"Acme, Inc.",plan:"enterprise",employee_count:250,founded_year:2010}}),mapping:{skip:!0,settings:{groupProfile:{map:{key:{value:"company_id"},id:"data.company_id",set:{map:{name:"data.company_name",plan:"data.plan",employee_count:"data.employee_count"}},set_once:{map:{founded:"data.founded_year"}}}}}},out:[["mp.groups.set","company_id","acme-inc",{name:"Acme, Inc.",plan:"enterprise",employee_count:250}],["mp.groups.set_once","company_id","acme-inc",{founded:2010}]]},x={in:y("order complete",{timestamp:1700000107,data:{total:99.99}}),settings:{useImport:!0,identify:{map:{distinctId:"user.id"}}},out:["mp.import","order complete",1700000107,{distinct_id:"us3r"}]},D={in:y("user login",{timestamp:1700000108,data:{user_id:"new-user-456",anon_id:"anon-789"}}),mapping:{settings:{identify:{map:{distinctId:"data.user_id",alias:"data.anon_id"}}}},out:[["mp.alias","new-user-456","anon-789"],["mp.track","user login",{distinct_id:"new-user-456"}]]},A={in:y("debug noise",{timestamp:1700000109}),mapping:{ignore:!0},out:[]};export{m as examples,t as schemas};//# sourceMappingURL=dev.mjs.map
|
|
1
|
+
var e=Object.defineProperty,a=(a,t)=>{for(var i in t)e(a,i,{get:t[i],enumerable:!0})},t={};a(t,{MappingSchema:()=>s,SettingsSchema:()=>o,mapping:()=>l,settings:()=>r});import{zodToSchema as i}from"@walkeros/core/dev";import{z as n}from"@walkeros/core/dev";var o=n.object({apiKey:n.string().min(1).describe("Your Mixpanel project token. Find it in Project Settings > Access Keys. Passed as the first argument to Mixpanel.init()."),secret:n.string().describe("API secret for the /import endpoint (historical data). Required when useImport is true.").optional(),host:n.string().describe("Mixpanel API host. Default: 'api.mixpanel.com' (US). Use 'api-eu.mixpanel.com' (EU) or 'api-in.mixpanel.com' (India).").optional(),protocol:n.string().describe("Protocol for API requests. Default: 'https'.").optional(),keepAlive:n.boolean().describe("Reuse HTTP connections. Default: true.").optional(),geolocate:n.boolean().describe("Parse IP for geolocation. Default: false. Server IP caveat: all users map to server location unless $ip is overridden.").optional(),debug:n.boolean().describe("Enable SDK debug logging. Default: false.").optional(),verbose:n.boolean().describe("Enable verbose request logging. Default: false.").optional(),test:n.boolean().describe("Enable dry-run mode. Default: false.").optional(),useImport:n.boolean().describe("Use /import endpoint instead of /track. Accepts events of any age (no 5-day limit). Requires secret for authentication.").optional(),identify:n.unknown().describe("walkerOS mapping value resolving to { distinctId, alias? }. distinctId is passed as distinct_id on every SDK call.").optional(),include:n.unknown().describe("Event data sections to flatten into track() properties. Example: ['data', 'globals']. Sections are prefixed (data_, globals_, etc.).").optional()});import{z as p}from"@walkeros/core/dev";var s=p.object({identify:p.unknown().describe("Per-event identity mapping. Resolves to { distinctId, alias? }. distinctId is passed as distinct_id to all SDK calls.").optional(),people:p.unknown().describe("Per-event people operations. Resolves to an object with any of: set, set_once, increment, append, union, remove, unset, delete_user. Each key fires a separate mp.people.* call with distinct_id as first arg.").optional(),group:p.unknown().describe("Per-event group association. Resolves to { key, id }. The group key/id is added as a track() property.").optional(),groupProfile:p.unknown().describe("Per-event group profile operations. Resolves to { key, id, set?, set_once?, union?, remove?, unset?, delete? }. Fires mp.groups.* calls.").optional(),useImport:p.unknown().describe("Per-event import flag. When truthy, uses mp.import() instead of mp.track() for this rule.").optional()}),r=i(o),l=i(s),m={};a(m,{env:()=>d,step:()=>f});var d={};a(d,{push:()=>_,simulation:()=>v});var c=()=>{},u={set:c,set_once:c,increment:c,append:c,union:c,remove:c,unset:c,delete_user:c},g={set:c,set_once:c,union:c,remove:c,unset:c,delete_group:c};var _={Mixpanel:{init:function(){return{track:c,import:c,alias:c,people:{...u},groups:{...g}}}}},v=["call:Mixpanel.init","call:mp.track","call:mp.import","call:mp.alias","call:mp.people.set","call:mp.people.set_once","call:mp.people.increment","call:mp.people.append","call:mp.people.union","call:mp.people.remove","call:mp.people.unset","call:mp.people.delete_user","call:mp.groups.set","call:mp.groups.set_once","call:mp.groups.union","call:mp.groups.remove","call:mp.groups.unset","call:mp.groups.delete_group"],f={};a(f,{aliasBeforeTrack:()=>D,allPeopleOperations:()=>P,companyGroupProfile:()=>S,defaultEventForwarding:()=>k,historicalImport:()=>x,perEventIdentify:()=>w,trackWithGroup:()=>I,trackWithInclude:()=>b,userLoginPeopleSet:()=>h,wildcardIgnored:()=>A});import{getEvent as y}from"@walkeros/core";var k={in:y("product view",{timestamp:1700000100}),settings:{identify:{map:{distinctId:"user.id"}}},out:[["mp.track","product view",{distinct_id:"us3r"}]]},b={in:y("product view",{timestamp:1700000101}),settings:{identify:{map:{distinctId:"user.id"}}},configInclude:["data"],out:[["mp.track","product view",{distinct_id:"us3r",data_id:"ers",data_name:"Everyday Ruck Snack",data_color:"black",data_size:"l",data_price:420}]]},w={in:y("user login",{timestamp:1700000102,data:{user_id:"resolved-id",plan:"premium"}}),mapping:{settings:{identify:{map:{distinctId:"data.user_id"}}}},out:[["mp.track","user login",{distinct_id:"resolved-id"}]]},I={in:y("page view",{timestamp:1700000103,data:{company_id:"acme"}}),settings:{identify:{map:{distinctId:"user.id"}}},mapping:{settings:{group:{map:{key:{value:"company_id"},id:"data.company_id"}}}},out:[["mp.track","page view",{distinct_id:"us3r",company_id:"acme"}]]},h={in:y("user login",{timestamp:1700000104,data:{user_id:"new-user-123",plan:"premium",company:"Acme",email:"user@acme.com"}}),mapping:{skip:!0,settings:{identify:{map:{distinctId:"data.user_id"}},people:{map:{set:{map:{plan:"data.plan",company:"data.company",email:"data.email"}},set_once:{map:{first_login:"timestamp"}},increment:{map:{login_count:{value:1}}}}}}},out:[["mp.people.set","new-user-123",{plan:"premium",company:"Acme",email:"user@acme.com"}],["mp.people.set_once","new-user-123",{first_login:1700000104}],["mp.people.increment","new-user-123",{login_count:1}]]},P={in:y("profile update",{timestamp:1700000105,data:{name:"Jane Doe",email:"jane@acme.com",page:"/docs/getting-started",removed_tag:"trial",source:"referral"}}),mapping:{skip:!0,settings:{identify:{map:{distinctId:"user.id"}},people:{map:{set:{map:{name:"data.name",email:"data.email"}},set_once:{map:{signup_source:"data.source"}},increment:{map:{page_views:{value:1}}},append:{map:{visited_pages:"data.page"}},union:{map:{unique_tags:{value:["active"]}}},remove:{map:{tags:"data.removed_tag"}},unset:{value:["old_plan"]}}}}},out:[["mp.people.set","us3r",{name:"Jane Doe",email:"jane@acme.com"}],["mp.people.set_once","us3r",{signup_source:"referral"}],["mp.people.increment","us3r",{page_views:1}],["mp.people.append","us3r",{visited_pages:"/docs/getting-started"}],["mp.people.union","us3r",{unique_tags:["active"]}],["mp.people.remove","us3r",{tags:"trial"}],["mp.people.unset","us3r",["old_plan"]]]},S={in:y("company update",{timestamp:1700000106,data:{company_id:"acme-inc",company_name:"Acme, Inc.",plan:"enterprise",employee_count:250,founded_year:2010}}),mapping:{skip:!0,settings:{groupProfile:{map:{key:{value:"company_id"},id:"data.company_id",set:{map:{name:"data.company_name",plan:"data.plan",employee_count:"data.employee_count"}},set_once:{map:{founded:"data.founded_year"}}}}}},out:[["mp.groups.set","company_id","acme-inc",{name:"Acme, Inc.",plan:"enterprise",employee_count:250}],["mp.groups.set_once","company_id","acme-inc",{founded:2010}]]},x={in:y("order complete",{timestamp:1700000107,data:{total:99.99}}),settings:{useImport:!0,identify:{map:{distinctId:"user.id"}}},out:[["mp.import","order complete",1700000107,{distinct_id:"us3r"}]]},D={in:y("user login",{timestamp:1700000108,data:{user_id:"new-user-456",anon_id:"anon-789"}}),mapping:{settings:{identify:{map:{distinctId:"data.user_id",alias:"data.anon_id"}}}},out:[["mp.alias","new-user-456","anon-789"],["mp.track","user login",{distinct_id:"new-user-456"}]]},A={in:y("debug noise",{timestamp:1700000109}),mapping:{ignore:!0},out:[]};export{m as examples,t as schemas};//# sourceMappingURL=dev.mjs.map
|
package/dist/dev.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n apiKey: z\n .string()\n .min(1)\n .describe(\n 'Your Mixpanel project token. Find it in Project Settings > Access Keys. Passed as the first argument to Mixpanel.init().',\n ),\n secret: z\n .string()\n .describe(\n 'API secret for the /import endpoint (historical data). Required when useImport is true.',\n )\n .optional(),\n host: z\n .string()\n .describe(\n \"Mixpanel API host. Default: 'api.mixpanel.com' (US). Use 'api-eu.mixpanel.com' (EU) or 'api-in.mixpanel.com' (India).\",\n )\n .optional(),\n protocol: z\n .string()\n .describe(\"Protocol for API requests. Default: 'https'.\")\n .optional(),\n keepAlive: z\n .boolean()\n .describe('Reuse HTTP connections. Default: true.')\n .optional(),\n geolocate: z\n .boolean()\n .describe(\n 'Parse IP for geolocation. Default: false. Server IP caveat: all users map to server location unless $ip is overridden.',\n )\n .optional(),\n debug: z\n .boolean()\n .describe('Enable SDK debug logging. Default: false.')\n .optional(),\n verbose: z\n .boolean()\n .describe('Enable verbose request logging. Default: false.')\n .optional(),\n test: z.boolean().describe('Enable dry-run mode. Default: false.').optional(),\n useImport: z\n .boolean()\n .describe(\n 'Use /import endpoint instead of /track. Accepts events of any age (no 5-day limit). Requires secret for authentication.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to { distinctId, alias? }. distinctId is passed as distinct_id on every SDK call.',\n )\n .optional(),\n include: z\n .unknown()\n .describe(\n \"Event data sections to flatten into track() properties. Example: ['data', 'globals']. Sections are prefixed (data_, globals_, etc.).\",\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identity mapping. Resolves to { distinctId, alias? }. distinctId is passed as distinct_id to all SDK calls.',\n )\n .optional(),\n people: z\n .unknown()\n .describe(\n 'Per-event people operations. Resolves to an object with any of: set, set_once, increment, append, union, remove, unset, delete_user. Each key fires a separate mp.people.* call with distinct_id as first arg.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Per-event group association. Resolves to { key, id }. The group key/id is added as a track() property.',\n )\n .optional(),\n groupProfile: z\n .unknown()\n .describe(\n 'Per-event group profile operations. Resolves to { key, id, set?, set_once?, union?, remove?, unset?, delete? }. Fires mp.groups.* calls.',\n )\n .optional(),\n useImport: z\n .unknown()\n .describe(\n 'Per-event import flag. When truthy, uses mp.import() instead of mp.track() for this rule.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type {\n Env,\n MixpanelClient,\n MixpanelPeople,\n MixpanelGroups,\n} from '../types';\n\nconst noop = (() => {}) as (...args: unknown[]) => void;\n\nconst noopPeople: MixpanelPeople = {\n set: noop,\n set_once: noop,\n increment: noop,\n append: noop,\n union: noop,\n remove: noop,\n unset: noop,\n delete_user: noop,\n};\n\nconst noopGroups: MixpanelGroups = {\n set: noop,\n set_once: noop,\n union: noop,\n remove: noop,\n unset: noop,\n delete_group: noop,\n};\n\n/**\n * Mock Mixpanel factory that returns a no-op client instance.\n * Tests replace individual methods with spies.\n */\nfunction mockInit(): MixpanelClient {\n return {\n track: noop,\n import: noop,\n alias: noop,\n people: { ...noopPeople },\n groups: { ...noopGroups },\n };\n}\n\n/**\n * Standard mock environment for push operations.\n * The test runner clones this and replaces methods with spies.\n */\nexport const push: Env = {\n Mixpanel: { init: mockInit as (...args: unknown[]) => MixpanelClient },\n};\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = [\n 'call:Mixpanel.init',\n 'call:mp.track',\n 'call:mp.import',\n 'call:mp.alias',\n 'call:mp.people.set',\n 'call:mp.people.set_once',\n 'call:mp.people.increment',\n 'call:mp.people.append',\n 'call:mp.people.union',\n 'call:mp.people.remove',\n 'call:mp.people.unset',\n 'call:mp.people.delete_user',\n 'call:mp.groups.set',\n 'call:mp.groups.set_once',\n 'call:mp.groups.union',\n 'call:mp.groups.remove',\n 'call:mp.groups.unset',\n 'call:mp.groups.delete_group',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Step examples may carry destination-level settings and configInclude.\n * The test runner reads these to configure the destination.\n */\nexport type MixpanelStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n configInclude?: string[];\n};\n\n/**\n * Default event forwarding — every walkerOS event becomes\n * mp.track(event.name, { distinct_id, ...properties }).\n * With default settings.identify resolving user.id.\n */\nexport const defaultEventForwarding: MixpanelStepExample = {\n in: getEvent('product view', { timestamp: 1700000100 }),\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n out: ['mp.track', 'product view', { distinct_id: 'us3r' }],\n};\n\n/**\n * Track with include — flattens walkerOS `data` section into\n * prefixed track() properties.\n */\nexport const trackWithInclude: MixpanelStepExample = {\n in: getEvent('product view', { timestamp: 1700000101 }),\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n configInclude: ['data'],\n out: [\n 'mp.track',\n 'product view',\n {\n distinct_id: 'us3r',\n data_id: 'ers',\n data_name: 'Everyday Ruck Snack',\n data_color: 'black',\n data_size: 'l',\n data_price: 420,\n },\n ],\n};\n\n/**\n * Per-event identify — mapping-level settings.identify overrides\n * destination-level default.\n */\nexport const perEventIdentify: MixpanelStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000102,\n data: {\n user_id: 'resolved-id',\n plan: 'premium',\n },\n }),\n mapping: {\n settings: {\n identify: {\n map: {\n distinctId: 'data.user_id',\n },\n },\n },\n },\n out: [\n 'mp.track',\n 'user login',\n {\n distinct_id: 'resolved-id',\n },\n ],\n};\n\n/**\n * Track with group — group key/id attached as track property.\n */\nexport const trackWithGroup: MixpanelStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000103,\n data: {\n company_id: 'acme',\n },\n }),\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n mapping: {\n settings: {\n group: {\n map: {\n key: { value: 'company_id' },\n id: 'data.company_id',\n },\n },\n },\n },\n out: [\n 'mp.track',\n 'page view',\n {\n distinct_id: 'us3r',\n company_id: 'acme',\n },\n ],\n};\n\n/**\n * User login with people operations — skip: true suppresses track,\n * only identity + people side effects fire.\n */\nexport const userLoginPeopleSet: MixpanelStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000104,\n data: {\n user_id: 'new-user-123',\n plan: 'premium',\n company: 'Acme',\n email: 'user@acme.com',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n distinctId: 'data.user_id',\n },\n },\n people: {\n map: {\n set: {\n map: {\n plan: 'data.plan',\n company: 'data.company',\n email: 'data.email',\n },\n },\n set_once: {\n map: {\n first_login: 'timestamp',\n },\n },\n increment: {\n map: {\n login_count: { value: 1 },\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'mp.people.set',\n 'new-user-123',\n { plan: 'premium', company: 'Acme', email: 'user@acme.com' },\n ],\n ['mp.people.set_once', 'new-user-123', { first_login: 1700000104 }],\n ['mp.people.increment', 'new-user-123', { login_count: 1 }],\n ],\n};\n\n/**\n * Full people operation vocabulary — exercises set, set_once, increment,\n * append, union, remove, unset, delete_user.\n */\nexport const allPeopleOperations: MixpanelStepExample = {\n in: getEvent('profile update', {\n timestamp: 1700000105,\n data: {\n name: 'Jane Doe',\n email: 'jane@acme.com',\n page: '/docs/getting-started',\n removed_tag: 'trial',\n source: 'referral',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n people: {\n map: {\n set: {\n map: {\n name: 'data.name',\n email: 'data.email',\n },\n },\n set_once: {\n map: {\n signup_source: 'data.source',\n },\n },\n increment: {\n map: {\n page_views: { value: 1 },\n },\n },\n append: {\n map: {\n visited_pages: 'data.page',\n },\n },\n union: {\n map: {\n unique_tags: { value: ['active'] },\n },\n },\n remove: {\n map: {\n tags: 'data.removed_tag',\n },\n },\n unset: { value: ['old_plan'] },\n },\n },\n },\n },\n out: [\n ['mp.people.set', 'us3r', { name: 'Jane Doe', email: 'jane@acme.com' }],\n ['mp.people.set_once', 'us3r', { signup_source: 'referral' }],\n ['mp.people.increment', 'us3r', { page_views: 1 }],\n ['mp.people.append', 'us3r', { visited_pages: '/docs/getting-started' }],\n ['mp.people.union', 'us3r', { unique_tags: ['active'] }],\n ['mp.people.remove', 'us3r', { tags: 'trial' }],\n ['mp.people.unset', 'us3r', ['old_plan']],\n ],\n};\n\n/**\n * Group profile operations — settings.groupProfile with set and set_once.\n */\nexport const companyGroupProfile: MixpanelStepExample = {\n in: getEvent('company update', {\n timestamp: 1700000106,\n data: {\n company_id: 'acme-inc',\n company_name: 'Acme, Inc.',\n plan: 'enterprise',\n employee_count: 250,\n founded_year: 2010,\n },\n }),\n mapping: {\n skip: true,\n settings: {\n groupProfile: {\n map: {\n key: { value: 'company_id' },\n id: 'data.company_id',\n set: {\n map: {\n name: 'data.company_name',\n plan: 'data.plan',\n employee_count: 'data.employee_count',\n },\n },\n set_once: {\n map: {\n founded: 'data.founded_year',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'mp.groups.set',\n 'company_id',\n 'acme-inc',\n { name: 'Acme, Inc.', plan: 'enterprise', employee_count: 250 },\n ],\n ['mp.groups.set_once', 'company_id', 'acme-inc', { founded: 2010 }],\n ],\n};\n\n/**\n * Historical import — useImport: true uses mp.import() instead of mp.track().\n */\nexport const historicalImport: MixpanelStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000107,\n data: {\n total: 99.99,\n },\n }),\n settings: {\n useImport: true,\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n out: ['mp.import', 'order complete', 1700000107, { distinct_id: 'us3r' }],\n};\n\n/**\n * Alias — legacy identity merge. Fires mp.alias before track.\n */\nexport const aliasBeforeTrack: MixpanelStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000108,\n data: {\n user_id: 'new-user-456',\n anon_id: 'anon-789',\n },\n }),\n mapping: {\n settings: {\n identify: {\n map: {\n distinctId: 'data.user_id',\n alias: 'data.anon_id',\n },\n },\n },\n },\n out: [\n ['mp.alias', 'new-user-456', 'anon-789'],\n ['mp.track', 'user login', { distinct_id: 'new-user-456' }],\n ],\n};\n\n/**\n * Wildcard ignore — the rule matches but does nothing.\n */\nexport const wildcardIgnored: MixpanelStepExample = {\n in: getEvent('debug noise', { timestamp: 1700000109 }),\n mapping: { ignore: true },\n out: [],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,QAAQ,EACL,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,EACL,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,EACH,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,EACP,OAAO,EACP,SAAS,8CAA8C,EACvD,SAAS;AAAA,EACZ,WAAW,EACR,QAAQ,EACR,SAAS,wCAAwC,EACjD,SAAS;AAAA,EACZ,WAAW,EACR,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,OAAO,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;AAAA,YACX;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA,EAAE,MAAM,cAAc,MAAM,cAAc,gBAAgB,IAAI;AAAA,IAChE;AAAA,IACA,CAAC,sBAAsB,cAAc,YAAY,EAAE,SAAS,KAAK,CAAC;AAAA,EACpE;AACF;AAKO,IAAM,mBAAwC;AAAA,EACnD,IAAI,SAAS,kBAAkB;AAAA,IAC7B,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,OAAO;AAAA,IACT;AAAA,EACF,CAAC;AAAA,EACD,UAAU;AAAA,IACR,WAAW;AAAA,IACX,UAAU;AAAA,MACR,KAAK;AAAA,QACH,YAAY;AAAA,MACd;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK,CAAC,aAAa,kBAAkB,YAAY,EAAE,aAAa,OAAO,CAAC;AAC1E;AAKO,IAAM,mBAAwC;AAAA,EACnD,IAAI,SAAS,cAAc;AAAA,IACzB,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,EACF,CAAC;AAAA,EACD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,UAAU;AAAA,QACR,KAAK;AAAA,UACH,YAAY;AAAA,UACZ,OAAO;AAAA,QACT;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH,CAAC,YAAY,gBAAgB,UAAU;AAAA,IACvC,CAAC,YAAY,cAAc,EAAE,aAAa,eAAe,CAAC;AAAA,EAC5D;AACF;AAKO,IAAM,kBAAuC;AAAA,EAClD,IAAI,SAAS,eAAe,EAAE,WAAW,WAAW,CAAC;AAAA,EACrD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["z"]}
|
|
1
|
+
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n apiKey: z\n .string()\n .min(1)\n .describe(\n 'Your Mixpanel project token. Find it in Project Settings > Access Keys. Passed as the first argument to Mixpanel.init().',\n ),\n secret: z\n .string()\n .describe(\n 'API secret for the /import endpoint (historical data). Required when useImport is true.',\n )\n .optional(),\n host: z\n .string()\n .describe(\n \"Mixpanel API host. Default: 'api.mixpanel.com' (US). Use 'api-eu.mixpanel.com' (EU) or 'api-in.mixpanel.com' (India).\",\n )\n .optional(),\n protocol: z\n .string()\n .describe(\"Protocol for API requests. Default: 'https'.\")\n .optional(),\n keepAlive: z\n .boolean()\n .describe('Reuse HTTP connections. Default: true.')\n .optional(),\n geolocate: z\n .boolean()\n .describe(\n 'Parse IP for geolocation. Default: false. Server IP caveat: all users map to server location unless $ip is overridden.',\n )\n .optional(),\n debug: z\n .boolean()\n .describe('Enable SDK debug logging. Default: false.')\n .optional(),\n verbose: z\n .boolean()\n .describe('Enable verbose request logging. Default: false.')\n .optional(),\n test: z.boolean().describe('Enable dry-run mode. Default: false.').optional(),\n useImport: z\n .boolean()\n .describe(\n 'Use /import endpoint instead of /track. Accepts events of any age (no 5-day limit). Requires secret for authentication.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to { distinctId, alias? }. distinctId is passed as distinct_id on every SDK call.',\n )\n .optional(),\n include: z\n .unknown()\n .describe(\n \"Event data sections to flatten into track() properties. Example: ['data', 'globals']. Sections are prefixed (data_, globals_, etc.).\",\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identity mapping. Resolves to { distinctId, alias? }. distinctId is passed as distinct_id to all SDK calls.',\n )\n .optional(),\n people: z\n .unknown()\n .describe(\n 'Per-event people operations. Resolves to an object with any of: set, set_once, increment, append, union, remove, unset, delete_user. Each key fires a separate mp.people.* call with distinct_id as first arg.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Per-event group association. Resolves to { key, id }. The group key/id is added as a track() property.',\n )\n .optional(),\n groupProfile: z\n .unknown()\n .describe(\n 'Per-event group profile operations. Resolves to { key, id, set?, set_once?, union?, remove?, unset?, delete? }. Fires mp.groups.* calls.',\n )\n .optional(),\n useImport: z\n .unknown()\n .describe(\n 'Per-event import flag. When truthy, uses mp.import() instead of mp.track() for this rule.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type {\n Env,\n MixpanelClient,\n MixpanelPeople,\n MixpanelGroups,\n} from '../types';\n\nconst noop = (() => {}) as (...args: unknown[]) => void;\n\nconst noopPeople: MixpanelPeople = {\n set: noop,\n set_once: noop,\n increment: noop,\n append: noop,\n union: noop,\n remove: noop,\n unset: noop,\n delete_user: noop,\n};\n\nconst noopGroups: MixpanelGroups = {\n set: noop,\n set_once: noop,\n union: noop,\n remove: noop,\n unset: noop,\n delete_group: noop,\n};\n\n/**\n * Mock Mixpanel factory that returns a no-op client instance.\n * Tests replace individual methods with spies.\n */\nfunction mockInit(): MixpanelClient {\n return {\n track: noop,\n import: noop,\n alias: noop,\n people: { ...noopPeople },\n groups: { ...noopGroups },\n };\n}\n\n/**\n * Standard mock environment for push operations.\n * The test runner clones this and replaces methods with spies.\n */\nexport const push: Env = {\n Mixpanel: { init: mockInit as (...args: unknown[]) => MixpanelClient },\n};\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = [\n 'call:Mixpanel.init',\n 'call:mp.track',\n 'call:mp.import',\n 'call:mp.alias',\n 'call:mp.people.set',\n 'call:mp.people.set_once',\n 'call:mp.people.increment',\n 'call:mp.people.append',\n 'call:mp.people.union',\n 'call:mp.people.remove',\n 'call:mp.people.unset',\n 'call:mp.people.delete_user',\n 'call:mp.groups.set',\n 'call:mp.groups.set_once',\n 'call:mp.groups.union',\n 'call:mp.groups.remove',\n 'call:mp.groups.unset',\n 'call:mp.groups.delete_group',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Mixpanel server SDK step examples.\n *\n * At push time, the destination calls the `mixpanel` Node SDK via the\n * client returned from `Mixpanel.init(...)`. Public method paths users\n * see on the client are:\n *\n * - `mp.track(eventName, properties)`\n * - `mp.import(eventName, time, properties)` (when `useImport: true`)\n * - `mp.alias(distinctId, alias)` (fires before track)\n * - `mp.people.{set,set_once,increment,append,union,remove,unset,delete_user}(...)`\n * - `mp.groups.{set,set_once,union,remove,unset,delete_group}(...)`\n *\n * Each `out` is `[[callable, ...args], ...]`. The test filters out the\n * one-time `Mixpanel.init` call (fired during destination init) so only\n * per-event SDK calls are compared.\n *\n * For events marked `skip: true` or `ignore: true`, `track()` does not\n * fire — only the side-effect calls (people/groups/alias) appear.\n */\n\n/**\n * Step examples may carry destination-level settings and configInclude.\n * The test runner reads these to configure the destination.\n */\nexport type MixpanelStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n configInclude?: string[];\n};\n\n/**\n * Default event forwarding — every walkerOS event becomes\n * mp.track(event.name, { distinct_id, ...properties }).\n * With default settings.identify resolving user.id.\n */\nexport const defaultEventForwarding: MixpanelStepExample = {\n in: getEvent('product view', { timestamp: 1700000100 }),\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n out: [['mp.track', 'product view', { distinct_id: 'us3r' }]],\n};\n\n/**\n * Track with include — flattens walkerOS `data` section into\n * prefixed track() properties.\n */\nexport const trackWithInclude: MixpanelStepExample = {\n in: getEvent('product view', { timestamp: 1700000101 }),\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n configInclude: ['data'],\n out: [\n [\n 'mp.track',\n 'product view',\n {\n distinct_id: 'us3r',\n data_id: 'ers',\n data_name: 'Everyday Ruck Snack',\n data_color: 'black',\n data_size: 'l',\n data_price: 420,\n },\n ],\n ],\n};\n\n/**\n * Per-event identify — mapping-level settings.identify overrides\n * destination-level default.\n */\nexport const perEventIdentify: MixpanelStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000102,\n data: {\n user_id: 'resolved-id',\n plan: 'premium',\n },\n }),\n mapping: {\n settings: {\n identify: {\n map: {\n distinctId: 'data.user_id',\n },\n },\n },\n },\n out: [\n [\n 'mp.track',\n 'user login',\n {\n distinct_id: 'resolved-id',\n },\n ],\n ],\n};\n\n/**\n * Track with group — group key/id attached as track property.\n */\nexport const trackWithGroup: MixpanelStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000103,\n data: {\n company_id: 'acme',\n },\n }),\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n mapping: {\n settings: {\n group: {\n map: {\n key: { value: 'company_id' },\n id: 'data.company_id',\n },\n },\n },\n },\n out: [\n [\n 'mp.track',\n 'page view',\n {\n distinct_id: 'us3r',\n company_id: 'acme',\n },\n ],\n ],\n};\n\n/**\n * User login with people operations — skip: true suppresses track,\n * only identity + people side effects fire.\n */\nexport const userLoginPeopleSet: MixpanelStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000104,\n data: {\n user_id: 'new-user-123',\n plan: 'premium',\n company: 'Acme',\n email: 'user@acme.com',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n distinctId: 'data.user_id',\n },\n },\n people: {\n map: {\n set: {\n map: {\n plan: 'data.plan',\n company: 'data.company',\n email: 'data.email',\n },\n },\n set_once: {\n map: {\n first_login: 'timestamp',\n },\n },\n increment: {\n map: {\n login_count: { value: 1 },\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'mp.people.set',\n 'new-user-123',\n { plan: 'premium', company: 'Acme', email: 'user@acme.com' },\n ],\n ['mp.people.set_once', 'new-user-123', { first_login: 1700000104 }],\n ['mp.people.increment', 'new-user-123', { login_count: 1 }],\n ],\n};\n\n/**\n * Full people operation vocabulary — exercises set, set_once, increment,\n * append, union, remove, unset, delete_user.\n */\nexport const allPeopleOperations: MixpanelStepExample = {\n in: getEvent('profile update', {\n timestamp: 1700000105,\n data: {\n name: 'Jane Doe',\n email: 'jane@acme.com',\n page: '/docs/getting-started',\n removed_tag: 'trial',\n source: 'referral',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n people: {\n map: {\n set: {\n map: {\n name: 'data.name',\n email: 'data.email',\n },\n },\n set_once: {\n map: {\n signup_source: 'data.source',\n },\n },\n increment: {\n map: {\n page_views: { value: 1 },\n },\n },\n append: {\n map: {\n visited_pages: 'data.page',\n },\n },\n union: {\n map: {\n unique_tags: { value: ['active'] },\n },\n },\n remove: {\n map: {\n tags: 'data.removed_tag',\n },\n },\n unset: { value: ['old_plan'] },\n },\n },\n },\n },\n out: [\n ['mp.people.set', 'us3r', { name: 'Jane Doe', email: 'jane@acme.com' }],\n ['mp.people.set_once', 'us3r', { signup_source: 'referral' }],\n ['mp.people.increment', 'us3r', { page_views: 1 }],\n ['mp.people.append', 'us3r', { visited_pages: '/docs/getting-started' }],\n ['mp.people.union', 'us3r', { unique_tags: ['active'] }],\n ['mp.people.remove', 'us3r', { tags: 'trial' }],\n ['mp.people.unset', 'us3r', ['old_plan']],\n ],\n};\n\n/**\n * Group profile operations — settings.groupProfile with set and set_once.\n */\nexport const companyGroupProfile: MixpanelStepExample = {\n in: getEvent('company update', {\n timestamp: 1700000106,\n data: {\n company_id: 'acme-inc',\n company_name: 'Acme, Inc.',\n plan: 'enterprise',\n employee_count: 250,\n founded_year: 2010,\n },\n }),\n mapping: {\n skip: true,\n settings: {\n groupProfile: {\n map: {\n key: { value: 'company_id' },\n id: 'data.company_id',\n set: {\n map: {\n name: 'data.company_name',\n plan: 'data.plan',\n employee_count: 'data.employee_count',\n },\n },\n set_once: {\n map: {\n founded: 'data.founded_year',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'mp.groups.set',\n 'company_id',\n 'acme-inc',\n { name: 'Acme, Inc.', plan: 'enterprise', employee_count: 250 },\n ],\n ['mp.groups.set_once', 'company_id', 'acme-inc', { founded: 2010 }],\n ],\n};\n\n/**\n * Historical import — useImport: true uses mp.import() instead of mp.track().\n */\nexport const historicalImport: MixpanelStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000107,\n data: {\n total: 99.99,\n },\n }),\n settings: {\n useImport: true,\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n out: [['mp.import', 'order complete', 1700000107, { distinct_id: 'us3r' }]],\n};\n\n/**\n * Alias — legacy identity merge. Fires mp.alias before track.\n */\nexport const aliasBeforeTrack: MixpanelStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000108,\n data: {\n user_id: 'new-user-456',\n anon_id: 'anon-789',\n },\n }),\n mapping: {\n settings: {\n identify: {\n map: {\n distinctId: 'data.user_id',\n alias: 'data.anon_id',\n },\n },\n },\n },\n out: [\n ['mp.alias', 'new-user-456', 'anon-789'],\n ['mp.track', 'user login', { distinct_id: 'new-user-456' }],\n ],\n};\n\n/**\n * Wildcard ignore — the rule matches but does nothing.\n */\nexport const wildcardIgnored: MixpanelStepExample = {\n in: getEvent('debug noise', { timestamp: 1700000109 }),\n mapping: { ignore: true },\n out: [],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,QAAQ,EACL,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA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AK;AAAA,UACH,YAAY;AAAA,UACZ,OAAO;AAAA,QACT;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH,CAAC,YAAY,gBAAgB,UAAU;AAAA,IACvC,CAAC,YAAY,cAAc,EAAE,aAAa,eAAe,CAAC;AAAA,EAC5D;AACF;AAKO,IAAM,kBAAuC;AAAA,EAClD,IAAI,SAAS,eAAe,EAAE,WAAW,WAAW,CAAC;AAAA,EACrD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["z"]}
|
|
@@ -79,6 +79,26 @@ declare namespace env {
|
|
|
79
79
|
export { env_push as push, env_simulation as simulation };
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
/**
|
|
83
|
+
* Mixpanel server SDK step examples.
|
|
84
|
+
*
|
|
85
|
+
* At push time, the destination calls the `mixpanel` Node SDK via the
|
|
86
|
+
* client returned from `Mixpanel.init(...)`. Public method paths users
|
|
87
|
+
* see on the client are:
|
|
88
|
+
*
|
|
89
|
+
* - `mp.track(eventName, properties)`
|
|
90
|
+
* - `mp.import(eventName, time, properties)` (when `useImport: true`)
|
|
91
|
+
* - `mp.alias(distinctId, alias)` (fires before track)
|
|
92
|
+
* - `mp.people.{set,set_once,increment,append,union,remove,unset,delete_user}(...)`
|
|
93
|
+
* - `mp.groups.{set,set_once,union,remove,unset,delete_group}(...)`
|
|
94
|
+
*
|
|
95
|
+
* Each `out` is `[[callable, ...args], ...]`. The test filters out the
|
|
96
|
+
* one-time `Mixpanel.init` call (fired during destination init) so only
|
|
97
|
+
* per-event SDK calls are compared.
|
|
98
|
+
*
|
|
99
|
+
* For events marked `skip: true` or `ignore: true`, `track()` does not
|
|
100
|
+
* fire — only the side-effect calls (people/groups/alias) appear.
|
|
101
|
+
*/
|
|
82
102
|
/**
|
|
83
103
|
* Step examples may carry destination-level settings and configInclude.
|
|
84
104
|
* The test runner reads these to configure the destination.
|
package/dist/examples/index.d.ts
CHANGED
|
@@ -79,6 +79,26 @@ declare namespace env {
|
|
|
79
79
|
export { env_push as push, env_simulation as simulation };
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
/**
|
|
83
|
+
* Mixpanel server SDK step examples.
|
|
84
|
+
*
|
|
85
|
+
* At push time, the destination calls the `mixpanel` Node SDK via the
|
|
86
|
+
* client returned from `Mixpanel.init(...)`. Public method paths users
|
|
87
|
+
* see on the client are:
|
|
88
|
+
*
|
|
89
|
+
* - `mp.track(eventName, properties)`
|
|
90
|
+
* - `mp.import(eventName, time, properties)` (when `useImport: true`)
|
|
91
|
+
* - `mp.alias(distinctId, alias)` (fires before track)
|
|
92
|
+
* - `mp.people.{set,set_once,increment,append,union,remove,unset,delete_user}(...)`
|
|
93
|
+
* - `mp.groups.{set,set_once,union,remove,unset,delete_group}(...)`
|
|
94
|
+
*
|
|
95
|
+
* Each `out` is `[[callable, ...args], ...]`. The test filters out the
|
|
96
|
+
* one-time `Mixpanel.init` call (fired during destination init) so only
|
|
97
|
+
* per-event SDK calls are compared.
|
|
98
|
+
*
|
|
99
|
+
* For events marked `skip: true` or `ignore: true`, `track()` does not
|
|
100
|
+
* fire — only the side-effect calls (people/groups/alias) appear.
|
|
101
|
+
*/
|
|
82
102
|
/**
|
|
83
103
|
* Step examples may carry destination-level settings and configInclude.
|
|
84
104
|
* The test runner reads these to configure the destination.
|
package/dist/examples/index.js
CHANGED
|
@@ -108,7 +108,7 @@ var defaultEventForwarding = {
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
|
-
out: ["mp.track", "product view", { distinct_id: "us3r" }]
|
|
111
|
+
out: [["mp.track", "product view", { distinct_id: "us3r" }]]
|
|
112
112
|
};
|
|
113
113
|
var trackWithInclude = {
|
|
114
114
|
in: (0, import_core.getEvent)("product view", { timestamp: 1700000101 }),
|
|
@@ -121,16 +121,18 @@ var trackWithInclude = {
|
|
|
121
121
|
},
|
|
122
122
|
configInclude: ["data"],
|
|
123
123
|
out: [
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
124
|
+
[
|
|
125
|
+
"mp.track",
|
|
126
|
+
"product view",
|
|
127
|
+
{
|
|
128
|
+
distinct_id: "us3r",
|
|
129
|
+
data_id: "ers",
|
|
130
|
+
data_name: "Everyday Ruck Snack",
|
|
131
|
+
data_color: "black",
|
|
132
|
+
data_size: "l",
|
|
133
|
+
data_price: 420
|
|
134
|
+
}
|
|
135
|
+
]
|
|
134
136
|
]
|
|
135
137
|
};
|
|
136
138
|
var perEventIdentify = {
|
|
@@ -151,11 +153,13 @@ var perEventIdentify = {
|
|
|
151
153
|
}
|
|
152
154
|
},
|
|
153
155
|
out: [
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
[
|
|
157
|
+
"mp.track",
|
|
158
|
+
"user login",
|
|
159
|
+
{
|
|
160
|
+
distinct_id: "resolved-id"
|
|
161
|
+
}
|
|
162
|
+
]
|
|
159
163
|
]
|
|
160
164
|
};
|
|
161
165
|
var trackWithGroup = {
|
|
@@ -183,12 +187,14 @@ var trackWithGroup = {
|
|
|
183
187
|
}
|
|
184
188
|
},
|
|
185
189
|
out: [
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
[
|
|
191
|
+
"mp.track",
|
|
192
|
+
"page view",
|
|
193
|
+
{
|
|
194
|
+
distinct_id: "us3r",
|
|
195
|
+
company_id: "acme"
|
|
196
|
+
}
|
|
197
|
+
]
|
|
192
198
|
]
|
|
193
199
|
};
|
|
194
200
|
var userLoginPeopleSet = {
|
|
@@ -368,7 +374,7 @@ var historicalImport = {
|
|
|
368
374
|
}
|
|
369
375
|
}
|
|
370
376
|
},
|
|
371
|
-
out: ["mp.import", "order complete", 1700000107, { distinct_id: "us3r" }]
|
|
377
|
+
out: [["mp.import", "order complete", 1700000107, { distinct_id: "us3r" }]]
|
|
372
378
|
};
|
|
373
379
|
var aliasBeforeTrack = {
|
|
374
380
|
in: (0, import_core.getEvent)("user login", {
|
package/dist/examples/index.mjs
CHANGED
|
@@ -87,7 +87,7 @@ var defaultEventForwarding = {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
|
-
out: ["mp.track", "product view", { distinct_id: "us3r" }]
|
|
90
|
+
out: [["mp.track", "product view", { distinct_id: "us3r" }]]
|
|
91
91
|
};
|
|
92
92
|
var trackWithInclude = {
|
|
93
93
|
in: getEvent("product view", { timestamp: 1700000101 }),
|
|
@@ -100,16 +100,18 @@ var trackWithInclude = {
|
|
|
100
100
|
},
|
|
101
101
|
configInclude: ["data"],
|
|
102
102
|
out: [
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
103
|
+
[
|
|
104
|
+
"mp.track",
|
|
105
|
+
"product view",
|
|
106
|
+
{
|
|
107
|
+
distinct_id: "us3r",
|
|
108
|
+
data_id: "ers",
|
|
109
|
+
data_name: "Everyday Ruck Snack",
|
|
110
|
+
data_color: "black",
|
|
111
|
+
data_size: "l",
|
|
112
|
+
data_price: 420
|
|
113
|
+
}
|
|
114
|
+
]
|
|
113
115
|
]
|
|
114
116
|
};
|
|
115
117
|
var perEventIdentify = {
|
|
@@ -130,11 +132,13 @@ var perEventIdentify = {
|
|
|
130
132
|
}
|
|
131
133
|
},
|
|
132
134
|
out: [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
[
|
|
136
|
+
"mp.track",
|
|
137
|
+
"user login",
|
|
138
|
+
{
|
|
139
|
+
distinct_id: "resolved-id"
|
|
140
|
+
}
|
|
141
|
+
]
|
|
138
142
|
]
|
|
139
143
|
};
|
|
140
144
|
var trackWithGroup = {
|
|
@@ -162,12 +166,14 @@ var trackWithGroup = {
|
|
|
162
166
|
}
|
|
163
167
|
},
|
|
164
168
|
out: [
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
[
|
|
170
|
+
"mp.track",
|
|
171
|
+
"page view",
|
|
172
|
+
{
|
|
173
|
+
distinct_id: "us3r",
|
|
174
|
+
company_id: "acme"
|
|
175
|
+
}
|
|
176
|
+
]
|
|
171
177
|
]
|
|
172
178
|
};
|
|
173
179
|
var userLoginPeopleSet = {
|
|
@@ -347,7 +353,7 @@ var historicalImport = {
|
|
|
347
353
|
}
|
|
348
354
|
}
|
|
349
355
|
},
|
|
350
|
-
out: ["mp.import", "order complete", 1700000107, { distinct_id: "us3r" }]
|
|
356
|
+
out: [["mp.import", "order complete", 1700000107, { distinct_id: "us3r" }]]
|
|
351
357
|
};
|
|
352
358
|
var aliasBeforeTrack = {
|
|
353
359
|
in: getEvent("user login", {
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/server-destination-mixpanel",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.4.0",
|
|
5
5
|
"type": "destination",
|
|
6
6
|
"platform": [
|
|
7
7
|
"server"
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
"group": "gr0up",
|
|
173
173
|
"count": 1,
|
|
174
174
|
"version": {
|
|
175
|
-
"source": "3.
|
|
175
|
+
"source": "3.4.0",
|
|
176
176
|
"tagging": 1
|
|
177
177
|
},
|
|
178
178
|
"source": {
|
|
@@ -260,7 +260,7 @@
|
|
|
260
260
|
"group": "gr0up",
|
|
261
261
|
"count": 1,
|
|
262
262
|
"version": {
|
|
263
|
-
"source": "3.
|
|
263
|
+
"source": "3.4.0",
|
|
264
264
|
"tagging": 1
|
|
265
265
|
},
|
|
266
266
|
"source": {
|
|
@@ -434,7 +434,7 @@
|
|
|
434
434
|
"group": "gr0up",
|
|
435
435
|
"count": 1,
|
|
436
436
|
"version": {
|
|
437
|
-
"source": "3.
|
|
437
|
+
"source": "3.4.0",
|
|
438
438
|
"tagging": 1
|
|
439
439
|
},
|
|
440
440
|
"source": {
|
|
@@ -529,7 +529,7 @@
|
|
|
529
529
|
"group": "gr0up",
|
|
530
530
|
"count": 1,
|
|
531
531
|
"version": {
|
|
532
|
-
"source": "3.
|
|
532
|
+
"source": "3.4.0",
|
|
533
533
|
"tagging": 1
|
|
534
534
|
},
|
|
535
535
|
"source": {
|
|
@@ -546,11 +546,13 @@
|
|
|
546
546
|
}
|
|
547
547
|
},
|
|
548
548
|
"out": [
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
549
|
+
[
|
|
550
|
+
"mp.track",
|
|
551
|
+
"product view",
|
|
552
|
+
{
|
|
553
|
+
"distinct_id": "us3r"
|
|
554
|
+
}
|
|
555
|
+
]
|
|
554
556
|
]
|
|
555
557
|
},
|
|
556
558
|
"historicalImport": {
|
|
@@ -636,7 +638,7 @@
|
|
|
636
638
|
"group": "gr0up",
|
|
637
639
|
"count": 1,
|
|
638
640
|
"version": {
|
|
639
|
-
"source": "3.
|
|
641
|
+
"source": "3.4.0",
|
|
640
642
|
"tagging": 1
|
|
641
643
|
},
|
|
642
644
|
"source": {
|
|
@@ -654,12 +656,14 @@
|
|
|
654
656
|
}
|
|
655
657
|
},
|
|
656
658
|
"out": [
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
659
|
+
[
|
|
660
|
+
"mp.import",
|
|
661
|
+
"order complete",
|
|
662
|
+
1700000107,
|
|
663
|
+
{
|
|
664
|
+
"distinct_id": "us3r"
|
|
665
|
+
}
|
|
666
|
+
]
|
|
663
667
|
]
|
|
664
668
|
},
|
|
665
669
|
"perEventIdentify": {
|
|
@@ -713,7 +717,7 @@
|
|
|
713
717
|
"group": "gr0up",
|
|
714
718
|
"count": 1,
|
|
715
719
|
"version": {
|
|
716
|
-
"source": "3.
|
|
720
|
+
"source": "3.4.0",
|
|
717
721
|
"tagging": 1
|
|
718
722
|
},
|
|
719
723
|
"source": {
|
|
@@ -732,11 +736,13 @@
|
|
|
732
736
|
}
|
|
733
737
|
},
|
|
734
738
|
"out": [
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
739
|
+
[
|
|
740
|
+
"mp.track",
|
|
741
|
+
"user login",
|
|
742
|
+
{
|
|
743
|
+
"distinct_id": "resolved-id"
|
|
744
|
+
}
|
|
745
|
+
]
|
|
740
746
|
]
|
|
741
747
|
},
|
|
742
748
|
"trackWithGroup": {
|
|
@@ -789,7 +795,7 @@
|
|
|
789
795
|
"group": "gr0up",
|
|
790
796
|
"count": 1,
|
|
791
797
|
"version": {
|
|
792
|
-
"source": "3.
|
|
798
|
+
"source": "3.4.0",
|
|
793
799
|
"tagging": 1
|
|
794
800
|
},
|
|
795
801
|
"source": {
|
|
@@ -818,12 +824,14 @@
|
|
|
818
824
|
}
|
|
819
825
|
},
|
|
820
826
|
"out": [
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
+
[
|
|
828
|
+
"mp.track",
|
|
829
|
+
"page view",
|
|
830
|
+
{
|
|
831
|
+
"distinct_id": "us3r",
|
|
832
|
+
"company_id": "acme"
|
|
833
|
+
}
|
|
834
|
+
]
|
|
827
835
|
]
|
|
828
836
|
},
|
|
829
837
|
"trackWithInclude": {
|
|
@@ -866,7 +874,7 @@
|
|
|
866
874
|
"group": "gr0up",
|
|
867
875
|
"count": 1,
|
|
868
876
|
"version": {
|
|
869
|
-
"source": "3.
|
|
877
|
+
"source": "3.4.0",
|
|
870
878
|
"tagging": 1
|
|
871
879
|
},
|
|
872
880
|
"source": {
|
|
@@ -886,16 +894,18 @@
|
|
|
886
894
|
"data"
|
|
887
895
|
],
|
|
888
896
|
"out": [
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
897
|
+
[
|
|
898
|
+
"mp.track",
|
|
899
|
+
"product view",
|
|
900
|
+
{
|
|
901
|
+
"distinct_id": "us3r",
|
|
902
|
+
"data_id": "ers",
|
|
903
|
+
"data_name": "Everyday Ruck Snack",
|
|
904
|
+
"data_color": "black",
|
|
905
|
+
"data_size": "l",
|
|
906
|
+
"data_price": 420
|
|
907
|
+
}
|
|
908
|
+
]
|
|
899
909
|
]
|
|
900
910
|
},
|
|
901
911
|
"userLoginPeopleSet": {
|
|
@@ -951,7 +961,7 @@
|
|
|
951
961
|
"group": "gr0up",
|
|
952
962
|
"count": 1,
|
|
953
963
|
"version": {
|
|
954
|
-
"source": "3.
|
|
964
|
+
"source": "3.4.0",
|
|
955
965
|
"tagging": 1
|
|
956
966
|
},
|
|
957
967
|
"source": {
|
|
@@ -1076,7 +1086,7 @@
|
|
|
1076
1086
|
"group": "gr0up",
|
|
1077
1087
|
"count": 1,
|
|
1078
1088
|
"version": {
|
|
1079
|
-
"source": "3.
|
|
1089
|
+
"source": "3.4.0",
|
|
1080
1090
|
"tagging": 1
|
|
1081
1091
|
},
|
|
1082
1092
|
"source": {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/server-destination-mixpanel",
|
|
3
3
|
"description": "Mixpanel server destination for walkerOS",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.4.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"update": "npx npm-check-updates -u && npm update"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@walkeros/core": "3.
|
|
38
|
-
"@walkeros/server-core": "3.
|
|
37
|
+
"@walkeros/core": "3.4.0",
|
|
38
|
+
"@walkeros/server-core": "3.4.0",
|
|
39
39
|
"mixpanel": "^0.21.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@walkeros/collector": "3.
|
|
42
|
+
"@walkeros/collector": "3.4.0"
|
|
43
43
|
},
|
|
44
44
|
"repository": {
|
|
45
45
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|