import { NonNullablePaths } from '@wix/sdk-types'; /** * Aggregated AI Site-Chat statistics for a site. * * Statistics include daily KPI rows for recent activity and period KPI rows for comparison windows, such as the last 30 days and the previous 30 days. */ interface Statistics { /** * Site ID the statistics are scoped to. * @format GUID */ _id?: string; /** * Typed daily statistics. * * Deprecated. Use `dailyKpis` instead. * @maxSize 30 * @deprecated Typed daily statistics. * * Deprecated. Use `dailyKpis` instead. * @replacedBy daily_kpis * @targetRemovalDate 2026-02-03 */ dailies?: Daily[]; /** * Typed period statistics. * * Deprecated. Use `periodKpis` instead. * @maxSize 10 * @deprecated Typed period statistics. * * Deprecated. Use `periodKpis` instead. * @replacedBy period_kpis * @targetRemovalDate 2026-02-03 */ timespans?: Timespan[]; /** * Daily KPI rows for the last 30 days. * * Each row contains the fields requested in `dailyFields`, or all default daily KPI fields if `dailyFields` isn't provided. * @maxSize 30 */ dailyKpis?: Record[] | null; /** * Period KPI rows for comparison windows. * * Each row contains the fields requested in `byPeriodFields`, or all default period KPI fields if `byPeriodFields` isn't provided. * @maxSize 10 */ periodKpis?: Record[] | null; } interface Daily { /** Date the daily statistics are for. */ date?: Date | null; /** Number of conversations on this date. */ conversations?: string | null; /** * Number of messages on this date. * * Deprecated. * @deprecated */ messages?: string | null; /** Number of unique visitors on this date. */ visitors?: string | null; /** Number of product items shown or recommended in AI Site-Chat on this date. */ exposedItems?: string | null; /** Number of orders associated with AI Site-Chat activity on this date. */ orders?: string | null; /** Chat handler the daily statistics are grouped by. */ chatHandler?: ChatHandlerWithLiterals; /** Number of conversations that received a response on this date. */ repliedConversationsCount?: string | null; } declare enum ChatHandler { /** Unknown handler. */ UNKNOWN_HANDLER = "UNKNOWN_HANDLER", /** AI assistant. */ AI = "AI", /** Wix user, such as a site owner or contributor. */ WIX_USER = "WIX_USER" } /** @enumType */ type ChatHandlerWithLiterals = ChatHandler | 'UNKNOWN_HANDLER' | 'AI' | 'WIX_USER'; interface Timespan { /** Comparison period the statistics are aggregated for. */ period?: PeriodWithLiterals; /** Number of conversations in this period. */ conversations?: string | null; /** * Number of messages in this period. * * Deprecated. * @deprecated */ messages?: string | null; /** Number of unique visitors in this period. */ visitors?: string | null; /** Number of product items shown or recommended in AI Site-Chat in this period. */ exposedItems?: string | null; /** Number of orders associated with AI Site-Chat activity in this period. */ orders?: string | null; /** Chat handler the period statistics are grouped by. */ chatHandler?: ChatHandlerWithLiterals; /** Number of conversations that received a response in this period. */ repliedConversationsCount?: string | null; /** Median response time in seconds. */ medianResponseTimeSecondsP50?: string | null; /** Median first response time in seconds. */ medianFirstResponseTimeSecondsP50?: string | null; } declare enum Period { /** Unknown period. */ UNKNOWN_PERIOD = "UNKNOWN_PERIOD", /** Rolling 30-day period from the current date. */ LAST_30_DAYS = "LAST_30_DAYS", /** The 30-day period before `LAST_30_DAYS`. */ PREVIOUS_30_DAYS = "PREVIOUS_30_DAYS" } /** @enumType */ type PeriodWithLiterals = Period | 'UNKNOWN_PERIOD' | 'LAST_30_DAYS' | 'PREVIOUS_30_DAYS'; interface GetStatisticsRequest { /** * Daily KPI fields to return in `statistics.dailyKpis`. * * Supported values: `kpi_date`, `mode`, `conversations_count`, `visitors_distinct_count`, `exposed_items_count`, `total_orders_count`, `replied_conversations_count`, `response_time_seconds_p50`, `first_response_time_seconds_p50`. * * Default: All supported daily KPI fields. */ dailyFields?: string[]; /** * Period KPI fields to return in `statistics.periodKpis`. * * Supported values: `period`, `mode`, `conversations_count`, `visitors_distinct_count`, `exposed_items_count`, `total_orders_count`, `replied_conversations_count`, `response_time_seconds_p50`, `first_response_time_seconds_p50`. * * Default: All supported period KPI fields. */ byPeriodFields?: string[]; } interface GetStatisticsResponse { /** Aggregated AI Site-Chat statistics for the authenticated site. */ statistics?: Statistics; } /** * Retrieves aggregated AI Site-Chat statistics for the authenticated site. * @public * @documentationMaturity preview * @permissionId innovation:assistant:v2:statistics:get_statistics * @applicableIdentity APP * @fqn wix.innovation.assistant.stats.v2.WixAssistantStatistics.GetStatistics */ declare function getStatistics(options?: GetStatisticsOptions): Promise>; interface GetStatisticsOptions { /** * Daily KPI fields to return in `statistics.dailyKpis`. * * Supported values: `kpi_date`, `mode`, `conversations_count`, `visitors_distinct_count`, `exposed_items_count`, `total_orders_count`, `replied_conversations_count`, `response_time_seconds_p50`, `first_response_time_seconds_p50`. * * Default: All supported daily KPI fields. */ dailyFields?: string[]; /** * Period KPI fields to return in `statistics.periodKpis`. * * Supported values: `period`, `mode`, `conversations_count`, `visitors_distinct_count`, `exposed_items_count`, `total_orders_count`, `replied_conversations_count`, `response_time_seconds_p50`, `first_response_time_seconds_p50`. * * Default: All supported period KPI fields. */ byPeriodFields?: string[]; } export { ChatHandler, type ChatHandlerWithLiterals, type Daily, type GetStatisticsOptions, type GetStatisticsRequest, type GetStatisticsResponse, Period, type PeriodWithLiterals, type Statistics, type Timespan, getStatistics };