diff --git a/api/client/web/src/client/openapi.ts b/api/client/web/src/client/openapi.ts index 44d0ac734..1c5d33d9d 100644 --- a/api/client/web/src/client/openapi.ts +++ b/api/client/web/src/client/openapi.ts @@ -350,6 +350,11 @@ export interface paths { * @description List all notification events. */ get: operations['listNotificationEvents'] + /** + * Create a notification event + * @description Create a new notification event. + */ + post: operations['createNotificationEvent'] } '/api/v1/notification/events/{eventId}': { /** @@ -358,6 +363,13 @@ export interface paths { */ get: operations['getNotificationEvent'] } + '/api/v1/notification/webhook/svix': { + /** + * Receive Svix operational events + * @description Callback endpoint used by Svix to notify about operational events + */ + post: operations['receiveSvixOperationalEvent'] + } } export type webhooks = Record @@ -1689,6 +1701,13 @@ export interface components { */ disabled: boolean } + /** @description Request for creating new notification event with specific type and payload. */ + NotificationEventCreateRequest: { + type: components['schemas']['NotificationEventType'] + payload: components['schemas']['NotificationEventPayload'] + /** @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0 */ + ruleId: string + } /** * @description Notification event generated by the system based on the criteria defined in the corresponding * a notification rule. @@ -1701,6 +1720,7 @@ export interface components { * @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0 */ id: string + type: components['schemas']['NotificationEventType'] /** * Format: date-time * @description Timestamp when the notification event was created. @@ -1738,14 +1758,16 @@ export interface components { entitlement: components['schemas']['EntitlementMetered'] feature: components['schemas']['Feature'] subject: components['schemas']['Subject'] - balance: components['schemas']['EntitlementValue'] + value: components['schemas']['EntitlementValue'] threshold: components['schemas']['NotificationRuleBalanceThresholdValue'] } } NotificationEventDeliveryStatus: { channel: components['schemas']['NotificationChannelMeta'] /** @enum {string} */ - state: 'SUCCESS' | 'FAILED' | 'SENDING' + state: 'SUCCESS' | 'FAILED' | 'SENDING' | 'PENDING' + /** @example Failed to dispatch event */ + reason?: string /** * Format: date-time * @example 2023-01-01T00:00:00Z @@ -1772,6 +1794,20 @@ export interface components { pageSize: number items: components['schemas']['NotificationEvents'] } + SvixOperationalWebhookRequest: { + /** @enum {string} */ + type: + | 'endpoint.created' + | 'endpoint.deleted' + | 'endpoint.disabled' + | 'endpoint.updated' + | 'message.attempt.exhausted' + | 'message.attempt.failing' + | 'message.attempt.recovered' + data: { + [key: string]: unknown + } + } } responses: { /** @description Conflict */ @@ -3134,6 +3170,31 @@ export interface operations { default: components['responses']['UnexpectedProblemResponse'] } } + /** + * Create a notification event + * @description Create a new notification event. + */ + createNotificationEvent: { + /** @description The notification event to create. */ + requestBody: { + content: { + 'application/json': components['schemas']['NotificationEventCreateRequest'] + } + } + responses: { + /** @description Notification event created. */ + 201: { + content: { + 'application/json': components['schemas']['NotificationEvent'] + } + } + 400: components['responses']['BadRequestProblemResponse'] + 401: components['responses']['UnauthorizedProblemResponse'] + 409: components['responses']['ConflictProblemResponse'] + 501: components['responses']['NotImplementedProblemResponse'] + default: components['responses']['UnexpectedProblemResponse'] + } + } /** * Get notification event * @description Get a notification event by id. @@ -3156,4 +3217,26 @@ export interface operations { default: components['responses']['UnexpectedProblemResponse'] } } + /** + * Receive Svix operational events + * @description Callback endpoint used by Svix to notify about operational events + */ + receiveSvixOperationalEvent: { + /** @description The operational event. */ + requestBody: { + content: { + 'application/json': components['schemas']['SvixOperationalWebhookRequest'] + } + } + responses: { + /** @description Operational webhook request accepted */ + 204: { + content: never + } + 400: components['responses']['BadRequestProblemResponse'] + 401: components['responses']['UnauthorizedProblemResponse'] + 501: components['responses']['NotImplementedProblemResponse'] + default: components['responses']['UnexpectedProblemResponse'] + } + } }