import { Mapping, Flow, WalkerOS } from '@walkeros/core'; import { DestinationWeb } from '@walkeros/web-core'; /** * Settings (destination-level). * * orgId is the FullStory organization ID (e.g. "o-XXXXXX-na1"). * All SnippetOptions from @fullstory/browser are available as passthrough. */ interface Settings { orgId: string; host?: string; script?: string; cookieDomain?: string; debug?: boolean; devMode?: boolean; startCaptureManually?: boolean; namespace?: string; recordCrossDomainIFrames?: boolean; identify?: Mapping.Value; consent?: Record; } /** * FullStory SDK surface -- the subset of @fullstory/browser methods this * destination actually calls. Tests can mock each method individually. * * Uses V2 API only: FullStory('operationName', options). */ interface FullStorySDK { init: (options: { orgId: string; host?: string; script?: string; cookieDomain?: string; debug?: boolean; devMode?: boolean; startCaptureManually?: boolean; namespace?: string; recordCrossDomainIFrames?: boolean; }) => void; trackEvent: (options: { name: string; properties?: Record; }) => void; setIdentity: (options: { uid?: string | false; anonymous?: boolean; consent?: boolean; properties?: Record; }) => void; setProperties: (options: { type: 'user' | 'page'; properties: Record; }) => void; shutdown: () => void; start: () => void; } /** * Env -- optional override for the vendor SDK. Production leaves this * undefined and the destination falls back to the real @fullstory/browser. * Tests provide a mock via env.fullstory = { ... }. */ interface Env extends DestinationWeb.Env { fullstory?: FullStorySDK; } /** * Pre-init environment -- FullStory SDK methods are no-ops until init wires them. */ declare const init: Env | undefined; /** * Post-init environment -- FullStory SDK methods are spy-able no-ops. * Tests clone this and replace individual methods with jest.fn() for assertions. */ 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 }; } /** * Extended step example that may carry destination-level settings overrides. */ type FullStoryStepExample = Flow.StepExample & { settings?: Partial; /** Consent granted before `in` so a gated destination is loaded first. */ before?: WalkerOS.Consent; }; /** * Default event forwarding -- every walkerOS event becomes * FullStory('trackEvent', { name, properties }). No mapping rule needed. */ declare const defaultEventForwarding: FullStoryStepExample; /** * Wildcard ignore -- the event matches a mapping rule with ignore: true. * The destination fires zero SDK calls. */ declare const wildcardIgnored: FullStoryStepExample; /** * Event name mapping -- mapping.name renames the walkerOS event for FullStory. */ declare const mappedEventName: FullStoryStepExample; /** * Per-event identify via mapping.settings.identify. * Resolves { uid, properties } and calls FullStory('setIdentity', ...). * Then fires the default trackEvent. */ declare const userLoginIdentify: FullStoryStepExample; /** * Destination-level settings.identify -- fires setIdentity on every push. * Uses user.id from the standard getEvent fixture. */ declare const destinationLevelIdentify: FullStoryStepExample; /** * User properties via mapping.settings.set with default setType ('user'). * Calls FullStory('setProperties', { type: 'user', properties }). */ declare const setUserProperties: FullStoryStepExample; /** * Page properties via mapping.settings.set with setType: 'page'. * silent: true suppresses trackEvent -- useful for page views where * FullStory already auto-captures navigation. */ declare const setPageProperties: FullStoryStepExample; /** * Combined features -- identify the user, set user properties, then fire * the event. Tests push execution order: identify -> setProperties -> trackEvent. */ declare const combinedFeatures: FullStoryStepExample; /** * silent: true with identify -- mapping.silent suppresses trackEvent but * still executes identify and set from the mapping rule. */ declare const silentWithIdentify: FullStoryStepExample; /** * Consent grant -- settings.consent maps walkerOS consent key "analytics" * to FullStory "capture" action. Granting consent calls FullStory('start'). * * Uses command='consent' so the test runner dispatches via * elb('walker consent', in) instead of pushing an event. */ declare const consentGrantCapture: FullStoryStepExample; /** * Consent revoke -- after analytics consent is granted (FullStory starts * capture), revoking it calls FullStory('shutdown'). The destination is never * loaded under denied consent, so the shutdown is a real revocation of an * already-granted destination. */ declare const consentRevokeCapture: FullStoryStepExample; /** * Consent flag -- settings.consent maps walkerOS consent key to FullStory * "consent" action. Granting calls setIdentity({ consent: true }). */ declare const consentGrantFlag: FullStoryStepExample; /** * Consent flag revoke -- after marketing consent is granted (the destination * loads), revoking it calls setIdentity({ consent: false }). The destination is * never loaded under denied consent, so the revoke acts on an already-granted * destination. */ declare const consentRevokeFlag: FullStoryStepExample; type step_FullStoryStepExample = FullStoryStepExample; declare const step_combinedFeatures: typeof combinedFeatures; declare const step_consentGrantCapture: typeof consentGrantCapture; declare const step_consentGrantFlag: typeof consentGrantFlag; declare const step_consentRevokeCapture: typeof consentRevokeCapture; declare const step_consentRevokeFlag: typeof consentRevokeFlag; declare const step_defaultEventForwarding: typeof defaultEventForwarding; declare const step_destinationLevelIdentify: typeof destinationLevelIdentify; declare const step_mappedEventName: typeof mappedEventName; declare const step_setPageProperties: typeof setPageProperties; declare const step_setUserProperties: typeof setUserProperties; declare const step_silentWithIdentify: typeof silentWithIdentify; declare const step_userLoginIdentify: typeof userLoginIdentify; declare const step_wildcardIgnored: typeof wildcardIgnored; declare namespace step { export { type step_FullStoryStepExample as FullStoryStepExample, step_combinedFeatures as combinedFeatures, step_consentGrantCapture as consentGrantCapture, step_consentGrantFlag as consentGrantFlag, step_consentRevokeCapture as consentRevokeCapture, step_consentRevokeFlag as consentRevokeFlag, step_defaultEventForwarding as defaultEventForwarding, step_destinationLevelIdentify as destinationLevelIdentify, step_mappedEventName as mappedEventName, step_setPageProperties as setPageProperties, step_setUserProperties as setUserProperties, step_silentWithIdentify as silentWithIdentify, step_userLoginIdentify as userLoginIdentify, step_wildcardIgnored as wildcardIgnored }; } export { env, step };