import * as _walkeros_core_dev from '@walkeros/core/dev'; import { z } from '@walkeros/core/dev'; import { Mapping as Mapping$1, Flow, WalkerOS } from '@walkeros/core'; import { DestinationWeb } from '@walkeros/web-core'; import { Config } from 'mixpanel-browser'; declare const SettingsSchema: z.ZodObject<{ apiKey: z.ZodString; api_host: z.ZodOptional; persistence: z.ZodOptional>; cross_subdomain_cookie: z.ZodOptional; cookie_expiration: z.ZodOptional; secure_cookie: z.ZodOptional; ip: z.ZodOptional; batch_requests: z.ZodOptional; batch_size: z.ZodOptional; batch_flush_interval_ms: z.ZodOptional; debug: z.ZodOptional; opt_out_tracking_by_default: z.ZodOptional; track_pageview: z.ZodOptional>; autocapture: z.ZodOptional; record_sessions_percent: z.ZodOptional; record_mask_all_inputs: z.ZodOptional; identify: z.ZodOptional; group: z.ZodOptional; }, z.core.$strip>; type Settings$1 = z.infer; declare const MappingSchema: z.ZodObject<{ identify: z.ZodOptional; people: z.ZodOptional; group: z.ZodOptional; groupProfile: z.ZodOptional; reset: z.ZodOptional; }, z.core.$strip>; type Mapping = z.infer; declare const settings: _walkeros_core_dev.JSONSchema; declare const mapping: _walkeros_core_dev.JSONSchema; type index$1_Mapping = Mapping; declare const index$1_MappingSchema: typeof MappingSchema; declare const index$1_SettingsSchema: typeof SettingsSchema; declare const index$1_mapping: typeof mapping; declare const index$1_settings: typeof settings; declare namespace index$1 { export { type index$1_Mapping as Mapping, index$1_MappingSchema as MappingSchema, type Settings$1 as Settings, index$1_SettingsSchema as SettingsSchema, index$1_mapping as mapping, index$1_settings as settings }; } /** * Destination-level settings. * * Extends Mixpanel's `Config` so every `mixpanel.init()` option flows through * without per-field plumbing. The destination adds walkerOS-specific keys: * - `apiKey` (required) — maps to the first arg of `mixpanel.init()` * - `identify` — destination-level identity mapping * - `include` — event sections flattened into `track()` properties * - `group` — destination-level group association * - `_state` — runtime state (not user-facing, mutated by init/push) */ interface Settings extends Partial { apiKey: string; identify?: Mapping$1.Value; group?: Mapping$1.Value; /** Runtime state — populated by init() and mutated by push(). Not user-facing. */ _state?: RuntimeState; } interface RuntimeState { /** Last-set distinct_id, used to skip redundant identify() calls. */ lastIdentity?: { distinctId?: string; }; } /** * The `people` namespace on the mixpanel singleton. Mirrors the real SDK * shape so tests can spy each method individually. */ interface MixpanelPeople { set: (prop: string | Record, to?: unknown, callback?: () => void) => void; set_once: (prop: string | Record, to?: unknown, callback?: () => void) => void; increment: (prop: string | Record, by?: number, callback?: () => void) => void; append: (prop: string | Record, value?: unknown, callback?: () => void) => void; union: (prop: string | Record, value?: unknown[], callback?: () => void) => void; remove: (prop: string | Record, value?: unknown, callback?: () => void) => void; unset: (prop: string | string[], callback?: () => void) => void; delete_user: () => void; } /** * The handle returned by `mixpanel.get_group(key, id)`. Supports property * operations on the group profile. */ interface MixpanelGroup { set: (prop: string | Record, to?: unknown, callback?: () => void) => void; set_once: (prop: string | Record, to?: unknown, callback?: () => void) => void; unset: (prop: string | string[], callback?: () => void) => void; union: (prop: string | Record, value?: unknown[], callback?: () => void) => void; remove: (prop: string | Record, value?: unknown, callback?: () => void) => void; delete: () => void; } /** * Mixpanel SDK surface — the subset of `mixpanel-browser` the destination * actually uses. Mirrors the singleton's shape so tests can mock the whole * object via env.mixpanel. */ interface MixpanelSDK { init: (token: string, config?: Partial, name?: string) => void; track: (event: string, properties?: Record, callback?: () => void) => void; identify: (distinctId?: string) => void; reset: () => void; set_group: (groupKey: string, groupIds: string | string[], callback?: () => void) => void; get_group: (groupKey: string, groupId: string) => MixpanelGroup; opt_in_tracking: (options?: Record) => void; opt_out_tracking: (options?: Record) => void; stop_batch_senders?: () => void; people: MixpanelPeople; } /** * Env — optional SDK override. Production leaves this undefined and the * destination falls back to the real `mixpanel-browser` default export. * Tests provide a mock via env.mixpanel = { ... }. */ interface Env extends DestinationWeb.Env { mixpanel?: MixpanelSDK; } /** * Pre-init env — all methods are no-ops until the test runner wires spies. */ declare const init: Env | undefined; /** * Post-init env — same shape. The test runner clones this and replaces * individual methods with jest.fn() so it can assert on calls. */ declare const push: Env; /** Simulation tracking paths for CLI --simulate. */ declare const simulation: string[]; declare const env_init: typeof init; declare const env_push: typeof push; declare const env_simulation: typeof simulation; declare namespace env { export { env_init as init, env_push as push, env_simulation as simulation }; } /** * Examples may optionally carry destination-level settings. The test runner * reads `settings` from the example and merges it into the base destination * settings on top of the fixed apiKey. */ type MixpanelStepExample = Flow.StepExample & { settings?: Partial; configInclude?: string[]; /** Consent granted before `in` so a gated destination is loaded first. */ before?: WalkerOS.Consent; }; /** * Default event forwarding - every walkerOS event becomes * mixpanel.track(event.name, properties). With no mapping and no * destination-level include, properties is `{}`. */ declare const defaultEventForwarding: MixpanelStepExample; /** * Wildcard ignore - walkerOS's standard way to drop events. The rule * matches but does nothing. The destination fires zero SDK calls. */ declare const wildcardIgnored: MixpanelStepExample; /** * Destination-level settings.include flattens the walkerOS `data` section * into prefixed track() properties on every push. */ declare const destinationLevelInclude: MixpanelStepExample; /** * Per-rule settings.include REPLACES destination-level include for the * matched rule. Here destination-level sends `data`, but the rule * overrides it with `globals` only. */ declare const ruleIncludeReplaces: MixpanelStepExample; /** * Destination-level settings.identify fires on the first push. The * destination resolves { distinctId } and calls mixpanel.identify(distinctId), * then tracks the result in runtime state. Subsequent pushes with unchanged * distinctId do NOT re-fire identify(). */ declare const destinationLevelIdentify: MixpanelStepExample; /** * Per-event identify + people operations - the canonical "user login" * pattern. `silent: true` suppresses the default mixpanel.track() call * because we're running identity side effects only. */ declare const userLoginIdentifyAndPeople: MixpanelStepExample; /** * Full people operation vocabulary - a profile update rule that exercises * set, set_once, increment, append, union, remove, and unset in a single * rule. `silent: true` because only side effects are needed. */ declare const profileUpdateAllPeopleOperations: MixpanelStepExample; /** * people.delete_user - destructive operation. The resolved people object * uses `{ delete_user: true }` to trigger the call. */ declare const accountDeleteUser: MixpanelStepExample; /** * User logout - reset: true fires mixpanel.reset(), which clears all * persistence and generates a new anonymous distinct_id. */ declare const userLogoutReset: MixpanelStepExample; /** * User-group association - settings.group resolves to { key, id } and * calls mixpanel.set_group(key, id). Fires default track too. */ declare const userGroupAssociation: MixpanelStepExample; /** * Group profile properties - settings.groupProfile resolves to * { key, id, set?, set_once?, ... } and calls * mixpanel.get_group(key, id).set(...), .set_once(...), etc. */ declare const companyUpdateGroupProfile: MixpanelStepExample; /** * Consent revoked → mixpanel.opt_out_tracking(). After analytics consent is * granted (Mixpanel loads and opts in), revoking it calls * mixpanel.opt_out_tracking() via the consent handler. The destination is * never loaded under denied consent, so the opt-out is a real revocation of an * already-granted destination. */ declare const consentRevokeOptOut: MixpanelStepExample; /** * Consent granted → mixpanel.opt_in_tracking(). */ declare const consentGrantOptIn: MixpanelStepExample; type step_MixpanelStepExample = MixpanelStepExample; declare const step_accountDeleteUser: typeof accountDeleteUser; declare const step_companyUpdateGroupProfile: typeof companyUpdateGroupProfile; declare const step_consentGrantOptIn: typeof consentGrantOptIn; declare const step_consentRevokeOptOut: typeof consentRevokeOptOut; declare const step_defaultEventForwarding: typeof defaultEventForwarding; declare const step_destinationLevelIdentify: typeof destinationLevelIdentify; declare const step_destinationLevelInclude: typeof destinationLevelInclude; declare const step_profileUpdateAllPeopleOperations: typeof profileUpdateAllPeopleOperations; declare const step_ruleIncludeReplaces: typeof ruleIncludeReplaces; declare const step_userGroupAssociation: typeof userGroupAssociation; declare const step_userLoginIdentifyAndPeople: typeof userLoginIdentifyAndPeople; declare const step_userLogoutReset: typeof userLogoutReset; declare const step_wildcardIgnored: typeof wildcardIgnored; declare namespace step { export { type step_MixpanelStepExample as MixpanelStepExample, step_accountDeleteUser as accountDeleteUser, step_companyUpdateGroupProfile as companyUpdateGroupProfile, step_consentGrantOptIn as consentGrantOptIn, step_consentRevokeOptOut as consentRevokeOptOut, step_defaultEventForwarding as defaultEventForwarding, step_destinationLevelIdentify as destinationLevelIdentify, step_destinationLevelInclude as destinationLevelInclude, step_profileUpdateAllPeopleOperations as profileUpdateAllPeopleOperations, step_ruleIncludeReplaces as ruleIncludeReplaces, step_userGroupAssociation as userGroupAssociation, step_userLoginIdentifyAndPeople as userLoginIdentifyAndPeople, step_userLogoutReset as userLogoutReset, step_wildcardIgnored as wildcardIgnored }; } declare const index_env: typeof env; declare const index_step: typeof step; declare namespace index { export { index_env as env, index_step as step }; } export { index as examples, index$1 as schemas };