import { ResponseModel } from '../packages/network-layer'; import { SettingsService } from '../services/SettingsService'; import { dynamic } from '../types/Common'; import { UsageStatsUtil } from './UsageStatsUtil'; import { ContextModel } from '../models/user/ContextModel'; import { ServiceContainer } from '../services/ServiceContainer'; /** * Constructs the settings path with API key and account ID. * @param {string} sdkKey - The API key. * @param {any} accountId - The account identifier. * @returns {Record} - The settings path including API key, random number, and account ID. */ export declare function getSettingsPath(sdkKey: string, accountId: string | number): Record; /** * Constructs the tracking path for an event. * @param {string} event - The event type. * @param {string} accountId - The account identifier. * @param {string} userId - The user identifier. * @returns {Record} - The tracking path for the event. */ export declare function getTrackEventPath(event: string, accountId: string, userId: string): Record; /** * Builds generic properties for different tracking calls required by Wingify servers. * @param {SettingsService} settingsService - The settings service instance. * @param {String} eventName * @param {String} visitorUserAgent - The visitor user agent. * @param {String} ipAddress - The visitor IP address. * @param {Boolean} isUsageStatsEvent - Whether the event is a usage stats event. * @param {Number} usageStatsAccountId - The usage stats account ID. * @returns {Record} - The properties for the event. */ export declare function getEventsBaseProperties( settingsService: SettingsService, eventName: string, visitorUserAgent?: string, ipAddress?: string, isUsageStatsEvent?: boolean, usageStatsAccountId?: number, ): Record; /** * Builds generic payload required by all the different tracking calls. * @param {SettingsService} settingsService - The settings service instance. * @param {String} userId user id * @param {String} eventName event name * @param {String} visitorUserAgent - The visitor user agent. * @param {String} ipAddress - The visitor IP address. * @param {Boolean} isUsageStatsEvent - Whether the event is a usage stats event. * @param {Number} usageStatsAccountId - The usage stats account ID. * @param {Boolean} shouldGenerateUUID - Whether to generate a UUID. * @returns {Record} - The payload for the event. */ export declare function _getEventBasePayload( settingsService: SettingsService, userId: string | number, eventName: string, visitorUserAgent?: string, ipAddress?: string, isUsageStatsEvent?: boolean, usageStatsAccountId?: number, shouldGenerateUUID?: boolean, ): Record; /** * Builds payload to track the visitor. * @param {ServiceContainer} serviceContainer - The service container instance. * @param {String} eventName - The name of the event. * @param {Number} campaignId - The campaign ID. * @param {Number} variationId - The variation ID. * @param {ContextModel} context - The context model instance. * @returns {Record} - The payload for the event. */ export declare function getTrackUserPayloadData( serviceContainer: ServiceContainer, eventName: string, campaignId: number, variationId: number, context: ContextModel, ): Record; /** * Constructs the payload data for tracking goals with custom event properties. * @param {ServiceContainer} serviceContainer - The service container instance. * @param {string} eventName - Name of the event. * @param {any} eventProperties - Custom properties for the event. * @param {ContextModel} context - The context model instance. * @returns {any} - The constructed payload data. */ export declare function getTrackGoalPayloadData( serviceContainer: ServiceContainer, eventName: string, eventProperties: Record, context: ContextModel, ): Record; /** * Constructs the payload data for syncing multiple visitor attributes. * @param {ServiceContainer} serviceContainer - The service container instance. * @param {string} eventName - Event name. * @param {Record} attributes - Key-value map of attributes. * @param {ContextModel} context - The context model instance. * @returns {Record} - Payload object to be sent in the request. */ export declare function getAttributePayloadData( serviceContainer: ServiceContainer, eventName: string, attributes: Record, context: ContextModel, ): Record; /** * Sends a POST API request with the specified properties and payload. * @param {ServiceContainer} serviceContainer - The service container instance. * @param {any} properties - Properties for the request. * @param {any} payload - Payload for the request. * @param {string} userId - User ID. */ export declare function sendPostApiRequest( serviceContainer: ServiceContainer, properties: any, payload: any, userId: string, eventProperties?: any, campaignInfo?: any, ): Promise; /** * Constructs the payload for a messaging event. * @param {SettingsService} settingsService - The settings service instance. * @param messageType - The type of the message. * @param message - The message to send. * @param eventName - The name of the event. * @returns The constructed payload. */ export declare function getMessagingEventPayload( settingsService: SettingsService, messageType: string, message: string, eventName: string, extraData?: any, ): Record; /** * Constructs the payload for init called event. * @param {SettingsService} settingsService - The settings service instance. * @param eventName - The name of the event. * @param settingsFetchTime - Time taken to fetch settings in milliseconds. * @param sdkInitTime - Time taken to initialize the SDK in milliseconds. * @returns The constructed payload with required fields. */ export declare function getSDKInitEventPayload( settingsService: SettingsService, eventName: string, settingsFetchTime?: number, sdkInitTime?: number, ): Record; /** * Constructs the payload for sdk usage stats event. * @param {SettingsService} settingsService - The settings service instance. * @param eventName - The name of the event. * @param settingsFetchTime - Time taken to fetch settings in milliseconds. * @param sdkInitTime - Time taken to initialize the SDK in milliseconds. * @returns The constructed payload with required fields. */ export declare function getSDKUsageStatsEventPayload( settingsService: SettingsService, eventName: string, usageStatsAccountId: number, usageStatsUtil: UsageStatsUtil, ): Record; /** * Constructs the payload for debugger event. * @param {SettingsService} settingsService - The settings service instance. * @param eventProps - The properties for the event. * @returns The constructed payload. */ export declare function getDebuggerEventPayload( settingsService: SettingsService, eventProps?: Record, ): Record; /** * Sends an event to Wingify (generic event sender). * @param {NetworkManager} networkManager - The network manager instance. * @param {SettingsService} settingsService - The settings service instance. * @param properties - Query parameters for the request. * @param payload - The payload for the request. * @param eventName - The name of the event to send. * @returns A promise that resolves to the response from the server. */ export declare function sendEvent( serviceContainer: ServiceContainer, properties: Record, payload: Record, eventName: string, ): Promise; /** * Creates a network and retry debug event. * @param response The response model. * @param payload The payload for the request. * @param apiName The name of the API. * @param extraData Extra data for the message. * @param isBatchingDebugEvent Whether the debug event was triggered due to batching. * @returns The debug event properties. */ export declare function createNetWorkAndRetryDebugEvent( response: ResponseModel, payload: any, apiName: string, extraData: string, ): Record; /** * Creates payload for holdout variation shown event. * Similar to getTrackUserPayloadData but specifically for holdouts. * @param {SettingsModel} settings - The settings model containing configuration. * @param {string} eventName - The event name. * @param {number} holdoutId - The holdout ID (used as campaignId). * @param {number} variationId - The variation ID (1 if IN holdout, 2 if NOT IN holdout). * @param {ContextModel} context - The user context model containing user-specific data. * @param {number} featureId - The feature ID. * @returns {Record} - The holdout payload data. */ export declare function createHoldoutPayload( serviceContainer: any, eventName: string, holdoutId: number, variationId: number, context: ContextModel, featureId: number, ): Record;