/** * This file was auto-generated by openapi-typescript. * Do not make direct changes to the file. */ export interface paths { "/notification/channel": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List notification channels * @description List notification channels by NRN. */ get: operations["notification_channel:list"]; put?: never; /** * Create a notification channel * @description Create a new notification channel. */ post: operations["notification_channel:create"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/notification/channel/{id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Read a notification channel * @description Read a notification channel by its ID. */ get: operations["notification_channel:read"]; put?: never; post?: never; /** * Delete a notification channel * @description Delete a notification channel. This action cannot be undone. */ delete: operations["notification_channel:delete"]; options?: never; head?: never; /** * Update a notification channel * @description Updates a notification channel. */ patch: operations["notification_channel:update"]; trace?: never; }; } export type webhooks = Record; export interface components { schemas: { NotificationChannelCreate: { /** * @description The NRN of the resource (including children resources) where the action will apply. * @example organization=1:account=2:namespace=3:application=4 */ nrn: string; /** * @description The systems that are emitting these notifications. * @example [ * "approval" * ] */ source?: ("approval" | "service" | "audit" | "alert" | "entity")[]; /** * @description The type of notification channel. * @enum {string} */ type: "slack" | "http" | "github" | "gitlab" | "azure"; /** * @description The configuration object for the notification channel. * @example { * "token": "the-slack-token", * "channels": [ * "nullplatform-approvals" * ] * } */ configuration: | components["schemas"]["slack"] | components["schemas"]["http"] | components["schemas"]["github"] | components["schemas"]["gitlab"] | components["schemas"]["azure"]; /** * @description A flexible object that uses MongoDB query syntax to define criteria for filtering notifications. * * > **Note**: See [Notification filters](/docs/notifications/#filters) for more info. * @example { * "action": "deployment:create" * } */ filters?: Record; }; NotificationChannelWrite: { /** * @description The NRN of the resource (including children resources) where the action will apply. * @example organization=1:account=2:namespace=3:application=4 */ nrn?: string; /** * @description The systems that are emitting these notifications. * @example [ * "approval" * ] */ source?: ("approval" | "service" | "audit" | "alert" | "entity")[]; /** * @description The type of notification channel. * @enum {string} */ type?: "slack" | "http" | "github" | "gitlab" | "azure"; /** @description The configuration object for the notification channel. */ configuration?: | components["schemas"]["slack"] | components["schemas"]["http"] | components["schemas"]["github"] | components["schemas"]["gitlab"] | components["schemas"]["azure"]; /** * @description A flexible object that uses MongoDB query syntax to define criteria for filtering notifications. * * > **Note**: See [Notification filters](/docs/notifications/#filters) for more info. * @example { * "action": "deployment:create" * } */ filters?: Record; }; NotificationChannel: { /** * Format: uuid * @description The unique ID for the notification channel. * @example 1180cd02-1c36-4274-8e7a-4483b87e8f2e */ id: string; /** * @description The NRN of the resource (including children resources) where the action will apply. * @example organization=1:account=2:namespace=3:application=4 */ nrn: string; /** * @description The systems that are emitting these notifications. * @example [ * "approval" * ] */ source?: ("approval" | "service" | "audit" | "alert" | "entity")[]; /** @enum {string} */ type: "slack" | "http" | "github" | "gitlab" | "azure"; /** @description The configuration object for the notification channel. */ configuration: | components["schemas"]["slack"] | components["schemas"]["http"] | components["schemas"]["github"] | components["schemas"]["gitlab"] | components["schemas"]["azure"]; /** * @description A flexible object that uses MongoDB query syntax to define criteria for filtering notifications. * * > **Note**: See [Notification filters](/docs/notifications/#filters) for more info. * @example { * "action": "deployment:create" * } */ filters?: Record; }; /** * @example { * "token": "the-slack-token", * "channels": [ * "my-organization-private-channel" * ] * } */ slack: { /** * @description The Slack token. * @example the-slack-token */ token?: string; /** * @description An array of Slack channels. * @example [ * "nullplatform-approvals" * ] */ channels?: string[]; }; /** * @example { * "installation_id": "my-installation-id", * "account": "my-github-org", * "repository": "services-opentofu", * "reference": "main", * "workflow_id": "provisioning.yml" * } */ github: { /** * @description The GitHub installation ID. * @example my-installation-id */ installation_id?: string; /** * @description The GitHub account or organization. * @example my-github-org */ account?: string; /** * @description The GitHub repository. * @example services-opentofu */ repository?: string; /** * @description The reference to the GitHub repository. * @example main */ reference?: string; /** * @description The ID of the GitHub workflow. * @example provisioning.yml */ workflow_id?: string; }; /** * @example { * "reference": "main", * "project_id": "1234" * } */ gitlab: { /** * @description The reference to the GitLab project. This can be the project name or ID. * @example main */ reference?: string; /** * @description The ID of the GitLab project. * @example 1234 */ project_id?: string; }; /** * @example { * "organization": "my-azure-org", * "project": "my-azure-project", * "pipeline_id": 1234, * "reference": "main" * } */ azure: { /** * @description The Azure DevOps organization. * @example my-azure-org */ organization?: string; /** * @description The Azure DevOps project. * @example my-azure-project */ project?: string; /** * @description The ID of the Azure DevOps pipeline. * @example 1234 */ pipeline_id?: number; /** * @description The reference to the Azure DevOps pipeline. * @example main */ reference?: string; }; /** * @example { * "url": "https://yourdomain.com/url-you-configured", * "headers": { * "Authorization": "Bearer the-token" * } * } */ http: { /** * @description The URL where the notifications will be sent. * @example https://my-domain.com/my-notifications-url */ url?: string; /** * @description The headers to be sent with the request. * @example { * "Authorization": "Bearer the-token" * } */ headers?: Record; }; /** * @example { * "source": "approval", * "event": "deployment:create", * "notification": { * "approval_id": 1234, * "approve_url": "https://api.nullplatform.comapproval/1234/approve?token=the-token", * "deny_url": "https://api.nullplatform.comapproval/1234/deny?token=the-token", * "requested_by": { * "user_id": 4321, * "email": "mr.dev@mycompany.com", * "first_name": "John", * "last_name": "Doe", * "avatar": null * }, * "action": "deployment:create", * "details": { * "deployment": {}, * "scope": {}, * "release": {}, * "build": {}, * "application": {}, * "namespace": {}, * "account": {}, * "organization": {} * } * } * } */ "notification:push": { /** * Format: uuid * @description A system-wide unique ID for the notification. * @example 1180cd02-1c36-4274-8e7a-4483b87e8f2e */ id: string; /** * @description The systems that are emitting these notifications. * @example [ * "approval" * ] */ source: ("approval" | "service" | "audit" | "alert" | "entity")[]; /** * @description The name of the event originated by the source, for example `deployment:create`. * @example deployment:create */ event: string; /** * Format: date-time * @description The ISO 8601 UTC timestamp for this notification. * @example 2024-02-19T12:34:56Z */ created_at: string; /** @description An object containing the notification details. The content depends on the `source` field of this notification. */ notification: Record; }; /** @enum {string} */ ChannelType: "slack" | "http"; ChannelList: { paging?: { /** @description The start of the paging window. Minimum is 0. */ offset?: number; /** @description Maximum number of elements to retrieve per call. Maximum is 200. */ limit?: number; /** @description Total number of elements that can be retrieved. */ total?: number; }; results?: components["schemas"]["NotificationChannel"][]; }; }; responses: { /** @description Client error responses due to invalid input or missing parameters. */ "4XX": { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description HTTP status code representing the specific client error (e.g., 400, 401, 403, 404). * @example 400 */ statusCode: number; /** * @description A machine-readable error code that categorizes the server failure. * @example bad_request */ code?: string; /** * @description A brief, human-readable description of the error type (e.g., "Bad Request", "Unauthorized"). * @example Bad Request */ error: string; /** * @description Additional details about the error. * @example The request was malformed or contained invalid parameters. */ message: string; }; }; }; /** @description Server error responses indicating an issue on the API side. */ "5XX": { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description HTTP status code representing the specific server error (e.g., 500, 502, 503). * @example 500 */ statusCode: number; /** * @description A machine-readable error code that categorizes the server failure. * @example internal_server_error */ code?: string; /** * @description A brief, human-readable description of the error type (e.g., "Internal Server Error", "Service Unavailable"). * @example Internal Server Error */ error: string; /** * @description Additional details about the error. * @example An unexpected error occurred. Please try again later. */ message: string; }; }; }; }; parameters: never; requestBodies: never; headers: never; pathItems: never; } export type $defs = Record; export interface operations { "notification_channel:list": { parameters: { query: { /** * @description The resource (application, scope, etc.) under which the channel has been created. Format: organization=1:account=2:namespace=3:application=4:scope=5 (trailing levels optional). Read one from an entity's nrn field, e.g. 'np application read --id --query .nrn'. * @example organization=1:account=2:namespace=4:application=4:scope=5 */ nrn: string; /** * @description The channel type (github, gitlab, http, slack, azure, agent, entity). * @example slack */ type?: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description The operation was successful. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ChannelList"]; }; }; "4XX": components["responses"]["4XX"]; "5XX": components["responses"]["5XX"]; }; }; "notification_channel:create": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["NotificationChannelCreate"]; }; }; responses: { /** @description The operation was successful. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["NotificationChannel"]; }; }; "4XX": components["responses"]["4XX"]; "5XX": components["responses"]["5XX"]; }; }; "notification_channel:read": { parameters: { query?: never; header?: never; path: { /** * @description The ID of the notification channel to read. * @example 123 */ id: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description The operation was successful. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["NotificationChannel"]; }; }; "4XX": components["responses"]["4XX"]; "5XX": components["responses"]["5XX"]; }; }; "notification_channel:delete": { parameters: { query?: never; header?: never; path: { /** * @description The ID of the channel to delete. * @example 234 */ id: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description The deletion was successful. */ 204: { headers: { [name: string]: unknown; }; content?: never; }; "4XX": components["responses"]["4XX"]; "5XX": components["responses"]["5XX"]; }; }; "notification_channel:update": { parameters: { query?: never; header?: never; path: { /** * @description The ID of the channel to update. * @example 234 */ id: string; }; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["NotificationChannelWrite"]; }; }; responses: { /** @description The operation was successful. */ 204: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["NotificationChannel"]; }; }; "4XX": components["responses"]["4XX"]; "5XX": components["responses"]["5XX"]; }; }; }