|
| 1 | +/** |
| 2 | + * Notification inbox types — raw API shapes and request/response options. |
| 3 | + */ |
| 4 | + |
| 5 | +import type { PaginationOptions } from '../../utils/pagination/types'; |
| 6 | + |
| 7 | +/** |
| 8 | + * Priority level assigned to a notification by the publisher. |
| 9 | + */ |
| 10 | +export enum NotificationPriority { |
| 11 | + Low = 'Low', |
| 12 | + Medium = 'Medium', |
| 13 | + High = 'High', |
| 14 | + Critical = 'Critical', |
| 15 | +} |
| 16 | + |
| 17 | +/** |
| 18 | + * Severity classification of a notification topic. |
| 19 | + */ |
| 20 | +export enum NotificationCategory { |
| 21 | + /** Informational — no action required. */ |
| 22 | + Info = 'Info', |
| 23 | + /** Successful operation completed. */ |
| 24 | + Success = 'Success', |
| 25 | + /** Warning — degraded behaviour or non-fatal issue. */ |
| 26 | + Warn = 'Warn', |
| 27 | + /** Error — operation failed but the system continues. */ |
| 28 | + Error = 'Error', |
| 29 | + /** Fatal — unrecoverable failure. */ |
| 30 | + Fatal = 'Fatal', |
| 31 | +} |
| 32 | + |
| 33 | +/** |
| 34 | + * Notification entry as returned by `GET /odata/v1/NotificationEntry`. |
| 35 | + * |
| 36 | + * Field selection: many internal/transport-layer fields (`partitionKey`, `correlationId`, |
| 37 | + * `publicationId`, `messageVersion`, `messageTemplateKey`, `serviceRegistryName`, |
| 38 | + * `entityOrgName`, `entityTenantName`) are returned by the API but dropped from the SDK |
| 39 | + * because they have no use for an application developer. |
| 40 | + */ |
| 41 | +export interface NotificationGetResponse { |
| 42 | + /** Notification GUID. */ |
| 43 | + id: string; |
| 44 | + /** Resolved notification message text. */ |
| 45 | + message: string | null; |
| 46 | + /** Whether the user has read this notification. */ |
| 47 | + hasRead: boolean; |
| 48 | + /** Name of the publisher (e.g. `Orchestrator`, `Actions`). */ |
| 49 | + publisherName: string; |
| 50 | + /** Publisher GUID. */ |
| 51 | + publisherId: string; |
| 52 | + /** Human-readable topic name. */ |
| 53 | + topicName: string; |
| 54 | + /** Stable topic identifier (e.g. `Process.JobExecution.Faulted`). */ |
| 55 | + topicKeyName: string; |
| 56 | + /** Topic GUID. */ |
| 57 | + topicId: string; |
| 58 | + /** GUID of the user this notification belongs to (returned uppercase by the API). */ |
| 59 | + userId: string; |
| 60 | + /** Email of the user. Often `null`. */ |
| 61 | + userEmail: string | null; |
| 62 | + /** Tenant GUID this notification belongs to. Often `null` for org-scoped notifications. */ |
| 63 | + tenantId: string | null; |
| 64 | + /** Notification priority. */ |
| 65 | + priority: NotificationPriority; |
| 66 | + /** Notification severity category. */ |
| 67 | + category: NotificationCategory; |
| 68 | + /** JSON string of template parameters — parse with `JSON.parse()`. May be `null`. */ |
| 69 | + messageParam: string | null; |
| 70 | + /** URL to navigate to when the notification is clicked. */ |
| 71 | + redirectionUrl: string | null; |
| 72 | + /** Unix epoch **seconds** when the notification was published. */ |
| 73 | + publishedOn: number; |
| 74 | +} |
| 75 | + |
| 76 | +/** |
| 77 | + * Options for `Notifications.getAll()`. |
| 78 | + * |
| 79 | + * Supports OData query options (`filter`, `orderby`) and SDK cursor pagination. |
| 80 | + * |
| 81 | + * Notes: |
| 82 | + * - `$select` and `$expand` are not exposed because the API returns 500 on `$select` |
| 83 | + * and there are no expandable relationships on this endpoint. |
| 84 | + */ |
| 85 | +export type NotificationGetAllOptions = PaginationOptions & { |
| 86 | + filter?: string; |
| 87 | + orderby?: string; |
| 88 | +}; |
0 commit comments