diff --git a/apps/webservice/src/app/api/v1/job-agents/[agentId]/jobs/running/route.ts b/apps/webservice/src/app/api/v1/job-agents/[agentId]/jobs/running/route.ts index 1b2db59c..6c0105b7 100644 --- a/apps/webservice/src/app/api/v1/job-agents/[agentId]/jobs/running/route.ts +++ b/apps/webservice/src/app/api/v1/job-agents/[agentId]/jobs/running/route.ts @@ -1,5 +1,7 @@ import type { NextRequest } from "next/server"; import { NextResponse } from "next/server"; +import _ from "lodash"; +import { isPresent } from "ts-is-present"; import { and, eq, isNull, notInArray } from "@ctrlplane/db"; import { db } from "@ctrlplane/db/client"; @@ -9,6 +11,7 @@ import { job, release, releaseJobTrigger, + releaseMetadata, resource, } from "@ctrlplane/db/schema"; @@ -29,6 +32,7 @@ export const GET = async ( .leftJoin(environment, eq(environment.id, releaseJobTrigger.environmentId)) .leftJoin(resource, eq(resource.id, releaseJobTrigger.resourceId)) .leftJoin(release, eq(release.id, releaseJobTrigger.releaseId)) + .leftJoin(releaseMetadata, eq(releaseMetadata.releaseId, release.id)) .leftJoin(deployment, eq(deployment.id, release.deploymentId)) .where( and( @@ -44,14 +48,25 @@ export const GET = async ( ), ) .then((rows) => - rows.map((row) => ({ - ...row.job, - config: row.release_job_trigger, - environment: row.environment, - target: row.resource, - deployment: row.deployment, - release: row.release, - })), + _.chain(rows) + .groupBy((row) => row.job.id) + .map((jobRows) => ({ + ...jobRows[0]!.job, + config: jobRows[0]!.release_job_trigger, + environment: jobRows[0]!.environment, + target: jobRows[0]!.resource, + deployment: jobRows[0]!.deployment, + release: + jobRows[0]!.release != null + ? { + ...jobRows[0]!.release, + metadata: jobRows + .map((r) => r.release_metadata) + .filter(isPresent), + } + : null, + })) + .value(), ); return NextResponse.json(je); diff --git a/apps/webservice/src/app/api/v1/jobs/[jobId]/route.ts b/apps/webservice/src/app/api/v1/jobs/[jobId]/route.ts index 7d68be6e..cc3b0724 100644 --- a/apps/webservice/src/app/api/v1/jobs/[jobId]/route.ts +++ b/apps/webservice/src/app/api/v1/jobs/[jobId]/route.ts @@ -1,5 +1,6 @@ import type { NextRequest } from "next/server"; import { NextResponse } from "next/server"; +import { isPresent } from "ts-is-present"; import { and, eq, isNull, takeFirstOrNull } from "@ctrlplane/db"; import { db } from "@ctrlplane/db/client"; @@ -58,7 +59,7 @@ export const GET = request() }), ) .handle(async ({ db }, { params }) => { - const row = await db + const rows = await db .select() .from(schema.job) .leftJoin( @@ -85,14 +86,19 @@ export const GET = request() schema.release, eq(schema.releaseJobTrigger.releaseId, schema.release.id), ) + .leftJoin( + schema.releaseMetadata, + eq(schema.release.id, schema.releaseMetadata.releaseId), + ) .leftJoin( schema.deployment, eq(schema.release.deploymentId, schema.deployment.id), ) .where( and(eq(schema.job.id, params.jobId), isNull(schema.resource.deletedAt)), - ) - .then(takeFirstOrNull); + ); + + const row = rows.at(0); if (row == null) return NextResponse.json( @@ -100,13 +106,21 @@ export const GET = request() { status: 404 }, ); + const release = + row.release != null + ? { + ...row.release, + metadata: rows.map((r) => r.release_metadata).filter(isPresent), + } + : null; + const je = { job: row.job, runbook: row.runbook, environment: row.environment, resource: row.resource, deployment: row.deployment, - release: row.release, + release, }; const policyId = je.environment?.policyId; diff --git a/openapi.v1.json b/openapi.v1.json index b757a4d7..9d0ec2ab 100644 --- a/openapi.v1.json +++ b/openapi.v1.json @@ -2355,6 +2355,10 @@ "type": "object", "additionalProperties": true }, + "metadata": { + "type": "object", + "additionalProperties": { "type": "string" } + }, "deploymentId": { "type": "string", "format": "uuid" @@ -2369,6 +2373,7 @@ "name", "version", "config", + "metadata", "deploymentId", "createdAt" ] diff --git a/packages/node-sdk/src/schema.ts b/packages/node-sdk/src/schema.ts index fc12ecb3..43094ea1 100644 --- a/packages/node-sdk/src/schema.ts +++ b/packages/node-sdk/src/schema.ts @@ -4,1844 +4,1857 @@ */ export interface paths { - "/v1/deployments/{deploymentId}/release-channels/name/{name}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** Delete a release channel */ - delete: operations["deleteReleaseChannel"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/environments/{environmentId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get an environment */ - get: operations["getEnvironment"]; - put?: never; - post?: never; - /** Delete an environment */ - delete: operations["deleteEnvironment"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/environments": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create an environment */ - post: operations["createEnvironment"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/job-agents/{agentId}/jobs/running": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get a agents running jobs */ - get: operations["getAgentRunningJob"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/job-agents/{agentId}/queue/acknowledge": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Acknowledge a job for an agent - * @description Marks a job as acknowledged by the agent - */ - post: operations["acknowledgeAgentJob"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/job-agents/{agentId}/queue/next": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get the next jobs */ - get: operations["getNextJobs"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/job-agents/name": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** Upserts the agent */ - patch: operations["updateJobAgent"]; - trace?: never; - }; - "/v1/jobs/{jobId}/acknowledge": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Acknowledge a job */ - post: operations["acknowledgeJob"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/jobs/{jobId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get a Job */ - get: operations["getJob"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** Update a job */ - patch: operations["updateJob"]; - trace?: never; - }; - "/v1/relationship/job-to-resource": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create a relationship between a job and a resource */ - post: operations["createJobToResourceRelationship"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/relationship/resource-to-resource": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create a relationship between two resources */ - post: operations["createResourceToResourceRelationship"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/release-channels": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create a release channel */ - post: operations["createReleaseChannel"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/releases": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Creates a release */ - post: operations["createRelease"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/resource-providers/{providerId}/set": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** Sets the resource for a provider. */ - patch: operations["setResourceProvidersResources"]; - trace?: never; - }; - "/v1/resources/{resourceId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get a resource */ - get: operations["getResource"]; - put?: never; - post?: never; - /** Delete a resource */ - delete: operations["deleteResource"]; - options?: never; - head?: never; - /** Update a resource */ - patch: operations["updateResource"]; - trace?: never; - }; - "/v1/resources": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create or update multiple resources */ - post: operations["upsertResources"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/systems/{systemId}/environments/{name}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** Delete an environment */ - delete: operations["deleteEnvironmentByName"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/systems/{systemId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get a system */ - get: operations["getSystem"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/workspaces/{workspaceId}/resource-providers/name/{name}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Upserts a resource provider. */ - get: operations["upsertResourceProvider"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/workspaces/{workspaceId}/resources/identifier/{identifier}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get a resource by identifier */ - get: operations["getResourceByIdentifier"]; - put?: never; - post?: never; - /** Delete a resource by identifier */ - delete: operations["deleteResourceByIdentifier"]; - options?: never; - head?: never; - patch?: never; - trace?: never; + "/v1/deployments/{deploymentId}/release-channels/name/{name}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; + get?: never; + put?: never; + post?: never; + /** Delete a release channel */ + delete: operations["deleteReleaseChannel"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/environments/{environmentId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get an environment */ + get: operations["getEnvironment"]; + put?: never; + post?: never; + /** Delete an environment */ + delete: operations["deleteEnvironment"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/environments": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create an environment */ + post: operations["createEnvironment"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/job-agents/{agentId}/jobs/running": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a agents running jobs */ + get: operations["getAgentRunningJob"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/job-agents/{agentId}/queue/acknowledge": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Acknowledge a job for an agent + * @description Marks a job as acknowledged by the agent + */ + post: operations["acknowledgeAgentJob"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/job-agents/{agentId}/queue/next": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the next jobs */ + get: operations["getNextJobs"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/job-agents/name": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** Upserts the agent */ + patch: operations["updateJobAgent"]; + trace?: never; + }; + "/v1/jobs/{jobId}/acknowledge": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Acknowledge a job */ + post: operations["acknowledgeJob"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/jobs/{jobId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a Job */ + get: operations["getJob"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** Update a job */ + patch: operations["updateJob"]; + trace?: never; + }; + "/v1/relationship/job-to-resource": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create a relationship between a job and a resource */ + post: operations["createJobToResourceRelationship"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/relationship/resource-to-resource": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create a relationship between two resources */ + post: operations["createResourceToResourceRelationship"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/release-channels": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create a release channel */ + post: operations["createReleaseChannel"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/releases": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Creates a release */ + post: operations["createRelease"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/resource-providers/{providerId}/set": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** Sets the resource for a provider. */ + patch: operations["setResourceProvidersResources"]; + trace?: never; + }; + "/v1/resources/{resourceId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a resource */ + get: operations["getResource"]; + put?: never; + post?: never; + /** Delete a resource */ + delete: operations["deleteResource"]; + options?: never; + head?: never; + /** Update a resource */ + patch: operations["updateResource"]; + trace?: never; + }; + "/v1/resources": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create or update multiple resources */ + post: operations["upsertResources"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/systems/{systemId}/environments/{name}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** Delete an environment */ + delete: operations["deleteEnvironmentByName"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/systems/{systemId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a system */ + get: operations["getSystem"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/{workspaceId}/resource-providers/name/{name}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Upserts a resource provider. */ + get: operations["upsertResourceProvider"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/{workspaceId}/resources/identifier/{identifier}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a resource by identifier */ + get: operations["getResourceByIdentifier"]; + put?: never; + post?: never; + /** Delete a resource by identifier */ + delete: operations["deleteResourceByIdentifier"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; } export type webhooks = Record; export interface components { - schemas: { - Deployment: { - /** Format: uuid */ + schemas: { + Deployment: { + /** Format: uuid */ + id: string; + name: string; + slug: string; + description: string; + /** Format: uuid */ + systemId: string; + /** Format: uuid */ + jobAgentId?: string | null; + jobAgentConfig: { + [key: string]: unknown; + }; + }; + Release: { + /** Format: uuid */ + id: string; + name: string; + version: string; + config: { + [key: string]: unknown; + }; + metadata: { + [key: string]: string; + }; + /** Format: uuid */ + deploymentId: string; + /** Format: date-time */ + createdAt: string; + }; + Environment: { + /** Format: uuid */ + id: string; + /** Format: uuid */ + systemId: string; + name: string; + description?: string; + /** Format: uuid */ + policyId?: string | null; + resourceFilter?: { + [key: string]: unknown; + } | null; + /** Format: date-time */ + createdAt: string; + /** Format: date-time */ + expiresAt?: string | null; + }; + Runbook: { + /** Format: uuid */ + id: string; + name: string; + /** Format: uuid */ + systemId: string; + /** Format: uuid */ + jobAgentId: string; + }; + Resource: { + /** Format: uuid */ + id: string; + name: string; + version: string; + kind: string; + identifier: string; + config: { + [key: string]: unknown; + }; + metadata: { + [key: string]: unknown; + }; + /** Format: date-time */ + createdAt: string; + /** Format: date-time */ + updatedAt: string; + /** Format: uuid */ + workspaceId: string; + }; + Job: { + /** Format: uuid */ + id: string; + /** @enum {string} */ + status: + | "completed" + | "cancelled" + | "skipped" + | "in_progress" + | "action_required" + | "pending" + | "failure" + | "invalid_job_agent" + | "invalid_integration" + | "external_run_not_found"; + /** @description External job identifier (e.g. GitHub workflow run ID) */ + externalId?: string | null; + /** Format: date-time */ + createdAt: string; + /** Format: date-time */ + updatedAt: string; + /** Format: uuid */ + jobAgentId?: string; + /** @description Configuration for the Job Agent */ + jobAgentConfig: { + [key: string]: unknown; + }; + message?: string; + reason?: string; + }; + Variable: { + key: string; + value: string | number | boolean; + sensitive?: boolean; + }; + }; + responses: never; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; +} +export type $defs = Record; +export interface operations { + deleteReleaseChannel: { + parameters: { + query?: never; + header?: never; + path: { + deploymentId: string; + name: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Release channel deleted */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + message: string; + }; + }; + }; + /** @description Permission denied */ + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description Release channel not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description Failed to delete release channel */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; + }; + getEnvironment: { + parameters: { + query?: never; + header?: never; + path: { + /** @description UUID of the environment */ + environmentId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successful response */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { id: string; - name: string; - slug: string; - description: string; - /** Format: uuid */ systemId: string; - /** Format: uuid */ - jobAgentId?: string | null; - jobAgentConfig: { - [key: string]: unknown; - }; - }; - Release: { - /** Format: uuid */ - id: string; name: string; - version: string; - config: { - [key: string]: unknown; + description?: string | null; + resourceFilter?: { + [key: string]: unknown; }; - /** Format: uuid */ - deploymentId: string; + policyId?: string | null; + /** Format: date-time */ + expiresAt?: string; /** Format: date-time */ createdAt: string; + releaseChannels: { + id?: string; + deploymentId?: string; + channelId?: string; + environmentId?: string; + }[]; + policy?: { + systemId?: string; + name?: string; + description?: string | null; + id?: string; + /** @enum {string} */ + approvalRequirement?: "manual" | "automatic"; + /** @enum {string} */ + successType?: "some" | "all" | "optional"; + successMinimum?: number; + /** @enum {string} */ + concurrencyType?: "some" | "all"; + concurrencyLimit?: number; + rolloutDuration?: number; + /** @enum {string} */ + releaseSequencing?: "wait" | "cancel"; + } | null; + }; + }; + }; + /** @description Environment not found */ + 404: { + headers: { + [name: string]: unknown; }; - Environment: { - /** Format: uuid */ + content: { + "application/json": { + /** @example Environment not found */ + error: string; + }; + }; + }; + }; + }; + deleteEnvironment: { + parameters: { + query?: never; + header?: never; + path: { + /** @description UUID of the environment */ + environmentId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Environment deleted successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + createEnvironment: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + systemId: string; + name: string; + description?: string; + resourceFilter?: { + [key: string]: unknown; + }; + policyId?: string; + releaseChannels?: string[]; + /** Format: date-time */ + expiresAt?: string; + }; + }; + }; + responses: { + /** @description Environment created successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { id: string; - /** Format: uuid */ systemId: string; name: string; - description?: string; - /** Format: uuid */ - policyId?: string | null; - resourceFilter?: { - [key: string]: unknown; - } | null; - /** Format: date-time */ - createdAt: string; + description?: string | null; /** Format: date-time */ expiresAt?: string | null; - }; - Runbook: { - /** Format: uuid */ + resourceFilter?: { + [key: string]: unknown; + }; + }; + }; + }; + /** @description Environment already exists */ + 409: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + id?: string; + }; + }; + }; + /** @description Failed to create environment */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; + }; + getAgentRunningJob: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The execution ID */ + agentId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { id: string; - name: string; - /** Format: uuid */ - systemId: string; - /** Format: uuid */ + status: string; + message: string; jobAgentId: string; - }; - Resource: { - /** Format: uuid */ + jobAgentConfig: Record; + externalId: string | null; + release?: components["schemas"]["Release"]; + deployment?: components["schemas"]["Deployment"]; + config: Record; + runbook?: components["schemas"]["Runbook"]; + resource?: components["schemas"]["Resource"]; + environment?: components["schemas"]["Environment"]; + }[]; + }; + }; + }; + }; + acknowledgeAgentJob: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the job agent */ + agentId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successfully acknowledged job */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + job?: Record; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + /** @description Workspace not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + }; + }; + getNextJobs: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The agent ID */ + agentId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + jobs?: { + /** @description The job ID */ + id: string; + status: string; + jobAgentId: string; + jobAgentConfig: Record; + message: string; + releaseJobTriggerId: string; + }[]; + }; + }; + }; + }; + }; + updateJobAgent: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + workspaceId: string; + name: string; + type: string; + }; + }; + }; + responses: { + /** @description Successfully retrieved or created the agent */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { id: string; name: string; - version: string; - kind: string; - identifier: string; - config: { - [key: string]: unknown; - }; - metadata: { - [key: string]: unknown; - }; - /** Format: date-time */ - createdAt: string; - /** Format: date-time */ - updatedAt: string; - /** Format: uuid */ workspaceId: string; + }; }; - Job: { - /** Format: uuid */ - id: string; - /** @enum {string} */ - status: "completed" | "cancelled" | "skipped" | "in_progress" | "action_required" | "pending" | "failure" | "invalid_job_agent" | "invalid_integration" | "external_run_not_found"; - /** @description External job identifier (e.g. GitHub workflow run ID) */ - externalId?: string | null; - /** Format: date-time */ - createdAt: string; - /** Format: date-time */ - updatedAt: string; - /** Format: uuid */ - jobAgentId?: string; - /** @description Configuration for the Job Agent */ - jobAgentConfig: { - [key: string]: unknown; - }; - message?: string; - reason?: string; - }; - Variable: { - key: string; - value: string | number | boolean; - sensitive?: boolean; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; }; + content?: never; + }; }; - responses: never; - parameters: never; - requestBodies: never; - headers: never; - pathItems: never; -} -export type $defs = Record; -export interface operations { - deleteReleaseChannel: { - parameters: { - query?: never; - header?: never; - path: { - deploymentId: string; - name: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Release channel deleted */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - message: string; - }; - }; - }; - /** @description Permission denied */ - 403: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description Release channel not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description Failed to delete release channel */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; + }; + acknowledgeJob: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The job ID */ + jobId: string; + }; + cookie?: never; }; - getEnvironment: { - parameters: { - query?: never; - header?: never; - path: { - /** @description UUID of the environment */ - environmentId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - id: string; - systemId: string; - name: string; - description?: string | null; - resourceFilter?: { - [key: string]: unknown; - }; - policyId?: string | null; - /** Format: date-time */ - expiresAt?: string; - /** Format: date-time */ - createdAt: string; - releaseChannels: { - id?: string; - deploymentId?: string; - channelId?: string; - environmentId?: string; - }[]; - policy?: { - systemId?: string; - name?: string; - description?: string | null; - id?: string; - /** @enum {string} */ - approvalRequirement?: "manual" | "automatic"; - /** @enum {string} */ - successType?: "some" | "all" | "optional"; - successMinimum?: number; - /** @enum {string} */ - concurrencyType?: "some" | "all"; - concurrencyLimit?: number; - rolloutDuration?: number; - /** @enum {string} */ - releaseSequencing?: "wait" | "cancel"; - } | null; - }; - }; - }; - /** @description Environment not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Environment not found */ - error: string; - }; - }; - }; - }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + sucess: boolean; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; }; - deleteEnvironment: { - parameters: { - query?: never; - header?: never; - path: { - /** @description UUID of the environment */ - environmentId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Environment deleted successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; + }; + getJob: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The job ID */ + jobId: string; + }; + cookie?: never; }; - createEnvironment: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - systemId: string; - name: string; - description?: string; - resourceFilter?: { - [key: string]: unknown; - }; - policyId?: string; - releaseChannels?: string[]; - /** Format: date-time */ - expiresAt?: string; - }; - }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Job"] & { + release?: components["schemas"]["Release"]; + deployment?: components["schemas"]["Deployment"]; + runbook?: components["schemas"]["Runbook"]; + resource?: components["schemas"]["Resource"]; + environment?: components["schemas"]["Environment"]; + variables: Record; + approval?: { + id: string; + /** @enum {string} */ + status: "pending" | "approved" | "rejected"; + /** @description Null when status is pending, contains approver details when approved or rejected */ + approver?: { + id: string; + name: string; + } | null; + } | null; + }; }; - responses: { - /** @description Environment created successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - id: string; - systemId: string; - name: string; - description?: string | null; - /** Format: date-time */ - expiresAt?: string | null; - resourceFilter?: { - [key: string]: unknown; - }; - }; - }; - }; - /** @description Environment already exists */ - 409: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - id?: string; - }; - }; - }; - /** @description Failed to create environment */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; + }; + /** @description Not Found */ + 404: { + headers: { + [name: string]: unknown; }; - }; - getAgentRunningJob: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The execution ID */ - agentId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - id: string; - status: string; - message: string; - jobAgentId: string; - jobAgentConfig: Record; - externalId: string | null; - release?: components["schemas"]["Release"]; - deployment?: components["schemas"]["Deployment"]; - config: Record; - runbook?: components["schemas"]["Runbook"]; - resource?: components["schemas"]["Resource"]; - environment?: components["schemas"]["Environment"]; - }[]; - }; - }; + content: { + "application/json": { + /** @example Job not found. */ + error?: string; + }; }; + }; }; - acknowledgeAgentJob: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the job agent */ - agentId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successfully acknowledged job */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - job?: Record; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - /** @description Workspace not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - }; + }; + updateJob: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The execution ID */ + jobId: string; + }; + cookie?: never; }; - getNextJobs: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The agent ID */ - agentId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - jobs?: { - /** @description The job ID */ - id: string; - status: string; - jobAgentId: string; - jobAgentConfig: Record; - message: string; - releaseJobTriggerId: string; - }[]; - }; - }; - }; - }; + requestBody: { + content: { + "application/json": { + status?: string; + message?: string | null; + externalId?: string | null; + }; + }; }; - updateJobAgent: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - workspaceId: string; - name: string; - type: string; - }; - }; - }; - responses: { - /** @description Successfully retrieved or created the agent */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - id: string; - name: string; - workspaceId: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + }; }; + }; }; - acknowledgeJob: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The job ID */ - jobId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - sucess: boolean; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; + }; + createJobToResourceRelationship: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - getJob: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The job ID */ - jobId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Job"] & { - release?: components["schemas"]["Release"]; - deployment?: components["schemas"]["Deployment"]; - runbook?: components["schemas"]["Runbook"]; - resource?: components["schemas"]["Resource"]; - environment?: components["schemas"]["Environment"]; - variables: Record; - approval?: { - id: string; - /** @enum {string} */ - status: "pending" | "approved" | "rejected"; - /** @description Null when status is pending, contains approver details when approved or rejected */ - approver?: { - id: string; - name: string; - } | null; - } | null; - }; - }; - }; - /** @description Not Found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Job not found. */ - error?: string; - }; - }; - }; - }; + requestBody: { + content: { + "application/json": { + /** + * Format: uuid + * @description Unique identifier of the job + * @example 123e4567-e89b-12d3-a456-426614174000 + */ + jobId: string; + /** + * @description Unique identifier of the resource + * @example resource-123 + */ + resourceIdentifier: string; + }; + }; }; - updateJob: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The execution ID */ - jobId: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - status?: string; - message?: string | null; - externalId?: string | null; - }; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - id: string; - }; - }; - }; - }; + responses: { + /** @description Relationship created successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Relationship created successfully */ + message?: string; + }; + }; + }; + /** @description Invalid request body */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Invalid jobId format */ + error?: string; + }; + }; + }; + /** @description Job or resource not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Job with specified ID not found */ + error?: string; + }; + }; + }; + /** @description Relationship already exists */ + 409: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Relationship between job and resource already exists */ + error?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Internal server error occurred */ + error?: string; + }; + }; + }; }; - createJobToResourceRelationship: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - /** - * Format: uuid - * @description Unique identifier of the job - * @example 123e4567-e89b-12d3-a456-426614174000 - */ - jobId: string; - /** - * @description Unique identifier of the resource - * @example resource-123 - */ - resourceIdentifier: string; - }; - }; - }; - responses: { - /** @description Relationship created successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Relationship created successfully */ - message?: string; - }; - }; - }; - /** @description Invalid request body */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Invalid jobId format */ - error?: string; - }; - }; - }; - /** @description Job or resource not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Job with specified ID not found */ - error?: string; - }; - }; - }; - /** @description Relationship already exists */ - 409: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Relationship between job and resource already exists */ - error?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Internal server error occurred */ - error?: string; - }; - }; - }; - }; + }; + createResourceToResourceRelationship: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - createResourceToResourceRelationship: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - /** - * Format: uuid - * @description The workspace ID - * @example 123e4567-e89b-12d3-a456-426614174000 - */ - workspaceId: string; - /** - * @description The identifier of the resource to connect - * @example my-resource - */ - fromIdentifier: string; - /** - * @description The identifier of the resource to connect to - * @example my-resource - */ - toIdentifier: string; - /** - * @description The type of relationship - * @example depends_on - */ - type: string; - }; - }; - }; - responses: { - /** @description Relationship created */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Relationship created successfully */ - message?: string; - }; - }; - }; - /** @description Invalid request body */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - /** @description Resource not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - /** @description Relationship already exists */ - 409: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - }; + requestBody: { + content: { + "application/json": { + /** + * Format: uuid + * @description The workspace ID + * @example 123e4567-e89b-12d3-a456-426614174000 + */ + workspaceId: string; + /** + * @description The identifier of the resource to connect + * @example my-resource + */ + fromIdentifier: string; + /** + * @description The identifier of the resource to connect to + * @example my-resource + */ + toIdentifier: string; + /** + * @description The type of relationship + * @example depends_on + */ + type: string; + }; + }; }; - createReleaseChannel: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - deploymentId: string; - name: string; - description?: string | null; - releaseFilter: { - [key: string]: unknown; - }; - }; - }; - }; - responses: { - /** @description Release channel created successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - id: string; - deploymentId: string; - name: string; - description?: string | null; - /** Format: date-time */ - createdAt: string; - releaseFilter?: { - [key: string]: unknown; - }; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description Forbidden */ - 403: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description Release channel already exists */ - 409: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - id: string; - }; - }; - }; - /** @description Failed to create release channel */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; + responses: { + /** @description Relationship created */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Relationship created successfully */ + message?: string; + }; + }; + }; + /** @description Invalid request body */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + /** @description Resource not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + /** @description Relationship already exists */ + 409: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; }; - createRelease: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - version: string; - deploymentId: string; - /** Format: date-time */ - createdAt?: string; - name?: string; - config?: { - [key: string]: unknown; - }; - metadata?: { - [key: string]: string; - }; - }; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - id?: string; - version?: string; - metadata?: { - [key: string]: string; - }; - }; - }; - }; - /** @description Release already exists */ - 409: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - id?: string; - }; - }; - }; - }; + }; + createReleaseChannel: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - setResourceProvidersResources: { - parameters: { - query?: never; - header?: never; - path: { - /** @description UUID of the scanner */ - providerId: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - resources: { - identifier: string; - name: string; - version: string; - kind: string; - config: { - [key: string]: unknown; - }; - metadata: { - [key: string]: string; - }; - }[]; - }; - }; + requestBody: { + content: { + "application/json": { + deploymentId: string; + name: string; + description?: string | null; + releaseFilter: { + [key: string]: unknown; + }; + }; + }; + }; + responses: { + /** @description Release channel created successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + deploymentId: string; + name: string; + description?: string | null; + /** Format: date-time */ + createdAt: string; + releaseFilter?: { + [key: string]: unknown; + }; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description Forbidden */ + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description Release channel already exists */ + 409: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + id: string; + }; }; - responses: { - /** @description Successfully updated the deployment resources */ - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Invalid request */ - 400: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Deployment resources not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; + }; + /** @description Failed to create release channel */ + 500: { + headers: { + [name: string]: unknown; }; - }; - getResource: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The resource ID */ - resourceId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - id: string; - name: string; - workspaceId: string; - kind: string; - identifier: string; - version: string; - config: { - [key: string]: unknown; - }; - /** Format: date-time */ - lockedAt?: string | null; - /** Format: date-time */ - updatedAt: string; - provider?: { - id?: string; - name?: string; - } | null; - metadata: { - [key: string]: string; - }; - variable: { - [key: string]: string; - }; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Permission denied */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Resource not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Resource not found */ - error: string; - }; - }; - }; + content: { + "application/json": { + error: string; + }; }; + }; }; - deleteResource: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The resource ID */ - resourceId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Resource deleted successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - success: boolean; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Permission denied */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Resource not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; + }; + createRelease: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - updateResource: { - parameters: { - query?: never; - header?: never; - path: { - resourceId: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - name?: string; - version?: string; - kind?: string; - identifier?: string; - workspaceId?: string; - metadata?: { - [key: string]: string; - }; - variables?: components["schemas"]["Variable"][]; - }; - }; - }; - responses: { - /** @description Resource updated successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - id: string; - name: string; - workspaceId: string; - kind: string; - identifier: string; - version: string; - config: { - [key: string]: unknown; - }; - metadata: { - [key: string]: string; - }; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Permission denied */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Resource not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; + requestBody: { + content: { + "application/json": { + version: string; + deploymentId: string; + /** Format: date-time */ + createdAt?: string; + name?: string; + config?: { + [key: string]: unknown; + }; + metadata?: { + [key: string]: string; + }; + }; + }; }; - upsertResources: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - /** Format: uuid */ - workspaceId: string; - resources: { - name: string; - kind: string; - identifier: string; - version: string; - config: Record; - metadata?: { - [key: string]: string; - }; - variables?: components["schemas"]["Variable"][]; - }[]; - }; - }; - }; - responses: { - /** @description All of the cats */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - count?: number; - }; - }; - }; - }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id?: string; + version?: string; + metadata?: { + [key: string]: string; + }; + }; + }; + }; + /** @description Release already exists */ + 409: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + id?: string; + }; + }; + }; }; - deleteEnvironmentByName: { - parameters: { - query?: never; - header?: never; - path: { - /** @description UUID of the system */ - systemId: string; - /** @description Name of the environment */ - name: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Environment deleted successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; + }; + setResourceProvidersResources: { + parameters: { + query?: never; + header?: never; + path: { + /** @description UUID of the scanner */ + providerId: string; + }; + cookie?: never; }; - getSystem: { - parameters: { - query?: never; - header?: never; - path: { - /** @description UUID of the system */ - systemId: string; + requestBody: { + content: { + "application/json": { + resources: { + identifier: string; + name: string; + version: string; + kind: string; + config: { + [key: string]: unknown; }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description System retrieved successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - id: string; - name: string; - slug: string; - description: string; - workspaceId: string; - environments: { - id?: string; - name?: string; - description?: string | null; - /** Format: date-time */ - expiresAt?: string | null; - /** Format: date-time */ - createdAt?: string; - systemId?: string; - policyId?: string | null; - resourceFilter?: { - [key: string]: unknown; - } | null; - }[]; - deployments: { - id?: string; - name?: string; - slug?: string; - description?: string; - systemId?: string; - jobAgentId?: string | null; - jobAgentConfig?: { - [key: string]: unknown; - }; - }[]; - }; - }; + metadata: { + [key: string]: string; }; + }[]; }; + }; }; - upsertResourceProvider: { - parameters: { - query?: never; - header?: never; - path: { - /** @description Name of the workspace */ - workspaceId: string; - /** @description Name of the resource provider */ - name: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successfully retrieved or created the resource provider */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - id: string; - name: string; - workspaceId: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Permission denied */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Workspace not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; + responses: { + /** @description Successfully updated the deployment resources */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Invalid request */ + 400: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Deployment resources not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; - getResourceByIdentifier: { - parameters: { - query?: never; - header?: never; - path: { - /** @description ID of the workspace */ - workspaceId: string; - /** @description Identifier of the resource */ - identifier: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successfully retrieved the resource */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - id: string; - identifier: string; - workspaceId: string; - providerId: string; - provider?: { - id?: string; - name?: string; - workspaceId?: string; - }; - variables?: { - id?: string; - key?: string; - value?: string; - }[]; - metadata?: { - [key: string]: string; - }; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Permission denied */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; + }; + getResource: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The resource ID */ + resourceId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + name: string; + workspaceId: string; + kind: string; + identifier: string; + version: string; + config: { + [key: string]: unknown; }; - /** @description Resource not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Resource not found */ - error?: string; - }; - }; + /** Format: date-time */ + lockedAt?: string | null; + /** Format: date-time */ + updatedAt: string; + provider?: { + id?: string; + name?: string; + } | null; + metadata: { + [key: string]: string; + }; + variable: { + [key: string]: string; + }; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Permission denied */ + 403: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Resource not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Resource not found */ + error: string; + }; + }; + }; + }; + }; + deleteResource: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The resource ID */ + resourceId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Resource deleted successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + success: boolean; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Permission denied */ + 403: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Resource not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; + }; + updateResource: { + parameters: { + query?: never; + header?: never; + path: { + resourceId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + name?: string; + version?: string; + kind?: string; + identifier?: string; + workspaceId?: string; + metadata?: { + [key: string]: string; + }; + variables?: components["schemas"]["Variable"][]; + }; + }; + }; + responses: { + /** @description Resource updated successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + name: string; + workspaceId: string; + kind: string; + identifier: string; + version: string; + config: { + [key: string]: unknown; }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content?: never; + metadata: { + [key: string]: string; + }; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Permission denied */ + 403: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Resource not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; + }; + upsertResources: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** Format: uuid */ + workspaceId: string; + resources: { + name: string; + kind: string; + identifier: string; + version: string; + config: Record; + metadata?: { + [key: string]: string; }; + variables?: components["schemas"]["Variable"][]; + }[]; }; + }; }; - deleteResourceByIdentifier: { - parameters: { - query?: never; - header?: never; - path: { - /** @description ID of the workspace */ - workspaceId: string; - /** @description Identifier of the resource */ - identifier: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successfully deleted the resource */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example true */ - success?: boolean; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Permission denied */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Resource not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Resource not found */ - error?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; + responses: { + /** @description All of the cats */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + count?: number; + }; + }; + }; + }; + }; + deleteEnvironmentByName: { + parameters: { + query?: never; + header?: never; + path: { + /** @description UUID of the system */ + systemId: string; + /** @description Name of the environment */ + name: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Environment deleted successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + getSystem: { + parameters: { + query?: never; + header?: never; + path: { + /** @description UUID of the system */ + systemId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description System retrieved successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + name: string; + slug: string; + description: string; + workspaceId: string; + environments: { + id?: string; + name?: string; + description?: string | null; + /** Format: date-time */ + expiresAt?: string | null; + /** Format: date-time */ + createdAt?: string; + systemId?: string; + policyId?: string | null; + resourceFilter?: { + [key: string]: unknown; + } | null; + }[]; + deployments: { + id?: string; + name?: string; + slug?: string; + description?: string; + systemId?: string; + jobAgentId?: string | null; + jobAgentConfig?: { + [key: string]: unknown; + }; + }[]; + }; }; + }; + }; + }; + upsertResourceProvider: { + parameters: { + query?: never; + header?: never; + path: { + /** @description Name of the workspace */ + workspaceId: string; + /** @description Name of the resource provider */ + name: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successfully retrieved or created the resource provider */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + name: string; + workspaceId: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Permission denied */ + 403: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Workspace not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + getResourceByIdentifier: { + parameters: { + query?: never; + header?: never; + path: { + /** @description ID of the workspace */ + workspaceId: string; + /** @description Identifier of the resource */ + identifier: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successfully retrieved the resource */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + identifier: string; + workspaceId: string; + providerId: string; + provider?: { + id?: string; + name?: string; + workspaceId?: string; + }; + variables?: { + id?: string; + key?: string; + value?: string; + }[]; + metadata?: { + [key: string]: string; + }; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Permission denied */ + 403: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Resource not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Resource not found */ + error?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + deleteResourceByIdentifier: { + parameters: { + query?: never; + header?: never; + path: { + /** @description ID of the workspace */ + workspaceId: string; + /** @description Identifier of the resource */ + identifier: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successfully deleted the resource */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example true */ + success?: boolean; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Permission denied */ + 403: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Resource not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Resource not found */ + error?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; + }; }