@walkeros/server-destination-mixpanel 3.4.0 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dev.d.mts CHANGED
@@ -172,8 +172,9 @@ declare const trackWithGroup: MixpanelStepExample;
172
172
  */
173
173
  declare const userLoginPeopleSet: MixpanelStepExample;
174
174
  /**
175
- * Full people operation vocabulary — exercises set, set_once, increment,
176
- * append, union, remove, unset, delete_user.
175
+ * Common people operation vocabulary — exercises set, set_once, increment,
176
+ * append, union, remove, unset. (delete_user is intentionally not covered
177
+ * by this example.)
177
178
  */
178
179
  declare const allPeopleOperations: MixpanelStepExample;
179
180
  /**
package/dist/dev.d.ts CHANGED
@@ -172,8 +172,9 @@ declare const trackWithGroup: MixpanelStepExample;
172
172
  */
173
173
  declare const userLoginPeopleSet: MixpanelStepExample;
174
174
  /**
175
- * Full people operation vocabulary — exercises set, set_once, increment,
176
- * append, union, remove, unset, delete_user.
175
+ * Common people operation vocabulary — exercises set, set_once, increment,
176
+ * append, union, remove, unset. (delete_user is intentionally not covered
177
+ * by this example.)
177
178
  */
178
179
  declare const allPeopleOperations: MixpanelStepExample;
