@walkeros/web-destination-mixpanel 4.2.0 → 4.2.1-next-1781538735002
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/dev.d.mts +8 -3
- package/dist/dev.d.ts +8 -3
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/examples/index.d.mts +8 -3
- package/dist/examples/index.d.ts +8 -3
- package/dist/examples/index.js +2 -1
- package/dist/examples/index.mjs +2 -1
- package/dist/walkerOS.json +18 -12
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @walkeros/web-destination-mixpanel
|
|
2
2
|
|
|
3
|
+
## 4.2.1-next-1781538735002
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [5cbcd23]
|
|
8
|
+
- @walkeros/core@4.2.1-next-1781538735002
|
|
9
|
+
- @walkeros/web-core@4.2.1-next-1781538735002
|
|
10
|
+
|
|
3
11
|
## 4.2.0
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/dev.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
2
2
|
import { z } from '@walkeros/core/dev';
|
|
3
|
-
import { Mapping as Mapping$1, Flow } from '@walkeros/core';
|
|
3
|
+
import { Mapping as Mapping$1, Flow, WalkerOS } from '@walkeros/core';
|
|
4
4
|
import { DestinationWeb } from '@walkeros/web-core';
|
|
5
5
|
import { Config } from 'mixpanel-browser';
|
|
6
6
|
|
|
@@ -153,6 +153,8 @@ declare namespace env {
|
|
|
153
153
|
type MixpanelStepExample = Flow.StepExample & {
|
|
154
154
|
settings?: Partial<Settings>;
|
|
155
155
|
configInclude?: string[];
|
|
156
|
+
/** Consent granted before `in` so a gated destination is loaded first. */
|
|
157
|
+
before?: WalkerOS.Consent;
|
|
156
158
|
};
|
|
157
159
|
/**
|
|
158
160
|
* Default event forwarding - every walkerOS event becomes
|
|
@@ -217,8 +219,11 @@ declare const userGroupAssociation: MixpanelStepExample;
|
|
|
217
219
|
*/
|
|
218
220
|
declare const companyUpdateGroupProfile: MixpanelStepExample;
|
|
219
221
|
/**
|
|
220
|
-
* Consent revoked → mixpanel.opt_out_tracking().
|
|
221
|
-
*
|
|
222
|
+
* Consent revoked → mixpanel.opt_out_tracking(). After analytics consent is
|
|
223
|
+
* granted (Mixpanel loads and opts in), revoking it calls
|
|
224
|
+
* mixpanel.opt_out_tracking() via the consent handler. The destination is
|
|
225
|
+
* never loaded under denied consent, so the opt-out is a real revocation of an
|
|
226
|
+
* already-granted destination.
|
|
222
227
|
*/
|
|
223
228
|
declare const consentRevokeOptOut: MixpanelStepExample;
|
|
224
229
|
/**
|
package/dist/dev.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
2
2
|
import { z } from '@walkeros/core/dev';
|
|
3
|
-
import { Mapping as Mapping$1, Flow } from '@walkeros/core';
|
|
3
|
+
import { Mapping as Mapping$1, Flow, WalkerOS } from '@walkeros/core';
|
|
4
4
|
import { DestinationWeb } from '@walkeros/web-core';
|
|
5
5
|
import { Config } from 'mixpanel-browser';
|
|
6
6
|
|
|
@@ -153,6 +153,8 @@ declare namespace env {
|
|
|
153
153
|
type MixpanelStepExample = Flow.StepExample & {
|
|
154
154
|
settings?: Partial<Settings>;
|
|
155
155
|
configInclude?: string[];
|
|
156
|
+
/** Consent granted before `in` so a gated destination is loaded first. */
|
|
157
|
+
before?: WalkerOS.Consent;
|
|
156
158
|
};
|
|
157
159
|
/**
|
|
158
160
|
* Default event forwarding - every walkerOS event becomes
|
|
@@ -217,8 +219,11 @@ declare const userGroupAssociation: MixpanelStepExample;
|
|
|
217
219
|
*/
|
|
218
220
|
declare const companyUpdateGroupProfile: MixpanelStepExample;
|
|
219
221
|
/**
|
|
220
|
-
* Consent revoked → mixpanel.opt_out_tracking().
|
|
221
|
-
*
|
|
222
|
+
* Consent revoked → mixpanel.opt_out_tracking(). After analytics consent is
|
|
223
|
+
* granted (Mixpanel loads and opts in), revoking it calls
|
|
224
|
+
* mixpanel.opt_out_tracking() via the consent handler. The destination is
|
|
225
|
+
* never loaded under denied consent, so the opt-out is a real revocation of an
|
|
226
|
+
* already-granted destination.
|
|
222
227
|
*/
|
|
223
228
|
declare const consentRevokeOptOut: MixpanelStepExample;
|
|
224
229
|
/**
|
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,o=(e,n)=>{for(var a in n)t(e,a,{get:n[a],enumerable:!0})},p={};o(p,{examples:()=>_,schemas:()=>l}),module.exports=(e=p,((e,o,p,l)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let s of a(o))i.call(e,s)||s===p||t(e,s,{get:()=>o[s],enumerable:!(l=n(o,s))||l.enumerable});return e})(t({},"__esModule",{value:!0}),e));var l={};o(l,{MappingSchema:()=>d,SettingsSchema:()=>c,mapping:()=>g,settings:()=>m});var s=require("@walkeros/core/dev"),r=require("@walkeros/core/dev"),c=r.z.object({apiKey:r.z.string().min(1).describe('Your Mixpanel project token. Find it in your Mixpanel project settings under "Project Settings" and "Access Keys". Passed to mixpanel.init() as the first argument (like a1b2c3d4e5f6789012345678abcdef12).'),api_host:r.z.string().describe("Mixpanel ingestion host. Default: https://api-js.mixpanel.com. Use https://api-eu.mixpanel.com for EU residency.").optional(),persistence:r.z.enum(["cookie","localStorage"]).describe("Client-side persistence backend. Default: cookie.").optional(),cross_subdomain_cookie:r.z.boolean().describe("Share cookie across subdomains. Default: true.").optional(),cookie_expiration:r.z.number().int().nonnegative().describe("Cookie expiration in days. Default: 365.").optional(),secure_cookie:r.z.boolean().describe("Only send cookie over HTTPS. Default: false.").optional(),ip:r.z.boolean().describe("Enable server-side IP geolocation. Default: true.").optional(),batch_requests:r.z.boolean().describe("Use the /batch endpoint instead of individual requests. Default: true.").optional(),batch_size:r.z.number().int().positive().describe("Max events per batch. Default: 50.").optional(),batch_flush_interval_ms:r.z.number().int().positive().describe("Batch flush interval in ms. Default: 5000.").optional(),debug:r.z.boolean().describe("Enable verbose SDK logging. Default: false.").optional(),opt_out_tracking_by_default:r.z.boolean().describe("Start in opted-out state until opt_in_tracking() is called. Default: false.").optional(),track_pageview:r.z.union([r.z.boolean(),r.z.string()]).describe("Enable Mixpanel auto-pageview tracking. walkerOS default: false — walkerOS sources handle page views.").optional(),autocapture:r.z.unknown().describe("Enable Mixpanel web autocapture. walkerOS default: false — walkerOS sources handle event capture.").optional(),record_sessions_percent:r.z.number().min(0).max(100).describe("Session replay sampling rate (0-100). Default: 0 (disabled). Session replay is bundled in the npm build.").optional(),record_mask_all_inputs:r.z.boolean().describe("Mask all input values in session replay. Default: true.").optional(),identify:r.z.unknown().describe("walkerOS mapping value resolving to an identity object. Keys: distinctId.").optional(),group:r.z.unknown().describe("walkerOS mapping value resolving to { key, id } → mixpanel.set_group(key, id). Runs on destination init or per-event.").optional()}),u=require("@walkeros/core/dev"),d=u.z.object({identify:u.z.unknown().describe("Per-event identity mapping. Resolves to { distinctId } → mixpanel.identify(distinctId).").optional(),people:u.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 mixpanel.people.* call.").optional(),group:u.z.unknown().describe("Per-event group assignment. Resolves to { key, id } → mixpanel.set_group(key, id).").optional(),groupProfile:u.z.unknown().describe("Per-event group profile operations. Resolves to { key, id, set?, set_once?, unset?, union?, remove?, delete? } → mixpanel.get_group(key, id).set/... calls.").optional(),reset:u.z.unknown().describe("Logout trigger. Resolves to a truthy value → mixpanel.reset(). Typically used with silent: true on a user logout rule.").optional()}),m=(0,s.zodToSchema)(c),g=(0,s.zodToSchema)(d),_={};o(_,{env:()=>v,step:()=>h});var v={};o(v,{init:()=>b,push:()=>k,simulation:()=>x});var f=()=>{},y={set:f,set_once:f,unset:f,union:f,remove:f,delete:f},b={mixpanel:{init:f,track:f,identify:f,reset:f,set_group:f,get_group:()=>y,opt_in_tracking:f,opt_out_tracking:f,stop_batch_senders:f,people:{set:f,set_once:f,increment:f,append:f,union:f,remove:f,unset:f,delete_user:f}}},k={mixpanel:{init:f,track:f,identify:f,reset:f,set_group:f,get_group:()=>y,opt_in_tracking:f,opt_out_tracking:f,stop_batch_senders:f,people:{set:f,set_once:f,increment:f,append:f,union:f,remove:f,unset:f,delete_user:f}}},x=["call:mixpanel.init","call:mixpanel.track","call:mixpanel.identify","call:mixpanel.reset","call:mixpanel.set_group","call:mixpanel.get_group","call:mixpanel.opt_in_tracking","call:mixpanel.opt_out_tracking","call:mixpanel.people.set","call:mixpanel.people.set_once","call:mixpanel.people.increment","call:mixpanel.people.append","call:mixpanel.people.union","call:mixpanel.people.remove","call:mixpanel.people.unset","call:mixpanel.people.delete_user"],h={};o(h,{accountDeleteUser:()=>P,companyUpdateGroupProfile:()=>R,consentGrantOptIn:()=>U,consentRevokeOptOut:()=>q,defaultEventForwarding:()=>z,destinationLevelIdentify:()=>E,destinationLevelInclude:()=>S,profileUpdateAllPeopleOperations:()=>O,ruleIncludeReplaces:()=>A,userGroupAssociation:()=>M,userLoginIdentifyAndPeople:()=>I,userLogoutReset:()=>j,wildcardIgnored:()=>D});var w=require("@walkeros/core"),z={title:"Default track",description:"A walker event becomes a Mixpanel track call with the event name and empty properties.",in:(0,w.getEvent)("product view",{timestamp:1700000100}),out:[["mixpanel.track","product view",{}]]},D={public:!1,in:(0,w.getEvent)("debug noise",{timestamp:1700000101}),mapping:{ignore:!0},out:[]},S={title:"Include data",description:"Destination-level include flattens the event data section into prefixed Mixpanel track properties.",in:(0,w.getEvent)("product view",{timestamp:1700000102}),configInclude:["data"],out:[["mixpanel.track","product view",{data_id:"ers",data_name:"Everyday Ruck Snack",data_color:"black",data_size:"l",data_price:420}]]},A={title:"Rule include overrides",description:"A per-rule include replaces the destination-level include for this event, forwarding only globals here.",in:(0,w.getEvent)("order complete",{timestamp:1700000103}),configInclude:["data"],mapping:{include:["globals"]},out:[["mixpanel.track","order complete",{globals_pagegroup:"shop"}]]},E={title:"Destination identify",description:"Destination-level identify calls mixpanel.identify with a resolved distinctId before firing the default track.",in:(0,w.getEvent)("page view",{timestamp:1700000104}),settings:{identify:{map:{distinctId:"user.id"}}},out:[["mixpanel.identify","us3r"],["mixpanel.track","page view",{}]]},I={title:"User login identify",description:"A user login identifies the user and fires Mixpanel people set, set_once, and increment operations.",in:(0,w.getEvent)("user login",{timestamp:1700000105,data:{user_id:"new-user-123",plan:"premium",company:"Acme",email:"user@acme.com"}}),mapping:{silent:!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:[["mixpanel.identify","new-user-123"],["mixpanel.people.set",{plan:"premium",company:"Acme",email:"user@acme.com"}],["mixpanel.people.set_once",{first_login:1700000105}],["mixpanel.people.increment",{login_count:1}]]},O={title:"All people operations",description:"A profile update exercises the full Mixpanel people vocabulary including set, increment, append, union, and remove.",in:(0,w.getEvent)("profile update",{timestamp:1700000106,data:{name:"Jane Doe",email:"jane@acme.com",page:"/docs/getting-started",removed_tag:"trial",source:"referral"}}),mapping:{silent:!0,settings:{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:[["mixpanel.people.set",{name:"Jane Doe",email:"jane@acme.com"}],["mixpanel.people.set_once",{signup_source:"referral"}],["mixpanel.people.increment",{page_views:1}],["mixpanel.people.append",{visited_pages:"/docs/getting-started"}],["mixpanel.people.union",{unique_tags:["active"]}],["mixpanel.people.remove",{tags:"trial"}],["mixpanel.people.unset",["old_plan"]]]},P={title:"Delete user",description:"An account delete fires Mixpanel people.delete_user to remove the user profile from the project.",in:(0,w.getEvent)("account delete",{timestamp:1700000107}),mapping:{silent:!0,settings:{people:{map:{delete_user:{value:!0}}}}},out:[["mixpanel.people.delete_user"]]},j={title:"User logout reset",description:"A user logout calls mixpanel.reset to clear persistence and generate a new anonymous distinct id.",in:(0,w.getEvent)("user logout",{timestamp:1700000108}),mapping:{silent:!0,settings:{reset:!0}},out:[["mixpanel.reset"]]},M={title:"Group association",description:"A user login associates the user to a company group via mixpanel.set_group and fires the default track.",in:(0,w.getEvent)("user login",{timestamp:1700000109,data:{user_id:"user-456",company_id:"acme-inc"}}),mapping:{settings:{group:{map:{key:{value:"company_id"},id:"data.company_id"}}}},out:[["mixpanel.set_group","company_id","acme-inc"],["mixpanel.track","user login",{}]]},R={title:"Group profile",description:"A company update sets Mixpanel group profile properties via get_group.set and get_group.set_once.",in:(0,w.getEvent)("company update",{timestamp:1700000110,data:{company_id:"acme-inc",company_name:"Acme, Inc.",plan:"enterprise",employee_count:250,founded_year:2010}}),mapping:{silent:!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:[["mixpanel.get_group.set","company_id","acme-inc",{name:"Acme, Inc.",plan:"enterprise",employee_count:250}],["mixpanel.get_group.set_once","company_id","acme-inc",{founded:2010}]]},q={title:"Consent revoked",description:"A walker consent command with analytics denied calls mixpanel.opt_out_tracking to stop event capture.",command:"consent",in:{analytics:!1},settings:{},out:[["mixpanel.opt_out_tracking"]]},U={title:"Consent granted",description:"A walker consent command with analytics granted calls mixpanel.opt_in_tracking to resume event capture.",command:"consent",in:{analytics:!0},settings:{},out:[["mixpanel.opt_in_tracking"]]};//# sourceMappingURL=dev.js.map
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,o=(e,n)=>{for(var a in n)t(e,a,{get:n[a],enumerable:!0})},p={};o(p,{examples:()=>_,schemas:()=>l}),module.exports=(e=p,((e,o,p,l)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let s of a(o))i.call(e,s)||s===p||t(e,s,{get:()=>o[s],enumerable:!(l=n(o,s))||l.enumerable});return e})(t({},"__esModule",{value:!0}),e));var l={};o(l,{MappingSchema:()=>d,SettingsSchema:()=>c,mapping:()=>g,settings:()=>m});var s=require("@walkeros/core/dev"),r=require("@walkeros/core/dev"),c=r.z.object({apiKey:r.z.string().min(1).describe('Your Mixpanel project token. Find it in your Mixpanel project settings under "Project Settings" and "Access Keys". Passed to mixpanel.init() as the first argument (like a1b2c3d4e5f6789012345678abcdef12).'),api_host:r.z.string().describe("Mixpanel ingestion host. Default: https://api-js.mixpanel.com. Use https://api-eu.mixpanel.com for EU residency.").optional(),persistence:r.z.enum(["cookie","localStorage"]).describe("Client-side persistence backend. Default: cookie.").optional(),cross_subdomain_cookie:r.z.boolean().describe("Share cookie across subdomains. Default: true.").optional(),cookie_expiration:r.z.number().int().nonnegative().describe("Cookie expiration in days. Default: 365.").optional(),secure_cookie:r.z.boolean().describe("Only send cookie over HTTPS. Default: false.").optional(),ip:r.z.boolean().describe("Enable server-side IP geolocation. Default: true.").optional(),batch_requests:r.z.boolean().describe("Use the /batch endpoint instead of individual requests. Default: true.").optional(),batch_size:r.z.number().int().positive().describe("Max events per batch. Default: 50.").optional(),batch_flush_interval_ms:r.z.number().int().positive().describe("Batch flush interval in ms. Default: 5000.").optional(),debug:r.z.boolean().describe("Enable verbose SDK logging. Default: false.").optional(),opt_out_tracking_by_default:r.z.boolean().describe("Start in opted-out state until opt_in_tracking() is called. Default: false.").optional(),track_pageview:r.z.union([r.z.boolean(),r.z.string()]).describe("Enable Mixpanel auto-pageview tracking. walkerOS default: false — walkerOS sources handle page views.").optional(),autocapture:r.z.unknown().describe("Enable Mixpanel web autocapture. walkerOS default: false — walkerOS sources handle event capture.").optional(),record_sessions_percent:r.z.number().min(0).max(100).describe("Session replay sampling rate (0-100). Default: 0 (disabled). Session replay is bundled in the npm build.").optional(),record_mask_all_inputs:r.z.boolean().describe("Mask all input values in session replay. Default: true.").optional(),identify:r.z.unknown().describe("walkerOS mapping value resolving to an identity object. Keys: distinctId.").optional(),group:r.z.unknown().describe("walkerOS mapping value resolving to { key, id } → mixpanel.set_group(key, id). Runs on destination init or per-event.").optional()}),u=require("@walkeros/core/dev"),d=u.z.object({identify:u.z.unknown().describe("Per-event identity mapping. Resolves to { distinctId } → mixpanel.identify(distinctId).").optional(),people:u.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 mixpanel.people.* call.").optional(),group:u.z.unknown().describe("Per-event group assignment. Resolves to { key, id } → mixpanel.set_group(key, id).").optional(),groupProfile:u.z.unknown().describe("Per-event group profile operations. Resolves to { key, id, set?, set_once?, unset?, union?, remove?, delete? } → mixpanel.get_group(key, id).set/... calls.").optional(),reset:u.z.unknown().describe("Logout trigger. Resolves to a truthy value → mixpanel.reset(). Typically used with silent: true on a user logout rule.").optional()}),m=(0,s.zodToSchema)(c),g=(0,s.zodToSchema)(d),_={};o(_,{env:()=>v,step:()=>h});var v={};o(v,{init:()=>b,push:()=>k,simulation:()=>x});var f=()=>{},y={set:f,set_once:f,unset:f,union:f,remove:f,delete:f},b={mixpanel:{init:f,track:f,identify:f,reset:f,set_group:f,get_group:()=>y,opt_in_tracking:f,opt_out_tracking:f,stop_batch_senders:f,people:{set:f,set_once:f,increment:f,append:f,union:f,remove:f,unset:f,delete_user:f}}},k={mixpanel:{init:f,track:f,identify:f,reset:f,set_group:f,get_group:()=>y,opt_in_tracking:f,opt_out_tracking:f,stop_batch_senders:f,people:{set:f,set_once:f,increment:f,append:f,union:f,remove:f,unset:f,delete_user:f}}},x=["call:mixpanel.init","call:mixpanel.track","call:mixpanel.identify","call:mixpanel.reset","call:mixpanel.set_group","call:mixpanel.get_group","call:mixpanel.opt_in_tracking","call:mixpanel.opt_out_tracking","call:mixpanel.people.set","call:mixpanel.people.set_once","call:mixpanel.people.increment","call:mixpanel.people.append","call:mixpanel.people.union","call:mixpanel.people.remove","call:mixpanel.people.unset","call:mixpanel.people.delete_user"],h={};o(h,{accountDeleteUser:()=>P,companyUpdateGroupProfile:()=>R,consentGrantOptIn:()=>U,consentRevokeOptOut:()=>q,defaultEventForwarding:()=>z,destinationLevelIdentify:()=>E,destinationLevelInclude:()=>S,profileUpdateAllPeopleOperations:()=>O,ruleIncludeReplaces:()=>A,userGroupAssociation:()=>M,userLoginIdentifyAndPeople:()=>I,userLogoutReset:()=>j,wildcardIgnored:()=>D});var w=require("@walkeros/core"),z={title:"Default track",description:"A walker event becomes a Mixpanel track call with the event name and empty properties.",in:(0,w.getEvent)("product view",{timestamp:1700000100}),out:[["mixpanel.track","product view",{}]]},D={public:!1,in:(0,w.getEvent)("debug noise",{timestamp:1700000101}),mapping:{ignore:!0},out:[]},S={title:"Include data",description:"Destination-level include flattens the event data section into prefixed Mixpanel track properties.",in:(0,w.getEvent)("product view",{timestamp:1700000102}),configInclude:["data"],out:[["mixpanel.track","product view",{data_id:"ers",data_name:"Everyday Ruck Snack",data_color:"black",data_size:"l",data_price:420}]]},A={title:"Rule include overrides",description:"A per-rule include replaces the destination-level include for this event, forwarding only globals here.",in:(0,w.getEvent)("order complete",{timestamp:1700000103}),configInclude:["data"],mapping:{include:["globals"]},out:[["mixpanel.track","order complete",{globals_pagegroup:"shop"}]]},E={title:"Destination identify",description:"Destination-level identify calls mixpanel.identify with a resolved distinctId before firing the default track.",in:(0,w.getEvent)("page view",{timestamp:1700000104}),settings:{identify:{map:{distinctId:"user.id"}}},out:[["mixpanel.identify","us3r"],["mixpanel.track","page view",{}]]},I={title:"User login identify",description:"A user login identifies the user and fires Mixpanel people set, set_once, and increment operations.",in:(0,w.getEvent)("user login",{timestamp:1700000105,data:{user_id:"new-user-123",plan:"premium",company:"Acme",email:"user@acme.com"}}),mapping:{silent:!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:[["mixpanel.identify","new-user-123"],["mixpanel.people.set",{plan:"premium",company:"Acme",email:"user@acme.com"}],["mixpanel.people.set_once",{first_login:1700000105}],["mixpanel.people.increment",{login_count:1}]]},O={title:"All people operations",description:"A profile update exercises the full Mixpanel people vocabulary including set, increment, append, union, and remove.",in:(0,w.getEvent)("profile update",{timestamp:1700000106,data:{name:"Jane Doe",email:"jane@acme.com",page:"/docs/getting-started",removed_tag:"trial",source:"referral"}}),mapping:{silent:!0,settings:{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:[["mixpanel.people.set",{name:"Jane Doe",email:"jane@acme.com"}],["mixpanel.people.set_once",{signup_source:"referral"}],["mixpanel.people.increment",{page_views:1}],["mixpanel.people.append",{visited_pages:"/docs/getting-started"}],["mixpanel.people.union",{unique_tags:["active"]}],["mixpanel.people.remove",{tags:"trial"}],["mixpanel.people.unset",["old_plan"]]]},P={title:"Delete user",description:"An account delete fires Mixpanel people.delete_user to remove the user profile from the project.",in:(0,w.getEvent)("account delete",{timestamp:1700000107}),mapping:{silent:!0,settings:{people:{map:{delete_user:{value:!0}}}}},out:[["mixpanel.people.delete_user"]]},j={title:"User logout reset",description:"A user logout calls mixpanel.reset to clear persistence and generate a new anonymous distinct id.",in:(0,w.getEvent)("user logout",{timestamp:1700000108}),mapping:{silent:!0,settings:{reset:!0}},out:[["mixpanel.reset"]]},M={title:"Group association",description:"A user login associates the user to a company group via mixpanel.set_group and fires the default track.",in:(0,w.getEvent)("user login",{timestamp:1700000109,data:{user_id:"user-456",company_id:"acme-inc"}}),mapping:{settings:{group:{map:{key:{value:"company_id"},id:"data.company_id"}}}},out:[["mixpanel.set_group","company_id","acme-inc"],["mixpanel.track","user login",{}]]},R={title:"Group profile",description:"A company update sets Mixpanel group profile properties via get_group.set and get_group.set_once.",in:(0,w.getEvent)("company update",{timestamp:1700000110,data:{company_id:"acme-inc",company_name:"Acme, Inc.",plan:"enterprise",employee_count:250,founded_year:2010}}),mapping:{silent:!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:[["mixpanel.get_group.set","company_id","acme-inc",{name:"Acme, Inc.",plan:"enterprise",employee_count:250}],["mixpanel.get_group.set_once","company_id","acme-inc",{founded:2010}]]},q={title:"Consent revoked",description:"A walker consent command with analytics denied calls mixpanel.opt_out_tracking to stop event capture.",command:"consent",before:{analytics:!0},in:{analytics:!1},settings:{},out:[["mixpanel.opt_in_tracking"],["mixpanel.opt_out_tracking"]]},U={title:"Consent granted",description:"A walker consent command with analytics granted calls mixpanel.opt_in_tracking to resume event capture.",command:"consent",in:{analytics:!0},settings:{},out:[["mixpanel.opt_in_tracking"]]};//# 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 your Mixpanel project settings under \"Project Settings\" and \"Access Keys\". Passed to mixpanel.init() as the first argument (like a1b2c3d4e5f6789012345678abcdef12).',\n ),\n api_host: z\n .string()\n .describe(\n 'Mixpanel ingestion host. Default: https://api-js.mixpanel.com. Use https://api-eu.mixpanel.com for EU residency.',\n )\n .optional(),\n persistence: z\n .enum(['cookie', 'localStorage'])\n .describe('Client-side persistence backend. Default: cookie.')\n .optional(),\n cross_subdomain_cookie: z\n .boolean()\n .describe('Share cookie across subdomains. Default: true.')\n .optional(),\n cookie_expiration: z\n .number()\n .int()\n .nonnegative()\n .describe('Cookie expiration in days. Default: 365.')\n .optional(),\n secure_cookie: z\n .boolean()\n .describe('Only send cookie over HTTPS. Default: false.')\n .optional(),\n ip: z\n .boolean()\n .describe('Enable server-side IP geolocation. Default: true.')\n .optional(),\n batch_requests: z\n .boolean()\n .describe(\n 'Use the /batch endpoint instead of individual requests. Default: true.',\n )\n .optional(),\n batch_size: z\n .number()\n .int()\n .positive()\n .describe('Max events per batch. Default: 50.')\n .optional(),\n batch_flush_interval_ms: z\n .number()\n .int()\n .positive()\n .describe('Batch flush interval in ms. Default: 5000.')\n .optional(),\n debug: z\n .boolean()\n .describe('Enable verbose SDK logging. Default: false.')\n .optional(),\n opt_out_tracking_by_default: z\n .boolean()\n .describe(\n 'Start in opted-out state until opt_in_tracking() is called. Default: false.',\n )\n .optional(),\n track_pageview: z\n .union([z.boolean(), z.string()])\n .describe(\n 'Enable Mixpanel auto-pageview tracking. walkerOS default: false — walkerOS sources handle page views.',\n )\n .optional(),\n autocapture: z\n .unknown()\n .describe(\n 'Enable Mixpanel web autocapture. walkerOS default: false — walkerOS sources handle event capture.',\n )\n .optional(),\n record_sessions_percent: z\n .number()\n .min(0)\n .max(100)\n .describe(\n 'Session replay sampling rate (0-100). Default: 0 (disabled). Session replay is bundled in the npm build.',\n )\n .optional(),\n record_mask_all_inputs: z\n .boolean()\n .describe('Mask all input values in session replay. Default: true.')\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to an identity object. Keys: distinctId.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to { key, id } → mixpanel.set_group(key, id). Runs on destination init or per-event.',\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 } → mixpanel.identify(distinctId).',\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 mixpanel.people.* call.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Per-event group assignment. Resolves to { key, id } → mixpanel.set_group(key, id).',\n )\n .optional(),\n groupProfile: z\n .unknown()\n .describe(\n 'Per-event group profile operations. Resolves to { key, id, set?, set_once?, unset?, union?, remove?, delete? } → mixpanel.get_group(key, id).set/... calls.',\n )\n .optional(),\n reset: z\n .unknown()\n .describe(\n 'Logout trigger. Resolves to a truthy value → mixpanel.reset(). Typically used with silent: true on a user logout 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 { Env, MixpanelGroup } from '../types';\n\nconst noop = () => {};\n\n/**\n * A recording group handle that accumulates calls so tests can assert on them.\n * Each method records its arguments and returns `this` for chaining.\n */\nclass RecordingGroup implements MixpanelGroup {\n _calls: Array<{ method: string; args: unknown[] }> = [];\n\n private _record(method: string, ...args: unknown[]) {\n this._calls.push({ method, args });\n }\n\n set(...args: unknown[]) {\n this._record('set', ...args);\n }\n set_once(...args: unknown[]) {\n this._record('set_once', ...args);\n }\n unset(...args: unknown[]) {\n this._record('unset', ...args);\n }\n union(...args: unknown[]) {\n this._record('union', ...args);\n }\n remove(...args: unknown[]) {\n this._record('remove', ...args);\n }\n delete(...args: unknown[]) {\n this._record('delete', ...args);\n }\n}\n\n/**\n * A no-op group handle returned by the stub get_group(). Tests replace the\n * get_group function in the spy runner so this stub is never actually seen.\n */\nconst noopGroup: MixpanelGroup = {\n set: noop,\n set_once: noop,\n unset: noop,\n union: noop,\n remove: noop,\n delete: noop,\n};\n\n/**\n * Pre-init env — all methods are no-ops until the test runner wires spies.\n */\nexport const init: Env | undefined = {\n mixpanel: {\n init: noop,\n track: noop,\n identify: noop,\n reset: noop,\n set_group: noop,\n get_group: () => noopGroup,\n opt_in_tracking: noop,\n opt_out_tracking: noop,\n stop_batch_senders: noop,\n people: {\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 },\n};\n\n/**\n * Post-init env — same shape. The test runner clones this and replaces\n * individual methods with jest.fn() so it can assert on calls.\n */\nexport const push: Env = {\n mixpanel: {\n init: noop,\n track: noop,\n identify: noop,\n reset: noop,\n set_group: noop,\n get_group: () => noopGroup,\n opt_in_tracking: noop,\n opt_out_tracking: noop,\n stop_batch_senders: noop,\n people: {\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 },\n};\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = [\n 'call:mixpanel.init',\n 'call:mixpanel.track',\n 'call:mixpanel.identify',\n 'call:mixpanel.reset',\n 'call:mixpanel.set_group',\n 'call:mixpanel.get_group',\n 'call:mixpanel.opt_in_tracking',\n 'call:mixpanel.opt_out_tracking',\n 'call:mixpanel.people.set',\n 'call:mixpanel.people.set_once',\n 'call:mixpanel.people.increment',\n 'call:mixpanel.people.append',\n 'call:mixpanel.people.union',\n 'call:mixpanel.people.remove',\n 'call:mixpanel.people.unset',\n 'call:mixpanel.people.delete_user',\n];\n","import type { Flow, WalkerOS } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Examples may optionally carry destination-level settings. The test runner\n * reads `settings` from the example and merges it into the base destination\n * settings on top of the fixed apiKey.\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 * mixpanel.track(event.name, properties). With no mapping and no\n * destination-level include, properties is `{}`.\n */\nexport const defaultEventForwarding: MixpanelStepExample = {\n title: 'Default track',\n description:\n 'A walker event becomes a Mixpanel track call with the event name and empty properties.',\n in: getEvent('product view', { timestamp: 1700000100 }),\n out: [['mixpanel.track', 'product view', {}]],\n};\n\n/**\n * Wildcard ignore - walkerOS's standard way to drop events. The rule\n * matches but does nothing. The destination fires zero SDK calls.\n */\nexport const wildcardIgnored: MixpanelStepExample = {\n public: false,\n in: getEvent('debug noise', { timestamp: 1700000101 }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * Destination-level settings.include flattens the walkerOS `data` section\n * into prefixed track() properties on every push.\n */\nexport const destinationLevelInclude: MixpanelStepExample = {\n title: 'Include data',\n description:\n 'Destination-level include flattens the event data section into prefixed Mixpanel track properties.',\n in: getEvent('product view', { timestamp: 1700000102 }),\n configInclude: ['data'],\n out: [\n [\n 'mixpanel.track',\n 'product view',\n {\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-rule settings.include REPLACES destination-level include for the\n * matched rule. Here destination-level sends `data`, but the rule\n * overrides it with `globals` only.\n */\nexport const ruleIncludeReplaces: MixpanelStepExample = {\n title: 'Rule include overrides',\n description:\n 'A per-rule include replaces the destination-level include for this event, forwarding only globals here.',\n in: getEvent('order complete', { timestamp: 1700000103 }),\n configInclude: ['data'],\n mapping: {\n include: ['globals'],\n },\n out: [\n [\n 'mixpanel.track',\n 'order complete',\n {\n globals_pagegroup: 'shop',\n },\n ],\n ],\n};\n\n/**\n * Destination-level settings.identify fires on the first push. The\n * destination resolves { distinctId } and calls mixpanel.identify(distinctId),\n * then tracks the result in runtime state. Subsequent pushes with unchanged\n * distinctId do NOT re-fire identify().\n */\nexport const destinationLevelIdentify: MixpanelStepExample = {\n title: 'Destination identify',\n description:\n 'Destination-level identify calls mixpanel.identify with a resolved distinctId before firing the default track.',\n in: getEvent('page view', { timestamp: 1700000104 }),\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n out: [\n ['mixpanel.identify', 'us3r'],\n ['mixpanel.track', 'page view', {}],\n ],\n};\n\n/**\n * Per-event identify + people operations - the canonical \"user login\"\n * pattern. `silent: true` suppresses the default mixpanel.track() call\n * because we're running identity side effects only.\n */\nexport const userLoginIdentifyAndPeople: MixpanelStepExample = {\n title: 'User login identify',\n description:\n 'A user login identifies the user and fires Mixpanel people set, set_once, and increment operations.',\n in: getEvent('user login', {\n timestamp: 1700000105,\n data: {\n user_id: 'new-user-123',\n plan: 'premium',\n company: 'Acme',\n email: 'user@acme.com',\n },\n }),\n mapping: {\n silent: 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 ['mixpanel.identify', 'new-user-123'],\n [\n 'mixpanel.people.set',\n {\n plan: 'premium',\n company: 'Acme',\n email: 'user@acme.com',\n },\n ],\n [\n 'mixpanel.people.set_once',\n {\n first_login: 1700000105,\n },\n ],\n [\n 'mixpanel.people.increment',\n {\n login_count: 1,\n },\n ],\n ],\n};\n\n/**\n * Full people operation vocabulary - a profile update rule that exercises\n * set, set_once, increment, append, union, remove, and unset in a single\n * rule. `silent: true` because only side effects are needed.\n */\nexport const profileUpdateAllPeopleOperations: MixpanelStepExample = {\n title: 'All people operations',\n description:\n 'A profile update exercises the full Mixpanel people vocabulary including set, increment, append, union, and remove.',\n in: getEvent('profile update', {\n timestamp: 1700000106,\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 silent: true,\n settings: {\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 ['mixpanel.people.set', { name: 'Jane Doe', email: 'jane@acme.com' }],\n ['mixpanel.people.set_once', { signup_source: 'referral' }],\n ['mixpanel.people.increment', { page_views: 1 }],\n ['mixpanel.people.append', { visited_pages: '/docs/getting-started' }],\n ['mixpanel.people.union', { unique_tags: ['active'] }],\n ['mixpanel.people.remove', { tags: 'trial' }],\n ['mixpanel.people.unset', ['old_plan']],\n ],\n};\n\n/**\n * people.delete_user - destructive operation. The resolved people object\n * uses `{ delete_user: true }` to trigger the call.\n */\nexport const accountDeleteUser: MixpanelStepExample = {\n title: 'Delete user',\n description:\n 'An account delete fires Mixpanel people.delete_user to remove the user profile from the project.',\n in: getEvent('account delete', { timestamp: 1700000107 }),\n mapping: {\n silent: true,\n settings: {\n people: {\n map: {\n delete_user: { value: true },\n },\n },\n },\n },\n out: [['mixpanel.people.delete_user']],\n};\n\n/**\n * User logout - reset: true fires mixpanel.reset(), which clears all\n * persistence and generates a new anonymous distinct_id.\n */\nexport const userLogoutReset: MixpanelStepExample = {\n title: 'User logout reset',\n description:\n 'A user logout calls mixpanel.reset to clear persistence and generate a new anonymous distinct id.',\n in: getEvent('user logout', { timestamp: 1700000108 }),\n mapping: {\n silent: true,\n settings: {\n reset: true,\n },\n },\n out: [['mixpanel.reset']],\n};\n\n/**\n * User-group association - settings.group resolves to { key, id } and\n * calls mixpanel.set_group(key, id). Fires default track too.\n */\nexport const userGroupAssociation: MixpanelStepExample = {\n title: 'Group association',\n description:\n 'A user login associates the user to a company group via mixpanel.set_group and fires the default track.',\n in: getEvent('user login', {\n timestamp: 1700000109,\n data: {\n user_id: 'user-456',\n company_id: 'acme-inc',\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 ['mixpanel.set_group', 'company_id', 'acme-inc'],\n ['mixpanel.track', 'user login', {}],\n ],\n};\n\n/**\n * Group profile properties - settings.groupProfile resolves to\n * { key, id, set?, set_once?, ... } and calls\n * mixpanel.get_group(key, id).set(...), .set_once(...), etc.\n */\nexport const companyUpdateGroupProfile: MixpanelStepExample = {\n title: 'Group profile',\n description:\n 'A company update sets Mixpanel group profile properties via get_group.set and get_group.set_once.',\n in: getEvent('company update', {\n timestamp: 1700000110,\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 silent: 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 'mixpanel.get_group.set',\n 'company_id',\n 'acme-inc',\n { name: 'Acme, Inc.', plan: 'enterprise', employee_count: 250 },\n ],\n [\n 'mixpanel.get_group.set_once',\n 'company_id',\n 'acme-inc',\n { founded: 2010 },\n ],\n ],\n};\n\n/**\n * Consent revoked → mixpanel.opt_out_tracking(). The destination checks\n * the consent keys declared in config.consent and toggles opt_out/opt_in.\n */\nexport const consentRevokeOptOut: MixpanelStepExample = {\n title: 'Consent revoked',\n description:\n 'A walker consent command with analytics denied calls mixpanel.opt_out_tracking to stop event capture.',\n command: 'consent',\n in: { analytics: false } as WalkerOS.Consent,\n settings: {} as Partial<Settings>,\n out: [['mixpanel.opt_out_tracking']],\n};\n\n/**\n * Consent granted → mixpanel.opt_in_tracking().\n */\nexport const consentGrantOptIn: MixpanelStepExample = {\n title: 'Consent granted',\n description:\n 'A walker consent command with analytics granted calls mixpanel.opt_in_tracking to resume event capture.',\n command: 'consent',\n in: { analytics: true } as WalkerOS.Consent,\n settings: {} as Partial<Settings>,\n out: [['mixpanel.opt_in_tracking']],\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,UAAU,aACP,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,aACV,KAAK,CAAC,UAAU,cAAc,CAAC,EAC/B,SAAS,mDAAmD,EAC5D,SAAS;AAAA,EACZ,wBAAwB,aACrB,QAAQ,EACR,SAAS,gDAAgD,EACzD,SAAS;AAAA,EACZ,mBAAmB,aAChB,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,SAAS,0CAA0C,EACnD,SAAS;AAAA,EACZ,eAAe,aACZ,QAAQ,EACR,SAAS,8CAA8C,EACvD,SAAS;AAAA,EACZ,IAAI,aACD,QAAQ,EACR,SAAS,mDAAmD,EAC5D,SAAS;AAAA,EACZ,gBAAgB,aACb,QAAQ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AA,EACF,QAAI,sBAAS,kBAAkB;AAAA,IAC7B,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,cAAc;AAAA,IAChB;AAAA,EACF,CAAC;AAAA,EACD,SAAS;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,MACR,cAAc;AAAA,QACZ,KAAK;AAAA,UACH,KAAK,EAAE,OAAO,aAAa;AAAA,UAC3B,IAAI;AAAA,UACJ,KAAK;AAAA,YACH,KAAK;AAAA,cACH,MAAM;AAAA,cACN,MAAM;AAAA,cACN,gBAAgB;AAAA,YAClB;AAAA,UACF;AAAA,UACA,UAAU;AAAA,YACR,KAAK;AAAA,cACH,SAAS;AAAA,YACX;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA,EAAE,MAAM,cAAc,MAAM,cAAc,gBAAgB,IAAI;AAAA,IAChE;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA,EAAE,SAAS,KAAK;AAAA,IAClB;AAAA,EACF;AACF;AAMO,IAAM,sBAA2C;AAAA,EACtD,OAAO;AAAA,EACP,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,MAAM;AAAA,EACvB,UAAU,CAAC;AAAA,EACX,KAAK,CAAC,CAAC,2BAA2B,CAAC;AACrC;AAKO,IAAM,oBAAyC;AAAA,EACpD,OAAO;AAAA,EACP,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,KAAK;AAAA,EACtB,UAAU,CAAC;AAAA,EACX,KAAK,CAAC,CAAC,0BAA0B,CAAC;AACpC;","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 your Mixpanel project settings under \"Project Settings\" and \"Access Keys\". Passed to mixpanel.init() as the first argument (like a1b2c3d4e5f6789012345678abcdef12).',\n ),\n api_host: z\n .string()\n .describe(\n 'Mixpanel ingestion host. Default: https://api-js.mixpanel.com. Use https://api-eu.mixpanel.com for EU residency.',\n )\n .optional(),\n persistence: z\n .enum(['cookie', 'localStorage'])\n .describe('Client-side persistence backend. Default: cookie.')\n .optional(),\n cross_subdomain_cookie: z\n .boolean()\n .describe('Share cookie across subdomains. Default: true.')\n .optional(),\n cookie_expiration: z\n .number()\n .int()\n .nonnegative()\n .describe('Cookie expiration in days. Default: 365.')\n .optional(),\n secure_cookie: z\n .boolean()\n .describe('Only send cookie over HTTPS. Default: false.')\n .optional(),\n ip: z\n .boolean()\n .describe('Enable server-side IP geolocation. Default: true.')\n .optional(),\n batch_requests: z\n .boolean()\n .describe(\n 'Use the /batch endpoint instead of individual requests. Default: true.',\n )\n .optional(),\n batch_size: z\n .number()\n .int()\n .positive()\n .describe('Max events per batch. Default: 50.')\n .optional(),\n batch_flush_interval_ms: z\n .number()\n .int()\n .positive()\n .describe('Batch flush interval in ms. Default: 5000.')\n .optional(),\n debug: z\n .boolean()\n .describe('Enable verbose SDK logging. Default: false.')\n .optional(),\n opt_out_tracking_by_default: z\n .boolean()\n .describe(\n 'Start in opted-out state until opt_in_tracking() is called. Default: false.',\n )\n .optional(),\n track_pageview: z\n .union([z.boolean(), z.string()])\n .describe(\n 'Enable Mixpanel auto-pageview tracking. walkerOS default: false — walkerOS sources handle page views.',\n )\n .optional(),\n autocapture: z\n .unknown()\n .describe(\n 'Enable Mixpanel web autocapture. walkerOS default: false — walkerOS sources handle event capture.',\n )\n .optional(),\n record_sessions_percent: z\n .number()\n .min(0)\n .max(100)\n .describe(\n 'Session replay sampling rate (0-100). Default: 0 (disabled). Session replay is bundled in the npm build.',\n )\n .optional(),\n record_mask_all_inputs: z\n .boolean()\n .describe('Mask all input values in session replay. Default: true.')\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to an identity object. Keys: distinctId.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to { key, id } → mixpanel.set_group(key, id). Runs on destination init or per-event.',\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 } → mixpanel.identify(distinctId).',\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 mixpanel.people.* call.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Per-event group assignment. Resolves to { key, id } → mixpanel.set_group(key, id).',\n )\n .optional(),\n groupProfile: z\n .unknown()\n .describe(\n 'Per-event group profile operations. Resolves to { key, id, set?, set_once?, unset?, union?, remove?, delete? } → mixpanel.get_group(key, id).set/... calls.',\n )\n .optional(),\n reset: z\n .unknown()\n .describe(\n 'Logout trigger. Resolves to a truthy value → mixpanel.reset(). Typically used with silent: true on a user logout 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 { Env, MixpanelGroup } from '../types';\n\nconst noop = () => {};\n\n/**\n * A recording group handle that accumulates calls so tests can assert on them.\n * Each method records its arguments and returns `this` for chaining.\n */\nclass RecordingGroup implements MixpanelGroup {\n _calls: Array<{ method: string; args: unknown[] }> = [];\n\n private _record(method: string, ...args: unknown[]) {\n this._calls.push({ method, args });\n }\n\n set(...args: unknown[]) {\n this._record('set', ...args);\n }\n set_once(...args: unknown[]) {\n this._record('set_once', ...args);\n }\n unset(...args: unknown[]) {\n this._record('unset', ...args);\n }\n union(...args: unknown[]) {\n this._record('union', ...args);\n }\n remove(...args: unknown[]) {\n this._record('remove', ...args);\n }\n delete(...args: unknown[]) {\n this._record('delete', ...args);\n }\n}\n\n/**\n * A no-op group handle returned by the stub get_group(). Tests replace the\n * get_group function in the spy runner so this stub is never actually seen.\n */\nconst noopGroup: MixpanelGroup = {\n set: noop,\n set_once: noop,\n unset: noop,\n union: noop,\n remove: noop,\n delete: noop,\n};\n\n/**\n * Pre-init env — all methods are no-ops until the test runner wires spies.\n */\nexport const init: Env | undefined = {\n mixpanel: {\n init: noop,\n track: noop,\n identify: noop,\n reset: noop,\n set_group: noop,\n get_group: () => noopGroup,\n opt_in_tracking: noop,\n opt_out_tracking: noop,\n stop_batch_senders: noop,\n people: {\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 },\n};\n\n/**\n * Post-init env — same shape. The test runner clones this and replaces\n * individual methods with jest.fn() so it can assert on calls.\n */\nexport const push: Env = {\n mixpanel: {\n init: noop,\n track: noop,\n identify: noop,\n reset: noop,\n set_group: noop,\n get_group: () => noopGroup,\n opt_in_tracking: noop,\n opt_out_tracking: noop,\n stop_batch_senders: noop,\n people: {\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 },\n};\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = [\n 'call:mixpanel.init',\n 'call:mixpanel.track',\n 'call:mixpanel.identify',\n 'call:mixpanel.reset',\n 'call:mixpanel.set_group',\n 'call:mixpanel.get_group',\n 'call:mixpanel.opt_in_tracking',\n 'call:mixpanel.opt_out_tracking',\n 'call:mixpanel.people.set',\n 'call:mixpanel.people.set_once',\n 'call:mixpanel.people.increment',\n 'call:mixpanel.people.append',\n 'call:mixpanel.people.union',\n 'call:mixpanel.people.remove',\n 'call:mixpanel.people.unset',\n 'call:mixpanel.people.delete_user',\n];\n","import type { Flow, WalkerOS } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Examples may optionally carry destination-level settings. The test runner\n * reads `settings` from the example and merges it into the base destination\n * settings on top of the fixed apiKey.\n */\nexport type MixpanelStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n configInclude?: string[];\n /** Consent granted before `in` so a gated destination is loaded first. */\n before?: WalkerOS.Consent;\n};\n\n/**\n * Default event forwarding - every walkerOS event becomes\n * mixpanel.track(event.name, properties). With no mapping and no\n * destination-level include, properties is `{}`.\n */\nexport const defaultEventForwarding: MixpanelStepExample = {\n title: 'Default track',\n description:\n 'A walker event becomes a Mixpanel track call with the event name and empty properties.',\n in: getEvent('product view', { timestamp: 1700000100 }),\n out: [['mixpanel.track', 'product view', {}]],\n};\n\n/**\n * Wildcard ignore - walkerOS's standard way to drop events. The rule\n * matches but does nothing. The destination fires zero SDK calls.\n */\nexport const wildcardIgnored: MixpanelStepExample = {\n public: false,\n in: getEvent('debug noise', { timestamp: 1700000101 }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * Destination-level settings.include flattens the walkerOS `data` section\n * into prefixed track() properties on every push.\n */\nexport const destinationLevelInclude: MixpanelStepExample = {\n title: 'Include data',\n description:\n 'Destination-level include flattens the event data section into prefixed Mixpanel track properties.',\n in: getEvent('product view', { timestamp: 1700000102 }),\n configInclude: ['data'],\n out: [\n [\n 'mixpanel.track',\n 'product view',\n {\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-rule settings.include REPLACES destination-level include for the\n * matched rule. Here destination-level sends `data`, but the rule\n * overrides it with `globals` only.\n */\nexport const ruleIncludeReplaces: MixpanelStepExample = {\n title: 'Rule include overrides',\n description:\n 'A per-rule include replaces the destination-level include for this event, forwarding only globals here.',\n in: getEvent('order complete', { timestamp: 1700000103 }),\n configInclude: ['data'],\n mapping: {\n include: ['globals'],\n },\n out: [\n [\n 'mixpanel.track',\n 'order complete',\n {\n globals_pagegroup: 'shop',\n },\n ],\n ],\n};\n\n/**\n * Destination-level settings.identify fires on the first push. The\n * destination resolves { distinctId } and calls mixpanel.identify(distinctId),\n * then tracks the result in runtime state. Subsequent pushes with unchanged\n * distinctId do NOT re-fire identify().\n */\nexport const destinationLevelIdentify: MixpanelStepExample = {\n title: 'Destination identify',\n description:\n 'Destination-level identify calls mixpanel.identify with a resolved distinctId before firing the default track.',\n in: getEvent('page view', { timestamp: 1700000104 }),\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n out: [\n ['mixpanel.identify', 'us3r'],\n ['mixpanel.track', 'page view', {}],\n ],\n};\n\n/**\n * Per-event identify + people operations - the canonical \"user login\"\n * pattern. `silent: true` suppresses the default mixpanel.track() call\n * because we're running identity side effects only.\n */\nexport const userLoginIdentifyAndPeople: MixpanelStepExample = {\n title: 'User login identify',\n description:\n 'A user login identifies the user and fires Mixpanel people set, set_once, and increment operations.',\n in: getEvent('user login', {\n timestamp: 1700000105,\n data: {\n user_id: 'new-user-123',\n plan: 'premium',\n company: 'Acme',\n email: 'user@acme.com',\n },\n }),\n mapping: {\n silent: 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 ['mixpanel.identify', 'new-user-123'],\n [\n 'mixpanel.people.set',\n {\n plan: 'premium',\n company: 'Acme',\n email: 'user@acme.com',\n },\n ],\n [\n 'mixpanel.people.set_once',\n {\n first_login: 1700000105,\n },\n ],\n [\n 'mixpanel.people.increment',\n {\n login_count: 1,\n },\n ],\n ],\n};\n\n/**\n * Full people operation vocabulary - a profile update rule that exercises\n * set, set_once, increment, append, union, remove, and unset in a single\n * rule. `silent: true` because only side effects are needed.\n */\nexport const profileUpdateAllPeopleOperations: MixpanelStepExample = {\n title: 'All people operations',\n description:\n 'A profile update exercises the full Mixpanel people vocabulary including set, increment, append, union, and remove.',\n in: getEvent('profile update', {\n timestamp: 1700000106,\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 silent: true,\n settings: {\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 ['mixpanel.people.set', { name: 'Jane Doe', email: 'jane@acme.com' }],\n ['mixpanel.people.set_once', { signup_source: 'referral' }],\n ['mixpanel.people.increment', { page_views: 1 }],\n ['mixpanel.people.append', { visited_pages: '/docs/getting-started' }],\n ['mixpanel.people.union', { unique_tags: ['active'] }],\n ['mixpanel.people.remove', { tags: 'trial' }],\n ['mixpanel.people.unset', ['old_plan']],\n ],\n};\n\n/**\n * people.delete_user - destructive operation. The resolved people object\n * uses `{ delete_user: true }` to trigger the call.\n */\nexport const accountDeleteUser: MixpanelStepExample = {\n title: 'Delete user',\n description:\n 'An account delete fires Mixpanel people.delete_user to remove the user profile from the project.',\n in: getEvent('account delete', { timestamp: 1700000107 }),\n mapping: {\n silent: true,\n settings: {\n people: {\n map: {\n delete_user: { value: true },\n },\n },\n },\n },\n out: [['mixpanel.people.delete_user']],\n};\n\n/**\n * User logout - reset: true fires mixpanel.reset(), which clears all\n * persistence and generates a new anonymous distinct_id.\n */\nexport const userLogoutReset: MixpanelStepExample = {\n title: 'User logout reset',\n description:\n 'A user logout calls mixpanel.reset to clear persistence and generate a new anonymous distinct id.',\n in: getEvent('user logout', { timestamp: 1700000108 }),\n mapping: {\n silent: true,\n settings: {\n reset: true,\n },\n },\n out: [['mixpanel.reset']],\n};\n\n/**\n * User-group association - settings.group resolves to { key, id } and\n * calls mixpanel.set_group(key, id). Fires default track too.\n */\nexport const userGroupAssociation: MixpanelStepExample = {\n title: 'Group association',\n description:\n 'A user login associates the user to a company group via mixpanel.set_group and fires the default track.',\n in: getEvent('user login', {\n timestamp: 1700000109,\n data: {\n user_id: 'user-456',\n company_id: 'acme-inc',\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 ['mixpanel.set_group', 'company_id', 'acme-inc'],\n ['mixpanel.track', 'user login', {}],\n ],\n};\n\n/**\n * Group profile properties - settings.groupProfile resolves to\n * { key, id, set?, set_once?, ... } and calls\n * mixpanel.get_group(key, id).set(...), .set_once(...), etc.\n */\nexport const companyUpdateGroupProfile: MixpanelStepExample = {\n title: 'Group profile',\n description:\n 'A company update sets Mixpanel group profile properties via get_group.set and get_group.set_once.',\n in: getEvent('company update', {\n timestamp: 1700000110,\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 silent: 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 'mixpanel.get_group.set',\n 'company_id',\n 'acme-inc',\n { name: 'Acme, Inc.', plan: 'enterprise', employee_count: 250 },\n ],\n [\n 'mixpanel.get_group.set_once',\n 'company_id',\n 'acme-inc',\n { founded: 2010 },\n ],\n ],\n};\n\n/**\n * Consent revoked → mixpanel.opt_out_tracking(). After analytics consent is\n * granted (Mixpanel loads and opts in), revoking it calls\n * mixpanel.opt_out_tracking() via the consent handler. The destination is\n * never loaded under denied consent, so the opt-out is a real revocation of an\n * already-granted destination.\n */\nexport const consentRevokeOptOut: MixpanelStepExample = {\n title: 'Consent revoked',\n description:\n 'A walker consent command with analytics denied calls mixpanel.opt_out_tracking to stop event capture.',\n command: 'consent',\n before: { analytics: true },\n in: { analytics: false } as WalkerOS.Consent,\n settings: {} as Partial<Settings>,\n out: [['mixpanel.opt_in_tracking'], ['mixpanel.opt_out_tracking']],\n};\n\n/**\n * Consent granted → mixpanel.opt_in_tracking().\n */\nexport const consentGrantOptIn: MixpanelStepExample = {\n title: 'Consent granted',\n description:\n 'A walker consent command with analytics granted calls mixpanel.opt_in_tracking to resume event capture.',\n command: 'consent',\n in: { analytics: true } as WalkerOS.Consent,\n settings: {} as Partial<Settings>,\n out: [['mixpanel.opt_in_tracking']],\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,UAAU,aACP,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,aACV,KAAK,CAAC,UAAU,cAAc,CAAC,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A,EAC1B,IAAI,EAAE,WAAW,MAAM;AAAA,EACvB,UAAU,CAAC;AAAA,EACX,KAAK,CAAC,CAAC,0BAA0B,GAAG,CAAC,2BAA2B,CAAC;AACnE;AAKO,IAAM,oBAAyC;AAAA,EACpD,OAAO;AAAA,EACP,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,KAAK;AAAA,EACtB,UAAU,CAAC;AAAA,EACX,KAAK,CAAC,CAAC,0BAA0B,CAAC;AACpC;","names":["import_dev","import_dev"]}
|
package/dist/dev.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(t,n)=>{for(var a in n)e(t,a,{get:n[a],enumerable:!0})},n={};t(n,{MappingSchema:()=>l,SettingsSchema:()=>o,mapping:()=>r,settings:()=>s});import{zodToSchema as a}from"@walkeros/core/dev";import{z as i}from"@walkeros/core/dev";var o=i.object({apiKey:i.string().min(1).describe('Your Mixpanel project token. Find it in your Mixpanel project settings under "Project Settings" and "Access Keys". Passed to mixpanel.init() as the first argument (like a1b2c3d4e5f6789012345678abcdef12).'),api_host:i.string().describe("Mixpanel ingestion host. Default: https://api-js.mixpanel.com. Use https://api-eu.mixpanel.com for EU residency.").optional(),persistence:i.enum(["cookie","localStorage"]).describe("Client-side persistence backend. Default: cookie.").optional(),cross_subdomain_cookie:i.boolean().describe("Share cookie across subdomains. Default: true.").optional(),cookie_expiration:i.number().int().nonnegative().describe("Cookie expiration in days. Default: 365.").optional(),secure_cookie:i.boolean().describe("Only send cookie over HTTPS. Default: false.").optional(),ip:i.boolean().describe("Enable server-side IP geolocation. Default: true.").optional(),batch_requests:i.boolean().describe("Use the /batch endpoint instead of individual requests. Default: true.").optional(),batch_size:i.number().int().positive().describe("Max events per batch. Default: 50.").optional(),batch_flush_interval_ms:i.number().int().positive().describe("Batch flush interval in ms. Default: 5000.").optional(),debug:i.boolean().describe("Enable verbose SDK logging. Default: false.").optional(),opt_out_tracking_by_default:i.boolean().describe("Start in opted-out state until opt_in_tracking() is called. Default: false.").optional(),track_pageview:i.union([i.boolean(),i.string()]).describe("Enable Mixpanel auto-pageview tracking. walkerOS default: false — walkerOS sources handle page views.").optional(),autocapture:i.unknown().describe("Enable Mixpanel web autocapture. walkerOS default: false — walkerOS sources handle event capture.").optional(),record_sessions_percent:i.number().min(0).max(100).describe("Session replay sampling rate (0-100). Default: 0 (disabled). Session replay is bundled in the npm build.").optional(),record_mask_all_inputs:i.boolean().describe("Mask all input values in session replay. Default: true.").optional(),identify:i.unknown().describe("walkerOS mapping value resolving to an identity object. Keys: distinctId.").optional(),group:i.unknown().describe("walkerOS mapping value resolving to { key, id } → mixpanel.set_group(key, id). Runs on destination init or per-event.").optional()});import{z as p}from"@walkeros/core/dev";var l=p.object({identify:p.unknown().describe("Per-event identity mapping. Resolves to { distinctId } → mixpanel.identify(distinctId).").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 mixpanel.people.* call.").optional(),group:p.unknown().describe("Per-event group assignment. Resolves to { key, id } → mixpanel.set_group(key, id).").optional(),groupProfile:p.unknown().describe("Per-event group profile operations. Resolves to { key, id, set?, set_once?, unset?, union?, remove?, delete? } → mixpanel.get_group(key, id).set/... calls.").optional(),reset:p.unknown().describe("Logout trigger. Resolves to a truthy value → mixpanel.reset(). Typically used with silent: true on a user logout rule.").optional()}),s=a(o),r=a(l),c={};t(c,{env:()=>d,step:()=>f});var d={};t(d,{init:()=>g,push:()=>_,simulation:()=>v});var u=()=>{},m={set:u,set_once:u,unset:u,union:u,remove:u,delete:u},g={mixpanel:{init:u,track:u,identify:u,reset:u,set_group:u,get_group:()=>m,opt_in_tracking:u,opt_out_tracking:u,stop_batch_senders:u,people:{set:u,set_once:u,increment:u,append:u,union:u,remove:u,unset:u,delete_user:u}}},_={mixpanel:{init:u,track:u,identify:u,reset:u,set_group:u,get_group:()=>m,opt_in_tracking:u,opt_out_tracking:u,stop_batch_senders:u,people:{set:u,set_once:u,increment:u,append:u,union:u,remove:u,unset:u,delete_user:u}}},v=["call:mixpanel.init","call:mixpanel.track","call:mixpanel.identify","call:mixpanel.reset","call:mixpanel.set_group","call:mixpanel.get_group","call:mixpanel.opt_in_tracking","call:mixpanel.opt_out_tracking","call:mixpanel.people.set","call:mixpanel.people.set_once","call:mixpanel.people.increment","call:mixpanel.people.append","call:mixpanel.people.union","call:mixpanel.people.remove","call:mixpanel.people.unset","call:mixpanel.people.delete_user"],f={};t(f,{accountDeleteUser:()=>I,companyUpdateGroupProfile:()=>P,consentGrantOptIn:()=>O,consentRevokeOptOut:()=>j,defaultEventForwarding:()=>k,destinationLevelIdentify:()=>w,destinationLevelInclude:()=>b,profileUpdateAllPeopleOperations:()=>A,ruleIncludeReplaces:()=>h,userGroupAssociation:()=>M,userLoginIdentifyAndPeople:()=>D,userLogoutReset:()=>S,wildcardIgnored:()=>x});import{getEvent as y}from"@walkeros/core";var k={title:"Default track",description:"A walker event becomes a Mixpanel track call with the event name and empty properties.",in:y("product view",{timestamp:1700000100}),out:[["mixpanel.track","product view",{}]]},x={public:!1,in:y("debug noise",{timestamp:1700000101}),mapping:{ignore:!0},out:[]},b={title:"Include data",description:"Destination-level include flattens the event data section into prefixed Mixpanel track properties.",in:y("product view",{timestamp:1700000102}),configInclude:["data"],out:[["mixpanel.track","product view",{data_id:"ers",data_name:"Everyday Ruck Snack",data_color:"black",data_size:"l",data_price:420}]]},h={title:"Rule include overrides",description:"A per-rule include replaces the destination-level include for this event, forwarding only globals here.",in:y("order complete",{timestamp:1700000103}),configInclude:["data"],mapping:{include:["globals"]},out:[["mixpanel.track","order complete",{globals_pagegroup:"shop"}]]},w={title:"Destination identify",description:"Destination-level identify calls mixpanel.identify with a resolved distinctId before firing the default track.",in:y("page view",{timestamp:1700000104}),settings:{identify:{map:{distinctId:"user.id"}}},out:[["mixpanel.identify","us3r"],["mixpanel.track","page view",{}]]},D={title:"User login identify",description:"A user login identifies the user and fires Mixpanel people set, set_once, and increment operations.",in:y("user login",{timestamp:1700000105,data:{user_id:"new-user-123",plan:"premium",company:"Acme",email:"user@acme.com"}}),mapping:{silent:!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:[["mixpanel.identify","new-user-123"],["mixpanel.people.set",{plan:"premium",company:"Acme",email:"user@acme.com"}],["mixpanel.people.set_once",{first_login:1700000105}],["mixpanel.people.increment",{login_count:1}]]},A={title:"All people operations",description:"A profile update exercises the full Mixpanel people vocabulary including set, increment, append, union, and remove.",in:y("profile update",{timestamp:1700000106,data:{name:"Jane Doe",email:"jane@acme.com",page:"/docs/getting-started",removed_tag:"trial",source:"referral"}}),mapping:{silent:!0,settings:{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:[["mixpanel.people.set",{name:"Jane Doe",email:"jane@acme.com"}],["mixpanel.people.set_once",{signup_source:"referral"}],["mixpanel.people.increment",{page_views:1}],["mixpanel.people.append",{visited_pages:"/docs/getting-started"}],["mixpanel.people.union",{unique_tags:["active"]}],["mixpanel.people.remove",{tags:"trial"}],["mixpanel.people.unset",["old_plan"]]]},I={title:"Delete user",description:"An account delete fires Mixpanel people.delete_user to remove the user profile from the project.",in:y("account delete",{timestamp:1700000107}),mapping:{silent:!0,settings:{people:{map:{delete_user:{value:!0}}}}},out:[["mixpanel.people.delete_user"]]},S={title:"User logout reset",description:"A user logout calls mixpanel.reset to clear persistence and generate a new anonymous distinct id.",in:y("user logout",{timestamp:1700000108}),mapping:{silent:!0,settings:{reset:!0}},out:[["mixpanel.reset"]]},M={title:"Group association",description:"A user login associates the user to a company group via mixpanel.set_group and fires the default track.",in:y("user login",{timestamp:1700000109,data:{user_id:"user-456",company_id:"acme-inc"}}),mapping:{settings:{group:{map:{key:{value:"company_id"},id:"data.company_id"}}}},out:[["mixpanel.set_group","company_id","acme-inc"],["mixpanel.track","user login",{}]]},P={title:"Group profile",description:"A company update sets Mixpanel group profile properties via get_group.set and get_group.set_once.",in:y("company update",{timestamp:1700000110,data:{company_id:"acme-inc",company_name:"Acme, Inc.",plan:"enterprise",employee_count:250,founded_year:2010}}),mapping:{silent:!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:[["mixpanel.get_group.set","company_id","acme-inc",{name:"Acme, Inc.",plan:"enterprise",employee_count:250}],["mixpanel.get_group.set_once","company_id","acme-inc",{founded:2010}]]},j={title:"Consent revoked",description:"A walker consent command with analytics denied calls mixpanel.opt_out_tracking to stop event capture.",command:"consent",in:{analytics:!1},settings:{},out:[["mixpanel.opt_out_tracking"]]},O={title:"Consent granted",description:"A walker consent command with analytics granted calls mixpanel.opt_in_tracking to resume event capture.",command:"consent",in:{analytics:!0},settings:{},out:[["mixpanel.opt_in_tracking"]]};export{c as examples,n as schemas};//# sourceMappingURL=dev.mjs.map
|
|
1
|
+
var e=Object.defineProperty,t=(t,n)=>{for(var a in n)e(t,a,{get:n[a],enumerable:!0})},n={};t(n,{MappingSchema:()=>l,SettingsSchema:()=>o,mapping:()=>r,settings:()=>s});import{zodToSchema as a}from"@walkeros/core/dev";import{z as i}from"@walkeros/core/dev";var o=i.object({apiKey:i.string().min(1).describe('Your Mixpanel project token. Find it in your Mixpanel project settings under "Project Settings" and "Access Keys". Passed to mixpanel.init() as the first argument (like a1b2c3d4e5f6789012345678abcdef12).'),api_host:i.string().describe("Mixpanel ingestion host. Default: https://api-js.mixpanel.com. Use https://api-eu.mixpanel.com for EU residency.").optional(),persistence:i.enum(["cookie","localStorage"]).describe("Client-side persistence backend. Default: cookie.").optional(),cross_subdomain_cookie:i.boolean().describe("Share cookie across subdomains. Default: true.").optional(),cookie_expiration:i.number().int().nonnegative().describe("Cookie expiration in days. Default: 365.").optional(),secure_cookie:i.boolean().describe("Only send cookie over HTTPS. Default: false.").optional(),ip:i.boolean().describe("Enable server-side IP geolocation. Default: true.").optional(),batch_requests:i.boolean().describe("Use the /batch endpoint instead of individual requests. Default: true.").optional(),batch_size:i.number().int().positive().describe("Max events per batch. Default: 50.").optional(),batch_flush_interval_ms:i.number().int().positive().describe("Batch flush interval in ms. Default: 5000.").optional(),debug:i.boolean().describe("Enable verbose SDK logging. Default: false.").optional(),opt_out_tracking_by_default:i.boolean().describe("Start in opted-out state until opt_in_tracking() is called. Default: false.").optional(),track_pageview:i.union([i.boolean(),i.string()]).describe("Enable Mixpanel auto-pageview tracking. walkerOS default: false — walkerOS sources handle page views.").optional(),autocapture:i.unknown().describe("Enable Mixpanel web autocapture. walkerOS default: false — walkerOS sources handle event capture.").optional(),record_sessions_percent:i.number().min(0).max(100).describe("Session replay sampling rate (0-100). Default: 0 (disabled). Session replay is bundled in the npm build.").optional(),record_mask_all_inputs:i.boolean().describe("Mask all input values in session replay. Default: true.").optional(),identify:i.unknown().describe("walkerOS mapping value resolving to an identity object. Keys: distinctId.").optional(),group:i.unknown().describe("walkerOS mapping value resolving to { key, id } → mixpanel.set_group(key, id). Runs on destination init or per-event.").optional()});import{z as p}from"@walkeros/core/dev";var l=p.object({identify:p.unknown().describe("Per-event identity mapping. Resolves to { distinctId } → mixpanel.identify(distinctId).").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 mixpanel.people.* call.").optional(),group:p.unknown().describe("Per-event group assignment. Resolves to { key, id } → mixpanel.set_group(key, id).").optional(),groupProfile:p.unknown().describe("Per-event group profile operations. Resolves to { key, id, set?, set_once?, unset?, union?, remove?, delete? } → mixpanel.get_group(key, id).set/... calls.").optional(),reset:p.unknown().describe("Logout trigger. Resolves to a truthy value → mixpanel.reset(). Typically used with silent: true on a user logout rule.").optional()}),s=a(o),r=a(l),c={};t(c,{env:()=>d,step:()=>f});var d={};t(d,{init:()=>g,push:()=>_,simulation:()=>v});var u=()=>{},m={set:u,set_once:u,unset:u,union:u,remove:u,delete:u},g={mixpanel:{init:u,track:u,identify:u,reset:u,set_group:u,get_group:()=>m,opt_in_tracking:u,opt_out_tracking:u,stop_batch_senders:u,people:{set:u,set_once:u,increment:u,append:u,union:u,remove:u,unset:u,delete_user:u}}},_={mixpanel:{init:u,track:u,identify:u,reset:u,set_group:u,get_group:()=>m,opt_in_tracking:u,opt_out_tracking:u,stop_batch_senders:u,people:{set:u,set_once:u,increment:u,append:u,union:u,remove:u,unset:u,delete_user:u}}},v=["call:mixpanel.init","call:mixpanel.track","call:mixpanel.identify","call:mixpanel.reset","call:mixpanel.set_group","call:mixpanel.get_group","call:mixpanel.opt_in_tracking","call:mixpanel.opt_out_tracking","call:mixpanel.people.set","call:mixpanel.people.set_once","call:mixpanel.people.increment","call:mixpanel.people.append","call:mixpanel.people.union","call:mixpanel.people.remove","call:mixpanel.people.unset","call:mixpanel.people.delete_user"],f={};t(f,{accountDeleteUser:()=>I,companyUpdateGroupProfile:()=>P,consentGrantOptIn:()=>O,consentRevokeOptOut:()=>j,defaultEventForwarding:()=>k,destinationLevelIdentify:()=>w,destinationLevelInclude:()=>b,profileUpdateAllPeopleOperations:()=>A,ruleIncludeReplaces:()=>h,userGroupAssociation:()=>M,userLoginIdentifyAndPeople:()=>D,userLogoutReset:()=>S,wildcardIgnored:()=>x});import{getEvent as y}from"@walkeros/core";var k={title:"Default track",description:"A walker event becomes a Mixpanel track call with the event name and empty properties.",in:y("product view",{timestamp:1700000100}),out:[["mixpanel.track","product view",{}]]},x={public:!1,in:y("debug noise",{timestamp:1700000101}),mapping:{ignore:!0},out:[]},b={title:"Include data",description:"Destination-level include flattens the event data section into prefixed Mixpanel track properties.",in:y("product view",{timestamp:1700000102}),configInclude:["data"],out:[["mixpanel.track","product view",{data_id:"ers",data_name:"Everyday Ruck Snack",data_color:"black",data_size:"l",data_price:420}]]},h={title:"Rule include overrides",description:"A per-rule include replaces the destination-level include for this event, forwarding only globals here.",in:y("order complete",{timestamp:1700000103}),configInclude:["data"],mapping:{include:["globals"]},out:[["mixpanel.track","order complete",{globals_pagegroup:"shop"}]]},w={title:"Destination identify",description:"Destination-level identify calls mixpanel.identify with a resolved distinctId before firing the default track.",in:y("page view",{timestamp:1700000104}),settings:{identify:{map:{distinctId:"user.id"}}},out:[["mixpanel.identify","us3r"],["mixpanel.track","page view",{}]]},D={title:"User login identify",description:"A user login identifies the user and fires Mixpanel people set, set_once, and increment operations.",in:y("user login",{timestamp:1700000105,data:{user_id:"new-user-123",plan:"premium",company:"Acme",email:"user@acme.com"}}),mapping:{silent:!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:[["mixpanel.identify","new-user-123"],["mixpanel.people.set",{plan:"premium",company:"Acme",email:"user@acme.com"}],["mixpanel.people.set_once",{first_login:1700000105}],["mixpanel.people.increment",{login_count:1}]]},A={title:"All people operations",description:"A profile update exercises the full Mixpanel people vocabulary including set, increment, append, union, and remove.",in:y("profile update",{timestamp:1700000106,data:{name:"Jane Doe",email:"jane@acme.com",page:"/docs/getting-started",removed_tag:"trial",source:"referral"}}),mapping:{silent:!0,settings:{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:[["mixpanel.people.set",{name:"Jane Doe",email:"jane@acme.com"}],["mixpanel.people.set_once",{signup_source:"referral"}],["mixpanel.people.increment",{page_views:1}],["mixpanel.people.append",{visited_pages:"/docs/getting-started"}],["mixpanel.people.union",{unique_tags:["active"]}],["mixpanel.people.remove",{tags:"trial"}],["mixpanel.people.unset",["old_plan"]]]},I={title:"Delete user",description:"An account delete fires Mixpanel people.delete_user to remove the user profile from the project.",in:y("account delete",{timestamp:1700000107}),mapping:{silent:!0,settings:{people:{map:{delete_user:{value:!0}}}}},out:[["mixpanel.people.delete_user"]]},S={title:"User logout reset",description:"A user logout calls mixpanel.reset to clear persistence and generate a new anonymous distinct id.",in:y("user logout",{timestamp:1700000108}),mapping:{silent:!0,settings:{reset:!0}},out:[["mixpanel.reset"]]},M={title:"Group association",description:"A user login associates the user to a company group via mixpanel.set_group and fires the default track.",in:y("user login",{timestamp:1700000109,data:{user_id:"user-456",company_id:"acme-inc"}}),mapping:{settings:{group:{map:{key:{value:"company_id"},id:"data.company_id"}}}},out:[["mixpanel.set_group","company_id","acme-inc"],["mixpanel.track","user login",{}]]},P={title:"Group profile",description:"A company update sets Mixpanel group profile properties via get_group.set and get_group.set_once.",in:y("company update",{timestamp:1700000110,data:{company_id:"acme-inc",company_name:"Acme, Inc.",plan:"enterprise",employee_count:250,founded_year:2010}}),mapping:{silent:!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:[["mixpanel.get_group.set","company_id","acme-inc",{name:"Acme, Inc.",plan:"enterprise",employee_count:250}],["mixpanel.get_group.set_once","company_id","acme-inc",{founded:2010}]]},j={title:"Consent revoked",description:"A walker consent command with analytics denied calls mixpanel.opt_out_tracking to stop event capture.",command:"consent",before:{analytics:!0},in:{analytics:!1},settings:{},out:[["mixpanel.opt_in_tracking"],["mixpanel.opt_out_tracking"]]},O={title:"Consent granted",description:"A walker consent command with analytics granted calls mixpanel.opt_in_tracking to resume event capture.",command:"consent",in:{analytics:!0},settings:{},out:[["mixpanel.opt_in_tracking"]]};export{c as examples,n 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 your Mixpanel project settings under \"Project Settings\" and \"Access Keys\". Passed to mixpanel.init() as the first argument (like a1b2c3d4e5f6789012345678abcdef12).',\n ),\n api_host: z\n .string()\n .describe(\n 'Mixpanel ingestion host. Default: https://api-js.mixpanel.com. Use https://api-eu.mixpanel.com for EU residency.',\n )\n .optional(),\n persistence: z\n .enum(['cookie', 'localStorage'])\n .describe('Client-side persistence backend. Default: cookie.')\n .optional(),\n cross_subdomain_cookie: z\n .boolean()\n .describe('Share cookie across subdomains. Default: true.')\n .optional(),\n cookie_expiration: z\n .number()\n .int()\n .nonnegative()\n .describe('Cookie expiration in days. Default: 365.')\n .optional(),\n secure_cookie: z\n .boolean()\n .describe('Only send cookie over HTTPS. Default: false.')\n .optional(),\n ip: z\n .boolean()\n .describe('Enable server-side IP geolocation. Default: true.')\n .optional(),\n batch_requests: z\n .boolean()\n .describe(\n 'Use the /batch endpoint instead of individual requests. Default: true.',\n )\n .optional(),\n batch_size: z\n .number()\n .int()\n .positive()\n .describe('Max events per batch. Default: 50.')\n .optional(),\n batch_flush_interval_ms: z\n .number()\n .int()\n .positive()\n .describe('Batch flush interval in ms. Default: 5000.')\n .optional(),\n debug: z\n .boolean()\n .describe('Enable verbose SDK logging. Default: false.')\n .optional(),\n opt_out_tracking_by_default: z\n .boolean()\n .describe(\n 'Start in opted-out state until opt_in_tracking() is called. Default: false.',\n )\n .optional(),\n track_pageview: z\n .union([z.boolean(), z.string()])\n .describe(\n 'Enable Mixpanel auto-pageview tracking. walkerOS default: false — walkerOS sources handle page views.',\n )\n .optional(),\n autocapture: z\n .unknown()\n .describe(\n 'Enable Mixpanel web autocapture. walkerOS default: false — walkerOS sources handle event capture.',\n )\n .optional(),\n record_sessions_percent: z\n .number()\n .min(0)\n .max(100)\n .describe(\n 'Session replay sampling rate (0-100). Default: 0 (disabled). Session replay is bundled in the npm build.',\n )\n .optional(),\n record_mask_all_inputs: z\n .boolean()\n .describe('Mask all input values in session replay. Default: true.')\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to an identity object. Keys: distinctId.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to { key, id } → mixpanel.set_group(key, id). Runs on destination init or per-event.',\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 } → mixpanel.identify(distinctId).',\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 mixpanel.people.* call.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Per-event group assignment. Resolves to { key, id } → mixpanel.set_group(key, id).',\n )\n .optional(),\n groupProfile: z\n .unknown()\n .describe(\n 'Per-event group profile operations. Resolves to { key, id, set?, set_once?, unset?, union?, remove?, delete? } → mixpanel.get_group(key, id).set/... calls.',\n )\n .optional(),\n reset: z\n .unknown()\n .describe(\n 'Logout trigger. Resolves to a truthy value → mixpanel.reset(). Typically used with silent: true on a user logout 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 { Env, MixpanelGroup } from '../types';\n\nconst noop = () => {};\n\n/**\n * A recording group handle that accumulates calls so tests can assert on them.\n * Each method records its arguments and returns `this` for chaining.\n */\nclass RecordingGroup implements MixpanelGroup {\n _calls: Array<{ method: string; args: unknown[] }> = [];\n\n private _record(method: string, ...args: unknown[]) {\n this._calls.push({ method, args });\n }\n\n set(...args: unknown[]) {\n this._record('set', ...args);\n }\n set_once(...args: unknown[]) {\n this._record('set_once', ...args);\n }\n unset(...args: unknown[]) {\n this._record('unset', ...args);\n }\n union(...args: unknown[]) {\n this._record('union', ...args);\n }\n remove(...args: unknown[]) {\n this._record('remove', ...args);\n }\n delete(...args: unknown[]) {\n this._record('delete', ...args);\n }\n}\n\n/**\n * A no-op group handle returned by the stub get_group(). Tests replace the\n * get_group function in the spy runner so this stub is never actually seen.\n */\nconst noopGroup: MixpanelGroup = {\n set: noop,\n set_once: noop,\n unset: noop,\n union: noop,\n remove: noop,\n delete: noop,\n};\n\n/**\n * Pre-init env — all methods are no-ops until the test runner wires spies.\n */\nexport const init: Env | undefined = {\n mixpanel: {\n init: noop,\n track: noop,\n identify: noop,\n reset: noop,\n set_group: noop,\n get_group: () => noopGroup,\n opt_in_tracking: noop,\n opt_out_tracking: noop,\n stop_batch_senders: noop,\n people: {\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 },\n};\n\n/**\n * Post-init env — same shape. The test runner clones this and replaces\n * individual methods with jest.fn() so it can assert on calls.\n */\nexport const push: Env = {\n mixpanel: {\n init: noop,\n track: noop,\n identify: noop,\n reset: noop,\n set_group: noop,\n get_group: () => noopGroup,\n opt_in_tracking: noop,\n opt_out_tracking: noop,\n stop_batch_senders: noop,\n people: {\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 },\n};\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = [\n 'call:mixpanel.init',\n 'call:mixpanel.track',\n 'call:mixpanel.identify',\n 'call:mixpanel.reset',\n 'call:mixpanel.set_group',\n 'call:mixpanel.get_group',\n 'call:mixpanel.opt_in_tracking',\n 'call:mixpanel.opt_out_tracking',\n 'call:mixpanel.people.set',\n 'call:mixpanel.people.set_once',\n 'call:mixpanel.people.increment',\n 'call:mixpanel.people.append',\n 'call:mixpanel.people.union',\n 'call:mixpanel.people.remove',\n 'call:mixpanel.people.unset',\n 'call:mixpanel.people.delete_user',\n];\n","import type { Flow, WalkerOS } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Examples may optionally carry destination-level settings. The test runner\n * reads `settings` from the example and merges it into the base destination\n * settings on top of the fixed apiKey.\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 * mixpanel.track(event.name, properties). With no mapping and no\n * destination-level include, properties is `{}`.\n */\nexport const defaultEventForwarding: MixpanelStepExample = {\n title: 'Default track',\n description:\n 'A walker event becomes a Mixpanel track call with the event name and empty properties.',\n in: getEvent('product view', { timestamp: 1700000100 }),\n out: [['mixpanel.track', 'product view', {}]],\n};\n\n/**\n * Wildcard ignore - walkerOS's standard way to drop events. The rule\n * matches but does nothing. The destination fires zero SDK calls.\n */\nexport const wildcardIgnored: MixpanelStepExample = {\n public: false,\n in: getEvent('debug noise', { timestamp: 1700000101 }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * Destination-level settings.include flattens the walkerOS `data` section\n * into prefixed track() properties on every push.\n */\nexport const destinationLevelInclude: MixpanelStepExample = {\n title: 'Include data',\n description:\n 'Destination-level include flattens the event data section into prefixed Mixpanel track properties.',\n in: getEvent('product view', { timestamp: 1700000102 }),\n configInclude: ['data'],\n out: [\n [\n 'mixpanel.track',\n 'product view',\n {\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-rule settings.include REPLACES destination-level include for the\n * matched rule. Here destination-level sends `data`, but the rule\n * overrides it with `globals` only.\n */\nexport const ruleIncludeReplaces: MixpanelStepExample = {\n title: 'Rule include overrides',\n description:\n 'A per-rule include replaces the destination-level include for this event, forwarding only globals here.',\n in: getEvent('order complete', { timestamp: 1700000103 }),\n configInclude: ['data'],\n mapping: {\n include: ['globals'],\n },\n out: [\n [\n 'mixpanel.track',\n 'order complete',\n {\n globals_pagegroup: 'shop',\n },\n ],\n ],\n};\n\n/**\n * Destination-level settings.identify fires on the first push. The\n * destination resolves { distinctId } and calls mixpanel.identify(distinctId),\n * then tracks the result in runtime state. Subsequent pushes with unchanged\n * distinctId do NOT re-fire identify().\n */\nexport const destinationLevelIdentify: MixpanelStepExample = {\n title: 'Destination identify',\n description:\n 'Destination-level identify calls mixpanel.identify with a resolved distinctId before firing the default track.',\n in: getEvent('page view', { timestamp: 1700000104 }),\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n out: [\n ['mixpanel.identify', 'us3r'],\n ['mixpanel.track', 'page view', {}],\n ],\n};\n\n/**\n * Per-event identify + people operations - the canonical \"user login\"\n * pattern. `silent: true` suppresses the default mixpanel.track() call\n * because we're running identity side effects only.\n */\nexport const userLoginIdentifyAndPeople: MixpanelStepExample = {\n title: 'User login identify',\n description:\n 'A user login identifies the user and fires Mixpanel people set, set_once, and increment operations.',\n in: getEvent('user login', {\n timestamp: 1700000105,\n data: {\n user_id: 'new-user-123',\n plan: 'premium',\n company: 'Acme',\n email: 'user@acme.com',\n },\n }),\n mapping: {\n silent: 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 ['mixpanel.identify', 'new-user-123'],\n [\n 'mixpanel.people.set',\n {\n plan: 'premium',\n company: 'Acme',\n email: 'user@acme.com',\n },\n ],\n [\n 'mixpanel.people.set_once',\n {\n first_login: 1700000105,\n },\n ],\n [\n 'mixpanel.people.increment',\n {\n login_count: 1,\n },\n ],\n ],\n};\n\n/**\n * Full people operation vocabulary - a profile update rule that exercises\n * set, set_once, increment, append, union, remove, and unset in a single\n * rule. `silent: true` because only side effects are needed.\n */\nexport const profileUpdateAllPeopleOperations: MixpanelStepExample = {\n title: 'All people operations',\n description:\n 'A profile update exercises the full Mixpanel people vocabulary including set, increment, append, union, and remove.',\n in: getEvent('profile update', {\n timestamp: 1700000106,\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 silent: true,\n settings: {\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 ['mixpanel.people.set', { name: 'Jane Doe', email: 'jane@acme.com' }],\n ['mixpanel.people.set_once', { signup_source: 'referral' }],\n ['mixpanel.people.increment', { page_views: 1 }],\n ['mixpanel.people.append', { visited_pages: '/docs/getting-started' }],\n ['mixpanel.people.union', { unique_tags: ['active'] }],\n ['mixpanel.people.remove', { tags: 'trial' }],\n ['mixpanel.people.unset', ['old_plan']],\n ],\n};\n\n/**\n * people.delete_user - destructive operation. The resolved people object\n * uses `{ delete_user: true }` to trigger the call.\n */\nexport const accountDeleteUser: MixpanelStepExample = {\n title: 'Delete user',\n description:\n 'An account delete fires Mixpanel people.delete_user to remove the user profile from the project.',\n in: getEvent('account delete', { timestamp: 1700000107 }),\n mapping: {\n silent: true,\n settings: {\n people: {\n map: {\n delete_user: { value: true },\n },\n },\n },\n },\n out: [['mixpanel.people.delete_user']],\n};\n\n/**\n * User logout - reset: true fires mixpanel.reset(), which clears all\n * persistence and generates a new anonymous distinct_id.\n */\nexport const userLogoutReset: MixpanelStepExample = {\n title: 'User logout reset',\n description:\n 'A user logout calls mixpanel.reset to clear persistence and generate a new anonymous distinct id.',\n in: getEvent('user logout', { timestamp: 1700000108 }),\n mapping: {\n silent: true,\n settings: {\n reset: true,\n },\n },\n out: [['mixpanel.reset']],\n};\n\n/**\n * User-group association - settings.group resolves to { key, id } and\n * calls mixpanel.set_group(key, id). Fires default track too.\n */\nexport const userGroupAssociation: MixpanelStepExample = {\n title: 'Group association',\n description:\n 'A user login associates the user to a company group via mixpanel.set_group and fires the default track.',\n in: getEvent('user login', {\n timestamp: 1700000109,\n data: {\n user_id: 'user-456',\n company_id: 'acme-inc',\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 ['mixpanel.set_group', 'company_id', 'acme-inc'],\n ['mixpanel.track', 'user login', {}],\n ],\n};\n\n/**\n * Group profile properties - settings.groupProfile resolves to\n * { key, id, set?, set_once?, ... } and calls\n * mixpanel.get_group(key, id).set(...), .set_once(...), etc.\n */\nexport const companyUpdateGroupProfile: MixpanelStepExample = {\n title: 'Group profile',\n description:\n 'A company update sets Mixpanel group profile properties via get_group.set and get_group.set_once.',\n in: getEvent('company update', {\n timestamp: 1700000110,\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 silent: 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 'mixpanel.get_group.set',\n 'company_id',\n 'acme-inc',\n { name: 'Acme, Inc.', plan: 'enterprise', employee_count: 250 },\n ],\n [\n 'mixpanel.get_group.set_once',\n 'company_id',\n 'acme-inc',\n { founded: 2010 },\n ],\n ],\n};\n\n/**\n * Consent revoked → mixpanel.opt_out_tracking(). The destination checks\n * the consent keys declared in config.consent and toggles opt_out/opt_in.\n */\nexport const consentRevokeOptOut: MixpanelStepExample = {\n title: 'Consent revoked',\n description:\n 'A walker consent command with analytics denied calls mixpanel.opt_out_tracking to stop event capture.',\n command: 'consent',\n in: { analytics: false } as WalkerOS.Consent,\n settings: {} as Partial<Settings>,\n out: [['mixpanel.opt_out_tracking']],\n};\n\n/**\n * Consent granted → mixpanel.opt_in_tracking().\n */\nexport const consentGrantOptIn: MixpanelStepExample = {\n title: 'Consent granted',\n description:\n 'A walker consent command with analytics granted calls mixpanel.opt_in_tracking to resume event capture.',\n command: 'consent',\n in: { analytics: true } as WalkerOS.Consent,\n settings: {} as Partial<Settings>,\n out: [['mixpanel.opt_in_tracking']],\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,UAAU,EACP,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,EACV,KAAK,CAAC,UAAU,cAAc,CAAC,EAC/B,SAAS,mDAAmD,EAC5D,SAAS;AAAA,EACZ,wBAAwB,EACrB,QAAQ,EACR,SAAS,gDAAgD,EACzD,SAAS;AAAA,EACZ,mBAAm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P,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,KAAK;AAAA,EACtB,UAAU,CAAC;AAAA,EACX,KAAK,CAAC,CAAC,0BAA0B,CAAC;AACpC;","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 your Mixpanel project settings under \"Project Settings\" and \"Access Keys\". Passed to mixpanel.init() as the first argument (like a1b2c3d4e5f6789012345678abcdef12).',\n ),\n api_host: z\n .string()\n .describe(\n 'Mixpanel ingestion host. Default: https://api-js.mixpanel.com. Use https://api-eu.mixpanel.com for EU residency.',\n )\n .optional(),\n persistence: z\n .enum(['cookie', 'localStorage'])\n .describe('Client-side persistence backend. Default: cookie.')\n .optional(),\n cross_subdomain_cookie: z\n .boolean()\n .describe('Share cookie across subdomains. Default: true.')\n .optional(),\n cookie_expiration: z\n .number()\n .int()\n .nonnegative()\n .describe('Cookie expiration in days. Default: 365.')\n .optional(),\n secure_cookie: z\n .boolean()\n .describe('Only send cookie over HTTPS. Default: false.')\n .optional(),\n ip: z\n .boolean()\n .describe('Enable server-side IP geolocation. Default: true.')\n .optional(),\n batch_requests: z\n .boolean()\n .describe(\n 'Use the /batch endpoint instead of individual requests. Default: true.',\n )\n .optional(),\n batch_size: z\n .number()\n .int()\n .positive()\n .describe('Max events per batch. Default: 50.')\n .optional(),\n batch_flush_interval_ms: z\n .number()\n .int()\n .positive()\n .describe('Batch flush interval in ms. Default: 5000.')\n .optional(),\n debug: z\n .boolean()\n .describe('Enable verbose SDK logging. Default: false.')\n .optional(),\n opt_out_tracking_by_default: z\n .boolean()\n .describe(\n 'Start in opted-out state until opt_in_tracking() is called. Default: false.',\n )\n .optional(),\n track_pageview: z\n .union([z.boolean(), z.string()])\n .describe(\n 'Enable Mixpanel auto-pageview tracking. walkerOS default: false — walkerOS sources handle page views.',\n )\n .optional(),\n autocapture: z\n .unknown()\n .describe(\n 'Enable Mixpanel web autocapture. walkerOS default: false — walkerOS sources handle event capture.',\n )\n .optional(),\n record_sessions_percent: z\n .number()\n .min(0)\n .max(100)\n .describe(\n 'Session replay sampling rate (0-100). Default: 0 (disabled). Session replay is bundled in the npm build.',\n )\n .optional(),\n record_mask_all_inputs: z\n .boolean()\n .describe('Mask all input values in session replay. Default: true.')\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to an identity object. Keys: distinctId.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to { key, id } → mixpanel.set_group(key, id). Runs on destination init or per-event.',\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 } → mixpanel.identify(distinctId).',\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 mixpanel.people.* call.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Per-event group assignment. Resolves to { key, id } → mixpanel.set_group(key, id).',\n )\n .optional(),\n groupProfile: z\n .unknown()\n .describe(\n 'Per-event group profile operations. Resolves to { key, id, set?, set_once?, unset?, union?, remove?, delete? } → mixpanel.get_group(key, id).set/... calls.',\n )\n .optional(),\n reset: z\n .unknown()\n .describe(\n 'Logout trigger. Resolves to a truthy value → mixpanel.reset(). Typically used with silent: true on a user logout 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 { Env, MixpanelGroup } from '../types';\n\nconst noop = () => {};\n\n/**\n * A recording group handle that accumulates calls so tests can assert on them.\n * Each method records its arguments and returns `this` for chaining.\n */\nclass RecordingGroup implements MixpanelGroup {\n _calls: Array<{ method: string; args: unknown[] }> = [];\n\n private _record(method: string, ...args: unknown[]) {\n this._calls.push({ method, args });\n }\n\n set(...args: unknown[]) {\n this._record('set', ...args);\n }\n set_once(...args: unknown[]) {\n this._record('set_once', ...args);\n }\n unset(...args: unknown[]) {\n this._record('unset', ...args);\n }\n union(...args: unknown[]) {\n this._record('union', ...args);\n }\n remove(...args: unknown[]) {\n this._record('remove', ...args);\n }\n delete(...args: unknown[]) {\n this._record('delete', ...args);\n }\n}\n\n/**\n * A no-op group handle returned by the stub get_group(). Tests replace the\n * get_group function in the spy runner so this stub is never actually seen.\n */\nconst noopGroup: MixpanelGroup = {\n set: noop,\n set_once: noop,\n unset: noop,\n union: noop,\n remove: noop,\n delete: noop,\n};\n\n/**\n * Pre-init env — all methods are no-ops until the test runner wires spies.\n */\nexport const init: Env | undefined = {\n mixpanel: {\n init: noop,\n track: noop,\n identify: noop,\n reset: noop,\n set_group: noop,\n get_group: () => noopGroup,\n opt_in_tracking: noop,\n opt_out_tracking: noop,\n stop_batch_senders: noop,\n people: {\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 },\n};\n\n/**\n * Post-init env — same shape. The test runner clones this and replaces\n * individual methods with jest.fn() so it can assert on calls.\n */\nexport const push: Env = {\n mixpanel: {\n init: noop,\n track: noop,\n identify: noop,\n reset: noop,\n set_group: noop,\n get_group: () => noopGroup,\n opt_in_tracking: noop,\n opt_out_tracking: noop,\n stop_batch_senders: noop,\n people: {\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 },\n};\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = [\n 'call:mixpanel.init',\n 'call:mixpanel.track',\n 'call:mixpanel.identify',\n 'call:mixpanel.reset',\n 'call:mixpanel.set_group',\n 'call:mixpanel.get_group',\n 'call:mixpanel.opt_in_tracking',\n 'call:mixpanel.opt_out_tracking',\n 'call:mixpanel.people.set',\n 'call:mixpanel.people.set_once',\n 'call:mixpanel.people.increment',\n 'call:mixpanel.people.append',\n 'call:mixpanel.people.union',\n 'call:mixpanel.people.remove',\n 'call:mixpanel.people.unset',\n 'call:mixpanel.people.delete_user',\n];\n","import type { Flow, WalkerOS } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Examples may optionally carry destination-level settings. The test runner\n * reads `settings` from the example and merges it into the base destination\n * settings on top of the fixed apiKey.\n */\nexport type MixpanelStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n configInclude?: string[];\n /** Consent granted before `in` so a gated destination is loaded first. */\n before?: WalkerOS.Consent;\n};\n\n/**\n * Default event forwarding - every walkerOS event becomes\n * mixpanel.track(event.name, properties). With no mapping and no\n * destination-level include, properties is `{}`.\n */\nexport const defaultEventForwarding: MixpanelStepExample = {\n title: 'Default track',\n description:\n 'A walker event becomes a Mixpanel track call with the event name and empty properties.',\n in: getEvent('product view', { timestamp: 1700000100 }),\n out: [['mixpanel.track', 'product view', {}]],\n};\n\n/**\n * Wildcard ignore - walkerOS's standard way to drop events. The rule\n * matches but does nothing. The destination fires zero SDK calls.\n */\nexport const wildcardIgnored: MixpanelStepExample = {\n public: false,\n in: getEvent('debug noise', { timestamp: 1700000101 }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * Destination-level settings.include flattens the walkerOS `data` section\n * into prefixed track() properties on every push.\n */\nexport const destinationLevelInclude: MixpanelStepExample = {\n title: 'Include data',\n description:\n 'Destination-level include flattens the event data section into prefixed Mixpanel track properties.',\n in: getEvent('product view', { timestamp: 1700000102 }),\n configInclude: ['data'],\n out: [\n [\n 'mixpanel.track',\n 'product view',\n {\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-rule settings.include REPLACES destination-level include for the\n * matched rule. Here destination-level sends `data`, but the rule\n * overrides it with `globals` only.\n */\nexport const ruleIncludeReplaces: MixpanelStepExample = {\n title: 'Rule include overrides',\n description:\n 'A per-rule include replaces the destination-level include for this event, forwarding only globals here.',\n in: getEvent('order complete', { timestamp: 1700000103 }),\n configInclude: ['data'],\n mapping: {\n include: ['globals'],\n },\n out: [\n [\n 'mixpanel.track',\n 'order complete',\n {\n globals_pagegroup: 'shop',\n },\n ],\n ],\n};\n\n/**\n * Destination-level settings.identify fires on the first push. The\n * destination resolves { distinctId } and calls mixpanel.identify(distinctId),\n * then tracks the result in runtime state. Subsequent pushes with unchanged\n * distinctId do NOT re-fire identify().\n */\nexport const destinationLevelIdentify: MixpanelStepExample = {\n title: 'Destination identify',\n description:\n 'Destination-level identify calls mixpanel.identify with a resolved distinctId before firing the default track.',\n in: getEvent('page view', { timestamp: 1700000104 }),\n settings: {\n identify: {\n map: {\n distinctId: 'user.id',\n },\n },\n },\n out: [\n ['mixpanel.identify', 'us3r'],\n ['mixpanel.track', 'page view', {}],\n ],\n};\n\n/**\n * Per-event identify + people operations - the canonical \"user login\"\n * pattern. `silent: true` suppresses the default mixpanel.track() call\n * because we're running identity side effects only.\n */\nexport const userLoginIdentifyAndPeople: MixpanelStepExample = {\n title: 'User login identify',\n description:\n 'A user login identifies the user and fires Mixpanel people set, set_once, and increment operations.',\n in: getEvent('user login', {\n timestamp: 1700000105,\n data: {\n user_id: 'new-user-123',\n plan: 'premium',\n company: 'Acme',\n email: 'user@acme.com',\n },\n }),\n mapping: {\n silent: 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 ['mixpanel.identify', 'new-user-123'],\n [\n 'mixpanel.people.set',\n {\n plan: 'premium',\n company: 'Acme',\n email: 'user@acme.com',\n },\n ],\n [\n 'mixpanel.people.set_once',\n {\n first_login: 1700000105,\n },\n ],\n [\n 'mixpanel.people.increment',\n {\n login_count: 1,\n },\n ],\n ],\n};\n\n/**\n * Full people operation vocabulary - a profile update rule that exercises\n * set, set_once, increment, append, union, remove, and unset in a single\n * rule. `silent: true` because only side effects are needed.\n */\nexport const profileUpdateAllPeopleOperations: MixpanelStepExample = {\n title: 'All people operations',\n description:\n 'A profile update exercises the full Mixpanel people vocabulary including set, increment, append, union, and remove.',\n in: getEvent('profile update', {\n timestamp: 1700000106,\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 silent: true,\n settings: {\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 ['mixpanel.people.set', { name: 'Jane Doe', email: 'jane@acme.com' }],\n ['mixpanel.people.set_once', { signup_source: 'referral' }],\n ['mixpanel.people.increment', { page_views: 1 }],\n ['mixpanel.people.append', { visited_pages: '/docs/getting-started' }],\n ['mixpanel.people.union', { unique_tags: ['active'] }],\n ['mixpanel.people.remove', { tags: 'trial' }],\n ['mixpanel.people.unset', ['old_plan']],\n ],\n};\n\n/**\n * people.delete_user - destructive operation. The resolved people object\n * uses `{ delete_user: true }` to trigger the call.\n */\nexport const accountDeleteUser: MixpanelStepExample = {\n title: 'Delete user',\n description:\n 'An account delete fires Mixpanel people.delete_user to remove the user profile from the project.',\n in: getEvent('account delete', { timestamp: 1700000107 }),\n mapping: {\n silent: true,\n settings: {\n people: {\n map: {\n delete_user: { value: true },\n },\n },\n },\n },\n out: [['mixpanel.people.delete_user']],\n};\n\n/**\n * User logout - reset: true fires mixpanel.reset(), which clears all\n * persistence and generates a new anonymous distinct_id.\n */\nexport const userLogoutReset: MixpanelStepExample = {\n title: 'User logout reset',\n description:\n 'A user logout calls mixpanel.reset to clear persistence and generate a new anonymous distinct id.',\n in: getEvent('user logout', { timestamp: 1700000108 }),\n mapping: {\n silent: true,\n settings: {\n reset: true,\n },\n },\n out: [['mixpanel.reset']],\n};\n\n/**\n * User-group association - settings.group resolves to { key, id } and\n * calls mixpanel.set_group(key, id). Fires default track too.\n */\nexport const userGroupAssociation: MixpanelStepExample = {\n title: 'Group association',\n description:\n 'A user login associates the user to a company group via mixpanel.set_group and fires the default track.',\n in: getEvent('user login', {\n timestamp: 1700000109,\n data: {\n user_id: 'user-456',\n company_id: 'acme-inc',\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 ['mixpanel.set_group', 'company_id', 'acme-inc'],\n ['mixpanel.track', 'user login', {}],\n ],\n};\n\n/**\n * Group profile properties - settings.groupProfile resolves to\n * { key, id, set?, set_once?, ... } and calls\n * mixpanel.get_group(key, id).set(...), .set_once(...), etc.\n */\nexport const companyUpdateGroupProfile: MixpanelStepExample = {\n title: 'Group profile',\n description:\n 'A company update sets Mixpanel group profile properties via get_group.set and get_group.set_once.',\n in: getEvent('company update', {\n timestamp: 1700000110,\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 silent: 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 'mixpanel.get_group.set',\n 'company_id',\n 'acme-inc',\n { name: 'Acme, Inc.', plan: 'enterprise', employee_count: 250 },\n ],\n [\n 'mixpanel.get_group.set_once',\n 'company_id',\n 'acme-inc',\n { founded: 2010 },\n ],\n ],\n};\n\n/**\n * Consent revoked → mixpanel.opt_out_tracking(). After analytics consent is\n * granted (Mixpanel loads and opts in), revoking it calls\n * mixpanel.opt_out_tracking() via the consent handler. The destination is\n * never loaded under denied consent, so the opt-out is a real revocation of an\n * already-granted destination.\n */\nexport const consentRevokeOptOut: MixpanelStepExample = {\n title: 'Consent revoked',\n description:\n 'A walker consent command with analytics denied calls mixpanel.opt_out_tracking to stop event capture.',\n command: 'consent',\n before: { analytics: true },\n in: { analytics: false } as WalkerOS.Consent,\n settings: {} as Partial<Settings>,\n out: [['mixpanel.opt_in_tracking'], ['mixpanel.opt_out_tracking']],\n};\n\n/**\n * Consent granted → mixpanel.opt_in_tracking().\n */\nexport const consentGrantOptIn: MixpanelStepExample = {\n title: 'Consent granted',\n description:\n 'A walker consent command with analytics granted calls mixpanel.opt_in_tracking to resume event capture.',\n command: 'consent',\n in: { analytics: true } as WalkerOS.Consent,\n settings: {} as Partial<Settings>,\n out: [['mixpanel.opt_in_tracking']],\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,E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AA,EACF;AACF;AASO,IAAM,sBAA2C;AAAA,EACtD,OAAO;AAAA,EACP,aACE;AAAA,EACF,SAAS;AAAA,EACT,QAAQ,EAAE,WAAW,KAAK;AAAA,EAC1B,IAAI,EAAE,WAAW,MAAM;AAAA,EACvB,UAAU,CAAC;AAAA,EACX,KAAK,CAAC,CAAC,0BAA0B,GAAG,CAAC,2BAA2B,CAAC;AACnE;AAKO,IAAM,oBAAyC;AAAA,EACpD,OAAO;AAAA,EACP,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,KAAK;AAAA,EACtB,UAAU,CAAC;AAAA,EACX,KAAK,CAAC,CAAC,0BAA0B,CAAC;AACpC;","names":["z"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mapping, Flow } from '@walkeros/core';
|
|
1
|
+
import { Mapping, Flow, WalkerOS } from '@walkeros/core';
|
|
2
2
|
import { DestinationWeb } from '@walkeros/web-core';
|
|
3
3
|
import { Config } from 'mixpanel-browser';
|
|
4
4
|
|
|
@@ -105,6 +105,8 @@ declare namespace env {
|
|
|
105
105
|
type MixpanelStepExample = Flow.StepExample & {
|
|
106
106
|
settings?: Partial<Settings>;
|
|
107
107
|
configInclude?: string[];
|
|
108
|
+
/** Consent granted before `in` so a gated destination is loaded first. */
|
|
109
|
+
before?: WalkerOS.Consent;
|
|
108
110
|
};
|
|
109
111
|
/**
|
|
110
112
|
* Default event forwarding - every walkerOS event becomes
|
|
@@ -169,8 +171,11 @@ declare const userGroupAssociation: MixpanelStepExample;
|
|
|
169
171
|
*/
|
|
170
172
|
declare const companyUpdateGroupProfile: MixpanelStepExample;
|
|
171
173
|
/**
|
|
172
|
-
* Consent revoked → mixpanel.opt_out_tracking().
|
|
173
|
-
*
|
|
174
|
+
* Consent revoked → mixpanel.opt_out_tracking(). After analytics consent is
|
|
175
|
+
* granted (Mixpanel loads and opts in), revoking it calls
|
|
176
|
+
* mixpanel.opt_out_tracking() via the consent handler. The destination is
|
|
177
|
+
* never loaded under denied consent, so the opt-out is a real revocation of an
|
|
178
|
+
* already-granted destination.
|
|
174
179
|
*/
|
|
175
180
|
declare const consentRevokeOptOut: MixpanelStepExample;
|
|
176
181
|
/**
|
package/dist/examples/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mapping, Flow } from '@walkeros/core';
|
|
1
|
+
import { Mapping, Flow, WalkerOS } from '@walkeros/core';
|
|
2
2
|
import { DestinationWeb } from '@walkeros/web-core';
|
|
3
3
|
import { Config } from 'mixpanel-browser';
|
|
4
4
|
|
|
@@ -105,6 +105,8 @@ declare namespace env {
|
|
|
105
105
|
type MixpanelStepExample = Flow.StepExample & {
|
|
106
106
|
settings?: Partial<Settings>;
|
|
107
107
|
configInclude?: string[];
|
|
108
|
+
/** Consent granted before `in` so a gated destination is loaded first. */
|
|
109
|
+
before?: WalkerOS.Consent;
|
|
108
110
|
};
|
|
109
111
|
/**
|
|
110
112
|
* Default event forwarding - every walkerOS event becomes
|
|
@@ -169,8 +171,11 @@ declare const userGroupAssociation: MixpanelStepExample;
|
|
|
169
171
|
*/
|
|
170
172
|
declare const companyUpdateGroupProfile: MixpanelStepExample;
|
|
171
173
|
/**
|
|
172
|
-
* Consent revoked → mixpanel.opt_out_tracking().
|
|
173
|
-
*
|
|
174
|
+
* Consent revoked → mixpanel.opt_out_tracking(). After analytics consent is
|
|
175
|
+
* granted (Mixpanel loads and opts in), revoking it calls
|
|
176
|
+
* mixpanel.opt_out_tracking() via the consent handler. The destination is
|
|
177
|
+
* never loaded under denied consent, so the opt-out is a real revocation of an
|
|
178
|
+
* already-granted destination.
|
|
174
179
|
*/
|
|
175
180
|
declare const consentRevokeOptOut: MixpanelStepExample;
|
|
176
181
|
/**
|
package/dist/examples/index.js
CHANGED
|
@@ -429,9 +429,10 @@ var consentRevokeOptOut = {
|
|
|
429
429
|
title: "Consent revoked",
|
|
430
430
|
description: "A walker consent command with analytics denied calls mixpanel.opt_out_tracking to stop event capture.",
|
|
431
431
|
command: "consent",
|
|
432
|
+
before: { analytics: true },
|
|
432
433
|
in: { analytics: false },
|
|
433
434
|
settings: {},
|
|
434
|
-
out: [["mixpanel.opt_out_tracking"]]
|
|
435
|
+
out: [["mixpanel.opt_in_tracking"], ["mixpanel.opt_out_tracking"]]
|
|
435
436
|
};
|
|
436
437
|
var consentGrantOptIn = {
|
|
437
438
|
title: "Consent granted",
|
package/dist/examples/index.mjs
CHANGED
|
@@ -408,9 +408,10 @@ var consentRevokeOptOut = {
|
|
|
408
408
|
title: "Consent revoked",
|
|
409
409
|
description: "A walker consent command with analytics denied calls mixpanel.opt_out_tracking to stop event capture.",
|
|
410
410
|
command: "consent",
|
|
411
|
+
before: { analytics: true },
|
|
411
412
|
in: { analytics: false },
|
|
412
413
|
settings: {},
|
|
413
|
-
out: [["mixpanel.opt_out_tracking"]]
|
|
414
|
+
out: [["mixpanel.opt_in_tracking"], ["mixpanel.opt_out_tracking"]]
|
|
414
415
|
};
|
|
415
416
|
var consentGrantOptIn = {
|
|
416
417
|
title: "Consent granted",
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/web-destination-mixpanel",
|
|
4
|
-
"version": "4.2.
|
|
4
|
+
"version": "4.2.1-next-1781538735002",
|
|
5
5
|
"type": "destination",
|
|
6
6
|
"platform": [
|
|
7
7
|
"web"
|
|
@@ -311,7 +311,7 @@
|
|
|
311
311
|
"consent": {
|
|
312
312
|
"functional": true
|
|
313
313
|
},
|
|
314
|
-
"id": "
|
|
314
|
+
"id": "e0ca85c7451df404",
|
|
315
315
|
"trigger": "test",
|
|
316
316
|
"entity": "account",
|
|
317
317
|
"action": "delete",
|
|
@@ -380,7 +380,7 @@
|
|
|
380
380
|
"consent": {
|
|
381
381
|
"functional": true
|
|
382
382
|
},
|
|
383
|
-
"id": "
|
|
383
|
+
"id": "a5817b558dafa1aa",
|
|
384
384
|
"trigger": "test",
|
|
385
385
|
"entity": "company",
|
|
386
386
|
"action": "update",
|
|
@@ -455,11 +455,17 @@
|
|
|
455
455
|
"title": "Consent revoked",
|
|
456
456
|
"description": "A walker consent command with analytics denied calls mixpanel.opt_out_tracking to stop event capture.",
|
|
457
457
|
"command": "consent",
|
|
458
|
+
"before": {
|
|
459
|
+
"analytics": true
|
|
460
|
+
},
|
|
458
461
|
"in": {
|
|
459
462
|
"analytics": false
|
|
460
463
|
},
|
|
461
464
|
"settings": {},
|
|
462
465
|
"out": [
|
|
466
|
+
[
|
|
467
|
+
"mixpanel.opt_in_tracking"
|
|
468
|
+
],
|
|
463
469
|
[
|
|
464
470
|
"mixpanel.opt_out_tracking"
|
|
465
471
|
]
|
|
@@ -498,7 +504,7 @@
|
|
|
498
504
|
"consent": {
|
|
499
505
|
"functional": true
|
|
500
506
|
},
|
|
501
|
-
"id": "
|
|
507
|
+
"id": "40c7bfd7b997b673",
|
|
502
508
|
"trigger": "load",
|
|
503
509
|
"entity": "product",
|
|
504
510
|
"action": "view",
|
|
@@ -558,7 +564,7 @@
|
|
|
558
564
|
"consent": {
|
|
559
565
|
"functional": true
|
|
560
566
|
},
|
|
561
|
-
"id": "
|
|
567
|
+
"id": "87a81b6b88545c1d",
|
|
562
568
|
"trigger": "load",
|
|
563
569
|
"entity": "page",
|
|
564
570
|
"action": "view",
|
|
@@ -621,7 +627,7 @@
|
|
|
621
627
|
"consent": {
|
|
622
628
|
"functional": true
|
|
623
629
|
},
|
|
624
|
-
"id": "
|
|
630
|
+
"id": "3477b4ae441712b8",
|
|
625
631
|
"trigger": "load",
|
|
626
632
|
"entity": "product",
|
|
627
633
|
"action": "view",
|
|
@@ -689,7 +695,7 @@
|
|
|
689
695
|
"consent": {
|
|
690
696
|
"functional": true
|
|
691
697
|
},
|
|
692
|
-
"id": "
|
|
698
|
+
"id": "82b27bc156c48120",
|
|
693
699
|
"trigger": "test",
|
|
694
700
|
"entity": "profile",
|
|
695
701
|
"action": "update",
|
|
@@ -879,7 +885,7 @@
|
|
|
879
885
|
"consent": {
|
|
880
886
|
"functional": true
|
|
881
887
|
},
|
|
882
|
-
"id": "
|
|
888
|
+
"id": "eedc7d61109dc80a",
|
|
883
889
|
"trigger": "load",
|
|
884
890
|
"entity": "order",
|
|
885
891
|
"action": "complete",
|
|
@@ -945,7 +951,7 @@
|
|
|
945
951
|
"consent": {
|
|
946
952
|
"functional": true
|
|
947
953
|
},
|
|
948
|
-
"id": "
|
|
954
|
+
"id": "cafe3e058205c633",
|
|
949
955
|
"trigger": "test",
|
|
950
956
|
"entity": "user",
|
|
951
957
|
"action": "login",
|
|
@@ -1020,7 +1026,7 @@
|
|
|
1020
1026
|
"consent": {
|
|
1021
1027
|
"functional": true
|
|
1022
1028
|
},
|
|
1023
|
-
"id": "
|
|
1029
|
+
"id": "53e56f8d8ab98807",
|
|
1024
1030
|
"trigger": "test",
|
|
1025
1031
|
"entity": "user",
|
|
1026
1032
|
"action": "login",
|
|
@@ -1134,7 +1140,7 @@
|
|
|
1134
1140
|
"consent": {
|
|
1135
1141
|
"functional": true
|
|
1136
1142
|
},
|
|
1137
|
-
"id": "
|
|
1143
|
+
"id": "cc5b5ef5a4fb00c5",
|
|
1138
1144
|
"trigger": "test",
|
|
1139
1145
|
"entity": "user",
|
|
1140
1146
|
"action": "logout",
|
|
@@ -1199,7 +1205,7 @@
|
|
|
1199
1205
|
"consent": {
|
|
1200
1206
|
"functional": true
|
|
1201
1207
|
},
|
|
1202
|
-
"id": "
|
|
1208
|
+
"id": "85cf54ce846aee11",
|
|
1203
1209
|
"trigger": "test",
|
|
1204
1210
|
"entity": "debug",
|
|
1205
1211
|
"action": "noise",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/web-destination-mixpanel",
|
|
3
3
|
"description": "Mixpanel web destination for walkerOS (events, people, groups, consent)",
|
|
4
|
-
"version": "4.2.
|
|
4
|
+
"version": "4.2.1-next-1781538735002",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"update": "npx npm-check-updates -u && npm update"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@walkeros/core": "4.2.
|
|
41
|
+
"@walkeros/core": "4.2.1-next-1781538735002",
|
|
42
42
|
"mixpanel-browser": "^2.78.0",
|
|
43
|
-
"@walkeros/web-core": "4.2.
|
|
43
|
+
"@walkeros/web-core": "4.2.1-next-1781538735002"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/mixpanel-browser": "^2.50.0",
|
|
47
|
-
"@walkeros/collector": "4.2.
|
|
47
|
+
"@walkeros/collector": "4.2.1-next-1781538735002"
|
|
48
48
|
},
|
|
49
49
|
"repository": {
|
|
50
50
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|