/** * This file was auto-generated by openapi-typescript. * Do not make direct changes to the file. */ export interface paths { "/entity_hook/action": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List entity hook actions * @description Lists entity hook actions within an organization. */ get: operations["entity_hook_action:list"]; put?: never; /** * Create an entity hook action * @description Create an action for an entity hook. */ post: operations["entity_hook_action:create"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/entity_hook/action/find": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Find entity hook actions matching a request * @description Returns the entity hook actions that apply to a given NRN, action, dimensions, and an optional `request_body`. * For each matching hook, the API runs a dry-run notification with `context.request_body` set to the supplied payload; hooks whose dry-run finds no channel willing to deliver are excluded from the response. */ post: operations["entity_hook_action:find"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/entity_hook/action/{id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Read an entity hook action * @description Read an entity hook action. */ get: operations["entity_hook_action:read"]; put?: never; post?: never; /** * Delete an entity hook action * @description Delete an entity hook action. */ delete: operations["entity_hook_action:delete"]; options?: never; head?: never; /** * Update an entity hook action * @description Updates an entity hook action. */ patch: operations["entity_hook_action:update"]; trace?: never; }; } export type webhooks = Record; export interface components { schemas: { entityHookListResponse: { paging: { /** * @description The starting point for pagination. Defaults to 0 if not provided. * @example 0 */ offset: number; /** * @description The maximum number of results to return per page. The maximum allowed value is 200. * @example 200 */ limit: number; }; results: components["schemas"]["entityHook"][]; }; entityHook: { /** * @description The unique identifier of the entity hook. * @example 550e8400-e29b-41d4-a716-446655440000 */ id: Record; /** * @description A resource identifier (NRN) specifying where this action applies. * @example organization=1:account=2:namespace=3:application=4 */ nrn: string; /** * @description The type of entity affected by this entity hook action. * @example scope * @enum {string} */ entity: "application" | "scope" | "deployment"; /** * @description The specific action you want to be notified about. * @example scope:create * @enum {string} */ action: | "deployment:create" | "deployment:write" | "deployment:delete" | "scope:create" | "scope:write" | "scope:delete" | "application:create" | "application:write" | "application:delete"; /** * @description Key-value pairs defining the scope of the action. * @example { * "environment": "production", * "country": "us" * } */ dimensions?: Record; /** * @description The action to be taken on the entity hook success. * * > **Note:** Currently, only "manual" is supported. * @example manual * @enum {string} */ on_policy_success: "manual"; /** * @description The action to be taken on entity hook failure." * * > **Note:** Currently, only "manual" is supported. * @example manual * @enum {string} */ on_policy_fail: "manual"; /** * @description Specifies whether the hook occurs before or after nullplatform's internal logic. * * > **Note:** Currently, only "before" is supported. * @example before * @enum {string} */ when: "before"; /** * @description The type of entity hook action. * * > **Note:** Currently, only "hook" is supported. * @example hook * @enum {string} */ type: "hook"; /** * @description Specifies the type of action that triggers the hook. * @example create * @enum {string} */ on: "create, update, delete"; /** * @description The policies applied to the entity. * * > ℹ️ If no policies are found, we return an empty array. */ policies?: { /** * @description A unique identifier for the policy. * @example 5678 */ id?: number; /** * @description A resource identifier (NRN) specifying where the policy applies. * @example organization=1:account=2:namespace=3:application=4 */ nrn?: string; /** * @description The name of the policy. * @example Crypto Kong Policies */ name?: string; /** * @description A JSON object defining the conditions under which this policy applies. * @example { * "scope.requested_spec.memory_in_gb": { * "$lte": 4 * } * } */ conditions?: Record; }[]; }; /** @description Body for the `find` endpoint. nullplatform looks up hook actions matching nrn/action/dimensions, then dry-runs a notification per hook with `request_body` inside the context. Only hooks whose dry-run resolves to at least one matching channel are returned. */ "entityHook:find": { /** * @description A resource identifier (NRN) specifying where this action applies. * @example organization=1:account=2:namespace=3:application=4 */ nrn: string; /** * @description The specific action being performed on the entity. * @example deployment:update */ action: string; /** * @description Optional user identifier of the principal performing the action. * @example 123 */ user_id?: number; /** * @description Key-value pairs defining the scope of the action. * @example { * "environment": "production", * "country": "us" * } */ dimensions?: Record; /** * @description Filters hooks that fire on this lifecycle event. Typically derived from the action verb. * @example update * @enum {string} */ on?: "create, update, delete"; /** * @description The payload of the originating request. Forwarded inside `context.request_body` of the dry-run notification per hook so that notification channels with `filters` can decide whether to deliver. Omit to discover hooks without channel-side filtering. * @example { * "status": "finalized", * "traffic_percentage": 100 * } */ request_body?: Record; }; "entityHook:create": { /** * @description A resource identifier (NRN) specifying where this action applies. * @example organization=1:account=2:namespace=3:application=4 */ nrn: string; /** * @description The type of entity affected by this entity hook action. * @example scope * @enum {string} */ entity: "application" | "scope" | "deployment"; /** * @description The specific action you want to be notified about. * @example scope:create * @enum {string} */ action: | "deployment:create" | "deployment:write" | "deployment:delete" | "scope:create" | "scope:write" | "scope:delete" | "application:create" | "application:write" | "application:delete"; /** * @description Key-value pairs defining the scope of the action. * @example { * "environment": "production", * "country": "us" * } */ dimensions?: Record; /** * @description Specifies whether the hook occurs before or after nullplatform's internal logic. * * > **Note:** Currently, only "before" is supported. * @example before * @enum {string} */ when: "before"; /** * @description The type of entity hook action. * * > **Note:** Currently, only "hook" is supported. * @example hook * @enum {string} */ type: "hook"; /** * @description Specifies the type of action that triggers the hook. * @example create * @enum {string} */ on: "create, update, delete"; }; "entityHook:write": { /** * @description Specifies whether the hook occurs before or after nullplatform's internal logic. * * > **Note:** Currently, only "before" is supported. * @example before * @enum {string} */ when?: "before"; /** * @description The type of entity hook action. * * > **Note:** Currently, only "hook" is supported. * @example hook * @enum {string} */ type?: "hook"; /** * @description Specifies the type of action that triggers the hook. * @example create * @enum {string} */ on?: "create, update, delete"; }; }; responses: never; parameters: never; requestBodies: never; headers: never; pathItems: never; } export type $defs = Record; export interface operations { "entity_hook_action:list": { parameters: { query: { /** * @description Filters actions that match or are more specific than the provided NRN. 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=3 */ nrn: string; /** * @description The type of entity affected by this entity hook action. * @example scope */ entity?: string; /** * @description Specifies the type of action that triggers the hook. * @example create * @enum {unknown} */ on?: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description The list of entity hooks matching the query. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["entityHookListResponse"]; }; }; }; }; "entity_hook_action:create": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["entityHook:create"]; }; }; responses: { /** @description The action was triggered successfully. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["entityHook"]; }; }; }; }; "entity_hook_action:find": { parameters: { query?: { /** * @description Pagination offset. Defaults to 0. * @example 0 */ offset?: number; /** * @description Pagination limit. Defaults to 30. * @example 30 */ limit?: number; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["entityHook:find"]; }; }; responses: { /** @description The list of entity hook actions that apply to the given context. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["entityHookListResponse"]; }; }; }; }; "entity_hook_action:read": { parameters: { query?: never; header?: never; path: { /** * @description The ID of the entity hook action to delete. * @example 550e8400-e29b-41d4-a716-446655440000 */ id: Record; }; cookie?: never; }; requestBody?: never; responses: { /** @description The entity hook action was found. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["entityHook"]; }; }; }; }; "entity_hook_action:delete": { parameters: { query?: never; header?: never; path: { /** * @description The ID of the entity hook action to delete. * @example 550e8400-e29b-41d4-a716-446655440000 */ id: Record; }; cookie?: never; }; requestBody?: never; responses: { /** @description The entity hook action was deleted. */ 200: { headers: { [name: string]: unknown; }; content?: never; }; }; }; "entity_hook_action:update": { parameters: { query?: never; header?: never; path: { /** * @description The ID of the entity hook action to delete. * @example 550e8400-e29b-41d4-a716-446655440000 */ id: Record; }; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["entityHook:write"]; }; }; responses: { /** @description The entity hook action was updated. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["entityHook"]; }; }; }; }; }