179
180
  /**
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,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,o=(e,i)=>{for(var a in i)t(e,a,{get:i[a],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 a(o))n.call(e,r)||r===p||t(e,r,{get:()=>o[r],enumerable:!(s=i(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:()=>w});var _={};o(_,{push:()=>b,simulation:()=>h});var f=()=>{},y={set:f,set_once:f,increment:f,append:f,union:f,remove:f,unset:f,delete_user:f},k={set:f,set_once:f,union:f,remove:f,unset:f,delete_group:f};var b={Mixpanel:{init:function(){return{track:f,import:f,alias:f,people:{...y},groups:{...k}}}}},h=["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"],w={};o(w,{aliasBeforeTrack:()=>j,allPeopleOperations:()=>S,companyGroupProfile:()=>D,defaultEventForwarding:()=>P,historicalImport:()=>M,perEventIdentify:()=>z,trackWithGroup:()=>E,trackWithInclude:()=>x,userLoginPeopleSet:()=>A,wildcardIgnored:()=>q});var I=require("@walkeros/core"),P={title:"Default track",description:"A walkerOS event is forwarded to Mixpanel as a track call with the user id as the distinct_id.",in:(0,I.getEvent)("product view",{timestamp:1700000100}),settings:{identify:{map:{distinctId:"user.id"}}},out:[["mp.track","product view",{distinct_id:"us3r"}]]},x={title:"Track with include",description:"A destination-level include flattens the event data section into prefixed Mixpanel track properties.",in:(0,I.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}]]},z={title:"Per-event identify",description:"A mapping-level identify overrides the destination default to resolve the distinct_id from event data.",in:(0,I.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"}]]},E={title:"Track with group",description:"A group key and id are attached as a Mixpanel track property so the event is associated with a company or account.",in:(0,I.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"}]]},A={title:"User login people",description:"A user login fires Mixpanel people.set, set_once, and increment operations without sending a track event.",in:(0,I.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}]]},S={title:"Common people operations",description:"A profile update exercises the common Mixpanel people vocabulary: set, set_once, increment, append, union, remove, and unset. delete_user is not covered by this example.",in:(0,I.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"]]]},D={title:"Group profile",description:"A company update sets Mixpanel group profile properties via groups.set and groups.set_once.",in:(0,I.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}]]},M={title:"Historical import",description:"Setting useImport routes the event through mp.import for backfilling historical Mixpanel data.",in:(0,I.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"}]]},j={title:"Alias before track",description:"A user login merges a prior anonymous id into the new user id via mp.alias before sending the track event.",in:(0,I.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"}]]},q={public:!1,in:(0,I.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 * 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,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;AAAA,EACF,EACC,SAAS;AAAA,EACZ,OAAO,aACJ,QAAQ,EACR,SAAS,2CAA2C,EACpD,SAAS;AAAA,EACZ,SAAS,aACN,QAAQ,EACR,SAAS,iDAAiD,EAC1D,SAAS;AAAA,EACZ,MAAM,aAAE,QAAQ,EAAE,SAAS,sCAAsC,EAAE,SAAS;AAAA,EAC5E,WAAW,aACR,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,aACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,SAAS,aACN,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AC9DD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B;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,CAAC,aAAa,kBAAkB,YAAY,EAAE,aAAa,OAAO,CAAC,CAAC;AAC5E;AAKO,IAAM,mBAAwC;AAAA,EACnD,QAAI,sBAAS,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,QAAI,sBAAS,eAAe,EAAE,WAAW,WAAW,CAAC;AAAA,EACrD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["import_dev","import_dev"]}
1
+ {"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n 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 title: 'Default track',\n description:\n 'A walkerOS event is forwarded to Mixpanel as a track call with the user id as the distinct_id.',\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 title: 'Track with include',\n description:\n 'A destination-level include flattens the event data section into prefixed Mixpanel track properties.',\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 title: 'Per-event identify',\n description:\n 'A mapping-level identify overrides the destination default to resolve the distinct_id from event data.',\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 title: 'Track with group',\n description:\n 'A group key and id are attached as a Mixpanel track property so the event is associated with a company or account.',\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 title: 'User login people',\n description:\n 'A user login fires Mixpanel people.set, set_once, and increment operations without sending a track event.',\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 * Common people operation vocabulary — exercises set, set_once, increment,\n * append, union, remove, unset. (delete_user is intentionally not covered\n * by this example.)\n */\nexport const allPeopleOperations: MixpanelStepExample = {\n title: 'Common people operations',\n description:\n 'A profile update exercises the common Mixpanel people vocabulary: set, set_once, increment, append, union, remove, and unset. delete_user is not covered by this example.',\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 title: 'Group profile',\n description:\n 'A company update sets Mixpanel group profile properties via groups.set and groups.set_once.',\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 title: 'Historical import',\n description:\n 'Setting useImport routes the event through mp.import for backfilling historical Mixpanel data.',\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 title: 'Alias before track',\n description:\n 'A user login merges a prior anonymous id into the new user id via mp.alias before sending the track event.',\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 public: false,\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;AAAA,EACF,EACC,SAAS;AAAA,EACZ,OAAO,aACJ,QAAQ,EACR,SAAS,2CAA2C,EACpD,SAAS;AAAA,EACZ,SAAS,aACN,QAAQ,EACR,SAAS,iDAAiD,EAC1D,SAAS;AAAA,EACZ,MAAM,aAAE,QAAQ,EAAE,SAAS,sCAAsC,EAAE,SAAS;AAAA,EAC5E,WAAW,aACR,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,aACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,SAAS,aACN,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AC9DD,IAAAC,cAAkB;AAEX,IAAM,gBAAgB,cAAE,OAAO;AAAA,EACpC,UAAU,cACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SA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C,sBAAsB,cAAc,YAAY,EAAE,SAAS,KAAK,CAAC;AAAA,EACpE;AACF;AAKO,IAAM,mBAAwC;AAAA,EACnD,OAAO;AAAA,EACP,aACE;AAAA,EACF,QAAI,sBAAS,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,CAAC,aAAa,kBAAkB,YAAY,EAAE,aAAa,OAAO,CAAC,CAAC;AAC5E;AAKO,IAAM,mBAAwC;AAAA,EACnD,OAAO;AAAA,EACP,aACE;AAAA,EACF,QAAI,sBAAS,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,QAAQ;AAAA,EACR,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,t=(t,i)=>{for(var a in i)e(t,a,{get:i[a],enumerable:!0})},i={};t(i,{MappingSchema:()=>s,SettingsSchema:()=>o,mapping:()=>l,settings:()=>r});import{zodToSchema as a}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=a(o),l=a(s),d={};t(d,{env:()=>c,step:()=>f});var c={};t(c,{push:()=>v,simulation:()=>_});var m=()=>{},u={set:m,set_once:m,increment:m,append:m,union:m,remove:m,unset:m,delete_user:m},g={set:m,set_once:m,union:m,remove:m,unset:m,delete_group:m};var v={Mixpanel:{init:function(){return{track:m,import:m,alias:m,people:{...u},groups:{...g}}}}},_=["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={};t(f,{aliasBeforeTrack:()=>S,allPeopleOperations:()=>x,companyGroupProfile:()=>P,defaultEventForwarding:()=>k,historicalImport:()=>A,perEventIdentify:()=>h,trackWithGroup:()=>w,trackWithInclude:()=>b,userLoginPeopleSet:()=>I,wildcardIgnored:()=>D});import{getEvent as y}from"@walkeros/core";var k={title:"Default track",description:"A walkerOS event is forwarded to Mixpanel as a track call with the user id as the distinct_id.",in:y("product view",{timestamp:1700000100}),settings:{identify:{map:{distinctId:"user.id"}}},out:[["mp.track","product view",{distinct_id:"us3r"}]]},b={title:"Track with include",description:"A destination-level include flattens the event data section into prefixed Mixpanel track properties.",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}]]},h={title:"Per-event identify",description:"A mapping-level identify overrides the destination default to resolve the distinct_id from event data.",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"}]]},w={title:"Track with group",description:"A group key and id are attached as a Mixpanel track property so the event is associated with a company or account.",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"}]]},I={title:"User login people",description:"A user login fires Mixpanel people.set, set_once, and increment operations without sending a track event.",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}]]},x={title:"Common people operations",description:"A profile update exercises the common Mixpanel people vocabulary: set, set_once, increment, append, union, remove, and unset. delete_user is not covered by this example.",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"]]]},P={title:"Group profile",description:"A company update sets Mixpanel group profile properties via groups.set and groups.set_once.",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}]]},A={title:"Historical import",description:"Setting useImport routes the event through mp.import for backfilling historical Mixpanel data.",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"}]]},S={title:"Alias before track",description:"A user login merges a prior anonymous id into the new user id via mp.alias before sending the track event.",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"}]]},D={public:!1,in:y("debug noise",{timestamp:1700000109}),mapping:{ignore:!0},out:[]};export{d as examples,i as schemas};//# sourceMappingURL=dev.mjs.map
package/dist/dev.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.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,EACF,QAAQ,EACL,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAA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;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 title: 'Default track',\n description:\n 'A walkerOS event is forwarded to Mixpanel as a track call with the user id as the distinct_id.',\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 title: 'Track with include',\n description:\n 'A destination-level include flattens the event data section into prefixed Mixpanel track properties.',\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 title: 'Per-event identify',\n description:\n 'A mapping-level identify overrides the destination default to resolve the distinct_id from event data.',\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 title: 'Track with group',\n description:\n 'A group key and id are attached as a Mixpanel track property so the event is associated with a company or account.',\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 title: 'User login people',\n description:\n 'A user login fires Mixpanel people.set, set_once, and increment operations without sending a track event.',\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 * Common people operation vocabulary — exercises set, set_once, increment,\n * append, union, remove, unset. (delete_user is intentionally not covered\n * by this example.)\n */\nexport const allPeopleOperations: MixpanelStepExample = {\n title: 'Common people operations',\n description:\n 'A profile update exercises the common Mixpanel people vocabulary: set, set_once, increment, append, union, remove, and unset. delete_user is not covered by this example.',\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 title: 'Group profile',\n description:\n 'A company update sets Mixpanel group profile properties via groups.set and groups.set_once.',\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 title: 'Historical import',\n description:\n 'Setting useImport routes the event through mp.import for backfilling historical Mixpanel data.',\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 title: 'Alias before track',\n description:\n 'A user login merges a prior anonymous id into the new user id via mp.alias before sending the track event.',\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 public: false,\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,Q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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,QAAQ;AAAA,EACR,IAAI,SAAS,eAAe,EAAE,WAAW,WAAW,CAAC;AAAA,EACrD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["z"]}
@@ -133,8 +133,9 @@ declare const trackWithGroup: MixpanelStepExample;
133
133
  */
