/** Notification type metadata nested in a system notification. */ interface SystemNotificationType { id: string; slug: string; alias: string; } /** A system notification catalog entry. */ interface SystemNotification { id: string; notificationTypeId: string; slug: string; alias: string; description: string; type: SystemNotificationType; } /** Query parameters for listing system notifications. */ interface GetSystemNotificationsParams { /** Filters notifications by type slug (e.g. `chat`). */ typeSlug?: string; /** Filters notifications by type UUID. */ notificationTypeId?: string; } /** Response returned when listing system notifications. */ interface GetSystemNotificationsResponse { items: SystemNotification[]; total: number; } /** Device type metadata nested in a user device. */ interface DeviceType { id: string; slug: string; alias: string; description?: string; } /** A registered user device with its push notification token. */ interface UserDevice { id: string; userId: string; companyId: string; deviceId: string; deviceToken: string; device: DeviceType; } /** Query parameters for listing user devices. */ interface GetUserDevicesParams { /** Filters by device type slug (e.g. `mobile`, `web`). */ deviceSlug?: string; /** Filters by device type UUID from the catalog. */ deviceId?: string; /** Filters by a specific device token. */ deviceToken?: string; /** Maximum number of records returned (1 to 100). Defaults to 50. */ limit?: number; /** Offset for pagination. Defaults to 0. */ offset?: number; /** Company ID (used with Service Token). */ companyId?: string; /** User ID (used with Service Token). */ userId?: string; } /** Response returned when listing user devices. */ interface GetUserDevicesResponse { items: UserDevice[]; total: number; } /** * Request payload for registering a user device. * Either `deviceSlug` or `deviceId` must be provided. */ interface RegisterUserDeviceRequest { /** FCM, APNs or Web Push token of the device. */ deviceToken: string; /** Device slug (e.g. `mobile`, `web`). Required if `deviceId` is not sent. */ deviceSlug?: string; /** Device type UUID from the catalog. Required if `deviceSlug` is not sent. */ deviceId?: string; /** Company ID (used with Service Token). */ companyId?: string; /** User ID (used with Service Token). */ userId?: string; } /** Response returned when registering a user device. */ interface RegisterUserDeviceResponse { id: string; deviceSlug: string; deviceToken: string; } /** Response returned when deleting a user device. */ interface DeleteUserDeviceResponse { isDeleted: boolean; id: string; } /** Nested user device summary inside a preference. */ interface UserPreferenceDevice { id: string; deviceId: string; deviceToken: string; device: Pick; } /** Nested system notification summary inside a preference. */ interface UserPreferenceSystemNotification { id: string; slug: string; alias: string; } /** A user notification preference linked to a physical device. */ interface UserPreference { id: string; companyId: string; userId: string; userDeviceId: string; systemNotificationId: string; userDevice: UserPreferenceDevice; systemNotification: UserPreferenceSystemNotification; } /** Query parameters for listing user preferences. */ interface GetUserPreferencesParams { /** Company ID (used with Service Token). */ companyId?: string; /** User ID (used with Service Token). */ userId?: string; /** Filter by physical device ID (`user_devices.id`). */ userDeviceId?: string; /** Filter by system notification slug. */ systemNotificationSlug?: string; /** Filter by system notification UUID. */ systemNotificationId?: string; } /** * Request payload for creating a user preference. * Either `systemNotificationSlug` or `systemNotificationId` must be provided. */ interface CreateUserPreferenceRequest { /** UUID of the physical device registered in `user_devices`. */ userDeviceId: string; /** System notification slug (e.g. `chat_invitation`). */ systemNotificationSlug?: string; /** System notification UUID. */ systemNotificationId?: string; /** Company ID (used with Service Token). */ companyId?: string; /** User ID (used with Service Token). */ userId?: string; } /** Query parameters for deleting a user preference (Service Token context). */ interface DeleteUserPreferenceParams { /** Company ID (used with Service Token). */ companyId?: string; /** User ID (used with Service Token). */ userId?: string; } /** Response returned when deleting a user preference. */ interface DeleteUserPreferenceResponse { isDeleted: boolean; id: string; } export type { CreateUserPreferenceRequest, DeleteUserDeviceResponse, DeleteUserPreferenceParams, DeleteUserPreferenceResponse, DeviceType, GetSystemNotificationsParams, GetSystemNotificationsResponse, GetUserDevicesParams, GetUserDevicesResponse, GetUserPreferencesParams, RegisterUserDeviceRequest, RegisterUserDeviceResponse, SystemNotification, SystemNotificationType, UserDevice, UserPreference, UserPreferenceDevice, UserPreferenceSystemNotification };