From 54e11c1c91f85ecfca1762cea51632411754227f Mon Sep 17 00:00:00 2001 From: Justin Brooks Date: Mon, 5 May 2025 14:28:38 -0400 Subject: [PATCH 1/5] add netadata key matching --- packages/db/drizzle/0099_dear_korg.sql | 9 + packages/db/drizzle/meta/0099_snapshot.json | 6889 +++++++++++++++++ packages/db/drizzle/meta/_journal.json | 9 +- .../db/src/queries/get-resource-parents.ts | 43 +- .../src/schema/resource-relationship-rule.ts | 21 + 5 files changed, 6966 insertions(+), 5 deletions(-) create mode 100644 packages/db/drizzle/0099_dear_korg.sql create mode 100644 packages/db/drizzle/meta/0099_snapshot.json diff --git a/packages/db/drizzle/0099_dear_korg.sql b/packages/db/drizzle/0099_dear_korg.sql new file mode 100644 index 000000000..bdca7c401 --- /dev/null +++ b/packages/db/drizzle/0099_dear_korg.sql @@ -0,0 +1,9 @@ +CREATE TABLE "resource_relationship_rule_metadata_equals" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, + "resource_relationship_rule_id" uuid NOT NULL, + "key" text NOT NULL, + "value" text NOT NULL +); +--> statement-breakpoint +ALTER TABLE "resource_relationship_rule_metadata_equals" ADD CONSTRAINT "resource_relationship_rule_metadata_equals_resource_relationship_rule_id_resource_relationship_rule_id_fk" FOREIGN KEY ("resource_relationship_rule_id") REFERENCES "public"."resource_relationship_rule"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +CREATE UNIQUE INDEX "unique_resource_relationship_rule_metadata_equals" ON "resource_relationship_rule_metadata_equals" USING btree ("resource_relationship_rule_id","key"); \ No newline at end of file diff --git a/packages/db/drizzle/meta/0099_snapshot.json b/packages/db/drizzle/meta/0099_snapshot.json new file mode 100644 index 000000000..ab1381744 --- /dev/null +++ b/packages/db/drizzle/meta/0099_snapshot.json @@ -0,0 +1,6889 @@ +{ + "id": "45cb559c-82d4-4a6d-a390-8d6d7bbc6d1e", + "prevId": "388fdaa7-8b17-4f2c-a523-a344c2e223b3", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.account": { + "name": "account", + "schema": "", + "columns": { + "userId": { + "name": "userId", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "providerAccountId": { + "name": "providerAccountId", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "access_token": { + "name": "access_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "token_type": { + "name": "token_type", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "id_token": { + "name": "id_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "session_state": { + "name": "session_state", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "account_userId_user_id_fk": { + "name": "account_userId_user_id_fk", + "tableFrom": "account", + "tableTo": "user", + "columnsFrom": [ + "userId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "account_provider_providerAccountId_pk": { + "name": "account_provider_providerAccountId_pk", + "columns": [ + "provider", + "providerAccountId" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.session": { + "name": "session", + "schema": "", + "columns": { + "sessionToken": { + "name": "sessionToken", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "userId": { + "name": "userId", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "expires": { + "name": "expires", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "session_userId_user_id_fk": { + "name": "session_userId_user_id_fk", + "tableFrom": "session", + "tableTo": "user", + "columnsFrom": [ + "userId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "emailVerified": { + "name": "emailVerified", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "image": { + "name": "image", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "active_workspace_id": { + "name": "active_workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": false, + "default": "null" + }, + "password_hash": { + "name": "password_hash", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "null" + }, + "system_role": { + "name": "system_role", + "type": "system_role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'user'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "user_active_workspace_id_workspace_id_fk": { + "name": "user_active_workspace_id_workspace_id_fk", + "tableFrom": "user", + "tableTo": "workspace", + "columnsFrom": [ + "active_workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_api_key": { + "name": "user_api_key", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "key_preview": { + "name": "key_preview", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "key_hash": { + "name": "key_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "key_prefix": { + "name": "key_prefix", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "user_api_key_key_prefix_key_hash_index": { + "name": "user_api_key_key_prefix_key_hash_index", + "columns": [ + { + "expression": "key_prefix", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "key_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "user_api_key_user_id_user_id_fk": { + "name": "user_api_key_user_id_user_id_fk", + "tableFrom": "user_api_key", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dashboard": { + "name": "dashboard", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "dashboard_workspace_id_workspace_id_fk": { + "name": "dashboard_workspace_id_workspace_id_fk", + "tableFrom": "dashboard", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dashboard_widget": { + "name": "dashboard_widget", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "dashboard_id": { + "name": "dashboard_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "widget": { + "name": "widget", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "config": { + "name": "config", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "x": { + "name": "x", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "y": { + "name": "y", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "w": { + "name": "w", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "h": { + "name": "h", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "dashboard_widget_dashboard_id_dashboard_id_fk": { + "name": "dashboard_widget_dashboard_id_dashboard_id_fk", + "tableFrom": "dashboard_widget", + "tableTo": "dashboard", + "columnsFrom": [ + "dashboard_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.deployment_variable": { + "name": "deployment_variable", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "deployment_id": { + "name": "deployment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "default_value_id": { + "name": "default_value_id", + "type": "uuid", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "schema": { + "name": "schema", + "type": "jsonb", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "deployment_variable_deployment_id_key_index": { + "name": "deployment_variable_deployment_id_key_index", + "columns": [ + { + "expression": "deployment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "deployment_variable_deployment_id_deployment_id_fk": { + "name": "deployment_variable_deployment_id_deployment_id_fk", + "tableFrom": "deployment_variable", + "tableTo": "deployment", + "columnsFrom": [ + "deployment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "deployment_variable_default_value_id_deployment_variable_value_id_fk": { + "name": "deployment_variable_default_value_id_deployment_variable_value_id_fk", + "tableFrom": "deployment_variable", + "tableTo": "deployment_variable_value", + "columnsFrom": [ + "default_value_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.deployment_variable_set": { + "name": "deployment_variable_set", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "deployment_id": { + "name": "deployment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "variable_set_id": { + "name": "variable_set_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "deployment_variable_set_deployment_id_variable_set_id_index": { + "name": "deployment_variable_set_deployment_id_variable_set_id_index", + "columns": [ + { + "expression": "deployment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "variable_set_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "deployment_variable_set_deployment_id_deployment_id_fk": { + "name": "deployment_variable_set_deployment_id_deployment_id_fk", + "tableFrom": "deployment_variable_set", + "tableTo": "deployment", + "columnsFrom": [ + "deployment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "deployment_variable_set_variable_set_id_variable_set_id_fk": { + "name": "deployment_variable_set_variable_set_id_variable_set_id_fk", + "tableFrom": "deployment_variable_set", + "tableTo": "variable_set", + "columnsFrom": [ + "variable_set_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.deployment_variable_value": { + "name": "deployment_variable_value", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "variable_id": { + "name": "variable_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "sensitive": { + "name": "sensitive", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "resource_selector": { + "name": "resource_selector", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": { + "deployment_variable_value_variable_id_value_index": { + "name": "deployment_variable_value_variable_id_value_index", + "columns": [ + { + "expression": "variable_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "value", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "deployment_variable_value_variable_id_deployment_variable_id_fk": { + "name": "deployment_variable_value_variable_id_deployment_variable_id_fk", + "tableFrom": "deployment_variable_value", + "tableTo": "deployment_variable", + "columnsFrom": [ + "variable_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "restrict" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.deployment_version": { + "name": "deployment_version", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "config": { + "name": "config", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "job_agent_config": { + "name": "job_agent_config", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "deployment_id": { + "name": "deployment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "deployment_version_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'ready'" + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "deployment_version_deployment_id_tag_index": { + "name": "deployment_version_deployment_id_tag_index", + "columns": [ + { + "expression": "deployment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "tag", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "deployment_version_created_at_idx": { + "name": "deployment_version_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "deployment_version_deployment_id_deployment_id_fk": { + "name": "deployment_version_deployment_id_deployment_id_fk", + "tableFrom": "deployment_version", + "tableTo": "deployment", + "columnsFrom": [ + "deployment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.deployment_version_channel": { + "name": "deployment_version_channel", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "''" + }, + "deployment_id": { + "name": "deployment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "deployment_version_selector": { + "name": "deployment_version_selector", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": { + "deployment_version_channel_deployment_id_name_index": { + "name": "deployment_version_channel_deployment_id_name_index", + "columns": [ + { + "expression": "deployment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "deployment_version_channel_deployment_id_deployment_id_fk": { + "name": "deployment_version_channel_deployment_id_deployment_id_fk", + "tableFrom": "deployment_version_channel", + "tableTo": "deployment", + "columnsFrom": [ + "deployment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.deployment_version_metadata": { + "name": "deployment_version_metadata", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "deployment_version_id": { + "name": "deployment_version_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "deployment_version_metadata_key_deployment_version_id_index": { + "name": "deployment_version_metadata_key_deployment_version_id_index", + "columns": [ + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deployment_version_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "deployment_version_metadata_version_id_idx": { + "name": "deployment_version_metadata_version_id_idx", + "columns": [ + { + "expression": "deployment_version_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "deployment_version_metadata_deployment_version_id_deployment_version_id_fk": { + "name": "deployment_version_metadata_deployment_version_id_deployment_version_id_fk", + "tableFrom": "deployment_version_metadata", + "tableTo": "deployment_version", + "columnsFrom": [ + "deployment_version_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.deployment_version_dependency": { + "name": "deployment_version_dependency", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "deployment_version_id": { + "name": "deployment_version_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "deployment_id": { + "name": "deployment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "deployment_version_selector": { + "name": "deployment_version_selector", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": { + "deployment_version_dependency_deployment_version_id_deployment_id_index": { + "name": "deployment_version_dependency_deployment_version_id_deployment_id_index", + "columns": [ + { + "expression": "deployment_version_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deployment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "deployment_version_dependency_deployment_version_id_deployment_version_id_fk": { + "name": "deployment_version_dependency_deployment_version_id_deployment_version_id_fk", + "tableFrom": "deployment_version_dependency", + "tableTo": "deployment_version", + "columnsFrom": [ + "deployment_version_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "deployment_version_dependency_deployment_id_deployment_id_fk": { + "name": "deployment_version_dependency_deployment_id_deployment_id_fk", + "tableFrom": "deployment_version_dependency", + "tableTo": "deployment", + "columnsFrom": [ + "deployment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.computed_deployment_resource": { + "name": "computed_deployment_resource", + "schema": "", + "columns": { + "deployment_id": { + "name": "deployment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "resource_id": { + "name": "resource_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "computed_deployment_resource_deployment_id_deployment_id_fk": { + "name": "computed_deployment_resource_deployment_id_deployment_id_fk", + "tableFrom": "computed_deployment_resource", + "tableTo": "deployment", + "columnsFrom": [ + "deployment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "computed_deployment_resource_resource_id_resource_id_fk": { + "name": "computed_deployment_resource_resource_id_resource_id_fk", + "tableFrom": "computed_deployment_resource", + "tableTo": "resource", + "columnsFrom": [ + "resource_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "computed_deployment_resource_deployment_id_resource_id_pk": { + "name": "computed_deployment_resource_deployment_id_resource_id_pk", + "columns": [ + "deployment_id", + "resource_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.deployment": { + "name": "deployment", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "system_id": { + "name": "system_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "job_agent_id": { + "name": "job_agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "job_agent_config": { + "name": "job_agent_config", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "retry_count": { + "name": "retry_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "timeout": { + "name": "timeout", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "resource_selector": { + "name": "resource_selector", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": { + "deployment_system_id_slug_index": { + "name": "deployment_system_id_slug_index", + "columns": [ + { + "expression": "system_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "deployment_system_id_system_id_fk": { + "name": "deployment_system_id_system_id_fk", + "tableFrom": "deployment", + "tableTo": "system", + "columnsFrom": [ + "system_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "deployment_job_agent_id_job_agent_id_fk": { + "name": "deployment_job_agent_id_job_agent_id_fk", + "tableFrom": "deployment", + "tableTo": "job_agent", + "columnsFrom": [ + "job_agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.environment_policy_deployment": { + "name": "environment_policy_deployment", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "policy_id": { + "name": "policy_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "environment_policy_deployment_policy_id_environment_id_index": { + "name": "environment_policy_deployment_policy_id_environment_id_index", + "columns": [ + { + "expression": "policy_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "environment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "environment_policy_deployment_policy_id_environment_policy_id_fk": { + "name": "environment_policy_deployment_policy_id_environment_policy_id_fk", + "tableFrom": "environment_policy_deployment", + "tableTo": "environment_policy", + "columnsFrom": [ + "policy_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "environment_policy_deployment_environment_id_environment_id_fk": { + "name": "environment_policy_deployment_environment_id_environment_id_fk", + "tableFrom": "environment_policy_deployment", + "tableTo": "environment", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.computed_environment_resource": { + "name": "computed_environment_resource", + "schema": "", + "columns": { + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "resource_id": { + "name": "resource_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "computed_environment_resource_environment_id_environment_id_fk": { + "name": "computed_environment_resource_environment_id_environment_id_fk", + "tableFrom": "computed_environment_resource", + "tableTo": "environment", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "computed_environment_resource_resource_id_resource_id_fk": { + "name": "computed_environment_resource_resource_id_resource_id_fk", + "tableFrom": "computed_environment_resource", + "tableTo": "resource", + "columnsFrom": [ + "resource_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "computed_environment_resource_environment_id_resource_id_pk": { + "name": "computed_environment_resource_environment_id_resource_id_pk", + "columns": [ + "environment_id", + "resource_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.environment": { + "name": "environment", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "system_id": { + "name": "system_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "directory": { + "name": "directory", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "''" + }, + "policy_id": { + "name": "policy_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "resource_selector": { + "name": "resource_selector", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "environment_system_id_name_index": { + "name": "environment_system_id_name_index", + "columns": [ + { + "expression": "system_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "environment_system_id_system_id_fk": { + "name": "environment_system_id_system_id_fk", + "tableFrom": "environment", + "tableTo": "system", + "columnsFrom": [ + "system_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "environment_policy_id_environment_policy_id_fk": { + "name": "environment_policy_id_environment_policy_id_fk", + "tableFrom": "environment", + "tableTo": "environment_policy", + "columnsFrom": [ + "policy_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.environment_metadata": { + "name": "environment_metadata", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "environment_metadata_key_environment_id_index": { + "name": "environment_metadata_key_environment_id_index", + "columns": [ + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "environment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "environment_metadata_environment_id_environment_id_fk": { + "name": "environment_metadata_environment_id_environment_id_fk", + "tableFrom": "environment_metadata", + "tableTo": "environment", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.environment_policy": { + "name": "environment_policy", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "system_id": { + "name": "system_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "approval_required": { + "name": "approval_required", + "type": "environment_policy_approval_requirement", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'automatic'" + }, + "success_status": { + "name": "success_status", + "type": "environment_policy_deployment_success_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'all'" + }, + "minimum_success": { + "name": "minimum_success", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "concurrency_limit": { + "name": "concurrency_limit", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "rollout_duration": { + "name": "rollout_duration", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "minimum_release_interval": { + "name": "minimum_release_interval", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "release_sequencing": { + "name": "release_sequencing", + "type": "release_sequencing_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'cancel'" + } + }, + "indexes": {}, + "foreignKeys": { + "environment_policy_system_id_system_id_fk": { + "name": "environment_policy_system_id_system_id_fk", + "tableFrom": "environment_policy", + "tableTo": "system", + "columnsFrom": [ + "system_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "environment_policy_environment_id_environment_id_fk": { + "name": "environment_policy_environment_id_environment_id_fk", + "tableFrom": "environment_policy", + "tableTo": "environment", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.environment_policy_approval": { + "name": "environment_policy_approval", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "policy_id": { + "name": "policy_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "release_id": { + "name": "release_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "approval_status_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "approved_at": { + "name": "approved_at", + "type": "timestamp (0) with time zone", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": { + "environment_policy_approval_policy_id_release_id_index": { + "name": "environment_policy_approval_policy_id_release_id_index", + "columns": [ + { + "expression": "policy_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "release_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "environment_policy_approval_policy_id_environment_policy_id_fk": { + "name": "environment_policy_approval_policy_id_environment_policy_id_fk", + "tableFrom": "environment_policy_approval", + "tableTo": "environment_policy", + "columnsFrom": [ + "policy_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "environment_policy_approval_release_id_deployment_version_id_fk": { + "name": "environment_policy_approval_release_id_deployment_version_id_fk", + "tableFrom": "environment_policy_approval", + "tableTo": "deployment_version", + "columnsFrom": [ + "release_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "environment_policy_approval_user_id_user_id_fk": { + "name": "environment_policy_approval_user_id_user_id_fk", + "tableFrom": "environment_policy_approval", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.environment_policy_release_window": { + "name": "environment_policy_release_window", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "policy_id": { + "name": "policy_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "start_time": { + "name": "start_time", + "type": "timestamp (0) with time zone", + "primaryKey": false, + "notNull": true + }, + "end_time": { + "name": "end_time", + "type": "timestamp (0) with time zone", + "primaryKey": false, + "notNull": true + }, + "recurrence": { + "name": "recurrence", + "type": "recurrence_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "environment_policy_release_window_policy_id_environment_policy_id_fk": { + "name": "environment_policy_release_window_policy_id_environment_policy_id_fk", + "tableFrom": "environment_policy_release_window", + "tableTo": "environment_policy", + "columnsFrom": [ + "policy_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.event": { + "name": "event", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "payload": { + "name": "payload", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "event_workspace_id_workspace_id_fk": { + "name": "event_workspace_id_workspace_id_fk", + "tableFrom": "event", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.hook": { + "name": "hook", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "scope_type": { + "name": "scope_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "scope_id": { + "name": "scope_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.runhook": { + "name": "runhook", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "hook_id": { + "name": "hook_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "runbook_id": { + "name": "runbook_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "runhook_hook_id_runbook_id_index": { + "name": "runhook_hook_id_runbook_id_index", + "columns": [ + { + "expression": "hook_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "runbook_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "runhook_hook_id_hook_id_fk": { + "name": "runhook_hook_id_hook_id_fk", + "tableFrom": "runhook", + "tableTo": "hook", + "columnsFrom": [ + "hook_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "runhook_runbook_id_runbook_id_fk": { + "name": "runhook_runbook_id_runbook_id_fk", + "tableFrom": "runhook", + "tableTo": "runbook", + "columnsFrom": [ + "runbook_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.github_entity": { + "name": "github_entity", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "installation_id": { + "name": "installation_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "github_entity_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'organization'" + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "added_by_user_id": { + "name": "added_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "avatar_url": { + "name": "avatar_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "unique_installation_workspace": { + "name": "unique_installation_workspace", + "columns": [ + { + "expression": "installation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "github_entity_added_by_user_id_user_id_fk": { + "name": "github_entity_added_by_user_id_user_id_fk", + "tableFrom": "github_entity", + "tableTo": "user", + "columnsFrom": [ + "added_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "github_entity_workspace_id_workspace_id_fk": { + "name": "github_entity_workspace_id_workspace_id_fk", + "tableFrom": "github_entity", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.github_user": { + "name": "github_user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "github_user_id": { + "name": "github_user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "github_username": { + "name": "github_username", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "github_user_user_id_user_id_fk": { + "name": "github_user_user_id_user_id_fk", + "tableFrom": "github_user", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.job_resource_relationship": { + "name": "job_resource_relationship", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "job_id": { + "name": "job_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "resource_identifier": { + "name": "resource_identifier", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "job_resource_relationship_job_id_resource_identifier_index": { + "name": "job_resource_relationship_job_id_resource_identifier_index", + "columns": [ + { + "expression": "job_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "resource_identifier", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "job_resource_relationship_job_id_job_id_fk": { + "name": "job_resource_relationship_job_id_job_id_fk", + "tableFrom": "job_resource_relationship", + "tableTo": "job", + "columnsFrom": [ + "job_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resource": { + "name": "resource", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "version": { + "name": "version", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "identifier": { + "name": "identifier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider_id": { + "name": "provider_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "config": { + "name": "config", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "locked_at": { + "name": "locked_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "resource_identifier_workspace_id_index": { + "name": "resource_identifier_workspace_id_index", + "columns": [ + { + "expression": "identifier", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "resource_provider_id_resource_provider_id_fk": { + "name": "resource_provider_id_resource_provider_id_fk", + "tableFrom": "resource", + "tableTo": "resource_provider", + "columnsFrom": [ + "provider_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "resource_workspace_id_workspace_id_fk": { + "name": "resource_workspace_id_workspace_id_fk", + "tableFrom": "resource", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resource_metadata": { + "name": "resource_metadata", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "resource_id": { + "name": "resource_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "resource_metadata_key_resource_id_index": { + "name": "resource_metadata_key_resource_id_index", + "columns": [ + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "resource_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "resource_metadata_resource_id_resource_id_fk": { + "name": "resource_metadata_resource_id_resource_id_fk", + "tableFrom": "resource_metadata", + "tableTo": "resource", + "columnsFrom": [ + "resource_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resource_relationship": { + "name": "resource_relationship", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "from_identifier": { + "name": "from_identifier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "to_identifier": { + "name": "to_identifier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "resource_relationship_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "resource_relationship_to_identifier_from_identifier_index": { + "name": "resource_relationship_to_identifier_from_identifier_index", + "columns": [ + { + "expression": "to_identifier", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "from_identifier", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "resource_relationship_workspace_id_workspace_id_fk": { + "name": "resource_relationship_workspace_id_workspace_id_fk", + "tableFrom": "resource_relationship", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resource_schema": { + "name": "resource_schema", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "version": { + "name": "version", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "json_schema": { + "name": "json_schema", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "resource_schema_version_kind_workspace_id_index": { + "name": "resource_schema_version_kind_workspace_id_index", + "columns": [ + { + "expression": "version", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "resource_schema_workspace_id_workspace_id_fk": { + "name": "resource_schema_workspace_id_workspace_id_fk", + "tableFrom": "resource_schema", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resource_variable": { + "name": "resource_variable", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "resource_id": { + "name": "resource_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "sensitive": { + "name": "sensitive", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "reference": { + "name": "reference", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "path": { + "name": "path", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "default_value": { + "name": "default_value", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "value_type": { + "name": "value_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'direct'" + } + }, + "indexes": { + "resource_variable_resource_id_key_index": { + "name": "resource_variable_resource_id_key_index", + "columns": [ + { + "expression": "resource_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "resource_variable_resource_id_resource_id_fk": { + "name": "resource_variable_resource_id_resource_id_fk", + "tableFrom": "resource_variable", + "tableTo": "resource", + "columnsFrom": [ + "resource_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resource_view": { + "name": "resource_view", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "''" + }, + "filter": { + "name": "filter", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "resource_view_workspace_id_workspace_id_fk": { + "name": "resource_view_workspace_id_workspace_id_fk", + "tableFrom": "resource_view", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.azure_tenant": { + "name": "azure_tenant", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "tenant_id": { + "name": "tenant_id", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "azure_tenant_tenant_id_index": { + "name": "azure_tenant_tenant_id_index", + "columns": [ + { + "expression": "tenant_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "azure_tenant_workspace_id_workspace_id_fk": { + "name": "azure_tenant_workspace_id_workspace_id_fk", + "tableFrom": "azure_tenant", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resource_provider": { + "name": "resource_provider", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "resource_provider_workspace_id_name_index": { + "name": "resource_provider_workspace_id_name_index", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "resource_provider_workspace_id_workspace_id_fk": { + "name": "resource_provider_workspace_id_workspace_id_fk", + "tableFrom": "resource_provider", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resource_provider_aws": { + "name": "resource_provider_aws", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "resource_provider_id": { + "name": "resource_provider_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "aws_role_arns": { + "name": "aws_role_arns", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "import_eks": { + "name": "import_eks", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "import_vpc": { + "name": "import_vpc", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "resource_provider_aws_resource_provider_id_resource_provider_id_fk": { + "name": "resource_provider_aws_resource_provider_id_resource_provider_id_fk", + "tableFrom": "resource_provider_aws", + "tableTo": "resource_provider", + "columnsFrom": [ + "resource_provider_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resource_provider_azure": { + "name": "resource_provider_azure", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "resource_provider_id": { + "name": "resource_provider_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "tenant_id": { + "name": "tenant_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "subscription_id": { + "name": "subscription_id", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "resource_provider_azure_resource_provider_id_resource_provider_id_fk": { + "name": "resource_provider_azure_resource_provider_id_resource_provider_id_fk", + "tableFrom": "resource_provider_azure", + "tableTo": "resource_provider", + "columnsFrom": [ + "resource_provider_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "resource_provider_azure_tenant_id_azure_tenant_id_fk": { + "name": "resource_provider_azure_tenant_id_azure_tenant_id_fk", + "tableFrom": "resource_provider_azure", + "tableTo": "azure_tenant", + "columnsFrom": [ + "tenant_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resource_provider_google": { + "name": "resource_provider_google", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "resource_provider_id": { + "name": "resource_provider_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "project_ids": { + "name": "project_ids", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "import_gke": { + "name": "import_gke", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "import_namespaces": { + "name": "import_namespaces", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "import_vcluster": { + "name": "import_vcluster", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "import_vms": { + "name": "import_vms", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "import_vpc": { + "name": "import_vpc", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "resource_provider_google_resource_provider_id_resource_provider_id_fk": { + "name": "resource_provider_google_resource_provider_id_resource_provider_id_fk", + "tableFrom": "resource_provider_google", + "tableTo": "resource_provider", + "columnsFrom": [ + "resource_provider_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.system": { + "name": "system", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "system_workspace_id_slug_index": { + "name": "system_workspace_id_slug_index", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "system_workspace_id_workspace_id_fk": { + "name": "system_workspace_id_workspace_id_fk", + "tableFrom": "system", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.runbook": { + "name": "runbook", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "system_id": { + "name": "system_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "job_agent_id": { + "name": "job_agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "job_agent_config": { + "name": "job_agent_config", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + } + }, + "indexes": {}, + "foreignKeys": { + "runbook_system_id_system_id_fk": { + "name": "runbook_system_id_system_id_fk", + "tableFrom": "runbook", + "tableTo": "system", + "columnsFrom": [ + "system_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "runbook_job_agent_id_job_agent_id_fk": { + "name": "runbook_job_agent_id_job_agent_id_fk", + "tableFrom": "runbook", + "tableTo": "job_agent", + "columnsFrom": [ + "job_agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.runbook_job_trigger": { + "name": "runbook_job_trigger", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "job_id": { + "name": "job_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "runbook_id": { + "name": "runbook_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "runbook_job_trigger_job_id_job_id_fk": { + "name": "runbook_job_trigger_job_id_job_id_fk", + "tableFrom": "runbook_job_trigger", + "tableTo": "job", + "columnsFrom": [ + "job_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "runbook_job_trigger_runbook_id_runbook_id_fk": { + "name": "runbook_job_trigger_runbook_id_runbook_id_fk", + "tableFrom": "runbook_job_trigger", + "tableTo": "runbook", + "columnsFrom": [ + "runbook_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "runbook_job_trigger_job_id_unique": { + "name": "runbook_job_trigger_job_id_unique", + "nullsNotDistinct": false, + "columns": [ + "job_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.team": { + "name": "team", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "text": { + "name": "text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "team_workspace_id_workspace_id_fk": { + "name": "team_workspace_id_workspace_id_fk", + "tableFrom": "team", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.team_member": { + "name": "team_member", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "team_id": { + "name": "team_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "team_member_team_id_user_id_index": { + "name": "team_member_team_id_user_id_index", + "columns": [ + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "team_member_team_id_team_id_fk": { + "name": "team_member_team_id_team_id_fk", + "tableFrom": "team_member", + "tableTo": "team", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "team_member_user_id_user_id_fk": { + "name": "team_member_user_id_user_id_fk", + "tableFrom": "team_member", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.job": { + "name": "job", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "job_agent_id": { + "name": "job_agent_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "job_agent_config": { + "name": "job_agent_config", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "external_id": { + "name": "external_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "job_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "reason": { + "name": "reason", + "type": "job_reason", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'policy_passing'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "started_at": { + "name": "started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "job_created_at_idx": { + "name": "job_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "job_status_idx": { + "name": "job_status_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "job_job_agent_id_job_agent_id_fk": { + "name": "job_job_agent_id_job_agent_id_fk", + "tableFrom": "job", + "tableTo": "job_agent", + "columnsFrom": [ + "job_agent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.job_metadata": { + "name": "job_metadata", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "job_id": { + "name": "job_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "job_metadata_key_job_id_index": { + "name": "job_metadata_key_job_id_index", + "columns": [ + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "job_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "job_metadata_job_id_job_id_fk": { + "name": "job_metadata_job_id_job_id_fk", + "tableFrom": "job_metadata", + "tableTo": "job", + "columnsFrom": [ + "job_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.job_variable": { + "name": "job_variable", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "job_id": { + "name": "job_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "sensitive": { + "name": "sensitive", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "job_variable_job_id_key_index": { + "name": "job_variable_job_id_key_index", + "columns": [ + { + "expression": "job_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "job_variable_job_id_job_id_fk": { + "name": "job_variable_job_id_job_id_fk", + "tableFrom": "job_variable", + "tableTo": "job", + "columnsFrom": [ + "job_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspace": { + "name": "workspace", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "google_service_account_email": { + "name": "google_service_account_email", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "aws_role_arn": { + "name": "aws_role_arn", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "workspace_slug_unique": { + "name": "workspace_slug_unique", + "nullsNotDistinct": false, + "columns": [ + "slug" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspace_email_domain_matching": { + "name": "workspace_email_domain_matching", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "domain": { + "name": "domain", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "verified": { + "name": "verified", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "verification_code": { + "name": "verification_code", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "verification_email": { + "name": "verification_email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workspace_email_domain_matching_workspace_id_domain_index": { + "name": "workspace_email_domain_matching_workspace_id_domain_index", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "domain", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workspace_email_domain_matching_workspace_id_workspace_id_fk": { + "name": "workspace_email_domain_matching_workspace_id_workspace_id_fk", + "tableFrom": "workspace_email_domain_matching", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workspace_email_domain_matching_role_id_role_id_fk": { + "name": "workspace_email_domain_matching_role_id_role_id_fk", + "tableFrom": "workspace_email_domain_matching", + "tableTo": "role", + "columnsFrom": [ + "role_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.variable_set": { + "name": "variable_set", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "system_id": { + "name": "system_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "variable_set_system_id_system_id_fk": { + "name": "variable_set_system_id_system_id_fk", + "tableFrom": "variable_set", + "tableTo": "system", + "columnsFrom": [ + "system_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.variable_set_environment": { + "name": "variable_set_environment", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "variable_set_id": { + "name": "variable_set_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "variable_set_environment_variable_set_id_variable_set_id_fk": { + "name": "variable_set_environment_variable_set_id_variable_set_id_fk", + "tableFrom": "variable_set_environment", + "tableTo": "variable_set", + "columnsFrom": [ + "variable_set_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "variable_set_environment_environment_id_environment_id_fk": { + "name": "variable_set_environment_environment_id_environment_id_fk", + "tableFrom": "variable_set_environment", + "tableTo": "environment", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.variable_set_value": { + "name": "variable_set_value", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "variable_set_id": { + "name": "variable_set_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "sensitive": { + "name": "sensitive", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "variable_set_value_variable_set_id_key_index": { + "name": "variable_set_value_variable_set_id_key_index", + "columns": [ + { + "expression": "variable_set_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "variable_set_value_variable_set_id_variable_set_id_fk": { + "name": "variable_set_value_variable_set_id_variable_set_id_fk", + "tableFrom": "variable_set_value", + "tableTo": "variable_set", + "columnsFrom": [ + "variable_set_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspace_invite_token": { + "name": "workspace_invite_token", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "token": { + "name": "token", + "type": "uuid", + "primaryKey": false, + "notNull": true, + "default": "gen_random_uuid()" + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "workspace_invite_token_role_id_role_id_fk": { + "name": "workspace_invite_token_role_id_role_id_fk", + "tableFrom": "workspace_invite_token", + "tableTo": "role", + "columnsFrom": [ + "role_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workspace_invite_token_workspace_id_workspace_id_fk": { + "name": "workspace_invite_token_workspace_id_workspace_id_fk", + "tableFrom": "workspace_invite_token", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workspace_invite_token_created_by_user_id_fk": { + "name": "workspace_invite_token_created_by_user_id_fk", + "tableFrom": "workspace_invite_token", + "tableTo": "user", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "workspace_invite_token_token_unique": { + "name": "workspace_invite_token_token_unique", + "nullsNotDistinct": false, + "columns": [ + "token" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resource_metadata_group": { + "name": "resource_metadata_group", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "keys": { + "name": "keys", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "include_null_combinations": { + "name": "include_null_combinations", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "resource_metadata_group_workspace_id_workspace_id_fk": { + "name": "resource_metadata_group_workspace_id_workspace_id_fk", + "tableFrom": "resource_metadata_group", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.runbook_variable": { + "name": "runbook_variable", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "runbook_id": { + "name": "runbook_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "schema": { + "name": "schema", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "required": { + "name": "required", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "runbook_variable_runbook_id_key_index": { + "name": "runbook_variable_runbook_id_key_index", + "columns": [ + { + "expression": "runbook_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "runbook_variable_runbook_id_runbook_id_fk": { + "name": "runbook_variable_runbook_id_runbook_id_fk", + "tableFrom": "runbook_variable", + "tableTo": "runbook", + "columnsFrom": [ + "runbook_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.entity_role": { + "name": "entity_role", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "entity_type": { + "name": "entity_type", + "type": "entity_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "entity_id": { + "name": "entity_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "scope_id": { + "name": "scope_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "scope_type": { + "name": "scope_type", + "type": "scope_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "entity_role_role_id_entity_type_entity_id_scope_id_scope_type_index": { + "name": "entity_role_role_id_entity_type_entity_id_scope_id_scope_type_index", + "columns": [ + { + "expression": "role_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "entity_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "entity_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "scope_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "scope_type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "entity_role_role_id_role_id_fk": { + "name": "entity_role_role_id_role_id_fk", + "tableFrom": "entity_role", + "tableTo": "role", + "columnsFrom": [ + "role_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.role": { + "name": "role", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "role_workspace_id_workspace_id_fk": { + "name": "role_workspace_id_workspace_id_fk", + "tableFrom": "role", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.role_permission": { + "name": "role_permission", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "permission": { + "name": "permission", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "role_permission_role_id_permission_index": { + "name": "role_permission_role_id_permission_index", + "columns": [ + { + "expression": "role_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "permission", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "role_permission_role_id_role_id_fk": { + "name": "role_permission_role_id_role_id_fk", + "tableFrom": "role_permission", + "tableTo": "role", + "columnsFrom": [ + "role_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.job_agent": { + "name": "job_agent", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "config": { + "name": "config", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + } + }, + "indexes": { + "job_agent_workspace_id_name_index": { + "name": "job_agent_workspace_id_name_index", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "job_agent_workspace_id_workspace_id_fk": { + "name": "job_agent_workspace_id_workspace_id_fk", + "tableFrom": "job_agent", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.environment_policy_deployment_version_channel": { + "name": "environment_policy_deployment_version_channel", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "policy_id": { + "name": "policy_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "channel_id": { + "name": "channel_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "deployment_id": { + "name": "deployment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "environment_policy_deployment_version_channel_policy_id_channel_id_index": { + "name": "environment_policy_deployment_version_channel_policy_id_channel_id_index", + "columns": [ + { + "expression": "policy_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "channel_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "environment_policy_deployment_version_channel_policy_id_deployment_id_index": { + "name": "environment_policy_deployment_version_channel_policy_id_deployment_id_index", + "columns": [ + { + "expression": "policy_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deployment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "environment_policy_deployment_version_channel_policy_id_environment_policy_id_fk": { + "name": "environment_policy_deployment_version_channel_policy_id_environment_policy_id_fk", + "tableFrom": "environment_policy_deployment_version_channel", + "tableTo": "environment_policy", + "columnsFrom": [ + "policy_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "environment_policy_deployment_version_channel_channel_id_deployment_version_channel_id_fk": { + "name": "environment_policy_deployment_version_channel_channel_id_deployment_version_channel_id_fk", + "tableFrom": "environment_policy_deployment_version_channel", + "tableTo": "deployment_version_channel", + "columnsFrom": [ + "channel_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "environment_policy_deployment_version_channel_deployment_id_deployment_id_fk": { + "name": "environment_policy_deployment_version_channel_deployment_id_deployment_id_fk", + "tableFrom": "environment_policy_deployment_version_channel", + "tableTo": "deployment", + "columnsFrom": [ + "deployment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.release_job_trigger": { + "name": "release_job_trigger", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "job_id": { + "name": "job_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "release_job_trigger_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "caused_by_id": { + "name": "caused_by_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "deployment_version_id": { + "name": "deployment_version_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "resource_id": { + "name": "resource_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "release_job_trigger_job_id_job_id_fk": { + "name": "release_job_trigger_job_id_job_id_fk", + "tableFrom": "release_job_trigger", + "tableTo": "job", + "columnsFrom": [ + "job_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "release_job_trigger_caused_by_id_user_id_fk": { + "name": "release_job_trigger_caused_by_id_user_id_fk", + "tableFrom": "release_job_trigger", + "tableTo": "user", + "columnsFrom": [ + "caused_by_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "release_job_trigger_deployment_version_id_deployment_version_id_fk": { + "name": "release_job_trigger_deployment_version_id_deployment_version_id_fk", + "tableFrom": "release_job_trigger", + "tableTo": "deployment_version", + "columnsFrom": [ + "deployment_version_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "release_job_trigger_resource_id_resource_id_fk": { + "name": "release_job_trigger_resource_id_resource_id_fk", + "tableFrom": "release_job_trigger", + "tableTo": "resource", + "columnsFrom": [ + "resource_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "release_job_trigger_environment_id_environment_id_fk": { + "name": "release_job_trigger_environment_id_environment_id_fk", + "tableFrom": "release_job_trigger", + "tableTo": "environment", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "release_job_trigger_job_id_unique": { + "name": "release_job_trigger_job_id_unique", + "nullsNotDistinct": false, + "columns": [ + "job_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.computed_policy_target_release_target": { + "name": "computed_policy_target_release_target", + "schema": "", + "columns": { + "policy_target_id": { + "name": "policy_target_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "release_target_id": { + "name": "release_target_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "computed_policy_target_release_target_policy_target_id_policy_target_id_fk": { + "name": "computed_policy_target_release_target_policy_target_id_policy_target_id_fk", + "tableFrom": "computed_policy_target_release_target", + "tableTo": "policy_target", + "columnsFrom": [ + "policy_target_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "computed_policy_target_release_target_release_target_id_release_target_id_fk": { + "name": "computed_policy_target_release_target_release_target_id_release_target_id_fk", + "tableFrom": "computed_policy_target_release_target", + "tableTo": "release_target", + "columnsFrom": [ + "release_target_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "computed_policy_target_release_target_policy_target_id_release_target_id_pk": { + "name": "computed_policy_target_release_target_policy_target_id_release_target_id_pk", + "columns": [ + "policy_target_id", + "release_target_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.policy": { + "name": "policy", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "priority": { + "name": "priority", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "policy_workspace_id_workspace_id_fk": { + "name": "policy_workspace_id_workspace_id_fk", + "tableFrom": "policy", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "policy_workspace_id_name_unique": { + "name": "policy_workspace_id_name_unique", + "nullsNotDistinct": false, + "columns": [ + "workspace_id", + "name" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.policy_target": { + "name": "policy_target", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "policy_id": { + "name": "policy_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "deployment_selector": { + "name": "deployment_selector", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "environment_selector": { + "name": "environment_selector", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "resource_selector": { + "name": "resource_selector", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": {}, + "foreignKeys": { + "policy_target_policy_id_policy_id_fk": { + "name": "policy_target_policy_id_policy_id_fk", + "tableFrom": "policy_target", + "tableTo": "policy", + "columnsFrom": [ + "policy_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.release": { + "name": "release", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "version_release_id": { + "name": "version_release_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "variable_release_id": { + "name": "variable_release_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "release_version_release_id_version_release_id_fk": { + "name": "release_version_release_id_version_release_id_fk", + "tableFrom": "release", + "tableTo": "version_release", + "columnsFrom": [ + "version_release_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "release_variable_release_id_variable_set_release_id_fk": { + "name": "release_variable_release_id_variable_set_release_id_fk", + "tableFrom": "release", + "tableTo": "variable_set_release", + "columnsFrom": [ + "variable_release_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.release_job": { + "name": "release_job", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "release_id": { + "name": "release_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "job_id": { + "name": "job_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "release_job_release_id_release_id_fk": { + "name": "release_job_release_id_release_id_fk", + "tableFrom": "release_job", + "tableTo": "release", + "columnsFrom": [ + "release_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "release_job_job_id_job_id_fk": { + "name": "release_job_job_id_job_id_fk", + "tableFrom": "release_job", + "tableTo": "job", + "columnsFrom": [ + "job_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.release_target": { + "name": "release_target", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "resource_id": { + "name": "resource_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "environment_id": { + "name": "environment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "deployment_id": { + "name": "deployment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "desired_release_id": { + "name": "desired_release_id", + "type": "uuid", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": { + "release_target_resource_id_environment_id_deployment_id_index": { + "name": "release_target_resource_id_environment_id_deployment_id_index", + "columns": [ + { + "expression": "resource_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "environment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deployment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "release_target_resource_id_resource_id_fk": { + "name": "release_target_resource_id_resource_id_fk", + "tableFrom": "release_target", + "tableTo": "resource", + "columnsFrom": [ + "resource_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "release_target_environment_id_environment_id_fk": { + "name": "release_target_environment_id_environment_id_fk", + "tableFrom": "release_target", + "tableTo": "environment", + "columnsFrom": [ + "environment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "release_target_deployment_id_deployment_id_fk": { + "name": "release_target_deployment_id_deployment_id_fk", + "tableFrom": "release_target", + "tableTo": "deployment", + "columnsFrom": [ + "deployment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "release_target_desired_release_id_release_id_fk": { + "name": "release_target_desired_release_id_release_id_fk", + "tableFrom": "release_target", + "tableTo": "release", + "columnsFrom": [ + "desired_release_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.variable_set_release": { + "name": "variable_set_release", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "release_target_id": { + "name": "release_target_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "variable_set_release_release_target_id_release_target_id_fk": { + "name": "variable_set_release_release_target_id_release_target_id_fk", + "tableFrom": "variable_set_release", + "tableTo": "release_target", + "columnsFrom": [ + "release_target_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.variable_set_release_value": { + "name": "variable_set_release_value", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "variable_set_release_id": { + "name": "variable_set_release_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "variable_value_snapshot_id": { + "name": "variable_value_snapshot_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "variable_set_release_value_variable_set_release_id_variable_value_snapshot_id_index": { + "name": "variable_set_release_value_variable_set_release_id_variable_value_snapshot_id_index", + "columns": [ + { + "expression": "variable_set_release_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "variable_value_snapshot_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "variable_set_release_value_variable_set_release_id_variable_set_release_id_fk": { + "name": "variable_set_release_value_variable_set_release_id_variable_set_release_id_fk", + "tableFrom": "variable_set_release_value", + "tableTo": "variable_set_release", + "columnsFrom": [ + "variable_set_release_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "variable_set_release_value_variable_value_snapshot_id_variable_value_snapshot_id_fk": { + "name": "variable_set_release_value_variable_value_snapshot_id_variable_value_snapshot_id_fk", + "tableFrom": "variable_set_release_value", + "tableTo": "variable_value_snapshot", + "columnsFrom": [ + "variable_value_snapshot_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.variable_value_snapshot": { + "name": "variable_value_snapshot", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sensitive": { + "name": "sensitive", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "variable_value_snapshot_workspace_id_key_value_index": { + "name": "variable_value_snapshot_workspace_id_key_value_index", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "value", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "variable_value_snapshot_workspace_id_workspace_id_fk": { + "name": "variable_value_snapshot_workspace_id_workspace_id_fk", + "tableFrom": "variable_value_snapshot", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.version_release": { + "name": "version_release", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "release_target_id": { + "name": "release_target_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "version_id": { + "name": "version_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "version_release_release_target_id_release_target_id_fk": { + "name": "version_release_release_target_id_release_target_id_fk", + "tableFrom": "version_release", + "tableTo": "release_target", + "columnsFrom": [ + "release_target_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "version_release_version_id_deployment_version_id_fk": { + "name": "version_release_version_id_deployment_version_id_fk", + "tableFrom": "version_release", + "tableTo": "deployment_version", + "columnsFrom": [ + "version_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.policy_rule_deny_window": { + "name": "policy_rule_deny_window", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "policy_id": { + "name": "policy_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "rrule": { + "name": "rrule", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "dtend": { + "name": "dtend", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "time_zone": { + "name": "time_zone", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "policy_rule_deny_window_policy_id_policy_id_fk": { + "name": "policy_rule_deny_window_policy_id_policy_id_fk", + "tableFrom": "policy_rule_deny_window", + "tableTo": "policy", + "columnsFrom": [ + "policy_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.policy_rule_user_approval": { + "name": "policy_rule_user_approval", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "policy_id": { + "name": "policy_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "policy_rule_user_approval_policy_id_policy_id_fk": { + "name": "policy_rule_user_approval_policy_id_policy_id_fk", + "tableFrom": "policy_rule_user_approval", + "tableTo": "policy", + "columnsFrom": [ + "policy_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "policy_rule_user_approval_user_id_user_id_fk": { + "name": "policy_rule_user_approval_user_id_user_id_fk", + "tableFrom": "policy_rule_user_approval", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.policy_rule_user_approval_record": { + "name": "policy_rule_user_approval_record", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "deployment_version_id": { + "name": "deployment_version_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "approval_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "approved_at": { + "name": "approved_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "rule_id": { + "name": "rule_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "policy_rule_user_approval_record_user_id_user_id_fk": { + "name": "policy_rule_user_approval_record_user_id_user_id_fk", + "tableFrom": "policy_rule_user_approval_record", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "policy_rule_user_approval_record_rule_id_policy_rule_user_approval_id_fk": { + "name": "policy_rule_user_approval_record_rule_id_policy_rule_user_approval_id_fk", + "tableFrom": "policy_rule_user_approval_record", + "tableTo": "policy_rule_user_approval", + "columnsFrom": [ + "rule_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.policy_rule_role_approval": { + "name": "policy_rule_role_approval", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "policy_id": { + "name": "policy_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "role_id": { + "name": "role_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "required_approvals_count": { + "name": "required_approvals_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + } + }, + "indexes": {}, + "foreignKeys": { + "policy_rule_role_approval_policy_id_policy_id_fk": { + "name": "policy_rule_role_approval_policy_id_policy_id_fk", + "tableFrom": "policy_rule_role_approval", + "tableTo": "policy", + "columnsFrom": [ + "policy_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "policy_rule_role_approval_role_id_role_id_fk": { + "name": "policy_rule_role_approval_role_id_role_id_fk", + "tableFrom": "policy_rule_role_approval", + "tableTo": "role", + "columnsFrom": [ + "role_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.policy_rule_role_approval_record": { + "name": "policy_rule_role_approval_record", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "deployment_version_id": { + "name": "deployment_version_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "approval_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "approved_at": { + "name": "approved_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "rule_id": { + "name": "rule_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "policy_rule_role_approval_record_user_id_user_id_fk": { + "name": "policy_rule_role_approval_record_user_id_user_id_fk", + "tableFrom": "policy_rule_role_approval_record", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "policy_rule_role_approval_record_rule_id_policy_rule_role_approval_id_fk": { + "name": "policy_rule_role_approval_record_rule_id_policy_rule_role_approval_id_fk", + "tableFrom": "policy_rule_role_approval_record", + "tableTo": "policy_rule_role_approval", + "columnsFrom": [ + "rule_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.policy_rule_any_approval": { + "name": "policy_rule_any_approval", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "policy_id": { + "name": "policy_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "required_approvals_count": { + "name": "required_approvals_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + } + }, + "indexes": {}, + "foreignKeys": { + "policy_rule_any_approval_policy_id_policy_id_fk": { + "name": "policy_rule_any_approval_policy_id_policy_id_fk", + "tableFrom": "policy_rule_any_approval", + "tableTo": "policy", + "columnsFrom": [ + "policy_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.policy_rule_any_approval_record": { + "name": "policy_rule_any_approval_record", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "deployment_version_id": { + "name": "deployment_version_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "approval_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "approved_at": { + "name": "approved_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "unique_rule_id_user_id": { + "name": "unique_rule_id_user_id", + "columns": [ + { + "expression": "deployment_version_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "policy_rule_any_approval_record_user_id_user_id_fk": { + "name": "policy_rule_any_approval_record_user_id_user_id_fk", + "tableFrom": "policy_rule_any_approval_record", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.policy_rule_deployment_version_selector": { + "name": "policy_rule_deployment_version_selector", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "policy_id": { + "name": "policy_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "deployment_version_selector": { + "name": "deployment_version_selector", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "policy_rule_deployment_version_selector_policy_id_policy_id_fk": { + "name": "policy_rule_deployment_version_selector_policy_id_policy_id_fk", + "tableFrom": "policy_rule_deployment_version_selector", + "tableTo": "policy", + "columnsFrom": [ + "policy_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "policy_rule_deployment_version_selector_policy_id_unique": { + "name": "policy_rule_deployment_version_selector_policy_id_unique", + "nullsNotDistinct": false, + "columns": [ + "policy_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resource_relationship_rule": { + "name": "resource_relationship_rule", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "reference": { + "name": "reference", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dependency_type": { + "name": "dependency_type", + "type": "resource_dependency_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "dependency_description": { + "name": "dependency_description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "source_kind": { + "name": "source_kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_version": { + "name": "source_version", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "target_kind": { + "name": "target_kind", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "target_version": { + "name": "target_version", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "unique_resource_relationship_rule_reference": { + "name": "unique_resource_relationship_rule_reference", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "reference", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "source_kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "source_version", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "resource_relationship_rule_workspace_id_workspace_id_fk": { + "name": "resource_relationship_rule_workspace_id_workspace_id_fk", + "tableFrom": "resource_relationship_rule", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resource_relationship_rule_metadata_equals": { + "name": "resource_relationship_rule_metadata_equals", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "resource_relationship_rule_id": { + "name": "resource_relationship_rule_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "unique_resource_relationship_rule_metadata_equals": { + "name": "unique_resource_relationship_rule_metadata_equals", + "columns": [ + { + "expression": "resource_relationship_rule_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "resource_relationship_rule_metadata_equals_resource_relationship_rule_id_resource_relationship_rule_id_fk": { + "name": "resource_relationship_rule_metadata_equals_resource_relationship_rule_id_resource_relationship_rule_id_fk", + "tableFrom": "resource_relationship_rule_metadata_equals", + "tableTo": "resource_relationship_rule", + "columnsFrom": [ + "resource_relationship_rule_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resource_relationship_rule_metadata_match": { + "name": "resource_relationship_rule_metadata_match", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "resource_relationship_rule_id": { + "name": "resource_relationship_rule_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "unique_resource_relationship_rule_metadata_match": { + "name": "unique_resource_relationship_rule_metadata_match", + "columns": [ + { + "expression": "resource_relationship_rule_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "resource_relationship_rule_metadata_match_resource_relationship_rule_id_resource_relationship_rule_id_fk": { + "name": "resource_relationship_rule_metadata_match_resource_relationship_rule_id_resource_relationship_rule_id_fk", + "tableFrom": "resource_relationship_rule_metadata_match", + "tableTo": "resource_relationship_rule", + "columnsFrom": [ + "resource_relationship_rule_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.system_role": { + "name": "system_role", + "schema": "public", + "values": [ + "user", + "admin" + ] + }, + "public.deployment_version_status": { + "name": "deployment_version_status", + "schema": "public", + "values": [ + "building", + "ready", + "failed" + ] + }, + "public.environment_policy_approval_requirement": { + "name": "environment_policy_approval_requirement", + "schema": "public", + "values": [ + "manual", + "automatic" + ] + }, + "public.approval_status_type": { + "name": "approval_status_type", + "schema": "public", + "values": [ + "pending", + "approved", + "rejected" + ] + }, + "public.environment_policy_deployment_success_type": { + "name": "environment_policy_deployment_success_type", + "schema": "public", + "values": [ + "all", + "some", + "optional" + ] + }, + "public.recurrence_type": { + "name": "recurrence_type", + "schema": "public", + "values": [ + "hourly", + "daily", + "weekly", + "monthly" + ] + }, + "public.release_sequencing_type": { + "name": "release_sequencing_type", + "schema": "public", + "values": [ + "wait", + "cancel" + ] + }, + "public.github_entity_type": { + "name": "github_entity_type", + "schema": "public", + "values": [ + "organization", + "user" + ] + }, + "public.resource_relationship_type": { + "name": "resource_relationship_type", + "schema": "public", + "values": [ + "associated_with", + "depends_on" + ] + }, + "public.job_reason": { + "name": "job_reason", + "schema": "public", + "values": [ + "policy_passing", + "policy_override", + "env_policy_override", + "config_policy_override" + ] + }, + "public.job_status": { + "name": "job_status", + "schema": "public", + "values": [ + "cancelled", + "skipped", + "in_progress", + "action_required", + "pending", + "failure", + "invalid_job_agent", + "invalid_integration", + "external_run_not_found", + "successful" + ] + }, + "public.entity_type": { + "name": "entity_type", + "schema": "public", + "values": [ + "user", + "team" + ] + }, + "public.scope_type": { + "name": "scope_type", + "schema": "public", + "values": [ + "deploymentVersion", + "deploymentVersionChannel", + "resource", + "resourceProvider", + "resourceMetadataGroup", + "workspace", + "environment", + "environmentPolicy", + "deploymentVariable", + "variableSet", + "system", + "deployment", + "job", + "jobAgent", + "runbook", + "policy", + "resourceView", + "releaseTarget" + ] + }, + "public.release_job_trigger_type": { + "name": "release_job_trigger_type", + "schema": "public", + "values": [ + "new_version", + "version_updated", + "new_resource", + "resource_changed", + "api", + "redeploy", + "force_deploy", + "new_environment", + "variable_changed", + "retry" + ] + }, + "public.approval_status": { + "name": "approval_status", + "schema": "public", + "values": [ + "approved", + "rejected" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/packages/db/drizzle/meta/_journal.json b/packages/db/drizzle/meta/_journal.json index 407f08fa4..e314e3151 100644 --- a/packages/db/drizzle/meta/_journal.json +++ b/packages/db/drizzle/meta/_journal.json @@ -694,6 +694,13 @@ "when": 1746421492060, "tag": "0098_fair_abomination", "breakpoints": true + }, + { + "idx": 99, + "version": "7", + "when": 1746469060223, + "tag": "0099_dear_korg", + "breakpoints": true } ] -} +} \ No newline at end of file diff --git a/packages/db/src/queries/get-resource-parents.ts b/packages/db/src/queries/get-resource-parents.ts index 457ffe9df..e0b839808 100644 --- a/packages/db/src/queries/get-resource-parents.ts +++ b/packages/db/src/queries/get-resource-parents.ts @@ -5,6 +5,7 @@ import _ from "lodash"; import type { Tx } from "../common.js"; import { resourceRelationshipRule, + resourceRelationshipRuleMetadataEquals, resourceRelationshipRuleMetadataMatch, } from "../schema/resource-relationship-rule.js"; import { resource, resourceMetadata } from "../schema/resource.js"; @@ -23,8 +24,11 @@ export const getResourceParents = async (tx: Tx, resourceId: string) => { workspaceId: resourceRelationshipRule.workspaceId, reference: resourceRelationshipRule.reference, dependencyType: resourceRelationshipRule.dependencyType, - metadataKeys: count(resourceRelationshipRuleMetadataMatch).as( - "metadataKeys", + metadataKeysMatches: count(resourceRelationshipRuleMetadataMatch).as( + "metadataKeysMatches", + ), + metadataKeysEquals: count(resourceRelationshipRuleMetadataEquals).as( + "metadataKeysEquals", ), targetKind: resourceRelationshipRule.targetKind, targetVersion: resourceRelationshipRule.targetVersion, @@ -39,6 +43,13 @@ export const getResourceParents = async (tx: Tx, resourceId: string) => { resourceRelationshipRuleMetadataMatch.resourceRelationshipRuleId, ), ) + .leftJoin( + resourceRelationshipRuleMetadataEquals, + eq( + resourceRelationshipRule.id, + resourceRelationshipRuleMetadataEquals.resourceRelationshipRuleId, + ), + ) .groupBy(resourceRelationshipRule.id) .as("rulesWithCount"); @@ -99,10 +110,28 @@ export const getResourceParents = async (tx: Tx, resourceId: string) => { resourceRelationshipRuleMetadataMatch.resourceRelationshipRuleId, ), ) + .leftJoin( + resourceRelationshipRuleMetadataEquals, + eq( + rulesWithCount.id, + resourceRelationshipRuleMetadataEquals.resourceRelationshipRuleId, + ), + ) .where( and( eq(sourceResource.id, resourceId), eq(sourceMetadata.key, resourceRelationshipRuleMetadataMatch.key), + or( + isNull(resourceRelationshipRuleMetadataEquals.key), + eq(targetMetadata.key, resourceRelationshipRuleMetadataEquals.key), + ), + or( + isNull(resourceRelationshipRuleMetadataEquals.value), + eq( + targetMetadata.value, + resourceRelationshipRuleMetadataEquals.value, + ), + ), ), ) .groupBy( @@ -112,11 +141,17 @@ export const getResourceParents = async (tx: Tx, resourceId: string) => { rulesWithCount.id, rulesWithCount.reference, rulesWithCount.dependencyType, - rulesWithCount.metadataKeys, + rulesWithCount.metadataKeysMatches, + rulesWithCount.metadataKeysEquals, ) // Only return relationships where the number of matching metadata keys // equals the number required by the rule (ensures ALL keys match) - .having(eq(count(sourceMetadata.key), rulesWithCount.metadataKeys)); + .having( + and( + eq(count(sourceMetadata.key), rulesWithCount.metadataKeysMatches), + eq(count(sourceMetadata.key), rulesWithCount.metadataKeysEquals), + ), + ); const relatipnshipTargets = async () => await tx.query.resource diff --git a/packages/db/src/schema/resource-relationship-rule.ts b/packages/db/src/schema/resource-relationship-rule.ts index 7f93adecc..26cc0b009 100644 --- a/packages/db/src/schema/resource-relationship-rule.ts +++ b/packages/db/src/schema/resource-relationship-rule.ts @@ -85,6 +85,27 @@ export const resourceRelationshipRule = pgTable( ], ); +export const resourceRelationshipRuleMetadataEquals = pgTable( + "resource_relationship_rule_metadata_equals", + { + id: uuid("id").primaryKey().defaultRandom(), + resourceRelationshipRuleId: uuid("resource_relationship_rule_id") + .notNull() + .references(() => resourceRelationshipRule.id, { + onDelete: "cascade", + }), + + key: text("key").notNull(), + value: text("value").notNull(), + }, + (t) => [ + uniqueIndex("unique_resource_relationship_rule_metadata_equals").on( + t.resourceRelationshipRuleId, + t.key, + ), + ], +); + export const resourceRelationshipRuleMetadataMatch = pgTable( "resource_relationship_rule_metadata_match", { From c0478d051726f1078e21e438984489a14fc05dea Mon Sep 17 00:00:00 2001 From: Aditya Choudhari <48932219+adityachoudhari26@users.noreply.github.com> Date: Mon, 5 May 2025 18:44:56 -0700 Subject: [PATCH 2/5] refactor: relationship query uses both types of matching rules (#549) --- .../src/app/api/v1/jobs/[jobId]/get-job.ts | 2 +- .../[ruleId]/openapi.ts | 106 ++ .../[ruleId]/route.ts | 131 ++ .../v1/resource-relationship-rules/openapi.ts | 47 +- .../v1/resource-relationship-rules/route.ts | 172 +-- e2e/api/schema.ts | 121 +- e2e/tests/api/resource-relationships.spec.ts | 109 +- openapi.v1.json | 200 ++- .../src/router/resource-relationship-rules.ts | 4 +- packages/auth/src/utils/rbac.ts | 22 + packages/db/drizzle/meta/0099_snapshot.json | 1067 ++++------------- packages/db/drizzle/meta/_journal.json | 2 +- .../db/src/queries/get-resource-parents.ts | 232 ++-- packages/db/src/schema/rbac.ts | 1 + .../src/schema/resource-relationship-rule.ts | 26 +- packages/validators/src/auth/index.ts | 4 + 16 files changed, 1157 insertions(+), 1089 deletions(-) create mode 100644 apps/webservice/src/app/api/v1/resource-relationship-rules/[ruleId]/openapi.ts create mode 100644 apps/webservice/src/app/api/v1/resource-relationship-rules/[ruleId]/route.ts diff --git a/apps/webservice/src/app/api/v1/jobs/[jobId]/get-job.ts b/apps/webservice/src/app/api/v1/jobs/[jobId]/get-job.ts index a66bd81b6..1b8eff6aa 100644 --- a/apps/webservice/src/app/api/v1/jobs/[jobId]/get-job.ts +++ b/apps/webservice/src/app/api/v1/jobs/[jobId]/get-job.ts @@ -1,7 +1,7 @@ import type { Tx } from "@ctrlplane/db"; -import { getResourceParents } from "node_modules/@ctrlplane/db/src/queries/get-resource-parents"; import { eq } from "@ctrlplane/db"; +import { getResourceParents } from "@ctrlplane/db/queries"; import * as schema from "@ctrlplane/db/schema"; import { logger } from "@ctrlplane/logger"; import { variablesAES256 } from "@ctrlplane/secrets"; diff --git a/apps/webservice/src/app/api/v1/resource-relationship-rules/[ruleId]/openapi.ts b/apps/webservice/src/app/api/v1/resource-relationship-rules/[ruleId]/openapi.ts new file mode 100644 index 000000000..a59868526 --- /dev/null +++ b/apps/webservice/src/app/api/v1/resource-relationship-rules/[ruleId]/openapi.ts @@ -0,0 +1,106 @@ +import type { Swagger } from "atlassian-openapi"; + +export const openapi: Swagger.SwaggerV3 = { + openapi: "3.0.0", + info: { + title: "Ctrlplane API", + version: "1.0.0", + }, + components: { + schemas: { + UpdateResourceRelationshipRule: { + type: "object", + properties: { + name: { type: "string" }, + reference: { type: "string" }, + dependencyType: { + $ref: "#/components/schemas/ResourceRelationshipRuleDependencyType", + }, + dependencyDescription: { type: "string" }, + description: { type: "string" }, + sourceKind: { type: "string" }, + sourceVersion: { type: "string" }, + targetKind: { type: "string" }, + targetVersion: { type: "string" }, + metadataKeysMatch: { + type: "array", + items: { type: "string" }, + }, + metadataKeysEquals: { + type: "array", + items: { + type: "object", + properties: { + key: { type: "string" }, + value: { type: "string" }, + }, + required: ["key", "value"], + }, + }, + }, + }, + }, + }, + paths: { + "/v1/resource-relationship-rules/{ruleId}": { + patch: { + summary: "Update a resource relationship rule", + operationId: "updateResourceRelationshipRule", + parameters: [ + { + name: "ruleId", + in: "path", + required: true, + schema: { type: "string", format: "uuid" }, + }, + ], + requestBody: { + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/UpdateResourceRelationshipRule", + }, + }, + }, + }, + responses: { + 200: { + description: "The updated resource relationship rule", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/ResourceRelationshipRule", + }, + }, + }, + }, + 404: { + description: "The resource relationship rule was not found", + content: { + "application/json": { + schema: { + type: "object", + properties: { error: { type: "string" } }, + required: ["error"], + }, + }, + }, + }, + 500: { + description: + "An error occurred while updating the resource relationship rule", + content: { + "application/json": { + schema: { + type: "object", + properties: { error: { type: "string" } }, + required: ["error"], + }, + }, + }, + }, + }, + }, + }, + }, +}; diff --git a/apps/webservice/src/app/api/v1/resource-relationship-rules/[ruleId]/route.ts b/apps/webservice/src/app/api/v1/resource-relationship-rules/[ruleId]/route.ts new file mode 100644 index 000000000..34e4c532b --- /dev/null +++ b/apps/webservice/src/app/api/v1/resource-relationship-rules/[ruleId]/route.ts @@ -0,0 +1,131 @@ +import type { Tx } from "@ctrlplane/db"; +import type { z } from "zod"; +import { NextResponse } from "next/server"; +import { INTERNAL_SERVER_ERROR, NOT_FOUND } from "http-status"; +import _ from "lodash"; + +import { eq, takeFirst } from "@ctrlplane/db"; +import * as schema from "@ctrlplane/db/schema"; +import { logger } from "@ctrlplane/logger"; +import { Permission } from "@ctrlplane/validators/auth"; + +import { authn, authz } from "~/app/api/v1/auth"; +import { parseBody } from "~/app/api/v1/body-parser"; +import { request } from "~/app/api/v1/middleware"; + +const log = logger.child({ route: "/v1/resource-relationship-rules/[ruleId]" }); + +const replaceMetadataMatchRules = async ( + tx: Tx, + ruleId: string, + metadataKeysMatch?: string[], +) => { + await tx + .delete(schema.resourceRelationshipRuleMetadataMatch) + .where( + eq( + schema.resourceRelationshipRuleMetadataMatch.resourceRelationshipRuleId, + ruleId, + ), + ); + + const metadataKeys = _.uniq(metadataKeysMatch ?? []); + if (metadataKeys.length > 0) + await tx.insert(schema.resourceRelationshipRuleMetadataMatch).values( + metadataKeys.map((key) => ({ + resourceRelationshipRuleId: ruleId, + key, + })), + ); + + return metadataKeys; +}; + +const replaceMetadataEqualsRules = async ( + tx: Tx, + ruleId: string, + metadataKeysEquals?: { key: string; value: string }[], +) => { + await tx + .delete(schema.resourceRelationshipRuleMetadataEquals) + .where( + eq( + schema.resourceRelationshipRuleMetadataEquals + .resourceRelationshipRuleId, + ruleId, + ), + ); + + const metadataKeys = _.uniqBy(metadataKeysEquals ?? [], (m) => m.key); + if (metadataKeys.length > 0) + await tx.insert(schema.resourceRelationshipRuleMetadataEquals).values( + metadataKeys.map(({ key, value }) => ({ + resourceRelationshipRuleId: ruleId, + key, + value, + })), + ); + + return metadataKeys; +}; + +export const PATCH = request() + .use(authn) + .use(parseBody(schema.updateResourceRelationshipRule)) + .use( + authz(({ can, params }) => + can.perform(Permission.ResourceRelationshipRuleUpdate).on({ + type: "resourceRelationshipRule", + id: params.ruleId ?? "", + }), + ), + ) + .handle< + { body: z.infer }, + { params: Promise<{ ruleId: string }> } + >(async ({ db, body }, { params }) => { + try { + const { ruleId } = await params; + + const existingRule = await db.query.resourceRelationshipRule.findFirst({ + where: eq(schema.resourceRelationshipRule.id, ruleId), + }); + + if (!existingRule) + return NextResponse.json( + { error: "Resource relationship rule not found" }, + { status: NOT_FOUND }, + ); + + const rule = await db.transaction(async (tx) => { + const rule = await tx + .update(schema.resourceRelationshipRule) + .set(body) + .where(eq(schema.resourceRelationshipRule.id, ruleId)) + .returning() + .then(takeFirst); + + const metadataKeysMatch = await replaceMetadataMatchRules( + tx, + ruleId, + body.metadataKeysMatch, + ); + + const metadataKeysEquals = await replaceMetadataEqualsRules( + tx, + ruleId, + body.metadataKeysEquals, + ); + + return { ...rule, metadataKeysMatch, metadataKeysEquals }; + }); + + return NextResponse.json(rule); + } catch (error) { + log.error(error); + return NextResponse.json( + { error: "Failed to update resource relationship rule" }, + { status: INTERNAL_SERVER_ERROR }, + ); + } + }); diff --git a/apps/webservice/src/app/api/v1/resource-relationship-rules/openapi.ts b/apps/webservice/src/app/api/v1/resource-relationship-rules/openapi.ts index 7cae1efb1..68f97e92d 100644 --- a/apps/webservice/src/app/api/v1/resource-relationship-rules/openapi.ts +++ b/apps/webservice/src/app/api/v1/resource-relationship-rules/openapi.ts @@ -10,7 +10,7 @@ export const openapi: Swagger.SwaggerV3 = { "/v1/resource-relationship-rules": { post: { summary: "Create a resource relationship rule", - operationId: "upsertResourceRelationshipRule", + operationId: "createResourceRelationshipRule", requestBody: { required: true, content: { @@ -32,7 +32,20 @@ export const openapi: Swagger.SwaggerV3 = { }, }, }, - "400": { + "409": { + description: "Resource relationship rule already exists", + content: { + "application/json": { + schema: { + type: "object", + properties: { + error: { type: "string" }, + }, + }, + }, + }, + }, + "500": { description: "Failed to create resource relationship rule", content: { "application/json": { @@ -65,8 +78,8 @@ export const openapi: Swagger.SwaggerV3 = { ResourceRelationshipRule: { type: "object", properties: { - id: { type: "string" }, - workspaceId: { type: "string" }, + id: { type: "string", format: "uuid" }, + workspaceId: { type: "string", format: "uuid" }, name: { type: "string" }, reference: { type: "string" }, dependencyType: { @@ -78,6 +91,20 @@ export const openapi: Swagger.SwaggerV3 = { sourceVersion: { type: "string" }, targetKind: { type: "string" }, targetVersion: { type: "string" }, + metadataKeysMatch: { + type: "array", + items: { type: "string" }, + }, + metadataKeysEquals: { + type: "array", + items: { + type: "object", + properties: { + key: { type: "string" }, + value: { type: "string" }, + }, + }, + }, }, required: [ "id", @@ -108,6 +135,17 @@ export const openapi: Swagger.SwaggerV3 = { type: "array", items: { type: "string" }, }, + metadataKeysEquals: { + type: "array", + items: { + type: "object", + properties: { + key: { type: "string" }, + value: { type: "string" }, + }, + required: ["key", "value"], + }, + }, }, required: [ "workspaceId", @@ -118,7 +156,6 @@ export const openapi: Swagger.SwaggerV3 = { "sourceVersion", "targetKind", "targetVersion", - "metadataKeysMatch", ], }, }, diff --git a/apps/webservice/src/app/api/v1/resource-relationship-rules/route.ts b/apps/webservice/src/app/api/v1/resource-relationship-rules/route.ts index a61689833..6ff8543c8 100644 --- a/apps/webservice/src/app/api/v1/resource-relationship-rules/route.ts +++ b/apps/webservice/src/app/api/v1/resource-relationship-rules/route.ts @@ -1,135 +1,95 @@ +import type { z } from "zod"; import { NextResponse } from "next/server"; import { and, eq } from "drizzle-orm"; +import { CONFLICT, INTERNAL_SERVER_ERROR } from "http-status"; import _ from "lodash"; -import { z } from "zod"; -import { takeFirstOrNull } from "@ctrlplane/db"; +import { takeFirst } from "@ctrlplane/db"; import * as schema from "@ctrlplane/db/schema"; +import { logger } from "@ctrlplane/logger"; import { Permission } from "@ctrlplane/validators/auth"; import { authn, authz } from "../auth"; import { parseBody } from "../body-parser"; import { request } from "../middleware"; -const body = z.object({ - workspaceId: z.string(), - name: z.string(), - reference: z.string(), - dependencyType: z.string(), - dependencyDescription: z.string().optional(), - description: z.string().optional(), - sourceKind: z.string(), - sourceVersion: z.string(), - targetKind: z.string().nullable().optional(), - targetVersion: z.string().nullable().optional(), - - metadataKeysMatch: z.array(z.string()).optional(), -}); +const log = logger.child({ route: "/v1/resource-relationship-rules" }); export const POST = request() .use(authn) - .use(parseBody(body)) + .use(parseBody(schema.createResourceRelationshipRule)) .use( authz(({ ctx, can }) => can - .perform(Permission.SystemUpdate) + .perform(Permission.ResourceRelationshipRuleCreate) .on({ type: "workspace", id: ctx.body.workspaceId }), ), ) - .handle<{ body: z.infer }>(async ({ db, body }) => { - const upsertedResourceRelationshipRule = await db.transaction( - async (tx) => { - // Check if rule already exists based on workspace, reference, and dependency type - const existingRule = await tx - .select() - .from(schema.resourceRelationshipRule) - .where( - and( - eq(schema.resourceRelationshipRule.workspaceId, body.workspaceId), - eq(schema.resourceRelationshipRule.reference, body.reference), - eq( - schema.resourceRelationshipRule.dependencyType, - body.dependencyType as any, - ), + .handle<{ body: z.infer }>( + async ({ db, body }) => { + try { + const existingRule = await db.query.resourceRelationshipRule.findFirst({ + where: and( + eq(schema.resourceRelationshipRule.workspaceId, body.workspaceId), + eq(schema.resourceRelationshipRule.reference, body.reference), + eq( + schema.resourceRelationshipRule.dependencyType, + body.dependencyType, ), - ) - .then(takeFirstOrNull); + ), + }); - let rule; - if (existingRule != null) { - // Update existing rule - rule = await tx - .update(schema.resourceRelationshipRule) - .set({ - name: body.name, - dependencyDescription: body.dependencyDescription, - description: body.description, - sourceKind: body.sourceKind, - sourceVersion: body.sourceVersion, - targetKind: body.targetKind, - targetVersion: body.targetVersion, - }) - .where(eq(schema.resourceRelationshipRule.id, existingRule.id)) - .returning() - .then(takeFirstOrNull); - } else { - // Insert new rule - rule = await tx + if (existingRule != null) + return NextResponse.json( + { + error: `Resource relationship with reference ${body.reference} and dependency type ${body.dependencyType} already exists in workspace ${body.workspaceId}`, + }, + { status: CONFLICT }, + ); + + const rule = await db.transaction(async (tx) => { + const rule = await tx .insert(schema.resourceRelationshipRule) - .values({ - workspaceId: body.workspaceId, - name: body.name, - reference: body.reference, - dependencyType: body.dependencyType as any, - dependencyDescription: body.dependencyDescription, - description: body.description, - sourceKind: body.sourceKind, - sourceVersion: body.sourceVersion, - targetKind: body.targetKind, - targetVersion: body.targetVersion, - }) + .values(body) .returning() - .then(takeFirstOrNull); - } - - if (rule == null) return null; + .then(takeFirst); - // Handle metadata keys - first delete existing ones if updating - if (existingRule != null) { - await tx - .delete(schema.resourceRelationshipRuleMetadataMatch) - .where( - eq( - schema.resourceRelationshipRuleMetadataMatch - .resourceRelationshipRuleId, - rule.id, - ), - ); - } + const metadataKeysMatch = _.uniq(body.metadataKeysMatch ?? []); + if (metadataKeysMatch.length > 0) + await tx + .insert(schema.resourceRelationshipRuleMetadataMatch) + .values( + metadataKeysMatch.map((key) => ({ + resourceRelationshipRuleId: rule.id, + key, + })), + ); - // Insert new metadata keys - const metadataKeys = _.uniq(body.metadataKeysMatch ?? []); - if (metadataKeys.length > 0) { - await tx.insert(schema.resourceRelationshipRuleMetadataMatch).values( - metadataKeys.map((key) => ({ - resourceRelationshipRuleId: rule.id, - key, - })), + const metadataKeysEquals = _.uniqBy( + body.metadataKeysEquals ?? [], + (m) => m.key, ); - } - - return rule; - }, - ); + if (metadataKeysEquals.length > 0) + await tx + .insert(schema.resourceRelationshipRuleMetadataEquals) + .values( + metadataKeysEquals.map((m) => ({ + resourceRelationshipRuleId: rule.id, + key: m.key, + value: m.value, + })), + ); - if (upsertedResourceRelationshipRule == null) { - return NextResponse.json( - { - error: "Failed to upsert resource relationship rule.", - }, - { status: 400 }, - ); - } + return { ...rule, metadataKeysMatch, metadataKeysEquals }; + }); - return NextResponse.json(upsertedResourceRelationshipRule); - }); + return NextResponse.json(rule); + } catch (error) { + log.error(error); + return NextResponse.json( + { error: "Failed to create resource relationship rule." }, + { status: INTERNAL_SERVER_ERROR }, + ); + } + }, + ); diff --git a/e2e/api/schema.ts b/e2e/api/schema.ts index 9d46c5047..f9c8d60f8 100644 --- a/e2e/api/schema.ts +++ b/e2e/api/schema.ts @@ -509,6 +509,23 @@ export interface paths { patch: operations["setResourceProvidersResources"]; trace?: never; }; + "/v1/resource-relationship-rules/{ruleId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** Update a resource relationship rule */ + patch: operations["updateResourceRelationshipRule"]; + trace?: never; + }; "/v1/resource-relationship-rules": { parameters: { query?: never; @@ -519,7 +536,7 @@ export interface paths { get?: never; put?: never; /** Create a resource relationship rule */ - post: operations["upsertResourceRelationshipRule"]; + post: operations["createResourceRelationshipRule"]; delete?: never; options?: never; head?: never; @@ -918,7 +935,11 @@ export interface components { version?: components["schemas"]["DeploymentVersion"]; deployment?: components["schemas"]["Deployment"]; runbook?: components["schemas"]["Runbook"]; - resource?: components["schemas"]["Resource"]; + resource?: components["schemas"]["ResourceWithVariablesAndMetadata"] & { + relationships?: { + [key: string]: components["schemas"]["Resource"]; + }; + }; environment?: components["schemas"]["Environment"]; variables: components["schemas"]["VariableMap"]; approval?: { @@ -1252,6 +1273,22 @@ export interface components { versionUserApprovals: components["schemas"]["VersionUserApproval"][]; versionRoleApprovals: components["schemas"]["VersionRoleApproval"][]; }; + UpdateResourceRelationshipRule: { + name?: string; + reference?: string; + dependencyType?: components["schemas"]["ResourceRelationshipRuleDependencyType"]; + dependencyDescription?: string; + description?: string; + sourceKind?: string; + sourceVersion?: string; + targetKind?: string; + targetVersion?: string; + metadataKeysMatch?: string[]; + metadataKeysEquals?: { + key: string; + value: string; + }[]; + }; /** @enum {string} */ ResourceRelationshipRuleDependencyType: | "depends_on" @@ -1261,7 +1298,9 @@ export interface components { | "provisioned_in" | "inherits_from"; ResourceRelationshipRule: { + /** Format: uuid */ id: string; + /** Format: uuid */ workspaceId: string; name: string; reference: string; @@ -1270,8 +1309,13 @@ export interface components { description?: string; sourceKind: string; sourceVersion: string; - targetKind: string; - targetVersion: string; + targetKind?: string; + targetVersion?: string; + metadataKeysMatch?: string[]; + metadataKeysEquals?: { + key?: string; + value?: string; + }[]; }; CreateResourceRelationshipRule: { workspaceId: string; @@ -1284,7 +1328,11 @@ export interface components { sourceVersion: string; targetKind: string; targetVersion: string; - metadataKeysMatch: string[]; + metadataKeysMatch?: string[]; + metadataKeysEquals?: { + key: string; + value: string; + }[]; }; ReleaseTarget: { /** Format: uuid */ @@ -3188,7 +3236,55 @@ export interface operations { }; }; }; - upsertResourceRelationshipRule: { + updateResourceRelationshipRule: { + parameters: { + query?: never; + header?: never; + path: { + ruleId: string; + }; + cookie?: never; + }; + requestBody?: { + content: { + "application/json": components["schemas"]["UpdateResourceRelationshipRule"]; + }; + }; + responses: { + /** @description The updated resource relationship rule */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ResourceRelationshipRule"]; + }; + }; + /** @description The resource relationship rule was not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description An error occurred while updating the resource relationship rule */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; + }; + createResourceRelationshipRule: { parameters: { query?: never; header?: never; @@ -3210,8 +3306,19 @@ export interface operations { "application/json": components["schemas"]["ResourceRelationshipRule"]; }; }; + /** @description Resource relationship rule already exists */ + 409: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; /** @description Failed to create resource relationship rule */ - 400: { + 500: { headers: { [name: string]: unknown; }; diff --git a/e2e/tests/api/resource-relationships.spec.ts b/e2e/tests/api/resource-relationships.spec.ts index b3c68e2d5..7c85ddb58 100644 --- a/e2e/tests/api/resource-relationships.spec.ts +++ b/e2e/tests/api/resource-relationships.spec.ts @@ -1,7 +1,12 @@ import path from "path"; +import { faker } from "@faker-js/faker"; import { expect } from "@playwright/test"; -import { ImportedEntities, importEntitiesFromYaml } from "../../api"; +import { + cleanupImportedEntities, + ImportedEntities, + importEntitiesFromYaml, +} from "../../api"; import { test } from "../fixtures"; const yamlPath = path.join(__dirname, "resource-relationships.spec.yaml"); @@ -17,14 +22,22 @@ test.describe("Resource Relationships API", () => { ); }); - test("create a relationship", async ({ api, workspace }) => { + test.afterAll(async ({ api, workspace }) => { + await cleanupImportedEntities(api, importedEntities, workspace.id); + }); + + test("create a relationship with metadata match", async ({ + api, + workspace, + }) => { + const reference = `${importedEntities.prefix}-${faker.string.alphanumeric(10)}`; const resourceRelationship = await api.POST( "/v1/resource-relationship-rules", { body: { workspaceId: workspace.id, - name: importedEntities.prefix + "-resource-relationship-rule", - reference: importedEntities.prefix, + name: reference + "-resource-relationship-rule", + reference, dependencyType: "depends_on", sourceKind: "Source", sourceVersion: "test-version/v1", @@ -35,7 +48,6 @@ test.describe("Resource Relationships API", () => { }, ); - console.log(JSON.stringify(resourceRelationship.data, null, 2)); expect(resourceRelationship.response.status).toBe(200); const sourceResource = await api.GET( @@ -52,11 +64,60 @@ test.describe("Resource Relationships API", () => { expect(sourceResource.response.status).toBe(200); expect(sourceResource.data?.relationships).toBeDefined(); - const target = - sourceResource.data?.relationships?.[importedEntities.prefix]; + const target = sourceResource.data?.relationships?.[reference]; + expect(target).toBeDefined(); + expect(target?.type).toBe("depends_on"); + expect(target?.reference).toBe(reference); + expect(target?.target?.id).toBeDefined(); + expect(target?.target?.name).toBeDefined(); + expect(target?.target?.version).toBeDefined(); + expect(target?.target?.kind).toBeDefined(); + expect(target?.target?.identifier).toBeDefined(); + expect(target?.target?.config).toBeDefined(); + }); + + test("create a relationship with metadata equals", async ({ + api, + workspace, + }) => { + const reference = `${importedEntities.prefix}-${faker.string.alphanumeric(10)}`; + const resourceRelationship = await api.POST( + "/v1/resource-relationship-rules", + { + body: { + workspaceId: workspace.id, + name: reference + "-resource-relationship-rule", + reference, + dependencyType: "depends_on", + sourceKind: "Source", + sourceVersion: "test-version/v1", + targetKind: "Target", + targetVersion: "test-version/v1", + metadataKeysEquals: [{ key: importedEntities.prefix, value: "true" }], + }, + }, + ); + + expect(resourceRelationship.response.status).toBe(200); + + const sourceResource = await api.GET( + `/v1/workspaces/{workspaceId}/resources/identifier/{identifier}`, + { + params: { + path: { + workspaceId: workspace.id, + identifier: importedEntities.prefix + "-source-resource", + }, + }, + }, + ); + + expect(sourceResource.response.status).toBe(200); + expect(sourceResource.data?.relationships).toBeDefined(); + const target = sourceResource.data?.relationships?.[reference]; expect(target).toBeDefined(); expect(target?.type).toBe("depends_on"); - expect(target?.reference).toBe(importedEntities.prefix); + expect(target?.reference).toBe(reference); expect(target?.target?.id).toBeDefined(); expect(target?.target?.name).toBeDefined(); expect(target?.target?.version).toBeDefined(); @@ -89,21 +150,27 @@ test.describe("Resource Relationships API", () => { expect(initialRule.data?.sourceKind).toBe("SourceA"); expect(initialRule.data?.targetKind).toBe("TargetA"); + const ruleId = initialRule.data?.id ?? ""; + // Update the existing rule with new properties - const updatedRule = await api.POST("/v1/resource-relationship-rules", { - body: { - workspaceId: workspace.id, - name: importedEntities.prefix + "-upsert-rule", // Same name for upsert - reference: importedEntities.prefix + "-upsert", - dependencyType: "depends_on", - sourceKind: "SourceB", - sourceVersion: "test-version/v2", - targetKind: "TargetB", - targetVersion: "test-version/v2", - description: "Updated description", - metadataKeysMatch: ["e2e/test", "additional-key"], + const updatedRule = await api.PATCH( + "/v1/resource-relationship-rules/{ruleId}", + { + params: { + path: { + ruleId: ruleId, + }, + }, + body: { + sourceKind: "SourceB", + sourceVersion: "test-version/v2", + targetKind: "TargetB", + targetVersion: "test-version/v2", + description: "Updated description", + metadataKeysMatch: ["e2e/test", "additional-key"], + }, }, - }); + ); expect(updatedRule.response.status).toBe(200); expect(updatedRule.data?.id).toBe(initialRule.data?.id); // Should maintain same ID diff --git a/openapi.v1.json b/openapi.v1.json index 299c7f625..8a7342a73 100644 --- a/openapi.v1.json +++ b/openapi.v1.json @@ -3070,10 +3070,84 @@ } } }, + "/v1/resource-relationship-rules/{ruleId}": { + "patch": { + "summary": "Update a resource relationship rule", + "operationId": "updateResourceRelationshipRule", + "parameters": [ + { + "name": "ruleId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateResourceRelationshipRule" + } + } + } + }, + "responses": { + "200": { + "description": "The updated resource relationship rule", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResourceRelationshipRule" + } + } + } + }, + "404": { + "description": "The resource relationship rule was not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string" + } + }, + "required": [ + "error" + ] + } + } + } + }, + "500": { + "description": "An error occurred while updating the resource relationship rule", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string" + } + }, + "required": [ + "error" + ] + } + } + } + } + } + } + }, "/v1/resource-relationship-rules": { "post": { "summary": "Create a resource relationship rule", - "operationId": "upsertResourceRelationshipRule", + "operationId": "createResourceRelationshipRule", "requestBody": { "required": true, "content": { @@ -3095,7 +3169,22 @@ } } }, - "400": { + "409": { + "description": "Resource relationship rule already exists", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string" + } + } + } + } + } + }, + "500": { "description": "Failed to create resource relationship rule", "content": { "application/json": { @@ -5688,6 +5777,62 @@ "versionRoleApprovals" ] }, + "UpdateResourceRelationshipRule": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "reference": { + "type": "string" + }, + "dependencyType": { + "$ref": "#/components/schemas/ResourceRelationshipRuleDependencyType" + }, + "dependencyDescription": { + "type": "string" + }, + "description": { + "type": "string" + }, + "sourceKind": { + "type": "string" + }, + "sourceVersion": { + "type": "string" + }, + "targetKind": { + "type": "string" + }, + "targetVersion": { + "type": "string" + }, + "metadataKeysMatch": { + "type": "array", + "items": { + "type": "string" + } + }, + "metadataKeysEquals": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "key", + "value" + ] + } + } + } + }, "ResourceRelationshipRuleDependencyType": { "type": "string", "enum": [ @@ -5703,10 +5848,12 @@ "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "format": "uuid" }, "workspaceId": { - "type": "string" + "type": "string", + "format": "uuid" }, "name": { "type": "string" @@ -5734,6 +5881,26 @@ }, "targetVersion": { "type": "string" + }, + "metadataKeysMatch": { + "type": "array", + "items": { + "type": "string" + } + }, + "metadataKeysEquals": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } } }, "required": [ @@ -5743,9 +5910,7 @@ "reference", "dependencyType", "sourceKind", - "sourceVersion", - "targetKind", - "targetVersion" + "sourceVersion" ] }, "CreateResourceRelationshipRule": { @@ -5786,6 +5951,24 @@ "items": { "type": "string" } + }, + "metadataKeysEquals": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "key", + "value" + ] + } } }, "required": [ @@ -5796,8 +5979,7 @@ "sourceKind", "sourceVersion", "targetKind", - "targetVersion", - "metadataKeysMatch" + "targetVersion" ] }, "ReleaseTarget": { diff --git a/packages/api/src/router/resource-relationship-rules.ts b/packages/api/src/router/resource-relationship-rules.ts index 8077b2a51..12f164c43 100644 --- a/packages/api/src/router/resource-relationship-rules.ts +++ b/packages/api/src/router/resource-relationship-rules.ts @@ -18,9 +18,7 @@ export const resourceRelationshipRulesRouter = createTRPCRouter({ .query(async ({ ctx, input }) => { return ctx.db.query.resourceRelationshipRule.findMany({ where: eq(schema.resourceRelationshipRule.workspaceId, input), - with: { - metadataMatches: true, - }, + with: { metadataMatches: true, metadataEquals: true }, }); }), diff --git a/packages/auth/src/utils/rbac.ts b/packages/auth/src/utils/rbac.ts index 171ea63c4..eb0391592 100644 --- a/packages/auth/src/utils/rbac.ts +++ b/packages/auth/src/utils/rbac.ts @@ -27,6 +27,7 @@ import { resource, resourceMetadataGroup, resourceProvider, + resourceRelationshipRule, resourceView, role, rolePermission, @@ -248,6 +249,26 @@ const getResourceViewScopes = async (id: string) => { ]; }; +const getResourceRelationshipRuleScopes = async (id: string) => { + const result = await db + .select() + .from(resourceRelationshipRule) + .innerJoin( + workspace, + eq(resourceRelationshipRule.workspaceId, workspace.id), + ) + .where(eq(resourceRelationshipRule.id, id)) + .then(takeFirst); + + return [ + { + type: "resourceRelationshipRule" as const, + id: result.resource_relationship_rule.id, + }, + { type: "workspace" as const, id: result.workspace.id }, + ]; +}; + const getDeploymentScopes = async (id: string) => { const result = await db .select() @@ -476,6 +497,7 @@ export const scopeHandlers: Record< job: getJobScopes, policy: getPolicyScopes, releaseTarget: getReleaseTargetScopes, + resourceRelationshipRule: getResourceRelationshipRuleScopes, }; const fetchScopeHierarchyForResource = async (resource: { diff --git a/packages/db/drizzle/meta/0099_snapshot.json b/packages/db/drizzle/meta/0099_snapshot.json index ab1381744..be63e3a84 100644 --- a/packages/db/drizzle/meta/0099_snapshot.json +++ b/packages/db/drizzle/meta/0099_snapshot.json @@ -81,12 +81,8 @@ "name": "account_userId_user_id_fk", "tableFrom": "account", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -94,10 +90,7 @@ "compositePrimaryKeys": { "account_provider_providerAccountId_pk": { "name": "account_provider_providerAccountId_pk", - "columns": [ - "provider", - "providerAccountId" - ] + "columns": ["provider", "providerAccountId"] } }, "uniqueConstraints": {}, @@ -134,12 +127,8 @@ "name": "session_userId_user_id_fk", "tableFrom": "session", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -221,12 +210,8 @@ "name": "user_active_workspace_id_workspace_id_fk", "tableFrom": "user", "tableTo": "workspace", - "columnsFrom": [ - "active_workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["active_workspace_id"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -313,12 +298,8 @@ "name": "user_api_key_user_id_user_id_fk", "tableFrom": "user_api_key", "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -378,12 +359,8 @@ "name": "dashboard_workspace_id_workspace_id_fk", "tableFrom": "dashboard", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -455,12 +432,8 @@ "name": "dashboard_widget_dashboard_id_dashboard_id_fk", "tableFrom": "dashboard_widget", "tableTo": "dashboard", - "columnsFrom": [ - "dashboard_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["dashboard_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -543,12 +516,8 @@ "name": "deployment_variable_deployment_id_deployment_id_fk", "tableFrom": "deployment_variable", "tableTo": "deployment", - "columnsFrom": [ - "deployment_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deployment_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -556,12 +525,8 @@ "name": "deployment_variable_default_value_id_deployment_variable_value_id_fk", "tableFrom": "deployment_variable", "tableTo": "deployment_variable_value", - "columnsFrom": [ - "default_value_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["default_value_id"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -624,12 +589,8 @@ "name": "deployment_variable_set_deployment_id_deployment_id_fk", "tableFrom": "deployment_variable_set", "tableTo": "deployment", - "columnsFrom": [ - "deployment_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deployment_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -637,12 +598,8 @@ "name": "deployment_variable_set_variable_set_id_variable_set_id_fk", "tableFrom": "deployment_variable_set", "tableTo": "variable_set", - "columnsFrom": [ - "variable_set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["variable_set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -719,12 +676,8 @@ "name": "deployment_variable_value_variable_id_deployment_variable_id_fk", "tableFrom": "deployment_variable_value", "tableTo": "deployment_variable", - "columnsFrom": [ - "variable_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["variable_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "restrict" } @@ -843,12 +796,8 @@ "name": "deployment_version_deployment_id_deployment_id_fk", "tableFrom": "deployment_version", "tableTo": "deployment", - "columnsFrom": [ - "deployment_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deployment_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -925,12 +874,8 @@ "name": "deployment_version_channel_deployment_id_deployment_id_fk", "tableFrom": "deployment_version_channel", "tableTo": "deployment", - "columnsFrom": [ - "deployment_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deployment_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -1014,12 +959,8 @@ "name": "deployment_version_metadata_deployment_version_id_deployment_version_id_fk", "tableFrom": "deployment_version_metadata", "tableTo": "deployment_version", - "columnsFrom": [ - "deployment_version_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deployment_version_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -1089,12 +1030,8 @@ "name": "deployment_version_dependency_deployment_version_id_deployment_version_id_fk", "tableFrom": "deployment_version_dependency", "tableTo": "deployment_version", - "columnsFrom": [ - "deployment_version_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deployment_version_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1102,12 +1039,8 @@ "name": "deployment_version_dependency_deployment_id_deployment_id_fk", "tableFrom": "deployment_version_dependency", "tableTo": "deployment", - "columnsFrom": [ - "deployment_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deployment_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -1141,12 +1074,8 @@ "name": "computed_deployment_resource_deployment_id_deployment_id_fk", "tableFrom": "computed_deployment_resource", "tableTo": "deployment", - "columnsFrom": [ - "deployment_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deployment_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1154,12 +1083,8 @@ "name": "computed_deployment_resource_resource_id_resource_id_fk", "tableFrom": "computed_deployment_resource", "tableTo": "resource", - "columnsFrom": [ - "resource_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["resource_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -1167,10 +1092,7 @@ "compositePrimaryKeys": { "computed_deployment_resource_deployment_id_resource_id_pk": { "name": "computed_deployment_resource_deployment_id_resource_id_pk", - "columns": [ - "deployment_id", - "resource_id" - ] + "columns": ["deployment_id", "resource_id"] } }, "uniqueConstraints": {}, @@ -1276,12 +1198,8 @@ "name": "deployment_system_id_system_id_fk", "tableFrom": "deployment", "tableTo": "system", - "columnsFrom": [ - "system_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["system_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1289,12 +1207,8 @@ "name": "deployment_job_agent_id_job_agent_id_fk", "tableFrom": "deployment", "tableTo": "job_agent", - "columnsFrom": [ - "job_agent_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["job_agent_id"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1357,12 +1271,8 @@ "name": "environment_policy_deployment_policy_id_environment_policy_id_fk", "tableFrom": "environment_policy_deployment", "tableTo": "environment_policy", - "columnsFrom": [ - "policy_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["policy_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1370,12 +1280,8 @@ "name": "environment_policy_deployment_environment_id_environment_id_fk", "tableFrom": "environment_policy_deployment", "tableTo": "environment", - "columnsFrom": [ - "environment_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["environment_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -1409,12 +1315,8 @@ "name": "computed_environment_resource_environment_id_environment_id_fk", "tableFrom": "computed_environment_resource", "tableTo": "environment", - "columnsFrom": [ - "environment_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["environment_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1422,12 +1324,8 @@ "name": "computed_environment_resource_resource_id_resource_id_fk", "tableFrom": "computed_environment_resource", "tableTo": "resource", - "columnsFrom": [ - "resource_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["resource_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -1435,10 +1333,7 @@ "compositePrimaryKeys": { "computed_environment_resource_environment_id_resource_id_pk": { "name": "computed_environment_resource_environment_id_resource_id_pk", - "columns": [ - "environment_id", - "resource_id" - ] + "columns": ["environment_id", "resource_id"] } }, "uniqueConstraints": {}, @@ -1532,12 +1427,8 @@ "name": "environment_system_id_system_id_fk", "tableFrom": "environment", "tableTo": "system", - "columnsFrom": [ - "system_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["system_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1545,12 +1436,8 @@ "name": "environment_policy_id_environment_policy_id_fk", "tableFrom": "environment", "tableTo": "environment_policy", - "columnsFrom": [ - "policy_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["policy_id"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1619,12 +1506,8 @@ "name": "environment_metadata_environment_id_environment_id_fk", "tableFrom": "environment_metadata", "tableTo": "environment", - "columnsFrom": [ - "environment_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["environment_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -1729,12 +1612,8 @@ "name": "environment_policy_system_id_system_id_fk", "tableFrom": "environment_policy", "tableTo": "system", - "columnsFrom": [ - "system_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["system_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1742,12 +1621,8 @@ "name": "environment_policy_environment_id_environment_id_fk", "tableFrom": "environment_policy", "tableTo": "environment", - "columnsFrom": [ - "environment_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["environment_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -1831,12 +1706,8 @@ "name": "environment_policy_approval_policy_id_environment_policy_id_fk", "tableFrom": "environment_policy_approval", "tableTo": "environment_policy", - "columnsFrom": [ - "policy_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["policy_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1844,12 +1715,8 @@ "name": "environment_policy_approval_release_id_deployment_version_id_fk", "tableFrom": "environment_policy_approval", "tableTo": "deployment_version", - "columnsFrom": [ - "release_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["release_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1857,12 +1724,8 @@ "name": "environment_policy_approval_user_id_user_id_fk", "tableFrom": "environment_policy_approval", "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1916,12 +1779,8 @@ "name": "environment_policy_release_window_policy_id_environment_policy_id_fk", "tableFrom": "environment_policy_release_window", "tableTo": "environment_policy", - "columnsFrom": [ - "policy_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["policy_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -1975,12 +1834,8 @@ "name": "event_workspace_id_workspace_id_fk", "tableFrom": "event", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -2087,12 +1942,8 @@ "name": "runhook_hook_id_hook_id_fk", "tableFrom": "runhook", "tableTo": "hook", - "columnsFrom": [ - "hook_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["hook_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -2100,12 +1951,8 @@ "name": "runhook_runbook_id_runbook_id_fk", "tableFrom": "runhook", "tableTo": "runbook", - "columnsFrom": [ - "runbook_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["runbook_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -2201,12 +2048,8 @@ "name": "github_entity_added_by_user_id_user_id_fk", "tableFrom": "github_entity", "tableTo": "user", - "columnsFrom": [ - "added_by_user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["added_by_user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -2214,12 +2057,8 @@ "name": "github_entity_workspace_id_workspace_id_fk", "tableFrom": "github_entity", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -2266,12 +2105,8 @@ "name": "github_user_user_id_user_id_fk", "tableFrom": "github_user", "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -2334,12 +2169,8 @@ "name": "job_resource_relationship_job_id_job_id_fk", "tableFrom": "job_resource_relationship", "tableTo": "job", - "columnsFrom": [ - "job_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["job_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -2458,12 +2289,8 @@ "name": "resource_provider_id_resource_provider_id_fk", "tableFrom": "resource", "tableTo": "resource_provider", - "columnsFrom": [ - "provider_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["provider_id"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -2471,12 +2298,8 @@ "name": "resource_workspace_id_workspace_id_fk", "tableFrom": "resource", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -2545,12 +2368,8 @@ "name": "resource_metadata_resource_id_resource_id_fk", "tableFrom": "resource_metadata", "tableTo": "resource", - "columnsFrom": [ - "resource_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["resource_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -2626,12 +2445,8 @@ "name": "resource_relationship_workspace_id_workspace_id_fk", "tableFrom": "resource_relationship", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -2712,12 +2527,8 @@ "name": "resource_schema_workspace_id_workspace_id_fk", "tableFrom": "resource_schema", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -2818,12 +2629,8 @@ "name": "resource_variable_resource_id_resource_id_fk", "tableFrom": "resource_variable", "tableTo": "resource", - "columnsFrom": [ - "resource_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["resource_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -2877,12 +2684,8 @@ "name": "resource_view_workspace_id_workspace_id_fk", "tableFrom": "resource_view", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -2939,12 +2742,8 @@ "name": "azure_tenant_workspace_id_workspace_id_fk", "tableFrom": "azure_tenant", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -3014,12 +2813,8 @@ "name": "resource_provider_workspace_id_workspace_id_fk", "tableFrom": "resource_provider", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -3074,12 +2869,8 @@ "name": "resource_provider_aws_resource_provider_id_resource_provider_id_fk", "tableFrom": "resource_provider_aws", "tableTo": "resource_provider", - "columnsFrom": [ - "resource_provider_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["resource_provider_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -3126,12 +2917,8 @@ "name": "resource_provider_azure_resource_provider_id_resource_provider_id_fk", "tableFrom": "resource_provider_azure", "tableTo": "resource_provider", - "columnsFrom": [ - "resource_provider_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["resource_provider_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -3139,12 +2926,8 @@ "name": "resource_provider_azure_tenant_id_azure_tenant_id_fk", "tableFrom": "resource_provider_azure", "tableTo": "azure_tenant", - "columnsFrom": [ - "tenant_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["tenant_id"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -3220,12 +3003,8 @@ "name": "resource_provider_google_resource_provider_id_resource_provider_id_fk", "tableFrom": "resource_provider_google", "tableTo": "resource_provider", - "columnsFrom": [ - "resource_provider_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["resource_provider_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -3301,12 +3080,8 @@ "name": "system_workspace_id_workspace_id_fk", "tableFrom": "system", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -3366,12 +3141,8 @@ "name": "runbook_system_id_system_id_fk", "tableFrom": "runbook", "tableTo": "system", - "columnsFrom": [ - "system_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["system_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -3379,12 +3150,8 @@ "name": "runbook_job_agent_id_job_agent_id_fk", "tableFrom": "runbook", "tableTo": "job_agent", - "columnsFrom": [ - "job_agent_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["job_agent_id"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -3432,12 +3199,8 @@ "name": "runbook_job_trigger_job_id_job_id_fk", "tableFrom": "runbook_job_trigger", "tableTo": "job", - "columnsFrom": [ - "job_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["job_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -3445,12 +3208,8 @@ "name": "runbook_job_trigger_runbook_id_runbook_id_fk", "tableFrom": "runbook_job_trigger", "tableTo": "runbook", - "columnsFrom": [ - "runbook_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["runbook_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -3460,9 +3219,7 @@ "runbook_job_trigger_job_id_unique": { "name": "runbook_job_trigger_job_id_unique", "nullsNotDistinct": false, - "columns": [ - "job_id" - ] + "columns": ["job_id"] } }, "policies": {}, @@ -3499,12 +3256,8 @@ "name": "team_workspace_id_workspace_id_fk", "tableFrom": "team", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -3567,12 +3320,8 @@ "name": "team_member_team_id_team_id_fk", "tableFrom": "team_member", "tableTo": "team", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["team_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -3580,12 +3329,8 @@ "name": "team_member_user_id_user_id_fk", "tableFrom": "team_member", "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -3712,12 +3457,8 @@ "name": "job_job_agent_id_job_agent_id_fk", "tableFrom": "job", "tableTo": "job_agent", - "columnsFrom": [ - "job_agent_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["job_agent_id"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -3786,12 +3527,8 @@ "name": "job_metadata_job_id_job_id_fk", "tableFrom": "job_metadata", "tableTo": "job", - "columnsFrom": [ - "job_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["job_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -3867,12 +3604,8 @@ "name": "job_variable_job_id_job_id_fk", "tableFrom": "job_variable", "tableTo": "job", - "columnsFrom": [ - "job_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["job_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -3933,9 +3666,7 @@ "workspace_slug_unique": { "name": "workspace_slug_unique", "nullsNotDistinct": false, - "columns": [ - "slug" - ] + "columns": ["slug"] } }, "policies": {}, @@ -4026,12 +3757,8 @@ "name": "workspace_email_domain_matching_workspace_id_workspace_id_fk", "tableFrom": "workspace_email_domain_matching", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -4039,12 +3766,8 @@ "name": "workspace_email_domain_matching_role_id_role_id_fk", "tableFrom": "workspace_email_domain_matching", "tableTo": "role", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["role_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -4091,12 +3814,8 @@ "name": "variable_set_system_id_system_id_fk", "tableFrom": "variable_set", "tableTo": "system", - "columnsFrom": [ - "system_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["system_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -4137,12 +3856,8 @@ "name": "variable_set_environment_variable_set_id_variable_set_id_fk", "tableFrom": "variable_set_environment", "tableTo": "variable_set", - "columnsFrom": [ - "variable_set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["variable_set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -4150,12 +3865,8 @@ "name": "variable_set_environment_environment_id_environment_id_fk", "tableFrom": "variable_set_environment", "tableTo": "environment", - "columnsFrom": [ - "environment_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["environment_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -4231,12 +3942,8 @@ "name": "variable_set_value_variable_set_id_variable_set_id_fk", "tableFrom": "variable_set_value", "tableTo": "variable_set", - "columnsFrom": [ - "variable_set_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["variable_set_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -4296,12 +4003,8 @@ "name": "workspace_invite_token_role_id_role_id_fk", "tableFrom": "workspace_invite_token", "tableTo": "role", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["role_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -4309,12 +4012,8 @@ "name": "workspace_invite_token_workspace_id_workspace_id_fk", "tableFrom": "workspace_invite_token", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -4322,12 +4021,8 @@ "name": "workspace_invite_token_created_by_user_id_fk", "tableFrom": "workspace_invite_token", "tableTo": "user", - "columnsFrom": [ - "created_by" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["created_by"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -4337,9 +4032,7 @@ "workspace_invite_token_token_unique": { "name": "workspace_invite_token_token_unique", "nullsNotDistinct": false, - "columns": [ - "token" - ] + "columns": ["token"] } }, "policies": {}, @@ -4395,12 +4088,8 @@ "name": "resource_metadata_group_workspace_id_workspace_id_fk", "tableFrom": "resource_metadata_group", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -4489,12 +4178,8 @@ "name": "runbook_variable_runbook_id_runbook_id_fk", "tableFrom": "runbook_variable", "tableTo": "runbook", - "columnsFrom": [ - "runbook_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["runbook_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -4595,12 +4280,8 @@ "name": "entity_role_role_id_role_id_fk", "tableFrom": "entity_role", "tableTo": "role", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["role_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -4647,12 +4328,8 @@ "name": "role_workspace_id_workspace_id_fk", "tableFrom": "role", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -4715,12 +4392,8 @@ "name": "role_permission_role_id_role_id_fk", "tableFrom": "role_permission", "tableTo": "role", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["role_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -4796,12 +4469,8 @@ "name": "job_agent_workspace_id_workspace_id_fk", "tableFrom": "job_agent", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -4891,12 +4560,8 @@ "name": "environment_policy_deployment_version_channel_policy_id_environment_policy_id_fk", "tableFrom": "environment_policy_deployment_version_channel", "tableTo": "environment_policy", - "columnsFrom": [ - "policy_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["policy_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -4904,12 +4569,8 @@ "name": "environment_policy_deployment_version_channel_channel_id_deployment_version_channel_id_fk", "tableFrom": "environment_policy_deployment_version_channel", "tableTo": "deployment_version_channel", - "columnsFrom": [ - "channel_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["channel_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -4917,12 +4578,8 @@ "name": "environment_policy_deployment_version_channel_deployment_id_deployment_id_fk", "tableFrom": "environment_policy_deployment_version_channel", "tableTo": "deployment", - "columnsFrom": [ - "deployment_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deployment_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -4995,12 +4652,8 @@ "name": "release_job_trigger_job_id_job_id_fk", "tableFrom": "release_job_trigger", "tableTo": "job", - "columnsFrom": [ - "job_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["job_id"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -5008,12 +4661,8 @@ "name": "release_job_trigger_caused_by_id_user_id_fk", "tableFrom": "release_job_trigger", "tableTo": "user", - "columnsFrom": [ - "caused_by_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["caused_by_id"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -5021,12 +4670,8 @@ "name": "release_job_trigger_deployment_version_id_deployment_version_id_fk", "tableFrom": "release_job_trigger", "tableTo": "deployment_version", - "columnsFrom": [ - "deployment_version_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deployment_version_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -5034,12 +4679,8 @@ "name": "release_job_trigger_resource_id_resource_id_fk", "tableFrom": "release_job_trigger", "tableTo": "resource", - "columnsFrom": [ - "resource_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["resource_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -5047,12 +4688,8 @@ "name": "release_job_trigger_environment_id_environment_id_fk", "tableFrom": "release_job_trigger", "tableTo": "environment", - "columnsFrom": [ - "environment_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["environment_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -5062,9 +4699,7 @@ "release_job_trigger_job_id_unique": { "name": "release_job_trigger_job_id_unique", "nullsNotDistinct": false, - "columns": [ - "job_id" - ] + "columns": ["job_id"] } }, "policies": {}, @@ -5094,12 +4729,8 @@ "name": "computed_policy_target_release_target_policy_target_id_policy_target_id_fk", "tableFrom": "computed_policy_target_release_target", "tableTo": "policy_target", - "columnsFrom": [ - "policy_target_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["policy_target_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -5107,12 +4738,8 @@ "name": "computed_policy_target_release_target_release_target_id_release_target_id_fk", "tableFrom": "computed_policy_target_release_target", "tableTo": "release_target", - "columnsFrom": [ - "release_target_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["release_target_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -5120,10 +4747,7 @@ "compositePrimaryKeys": { "computed_policy_target_release_target_policy_target_id_release_target_id_pk": { "name": "computed_policy_target_release_target_policy_target_id_release_target_id_pk", - "columns": [ - "policy_target_id", - "release_target_id" - ] + "columns": ["policy_target_id", "release_target_id"] } }, "uniqueConstraints": {}, @@ -5188,12 +4812,8 @@ "name": "policy_workspace_id_workspace_id_fk", "tableFrom": "policy", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -5203,10 +4823,7 @@ "policy_workspace_id_name_unique": { "name": "policy_workspace_id_name_unique", "nullsNotDistinct": false, - "columns": [ - "workspace_id", - "name" - ] + "columns": ["workspace_id", "name"] } }, "policies": {}, @@ -5258,12 +4875,8 @@ "name": "policy_target_policy_id_policy_id_fk", "tableFrom": "policy_target", "tableTo": "policy", - "columnsFrom": [ - "policy_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["policy_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -5311,12 +4924,8 @@ "name": "release_version_release_id_version_release_id_fk", "tableFrom": "release", "tableTo": "version_release", - "columnsFrom": [ - "version_release_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["version_release_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -5324,12 +4933,8 @@ "name": "release_variable_release_id_variable_set_release_id_fk", "tableFrom": "release", "tableTo": "variable_set_release", - "columnsFrom": [ - "variable_release_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["variable_release_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -5370,12 +4975,8 @@ "name": "release_job_release_id_release_id_fk", "tableFrom": "release_job", "tableTo": "release", - "columnsFrom": [ - "release_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["release_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -5383,12 +4984,8 @@ "name": "release_job_job_id_job_id_fk", "tableFrom": "release_job", "tableTo": "job", - "columnsFrom": [ - "job_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["job_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -5470,12 +5067,8 @@ "name": "release_target_resource_id_resource_id_fk", "tableFrom": "release_target", "tableTo": "resource", - "columnsFrom": [ - "resource_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["resource_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -5483,12 +5076,8 @@ "name": "release_target_environment_id_environment_id_fk", "tableFrom": "release_target", "tableTo": "environment", - "columnsFrom": [ - "environment_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["environment_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -5496,12 +5085,8 @@ "name": "release_target_deployment_id_deployment_id_fk", "tableFrom": "release_target", "tableTo": "deployment", - "columnsFrom": [ - "deployment_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deployment_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -5509,12 +5094,8 @@ "name": "release_target_desired_release_id_release_id_fk", "tableFrom": "release_target", "tableTo": "release", - "columnsFrom": [ - "desired_release_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["desired_release_id"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -5556,12 +5137,8 @@ "name": "variable_set_release_release_target_id_release_target_id_fk", "tableFrom": "variable_set_release", "tableTo": "release_target", - "columnsFrom": [ - "release_target_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["release_target_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -5631,12 +5208,8 @@ "name": "variable_set_release_value_variable_set_release_id_variable_set_release_id_fk", "tableFrom": "variable_set_release_value", "tableTo": "variable_set_release", - "columnsFrom": [ - "variable_set_release_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["variable_set_release_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -5644,12 +5217,8 @@ "name": "variable_set_release_value_variable_value_snapshot_id_variable_value_snapshot_id_fk", "tableFrom": "variable_set_release_value", "tableTo": "variable_value_snapshot", - "columnsFrom": [ - "variable_value_snapshot_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["variable_value_snapshot_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -5738,12 +5307,8 @@ "name": "variable_value_snapshot_workspace_id_workspace_id_fk", "tableFrom": "variable_value_snapshot", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -5791,12 +5356,8 @@ "name": "version_release_release_target_id_release_target_id_fk", "tableFrom": "version_release", "tableTo": "release_target", - "columnsFrom": [ - "release_target_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["release_target_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -5804,12 +5365,8 @@ "name": "version_release_version_id_deployment_version_id_fk", "tableFrom": "version_release", "tableTo": "deployment_version", - "columnsFrom": [ - "version_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["version_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -5871,12 +5428,8 @@ "name": "policy_rule_deny_window_policy_id_policy_id_fk", "tableFrom": "policy_rule_deny_window", "tableTo": "policy", - "columnsFrom": [ - "policy_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["policy_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -5924,12 +5477,8 @@ "name": "policy_rule_user_approval_policy_id_policy_id_fk", "tableFrom": "policy_rule_user_approval", "tableTo": "policy", - "columnsFrom": [ - "policy_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["policy_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -5937,12 +5486,8 @@ "name": "policy_rule_user_approval_user_id_user_id_fk", "tableFrom": "policy_rule_user_approval", "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -6022,12 +5567,8 @@ "name": "policy_rule_user_approval_record_user_id_user_id_fk", "tableFrom": "policy_rule_user_approval_record", "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -6035,12 +5576,8 @@ "name": "policy_rule_user_approval_record_rule_id_policy_rule_user_approval_id_fk", "tableFrom": "policy_rule_user_approval_record", "tableTo": "policy_rule_user_approval", - "columnsFrom": [ - "rule_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["rule_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -6095,12 +5632,8 @@ "name": "policy_rule_role_approval_policy_id_policy_id_fk", "tableFrom": "policy_rule_role_approval", "tableTo": "policy", - "columnsFrom": [ - "policy_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["policy_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -6108,12 +5641,8 @@ "name": "policy_rule_role_approval_role_id_role_id_fk", "tableFrom": "policy_rule_role_approval", "tableTo": "role", - "columnsFrom": [ - "role_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["role_id"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -6193,12 +5722,8 @@ "name": "policy_rule_role_approval_record_user_id_user_id_fk", "tableFrom": "policy_rule_role_approval_record", "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -6206,12 +5731,8 @@ "name": "policy_rule_role_approval_record_rule_id_policy_rule_role_approval_id_fk", "tableFrom": "policy_rule_role_approval_record", "tableTo": "policy_rule_role_approval", - "columnsFrom": [ - "rule_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["rule_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -6260,12 +5781,8 @@ "name": "policy_rule_any_approval_policy_id_policy_id_fk", "tableFrom": "policy_rule_any_approval", "tableTo": "policy", - "columnsFrom": [ - "policy_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["policy_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -6361,12 +5878,8 @@ "name": "policy_rule_any_approval_record_user_id_user_id_fk", "tableFrom": "policy_rule_any_approval_record", "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["user_id"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -6419,12 +5932,8 @@ "name": "policy_rule_deployment_version_selector_policy_id_policy_id_fk", "tableFrom": "policy_rule_deployment_version_selector", "tableTo": "policy", - "columnsFrom": [ - "policy_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["policy_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -6434,9 +5943,7 @@ "policy_rule_deployment_version_selector_policy_id_unique": { "name": "policy_rule_deployment_version_selector_policy_id_unique", "nullsNotDistinct": false, - "columns": [ - "policy_id" - ] + "columns": ["policy_id"] } }, "policies": {}, @@ -6556,12 +6063,8 @@ "name": "resource_relationship_rule_workspace_id_workspace_id_fk", "tableFrom": "resource_relationship_rule", "tableTo": "workspace", - "columnsFrom": [ - "workspace_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -6630,12 +6133,8 @@ "name": "resource_relationship_rule_metadata_equals_resource_relationship_rule_id_resource_relationship_rule_id_fk", "tableFrom": "resource_relationship_rule_metadata_equals", "tableTo": "resource_relationship_rule", - "columnsFrom": [ - "resource_relationship_rule_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["resource_relationship_rule_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -6698,12 +6197,8 @@ "name": "resource_relationship_rule_metadata_match_resource_relationship_rule_id_resource_relationship_rule_id_fk", "tableFrom": "resource_relationship_rule_metadata_match", "tableTo": "resource_relationship_rule", - "columnsFrom": [ - "resource_relationship_rule_id" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["resource_relationship_rule_id"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -6719,79 +6214,47 @@ "public.system_role": { "name": "system_role", "schema": "public", - "values": [ - "user", - "admin" - ] + "values": ["user", "admin"] }, "public.deployment_version_status": { "name": "deployment_version_status", "schema": "public", - "values": [ - "building", - "ready", - "failed" - ] + "values": ["building", "ready", "failed"] }, "public.environment_policy_approval_requirement": { "name": "environment_policy_approval_requirement", "schema": "public", - "values": [ - "manual", - "automatic" - ] + "values": ["manual", "automatic"] }, "public.approval_status_type": { "name": "approval_status_type", "schema": "public", - "values": [ - "pending", - "approved", - "rejected" - ] + "values": ["pending", "approved", "rejected"] }, "public.environment_policy_deployment_success_type": { "name": "environment_policy_deployment_success_type", "schema": "public", - "values": [ - "all", - "some", - "optional" - ] + "values": ["all", "some", "optional"] }, "public.recurrence_type": { "name": "recurrence_type", "schema": "public", - "values": [ - "hourly", - "daily", - "weekly", - "monthly" - ] + "values": ["hourly", "daily", "weekly", "monthly"] }, "public.release_sequencing_type": { "name": "release_sequencing_type", "schema": "public", - "values": [ - "wait", - "cancel" - ] + "values": ["wait", "cancel"] }, "public.github_entity_type": { "name": "github_entity_type", "schema": "public", - "values": [ - "organization", - "user" - ] + "values": ["organization", "user"] }, "public.resource_relationship_type": { "name": "resource_relationship_type", "schema": "public", - "values": [ - "associated_with", - "depends_on" - ] + "values": ["associated_with", "depends_on"] }, "public.job_reason": { "name": "job_reason", @@ -6822,10 +6285,7 @@ "public.entity_type": { "name": "entity_type", "schema": "public", - "values": [ - "user", - "team" - ] + "values": ["user", "team"] }, "public.scope_type": { "name": "scope_type", @@ -6870,10 +6330,7 @@ "public.approval_status": { "name": "approval_status", "schema": "public", - "values": [ - "approved", - "rejected" - ] + "values": ["approved", "rejected"] } }, "schemas": {}, @@ -6886,4 +6343,4 @@ "schemas": {}, "tables": {} } -} \ No newline at end of file +} diff --git a/packages/db/drizzle/meta/_journal.json b/packages/db/drizzle/meta/_journal.json index e314e3151..512980bbc 100644 --- a/packages/db/drizzle/meta/_journal.json +++ b/packages/db/drizzle/meta/_journal.json @@ -703,4 +703,4 @@ "breakpoints": true } ] -} \ No newline at end of file +} diff --git a/packages/db/src/queries/get-resource-parents.ts b/packages/db/src/queries/get-resource-parents.ts index e0b839808..74b0edf02 100644 --- a/packages/db/src/queries/get-resource-parents.ts +++ b/packages/db/src/queries/get-resource-parents.ts @@ -1,14 +1,9 @@ -import { and, count, eq, inArray, isNull, or } from "drizzle-orm"; +import { and, eq, exists, inArray, isNull, ne, or } from "drizzle-orm"; import { alias } from "drizzle-orm/pg-core"; import _ from "lodash"; import type { Tx } from "../common.js"; -import { - resourceRelationshipRule, - resourceRelationshipRuleMetadataEquals, - resourceRelationshipRuleMetadataMatch, -} from "../schema/resource-relationship-rule.js"; -import { resource, resourceMetadata } from "../schema/resource.js"; +import * as schema from "../schema/index.js"; /** * Gets relationships for a resource based on relationship rules @@ -16,140 +11,111 @@ import { resource, resourceMetadata } from "../schema/resource.js"; * @returns Array of relationships with rule info and target resources */ export const getResourceParents = async (tx: Tx, resourceId: string) => { - // First, get all relationship rules and count how many metadata keys each rule requires to match - // This creates a subquery that we'll use later to ensure resources match ALL required metadata keys - const rulesWithCount = tx - .selectDistinctOn([resourceRelationshipRule.id], { - id: resourceRelationshipRule.id, - workspaceId: resourceRelationshipRule.workspaceId, - reference: resourceRelationshipRule.reference, - dependencyType: resourceRelationshipRule.dependencyType, - metadataKeysMatches: count(resourceRelationshipRuleMetadataMatch).as( - "metadataKeysMatches", - ), - metadataKeysEquals: count(resourceRelationshipRuleMetadataEquals).as( - "metadataKeysEquals", - ), - targetKind: resourceRelationshipRule.targetKind, - targetVersion: resourceRelationshipRule.targetVersion, - sourceKind: resourceRelationshipRule.sourceKind, - sourceVersion: resourceRelationshipRule.sourceVersion, - }) - .from(resourceRelationshipRule) - .leftJoin( - resourceRelationshipRuleMetadataMatch, - eq( - resourceRelationshipRule.id, - resourceRelationshipRuleMetadataMatch.resourceRelationshipRuleId, - ), - ) - .leftJoin( - resourceRelationshipRuleMetadataEquals, - eq( - resourceRelationshipRule.id, - resourceRelationshipRuleMetadataEquals.resourceRelationshipRuleId, - ), - ) - .groupBy(resourceRelationshipRule.id) - .as("rulesWithCount"); - // Create aliases for tables we'll join multiple times to avoid naming conflicts - const sourceResource = alias(resource, "sourceResource"); - const sourceMetadata = alias(resourceMetadata, "sourceMetadata"); - const targetResource = alias(resource, "targetResource"); - const targetMetadata = alias(resourceMetadata, "targetMetadata"); + const sourceResource = alias(schema.resource, "sourceResource"); + const sourceMetadata = alias(schema.resourceMetadata, "sourceMetadata"); + const targetResource = alias(schema.resource, "targetResource"); + const targetMetadata = alias(schema.resourceMetadata, "targetMetadata"); + + const isMetadataMatchSatisfied = or( + isNull(schema.resourceRelationshipRuleMetadataMatch.key), + exists( + tx + .select() + .from(sourceMetadata) + .innerJoin(targetMetadata, eq(sourceMetadata.key, targetMetadata.key)) + .where( + and( + eq(sourceMetadata.resourceId, sourceResource.id), + eq(targetMetadata.resourceId, targetResource.id), + eq(sourceMetadata.value, targetMetadata.value), + eq( + sourceMetadata.key, + schema.resourceRelationshipRuleMetadataMatch.key, + ), + ), + ), + ), + ); + + const isMetadataEqualsSatisfied = or( + isNull(schema.resourceRelationshipRuleMetadataEquals.key), + exists( + tx + .select() + .from(targetMetadata) + .where( + and( + eq(targetMetadata.resourceId, targetResource.id), + eq( + targetMetadata.key, + schema.resourceRelationshipRuleMetadataEquals.key, + ), + eq( + targetMetadata.value, + schema.resourceRelationshipRuleMetadataEquals.value, + ), + ), + ), + ), + ); + + const ruleMatchesSource = [ + eq(schema.resourceRelationshipRule.workspaceId, sourceResource.workspaceId), + eq(schema.resourceRelationshipRule.sourceKind, sourceResource.kind), + eq(schema.resourceRelationshipRule.sourceVersion, sourceResource.version), + ]; + + const ruleMatchesTarget = [ + or( + isNull(schema.resourceRelationshipRule.targetKind), + eq(schema.resourceRelationshipRule.targetKind, targetResource.kind), + ), + or( + isNull(schema.resourceRelationshipRule.targetVersion), + eq(schema.resourceRelationshipRule.targetVersion, targetResource.version), + ), + ]; - // Main query to find relationships: - // 1. Start with the source resource - // 2. Join its metadata - // 3. Find target resources in same workspace with matching metadata values - // 4. Join with rules that match source/target kinds and versions - // 5. Ensure metadata keys match what the rule requires - // 6. Group and count matches to verify ALL required metadata keys match const relationships = await tx - .selectDistinctOn([sourceResource.id, rulesWithCount.id], { - ruleId: rulesWithCount.id, - type: rulesWithCount.dependencyType, + .selectDistinctOn([targetResource.id, schema.resourceRelationshipRule.id], { + ruleId: schema.resourceRelationshipRule.id, + type: schema.resourceRelationshipRule.dependencyType, target: targetResource, - reference: rulesWithCount.reference, + reference: schema.resourceRelationshipRule.reference, }) .from(sourceResource) - .innerJoin(sourceMetadata, eq(sourceResource.id, sourceMetadata.resourceId)) .innerJoin( targetResource, - eq(sourceResource.workspaceId, targetResource.workspaceId), + eq(targetResource.workspaceId, sourceResource.workspaceId), ) .innerJoin( - targetMetadata, - and( - eq(targetResource.id, targetMetadata.resourceId), - eq(targetMetadata.key, sourceMetadata.key), - eq(targetMetadata.value, sourceMetadata.value), - ), + schema.resourceRelationshipRule, + and(...ruleMatchesSource, ...ruleMatchesTarget), ) - .innerJoin( - rulesWithCount, - and( - eq(rulesWithCount.workspaceId, sourceResource.workspaceId), - eq(rulesWithCount.sourceKind, sourceResource.kind), - eq(rulesWithCount.sourceVersion, sourceResource.version), - or( - eq(rulesWithCount.targetKind, targetResource.kind), - isNull(rulesWithCount.targetKind), - ), - or( - eq(rulesWithCount.targetVersion, targetResource.version), - isNull(rulesWithCount.targetVersion), - ), - ), - ) - .innerJoin( - resourceRelationshipRuleMetadataMatch, + .leftJoin( + schema.resourceRelationshipRuleMetadataMatch, eq( - rulesWithCount.id, - resourceRelationshipRuleMetadataMatch.resourceRelationshipRuleId, + schema.resourceRelationshipRuleMetadataMatch.resourceRelationshipRuleId, + schema.resourceRelationshipRule.id, ), ) .leftJoin( - resourceRelationshipRuleMetadataEquals, + schema.resourceRelationshipRuleMetadataEquals, eq( - rulesWithCount.id, - resourceRelationshipRuleMetadataEquals.resourceRelationshipRuleId, + schema.resourceRelationshipRuleMetadataEquals + .resourceRelationshipRuleId, + schema.resourceRelationshipRule.id, ), ) .where( and( eq(sourceResource.id, resourceId), - eq(sourceMetadata.key, resourceRelationshipRuleMetadataMatch.key), - or( - isNull(resourceRelationshipRuleMetadataEquals.key), - eq(targetMetadata.key, resourceRelationshipRuleMetadataEquals.key), - ), - or( - isNull(resourceRelationshipRuleMetadataEquals.value), - eq( - targetMetadata.value, - resourceRelationshipRuleMetadataEquals.value, - ), - ), - ), - ) - .groupBy( - sourceResource.workspaceId, - sourceResource.id, - targetResource.id, - rulesWithCount.id, - rulesWithCount.reference, - rulesWithCount.dependencyType, - rulesWithCount.metadataKeysMatches, - rulesWithCount.metadataKeysEquals, - ) - // Only return relationships where the number of matching metadata keys - // equals the number required by the rule (ensures ALL keys match) - .having( - and( - eq(count(sourceMetadata.key), rulesWithCount.metadataKeysMatches), - eq(count(sourceMetadata.key), rulesWithCount.metadataKeysEquals), + ne(targetResource.id, resourceId), + isNull(sourceResource.deletedAt), + isNull(targetResource.deletedAt), + isMetadataEqualsSatisfied, + isMetadataMatchSatisfied, ), ); @@ -157,7 +123,7 @@ export const getResourceParents = async (tx: Tx, resourceId: string) => { await tx.query.resource .findMany({ where: inArray( - resource.id, + schema.resource.id, Object.values(relationships).map((r) => r.target.id), ), with: { @@ -192,23 +158,29 @@ export const getResourceRelationshipRules = async ( ) => { return tx .select() - .from(resource) + .from(schema.resource) .innerJoin( - resourceRelationshipRule, + schema.resourceRelationshipRule, and( - eq(resourceRelationshipRule.workspaceId, resource.workspaceId), - eq(resourceRelationshipRule.sourceKind, resource.kind), - eq(resourceRelationshipRule.sourceVersion, resource.version), + eq( + schema.resourceRelationshipRule.workspaceId, + schema.resource.workspaceId, + ), + eq(schema.resourceRelationshipRule.sourceKind, schema.resource.kind), + eq( + schema.resourceRelationshipRule.sourceVersion, + schema.resource.version, + ), ), ) .innerJoin( - resourceRelationshipRuleMetadataMatch, + schema.resourceRelationshipRuleMetadataMatch, eq( - resourceRelationshipRule.id, - resourceRelationshipRuleMetadataMatch.resourceRelationshipRuleId, + schema.resourceRelationshipRule.id, + schema.resourceRelationshipRuleMetadataMatch.resourceRelationshipRuleId, ), ) - .where(eq(resource.id, resourceId)) + .where(eq(schema.resource.id, resourceId)) .then((r) => _.chain(r) .groupBy((v) => v.resource_relationship_rule.id) diff --git a/packages/db/src/schema/rbac.ts b/packages/db/src/schema/rbac.ts index c0cbe383a..37176f510 100644 --- a/packages/db/src/schema/rbac.ts +++ b/packages/db/src/schema/rbac.ts @@ -38,6 +38,7 @@ export const scopeType = pgEnum("scope_type", [ "resource", "resourceProvider", "resourceMetadataGroup", + "resourceRelationshipRule", "workspace", "environment", "environmentPolicy", diff --git a/packages/db/src/schema/resource-relationship-rule.ts b/packages/db/src/schema/resource-relationship-rule.ts index 26cc0b009..84bee3792 100644 --- a/packages/db/src/schema/resource-relationship-rule.ts +++ b/packages/db/src/schema/resource-relationship-rule.ts @@ -1,6 +1,7 @@ import { relations } from "drizzle-orm"; import { pgEnum, pgTable, text, uniqueIndex, uuid } from "drizzle-orm/pg-core"; import { createInsertSchema } from "drizzle-zod"; +import { z } from "zod"; import { workspace } from "./workspace.js"; @@ -130,6 +131,7 @@ export const resourceRelationshipRuleRelations = relations( resourceRelationshipRule, ({ many }) => ({ metadataMatches: many(resourceRelationshipRuleMetadataMatch), + metadataEquals: many(resourceRelationshipRuleMetadataEquals), }), ); @@ -145,6 +147,28 @@ export const resourceRelationshipRuleMetadataMatchRelations = relations( }), ); +export const resourceRelationshipRuleMetadataEqualsRelations = relations( + resourceRelationshipRuleMetadataEquals, + ({ one }) => ({ + rule: one(resourceRelationshipRule, { + fields: [ + resourceRelationshipRuleMetadataEquals.resourceRelationshipRuleId, + ], + references: [resourceRelationshipRule.id], + }), + }), +); + export const createResourceRelationshipRule = createInsertSchema( resourceRelationshipRule, -); +) + .omit({ id: true }) + .extend({ + metadataKeysMatch: z.array(z.string()).optional(), + metadataKeysEquals: z + .array(z.object({ key: z.string(), value: z.string() })) + .optional(), + }); + +export const updateResourceRelationshipRule = + createResourceRelationshipRule.partial(); diff --git a/packages/validators/src/auth/index.ts b/packages/validators/src/auth/index.ts index d48689cde..ec4b0b9a9 100644 --- a/packages/validators/src/auth/index.ts +++ b/packages/validators/src/auth/index.ts @@ -68,6 +68,10 @@ export enum Permission { ResourceMetadataGroupUpdate = "resourceMetadataGroup.update", ResourceMetadataGroupDelete = "resourceMetadataGroup.delete", + ResourceRelationshipRuleCreate = "resourceRelationshipRule.create", + ResourceRelationshipRuleUpdate = "resourceRelationshipRule.update", + ResourceRelationshipRuleDelete = "resourceRelationshipRule.delete", + DeploymentCreate = "deployment.create", DeploymentUpdate = "deployment.update", DeploymentGet = "deployment.get", From 63833d960717824e5f1893ae3f0c0c0e3c520787 Mon Sep 17 00:00:00 2001 From: Justin Brooks Date: Mon, 5 May 2025 22:07:07 -0400 Subject: [PATCH 3/5] update table name --- .../[ruleId]/route.ts | 6 +-- .../v1/resource-relationship-rules/route.ts | 2 +- packages/db/drizzle/0099_dear_korg.sql | 9 ---- packages/db/drizzle/0099_pink_chamber.sql | 10 +++++ packages/db/drizzle/meta/0099_snapshot.json | 43 ++++++++++--------- packages/db/drizzle/meta/_journal.json | 4 +- .../db/src/queries/get-resource-parents.ts | 10 ++--- .../src/schema/resource-relationship-rule.ts | 12 +++--- 8 files changed, 49 insertions(+), 47 deletions(-) delete mode 100644 packages/db/drizzle/0099_dear_korg.sql create mode 100644 packages/db/drizzle/0099_pink_chamber.sql diff --git a/apps/webservice/src/app/api/v1/resource-relationship-rules/[ruleId]/route.ts b/apps/webservice/src/app/api/v1/resource-relationship-rules/[ruleId]/route.ts index 34e4c532b..4fc67c0f4 100644 --- a/apps/webservice/src/app/api/v1/resource-relationship-rules/[ruleId]/route.ts +++ b/apps/webservice/src/app/api/v1/resource-relationship-rules/[ruleId]/route.ts @@ -47,10 +47,10 @@ const replaceMetadataEqualsRules = async ( metadataKeysEquals?: { key: string; value: string }[], ) => { await tx - .delete(schema.resourceRelationshipRuleMetadataEquals) + .delete(schema.resourceRelationshipTargetRuleMetadataEquals) .where( eq( - schema.resourceRelationshipRuleMetadataEquals + schema.resourceRelationshipTargetRuleMetadataEquals .resourceRelationshipRuleId, ruleId, ), @@ -58,7 +58,7 @@ const replaceMetadataEqualsRules = async ( const metadataKeys = _.uniqBy(metadataKeysEquals ?? [], (m) => m.key); if (metadataKeys.length > 0) - await tx.insert(schema.resourceRelationshipRuleMetadataEquals).values( + await tx.insert(schema.resourceRelationshipTargetRuleMetadataEquals).values( metadataKeys.map(({ key, value }) => ({ resourceRelationshipRuleId: ruleId, key, diff --git a/apps/webservice/src/app/api/v1/resource-relationship-rules/route.ts b/apps/webservice/src/app/api/v1/resource-relationship-rules/route.ts index 6ff8543c8..973eaea68 100644 --- a/apps/webservice/src/app/api/v1/resource-relationship-rules/route.ts +++ b/apps/webservice/src/app/api/v1/resource-relationship-rules/route.ts @@ -71,7 +71,7 @@ export const POST = request() ); if (metadataKeysEquals.length > 0) await tx - .insert(schema.resourceRelationshipRuleMetadataEquals) + .insert(schema.resourceRelationshipTargetRuleMetadataEquals) .values( metadataKeysEquals.map((m) => ({ resourceRelationshipRuleId: rule.id, diff --git a/packages/db/drizzle/0099_dear_korg.sql b/packages/db/drizzle/0099_dear_korg.sql deleted file mode 100644 index bdca7c401..000000000 --- a/packages/db/drizzle/0099_dear_korg.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE TABLE "resource_relationship_rule_metadata_equals" ( - "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, - "resource_relationship_rule_id" uuid NOT NULL, - "key" text NOT NULL, - "value" text NOT NULL -); ---> statement-breakpoint -ALTER TABLE "resource_relationship_rule_metadata_equals" ADD CONSTRAINT "resource_relationship_rule_metadata_equals_resource_relationship_rule_id_resource_relationship_rule_id_fk" FOREIGN KEY ("resource_relationship_rule_id") REFERENCES "public"."resource_relationship_rule"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -CREATE UNIQUE INDEX "unique_resource_relationship_rule_metadata_equals" ON "resource_relationship_rule_metadata_equals" USING btree ("resource_relationship_rule_id","key"); \ No newline at end of file diff --git a/packages/db/drizzle/0099_pink_chamber.sql b/packages/db/drizzle/0099_pink_chamber.sql new file mode 100644 index 000000000..f1b19460e --- /dev/null +++ b/packages/db/drizzle/0099_pink_chamber.sql @@ -0,0 +1,10 @@ +ALTER TYPE "public"."scope_type" ADD VALUE 'resourceRelationshipRule' BEFORE 'workspace';--> statement-breakpoint +CREATE TABLE "resource_relationship_rule_target_metadata_equals" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, + "resource_relationship_rule_id" uuid NOT NULL, + "key" text NOT NULL, + "value" text NOT NULL +); +--> statement-breakpoint +ALTER TABLE "resource_relationship_rule_target_metadata_equals" ADD CONSTRAINT "resource_relationship_rule_target_metadata_equals_resource_relationship_rule_id_resource_relationship_rule_id_fk" FOREIGN KEY ("resource_relationship_rule_id") REFERENCES "public"."resource_relationship_rule"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +CREATE UNIQUE INDEX "unique_resource_relationship_rule_target_metadata_equals" ON "resource_relationship_rule_target_metadata_equals" USING btree ("resource_relationship_rule_id","key"); \ No newline at end of file diff --git a/packages/db/drizzle/meta/0099_snapshot.json b/packages/db/drizzle/meta/0099_snapshot.json index be63e3a84..737e428e8 100644 --- a/packages/db/drizzle/meta/0099_snapshot.json +++ b/packages/db/drizzle/meta/0099_snapshot.json @@ -1,5 +1,5 @@ { - "id": "45cb559c-82d4-4a6d-a390-8d6d7bbc6d1e", + "id": "a491210f-543e-42f5-b0dc-381b8c5282b6", "prevId": "388fdaa7-8b17-4f2c-a523-a344c2e223b3", "version": "7", "dialect": "postgresql", @@ -6075,8 +6075,8 @@ "checkConstraints": {}, "isRLSEnabled": false }, - "public.resource_relationship_rule_metadata_equals": { - "name": "resource_relationship_rule_metadata_equals", + "public.resource_relationship_rule_metadata_match": { + "name": "resource_relationship_rule_metadata_match", "schema": "", "columns": { "id": { @@ -6097,17 +6097,11 @@ "type": "text", "primaryKey": false, "notNull": true - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true } }, "indexes": { - "unique_resource_relationship_rule_metadata_equals": { - "name": "unique_resource_relationship_rule_metadata_equals", + "unique_resource_relationship_rule_metadata_match": { + "name": "unique_resource_relationship_rule_metadata_match", "columns": [ { "expression": "resource_relationship_rule_id", @@ -6129,9 +6123,9 @@ } }, "foreignKeys": { - "resource_relationship_rule_metadata_equals_resource_relationship_rule_id_resource_relationship_rule_id_fk": { - "name": "resource_relationship_rule_metadata_equals_resource_relationship_rule_id_resource_relationship_rule_id_fk", - "tableFrom": "resource_relationship_rule_metadata_equals", + "resource_relationship_rule_metadata_match_resource_relationship_rule_id_resource_relationship_rule_id_fk": { + "name": "resource_relationship_rule_metadata_match_resource_relationship_rule_id_resource_relationship_rule_id_fk", + "tableFrom": "resource_relationship_rule_metadata_match", "tableTo": "resource_relationship_rule", "columnsFrom": ["resource_relationship_rule_id"], "columnsTo": ["id"], @@ -6145,8 +6139,8 @@ "checkConstraints": {}, "isRLSEnabled": false }, - "public.resource_relationship_rule_metadata_match": { - "name": "resource_relationship_rule_metadata_match", + "public.resource_relationship_rule_target_metadata_equals": { + "name": "resource_relationship_rule_target_metadata_equals", "schema": "", "columns": { "id": { @@ -6167,11 +6161,17 @@ "type": "text", "primaryKey": false, "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true } }, "indexes": { - "unique_resource_relationship_rule_metadata_match": { - "name": "unique_resource_relationship_rule_metadata_match", + "unique_resource_relationship_rule_target_metadata_equals": { + "name": "unique_resource_relationship_rule_target_metadata_equals", "columns": [ { "expression": "resource_relationship_rule_id", @@ -6193,9 +6193,9 @@ } }, "foreignKeys": { - "resource_relationship_rule_metadata_match_resource_relationship_rule_id_resource_relationship_rule_id_fk": { - "name": "resource_relationship_rule_metadata_match_resource_relationship_rule_id_resource_relationship_rule_id_fk", - "tableFrom": "resource_relationship_rule_metadata_match", + "resource_relationship_rule_target_metadata_equals_resource_relationship_rule_id_resource_relationship_rule_id_fk": { + "name": "resource_relationship_rule_target_metadata_equals_resource_relationship_rule_id_resource_relationship_rule_id_fk", + "tableFrom": "resource_relationship_rule_target_metadata_equals", "tableTo": "resource_relationship_rule", "columnsFrom": ["resource_relationship_rule_id"], "columnsTo": ["id"], @@ -6296,6 +6296,7 @@ "resource", "resourceProvider", "resourceMetadataGroup", + "resourceRelationshipRule", "workspace", "environment", "environmentPolicy", diff --git a/packages/db/drizzle/meta/_journal.json b/packages/db/drizzle/meta/_journal.json index 512980bbc..51742b37b 100644 --- a/packages/db/drizzle/meta/_journal.json +++ b/packages/db/drizzle/meta/_journal.json @@ -698,8 +698,8 @@ { "idx": 99, "version": "7", - "when": 1746469060223, - "tag": "0099_dear_korg", + "when": 1746497118592, + "tag": "0099_pink_chamber", "breakpoints": true } ] diff --git a/packages/db/src/queries/get-resource-parents.ts b/packages/db/src/queries/get-resource-parents.ts index 74b0edf02..8ae391164 100644 --- a/packages/db/src/queries/get-resource-parents.ts +++ b/packages/db/src/queries/get-resource-parents.ts @@ -39,7 +39,7 @@ export const getResourceParents = async (tx: Tx, resourceId: string) => { ); const isMetadataEqualsSatisfied = or( - isNull(schema.resourceRelationshipRuleMetadataEquals.key), + isNull(schema.resourceRelationshipTargetRuleMetadataEquals.key), exists( tx .select() @@ -49,11 +49,11 @@ export const getResourceParents = async (tx: Tx, resourceId: string) => { eq(targetMetadata.resourceId, targetResource.id), eq( targetMetadata.key, - schema.resourceRelationshipRuleMetadataEquals.key, + schema.resourceRelationshipTargetRuleMetadataEquals.key, ), eq( targetMetadata.value, - schema.resourceRelationshipRuleMetadataEquals.value, + schema.resourceRelationshipTargetRuleMetadataEquals.value, ), ), ), @@ -101,9 +101,9 @@ export const getResourceParents = async (tx: Tx, resourceId: string) => { ), ) .leftJoin( - schema.resourceRelationshipRuleMetadataEquals, + schema.resourceRelationshipTargetRuleMetadataEquals, eq( - schema.resourceRelationshipRuleMetadataEquals + schema.resourceRelationshipTargetRuleMetadataEquals .resourceRelationshipRuleId, schema.resourceRelationshipRule.id, ), diff --git a/packages/db/src/schema/resource-relationship-rule.ts b/packages/db/src/schema/resource-relationship-rule.ts index 84bee3792..22c14d286 100644 --- a/packages/db/src/schema/resource-relationship-rule.ts +++ b/packages/db/src/schema/resource-relationship-rule.ts @@ -86,8 +86,8 @@ export const resourceRelationshipRule = pgTable( ], ); -export const resourceRelationshipRuleMetadataEquals = pgTable( - "resource_relationship_rule_metadata_equals", +export const resourceRelationshipTargetRuleMetadataEquals = pgTable( + "resource_relationship_rule_target_metadata_equals", { id: uuid("id").primaryKey().defaultRandom(), resourceRelationshipRuleId: uuid("resource_relationship_rule_id") @@ -100,7 +100,7 @@ export const resourceRelationshipRuleMetadataEquals = pgTable( value: text("value").notNull(), }, (t) => [ - uniqueIndex("unique_resource_relationship_rule_metadata_equals").on( + uniqueIndex("unique_resource_relationship_rule_target_metadata_equals").on( t.resourceRelationshipRuleId, t.key, ), @@ -131,7 +131,7 @@ export const resourceRelationshipRuleRelations = relations( resourceRelationshipRule, ({ many }) => ({ metadataMatches: many(resourceRelationshipRuleMetadataMatch), - metadataEquals: many(resourceRelationshipRuleMetadataEquals), + metadataEquals: many(resourceRelationshipTargetRuleMetadataEquals), }), ); @@ -148,11 +148,11 @@ export const resourceRelationshipRuleMetadataMatchRelations = relations( ); export const resourceRelationshipRuleMetadataEqualsRelations = relations( - resourceRelationshipRuleMetadataEquals, + resourceRelationshipTargetRuleMetadataEquals, ({ one }) => ({ rule: one(resourceRelationshipRule, { fields: [ - resourceRelationshipRuleMetadataEquals.resourceRelationshipRuleId, + resourceRelationshipTargetRuleMetadataEquals.resourceRelationshipRuleId, ], references: [resourceRelationshipRule.id], }), From 67636e5712e42ec6afd470931601d3cee9feb916 Mon Sep 17 00:00:00 2001 From: Justin Brooks Date: Mon, 5 May 2025 22:21:53 -0400 Subject: [PATCH 4/5] fix metadata name --- .../[ruleId]/openapi.ts | 2 +- .../v1/resource-relationship-rules/openapi.ts | 5 +- e2e/api/schema.ts | 8548 ++++++++--------- e2e/tests/api/resource-relationships.spec.ts | 4 +- openapi.v1.json | 12 +- 5 files changed, 4276 insertions(+), 4295 deletions(-) diff --git a/apps/webservice/src/app/api/v1/resource-relationship-rules/[ruleId]/openapi.ts b/apps/webservice/src/app/api/v1/resource-relationship-rules/[ruleId]/openapi.ts index a59868526..b09f241b2 100644 --- a/apps/webservice/src/app/api/v1/resource-relationship-rules/[ruleId]/openapi.ts +++ b/apps/webservice/src/app/api/v1/resource-relationship-rules/[ruleId]/openapi.ts @@ -26,7 +26,7 @@ export const openapi: Swagger.SwaggerV3 = { type: "array", items: { type: "string" }, }, - metadataKeysEquals: { + metadataTargetKeysEquals: { type: "array", items: { type: "object", diff --git a/apps/webservice/src/app/api/v1/resource-relationship-rules/openapi.ts b/apps/webservice/src/app/api/v1/resource-relationship-rules/openapi.ts index 68f97e92d..e6bfce3b0 100644 --- a/apps/webservice/src/app/api/v1/resource-relationship-rules/openapi.ts +++ b/apps/webservice/src/app/api/v1/resource-relationship-rules/openapi.ts @@ -95,7 +95,7 @@ export const openapi: Swagger.SwaggerV3 = { type: "array", items: { type: "string" }, }, - metadataKeysEquals: { + metadataTargetKeysEquals: { type: "array", items: { type: "object", @@ -103,6 +103,7 @@ export const openapi: Swagger.SwaggerV3 = { key: { type: "string" }, value: { type: "string" }, }, + required: ["key", "value"], }, }, }, @@ -135,7 +136,7 @@ export const openapi: Swagger.SwaggerV3 = { type: "array", items: { type: "string" }, }, - metadataKeysEquals: { + metadataTargetKeysEquals: { type: "array", items: { type: "object", diff --git a/e2e/api/schema.ts b/e2e/api/schema.ts index f9c8d60f8..f7707fc08 100644 --- a/e2e/api/schema.ts +++ b/e2e/api/schema.ts @@ -4,4399 +4,4373 @@ */ export interface paths { - "/api/v1/cloud-locations/{provider}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get all regions for a specific cloud provider - * @description Returns geographic data for all regions of a specific cloud provider - */ - get: operations["getCloudProviderRegions"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/deployment-version-channels": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create a deployment version channel */ - post: operations["createDeploymentVersionChannel"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/deployment-versions/{deploymentVersionId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** Updates a deployment version */ - patch: operations["updateDeploymentVersion"]; - trace?: never; - }; - "/v1/deployment-versions": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Upserts a deployment version */ - post: operations["upsertDeploymentVersion"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/deployments/{deploymentId}/deployment-version-channels/name/{name}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** Delete a deployment version channel */ - delete: operations["deleteDeploymentVersionChannel"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/deployments/{deploymentId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get a deployment */ - get: operations["getDeployment"]; - put?: never; - post?: never; - /** Delete a deployment */ - delete: operations["deleteDeployment"]; - options?: never; - head?: never; - /** Update a deployment */ - patch: operations["updateDeployment"]; - 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/deployments/{deploymentId}/resources": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get resources for a deployment */ - get: operations["getResourcesForDeployment"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/deployments/{deploymentId}/variables": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get all variables for a deployment */ - get: operations["getDeploymentVariables"]; - put?: never; - /** Create a new variable for a deployment */ - post: operations["createDeploymentVariable"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/deployments": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create a deployment */ - post: operations["createDeployment"]; - delete?: never; - 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/{environmentId}/resources": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get resources for an environment */ - get: operations["getResourcesForEnvironment"]; - put?: never; - post?: never; - delete?: never; - 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["getAgentRunningJobs"]; - 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["upsertJobAgent"]; - 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/policies/{policyId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** Delete a policy */ - delete: operations["deletePolicy"]; - options?: never; - head?: never; - /** Update a policy */ - patch: operations["updatePolicy"]; - trace?: never; - }; - "/v1/policies/{policyId}/release-targets": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get release targets for a policy */ - get: operations["getReleaseTargetsForPolicy"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/policies": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Upsert a policy */ - post: operations["upsertPolicy"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - 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/release-targets/{releaseTargetId}/releases": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get the latest 100 releases for a release target */ - get: operations["getReleaseTargetReleases"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/releases/{releaseId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** Updates a release */ - patch: operations["updateRelease"]; - trace?: never; - }; - "/v1/releases": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Upserts a release */ - post: operations["upsertRelease"]; - 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/resource-relationship-rules/{ruleId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** Update a resource relationship rule */ - patch: operations["updateResourceRelationshipRule"]; - trace?: never; - }; - "/v1/resource-relationship-rules": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create a resource relationship rule */ - post: operations["createResourceRelationshipRule"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/resource-schemas": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create a resource schema */ - post: operations["createResourceSchema"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/resource-schemas/{schemaId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** Delete a resource schema */ - delete: operations["deleteResourceSchema"]; - options?: never; - head?: never; - patch?: never; - 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/{resourceId}/release-targets": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get release targets for a resource */ - get: operations["getReleaseTargets"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/resources": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create or update a resource */ - post: operations["upsertResource"]; - 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 a system */ - delete: operations["deleteSystem"]; - options?: never; - head?: never; - /** Update a system */ - patch: operations["updateSystem"]; - trace?: never; - }; - "/v1/systems": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create a system */ - post: operations["createSystem"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/workspaces/{workspaceId}/deployments": { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - }; - cookie?: never; - }; - /** List all deployments */ - get: operations["listDeployments"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/workspaces/{workspaceId}/environments": { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - }; - cookie?: never; - }; - /** List all environments */ - get: operations["listEnvironments"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/workspaces/{workspaceId}/events/{action}": { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - action: string; - }; - cookie?: never; - }; - /** Get events by action */ - get: operations["getEventsByAction"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/workspaces/{workspaceId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get a workspace */ - get: operations["getWorkspace"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/workspaces/{workspaceId}/policies/{name}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** Delete a policy by name */ - delete: operations["deletePolicyByName"]; - 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/workspaces/{workspaceId}/resources/metadata-grouped-counts": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Get grouped counts of resources */ - post: operations["getGroupedCounts"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/workspaces/{workspaceId}/resources": { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - }; - cookie?: never; - }; - /** List all resources */ - get: operations["listResources"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/workspaces/{workspaceId}/systems": { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - }; - cookie?: never; - }; - /** List all systems */ - get: operations["listSystems"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/workspaces/slug/{workspaceSlug}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; + "/api/v1/cloud-locations/{provider}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get all regions for a specific cloud provider + * @description Returns geographic data for all regions of a specific cloud provider + */ + get: operations["getCloudProviderRegions"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/deployment-version-channels": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create a deployment version channel */ + post: operations["createDeploymentVersionChannel"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/deployment-versions/{deploymentVersionId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** Updates a deployment version */ + patch: operations["updateDeploymentVersion"]; + trace?: never; + }; + "/v1/deployment-versions": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Upserts a deployment version */ + post: operations["upsertDeploymentVersion"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/deployments/{deploymentId}/deployment-version-channels/name/{name}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** Delete a deployment version channel */ + delete: operations["deleteDeploymentVersionChannel"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/deployments/{deploymentId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a deployment */ + get: operations["getDeployment"]; + put?: never; + post?: never; + /** Delete a deployment */ + delete: operations["deleteDeployment"]; + options?: never; + head?: never; + /** Update a deployment */ + patch: operations["updateDeployment"]; + 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/deployments/{deploymentId}/resources": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get resources for a deployment */ + get: operations["getResourcesForDeployment"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/deployments/{deploymentId}/variables": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get all variables for a deployment */ + get: operations["getDeploymentVariables"]; + put?: never; + /** Create a new variable for a deployment */ + post: operations["createDeploymentVariable"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/deployments": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create a deployment */ + post: operations["createDeployment"]; + delete?: never; + 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/{environmentId}/resources": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get resources for an environment */ + get: operations["getResourcesForEnvironment"]; + put?: never; + post?: never; + delete?: never; + 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["getAgentRunningJobs"]; + 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["upsertJobAgent"]; + 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/policies/{policyId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** Delete a policy */ + delete: operations["deletePolicy"]; + options?: never; + head?: never; + /** Update a policy */ + patch: operations["updatePolicy"]; + trace?: never; + }; + "/v1/policies/{policyId}/release-targets": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get release targets for a policy */ + get: operations["getReleaseTargetsForPolicy"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/policies": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Upsert a policy */ + post: operations["upsertPolicy"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + 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/release-targets/{releaseTargetId}/releases": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the latest 100 releases for a release target */ + get: operations["getReleaseTargetReleases"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/releases/{releaseId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** Updates a release */ + patch: operations["updateRelease"]; + trace?: never; + }; + "/v1/releases": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Upserts a release */ + post: operations["upsertRelease"]; + 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/resource-relationship-rules/{ruleId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** Update a resource relationship rule */ + patch: operations["updateResourceRelationshipRule"]; + trace?: never; + }; + "/v1/resource-relationship-rules": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create a resource relationship rule */ + post: operations["createResourceRelationshipRule"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/resource-schemas": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create a resource schema */ + post: operations["createResourceSchema"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/resource-schemas/{schemaId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** Delete a resource schema */ + delete: operations["deleteResourceSchema"]; + options?: never; + head?: never; + patch?: never; + 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/{resourceId}/release-targets": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get release targets for a resource */ + get: operations["getReleaseTargets"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/resources": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create or update a resource */ + post: operations["upsertResource"]; + 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 a system */ + delete: operations["deleteSystem"]; + options?: never; + head?: never; + /** Update a system */ + patch: operations["updateSystem"]; + trace?: never; + }; + "/v1/systems": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create a system */ + post: operations["createSystem"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/{workspaceId}/deployments": { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + }; + cookie?: never; + }; + /** List all deployments */ + get: operations["listDeployments"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/{workspaceId}/environments": { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + }; + cookie?: never; + }; + /** List all environments */ + get: operations["listEnvironments"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/{workspaceId}/events/{action}": { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + action: string; + }; + cookie?: never; + }; + /** Get events by action */ + get: operations["getEventsByAction"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/{workspaceId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a workspace */ + get: operations["getWorkspace"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/{workspaceId}/policies/{name}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** Delete a policy by name */ + delete: operations["deletePolicyByName"]; + 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/workspaces/{workspaceId}/resources/metadata-grouped-counts": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Get grouped counts of resources */ + post: operations["getGroupedCounts"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/{workspaceId}/resources": { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + }; + cookie?: never; + }; + /** List all resources */ + get: operations["listResources"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/{workspaceId}/systems": { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + }; + cookie?: never; + }; + /** List all systems */ + get: operations["listSystems"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/slug/{workspaceSlug}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a workspace by slug */ + get: operations["getWorkspaceBySlug"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; }; - /** Get a workspace by slug */ - get: operations["getWorkspaceBySlug"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; } export type webhooks = Record; export interface components { - schemas: { - CloudRegionGeoData: { - /** - * @description Timezone of the region in UTC format - * @example UTC+1 - */ - timezone: string; - /** - * Format: float - * @description Latitude coordinate for the region - * @example 50.1109 - */ - latitude: number; - /** - * Format: float - * @description Longitude coordinate for the region - * @example 8.6821 - */ - longitude: number; - }; - DeploymentVariableValue: { - /** Format: uuid */ - id: string; - value: unknown; - sensitive: boolean; - resourceSelector: { - [key: string]: unknown; - } | null; - }; - DeploymentVariable: { - /** Format: uuid */ - id: string; - key: string; - description: string; - values: components["schemas"]["DeploymentVariableValue"][]; - defaultValue?: components["schemas"]["DeploymentVariableValue"]; - config: { - [key: string]: unknown; - }; - }; - JobWithTrigger: components["schemas"]["Job"] & { - release?: components["schemas"]["Release"]; - version?: components["schemas"]["DeploymentVersion"]; - deployment?: components["schemas"]["Deployment"]; - runbook?: components["schemas"]["Runbook"]; - resource?: components["schemas"]["ResourceWithVariablesAndMetadata"] & { - relationships?: { - [key: string]: components["schemas"]["Resource"]; - }; - }; - environment?: components["schemas"]["Environment"]; - variables: components["schemas"]["VariableMap"]; - approval?: { - id: string; + schemas: { + CloudRegionGeoData: { + /** + * @description Timezone of the region in UTC format + * @example UTC+1 + */ + timezone: string; + /** + * Format: float + * @description Latitude coordinate for the region + * @example 50.1109 + */ + latitude: number; + /** + * Format: float + * @description Longitude coordinate for the region + * @example 8.6821 + */ + longitude: number; + }; + DeploymentVariableValue: { + /** Format: uuid */ + id: string; + value: unknown; + sensitive: boolean; + resourceSelector: { + [key: string]: unknown; + } | null; + }; + DeploymentVariable: { + /** Format: uuid */ + id: string; + key: string; + description: string; + values: components["schemas"]["DeploymentVariableValue"][]; + defaultValue?: components["schemas"]["DeploymentVariableValue"]; + config: { + [key: string]: unknown; + }; + }; + JobWithTrigger: components["schemas"]["Job"] & { + release?: components["schemas"]["Release"]; + version?: components["schemas"]["DeploymentVersion"]; + deployment?: components["schemas"]["Deployment"]; + runbook?: components["schemas"]["Runbook"]; + resource?: components["schemas"]["ResourceWithVariablesAndMetadata"] & { + relationships?: { + [key: string]: components["schemas"]["Resource"]; + }; + }; + environment?: components["schemas"]["Environment"]; + variables: components["schemas"]["VariableMap"]; + 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; + }; + Workspace: { + /** + * Format: uuid + * @description The workspace ID + */ + id: string; + /** @description The name of the workspace */ + name: string; + /** @description The slug of the workspace */ + slug: string; + /** + * @description The email of the Google service account attached to the workspace + * @example ctrlplane@ctrlplane-workspace.iam.gserviceaccount.com + */ + googleServiceAccountEmail?: string | null; + /** + * @description The ARN of the AWS role attached to the workspace + * @example arn:aws:iam::123456789012:role/ctrlplane-workspace-role + */ + awsRoleArn?: string | null; + }; + System: { + /** + * Format: uuid + * @description The system ID + */ + id: string; + /** + * Format: uuid + * @description The workspace ID of the system + */ + workspaceId: string; + /** @description The name of the system */ + name: string; + /** @description The slug of the system */ + slug: string; + /** @description The description of the system */ + description?: string; + }; + Deployment: { + /** Format: uuid */ + id: string; + name: string; + slug: string; + description: string; + /** Format: uuid */ + systemId: string; + /** Format: uuid */ + jobAgentId?: string | null; + jobAgentConfig: { + [key: string]: unknown; + }; + retryCount?: number; + timeout?: number | null; + }; + /** @description Schema for updating a deployment (all fields optional) */ + UpdateDeployment: { + [key: string]: unknown; + } & (WithRequired & { + [key: string]: unknown; + }); + Release: { + /** Format: uuid */ + id: string; + name: string; + version: string; + config: { + [key: string]: unknown; + }; + jobAgentConfig: { + [key: string]: unknown; + }; + /** Format: uuid */ + deploymentId: string; + /** Format: date-time */ + createdAt: string; + metadata?: { + [key: string]: unknown; + }; + }; + DeploymentVersion: { + /** Format: uuid */ + id: string; + name: string; + tag: string; + config: { + [key: string]: unknown; + }; + jobAgentConfig: { + [key: string]: unknown; + }; + /** Format: uuid */ + deploymentId: string; + /** Format: date-time */ + createdAt: string; + metadata?: { + [key: string]: string; + }; + /** @enum {string} */ + status?: "building" | "ready" | "failed"; + }; + Policy: { + /** + * Format: uuid + * @description The policy ID + */ + id: string; + /** + * Format: uuid + * @description The system ID + */ + systemId: string; + /** @description The name of the policy */ + name: string; + /** @description The description of the policy */ + description?: string | null; + /** + * @description The approval requirement of the policy + * @enum {string} + */ + approvalRequirement: "manual" | "automatic"; + /** + * @description If a policy depends on an environment, whether or not the policy requires all, some, or optional successful releases in the environment + * @enum {string} + */ + successType: "some" | "all" | "optional"; + /** @description If a policy depends on an environment, the minimum number of successful releases in the environment */ + successMinimum: number; + /** @description The maximum number of concurrent releases in the environment */ + concurrencyLimit?: number | null; + /** @description The duration of the rollout in milliseconds */ + rolloutDuration: number; + /** @description The minimum interval between releases in milliseconds */ + minimumReleaseInterval: number; + /** + * @description If a new release is created, whether it will wait for the current release to finish before starting, or cancel the current release + * @enum {string} + */ + releaseSequencing: "wait" | "cancel"; + }; + Environment: { + /** Format: uuid */ + id: string; + /** Format: uuid */ + systemId: string; + name: string; + description?: string; + /** Format: uuid */ + policyId?: string | null; + resourceSelector?: { + [key: string]: unknown; + } | null; + /** + * @description The directory path of the environment + * @default + * @example my/env/path + */ + directory: string; + /** Format: date-time */ + createdAt: string; + metadata?: { + [key: string]: string; + }; + policy?: components["schemas"]["Policy"]; + }; + 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; + /** Format: uuid */ + providerId?: string; + }; + ResourceWithVariables: components["schemas"]["Resource"] & { + variables?: components["schemas"]["VariableMap"]; + }; + ResourceWithMetadata: components["schemas"]["Resource"] & { + metadata?: components["schemas"]["MetadataMap"]; + }; + ResourceWithVariablesAndMetadata: components["schemas"]["ResourceWithVariables"] & components["schemas"]["ResourceWithMetadata"]; /** @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; - }; - Workspace: { - /** - * Format: uuid - * @description The workspace ID - */ - id: string; - /** @description The name of the workspace */ - name: string; - /** @description The slug of the workspace */ - slug: string; - /** - * @description The email of the Google service account attached to the workspace - * @example ctrlplane@ctrlplane-workspace.iam.gserviceaccount.com - */ - googleServiceAccountEmail?: string | null; - /** - * @description The ARN of the AWS role attached to the workspace - * @example arn:aws:iam::123456789012:role/ctrlplane-workspace-role - */ - awsRoleArn?: string | null; - }; - System: { - /** - * Format: uuid - * @description The system ID - */ - id: string; - /** - * Format: uuid - * @description The workspace ID of the system - */ - workspaceId: string; - /** @description The name of the system */ - name: string; - /** @description The slug of the system */ - slug: string; - /** @description The description of the system */ - description?: string; - }; - Deployment: { - /** Format: uuid */ - id: string; - name: string; - slug: string; - description: string; - /** Format: uuid */ - systemId: string; - /** Format: uuid */ - jobAgentId?: string | null; - jobAgentConfig: { - [key: string]: unknown; - }; - retryCount?: number; - timeout?: number | null; - }; - /** @description Schema for updating a deployment (all fields optional) */ - UpdateDeployment: { - [key: string]: unknown; - } & (WithRequired & { - [key: string]: unknown; - }); - Release: { - /** Format: uuid */ - id: string; - name: string; - version: string; - config: { - [key: string]: unknown; - }; - jobAgentConfig: { - [key: string]: unknown; - }; - /** Format: uuid */ - deploymentId: string; - /** Format: date-time */ - createdAt: string; - metadata?: { - [key: string]: unknown; - }; - }; - DeploymentVersion: { - /** Format: uuid */ - id: string; - name: string; - tag: string; - config: { - [key: string]: unknown; - }; - jobAgentConfig: { - [key: string]: unknown; - }; - /** Format: uuid */ - deploymentId: string; - /** Format: date-time */ - createdAt: string; - metadata?: { - [key: string]: string; - }; - /** @enum {string} */ - status?: "building" | "ready" | "failed"; + JobStatus: "successful" | "cancelled" | "skipped" | "in_progress" | "action_required" | "pending" | "failure" | "invalid_job_agent" | "invalid_integration" | "external_run_not_found"; + Job: { + /** Format: uuid */ + id: string; + status: components["schemas"]["JobStatus"]; + /** @description External job identifier (e.g. GitHub workflow run ID) */ + externalId?: string | null; + /** Format: date-time */ + createdAt: string; + /** Format: date-time */ + updatedAt: string; + /** Format: date-time */ + startedAt?: string | null; + /** Format: date-time */ + completedAt?: string | null; + /** Format: uuid */ + jobAgentId?: string; + /** @description Configuration for the Job Agent */ + jobAgentConfig: { + [key: string]: unknown; + }; + message?: string; + reason?: string; + }; + MetadataMap: { + [key: string]: string; + }; + VariableMap: { + [key: string]: (string | boolean | number | Record | unknown[]) | null; + }; + ReferenceVariable: { + key: string; + reference: string; + path: string[]; + defaultValue?: string | number | boolean | Record | unknown[]; + }; + DirectVariable: { + key: string; + value: string | number | boolean | Record | unknown[]; + sensitive?: boolean; + }; + Variable: components["schemas"]["DirectVariable"] | components["schemas"]["ReferenceVariable"]; + PolicyTarget: { + deploymentSelector?: { + [key: string]: unknown; + } | null; + environmentSelector?: { + [key: string]: unknown; + } | null; + resourceSelector?: { + [key: string]: unknown; + } | null; + }; + DenyWindow: { + timeZone: string; + rrule: { + [key: string]: unknown; + }; + /** Format: date-time */ + dtend?: string; + }; + DeploymentVersionSelector: { + name: string; + deploymentVersionSelector: { + [key: string]: unknown; + }; + description?: string; + }; + VersionAnyApproval: { + requiredApprovalsCount: number; + }; + VersionUserApproval: { + userId: string; + }; + VersionRoleApproval: { + roleId: string; + requiredApprovalsCount: number; + }; + Policy1: { + /** Format: uuid */ + id: string; + name: string; + description?: string; + priority: number; + /** Format: date-time */ + createdAt: string; + enabled: boolean; + /** Format: uuid */ + workspaceId: string; + targets: components["schemas"]["PolicyTarget"][]; + denyWindows: components["schemas"]["DenyWindow"][]; + deploymentVersionSelector?: components["schemas"]["DeploymentVersionSelector"]; + versionAnyApprovals?: components["schemas"]["VersionAnyApproval"][]; + versionUserApprovals: components["schemas"]["VersionUserApproval"][]; + versionRoleApprovals: components["schemas"]["VersionRoleApproval"][]; + }; + UpdateResourceRelationshipRule: { + name?: string; + reference?: string; + dependencyType?: components["schemas"]["ResourceRelationshipRuleDependencyType"]; + dependencyDescription?: string; + description?: string; + sourceKind?: string; + sourceVersion?: string; + targetKind?: string; + targetVersion?: string; + metadataKeysMatch?: string[]; + metadataTargetKeysEquals?: { + key: string; + value: string; + }[]; + }; + /** @enum {string} */ + ResourceRelationshipRuleDependencyType: "depends_on" | "depends_indirectly_on" | "uses_at_runtime" | "created_after" | "provisioned_in" | "inherits_from"; + ResourceRelationshipRule: { + /** Format: uuid */ + id: string; + /** Format: uuid */ + workspaceId: string; + name: string; + reference: string; + dependencyType: components["schemas"]["ResourceRelationshipRuleDependencyType"]; + dependencyDescription?: string; + description?: string; + sourceKind: string; + sourceVersion: string; + targetKind?: string; + targetVersion?: string; + metadataKeysMatch?: string[]; + metadataTargetKeysEquals?: { + key: string; + value: string; + }[]; + }; + CreateResourceRelationshipRule: { + workspaceId: string; + name: string; + reference: string; + dependencyType: components["schemas"]["ResourceRelationshipRuleDependencyType"]; + dependencyDescription?: string; + description?: string; + sourceKind: string; + sourceVersion: string; + targetKind: string; + targetVersion: string; + metadataKeysMatch?: string[]; + metadataTargetKeysEquals?: { + key: string; + value: string; + }[]; + }; + ReleaseTarget: { + /** Format: uuid */ + id: string; + resource: components["schemas"]["Resource"]; + environment: components["schemas"]["Environment"]; + deployment: components["schemas"]["Deployment"]; + }; + Event: { + /** Format: uuid */ + id: string; + action: string; + payload: { + [key: string]: unknown; + }; + /** Format: date-time */ + createdAt: string; + }; }; - Policy: { - /** - * Format: uuid - * @description The policy ID - */ - id: string; - /** - * Format: uuid - * @description The system ID - */ - systemId: string; - /** @description The name of the policy */ - name: string; - /** @description The description of the policy */ - description?: string | null; - /** - * @description The approval requirement of the policy - * @enum {string} - */ - approvalRequirement: "manual" | "automatic"; - /** - * @description If a policy depends on an environment, whether or not the policy requires all, some, or optional successful releases in the environment - * @enum {string} - */ - successType: "some" | "all" | "optional"; - /** @description If a policy depends on an environment, the minimum number of successful releases in the environment */ - successMinimum: number; - /** @description The maximum number of concurrent releases in the environment */ - concurrencyLimit?: number | null; - /** @description The duration of the rollout in milliseconds */ - rolloutDuration: number; - /** @description The minimum interval between releases in milliseconds */ - minimumReleaseInterval: number; - /** - * @description If a new release is created, whether it will wait for the current release to finish before starting, or cancel the current release - * @enum {string} - */ - releaseSequencing: "wait" | "cancel"; + responses: never; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; +} +export type $defs = Record; +export interface operations { + getCloudProviderRegions: { + parameters: { + query?: never; + header?: never; + path: { + /** @description Cloud provider (aws, gcp, azure) */ + provider: "aws" | "gcp" | "azure"; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successfully returned geographic data for cloud provider regions */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + [key: string]: components["schemas"]["CloudRegionGeoData"]; + }; + }; + }; + /** @description Cloud provider not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Cloud provider 'unknown' not found */ + error?: string; + }; + }; + }; + }; }; - Environment: { - /** Format: uuid */ - id: string; - /** Format: uuid */ - systemId: string; - name: string; - description?: string; - /** Format: uuid */ - policyId?: string | null; - resourceSelector?: { - [key: string]: unknown; - } | null; - /** - * @description The directory path of the environment - * @default - * @example my/env/path - */ - directory: string; - /** Format: date-time */ - createdAt: string; - metadata?: { - [key: string]: string; - }; - policy?: components["schemas"]["Policy"]; + createDeploymentVersionChannel: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + deploymentId: string; + name: string; + description?: string | null; + versionSelector: { + [key: string]: unknown; + }; + }; + }; + }; + responses: { + /** @description Deployment version 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; + versionSelector?: { + [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 Deployment version channel already exists */ + 409: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + id: string; + }; + }; + }; + /** @description Failed to create deployment version channel */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; }; - Runbook: { - /** Format: uuid */ - id: string; - name: string; - /** Format: uuid */ - systemId: string; - /** Format: uuid */ - jobAgentId: string; + updateDeploymentVersion: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The deployment version ID */ + deploymentVersionId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + tag?: string; + deploymentId?: string; + /** Format: date-time */ + createdAt?: string; + name?: string; + config?: { + [key: string]: unknown; + }; + jobAgentConfig?: { + [key: string]: unknown; + }; + /** @enum {string} */ + status?: "ready" | "building" | "failed"; + message?: string; + metadata?: { + [key: string]: string; + }; + }; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DeploymentVersion"]; + }; + }; + /** @description Deployment version not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: 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; - /** Format: uuid */ - providerId?: string; + upsertDeploymentVersion: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + tag: string; + deploymentId: string; + /** Format: date-time */ + createdAt?: string; + name?: string; + config?: { + [key: string]: unknown; + }; + jobAgentConfig?: { + [key: string]: unknown; + }; + /** @enum {string} */ + status?: "ready" | "building" | "failed"; + message?: string; + metadata?: { + [key: string]: string; + }; + }; + }; + }; + responses: { + /** @description OK */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DeploymentVersion"]; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + }; }; - ResourceWithVariables: components["schemas"]["Resource"] & { - variables?: components["schemas"]["VariableMap"]; + deleteDeploymentVersionChannel: { + parameters: { + query?: never; + header?: never; + path: { + deploymentId: string; + name: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Deployment version 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 Deployment version channel not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description Failed to delete deployment version channel */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; }; - ResourceWithMetadata: components["schemas"]["Resource"] & { - metadata?: components["schemas"]["MetadataMap"]; + getDeployment: { + parameters: { + query?: never; + header?: never; + path: { + deploymentId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Deployment found */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Deployment"]; + }; + }; + /** @description Deployment not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; }; - ResourceWithVariablesAndMetadata: components["schemas"]["ResourceWithVariables"] & - components["schemas"]["ResourceWithMetadata"]; - /** @enum {string} */ - JobStatus: - | "successful" - | "cancelled" - | "skipped" - | "in_progress" - | "action_required" - | "pending" - | "failure" - | "invalid_job_agent" - | "invalid_integration" - | "external_run_not_found"; - Job: { - /** Format: uuid */ - id: string; - status: components["schemas"]["JobStatus"]; - /** @description External job identifier (e.g. GitHub workflow run ID) */ - externalId?: string | null; - /** Format: date-time */ - createdAt: string; - /** Format: date-time */ - updatedAt: string; - /** Format: date-time */ - startedAt?: string | null; - /** Format: date-time */ - completedAt?: string | null; - /** Format: uuid */ - jobAgentId?: string; - /** @description Configuration for the Job Agent */ - jobAgentConfig: { - [key: string]: unknown; - }; - message?: string; - reason?: string; + deleteDeployment: { + parameters: { + query?: never; + header?: never; + path: { + deploymentId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Deployment deleted */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Deployment"]; + }; + }; + /** @description Deployment not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description Failed to delete deployment */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; }; - MetadataMap: { - [key: string]: string; + updateDeployment: { + parameters: { + query?: never; + header?: never; + path: { + deploymentId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + name?: string; + slug?: string; + description?: string; + /** Format: uuid */ + systemId?: string; + /** Format: uuid */ + jobAgentId?: string | null; + jobAgentConfig?: { + [key: string]: unknown; + }; + retryCount?: number; + timeout?: number | null; + resourceSelector?: { + [key: string]: unknown; + } | null; + }; + }; + }; + responses: { + /** @description Deployment updated */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Deployment"]; + }; + }; + /** @description Deployment not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description Failed to update deployment */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; }; - VariableMap: { - [key: string]: - | (string | boolean | number | Record | unknown[]) - | null; + 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; + }; + }; + }; + }; }; - ReferenceVariable: { - key: string; - reference: string; - path: string[]; - defaultValue?: - | string - | number - | boolean - | Record - | unknown[]; + getResourcesForDeployment: { + parameters: { + query?: never; + header?: never; + path: { + /** @description UUID of the deployment */ + deploymentId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + resources?: components["schemas"]["Resource"][]; + count?: number; + }; + }; + }; + /** @description Internal Server Error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + }; }; - DirectVariable: { - key: string; - value: string | number | boolean | Record | unknown[]; - sensitive?: boolean; + getDeploymentVariables: { + parameters: { + query?: never; + header?: never; + path: { + deploymentId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Variables fetched successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DeploymentVariable"][]; + }; + }; + /** @description Deployment not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description Failed to fetch variables */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; }; - Variable: - | components["schemas"]["DirectVariable"] - | components["schemas"]["ReferenceVariable"]; - PolicyTarget: { - deploymentSelector?: { - [key: string]: unknown; - } | null; - environmentSelector?: { - [key: string]: unknown; - } | null; - resourceSelector?: { - [key: string]: unknown; - } | null; + createDeploymentVariable: { + parameters: { + query?: never; + header?: never; + path: { + deploymentId: string; + }; + cookie?: never; + }; + requestBody?: { + content: { + "application/json": { + key: string; + description?: string; + config: { + [key: string]: unknown; + }; + values?: { + value: unknown; + sensitive?: boolean; + resourceSelector?: { + [key: string]: unknown; + } | null; + default?: boolean; + }[]; + }; + }; + }; + responses: { + /** @description Variable created successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DeploymentVariable"]; + }; + }; + /** @description Invalid request body */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description Deployment not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description Failed to create variable */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; }; - DenyWindow: { - timeZone: string; - rrule: { - [key: string]: unknown; - }; - /** Format: date-time */ - dtend?: string; + createDeployment: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: { + content: { + "application/json": { + /** + * Format: uuid + * @description The ID of the system to create the deployment for + * @example 123e4567-e89b-12d3-a456-426614174000 + */ + systemId: string; + /** + * @description The name of the deployment + * @example My Deployment + */ + name: string; + /** + * @description The slug of the deployment + * @example my-deployment + */ + slug: string; + /** + * @description The description of the deployment + * @example This is a deployment for my system + */ + description?: string; + /** + * Format: uuid + * @description The ID of the job agent to use for the deployment + * @example 123e4567-e89b-12d3-a456-426614174000 + */ + jobAgentId?: string; + /** + * @description The configuration for the job agent + * @example { + * "key": "value" + * } + */ + jobAgentConfig?: Record; + /** + * @description The number of times to retry the deployment + * @example 3 + */ + retryCount?: number; + /** + * @description The timeout for the deployment + * @example 60 + */ + timeout?: number; + /** + * @description The resource selector for the deployment + * @example { + * "key": "value" + * } + */ + resourceSelector?: { + [key: string]: unknown; + }; + }; + }; + }; + responses: { + /** @description Deployment created */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Deployment"]; + }; + }; + /** @description Deployment already exists */ + 409: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + /** Format: uuid */ + id: string; + }; + }; + }; + /** @description Failed to create deployment */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; }; - DeploymentVersionSelector: { - name: string; - deploymentVersionSelector: { - [key: string]: unknown; - }; - description?: 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": components["schemas"]["Environment"]; + }; + }; + /** @description Environment not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Environment not found */ + error: string; + }; + }; + }; + }; }; - VersionAnyApproval: { - requiredApprovalsCount: number; + 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; + }; + }; }; - VersionUserApproval: { - userId: string; + getResourcesForEnvironment: { + parameters: { + query?: never; + header?: never; + path: { + /** @description UUID of the environment */ + environmentId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + resources?: components["schemas"]["Resource"][]; + count?: number; + }; + }; + }; + /** @description Internal Server Error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + }; }; - VersionRoleApproval: { - roleId: string; - requiredApprovalsCount: number; + createEnvironment: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** + * @description The directory path of the environment + * @default + * @example my/env/path + */ + directory?: string; + systemId: string; + name: string; + description?: string; + resourceSelector?: { + [key: string]: unknown; + }; + policyId?: string; + releaseChannels?: string[]; + deploymentVersionChannels?: string[]; + metadata?: { + [key: string]: string; + }; + }; + }; + }; + responses: { + /** @description Environment created successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Environment"]; + }; + }; + /** @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; + }; + }; + }; + }; }; - Policy1: { - /** Format: uuid */ - id: string; - name: string; - description?: string; - priority: number; - /** Format: date-time */ - createdAt: string; - enabled: boolean; - /** Format: uuid */ - workspaceId: string; - targets: components["schemas"]["PolicyTarget"][]; - denyWindows: components["schemas"]["DenyWindow"][]; - deploymentVersionSelector?: components["schemas"]["DeploymentVersionSelector"]; - versionAnyApprovals?: components["schemas"]["VersionAnyApproval"][]; - versionUserApprovals: components["schemas"]["VersionUserApproval"][]; - versionRoleApprovals: components["schemas"]["VersionRoleApproval"][]; + getAgentRunningJobs: { + 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": { + jobs: components["schemas"]["Job"][]; + }; + }; + }; + }; }; - UpdateResourceRelationshipRule: { - name?: string; - reference?: string; - dependencyType?: components["schemas"]["ResourceRelationshipRuleDependencyType"]; - dependencyDescription?: string; - description?: string; - sourceKind?: string; - sourceVersion?: string; - targetKind?: string; - targetVersion?: string; - metadataKeysMatch?: string[]; - metadataKeysEquals?: { - key: string; - value: 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?: components["schemas"]["Job"]; + }; + }; + }; + /** @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; + }; + }; + }; + }; }; - /** @enum {string} */ - ResourceRelationshipRuleDependencyType: - | "depends_on" - | "depends_indirectly_on" - | "uses_at_runtime" - | "created_after" - | "provisioned_in" - | "inherits_from"; - ResourceRelationshipRule: { - /** Format: uuid */ - id: string; - /** Format: uuid */ - workspaceId: string; - name: string; - reference: string; - dependencyType: components["schemas"]["ResourceRelationshipRuleDependencyType"]; - dependencyDescription?: string; - description?: string; - sourceKind: string; - sourceVersion: string; - targetKind?: string; - targetVersion?: string; - metadataKeysMatch?: string[]; - metadataKeysEquals?: { - key?: string; - value?: 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?: components["schemas"]["Job"][]; + }; + }; + }; + }; }; - CreateResourceRelationshipRule: { - workspaceId: string; - name: string; - reference: string; - dependencyType: components["schemas"]["ResourceRelationshipRuleDependencyType"]; - dependencyDescription?: string; - description?: string; - sourceKind: string; - sourceVersion: string; - targetKind: string; - targetVersion: string; - metadataKeysMatch?: string[]; - metadataKeysEquals?: { - key: string; - value: string; - }[]; + upsertJobAgent: { + 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; + }; + }; }; - ReleaseTarget: { - /** Format: uuid */ - id: string; - resource: components["schemas"]["Resource"]; - environment: components["schemas"]["Environment"]; - deployment: components["schemas"]["Deployment"]; + 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; + }; + }; + }; + }; }; - Event: { - /** Format: uuid */ - id: string; - action: string; - payload: { - [key: string]: unknown; - }; - /** Format: date-time */ - createdAt: string; + 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"]["JobWithTrigger"]; + }; + }; + /** @description Not Found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Job not found. */ + error?: string; + }; + }; + }; + }; }; - }; - responses: never; - parameters: never; - requestBodies: never; - headers: never; - pathItems: never; -} -export type $defs = Record; -export interface operations { - getCloudProviderRegions: { - parameters: { - query?: never; - header?: never; - path: { - /** @description Cloud provider (aws, gcp, azure) */ - provider: "aws" | "gcp" | "azure"; - }; - cookie?: never; + updateJob: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The execution ID */ + jobId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + status?: components["schemas"]["JobStatus"]; + message?: string | null; + externalId?: string | null; + }; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + }; + }; + }; + }; }; - requestBody?: never; - responses: { - /** @description Successfully returned geographic data for cloud provider regions */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - [key: string]: components["schemas"]["CloudRegionGeoData"]; - }; - }; - }; - /** @description Cloud provider not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Cloud provider 'unknown' not found */ - error?: string; - }; - }; - }; + deletePolicy: { + parameters: { + query?: never; + header?: never; + path: { + policyId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + count?: number; + }; + }; + }; + /** @description Internal Server Error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + }; }; - }; - createDeploymentVersionChannel: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; + updatePolicy: { + parameters: { + query?: never; + header?: never; + path: { + policyId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + name?: string; + description?: string; + priority?: number; + enabled?: boolean; + workspaceId?: string; + targets?: components["schemas"]["PolicyTarget"][]; + denyWindows?: { + timeZone: string; + rrule?: { + [key: string]: unknown; + }; + /** Format: date-time */ + dtend?: string; + }[]; + deploymentVersionSelector?: components["schemas"]["DeploymentVersionSelector"]; + versionAnyApprovals?: { + requiredApprovalsCount?: number; + }[]; + versionUserApprovals?: components["schemas"]["VersionUserApproval"][]; + versionRoleApprovals?: { + roleId: string; + requiredApprovalsCount?: number; + }[]; + }; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Policy"]; + }; + }; + /** @description Policy not found */ + 404: { + 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": { - deploymentId: string; - name: string; - description?: string | null; - versionSelector: { - [key: string]: unknown; - }; + getReleaseTargetsForPolicy: { + parameters: { + query?: never; + header?: never; + path: { + /** @description UUID of the policy */ + policyId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + releaseTargets?: components["schemas"]["ReleaseTarget"][]; + count?: number; + }; + }; + }; + /** @description Internal Server Error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; }; - }; }; - responses: { - /** @description Deployment version 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; - versionSelector?: { - [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 Deployment version channel already exists */ - 409: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - id: string; - }; + upsertPolicy: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + name: string; + description?: string; + priority?: number; + enabled?: boolean; + workspaceId: string; + targets: components["schemas"]["PolicyTarget"][]; + denyWindows?: { + timeZone: string; + rrule?: { + [key: string]: unknown; + }; + /** Format: date-time */ + dtend?: string; + }[]; + deploymentVersionSelector?: components["schemas"]["DeploymentVersionSelector"]; + versionAnyApprovals?: { + requiredApprovalsCount?: number; + }[]; + versionUserApprovals?: components["schemas"]["VersionUserApproval"][]; + versionRoleApprovals?: { + roleId: string; + requiredApprovalsCount?: number; + }[]; + }; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Policy1"]; + }; + }; + /** @description Internal Server Error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; }; - }; - /** @description Failed to create deployment version channel */ - 500: { - headers: { - [name: string]: unknown; + }; + 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; + }; + }; }; - content: { - "application/json": { - error: 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; + }; + }; + }; }; - }; - }; - }; - updateDeploymentVersion: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The deployment version ID */ - deploymentVersionId: string; - }; - cookie?: never; }; - requestBody: { - content: { - "application/json": { - tag?: string; - deploymentId?: string; - /** Format: date-time */ - createdAt?: string; - name?: string; - config?: { - [key: string]: unknown; - }; - jobAgentConfig?: { - [key: string]: unknown; - }; - /** @enum {string} */ - status?: "ready" | "building" | "failed"; - message?: string; - metadata?: { - [key: string]: string; - }; + 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 OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["DeploymentVersion"]; - }; - }; - /** @description Deployment version not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - }; - }; - upsertDeploymentVersion: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - tag: string; - deploymentId: string; - /** Format: date-time */ - createdAt?: string; - name?: string; - config?: { - [key: string]: unknown; - }; - jobAgentConfig?: { - [key: string]: unknown; - }; - /** @enum {string} */ - status?: "ready" | "building" | "failed"; - message?: string; - metadata?: { - [key: string]: 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; + }; + }; + }; }; - }; - }; - responses: { - /** @description OK */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["DeploymentVersion"]; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - }; - }; - deleteDeploymentVersionChannel: { - parameters: { - query?: never; - header?: never; - path: { - deploymentId: string; - name: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Deployment version 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 Deployment version channel not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description Failed to delete deployment version channel */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; - }; - getDeployment: { - parameters: { - query?: never; - header?: never; - path: { - deploymentId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Deployment found */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Deployment"]; - }; - }; - /** @description Deployment not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; - }; - deleteDeployment: { - parameters: { - query?: never; - header?: never; - path: { - deploymentId: string; - }; - cookie?: never; }; - requestBody?: never; - responses: { - /** @description Deployment deleted */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Deployment"]; - }; - }; - /** @description Deployment not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description Failed to delete deployment */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; - }; - updateDeployment: { - parameters: { - query?: never; - header?: never; - path: { - deploymentId: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - name?: string; - slug?: string; - description?: string; - /** Format: uuid */ - systemId?: string; - /** Format: uuid */ - jobAgentId?: string | null; - jobAgentConfig?: { - [key: string]: unknown; - }; - retryCount?: number; - timeout?: number | null; - resourceSelector?: { - [key: string]: unknown; - } | null; + createReleaseChannel: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + deploymentId: string; + name: string; + description?: string | null; + releaseSelector: { + [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; + releaseSelector?: { + [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 Deployment updated */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Deployment"]; - }; - }; - /** @description Deployment not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description Failed to update deployment */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; - }; - 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; - }; - }; - }; - }; - }; - getResourcesForDeployment: { - parameters: { - query?: never; - header?: never; - path: { - /** @description UUID of the deployment */ - deploymentId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - resources?: components["schemas"]["Resource"][]; - count?: number; - }; - }; - }; - /** @description Internal Server Error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - }; - }; - getDeploymentVariables: { - parameters: { - query?: never; - header?: never; - path: { - deploymentId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Variables fetched successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["DeploymentVariable"][]; - }; - }; - /** @description Deployment not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description Failed to fetch variables */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; - }; - createDeploymentVariable: { - parameters: { - query?: never; - header?: never; - path: { - deploymentId: string; - }; - cookie?: never; }; - requestBody?: { - content: { - "application/json": { - key: string; - description?: string; - config: { - [key: string]: unknown; - }; - values?: { - value: unknown; - sensitive?: boolean; - resourceSelector?: { - [key: string]: unknown; - } | null; - default?: boolean; - }[]; + getReleaseTargetReleases: { + parameters: { + query?: never; + header?: never; + path: { + releaseTargetId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The latest 100 releases for the release target */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + deployment: components["schemas"]["Deployment"]; + version: components["schemas"]["DeploymentVersion"]; + variables: { + key: string; + value: string; + }[]; + }[]; + }; + }; + /** @description The release target was not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description An internal server error occurred */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; }; - }; }; - responses: { - /** @description Variable created successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["DeploymentVariable"]; - }; - }; - /** @description Invalid request body */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description Deployment not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description Failed to create variable */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; + updateRelease: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The release ID */ + releaseId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + version?: string; + deploymentId?: string; + /** Format: date-time */ + createdAt?: string; + name?: string; + config?: { + [key: string]: unknown; + }; + jobAgentConfig?: { + [key: string]: unknown; + }; + /** @enum {string} */ + status?: "ready" | "building" | "failed"; + message?: string; + metadata?: { + [key: string]: string; + }; + }; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Release"]; + }; + }; + }; }; - }; - createDeployment: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; + upsertRelease: { + 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; + }; + jobAgentConfig?: { + [key: string]: unknown; + }; + /** @enum {string} */ + status?: "ready" | "building" | "failed"; + message?: string; + metadata?: { + [key: string]: string; + }; + }; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Release"]; + }; + }; + /** @description Release already exists */ + 409: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + id?: string; + }; + }; + }; + }; }; - requestBody?: { - content: { - "application/json": { - /** - * Format: uuid - * @description The ID of the system to create the deployment for - * @example 123e4567-e89b-12d3-a456-426614174000 - */ - systemId: string; - /** - * @description The name of the deployment - * @example My Deployment - */ - name: string; - /** - * @description The slug of the deployment - * @example my-deployment - */ - slug: string; - /** - * @description The description of the deployment - * @example This is a deployment for my system - */ - description?: string; - /** - * Format: uuid - * @description The ID of the job agent to use for the deployment - * @example 123e4567-e89b-12d3-a456-426614174000 - */ - jobAgentId?: string; - /** - * @description The configuration for the job agent - * @example { - * "key": "value" - * } - */ - jobAgentConfig?: Record; - /** - * @description The number of times to retry the deployment - * @example 3 - */ - retryCount?: number; - /** - * @description The timeout for the deployment - * @example 60 - */ - timeout?: number; - /** - * @description The resource selector for the deployment - * @example { - * "key": "value" - * } - */ - resourceSelector?: { - [key: string]: unknown; - }; + 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; + }; + }[]; + }; + }; + }; + responses: { + /** @description Successfully updated the deployment resources */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + resources?: { + ignored?: { + identifier?: string; + name?: string; + version?: string; + kind?: string; + workspaceId?: string; + }[]; + inserted?: { + id?: string; + name?: string; + version?: string; + kind?: string; + config?: { + [key: string]: unknown; + }; + }[]; + updated?: { + id?: string; + name?: string; + version?: string; + kind?: string; + config?: { + [key: string]: unknown; + }; + }[]; + deleted?: { + id?: string; + name?: string; + version?: string; + kind?: string; + config?: { + [key: string]: unknown; + }; + }[]; + }; + }; + }; + }; + /** @description Invalid request */ + 400: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Deployment resources not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; - }; }; - responses: { - /** @description Deployment created */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Deployment"]; - }; - }; - /** @description Deployment already exists */ - 409: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - /** Format: uuid */ - id: string; - }; + updateResourceRelationshipRule: { + parameters: { + query?: never; + header?: never; + path: { + ruleId: string; + }; + cookie?: never; }; - }; - /** @description Failed to create deployment */ - 500: { - headers: { - [name: string]: unknown; + requestBody?: { + content: { + "application/json": components["schemas"]["UpdateResourceRelationshipRule"]; + }; }; - content: { - "application/json": { - error: string; - }; + responses: { + /** @description The updated resource relationship rule */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ResourceRelationshipRule"]; + }; + }; + /** @description The resource relationship rule was not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description An error occurred while updating the resource relationship rule */ + 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": components["schemas"]["Environment"]; - }; - }; - /** @description Environment not found */ - 404: { - headers: { - [name: string]: unknown; - }; - 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; - }; }; - }; - getResourcesForEnvironment: { - parameters: { - query?: never; - header?: never; - path: { - /** @description UUID of the environment */ - environmentId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - resources?: components["schemas"]["Resource"][]; - count?: number; - }; - }; - }; - /** @description Internal Server Error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - }; - }; - createEnvironment: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - /** - * @description The directory path of the environment - * @default - * @example my/env/path - */ - directory?: string; - systemId: string; - name: string; - description?: string; - resourceSelector?: { - [key: string]: unknown; - }; - policyId?: string; - releaseChannels?: string[]; - deploymentVersionChannels?: string[]; - metadata?: { - [key: string]: string; - }; + createResourceRelationshipRule: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - }; - }; - responses: { - /** @description Environment created successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Environment"]; - }; - }; - /** @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; - }; - }; - }; - }; - }; - getAgentRunningJobs: { - 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": { - jobs: components["schemas"]["Job"][]; - }; - }; - }; - }; - }; - 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?: components["schemas"]["Job"]; - }; - }; - }; - /** @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?: components["schemas"]["Job"][]; - }; - }; - }; - }; - }; - upsertJobAgent: { - 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; - }; + requestBody: { + content: { + "application/json": components["schemas"]["CreateResourceRelationshipRule"]; + }; }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; + responses: { + /** @description Resource relationship rule created successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ResourceRelationshipRule"]; + }; + }; + /** @description Resource relationship rule already exists */ + 409: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + /** @description Failed to create resource relationship rule */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; }; - content?: never; - }; - }; - }; - 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; - }; - }; - }; - }; - }; - 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"]["JobWithTrigger"]; - }; - }; - /** @description Not Found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Job not found. */ - error?: string; - }; - }; - }; }; - }; - updateJob: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The execution ID */ - jobId: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - status?: components["schemas"]["JobStatus"]; - message?: string | null; - externalId?: string | null; - }; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - id: string; - }; + createResourceSchema: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** + * Format: uuid + * @description The ID of the workspace + */ + workspaceId: string; + /** @description Version of the schema */ + version: string; + /** @description Kind of resource this schema is for */ + kind: string; + /** @description The JSON schema definition */ + jsonSchema: Record; + }; + }; }; - }; - }; - }; - deletePolicy: { - parameters: { - query?: never; - header?: never; - path: { - policyId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - count?: number; - }; - }; - }; - /** @description Internal Server Error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - }; - }; - updatePolicy: { - parameters: { - query?: never; - header?: never; - path: { - policyId: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - name?: string; - description?: string; - priority?: number; - enabled?: boolean; - workspaceId?: string; - targets?: components["schemas"]["PolicyTarget"][]; - denyWindows?: { - timeZone: string; - rrule?: { - [key: string]: unknown; + responses: { + /** @description Resource schema created successfully */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** Format: uuid */ + id?: string; + /** Format: uuid */ + workspaceId?: string; + version?: string; + kind?: string; + jsonSchema?: Record; + }; + }; + }; + /** @description Invalid request body */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + /** @description Schema already exists for this version and kind */ + 409: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + /** Format: uuid */ + id?: string; + }; + }; }; - /** Format: date-time */ - dtend?: string; - }[]; - deploymentVersionSelector?: components["schemas"]["DeploymentVersionSelector"]; - versionAnyApprovals?: { - requiredApprovalsCount?: number; - }[]; - versionUserApprovals?: components["schemas"]["VersionUserApproval"][]; - versionRoleApprovals?: { - roleId: string; - requiredApprovalsCount?: number; - }[]; }; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Policy"]; - }; - }; - /** @description Policy not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - /** @description Internal Server Error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - }; - }; - getReleaseTargetsForPolicy: { - parameters: { - query?: never; - header?: never; - path: { - /** @description UUID of the policy */ - policyId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - releaseTargets?: components["schemas"]["ReleaseTarget"][]; - count?: number; - }; - }; - }; - /** @description Internal Server Error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; }; - }; - upsertPolicy: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - name: string; - description?: string; - priority?: number; - enabled?: boolean; - workspaceId: string; - targets: components["schemas"]["PolicyTarget"][]; - denyWindows?: { - timeZone: string; - rrule?: { - [key: string]: unknown; + deleteResourceSchema: { + parameters: { + query?: never; + header?: never; + path: { + /** @description UUID of the schema to delete */ + schemaId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Schema deleted successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** Format: uuid */ + id?: string; + }; + }; + }; + /** @description Schema not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Schema not found */ + error?: string; + }; + }; }; - /** Format: date-time */ - dtend?: string; - }[]; - deploymentVersionSelector?: components["schemas"]["DeploymentVersionSelector"]; - versionAnyApprovals?: { - requiredApprovalsCount?: number; - }[]; - versionUserApprovals?: components["schemas"]["VersionUserApproval"][]; - versionRoleApprovals?: { - roleId: string; - requiredApprovalsCount?: number; - }[]; }; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Policy1"]; - }; - }; - /** @description Internal Server Error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - 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; - }; - 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; - }; - }; - }; - }; - }; - createReleaseChannel: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - deploymentId: string; - name: string; - description?: string | null; - releaseSelector: { - [key: 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": components["schemas"]["ResourceWithVariablesAndMetadata"]; + }; + }; + /** @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; + }; + }; + }; }; - }; }; - 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; - releaseSelector?: { - [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; - }; + 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; + }; + }; + }; }; - }; - /** @description Failed to create release channel */ - 500: { - headers: { - [name: string]: unknown; + }; + 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?: components["schemas"]["MetadataMap"]; + variables?: components["schemas"]["DirectVariable"][]; + }; + }; }; - content: { - "application/json": { - error: string; - }; + responses: { + /** @description Resource updated successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ResourceWithVariablesAndMetadata"]; + }; + }; + /** @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; + }; + }; + }; }; - }; - }; - }; - getReleaseTargetReleases: { - parameters: { - query?: never; - header?: never; - path: { - releaseTargetId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description The latest 100 releases for the release target */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - deployment: components["schemas"]["Deployment"]; - version: components["schemas"]["DeploymentVersion"]; - variables: { - key: string; - value: string; - }[]; - }[]; - }; - }; - /** @description The release target was not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description An internal server error occurred */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; - }; - updateRelease: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The release ID */ - releaseId: string; - }; - cookie?: never; }; - requestBody: { - content: { - "application/json": { - version?: string; - deploymentId?: string; - /** Format: date-time */ - createdAt?: string; - name?: string; - config?: { - [key: string]: unknown; - }; - jobAgentConfig?: { - [key: string]: unknown; - }; - /** @enum {string} */ - status?: "ready" | "building" | "failed"; - message?: string; - metadata?: { - [key: string]: string; - }; + getReleaseTargets: { + 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": components["schemas"]["ReleaseTarget"][]; + }; + }; }; - }; }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; + upsertResource: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** Format: uuid */ + workspaceId: string; + name: string; + kind: string; + identifier: string; + version: string; + config: Record; + metadata?: { + [key: string]: string; + }; + variables?: components["schemas"]["Variable"][]; + }; + }; }; - content: { - "application/json": components["schemas"]["Release"]; + responses: { + /** @description The created or updated resource */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Resource"]; + }; + }; }; - }; }; - }; - upsertRelease: { - 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; - }; - jobAgentConfig?: { - [key: string]: unknown; - }; - /** @enum {string} */ - status?: "ready" | "building" | "failed"; - message?: string; - metadata?: { - [key: string]: 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; + }; }; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Release"]; - }; - }; - /** @description Release already exists */ - 409: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - id?: string; - }; - }; - }; }; - }; - 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; + getSystem: { + parameters: { + query?: never; + header?: never; + path: { + /** @description UUID of the system */ + systemId: string; }; - metadata: { - [key: string]: string; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description System retrieved successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["System"] & { + environments?: components["schemas"]["Environment"][]; + deployments?: components["schemas"]["Deployment"][]; + }; + }; }; - }[]; }; - }; - }; - responses: { - /** @description Successfully updated the deployment resources */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - resources?: { - ignored?: { - identifier?: string; - name?: string; - version?: string; - kind?: string; - workspaceId?: string; - }[]; - inserted?: { - id?: string; - name?: string; - version?: string; - kind?: string; - config?: { - [key: string]: unknown; - }; - }[]; - updated?: { - id?: string; - name?: string; - version?: string; - kind?: string; - config?: { - [key: string]: unknown; - }; - }[]; - deleted?: { - id?: string; - name?: string; - version?: string; - kind?: string; - config?: { - [key: string]: unknown; - }; - }[]; - }; - }; - }; - }; - /** @description Invalid request */ - 400: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Deployment resources not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; - }; - updateResourceRelationshipRule: { - parameters: { - query?: never; - header?: never; - path: { - ruleId: string; - }; - cookie?: never; - }; - requestBody?: { - content: { - "application/json": components["schemas"]["UpdateResourceRelationshipRule"]; - }; - }; - responses: { - /** @description The updated resource relationship rule */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ResourceRelationshipRule"]; - }; - }; - /** @description The resource relationship rule was not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description An error occurred while updating the resource relationship rule */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; - }; - createResourceRelationshipRule: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; }; - requestBody: { - content: { - "application/json": components["schemas"]["CreateResourceRelationshipRule"]; - }; - }; - responses: { - /** @description Resource relationship rule created successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ResourceRelationshipRule"]; - }; - }; - /** @description Resource relationship rule already exists */ - 409: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - /** @description Failed to create resource relationship rule */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - }; - }; - createResourceSchema: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - /** - * Format: uuid - * @description The ID of the workspace - */ - workspaceId: string; - /** @description Version of the schema */ - version: string; - /** @description Kind of resource this schema is for */ - kind: string; - /** @description The JSON schema definition */ - jsonSchema: Record; - }; - }; - }; - responses: { - /** @description Resource schema created successfully */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** Format: uuid */ - id?: string; - /** Format: uuid */ - workspaceId?: string; - version?: string; - kind?: string; - jsonSchema?: Record; - }; - }; - }; - /** @description Invalid request body */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - /** @description Schema already exists for this version and kind */ - 409: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - /** Format: uuid */ - id?: string; - }; + deleteSystem: { + parameters: { + query?: never; + header?: never; + path: { + systemId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description System deleted successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example System deleted */ + message?: string; + }; + }; + }; + /** @description System not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example System not found */ + error?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Internal server error */ + error?: string; + }; + }; + }; }; - }; - }; - }; - deleteResourceSchema: { - parameters: { - query?: never; - header?: never; - path: { - /** @description UUID of the schema to delete */ - schemaId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Schema deleted successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** Format: uuid */ - id?: string; - }; - }; - }; - /** @description Schema not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Schema not found */ - error?: string; - }; - }; - }; - }; - }; - 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": components["schemas"]["ResourceWithVariablesAndMetadata"]; - }; - }; - /** @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?: components["schemas"]["MetadataMap"]; - variables?: components["schemas"]["DirectVariable"][]; - }; - }; - }; - responses: { - /** @description Resource updated successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ResourceWithVariablesAndMetadata"]; - }; - }; - /** @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; - }; - }; - }; - }; - }; - getReleaseTargets: { - 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": components["schemas"]["ReleaseTarget"][]; + updateSystem: { + parameters: { + query?: never; + header?: never; + path: { + /** @description UUID of the system */ + systemId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description Name of the system */ + name?: string; + /** @description Slug of the system */ + slug?: string; + /** @description Description of the system */ + description?: string; + /** + * Format: uuid + * @description UUID of the workspace + */ + workspaceId?: string; + }; + }; }; - }; - }; - }; - upsertResource: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - /** Format: uuid */ - workspaceId: string; - name: string; - kind: string; - identifier: string; - version: string; - config: Record; - metadata?: { - [key: string]: string; - }; - variables?: components["schemas"]["Variable"][]; + responses: { + /** @description System updated successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["System"]; + }; + }; + /** @description System not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example System not found */ + error?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Internal server error */ + error?: string; + }; + }; + }; }; - }; }; - responses: { - /** @description The created or updated resource */ - 200: { - headers: { - [name: string]: unknown; + createSystem: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: { + content: { + "application/json": { + /** + * Format: uuid + * @description The workspace ID of the system + */ + workspaceId: string; + /** @description The name of the system */ + name: string; + /** @description The slug of the system */ + slug: string; + /** @description The description of the system */ + description?: string; + }; + }; }; - content: { - "application/json": components["schemas"]["Resource"]; + responses: { + /** @description System created successfully */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["System"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: { + /** @enum {string} */ + code: "invalid_type" | "invalid_literal" | "custom"; + message: string; + path: (string | number)[]; + }[]; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Internal Server Error */ + error?: 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; - }; - }; - }; - 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": components["schemas"]["System"] & { - environments?: components["schemas"]["Environment"][]; - deployments?: components["schemas"]["Deployment"][]; - }; - }; - }; + listDeployments: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description All deployments */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + data?: components["schemas"]["Deployment"][]; + }; + }; + }; + }; }; - }; - deleteSystem: { - parameters: { - query?: never; - header?: never; - path: { - systemId: string; - }; - cookie?: never; + listEnvironments: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description All environments */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + data?: components["schemas"]["Environment"][]; + }; + }; + }; + }; }; - requestBody?: never; - responses: { - /** @description System deleted successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example System deleted */ - message?: string; - }; - }; - }; - /** @description System not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example System not found */ - error?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Internal server error */ - error?: string; - }; - }; - }; + getEventsByAction: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + action: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Events */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Event"][]; + }; + }; + /** @description Workspace not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; }; - }; - updateSystem: { - parameters: { - query?: never; - header?: never; - path: { - /** @description UUID of the system */ - systemId: string; - }; - cookie?: never; + getWorkspace: { + parameters: { + query?: never; + header?: never; + path: { + workspaceId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Workspace found */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Workspace"]; + }; + }; + /** @description Workspace not found */ + 404: { + 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": { - /** @description Name of the system */ - name?: string; - /** @description Slug of the system */ - slug?: string; - /** @description Description of the system */ - description?: string; - /** - * Format: uuid - * @description UUID of the workspace - */ - workspaceId?: string; - }; - }; + deletePolicyByName: { + parameters: { + query?: never; + header?: never; + path: { + /** @description ID of the workspace */ + workspaceId: string; + /** @description Name of the policy */ + name: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successfully deleted the policy */ + 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 Policy not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Policy not found */ + error?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; }; - responses: { - /** @description System updated successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["System"]; - }; - }; - /** @description System not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example System not found */ - error?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Internal server error */ - error?: 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; + }; + }; }; - }; - createSystem: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: 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": components["schemas"]["ResourceWithVariablesAndMetadata"] & { + relationships?: { + [key: string]: { + ruleId: string; + type: string; + reference: string; + target: components["schemas"]["Resource"]; + }; + }; + }; + }; + }; + /** @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; + }; + }; }; - requestBody?: { - content: { - "application/json": { - /** - * Format: uuid - * @description The workspace ID of the system - */ - workspaceId: string; - /** @description The name of the system */ - name: string; - /** @description The slug of the system */ - slug: string; - /** @description The description of the system */ - description?: string; - }; - }; + 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 System created successfully */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["System"]; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: { - /** @enum {string} */ - code: "invalid_type" | "invalid_literal" | "custom"; - message: string; - path: (string | number)[]; - }[]; - }; + getGroupedCounts: { + parameters: { + query?: never; + header?: never; + path: { + /** @description ID of the workspace */ + workspaceId: string; + }; + cookie?: never; }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; + requestBody: { + content: { + "application/json": { + metadataKeys: string[]; + allowNullCombinations: boolean; + }; + }; }; - content: { - "application/json": { - /** @example Internal Server Error */ - error?: string; - }; + responses: { + /** @description Success */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + keys: string[]; + combinations: { + metadata: { + [key: string]: string; + }; + resources: number; + }[]; + }; + }; + }; }; - }; - }; - }; - listDeployments: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description All deployments */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - data?: components["schemas"]["Deployment"][]; - }; - }; - }; - }; - }; - listEnvironments: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description All environments */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - data?: components["schemas"]["Environment"][]; - }; - }; - }; - }; - }; - getEventsByAction: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - action: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Events */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Event"][]; - }; - }; - /** @description Workspace not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; - }; - getWorkspace: { - parameters: { - query?: never; - header?: never; - path: { - workspaceId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Workspace found */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Workspace"]; - }; - }; - /** @description Workspace not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - }; - }; - deletePolicyByName: { - parameters: { - query?: never; - header?: never; - path: { - /** @description ID of the workspace */ - workspaceId: string; - /** @description Name of the policy */ - name: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successfully deleted the policy */ - 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 Policy not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Policy not found */ - error?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; - }; - 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": components["schemas"]["ResourceWithVariablesAndMetadata"] & { - relationships?: { - [key: string]: { - ruleId: string; - type: string; - reference: string; - target: components["schemas"]["Resource"]; - }; - }; - }; - }; - }; - /** @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; - }; - }; - }; - getGroupedCounts: { - parameters: { - query?: never; - header?: never; - path: { - /** @description ID of the workspace */ - workspaceId: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - metadataKeys: string[]; - allowNullCombinations: boolean; + listResources: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description All resources */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + resources?: components["schemas"]["Resource"][]; + }; + }; + }; }; - }; }; - responses: { - /** @description Success */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - keys: string[]; - combinations: { - metadata: { - [key: string]: string; - }; - resources: number; - }[]; - }; + listSystems: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description All systems */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + data?: components["schemas"]["System"][]; + }; + }; + }; }; - }; }; - }; - listResources: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description All resources */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - resources?: components["schemas"]["Resource"][]; - }; - }; - }; - }; - }; - listSystems: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description All systems */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - data?: components["schemas"]["System"][]; - }; - }; - }; - }; - }; - getWorkspaceBySlug: { - parameters: { - query?: never; - header?: never; - path: { - workspaceSlug: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Workspace found */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Workspace"]; - }; - }; - /** @description Workspace not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; + getWorkspaceBySlug: { + parameters: { + query?: never; + header?: never; + path: { + workspaceSlug: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Workspace found */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Workspace"]; + }; + }; + /** @description Workspace not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + }; }; - }; } type WithRequired = T & { - [P in K]-?: T[P]; + [P in K]-?: T[P]; }; diff --git a/e2e/tests/api/resource-relationships.spec.ts b/e2e/tests/api/resource-relationships.spec.ts index 7c85ddb58..981fd0647 100644 --- a/e2e/tests/api/resource-relationships.spec.ts +++ b/e2e/tests/api/resource-relationships.spec.ts @@ -93,7 +93,9 @@ test.describe("Resource Relationships API", () => { sourceVersion: "test-version/v1", targetKind: "Target", targetVersion: "test-version/v1", - metadataKeysEquals: [{ key: importedEntities.prefix, value: "true" }], + metadataTargetKeysEquals: [ + { key: importedEntities.prefix, value: "true" }, + ], }, }, ); diff --git a/openapi.v1.json b/openapi.v1.json index 8a7342a73..6f54c1d9e 100644 --- a/openapi.v1.json +++ b/openapi.v1.json @@ -5813,7 +5813,7 @@ "type": "string" } }, - "metadataKeysEquals": { + "metadataTargetKeysEquals": { "type": "array", "items": { "type": "object", @@ -5888,7 +5888,7 @@ "type": "string" } }, - "metadataKeysEquals": { + "metadataTargetKeysEquals": { "type": "array", "items": { "type": "object", @@ -5899,7 +5899,11 @@ "value": { "type": "string" } - } + }, + "required": [ + "key", + "value" + ] } } }, @@ -5952,7 +5956,7 @@ "type": "string" } }, - "metadataKeysEquals": { + "metadataTargetKeysEquals": { "type": "array", "items": { "type": "object", From e5d533838ca3be0adde597bc3c37c49eac03a016 Mon Sep 17 00:00:00 2001 From: Justin Brooks Date: Mon, 5 May 2025 22:28:14 -0400 Subject: [PATCH 5/5] fix format --- e2e/api/schema.ts | 8556 +++++++++++++++++++++++---------------------- 1 file changed, 4291 insertions(+), 4265 deletions(-) diff --git a/e2e/api/schema.ts b/e2e/api/schema.ts index f7707fc08..d0b73c6ed 100644 --- a/e2e/api/schema.ts +++ b/e2e/api/schema.ts @@ -4,4373 +4,4399 @@ */ export interface paths { - "/api/v1/cloud-locations/{provider}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get all regions for a specific cloud provider - * @description Returns geographic data for all regions of a specific cloud provider - */ - get: operations["getCloudProviderRegions"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/deployment-version-channels": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create a deployment version channel */ - post: operations["createDeploymentVersionChannel"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/deployment-versions/{deploymentVersionId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** Updates a deployment version */ - patch: operations["updateDeploymentVersion"]; - trace?: never; - }; - "/v1/deployment-versions": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Upserts a deployment version */ - post: operations["upsertDeploymentVersion"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/deployments/{deploymentId}/deployment-version-channels/name/{name}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** Delete a deployment version channel */ - delete: operations["deleteDeploymentVersionChannel"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/deployments/{deploymentId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get a deployment */ - get: operations["getDeployment"]; - put?: never; - post?: never; - /** Delete a deployment */ - delete: operations["deleteDeployment"]; - options?: never; - head?: never; - /** Update a deployment */ - patch: operations["updateDeployment"]; - 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/deployments/{deploymentId}/resources": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get resources for a deployment */ - get: operations["getResourcesForDeployment"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/deployments/{deploymentId}/variables": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get all variables for a deployment */ - get: operations["getDeploymentVariables"]; - put?: never; - /** Create a new variable for a deployment */ - post: operations["createDeploymentVariable"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/deployments": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create a deployment */ - post: operations["createDeployment"]; - delete?: never; - 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/{environmentId}/resources": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get resources for an environment */ - get: operations["getResourcesForEnvironment"]; - put?: never; - post?: never; - delete?: never; - 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["getAgentRunningJobs"]; - 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["upsertJobAgent"]; - 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/policies/{policyId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** Delete a policy */ - delete: operations["deletePolicy"]; - options?: never; - head?: never; - /** Update a policy */ - patch: operations["updatePolicy"]; - trace?: never; - }; - "/v1/policies/{policyId}/release-targets": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get release targets for a policy */ - get: operations["getReleaseTargetsForPolicy"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/policies": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Upsert a policy */ - post: operations["upsertPolicy"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - 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/release-targets/{releaseTargetId}/releases": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get the latest 100 releases for a release target */ - get: operations["getReleaseTargetReleases"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/releases/{releaseId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** Updates a release */ - patch: operations["updateRelease"]; - trace?: never; - }; - "/v1/releases": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Upserts a release */ - post: operations["upsertRelease"]; - 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/resource-relationship-rules/{ruleId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** Update a resource relationship rule */ - patch: operations["updateResourceRelationshipRule"]; - trace?: never; - }; - "/v1/resource-relationship-rules": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create a resource relationship rule */ - post: operations["createResourceRelationshipRule"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/resource-schemas": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create a resource schema */ - post: operations["createResourceSchema"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/resource-schemas/{schemaId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** Delete a resource schema */ - delete: operations["deleteResourceSchema"]; - options?: never; - head?: never; - patch?: never; - 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/{resourceId}/release-targets": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get release targets for a resource */ - get: operations["getReleaseTargets"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/resources": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create or update a resource */ - post: operations["upsertResource"]; - 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 a system */ - delete: operations["deleteSystem"]; - options?: never; - head?: never; - /** Update a system */ - patch: operations["updateSystem"]; - trace?: never; - }; - "/v1/systems": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create a system */ - post: operations["createSystem"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/workspaces/{workspaceId}/deployments": { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - }; - cookie?: never; - }; - /** List all deployments */ - get: operations["listDeployments"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/workspaces/{workspaceId}/environments": { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - }; - cookie?: never; - }; - /** List all environments */ - get: operations["listEnvironments"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/workspaces/{workspaceId}/events/{action}": { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - action: string; - }; - cookie?: never; - }; - /** Get events by action */ - get: operations["getEventsByAction"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/workspaces/{workspaceId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get a workspace */ - get: operations["getWorkspace"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/workspaces/{workspaceId}/policies/{name}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** Delete a policy by name */ - delete: operations["deletePolicyByName"]; - 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/workspaces/{workspaceId}/resources/metadata-grouped-counts": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Get grouped counts of resources */ - post: operations["getGroupedCounts"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/workspaces/{workspaceId}/resources": { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - }; - cookie?: never; - }; - /** List all resources */ - get: operations["listResources"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/workspaces/{workspaceId}/systems": { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - }; - cookie?: never; - }; - /** List all systems */ - get: operations["listSystems"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v1/workspaces/slug/{workspaceSlug}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get a workspace by slug */ - get: operations["getWorkspaceBySlug"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; + "/api/v1/cloud-locations/{provider}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; -} -export type webhooks = Record; -export interface components { - schemas: { - CloudRegionGeoData: { - /** - * @description Timezone of the region in UTC format - * @example UTC+1 - */ - timezone: string; - /** - * Format: float - * @description Latitude coordinate for the region - * @example 50.1109 - */ - latitude: number; - /** - * Format: float - * @description Longitude coordinate for the region - * @example 8.6821 - */ - longitude: number; - }; - DeploymentVariableValue: { - /** Format: uuid */ - id: string; - value: unknown; - sensitive: boolean; - resourceSelector: { - [key: string]: unknown; - } | null; - }; - DeploymentVariable: { - /** Format: uuid */ - id: string; - key: string; - description: string; - values: components["schemas"]["DeploymentVariableValue"][]; - defaultValue?: components["schemas"]["DeploymentVariableValue"]; - config: { - [key: string]: unknown; - }; - }; - JobWithTrigger: components["schemas"]["Job"] & { - release?: components["schemas"]["Release"]; - version?: components["schemas"]["DeploymentVersion"]; - deployment?: components["schemas"]["Deployment"]; - runbook?: components["schemas"]["Runbook"]; - resource?: components["schemas"]["ResourceWithVariablesAndMetadata"] & { - relationships?: { - [key: string]: components["schemas"]["Resource"]; - }; - }; - environment?: components["schemas"]["Environment"]; - variables: components["schemas"]["VariableMap"]; - 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; - }; - Workspace: { - /** - * Format: uuid - * @description The workspace ID - */ - id: string; - /** @description The name of the workspace */ - name: string; - /** @description The slug of the workspace */ - slug: string; - /** - * @description The email of the Google service account attached to the workspace - * @example ctrlplane@ctrlplane-workspace.iam.gserviceaccount.com - */ - googleServiceAccountEmail?: string | null; - /** - * @description The ARN of the AWS role attached to the workspace - * @example arn:aws:iam::123456789012:role/ctrlplane-workspace-role - */ - awsRoleArn?: string | null; - }; - System: { - /** - * Format: uuid - * @description The system ID - */ - id: string; - /** - * Format: uuid - * @description The workspace ID of the system - */ - workspaceId: string; - /** @description The name of the system */ - name: string; - /** @description The slug of the system */ - slug: string; - /** @description The description of the system */ - description?: string; - }; - Deployment: { - /** Format: uuid */ - id: string; - name: string; - slug: string; - description: string; - /** Format: uuid */ - systemId: string; - /** Format: uuid */ - jobAgentId?: string | null; - jobAgentConfig: { - [key: string]: unknown; - }; - retryCount?: number; - timeout?: number | null; - }; - /** @description Schema for updating a deployment (all fields optional) */ - UpdateDeployment: { - [key: string]: unknown; - } & (WithRequired & { - [key: string]: unknown; - }); - Release: { - /** Format: uuid */ - id: string; - name: string; - version: string; - config: { - [key: string]: unknown; - }; - jobAgentConfig: { - [key: string]: unknown; - }; - /** Format: uuid */ - deploymentId: string; - /** Format: date-time */ - createdAt: string; - metadata?: { - [key: string]: unknown; - }; - }; - DeploymentVersion: { - /** Format: uuid */ - id: string; - name: string; - tag: string; - config: { - [key: string]: unknown; - }; - jobAgentConfig: { - [key: string]: unknown; - }; - /** Format: uuid */ - deploymentId: string; - /** Format: date-time */ - createdAt: string; - metadata?: { - [key: string]: string; - }; - /** @enum {string} */ - status?: "building" | "ready" | "failed"; - }; - Policy: { - /** - * Format: uuid - * @description The policy ID - */ - id: string; - /** - * Format: uuid - * @description The system ID - */ - systemId: string; - /** @description The name of the policy */ - name: string; - /** @description The description of the policy */ - description?: string | null; - /** - * @description The approval requirement of the policy - * @enum {string} - */ - approvalRequirement: "manual" | "automatic"; - /** - * @description If a policy depends on an environment, whether or not the policy requires all, some, or optional successful releases in the environment - * @enum {string} - */ - successType: "some" | "all" | "optional"; - /** @description If a policy depends on an environment, the minimum number of successful releases in the environment */ - successMinimum: number; - /** @description The maximum number of concurrent releases in the environment */ - concurrencyLimit?: number | null; - /** @description The duration of the rollout in milliseconds */ - rolloutDuration: number; - /** @description The minimum interval between releases in milliseconds */ - minimumReleaseInterval: number; - /** - * @description If a new release is created, whether it will wait for the current release to finish before starting, or cancel the current release - * @enum {string} - */ - releaseSequencing: "wait" | "cancel"; - }; - Environment: { - /** Format: uuid */ - id: string; - /** Format: uuid */ - systemId: string; - name: string; - description?: string; - /** Format: uuid */ - policyId?: string | null; - resourceSelector?: { - [key: string]: unknown; - } | null; - /** - * @description The directory path of the environment - * @default - * @example my/env/path - */ - directory: string; - /** Format: date-time */ - createdAt: string; - metadata?: { - [key: string]: string; - }; - policy?: components["schemas"]["Policy"]; - }; - 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; - /** Format: uuid */ - providerId?: string; - }; - ResourceWithVariables: components["schemas"]["Resource"] & { - variables?: components["schemas"]["VariableMap"]; - }; - ResourceWithMetadata: components["schemas"]["Resource"] & { - metadata?: components["schemas"]["MetadataMap"]; - }; - ResourceWithVariablesAndMetadata: components["schemas"]["ResourceWithVariables"] & components["schemas"]["ResourceWithMetadata"]; - /** @enum {string} */ - JobStatus: "successful" | "cancelled" | "skipped" | "in_progress" | "action_required" | "pending" | "failure" | "invalid_job_agent" | "invalid_integration" | "external_run_not_found"; - Job: { - /** Format: uuid */ - id: string; - status: components["schemas"]["JobStatus"]; - /** @description External job identifier (e.g. GitHub workflow run ID) */ - externalId?: string | null; - /** Format: date-time */ - createdAt: string; - /** Format: date-time */ - updatedAt: string; - /** Format: date-time */ - startedAt?: string | null; - /** Format: date-time */ - completedAt?: string | null; - /** Format: uuid */ - jobAgentId?: string; - /** @description Configuration for the Job Agent */ - jobAgentConfig: { - [key: string]: unknown; - }; - message?: string; - reason?: string; - }; - MetadataMap: { - [key: string]: string; - }; - VariableMap: { - [key: string]: (string | boolean | number | Record | unknown[]) | null; - }; - ReferenceVariable: { - key: string; - reference: string; - path: string[]; - defaultValue?: string | number | boolean | Record | unknown[]; - }; - DirectVariable: { - key: string; - value: string | number | boolean | Record | unknown[]; - sensitive?: boolean; - }; - Variable: components["schemas"]["DirectVariable"] | components["schemas"]["ReferenceVariable"]; - PolicyTarget: { - deploymentSelector?: { - [key: string]: unknown; - } | null; - environmentSelector?: { - [key: string]: unknown; - } | null; - resourceSelector?: { - [key: string]: unknown; - } | null; - }; - DenyWindow: { - timeZone: string; - rrule: { - [key: string]: unknown; - }; - /** Format: date-time */ - dtend?: string; - }; - DeploymentVersionSelector: { - name: string; - deploymentVersionSelector: { - [key: string]: unknown; - }; - description?: string; - }; - VersionAnyApproval: { - requiredApprovalsCount: number; - }; - VersionUserApproval: { - userId: string; - }; - VersionRoleApproval: { - roleId: string; - requiredApprovalsCount: number; - }; - Policy1: { - /** Format: uuid */ - id: string; - name: string; - description?: string; - priority: number; - /** Format: date-time */ - createdAt: string; - enabled: boolean; - /** Format: uuid */ - workspaceId: string; - targets: components["schemas"]["PolicyTarget"][]; - denyWindows: components["schemas"]["DenyWindow"][]; - deploymentVersionSelector?: components["schemas"]["DeploymentVersionSelector"]; - versionAnyApprovals?: components["schemas"]["VersionAnyApproval"][]; - versionUserApprovals: components["schemas"]["VersionUserApproval"][]; - versionRoleApprovals: components["schemas"]["VersionRoleApproval"][]; - }; - UpdateResourceRelationshipRule: { - name?: string; - reference?: string; - dependencyType?: components["schemas"]["ResourceRelationshipRuleDependencyType"]; - dependencyDescription?: string; - description?: string; - sourceKind?: string; - sourceVersion?: string; - targetKind?: string; - targetVersion?: string; - metadataKeysMatch?: string[]; - metadataTargetKeysEquals?: { - key: string; - value: string; - }[]; - }; - /** @enum {string} */ - ResourceRelationshipRuleDependencyType: "depends_on" | "depends_indirectly_on" | "uses_at_runtime" | "created_after" | "provisioned_in" | "inherits_from"; - ResourceRelationshipRule: { - /** Format: uuid */ - id: string; - /** Format: uuid */ - workspaceId: string; - name: string; - reference: string; - dependencyType: components["schemas"]["ResourceRelationshipRuleDependencyType"]; - dependencyDescription?: string; - description?: string; - sourceKind: string; - sourceVersion: string; - targetKind?: string; - targetVersion?: string; - metadataKeysMatch?: string[]; - metadataTargetKeysEquals?: { - key: string; - value: string; - }[]; - }; - CreateResourceRelationshipRule: { - workspaceId: string; - name: string; - reference: string; - dependencyType: components["schemas"]["ResourceRelationshipRuleDependencyType"]; - dependencyDescription?: string; - description?: string; - sourceKind: string; - sourceVersion: string; - targetKind: string; - targetVersion: string; - metadataKeysMatch?: string[]; - metadataTargetKeysEquals?: { - key: string; - value: string; - }[]; - }; - ReleaseTarget: { - /** Format: uuid */ - id: string; - resource: components["schemas"]["Resource"]; - environment: components["schemas"]["Environment"]; - deployment: components["schemas"]["Deployment"]; - }; - Event: { - /** Format: uuid */ - id: string; - action: string; - payload: { - [key: string]: unknown; - }; - /** Format: date-time */ - createdAt: string; - }; + /** + * Get all regions for a specific cloud provider + * @description Returns geographic data for all regions of a specific cloud provider + */ + get: operations["getCloudProviderRegions"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/deployment-version-channels": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - responses: never; - parameters: never; - requestBodies: never; - headers: never; - pathItems: never; -} -export type $defs = Record; -export interface operations { - getCloudProviderRegions: { - parameters: { - query?: never; - header?: never; - path: { - /** @description Cloud provider (aws, gcp, azure) */ - provider: "aws" | "gcp" | "azure"; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successfully returned geographic data for cloud provider regions */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - [key: string]: components["schemas"]["CloudRegionGeoData"]; - }; - }; - }; - /** @description Cloud provider not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Cloud provider 'unknown' not found */ - error?: string; - }; - }; - }; - }; + get?: never; + put?: never; + /** Create a deployment version channel */ + post: operations["createDeploymentVersionChannel"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/deployment-versions/{deploymentVersionId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - createDeploymentVersionChannel: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - deploymentId: string; - name: string; - description?: string | null; - versionSelector: { - [key: string]: unknown; - }; - }; - }; - }; - responses: { - /** @description Deployment version 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; - versionSelector?: { - [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 Deployment version channel already exists */ - 409: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - id: string; - }; - }; - }; - /** @description Failed to create deployment version channel */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** Updates a deployment version */ + patch: operations["updateDeploymentVersion"]; + trace?: never; + }; + "/v1/deployment-versions": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - updateDeploymentVersion: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The deployment version ID */ - deploymentVersionId: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - tag?: string; - deploymentId?: string; - /** Format: date-time */ - createdAt?: string; - name?: string; - config?: { - [key: string]: unknown; - }; - jobAgentConfig?: { - [key: string]: unknown; - }; - /** @enum {string} */ - status?: "ready" | "building" | "failed"; - message?: string; - metadata?: { - [key: string]: string; - }; - }; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["DeploymentVersion"]; - }; - }; - /** @description Deployment version not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - }; + get?: never; + put?: never; + /** Upserts a deployment version */ + post: operations["upsertDeploymentVersion"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/deployments/{deploymentId}/deployment-version-channels/name/{name}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - upsertDeploymentVersion: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - tag: string; - deploymentId: string; - /** Format: date-time */ - createdAt?: string; - name?: string; - config?: { - [key: string]: unknown; - }; - jobAgentConfig?: { - [key: string]: unknown; - }; - /** @enum {string} */ - status?: "ready" | "building" | "failed"; - message?: string; - metadata?: { - [key: string]: string; - }; - }; - }; - }; - responses: { - /** @description OK */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["DeploymentVersion"]; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - }; + get?: never; + put?: never; + post?: never; + /** Delete a deployment version channel */ + delete: operations["deleteDeploymentVersionChannel"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/deployments/{deploymentId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - deleteDeploymentVersionChannel: { - parameters: { - query?: never; - header?: never; - path: { - deploymentId: string; - name: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Deployment version 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 Deployment version channel not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description Failed to delete deployment version channel */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; + /** Get a deployment */ + get: operations["getDeployment"]; + put?: never; + post?: never; + /** Delete a deployment */ + delete: operations["deleteDeployment"]; + options?: never; + head?: never; + /** Update a deployment */ + patch: operations["updateDeployment"]; + 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/deployments/{deploymentId}/resources": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get resources for a deployment */ + get: operations["getResourcesForDeployment"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/deployments/{deploymentId}/variables": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get all variables for a deployment */ + get: operations["getDeploymentVariables"]; + put?: never; + /** Create a new variable for a deployment */ + post: operations["createDeploymentVariable"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/deployments": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create a deployment */ + post: operations["createDeployment"]; + delete?: never; + 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/{environmentId}/resources": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get resources for an environment */ + get: operations["getResourcesForEnvironment"]; + put?: never; + post?: never; + delete?: never; + 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["getAgentRunningJobs"]; + 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["upsertJobAgent"]; + 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/policies/{policyId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** Delete a policy */ + delete: operations["deletePolicy"]; + options?: never; + head?: never; + /** Update a policy */ + patch: operations["updatePolicy"]; + trace?: never; + }; + "/v1/policies/{policyId}/release-targets": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get release targets for a policy */ + get: operations["getReleaseTargetsForPolicy"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/policies": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Upsert a policy */ + post: operations["upsertPolicy"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + 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/release-targets/{releaseTargetId}/releases": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the latest 100 releases for a release target */ + get: operations["getReleaseTargetReleases"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/releases/{releaseId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** Updates a release */ + patch: operations["updateRelease"]; + trace?: never; + }; + "/v1/releases": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Upserts a release */ + post: operations["upsertRelease"]; + 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/resource-relationship-rules/{ruleId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** Update a resource relationship rule */ + patch: operations["updateResourceRelationshipRule"]; + trace?: never; + }; + "/v1/resource-relationship-rules": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create a resource relationship rule */ + post: operations["createResourceRelationshipRule"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/resource-schemas": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create a resource schema */ + post: operations["createResourceSchema"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/resource-schemas/{schemaId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** Delete a resource schema */ + delete: operations["deleteResourceSchema"]; + options?: never; + head?: never; + patch?: never; + 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/{resourceId}/release-targets": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get release targets for a resource */ + get: operations["getReleaseTargets"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/resources": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create or update a resource */ + post: operations["upsertResource"]; + 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 a system */ + delete: operations["deleteSystem"]; + options?: never; + head?: never; + /** Update a system */ + patch: operations["updateSystem"]; + trace?: never; + }; + "/v1/systems": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create a system */ + post: operations["createSystem"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/{workspaceId}/deployments": { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + }; + cookie?: never; }; - getDeployment: { - parameters: { - query?: never; - header?: never; - path: { - deploymentId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Deployment found */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Deployment"]; - }; - }; - /** @description Deployment not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; + /** List all deployments */ + get: operations["listDeployments"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/{workspaceId}/environments": { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + }; + cookie?: never; }; - deleteDeployment: { - parameters: { - query?: never; - header?: never; - path: { - deploymentId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Deployment deleted */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Deployment"]; - }; - }; - /** @description Deployment not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description Failed to delete deployment */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; + /** List all environments */ + get: operations["listEnvironments"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/{workspaceId}/events/{action}": { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + action: string; + }; + cookie?: never; }; - updateDeployment: { - parameters: { - query?: never; - header?: never; - path: { - deploymentId: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - name?: string; - slug?: string; - description?: string; - /** Format: uuid */ - systemId?: string; - /** Format: uuid */ - jobAgentId?: string | null; - jobAgentConfig?: { - [key: string]: unknown; - }; - retryCount?: number; - timeout?: number | null; - resourceSelector?: { - [key: string]: unknown; - } | null; - }; - }; - }; - responses: { - /** @description Deployment updated */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Deployment"]; - }; - }; - /** @description Deployment not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description Failed to update deployment */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; + /** Get events by action */ + get: operations["getEventsByAction"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/{workspaceId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - 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; - }; - }; - }; - }; + /** Get a workspace */ + get: operations["getWorkspace"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/{workspaceId}/policies/{name}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - getResourcesForDeployment: { - parameters: { - query?: never; - header?: never; - path: { - /** @description UUID of the deployment */ - deploymentId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - resources?: components["schemas"]["Resource"][]; - count?: number; - }; - }; - }; - /** @description Internal Server Error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - }; + get?: never; + put?: never; + post?: never; + /** Delete a policy by name */ + delete: operations["deletePolicyByName"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/{workspaceId}/resource-providers/name/{name}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - getDeploymentVariables: { - parameters: { - query?: never; - header?: never; - path: { - deploymentId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Variables fetched successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["DeploymentVariable"][]; - }; - }; - /** @description Deployment not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description Failed to fetch variables */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; + /** 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; }; - createDeploymentVariable: { - parameters: { - query?: never; - header?: never; - path: { - deploymentId: string; - }; - cookie?: never; - }; - requestBody?: { - content: { - "application/json": { - key: string; - description?: string; - config: { - [key: string]: unknown; - }; - values?: { - value: unknown; - sensitive?: boolean; - resourceSelector?: { - [key: string]: unknown; - } | null; - default?: boolean; - }[]; - }; - }; - }; - responses: { - /** @description Variable created successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["DeploymentVariable"]; - }; - }; - /** @description Invalid request body */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description Deployment not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description Failed to create variable */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; + /** 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/workspaces/{workspaceId}/resources/metadata-grouped-counts": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - createDeployment: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: { - content: { - "application/json": { - /** - * Format: uuid - * @description The ID of the system to create the deployment for - * @example 123e4567-e89b-12d3-a456-426614174000 - */ - systemId: string; - /** - * @description The name of the deployment - * @example My Deployment - */ - name: string; - /** - * @description The slug of the deployment - * @example my-deployment - */ - slug: string; - /** - * @description The description of the deployment - * @example This is a deployment for my system - */ - description?: string; - /** - * Format: uuid - * @description The ID of the job agent to use for the deployment - * @example 123e4567-e89b-12d3-a456-426614174000 - */ - jobAgentId?: string; - /** - * @description The configuration for the job agent - * @example { - * "key": "value" - * } - */ - jobAgentConfig?: Record; - /** - * @description The number of times to retry the deployment - * @example 3 - */ - retryCount?: number; - /** - * @description The timeout for the deployment - * @example 60 - */ - timeout?: number; - /** - * @description The resource selector for the deployment - * @example { - * "key": "value" - * } - */ - resourceSelector?: { - [key: string]: unknown; - }; - }; - }; - }; - responses: { - /** @description Deployment created */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Deployment"]; - }; - }; - /** @description Deployment already exists */ - 409: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - /** Format: uuid */ - id: string; - }; - }; - }; - /** @description Failed to create deployment */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - }; + get?: never; + put?: never; + /** Get grouped counts of resources */ + post: operations["getGroupedCounts"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/{workspaceId}/resources": { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: 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": components["schemas"]["Environment"]; - }; - }; - /** @description Environment not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Environment not found */ - error: string; - }; - }; - }; - }; + /** List all resources */ + get: operations["listResources"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/{workspaceId}/systems": { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + }; + cookie?: never; }; - 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; - }; - }; + /** List all systems */ + get: operations["listSystems"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/v1/workspaces/slug/{workspaceSlug}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - getResourcesForEnvironment: { - parameters: { - query?: never; - header?: never; - path: { - /** @description UUID of the environment */ - environmentId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - resources?: components["schemas"]["Resource"][]; - count?: number; - }; - }; - }; - /** @description Internal Server Error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - }; + /** Get a workspace by slug */ + get: operations["getWorkspaceBySlug"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; +} +export type webhooks = Record; +export interface components { + schemas: { + CloudRegionGeoData: { + /** + * @description Timezone of the region in UTC format + * @example UTC+1 + */ + timezone: string; + /** + * Format: float + * @description Latitude coordinate for the region + * @example 50.1109 + */ + latitude: number; + /** + * Format: float + * @description Longitude coordinate for the region + * @example 8.6821 + */ + longitude: number; }; - createEnvironment: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - /** - * @description The directory path of the environment - * @default - * @example my/env/path - */ - directory?: string; - systemId: string; - name: string; - description?: string; - resourceSelector?: { - [key: string]: unknown; - }; - policyId?: string; - releaseChannels?: string[]; - deploymentVersionChannels?: string[]; - metadata?: { - [key: string]: string; - }; - }; - }; - }; - responses: { - /** @description Environment created successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Environment"]; - }; - }; - /** @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; - }; - }; - }; - }; + DeploymentVariableValue: { + /** Format: uuid */ + id: string; + value: unknown; + sensitive: boolean; + resourceSelector: { + [key: string]: unknown; + } | null; }; - getAgentRunningJobs: { - 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": { - jobs: components["schemas"]["Job"][]; - }; - }; - }; - }; + DeploymentVariable: { + /** Format: uuid */ + id: string; + key: string; + description: string; + values: components["schemas"]["DeploymentVariableValue"][]; + defaultValue?: components["schemas"]["DeploymentVariableValue"]; + config: { + [key: string]: unknown; + }; }; - 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?: components["schemas"]["Job"]; - }; - }; - }; - /** @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; - }; - }; - }; - }; + JobWithTrigger: components["schemas"]["Job"] & { + release?: components["schemas"]["Release"]; + version?: components["schemas"]["DeploymentVersion"]; + deployment?: components["schemas"]["Deployment"]; + runbook?: components["schemas"]["Runbook"]; + resource?: components["schemas"]["ResourceWithVariablesAndMetadata"] & { + relationships?: { + [key: string]: components["schemas"]["Resource"]; + }; + }; + environment?: components["schemas"]["Environment"]; + variables: components["schemas"]["VariableMap"]; + 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; }; - 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?: components["schemas"]["Job"][]; - }; - }; - }; - }; + Workspace: { + /** + * Format: uuid + * @description The workspace ID + */ + id: string; + /** @description The name of the workspace */ + name: string; + /** @description The slug of the workspace */ + slug: string; + /** + * @description The email of the Google service account attached to the workspace + * @example ctrlplane@ctrlplane-workspace.iam.gserviceaccount.com + */ + googleServiceAccountEmail?: string | null; + /** + * @description The ARN of the AWS role attached to the workspace + * @example arn:aws:iam::123456789012:role/ctrlplane-workspace-role + */ + awsRoleArn?: string | null; }; - upsertJobAgent: { - 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; - }; - }; + System: { + /** + * Format: uuid + * @description The system ID + */ + id: string; + /** + * Format: uuid + * @description The workspace ID of the system + */ + workspaceId: string; + /** @description The name of the system */ + name: string; + /** @description The slug of the system */ + slug: string; + /** @description The description of the system */ + description?: 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; - }; - }; - }; - }; + Deployment: { + /** Format: uuid */ + id: string; + name: string; + slug: string; + description: string; + /** Format: uuid */ + systemId: string; + /** Format: uuid */ + jobAgentId?: string | null; + jobAgentConfig: { + [key: string]: unknown; + }; + retryCount?: number; + timeout?: number | null; }; - 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"]["JobWithTrigger"]; - }; - }; - /** @description Not Found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Job not found. */ - error?: string; - }; - }; - }; - }; + /** @description Schema for updating a deployment (all fields optional) */ + UpdateDeployment: { + [key: string]: unknown; + } & (WithRequired & { + [key: string]: unknown; + }); + Release: { + /** Format: uuid */ + id: string; + name: string; + version: string; + config: { + [key: string]: unknown; + }; + jobAgentConfig: { + [key: string]: unknown; + }; + /** Format: uuid */ + deploymentId: string; + /** Format: date-time */ + createdAt: string; + metadata?: { + [key: string]: unknown; + }; }; - updateJob: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The execution ID */ - jobId: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - status?: components["schemas"]["JobStatus"]; - message?: string | null; - externalId?: string | null; - }; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - id: string; - }; - }; - }; - }; + DeploymentVersion: { + /** Format: uuid */ + id: string; + name: string; + tag: string; + config: { + [key: string]: unknown; + }; + jobAgentConfig: { + [key: string]: unknown; + }; + /** Format: uuid */ + deploymentId: string; + /** Format: date-time */ + createdAt: string; + metadata?: { + [key: string]: string; + }; + /** @enum {string} */ + status?: "building" | "ready" | "failed"; }; - deletePolicy: { - parameters: { - query?: never; - header?: never; - path: { - policyId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - count?: number; - }; - }; - }; - /** @description Internal Server Error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - }; + Policy: { + /** + * Format: uuid + * @description The policy ID + */ + id: string; + /** + * Format: uuid + * @description The system ID + */ + systemId: string; + /** @description The name of the policy */ + name: string; + /** @description The description of the policy */ + description?: string | null; + /** + * @description The approval requirement of the policy + * @enum {string} + */ + approvalRequirement: "manual" | "automatic"; + /** + * @description If a policy depends on an environment, whether or not the policy requires all, some, or optional successful releases in the environment + * @enum {string} + */ + successType: "some" | "all" | "optional"; + /** @description If a policy depends on an environment, the minimum number of successful releases in the environment */ + successMinimum: number; + /** @description The maximum number of concurrent releases in the environment */ + concurrencyLimit?: number | null; + /** @description The duration of the rollout in milliseconds */ + rolloutDuration: number; + /** @description The minimum interval between releases in milliseconds */ + minimumReleaseInterval: number; + /** + * @description If a new release is created, whether it will wait for the current release to finish before starting, or cancel the current release + * @enum {string} + */ + releaseSequencing: "wait" | "cancel"; }; - updatePolicy: { - parameters: { - query?: never; - header?: never; - path: { - policyId: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - name?: string; - description?: string; - priority?: number; - enabled?: boolean; - workspaceId?: string; - targets?: components["schemas"]["PolicyTarget"][]; - denyWindows?: { - timeZone: string; - rrule?: { - [key: string]: unknown; - }; - /** Format: date-time */ - dtend?: string; - }[]; - deploymentVersionSelector?: components["schemas"]["DeploymentVersionSelector"]; - versionAnyApprovals?: { - requiredApprovalsCount?: number; - }[]; - versionUserApprovals?: components["schemas"]["VersionUserApproval"][]; - versionRoleApprovals?: { - roleId: string; - requiredApprovalsCount?: number; - }[]; - }; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Policy"]; - }; - }; - /** @description Policy not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - /** @description Internal Server Error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - }; + Environment: { + /** Format: uuid */ + id: string; + /** Format: uuid */ + systemId: string; + name: string; + description?: string; + /** Format: uuid */ + policyId?: string | null; + resourceSelector?: { + [key: string]: unknown; + } | null; + /** + * @description The directory path of the environment + * @default + * @example my/env/path + */ + directory: string; + /** Format: date-time */ + createdAt: string; + metadata?: { + [key: string]: string; + }; + policy?: components["schemas"]["Policy"]; }; - getReleaseTargetsForPolicy: { - parameters: { - query?: never; - header?: never; - path: { - /** @description UUID of the policy */ - policyId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - releaseTargets?: components["schemas"]["ReleaseTarget"][]; - count?: number; - }; - }; - }; - /** @description Internal Server Error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - }; + Runbook: { + /** Format: uuid */ + id: string; + name: string; + /** Format: uuid */ + systemId: string; + /** Format: uuid */ + jobAgentId: string; }; - upsertPolicy: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - name: string; - description?: string; - priority?: number; - enabled?: boolean; - workspaceId: string; - targets: components["schemas"]["PolicyTarget"][]; - denyWindows?: { - timeZone: string; - rrule?: { - [key: string]: unknown; - }; - /** Format: date-time */ - dtend?: string; - }[]; - deploymentVersionSelector?: components["schemas"]["DeploymentVersionSelector"]; - versionAnyApprovals?: { - requiredApprovalsCount?: number; - }[]; - versionUserApprovals?: components["schemas"]["VersionUserApproval"][]; - versionRoleApprovals?: { - roleId: string; - requiredApprovalsCount?: number; - }[]; - }; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Policy1"]; - }; - }; - /** @description Internal Server Error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: 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; + /** Format: uuid */ + providerId?: 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; - }; - }; - }; - }; + ResourceWithVariables: components["schemas"]["Resource"] & { + variables?: components["schemas"]["VariableMap"]; + }; + ResourceWithMetadata: components["schemas"]["Resource"] & { + metadata?: components["schemas"]["MetadataMap"]; + }; + ResourceWithVariablesAndMetadata: components["schemas"]["ResourceWithVariables"] & + components["schemas"]["ResourceWithMetadata"]; + /** @enum {string} */ + JobStatus: + | "successful" + | "cancelled" + | "skipped" + | "in_progress" + | "action_required" + | "pending" + | "failure" + | "invalid_job_agent" + | "invalid_integration" + | "external_run_not_found"; + Job: { + /** Format: uuid */ + id: string; + status: components["schemas"]["JobStatus"]; + /** @description External job identifier (e.g. GitHub workflow run ID) */ + externalId?: string | null; + /** Format: date-time */ + createdAt: string; + /** Format: date-time */ + updatedAt: string; + /** Format: date-time */ + startedAt?: string | null; + /** Format: date-time */ + completedAt?: string | null; + /** Format: uuid */ + jobAgentId?: string; + /** @description Configuration for the Job Agent */ + jobAgentConfig: { + [key: string]: unknown; + }; + message?: string; + reason?: string; + }; + MetadataMap: { + [key: string]: string; + }; + VariableMap: { + [key: string]: + | (string | boolean | number | Record | unknown[]) + | null; + }; + ReferenceVariable: { + key: string; + reference: string; + path: string[]; + defaultValue?: + | string + | number + | boolean + | Record + | unknown[]; + }; + DirectVariable: { + key: string; + value: string | number | boolean | Record | unknown[]; + sensitive?: boolean; + }; + Variable: + | components["schemas"]["DirectVariable"] + | components["schemas"]["ReferenceVariable"]; + PolicyTarget: { + deploymentSelector?: { + [key: string]: unknown; + } | null; + environmentSelector?: { + [key: string]: unknown; + } | null; + resourceSelector?: { + [key: string]: unknown; + } | null; + }; + DenyWindow: { + timeZone: string; + rrule: { + [key: string]: unknown; + }; + /** Format: date-time */ + dtend?: string; + }; + DeploymentVersionSelector: { + name: string; + deploymentVersionSelector: { + [key: string]: unknown; + }; + description?: string; }; - 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; - }; - }; - }; + VersionAnyApproval: { + requiredApprovalsCount: number; + }; + VersionUserApproval: { + userId: string; + }; + VersionRoleApproval: { + roleId: string; + requiredApprovalsCount: number; + }; + Policy1: { + /** Format: uuid */ + id: string; + name: string; + description?: string; + priority: number; + /** Format: date-time */ + createdAt: string; + enabled: boolean; + /** Format: uuid */ + workspaceId: string; + targets: components["schemas"]["PolicyTarget"][]; + denyWindows: components["schemas"]["DenyWindow"][]; + deploymentVersionSelector?: components["schemas"]["DeploymentVersionSelector"]; + versionAnyApprovals?: components["schemas"]["VersionAnyApproval"][]; + versionUserApprovals: components["schemas"]["VersionUserApproval"][]; + versionRoleApprovals: components["schemas"]["VersionRoleApproval"][]; + }; + UpdateResourceRelationshipRule: { + name?: string; + reference?: string; + dependencyType?: components["schemas"]["ResourceRelationshipRuleDependencyType"]; + dependencyDescription?: string; + description?: string; + sourceKind?: string; + sourceVersion?: string; + targetKind?: string; + targetVersion?: string; + metadataKeysMatch?: string[]; + metadataTargetKeysEquals?: { + key: string; + value: string; + }[]; + }; + /** @enum {string} */ + ResourceRelationshipRuleDependencyType: + | "depends_on" + | "depends_indirectly_on" + | "uses_at_runtime" + | "created_after" + | "provisioned_in" + | "inherits_from"; + ResourceRelationshipRule: { + /** Format: uuid */ + id: string; + /** Format: uuid */ + workspaceId: string; + name: string; + reference: string; + dependencyType: components["schemas"]["ResourceRelationshipRuleDependencyType"]; + dependencyDescription?: string; + description?: string; + sourceKind: string; + sourceVersion: string; + targetKind?: string; + targetVersion?: string; + metadataKeysMatch?: string[]; + metadataTargetKeysEquals?: { + key: string; + value: string; + }[]; + }; + CreateResourceRelationshipRule: { + workspaceId: string; + name: string; + reference: string; + dependencyType: components["schemas"]["ResourceRelationshipRuleDependencyType"]; + dependencyDescription?: string; + description?: string; + sourceKind: string; + sourceVersion: string; + targetKind: string; + targetVersion: string; + metadataKeysMatch?: string[]; + metadataTargetKeysEquals?: { + key: string; + value: string; + }[]; + }; + ReleaseTarget: { + /** Format: uuid */ + id: string; + resource: components["schemas"]["Resource"]; + environment: components["schemas"]["Environment"]; + deployment: components["schemas"]["Deployment"]; + }; + Event: { + /** Format: uuid */ + id: string; + action: string; + payload: { + [key: string]: unknown; + }; + /** Format: date-time */ + createdAt: string; + }; + }; + responses: never; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; +} +export type $defs = Record; +export interface operations { + getCloudProviderRegions: { + parameters: { + query?: never; + header?: never; + path: { + /** @description Cloud provider (aws, gcp, azure) */ + provider: "aws" | "gcp" | "azure"; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successfully returned geographic data for cloud provider regions */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + [key: string]: components["schemas"]["CloudRegionGeoData"]; + }; + }; + }; + /** @description Cloud provider not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Cloud provider 'unknown' not found */ + error?: string; + }; + }; + }; + }; + }; + createDeploymentVersionChannel: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + deploymentId: string; + name: string; + description?: string | null; + versionSelector: { + [key: string]: unknown; + }; }; + }; }; - createReleaseChannel: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - deploymentId: string; - name: string; - description?: string | null; - releaseSelector: { - [key: string]: unknown; - }; - }; - }; + responses: { + /** @description Deployment version 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; + versionSelector?: { + [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 Deployment version channel already exists */ + 409: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + id: string; + }; }; - 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; - releaseSelector?: { - [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; - }; - }; - }; + }; + /** @description Failed to create deployment version channel */ + 500: { + headers: { + [name: string]: unknown; }; - }; - getReleaseTargetReleases: { - parameters: { - query?: never; - header?: never; - path: { - releaseTargetId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description The latest 100 releases for the release target */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - deployment: components["schemas"]["Deployment"]; - version: components["schemas"]["DeploymentVersion"]; - variables: { - key: string; - value: string; - }[]; - }[]; - }; - }; - /** @description The release target was not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description An internal server error occurred */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; + content: { + "application/json": { + error: string; + }; }; + }; }; - updateRelease: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The release ID */ - releaseId: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - version?: string; - deploymentId?: string; - /** Format: date-time */ - createdAt?: string; - name?: string; - config?: { - [key: string]: unknown; - }; - jobAgentConfig?: { - [key: string]: unknown; - }; - /** @enum {string} */ - status?: "ready" | "building" | "failed"; - message?: string; - metadata?: { - [key: string]: string; - }; - }; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Release"]; - }; - }; + }; + updateDeploymentVersion: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The deployment version ID */ + deploymentVersionId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + tag?: string; + deploymentId?: string; + /** Format: date-time */ + createdAt?: string; + name?: string; + config?: { + [key: string]: unknown; + }; + jobAgentConfig?: { + [key: string]: unknown; + }; + /** @enum {string} */ + status?: "ready" | "building" | "failed"; + message?: string; + metadata?: { + [key: string]: string; + }; }; + }; }; - upsertRelease: { - 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; - }; - jobAgentConfig?: { - [key: string]: unknown; - }; - /** @enum {string} */ - status?: "ready" | "building" | "failed"; - message?: string; - metadata?: { - [key: string]: string; - }; - }; - }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DeploymentVersion"]; + }; + }; + /** @description Deployment version not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + }; + }; + upsertDeploymentVersion: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + tag: string; + deploymentId: string; + /** Format: date-time */ + createdAt?: string; + name?: string; + config?: { + [key: string]: unknown; + }; + jobAgentConfig?: { + [key: string]: unknown; + }; + /** @enum {string} */ + status?: "ready" | "building" | "failed"; + message?: string; + metadata?: { + [key: string]: string; + }; }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Release"]; - }; - }; - /** @description Release already exists */ - 409: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - id?: string; - }; - }; - }; + }; + }; + responses: { + /** @description OK */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DeploymentVersion"]; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + }; + }; + deleteDeploymentVersionChannel: { + parameters: { + query?: never; + header?: never; + path: { + deploymentId: string; + name: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Deployment version 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 Deployment version channel not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description Failed to delete deployment version channel */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; + }; + getDeployment: { + parameters: { + query?: never; + header?: never; + path: { + deploymentId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Deployment found */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Deployment"]; + }; + }; + /** @description Deployment not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; + }; + deleteDeployment: { + parameters: { + query?: never; + header?: never; + path: { + deploymentId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Deployment deleted */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Deployment"]; + }; + }; + /** @description Deployment not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description Failed to delete deployment */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; + }; + updateDeployment: { + parameters: { + query?: never; + header?: never; + path: { + deploymentId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + name?: string; + slug?: string; + description?: string; + /** Format: uuid */ + systemId?: string; + /** Format: uuid */ + jobAgentId?: string | null; + jobAgentConfig?: { + [key: string]: unknown; + }; + retryCount?: number; + timeout?: number | null; + resourceSelector?: { + [key: string]: unknown; + } | null; }; + }; }; - 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; - }; - }[]; - }; - }; + responses: { + /** @description Deployment updated */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Deployment"]; + }; + }; + /** @description Deployment not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description Failed to update deployment */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; + }; + 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; + }; + }; + }; + }; + }; + getResourcesForDeployment: { + parameters: { + query?: never; + header?: never; + path: { + /** @description UUID of the deployment */ + deploymentId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + resources?: components["schemas"]["Resource"][]; + count?: number; + }; + }; + }; + /** @description Internal Server Error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + }; + }; + getDeploymentVariables: { + parameters: { + query?: never; + header?: never; + path: { + deploymentId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Variables fetched successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DeploymentVariable"][]; + }; + }; + /** @description Deployment not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description Failed to fetch variables */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; + }; + createDeploymentVariable: { + parameters: { + query?: never; + header?: never; + path: { + deploymentId: string; + }; + cookie?: never; + }; + requestBody?: { + content: { + "application/json": { + key: string; + description?: string; + config: { + [key: string]: unknown; + }; + values?: { + value: unknown; + sensitive?: boolean; + resourceSelector?: { + [key: string]: unknown; + } | null; + default?: boolean; + }[]; }; - responses: { - /** @description Successfully updated the deployment resources */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - resources?: { - ignored?: { - identifier?: string; - name?: string; - version?: string; - kind?: string; - workspaceId?: string; - }[]; - inserted?: { - id?: string; - name?: string; - version?: string; - kind?: string; - config?: { - [key: string]: unknown; - }; - }[]; - updated?: { - id?: string; - name?: string; - version?: string; - kind?: string; - config?: { - [key: string]: unknown; - }; - }[]; - deleted?: { - id?: string; - name?: string; - version?: string; - kind?: string; - config?: { - [key: string]: unknown; - }; - }[]; - }; - }; - }; - }; - /** @description Invalid request */ - 400: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Deployment resources not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; + }; + }; + responses: { + /** @description Variable created successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DeploymentVariable"]; + }; + }; + /** @description Invalid request body */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description Deployment not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description Failed to create variable */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; + }; + createDeployment: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: { + content: { + "application/json": { + /** + * Format: uuid + * @description The ID of the system to create the deployment for + * @example 123e4567-e89b-12d3-a456-426614174000 + */ + systemId: string; + /** + * @description The name of the deployment + * @example My Deployment + */ + name: string; + /** + * @description The slug of the deployment + * @example my-deployment + */ + slug: string; + /** + * @description The description of the deployment + * @example This is a deployment for my system + */ + description?: string; + /** + * Format: uuid + * @description The ID of the job agent to use for the deployment + * @example 123e4567-e89b-12d3-a456-426614174000 + */ + jobAgentId?: string; + /** + * @description The configuration for the job agent + * @example { + * "key": "value" + * } + */ + jobAgentConfig?: Record; + /** + * @description The number of times to retry the deployment + * @example 3 + */ + retryCount?: number; + /** + * @description The timeout for the deployment + * @example 60 + */ + timeout?: number; + /** + * @description The resource selector for the deployment + * @example { + * "key": "value" + * } + */ + resourceSelector?: { + [key: string]: unknown; + }; }; + }; }; - updateResourceRelationshipRule: { - parameters: { - query?: never; - header?: never; - path: { - ruleId: string; - }; - cookie?: never; + responses: { + /** @description Deployment created */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Deployment"]; + }; + }; + /** @description Deployment already exists */ + 409: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + /** Format: uuid */ + id: string; + }; }; - requestBody?: { - content: { - "application/json": components["schemas"]["UpdateResourceRelationshipRule"]; - }; + }; + /** @description Failed to create deployment */ + 500: { + headers: { + [name: string]: unknown; }; - responses: { - /** @description The updated resource relationship rule */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ResourceRelationshipRule"]; - }; - }; - /** @description The resource relationship rule was not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description An error occurred while updating the resource relationship rule */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; + 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": components["schemas"]["Environment"]; + }; + }; + /** @description Environment not found */ + 404: { + headers: { + [name: string]: unknown; + }; + 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; + }; }; - createResourceRelationshipRule: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; + }; + getResourcesForEnvironment: { + parameters: { + query?: never; + header?: never; + path: { + /** @description UUID of the environment */ + environmentId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + resources?: components["schemas"]["Resource"][]; + count?: number; + }; + }; + }; + /** @description Internal Server Error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + }; + }; + createEnvironment: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** + * @description The directory path of the environment + * @default + * @example my/env/path + */ + directory?: string; + systemId: string; + name: string; + description?: string; + resourceSelector?: { + [key: string]: unknown; + }; + policyId?: string; + releaseChannels?: string[]; + deploymentVersionChannels?: string[]; + metadata?: { + [key: string]: string; + }; }; - requestBody: { - content: { - "application/json": components["schemas"]["CreateResourceRelationshipRule"]; - }; + }; + }; + responses: { + /** @description Environment created successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Environment"]; + }; + }; + /** @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; + }; + }; + }; + }; + }; + getAgentRunningJobs: { + 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": { + jobs: components["schemas"]["Job"][]; + }; + }; + }; + }; + }; + 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?: components["schemas"]["Job"]; + }; + }; + }; + /** @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?: components["schemas"]["Job"][]; + }; + }; + }; + }; + }; + upsertJobAgent: { + 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; + }; }; - responses: { - /** @description Resource relationship rule created successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ResourceRelationshipRule"]; - }; - }; - /** @description Resource relationship rule already exists */ - 409: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - /** @description Failed to create resource relationship rule */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; }; + content?: never; + }; }; - createResourceSchema: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - /** - * Format: uuid - * @description The ID of the workspace - */ - workspaceId: string; - /** @description Version of the schema */ - version: string; - /** @description Kind of resource this schema is for */ - kind: string; - /** @description The JSON schema definition */ - jsonSchema: Record; - }; - }; + }; + 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; + }; + }; + }; + }; + }; + 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"]["JobWithTrigger"]; + }; + }; + /** @description Not Found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Job not found. */ + error?: string; + }; + }; + }; + }; + }; + updateJob: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The execution ID */ + jobId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + status?: components["schemas"]["JobStatus"]; + message?: string | null; + externalId?: string | null; + }; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + id: string; + }; }; - responses: { - /** @description Resource schema created successfully */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** Format: uuid */ - id?: string; - /** Format: uuid */ - workspaceId?: string; - version?: string; - kind?: string; - jsonSchema?: Record; - }; - }; - }; - /** @description Invalid request body */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - /** @description Schema already exists for this version and kind */ - 409: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - /** Format: uuid */ - id?: string; - }; - }; + }; + }; + }; + deletePolicy: { + parameters: { + query?: never; + header?: never; + path: { + policyId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + count?: number; + }; + }; + }; + /** @description Internal Server Error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + }; + }; + updatePolicy: { + parameters: { + query?: never; + header?: never; + path: { + policyId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + name?: string; + description?: string; + priority?: number; + enabled?: boolean; + workspaceId?: string; + targets?: components["schemas"]["PolicyTarget"][]; + denyWindows?: { + timeZone: string; + rrule?: { + [key: string]: unknown; }; + /** Format: date-time */ + dtend?: string; + }[]; + deploymentVersionSelector?: components["schemas"]["DeploymentVersionSelector"]; + versionAnyApprovals?: { + requiredApprovalsCount?: number; + }[]; + versionUserApprovals?: components["schemas"]["VersionUserApproval"][]; + versionRoleApprovals?: { + roleId: string; + requiredApprovalsCount?: number; + }[]; }; + }; }; - deleteResourceSchema: { - parameters: { - query?: never; - header?: never; - path: { - /** @description UUID of the schema to delete */ - schemaId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Schema deleted successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** Format: uuid */ - id?: string; - }; - }; - }; - /** @description Schema not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Schema not found */ - error?: string; - }; - }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Policy"]; + }; + }; + /** @description Policy not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + /** @description Internal Server Error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + }; + }; + getReleaseTargetsForPolicy: { + parameters: { + query?: never; + header?: never; + path: { + /** @description UUID of the policy */ + policyId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + releaseTargets?: components["schemas"]["ReleaseTarget"][]; + count?: number; + }; + }; + }; + /** @description Internal Server Error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + }; + }; + upsertPolicy: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + name: string; + description?: string; + priority?: number; + enabled?: boolean; + workspaceId: string; + targets: components["schemas"]["PolicyTarget"][]; + denyWindows?: { + timeZone: string; + rrule?: { + [key: string]: unknown; }; + /** Format: date-time */ + dtend?: string; + }[]; + deploymentVersionSelector?: components["schemas"]["DeploymentVersionSelector"]; + versionAnyApprovals?: { + requiredApprovalsCount?: number; + }[]; + versionUserApprovals?: components["schemas"]["VersionUserApproval"][]; + versionRoleApprovals?: { + roleId: string; + requiredApprovalsCount?: number; + }[]; }; + }; }; - 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": components["schemas"]["ResourceWithVariablesAndMetadata"]; - }; - }; - /** @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; - }; - }; - }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Policy1"]; + }; + }; + /** @description Internal Server Error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + 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; + }; + 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; + }; + }; + }; + }; + }; + createReleaseChannel: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + deploymentId: string; + name: string; + description?: string | null; + releaseSelector: { + [key: string]: unknown; + }; }; + }; }; - 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; - }; - }; - }; + 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; + releaseSelector?: { + [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; + }; }; - }; - 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?: components["schemas"]["MetadataMap"]; - variables?: components["schemas"]["DirectVariable"][]; - }; - }; + }; + /** @description Failed to create release channel */ + 500: { + headers: { + [name: string]: unknown; }; - responses: { - /** @description Resource updated successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ResourceWithVariablesAndMetadata"]; - }; - }; - /** @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; - }; - }; - }; + content: { + "application/json": { + error: string; + }; }; + }; }; - getReleaseTargets: { - 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": components["schemas"]["ReleaseTarget"][]; - }; - }; + }; + getReleaseTargetReleases: { + parameters: { + query?: never; + header?: never; + path: { + releaseTargetId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The latest 100 releases for the release target */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + deployment: components["schemas"]["Deployment"]; + version: components["schemas"]["DeploymentVersion"]; + variables: { + key: string; + value: string; + }[]; + }[]; + }; + }; + /** @description The release target was not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description An internal server error occurred */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; + }; + updateRelease: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The release ID */ + releaseId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + version?: string; + deploymentId?: string; + /** Format: date-time */ + createdAt?: string; + name?: string; + config?: { + [key: string]: unknown; + }; + jobAgentConfig?: { + [key: string]: unknown; + }; + /** @enum {string} */ + status?: "ready" | "building" | "failed"; + message?: string; + metadata?: { + [key: string]: string; + }; }; + }; }; - upsertResource: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - /** Format: uuid */ - workspaceId: string; - name: string; - kind: string; - identifier: string; - version: string; - config: Record; - metadata?: { - [key: string]: string; - }; - variables?: components["schemas"]["Variable"][]; - }; - }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; }; - responses: { - /** @description The created or updated resource */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Resource"]; - }; - }; + content: { + "application/json": components["schemas"]["Release"]; }; + }; }; - 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; - }; - }; + }; + upsertRelease: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: 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": components["schemas"]["System"] & { - environments?: components["schemas"]["Environment"][]; - deployments?: components["schemas"]["Deployment"][]; - }; - }; - }; + requestBody: { + content: { + "application/json": { + version: string; + deploymentId: string; + /** Format: date-time */ + createdAt?: string; + name?: string; + config?: { + [key: string]: unknown; + }; + jobAgentConfig?: { + [key: string]: unknown; + }; + /** @enum {string} */ + status?: "ready" | "building" | "failed"; + message?: string; + metadata?: { + [key: string]: string; + }; }; + }; }; - deleteSystem: { - parameters: { - query?: never; - header?: never; - path: { - systemId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description System deleted successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example System deleted */ - message?: string; - }; - }; - }; - /** @description System not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example System not found */ - error?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Internal server error */ - error?: string; - }; - }; - }; - }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Release"]; + }; + }; + /** @description Release already exists */ + 409: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + id?: string; + }; + }; + }; }; - updateSystem: { - parameters: { - query?: never; - header?: never; - path: { - /** @description UUID of the system */ - systemId: string; + }; + 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; }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - /** @description Name of the system */ - name?: string; - /** @description Slug of the system */ - slug?: string; - /** @description Description of the system */ - description?: string; - /** - * Format: uuid - * @description UUID of the workspace - */ - workspaceId?: string; - }; + metadata: { + [key: string]: string; }; + }[]; }; - responses: { - /** @description System updated successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["System"]; - }; - }; - /** @description System not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example System not found */ - error?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Internal server error */ - error?: string; - }; - }; - }; + }; + }; + responses: { + /** @description Successfully updated the deployment resources */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + resources?: { + ignored?: { + identifier?: string; + name?: string; + version?: string; + kind?: string; + workspaceId?: string; + }[]; + inserted?: { + id?: string; + name?: string; + version?: string; + kind?: string; + config?: { + [key: string]: unknown; + }; + }[]; + updated?: { + id?: string; + name?: string; + version?: string; + kind?: string; + config?: { + [key: string]: unknown; + }; + }[]; + deleted?: { + id?: string; + name?: string; + version?: string; + kind?: string; + config?: { + [key: string]: unknown; + }; + }[]; + }; + }; + }; + }; + /** @description Invalid request */ + 400: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Deployment resources not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + updateResourceRelationshipRule: { + parameters: { + query?: never; + header?: never; + path: { + ruleId: string; + }; + cookie?: never; + }; + requestBody?: { + content: { + "application/json": components["schemas"]["UpdateResourceRelationshipRule"]; + }; + }; + responses: { + /** @description The updated resource relationship rule */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ResourceRelationshipRule"]; + }; + }; + /** @description The resource relationship rule was not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description An error occurred while updating the resource relationship rule */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; + }; + createResourceRelationshipRule: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["CreateResourceRelationshipRule"]; + }; + }; + responses: { + /** @description Resource relationship rule created successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ResourceRelationshipRule"]; + }; + }; + /** @description Resource relationship rule already exists */ + 409: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + /** @description Failed to create resource relationship rule */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + }; + }; + createResourceSchema: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** + * Format: uuid + * @description The ID of the workspace + */ + workspaceId: string; + /** @description Version of the schema */ + version: string; + /** @description Kind of resource this schema is for */ + kind: string; + /** @description The JSON schema definition */ + jsonSchema: Record; + }; + }; + }; + responses: { + /** @description Resource schema created successfully */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** Format: uuid */ + id?: string; + /** Format: uuid */ + workspaceId?: string; + version?: string; + kind?: string; + jsonSchema?: Record; + }; + }; + }; + /** @description Invalid request body */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + /** @description Schema already exists for this version and kind */ + 409: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + /** Format: uuid */ + id?: string; + }; }; + }; }; - createSystem: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: { - content: { - "application/json": { - /** - * Format: uuid - * @description The workspace ID of the system - */ - workspaceId: string; - /** @description The name of the system */ - name: string; - /** @description The slug of the system */ - slug: string; - /** @description The description of the system */ - description?: string; - }; - }; + }; + deleteResourceSchema: { + parameters: { + query?: never; + header?: never; + path: { + /** @description UUID of the schema to delete */ + schemaId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Schema deleted successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** Format: uuid */ + id?: string; + }; + }; + }; + /** @description Schema not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Schema not found */ + error?: string; + }; + }; + }; + }; + }; + 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": components["schemas"]["ResourceWithVariablesAndMetadata"]; + }; + }; + /** @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?: components["schemas"]["MetadataMap"]; + variables?: components["schemas"]["DirectVariable"][]; + }; + }; + }; + responses: { + /** @description Resource updated successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ResourceWithVariablesAndMetadata"]; + }; + }; + /** @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; + }; + }; + }; + }; + }; + getReleaseTargets: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The resource ID */ + resourceId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; }; - responses: { - /** @description System created successfully */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["System"]; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: { - /** @enum {string} */ - code: "invalid_type" | "invalid_literal" | "custom"; - message: string; - path: (string | number)[]; - }[]; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Internal Server Error */ - error?: string; - }; - }; - }; + content: { + "application/json": components["schemas"]["ReleaseTarget"][]; }; + }; }; - listDeployments: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description All deployments */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - data?: components["schemas"]["Deployment"][]; - }; - }; - }; - }; + }; + upsertResource: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - listEnvironments: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description All environments */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - data?: components["schemas"]["Environment"][]; - }; - }; - }; + requestBody: { + content: { + "application/json": { + /** Format: uuid */ + workspaceId: string; + name: string; + kind: string; + identifier: string; + version: string; + config: Record; + metadata?: { + [key: string]: string; + }; + variables?: components["schemas"]["Variable"][]; }; + }; }; - getEventsByAction: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - action: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Events */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Event"][]; - }; - }; - /** @description Workspace not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error: string; - }; - }; - }; + responses: { + /** @description The created or updated resource */ + 200: { + headers: { + [name: string]: unknown; }; - }; - getWorkspace: { - parameters: { - query?: never; - header?: never; - path: { - workspaceId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Workspace found */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Workspace"]; - }; - }; - /** @description Workspace not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; + content: { + "application/json": components["schemas"]["Resource"]; }; + }; }; - deletePolicyByName: { - parameters: { - query?: never; - header?: never; - path: { - /** @description ID of the workspace */ - workspaceId: string; - /** @description Name of the policy */ - name: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successfully deleted the policy */ - 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 Policy not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @example Policy not found */ - error?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; + }; + deleteEnvironmentByName: { + parameters: { + query?: never; + header?: never; + path: { + /** @description UUID of the system */ + systemId: string; + /** @description Name of the environment */ + name: string; + }; + cookie?: never; }; - 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; - }; - }; + requestBody?: never; + responses: { + /** @description Environment deleted successfully */ + 200: { + 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": components["schemas"]["ResourceWithVariablesAndMetadata"] & { - relationships?: { - [key: string]: { - ruleId: string; - type: string; - reference: string; - target: components["schemas"]["Resource"]; - }; - }; - }; - }; - }; - /** @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; - }; - }; + }; + getSystem: { + parameters: { + query?: never; + header?: never; + path: { + /** @description UUID of the system */ + systemId: string; + }; + cookie?: 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; - }; - }; + requestBody?: never; + responses: { + /** @description System retrieved successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["System"] & { + environments?: components["schemas"]["Environment"][]; + deployments?: components["schemas"]["Deployment"][]; + }; + }; + }; }; - getGroupedCounts: { - parameters: { - query?: never; - header?: never; - path: { - /** @description ID of the workspace */ - workspaceId: string; - }; - cookie?: never; + }; + deleteSystem: { + parameters: { + query?: never; + header?: never; + path: { + systemId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description System deleted successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example System deleted */ + message?: string; + }; + }; + }; + /** @description System not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example System not found */ + error?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Internal server error */ + error?: string; + }; + }; + }; + }; + }; + updateSystem: { + parameters: { + query?: never; + header?: never; + path: { + /** @description UUID of the system */ + systemId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description Name of the system */ + name?: string; + /** @description Slug of the system */ + slug?: string; + /** @description Description of the system */ + description?: string; + /** + * Format: uuid + * @description UUID of the workspace + */ + workspaceId?: string; + }; + }; + }; + responses: { + /** @description System updated successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["System"]; + }; + }; + /** @description System not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example System not found */ + error?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Internal server error */ + error?: string; + }; + }; + }; + }; + }; + createSystem: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: { + content: { + "application/json": { + /** + * Format: uuid + * @description The workspace ID of the system + */ + workspaceId: string; + /** @description The name of the system */ + name: string; + /** @description The slug of the system */ + slug: string; + /** @description The description of the system */ + description?: string; + }; + }; + }; + responses: { + /** @description System created successfully */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["System"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: { + /** @enum {string} */ + code: "invalid_type" | "invalid_literal" | "custom"; + message: string; + path: (string | number)[]; + }[]; + }; }; - requestBody: { - content: { - "application/json": { - metadataKeys: string[]; - allowNullCombinations: boolean; - }; - }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; }; - responses: { - /** @description Success */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - keys: string[]; - combinations: { - metadata: { - [key: string]: string; - }; - resources: number; - }[]; - }; - }; - }; + content: { + "application/json": { + /** @example Internal Server Error */ + error?: string; + }; }; + }; }; - listResources: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description All resources */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - resources?: components["schemas"]["Resource"][]; - }; - }; - }; - }; + }; + listDeployments: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + }; + cookie?: never; }; - listSystems: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the workspace */ - workspaceId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description All systems */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - data?: components["schemas"]["System"][]; - }; - }; - }; + requestBody?: never; + responses: { + /** @description All deployments */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + data?: components["schemas"]["Deployment"][]; + }; + }; + }; + }; + }; + listEnvironments: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description All environments */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + data?: components["schemas"]["Environment"][]; + }; + }; + }; + }; + }; + getEventsByAction: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + action: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Events */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Event"][]; + }; + }; + /** @description Workspace not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: string; + }; + }; + }; + }; + }; + getWorkspace: { + parameters: { + query?: never; + header?: never; + path: { + workspaceId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Workspace found */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Workspace"]; + }; + }; + /** @description Workspace not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + }; + }; + deletePolicyByName: { + parameters: { + query?: never; + header?: never; + path: { + /** @description ID of the workspace */ + workspaceId: string; + /** @description Name of the policy */ + name: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successfully deleted the policy */ + 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 Policy not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @example Policy not found */ + error?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + 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": components["schemas"]["ResourceWithVariablesAndMetadata"] & { + relationships?: { + [key: string]: { + ruleId: string; + type: string; + reference: string; + target: components["schemas"]["Resource"]; + }; + }; + }; + }; + }; + /** @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; + }; + }; + }; + getGroupedCounts: { + parameters: { + query?: never; + header?: never; + path: { + /** @description ID of the workspace */ + workspaceId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + metadataKeys: string[]; + allowNullCombinations: boolean; }; + }; }; - getWorkspaceBySlug: { - parameters: { - query?: never; - header?: never; - path: { - workspaceSlug: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Workspace found */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["Workspace"]; - }; - }; - /** @description Workspace not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - error?: string; - }; - }; - }; + responses: { + /** @description Success */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + keys: string[]; + combinations: { + metadata: { + [key: string]: string; + }; + resources: number; + }[]; + }; }; + }; + }; + }; + listResources: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description All resources */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + resources?: components["schemas"]["Resource"][]; + }; + }; + }; + }; + }; + listSystems: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the workspace */ + workspaceId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description All systems */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + data?: components["schemas"]["System"][]; + }; + }; + }; + }; + }; + getWorkspaceBySlug: { + parameters: { + query?: never; + header?: never; + path: { + workspaceSlug: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Workspace found */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Workspace"]; + }; + }; + /** @description Workspace not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error?: string; + }; + }; + }; }; + }; } type WithRequired = T & { - [P in K]-?: T[P]; + [P in K]-?: T[P]; };