UNPKG

@causalfoundry/js-sdk

Version:

Causal Foundry WEB SDK (JS/TS)

155 lines (154 loc) 4.51 kB
import { CartProperties, CheckoutProperties, DeliveryProperties, ECommerceTypes, ItemProperties } from "../modules/ECommerce/typings"; import { LevelProperties, MilestoneProperties } from "../modules/Loyalty/typings"; import { ELearningTypes } from "../modules/ELearning/typings"; import { LoyaltyTypes } from "../modules/Loyalty/typings"; import { AppProperties, ContentBlock, IdentifyProperties, InternalSearchProperties, MediaProperties, NavigationTypes, PageProperties, NudgeResponseProperties } from "../modules/Navigation/typings"; import { DeferredPaymentProperties, PaymentsTypes } from "../modules/Payments/typings"; import { InteractProperties, ReferenceGuideTypes } from "../modules/ReferenceGuide/typings"; import { FeedProperties, FeedTypes, PublicationProperties } from "../modules/Feed/typings"; import { BreakProperties, CallCenterEventType, ContactProperties, OpsScorecardProperties } from "../modules/CallCenter/typings"; import {AmbulanceProperties, EmergencyMgmtEventType, IncidentProperties} from "../modules/EmergencyMgmt/typings"; import { AppointmentProperties, EncounterProperties, PatientMgmtEventType, PatientProperties } from "../modules/PatientMgmt/typings"; export declare enum GlobalTypes { NavigationTypes = 0, ECommerceTypes = 1 } export interface BsBrowserOptions { logScroll: boolean; logPage: boolean; logUrlChanges: boolean; flushOnLeave: boolean; } export interface LogIngestorOptions { flushInterval: number; flushMaxRetries: number; ingestPath: string; cacheEventsInLocalstorage: boolean; cacheEventsKey: string; } export interface CfLogOptions { baseUrl: string; nudgeFetchPath: string; currencyPath: string; catalogPath: string; activateNudgeMechanism: boolean; defaultBlock: ContentBlock; debug: boolean; skipDynamicLoading?: boolean; } export interface BatteryStatus { charging: boolean; chargingTime: number; dischargingTime: number; level: number; } export interface EventContext { browser?: { user_agent: string; languages: string[]; online: boolean; battery?: BatteryStatus; }; } export type AnyKnownType = NavigationTypes | ECommerceTypes | ELearningTypes | ReferenceGuideTypes | PaymentsTypes | LoyaltyTypes | FeedTypes; export type EventTeaser = { name: NavigationTypes; property?: string; value?: number; ctx?: PageProperties | AppProperties | IdentifyProperties | MediaProperties | InternalSearchProperties | NudgeResponseProperties; } | { name: ECommerceTypes; property?: string; value?: number; ctx?: CartProperties | DeliveryProperties | CheckoutProperties | ItemProperties; } | { name: ReferenceGuideTypes; property?: string; value?: number; ctx?: InteractProperties; } | { name: PaymentsTypes; property?: string; value?: number; ctx?: DeferredPaymentProperties; } | { name: LoyaltyTypes; property?: string; value?: number; ctx?: LevelProperties | MilestoneProperties; } | { name: CallCenterEventType, property?: string; value?: number; ctx?: BreakProperties | ContactProperties | OpsScorecardProperties } | { name: EmergencyMgmtEventType, property?: string; value?: number; ctx?: IncidentProperties | AmbulanceProperties } | { name: PatientMgmtEventType property?: string; value?: number; ctx?: PatientProperties | EncounterProperties | AppointmentProperties } | { name: string; property?: string; value?: number; ctx?: Record<string, string|number> }; export type EventCommon = { block: ContentBlock; ol: boolean; ts: string; }; export type Event = EventTeaser & EventCommon; export type DeviceInfoObject = { id: string; brand: string; model: string; os: string; os_ver: string; }; export type AppInfoObject = { id: string; min_sdk_version: number; target_sdk_version: number; version_code: number; version_name: string; version: string; }; export type EventMainObject = { s_id: string; u_id: string; app_info: AppInfoObject; d_info: DeviceInfoObject; sdk: string; up?: number; dn?: number; data?: Event[]; }; export interface QueueItem { uuid: string; event: Event; time: number; retries: number; lastRetry?: number; } export interface TypedRows { header: string[]; data_type: string[]; rows: any[][]; }