import { RpcMethod } from './commonTypes'; import { Widget as pushwoosh_rpc_v2_statistics_dashboards_widgets_Widget } from './statistics_dashboards_widgets'; export type StatisticsDashboardsService_Load = RpcMethod; export type StatisticsDashboardsService_List = RpcMethod; export type StatisticsDashboardsService_Create = RpcMethod; export type StatisticsDashboardsService_Update = RpcMethod; export type StatisticsDashboardsService_Delete = RpcMethod; export type StatisticsDashboardsService_WidgetsList = RpcMethod; export interface StatisticsDashboardsService { /** Returns a single statistics dashboard by its dashboard code, with name and created/updated timestamps. Use to inspect one dashboard found via list_dashboards. */ Load: StatisticsDashboardsService_Load; /** Lists statistics dashboards of an application (application code XXXXX-XXXXX), sorted by name, with an optional free-text name filter. Use to browse dashboards or find a dashboard code before loading it or its widgets. */ List: StatisticsDashboardsService_List; /** Creates a new empty statistics dashboard with the given name in an application (application code XXXXX-XXXXX) and returns its generated code. Use to start a new dashboard before adding widgets. */ Create: StatisticsDashboardsService_Create; /** Renames an existing statistics dashboard identified by its dashboard code and bumps its updated timestamp. Use to change a dashboard's display name; overwrites the current name. */ Update: StatisticsDashboardsService_Update; /** Permanently deletes a statistics dashboard by its dashboard code. Irreversible; a second call for the same code errors because the dashboard no longer exists. */ Delete: StatisticsDashboardsService_Delete; /** Lists the widgets belonging to a statistics dashboard (by dashboard code), with their type, size, position and params. Legacy endpoint kept for older frontend clients; prefer the StatisticsDashboardsWidgets service for widget access. */ WidgetsList: StatisticsDashboardsService_WidgetsList; } export type Dashboard = { name: string; code: string; created: Date; updated: Date; }; export type LoadDashboardRequest = { /** Dashboard code to load. */ code?: string; }; export type ListDashboardRequest = { /** Application code (XXXXX-XXXXX) whose dashboards to list. */ application?: string; /** Optional free-text substring; case-insensitively matches the dashboard name. */ searchByName?: string; }; export type ListDashboardResponse = { dashboards: Dashboard[]; }; export type CreateDashboardRequest = { /** Display name for the new dashboard (max 128 characters). */ name?: string; /** Application code (XXXXX-XXXXX) the dashboard belongs to. */ application?: string; }; export type CreateDashboardResponse = { dashboard: Dashboard; }; export type UpdateDashboardRequest = { /** Dashboard code to update. */ code?: string; /** New display name (max 128 characters). */ name?: string; }; export type UpdateDashboardResponse = {}; export type DeleteDashboardRequest = { /** Dashboard code to delete. */ code?: string; }; export type DeleteDashboardResponse = {}; export type WidgetsListRequest = { /** Dashboard code whose widgets to list. */ code?: string; }; export type WidgetsListResponse = { widgets: pushwoosh_rpc_v2_statistics_dashboards_widgets_Widget[]; };