import { RpcMethod } from './commonTypes'; import { AlertType as pushwoosh_accounts_alerts_v1_AlertType } from './pushwoosh_accounts_alerts_v1'; import { AlertStatus as pushwoosh_accounts_alerts_v1_AlertStatus } from './pushwoosh_accounts_alerts_v1'; import { AlertSeverity as pushwoosh_accounts_alerts_v1_AlertSeverity } from './pushwoosh_accounts_alerts_v1'; import { OrderBy as pushwoosh_accounts_alerts_v1_OrderBy } from './pushwoosh_accounts_alerts_v1'; import { OrderDirection as pushwoosh_accounts_alerts_v1_OrderDirection } from './pushwoosh_accounts_alerts_v1'; export type InternalAlertsService_List = RpcMethod; export type InternalAlertsService_UpdateStatus = RpcMethod; export type InternalAlertsService_GetHighestSeverity = RpcMethod; export interface InternalAlertsService { /** Lists in-product alerts for the authenticated account, filtered by type, status and severity, with paging and ordering. Use to show the account's notification/alert feed before marking any as read via update_alert_statuses. */ List: InternalAlertsService_List; /** Sets the status (e.g. read/unread) of one or more alerts identified by uuid for the authenticated account. Use to mark alerts read or dismissed; all listed uuids must belong to the account or the call fails. */ UpdateStatus: InternalAlertsService_UpdateStatus; /** Returns the highest alert severity present for the account, optionally restricted to alerts of a given status. Use to drive a single badge/indicator without fetching the full list via list_alerts. */ GetHighestSeverity: InternalAlertsService_GetHighestSeverity; } export type ListRequest = { /** Optional filter: return only alerts of this type. */ type?: pushwoosh_accounts_alerts_v1_AlertType; /** Optional filter: return only alerts in this status (e.g. read/unread). */ status?: pushwoosh_accounts_alerts_v1_AlertStatus; /** Optional filter: return only alerts of this severity. */ severity?: pushwoosh_accounts_alerts_v1_AlertSeverity; /** Zero-based page index. */ page?: number; /** Page size. */ perPage?: number; /** Field to order the alerts by. */ orderBy?: pushwoosh_accounts_alerts_v1_OrderBy; /** Ascending or descending order. */ orderDirection?: pushwoosh_accounts_alerts_v1_OrderDirection; /** Optional filter: drop alerts of these types from the result. */ excludeTypes?: pushwoosh_accounts_alerts_v1_AlertType[]; }; export type Alert = { type: pushwoosh_accounts_alerts_v1_AlertType; status: pushwoosh_accounts_alerts_v1_AlertStatus; severity: pushwoosh_accounts_alerts_v1_AlertSeverity; title: string; content?: string; created?: Date; expiry?: Date; uuid: string; account: string; application?: string; actionLink?: string; actionLinkLabel?: string; /** Illustration of a product update card; empty means the client draws its own fallback. */ imageUrl?: string; secondaryActionLink?: string; secondaryActionLinkLabel?: string; }; export type ListResponse = { alerts: Alert[]; page: number; perPage: number; total: number; }; export type UpdateStatusRequest_AlertStatusUpdate = { /** UUID of the alert to update. */ uuid: string; /** New status to set on the alert (e.g. read/unread). */ status: pushwoosh_accounts_alerts_v1_AlertStatus; }; export type UpdateStatusRequest = { /** Alerts to update; every uuid must belong to the authenticated account. */ alerts?: UpdateStatusRequest_AlertStatusUpdate[]; }; export type UpdateStatusResponse = {}; export type GetHighestSeverityRequest = { /** Optional filter: consider only alerts in this status (e.g. read/unread). */ status?: pushwoosh_accounts_alerts_v1_AlertStatus; /** Optional filter: ignore alerts of these types when picking the severity. */ excludeTypes?: pushwoosh_accounts_alerts_v1_AlertType[]; }; export type GetHighestSeverityResponse = { severity: pushwoosh_accounts_alerts_v1_AlertSeverity; };