134
134
  declare const userLoginPeopleSet: MixpanelStepExample;
135
135
  /**
136
- * Full people operation vocabulary — exercises set, set_once, increment,
137
- * append, union, remove, unset, delete_user.
136
+ * Common people operation vocabulary — exercises set, set_once, increment,
137
+ * append, union, remove, unset. (delete_user is intentionally not covered
138
+ * by this example.)
138
139
  */
139
140
  declare const allPeopleOperations: MixpanelStepExample;
140
141
  /**
@@ -133,8 +133,9 @@ declare const trackWithGroup: MixpanelStepExample;
133
133
  */
134
134
  declare const userLoginPeopleSet: MixpanelStepExample;
135
135
  /**
136
- * Full people operation vocabulary — exercises set, set_once, increment,
137
- * append, union, remove, unset, delete_user.
136
+ * Common people operation vocabulary — exercises set, set_once, increment,
137
+ * append, union, remove, unset. (delete_user is intentionally not covered
138
+ * by this example.)
138
139
  */
139
140
  declare const allPeopleOperations: MixpanelStepExample;
140
141
  /**
@@ -100,6 +100,8 @@ __export(step_exports, {
100
100
  });
101
101
  var import_core = require("@walkeros/core");
102
102
  var defaultEventForwarding = {
103
+ title: "Default track",
104
+ description: "A walkerOS event is forwarded to Mixpanel as a track call with the user id as the distinct_id.",
103
105
  in: (0, import_core.getEvent)("product view", { timestamp: 1700000100 }),
104
106
  settings: {
105
107
  identify: {
@@ -111,6 +113,8 @@ var defaultEventForwarding = {
111
113
  out: [["mp.track", "product view", { distinct_id: "us3r" }]]
112
114
  };
113
115
  var trackWithInclude = {
116
+ title: "Track with include",
117
+ description: "A destination-level include flattens the event data section into prefixed Mixpanel track properties.",
114
118
  in: (0, import_core.getEvent)("product view", { timestamp: 1700000101 }),
115
119
  settings: {
116
120
  identify: {
@@ -136,6 +140,8 @@ var trackWithInclude = {
136
140
  ]
137
141
  };
138
142
  var perEventIdentify = {
143
+ title: "Per-event identify",
144
+ description: "A mapping-level identify overrides the destination default to resolve the distinct_id from event data.",
139
145
  in: (0, import_core.getEvent)("user login", {
140
146
  timestamp: 1700000102,
141
147
  data: {
@@ -163,6 +169,8 @@ var perEventIdentify = {
163
169
  ]
164
170
  };
165
171
  var trackWithGroup = {
172
+ title: "Track with group",
173
+ description: "A group key and id are attached as a Mixpanel track property so the event is associated with a company or account.",
166
174
  in: (0, import_core.getEvent)("page view", {
167
175
  timestamp: 1700000103,
168
176
  data: {
@@ -198,6 +206,8 @@ var trackWithGroup = {
198
206
  ]
199
207
  };
200
208
  var userLoginPeopleSet = {
209
+ title: "User login people",
210
+ description: "A user login fires Mixpanel people.set, set_once, and increment operations without sending a track event.",
201
211
  in: (0, import_core.getEvent)("user login", {
202
212
  timestamp: 1700000104,
203
213
  data: {
@@ -249,6 +259,8 @@ var userLoginPeopleSet = {
249
259
  ]
250
260
  };
251
261
  var allPeopleOperations = {
262
+ title: "Common people operations",
263
+ description: "A profile update exercises the common Mixpanel people vocabulary: set, set_once, increment, append, union, remove, and unset. delete_user is not covered by this example.",
252
264
  in: (0, import_core.getEvent)("profile update", {
253
265
  timestamp: 1700000105,
254
266
  data: {
@@ -316,6 +328,8 @@ var allPeopleOperations = {
316
328
  ]
317
329
  };
318
330
  var companyGroupProfile = {
331
+ title: "Group profile",
332
+ description: "A company update sets Mixpanel group profile properties via groups.set and groups.set_once.",
319
333
  in: (0, import_core.getEvent)("company update", {
320
334
  timestamp: 1700000106,
321
335
  data: {
@@ -360,6 +374,8 @@ var companyGroupProfile = {
360
374
  ]
361
375
  };
362
376
  var historicalImport = {
377
+ title: "Historical import",
378
+ description: "Setting useImport routes the event through mp.import for backfilling historical Mixpanel data.",
363
379
  in: (0, import_core.getEvent)("order complete", {
364
380
  timestamp: 1700000107,
365
381
  data: {
@@ -377,6 +393,8 @@ var historicalImport = {
377
393
  out: [["mp.import", "order complete", 1700000107, { distinct_id: "us3r" }]]
378
394
  };
379
395
  var aliasBeforeTrack = {
396
+ title: "Alias before track",
397
+ description: "A user login merges a prior anonymous id into the new user id via mp.alias before sending the track event.",
380
398
  in: (0, import_core.getEvent)("user login", {
381
399
  timestamp: 1700000108,
382
400
  data: {
@@ -400,6 +418,7 @@ var aliasBeforeTrack = {
400
418
  ]
401
419
  };
402
420
  var wildcardIgnored = {
421
+ public: false,
403
422
  in: (0, import_core.getEvent)("debug noise", { timestamp: 1700000109 }),
404
423
  mapping: { ignore: true },
405
424
  out: []
@@ -79,6 +79,8 @@ __export(step_exports, {
79
79
  });
80
80
  import { getEvent } from "@walkeros/core";
81
81
  var defaultEventForwarding = {
82
+ title: "Default track",
83
+ description: "A walkerOS event is forwarded to Mixpanel as a track call with the user id as the distinct_id.",
82
84
  in: getEvent("product view", { timestamp: 1700000100 }),
83
85
  settings: {
84
86
  identify: {
@@ -90,6 +92,8 @@ var defaultEventForwarding = {
90
92
  out: [["mp.track", "product view", { distinct_id: "us3r" }]]
91
93
  };
92
94
  var trackWithInclude = {
95
+ title: "Track with include",
96
+ description: "A destination-level include flattens the event data section into prefixed Mixpanel track properties.",
93
97
  in: getEvent("product view", { timestamp: 1700000101 }),
94
98
  settings: {
95
99
  identify: {
@@ -115,6 +119,8 @@ var trackWithInclude = {
115
119
  ]
116
120
  };
117
121
  var perEventIdentify = {
122
+ title: "Per-event identify",
123
+ description: "A mapping-level identify overrides the destination default to resolve the distinct_id from event data.",
118
124
  in: getEvent("user login", {
119
125
  timestamp: 1700000102,
120
126
  data: {
@@ -142,6 +148,8 @@ var perEventIdentify = {
142
148
  ]
143
149
  };
144
150
  var trackWithGroup = {
151
+ title: "Track with group",
152
+ description: "A group key and id are attached as a Mixpanel track property so the event is associated with a company or account.",
145
153
  in: getEvent("page view", {
146
154
  timestamp: 1700000103,
147
155
  data: {
@@ -177,6 +185,8 @@ var trackWithGroup = {
177
185
  ]
178
186
  };
179
187
  var userLoginPeopleSet = {
188
+ title: "User login people",
189
+ description: "A user login fires Mixpanel people.set, set_once, and increment operations without sending a track event.",
180
190
  in: getEvent("user login", {
181
191
  timestamp: 1700000104,
182
192
  data: {
@@ -228,6 +238,8 @@ var userLoginPeopleSet = {
228
238
  ]
229
239
  };
230
240
  var allPeopleOperations = {
241
+ title: "Common people operations",
242
+ description: "A profile update exercises the common Mixpanel people vocabulary: set, set_once, increment, append, union, remove, and unset. delete_user is not covered by this example.",
231
243
  in: getEvent("profile update", {
232
244
  timestamp: 1700000105,
233
245
  data: {
@@ -295,6 +307,8 @@ var allPeopleOperations = {
295
307
  ]
296
308
  };
297
309
  var companyGroupProfile = {
310
+ title: "Group profile",
311
+ description: "A company update sets Mixpanel group profile properties via groups.set and groups.set_once.",
298
312
  in: getEvent("company update", {
299
313
  timestamp: 1700000106,
300
314
  data: {
@@ -339,6 +353,8 @@ var companyGroupProfile = {
339
353
  ]
340
354
  };
341
355
  var historicalImport = {
356
+ title: "Historical import",
357
+ description: "Setting useImport routes the event through mp.import for backfilling historical Mixpanel data.",
342
358
  in: getEvent("order complete", {
343
359
  timestamp: 1700000107,
344
360
  data: {
@@ -356,6 +372,8 @@ var historicalImport = {
356
372
  out: [["mp.import", "order complete", 1700000107, { distinct_id: "us3r" }]]
357
373
  };
358
374
  var aliasBeforeTrack = {
375
+ title: "Alias before track",
376
+ description: "A user login merges a prior anonymous id into the new user id via mp.alias before sending the track event.",
359
377
  in: getEvent("user login", {
360
378
  timestamp: 1700000108,
361
379
  data: {
@@ -379,6 +397,7 @@ var aliasBeforeTrack = {
379
397
  ]
380
398
  };
381
399
  var wildcardIgnored = {
400
+ public: false,
382
401
  in: getEvent("debug noise", { timestamp: 1700000109 }),
383
402
  mapping: { ignore: true },
384
403
  out: []
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$meta": {
3
3
  "package": "@walkeros/server-destination-mixpanel",
4
- "version": "3.4.0",
4
+ "version": "3.4.1",
5
5
  "type": "destination",
6
6
  "platform": [
7
7
  "server"
@@ -95,7 +95,7 @@
95
95
  "push": {
96
96
  "Mixpanel": {
97
97
  "init": {
98
- "$code": "function(){return{track:c,import:c,alias:c,people:{...u},groups:{...g}}}"
98
+ "$code": "function(){return{track:m,import:m,alias:m,people:{...u},groups:{...g}}}"
99
99
  }
100
100
  }
101
101
  },
@@ -122,6 +122,8 @@
122
122
  },
123
123
  "step": {
124
124
  "aliasBeforeTrack": {
125
+ "title": "Alias before track",
126
+ "description": "A user login merges a prior anonymous id into the new user id via mp.alias before sending the track event.",
125
127
  "in": {
126
128
  "name": "user login",
127
129
  "data": {
@@ -172,7 +174,7 @@
172
174
  "group": "gr0up",
173
175
  "count": 1,
174
176
  "version": {
175
- "source": "3.4.0",
177
+ "source": "3.4.1",
176
178
  "tagging": 1
177
179
  },
178
180
  "source": {
@@ -207,6 +209,8 @@
207
209
  ]
208
210
  },
209
211
  "allPeopleOperations": {
212
+ "title": "Common people operations",
213
+ "description": "A profile update exercises the common Mixpanel people vocabulary: set, set_once, increment, append, union, remove, and unset. delete_user is not covered by this example.",
210
214
  "in": {
211
215
  "name": "profile update",
212
216
  "data": {
@@ -260,7 +264,7 @@
260
264
  "group": "gr0up",
261
265
  "count": 1,
262
266
  "version": {
263
- "source": "3.4.0",
267
+ "source": "3.4.1",
264
268
  "tagging": 1
265
269
  },
266
270
  "source": {
@@ -381,6 +385,8 @@
381
385
  ]
382
386
  },
383
387
  "companyGroupProfile": {
388
+ "title": "Group profile",
389
+ "description": "A company update sets Mixpanel group profile properties via groups.set and groups.set_once.",
384
390
  "in": {
385
391
  "name": "company update",
386
392
  "data": {
@@ -434,7 +440,7 @@
434
440
  "group": "gr0up",
435
441
  "count": 1,
436
442
  "version": {
437
- "source": "3.4.0",
443
+ "source": "3.4.1",
438
444
  "tagging": 1
439
445
  },
440
446
  "source": {
@@ -490,6 +496,8 @@
490
496
  ]
491
497
  },
492
498
  "defaultEventForwarding": {
499
+ "title": "Default track",
500
+ "description": "A walkerOS event is forwarded to Mixpanel as a track call with the user id as the distinct_id.",
493
501
  "in": {
494
502
  "name": "product view",
495
503
  "data": {
@@ -529,7 +537,7 @@
529
537
  "group": "gr0up",
530
538
  "count": 1,
531
539
  "version": {
532
- "source": "3.4.0",
540
+ "source": "3.4.1",
533
541
  "tagging": 1
534
542
  },
535
543
  "source": {
@@ -556,6 +564,8 @@
556
564
  ]
557
565
  },
558
566
  "historicalImport": {
567
+ "title": "Historical import",
568
+ "description": "Setting useImport routes the event through mp.import for backfilling historical Mixpanel data.",
559
569
  "in": {
560
570
  "name": "order complete",
561
571
  "data": {
@@ -638,7 +648,7 @@
638
648
  "group": "gr0up",
639
649
  "count": 1,
640
650
  "version": {
641
- "source": "3.4.0",
651
+ "source": "3.4.1",
642
652
  "tagging": 1
643
653
  },
644
654
  "source": {
@@ -667,6 +677,8 @@
667
677
  ]
668
678
  },
669
679
  "perEventIdentify": {
680
+ "title": "Per-event identify",
681
+ "description": "A mapping-level identify overrides the destination default to resolve the distinct_id from event data.",
670
682
  "in": {
671
683
  "name": "user login",
672
684
  "data": {
@@ -717,7 +729,7 @@
717
729
  "group": "gr0up",
718
730
  "count": 1,
719
731
  "version": {
720
- "source": "3.4.0",
732
+ "source": "3.4.1",
721
733
  "tagging": 1
722
734
  },
723
735
  "source": {
@@ -746,6 +758,8 @@
746
758
  ]
747
759
  },
748
760
  "trackWithGroup": {
761
+ "title": "Track with group",
762
+ "description": "A group key and id are attached as a Mixpanel track property so the event is associated with a company or account.",
749
763
  "in": {
750
764
  "name": "page view",
751
765
  "data": {
@@ -795,7 +809,7 @@
795
809
  "group": "gr0up",
796
810
  "count": 1,
797
811
  "version": {
798
- "source": "3.4.0",
812
+ "source": "3.4.1",
799
813
  "tagging": 1
800
814
  },
801
815
  "source": {
@@ -835,6 +849,8 @@
835
849
  ]
836
850
  },
837
851
  "trackWithInclude": {
852
+ "title": "Track with include",
853
+ "description": "A destination-level include flattens the event data section into prefixed Mixpanel track properties.",
838
854
  "in": {
839
855
  "name": "product view",
840
856
  "data": {
@@ -874,7 +890,7 @@
874
890
  "group": "gr0up",
875
891
  "count": 1,
876
892
  "version": {
877
- "source": "3.4.0",
893
+ "source": "3.4.1",
878
894
  "tagging": 1
879
895
  },
880
896
  "source": {
@@ -909,6 +925,8 @@
909
925
  ]
910
926
  },
911
927
  "userLoginPeopleSet": {
928
+ "title": "User login people",
929
+ "description": "A user login fires Mixpanel people.set, set_once, and increment operations without sending a track event.",
912
930
  "in": {
913
931
  "name": "user login",
914
932
  "data": {
@@ -961,7 +979,7 @@
961
979
  "group": "gr0up",
962
980
  "count": 1,
963
981
  "version": {
964
- "source": "3.4.0",
982
+ "source": "3.4.1",
965
983
  "tagging": 1
966
984
  },
967
985
  "source": {
@@ -1030,6 +1048,7 @@
1030
1048
  ]
1031
1049
  },
1032
1050
  "wildcardIgnored": {
1051
+ "public": false,
1033
1052
  "in": {
1034
1053
  "name": "debug noise",
1035
1054
  "data": {
@@ -1086,7 +1105,7 @@
1086
1105
  "group": "gr0up",
1087
1106
  "count": 1,
1088
1107
  "version": {
1089
- "source": "3.4.0",
1108
+ "source": "3.4.1",
1090
1109
  "tagging": 1
1091
1110
  },
1092
1111
  "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.0",
4
+ "version": "3.4.1",
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.4.0",
38
- "@walkeros/server-core": "3.4.0",
37
+ "@walkeros/core": "3.4.1",
38
+ "@walkeros/server-core": "3.4.1",
39
39
  "mixpanel": "^0.21.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@walkeros/collector": "3.4.0"
42
+ "@walkeros/collector": "3.4.1"
43
43
  },
44
44
  "repository": {
45
45
  "url": "git+https://github.com/elbwalker/walkerOS.git",