/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 6b84d8cb3738 */ import { operationsApproveAccessRequest } from "../funcs/operationsApproveAccessRequest.js"; import { operationsCreateAccessRequest } from "../funcs/operationsCreateAccessRequest.js"; import { operationsCreateBundleUploadUrl } from "../funcs/operationsCreateBundleUploadUrl.js"; import { operationsDenyAccessRequest } from "../funcs/operationsDenyAccessRequest.js"; import { operationsGetAccessRequest } from "../funcs/operationsGetAccessRequest.js"; import { operationsGetAccessRequestCoordinates } from "../funcs/operationsGetAccessRequestCoordinates.js"; import { operationsGetPolicy } from "../funcs/operationsGetPolicy.js"; import { operationsInvoke } from "../funcs/operationsInvoke.js"; import { operationsListAccessRequests } from "../funcs/operationsListAccessRequests.js"; import { operationsListPlugins } from "../funcs/operationsListPlugins.js"; import { operationsPublishPlugin } from "../funcs/operationsPublishPlugin.js"; import { operationsQueueAccessRequest } from "../funcs/operationsQueueAccessRequest.js"; import { operationsSetBuiltinPlugins } from "../funcs/operationsSetBuiltinPlugins.js"; import { operationsSetPluginEnabled } from "../funcs/operationsSetPluginEnabled.js"; import { operationsUpdatePolicy } from "../funcs/operationsUpdatePolicy.js"; import { operationsVerifyCheck } from "../funcs/operationsVerifyCheck.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as models from "../models/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Operations extends ClientSDK { /** * List available operations plugins (builtin + custom) for a project, with their operations and risk tiers. */ async listPlugins( request: operations.ListOperationsPluginsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(operationsListPlugins( this, request, options, )); } /** * Register a custom operations plugin whose bundle ZIP has already been uploaded to S3 (see POST /plugins/upload-url). Replaces any existing plugin of the same name in that project. New custom plugins are enabled by default. */ async publishPlugin( request: operations.PublishOperationsPluginRequest, options?: RequestOptions, ): Promise { return unwrapAsync(operationsPublishPlugin( this, request, options, )); } /** * Replace the complete set of enabled built-in operations plugins for a project. */ async setBuiltinPlugins( request: operations.SetBuiltinOperationsPluginsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(operationsSetBuiltinPlugins( this, request, options, )); } /** * Get a presigned S3 URL to upload a custom operations plugin bundle ZIP. Upload the ZIP with a PUT to the returned url (sending the given Content-Type), then call POST /plugins to register it. */ async createBundleUploadUrl( request: operations.CreateOperationsBundleUploadUrlRequest, options?: RequestOptions, ): Promise { return unwrapAsync(operationsCreateBundleUploadUrl( this, request, options, )); } /** * Enable or disable an operations plugin (builtin or custom) for a project. Only enabled plugins are baked into the operator image and can be invoked. */ async setPluginEnabled( request: operations.SetOperationsPluginEnabledRequest, options?: RequestOptions, ): Promise { return unwrapAsync(operationsSetPluginEnabled( this, request, options, )); } /** * Get a project's per-command approval policy. Mirrors what the operator enforces: `plugin/operation` / `plugin/*` / `*` patterns → auto | manual. */ async getPolicy( request: operations.GetOperationsPolicyRequest, options?: RequestOptions, ): Promise { return unwrapAsync(operationsGetPolicy( this, request, options, )); } /** * Replace a project's per-command approval policy (full rule set). Patterns are `plugin/operation`, `plugin/*`, or `*`; each maps to auto | manual. */ async updatePolicy( request: operations.UpdateOperationsPolicyRequest, options?: RequestOptions, ): Promise { return unwrapAsync(operationsUpdatePolicy( this, request, options, )); } /** * Invoke a plugin operation against a deployment. Honors the project's per-command approval policy. */ async invoke( request: operations.InvokeOperationRequest, options?: RequestOptions, ): Promise { return unwrapAsync(operationsInvoke( this, request, options, )); } /** * One verification poll cycle for an original operation command. Loads that command's authoritative stored result and dispatch-time verification contract, dispatches the frozen read-only poll operation once, and evaluates its frozen success condition. Callers poll this repeatedly per the returned policy. */ async verifyCheck( request: operations.VerifyOperationCheckRequest, options?: RequestOptions, ): Promise { return unwrapAsync(operationsVerifyCheck( this, request, options, )); } /** * Create an access request — either plan-backed (an ai-agent investigation's exact commands) or plan-less (a CLI-originated exact operation or wildcard pattern, resolved and frozen here). Plan-backed requests await the engineer gate (status `pending-approval`); plan-less requests are queued immediately since the requester is asking for their own access (status `queued`). */ async createAccessRequest( request?: models.CreateAccessRequest | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(operationsCreateAccessRequest( this, request, options, )); } /** * List a project's access requests, newest first. */ async listAccessRequests( request: operations.ListAccessRequestsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(operationsListAccessRequests( this, request, options, )); } /** * Engineer gate — approve a pending access request, queuing it for the operator to materialize. Records who queued it. */ async queueAccessRequest( request: operations.QueueAccessRequestRequest, options?: RequestOptions, ): Promise { return unwrapAsync(operationsQueueAccessRequest( this, request, options, )); } /** * Customer gate — an authenticated workspace member or administrator other than the requester may approve a queued access request. Actor identity comes from authentication; method/source are audit context only. */ async approveAccessRequest( request: operations.ApproveAccessRequestRequest, options?: RequestOptions, ): Promise { return unwrapAsync(operationsApproveAccessRequest( this, request, options, )); } /** * Customer gate — an authenticated workspace member or administrator other than the requester may reject a queued access request. Actor identity comes from authentication. */ async denyAccessRequest( request: operations.DenyAccessRequestRequest, options?: RequestOptions, ): Promise { return unwrapAsync(operationsDenyAccessRequest( this, request, options, )); } /** * The customer's kubectl approve command for a queued access request, or null until the operator has materialized the grant CR and reported its coordinates. Polled by the Slack handler to update the access-plan card. */ async getAccessRequestCoordinates( request: operations.GetAccessRequestCoordinatesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(operationsGetAccessRequestCoordinates( this, request, options, )); } /** * Get an access request by id. */ async getAccessRequest( request: operations.GetAccessRequestRequest, options?: RequestOptions, ): Promise { return unwrapAsync(operationsGetAccessRequest( this, request, options, )); } }